/* (moved) Homepage summary options styles live below global .form-check rules */
/* Bootstrap 5 CSS Variable Overrides - Recapify Design System */
:root {
  /* Typography - Match Inter Variable font system */
  --bs-font-family-base: "InterVariable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --bs-font-size-base: 1rem;
  --bs-line-height-base: 1.5;
  --bs-font-weight-normal: 400;
  --bs-font-weight-bold: 700;
  
  /* Colors - Match Recapify palette */
  --bs-primary: #0a107d;
  --bs-primary-rgb: 10, 16, 125;
  --bs-secondary: #6c757d;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success: #1b6e37;
  --bs-success-rgb: 27, 110, 55;
  --bs-danger: #dc2626;
  --bs-danger-rgb: 220, 38, 38;
  --bs-warning: #d97706;
  --bs-warning-rgb: 217, 119, 6;
  --bs-info: #0dcaf0;
  --bs-info-rgb: 13, 202, 240;
  --bs-light: #f8f9fa;
  --bs-light-rgb: 248, 249, 250;
  --bs-dark: #212529;
  --bs-dark-rgb: 33, 37, 41;
  
  /* Contact card border opacities (tune these for intensity) */
  --contact-card-border-alpha-light: 0.30; /* e.g., 0.25, 0.30, 0.40 */
  --contact-card-border-alpha-dark: 0.40;  /* e.g., 0.35, 0.40, 0.50 */
  
  /* Body colors */
  --bs-body-color: #111;
  --bs-body-bg: #fff;
  
  /* Border radius - Match Recapify's rounded corners */
  --bs-border-radius: 0.375rem;
  --bs-border-radius-sm: 0.25rem;
  --bs-border-radius-lg: 0.5rem;
  --bs-border-radius-xl: 0.75rem;
  
  /* Spacing - Match Recapify's spacing system */
  --bs-border-width: 1px;
  --bs-border-color: #dee2e6;
  
  /* Shadows - Match Recapify's subtle shadows */
  --bs-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Dark mode overrides */
.dark {
  --bs-body-color: #e6e6e6;
  --bs-body-bg: #0f1215;
  --bs-primary: #5166de;
  --bs-primary-rgb: 81, 102, 222;
  --bs-secondary: #6c757d;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-border-color: #334155;
  --bs-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
  --bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
  --bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.5);
}

/* Base layout */
@font-face {
  font-family: "InterVariable";
  src: url("/static/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;           /* full variable range */
  font-style: normal;
  font-display: swap;             /* render text immediately */
}
@font-face {
  font-family: "InterVariable";
  src: url("/static/fonts/Inter-Variable-Italic.woff2") format("woff2");
  font-weight: 100 900;           /* full variable range */
  font-style: italic;
  font-display: swap;
}

html, body { margin: 0; padding: 0; }
html { 
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}
body {
  font-family: "InterVariable", system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
               "Segoe UI Emoji", sans-serif;
  max-width: 860px; /* widened so metadata fits on one line */
  margin: 40px auto;
  padding: 20px 16px 0 16px; /* Add top padding for fixed header */
  font-size: 16px;        /* explicit */
  line-height: 1.6;       /* up from 1.5 for better reading */
  color: #111;
  background:
    radial-gradient(1200px 800px at 22% 78%, rgba(120,119,198,0.22) 0%, transparent 60%),
    radial-gradient(1100px 700px at 78% 18%, rgba(120,119,198,0.20) 0%, transparent 60%),
    radial-gradient(900px 600px at 50% 105%, rgba(120,119,198,0.16) 0%, transparent 65%),
    #f1f5f9;
  background-attachment: fixed;
  font-optical-sizing: auto;         /* lets the font adapt at each size */
  font-variation-settings: normal;   /* use defaults for weight/opsz */
  text-rendering: optimizeLegibility;/* slightly better kerning on desktop */
}
h1 { font-size: 28px; margin: 0 0 12px; font-weight: 800; letter-spacing: -0.01em; }

/* Homepage login button styling */
.home-form .btn-primary {
  background: #0a107d;
  border-color: #0a107d;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(10, 16, 125, 0.3);
  transition: all 0.2s ease;
}

.home-form .btn-primary:hover {
  background: #222abe;
  border-color: #222abe;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(10, 16, 125, 0.4);
}

.home-form .btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(68,99,230,.35);
}

/* Account page vertical centering */
.account-content-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 120px); /* Account for topbar height */
}

.account-title {
  margin-top: 10px;
  margin-bottom: 8px;
  font-size: 1.75rem;
  font-weight: 600;
  color: #111;
}

/* Legal pages styling */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.legal-content {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.legal-content h1 {
  color: #0a107d;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.last-updated {
  color: #6b7280;
  font-style: italic;
  margin-bottom: 40px;
}

.legal-content h2 {
  color: #0a107d;
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
}

.legal-content h3 {
  color: #374151;
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

.legal-content p {
  line-height: 1.7;
  margin-bottom: 16px;
  color: #374151;
}

.legal-content ul {
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal-content li {
  line-height: 1.6;
  margin-bottom: 8px;
  color: #374151;
}

/* Dark mode for legal pages */
.dark .legal-content {
  background: #12161a;
  border-color: #222;
}

.dark .legal-content h1,
.dark .legal-content h2 {
  color: #aeb8ff;
}

.dark .legal-content h3 {
  color: #d1d5db;
}

.dark .legal-content p,
.dark .legal-content li {
  color: #d1d5db;
}

.dark .last-updated {
  color: #9ca3af;
}

/* Terms agreement checkbox styling */
.terms-label {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}

.terms-link {
  color: #0a107d;
  text-decoration: none;
  font-weight: 500;
  margin: 0 2px;
}

.terms-link:hover {
  color: #0a107d;
  text-decoration: underline;
}

.form-check-input:checked + .terms-label {
  color: #64748b;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(10, 16, 125, 0.25);
}

.form-check-input.is-invalid {
  border-color: #dc3545;
}

.form-check-input.is-invalid:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Dark mode for terms checkbox */
.dark .terms-label {
  color: #94a3b8;
}

.dark .terms-link {
  color: #60a5fa;
  margin: 0 2px;
}

.dark .terms-link:hover {
  color: #60a5fa;
}

.dark .form-check-input:checked + .terms-label {
  color: #94a3b8;
}

.dark .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
}

/* Terms checkbox container styling */
.signup-form .form-check {
  margin-bottom: 0;
}

.signup-form .form-check-label {
  width: 100%;
  display: block;
}

.signup-form .form-check-input {
  margin-right: 5px !important;
}

.signup-form .form-check-label {
  margin-left: 5px !important;
}


/* Homepage container: center column, keep internal content left-aligned */
.home-container { max-width: 600px; margin: 0 auto; }

.home-hero { 
  text-align: center; 
  margin: 12px 0 20px; 
  padding: 20px 24px;
  padding-bottom: 18px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 30%, #cbd5e1 70%, #94a3b8 100%);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 25px rgba(28,25,90,0.10);
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #0a107d 0%, #222abe 50%, #0a107d 100%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Light mode hero colors */
.home-hero h1, .home-hero h2 { 
  margin: 0 0 8px; 
  font-size: 2.4rem; 
  font-weight: 800; 
  color: #0a107d; 
  line-height: 1.2; 
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0a107d 0%, #222abe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-hero p { 
  margin: 0px; 
  color: #475569; 
  padding: 0; 
  font-size: 1.2rem; 
  line-height: 1.4; 
  font-weight: 500;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInOnly {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes badgeBorder {
  0%   { background-position: 0 0,   0% 50%; }
  50%  { background-position: 0 0, 100% 50%; }
  100% { background-position: 0 0,   0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-badge { animation: none; }
}

/* Dark mode keeps the previous look */
.dark .home-hero { 
  background: linear-gradient(135deg, #1e293b 0%, #334155 30%, #475569 70%, #64748b 100%);
  border-color: #334155;
  box-shadow: 
    inset 0 0 0 1px rgba(255,255,255,.06),
    0 20px 50px rgba(0,0,0,.45);
}

.dark .home-hero::before {
  background: linear-gradient(90deg, #5166de 0%, #818cf8 50%, #5166de 100%);
}

.dark .home-hero h1, .dark .home-hero h2 { 
  color: #aeb8ff;
  background: linear-gradient(135deg, #aeb8ff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dark .home-hero p { 
  color: #cbd5e1; 
}

/* AI Badge styling */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.90rem;
  line-height: 1;
  letter-spacing: 0;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0px;
  border-radius: 9999px;
  color: #0369a1;
  /* Dual backgrounds: solid fill + animated border gradient */
  background:
    linear-gradient(#f0f9ff, #f0f9ff) padding-box,
    linear-gradient(135deg, #3b82f6, #06b6d4, #8b5cf6, #3b82f6) border-box;
  border: 2px solid transparent;
  background-size: auto, 300% 300%;
  margin-top: 10px;
  margin-bottom: 3px;
  text-transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  animation: badgeBorder 12s linear infinite;
  will-change: background-position;
}

.dark .ai-badge {
  color: #60a5fa;
  /* Dual backgrounds: solid fill + animated border gradient */
  background:
    linear-gradient(#1e293b, #1e293b) padding-box,
    linear-gradient(135deg, #60a5fa, #8b5cf6, #a78bfa, #60a5fa) border-box;
  border: 2px solid transparent;
  background-size: auto, 300% 300%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.input-error { color: #dc2626; font-size: 0.85rem; margin-top: 6px; }

.dark .card { box-shadow: 0 10px 30px rgba(0,0,0,0.35); }

/* Dark theme sticky header */
.dark .topbar {
  background: #1e2937;
  border-radius: 0; /* straight edges */
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Font inheritance rules */
*, *::before, *::after { font-family: inherit; }
button, input, select, textarea, h1, h2, h3, h4, h5, h6 { font-family: inherit; }

/* Top bar with theme switch */
.topbar { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin-bottom: 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  margin-top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1.5px solid rgba(0,0,0,.08); /* subtle divider */
  box-shadow: 0 6px 18px rgba(2,6,23,0.06);
  padding: 12px 10px 12px 10px;
  border-radius: 0; /* straight edges */
}

/* Inner content container for topbar */
.topbar-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 920px;
}

.topbar .left { display: flex; align-items: center; flex-wrap: nowrap; gap: 2px; flex: 0 0 auto; justify-content: flex-start; min-width: 0; }
.topbar .left h1 { display: none; }

/* Header logo styling */
.header-logo-link {
  display: inline-block;
  text-decoration: none;
  transition: opacity 0.3s ease;
  cursor: pointer;
  position: relative;
  z-index: 101;
  margin-right: 8px;
}

.header-logo {
  height: 24px;
  margin-top: 4px;
  width: auto;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(10, 16, 125, 0.2));
}

/* Responsive header adjustments */
@media (max-width: 768px) {
  .topbar .left {
    justify-content: flex-start;
  }
  
  .user-info {
    font-size: 0.9rem;
    gap: 3px;
    flex-wrap: wrap;
  }
  
  .topbar .right {
    gap: 6px;
  }
  
  .user-links {
    font-size: 0.9rem;
  }
}

.header-logo.light-logo {
  display: block;
}

.header-logo.dark-logo {
  display: none;
}

.dark .header-logo.light-logo {
  display: none;
}

.dark .header-logo.dark-logo {
  display: block;
}

/* Dark mode logo styling */
.dark .header-logo {
  filter: drop-shadow(0 2px 4px rgba(96, 165, 250, 0.3));
}
.topbar .right { display: flex; align-items: center; gap: 10px; justify-content: space-between; width: 100%; }

/* User info and links grouping */
.user-info { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: flex-start; font-size: 0.95rem; color: #0f172a; }

/* Default styling for line containers */
.user-info-line-1,
.user-info-line-2 {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Email link styling */
.email-link {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.email-link[data-full-email] {
  cursor: pointer;
}

.email-link:hover {
  color: #0a107d;
  text-decoration: underline;
}

.dark .email-link:hover {
  color: #aeb8ff;
}

/* Mini progress bar for minutes */
.mini-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-progress-bar {
  width: 60px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0a107d 0%, #222abe 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.mini-progress-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.low-balance-indicator {
  color: #dc2626;
  font-weight: bold;
  font-size: 0.9rem;
  margin-left: 2px;
}

.user-links { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* For non-logged-in users, align links to the right */
.guest-links {
  margin-left: auto;
}

/* For login page, align sign up button to the left */
.login-page-links {
  margin-right: auto;
}

.user-links a { 
  color: #0f172a; 
  text-decoration: none; 
  font-size: 0.9rem;
  padding: 6px 12px;
  border: 1px solid rgba(15,23,42,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.6);
  transition: all 0.2s ease;
}

.user-links a[title="Account"] {
  font-size: 1.15rem;
  padding: 8px 8px;
  color: #0a107d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Match Account icon sizing/padding for Home icon */
.user-links a[title="Home"] {
  font-size: 1.15rem;
  padding: 8px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-links a[title="Account"] img,
.user-links a[title="Account"] svg,
.user-links .user-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  vertical-align: middle;
}

.user-links a:hover { 
  background: rgba(15,23,42,0.08);
  border-color: rgba(15,23,42,0.25);
  color: #0a107d;
}

/* Homepage login button - enhanced outline/ghost style */
.user-links a[href*="login"] {
  background: rgba(10, 16, 125, 0.08) !important;
  border-color: #0a107d !important;
  color: #0a107d !important;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(10, 16, 125, 0.1);
  transition: all 0.2s ease;
}

.user-links a[href*="login"]:hover {
  background: #0a107d !important;
  border-color: #0a107d !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 16, 125, 0.3);
}

/* Dark mode login button styling */
.dark .user-links a[href*="login"] {
  background: rgba(96, 165, 250, 0.12) !important;
  border-color: #60a5fa !important;
  color: #60a5fa !important;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(96, 165, 250, 0.15);
  transition: all 0.2s ease;
}

.dark .user-links a[href*="login"]:hover {
  background: #60a5fa !important;
  border-color: #60a5fa !important;
  color: #1e293b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

/* Dark mode topbar */
.dark .user-info { color: #b9b8b8; }

.dark .mini-progress-bar {
  background: #374151;
}

.dark .mini-progress-fill {
  background: linear-gradient(90deg, #3b4db8 0%, #5c6fd8 100%);
}

.dark .mini-progress-text {
  color: #9ca3af;
}

.dark .low-balance-indicator {
  color: #fca5a5;
}

.dark .user-links a { 
  color: #aeb8ff;
  background: #1a1f26;
  border-color: #374151;
}

.dark .user-links a[title="Account"],
.dark .user-links .user-icon {
  color: #aeb8ff !important;
}

.dark .user-links a[title="Home"] {
  color: #aeb8ff !important;
}

.dark .account-icon {
  color: #aeb8ff !important;
  filter: none !important;
}

.dark .user-links a:hover { 
  background: #202632;
  border-color: #4b5563;
  color: #cbd5ff;
}

/* Icon theme toggle button */
/* Theme toggle slider with icon */
.theme-toggle-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #0f172a; /* near-black for light mode */
  background: #0f172a;       /* light mode track: dark/black */
  cursor: pointer;
  vertical-align: middle;
  margin-top: 0;
}
.theme-toggle-switch .handle {
  position: absolute;
  top: 0; /* align perfectly within 28px track with 1px borders */
  left: 1px; /* light mode: moon on the left, account for track border */
  right: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #0f172a;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #0f172a;
  transition: left 0.2s ease, right 0.2s ease;
  box-sizing: border-box;
}
.theme-toggle-switch .handle::before { content: '☾'; }

/* Dark mode shows target (light) */
.dark .theme-toggle-switch {
  background: #f59e0b; /* amber in dark mode */
  border-color: #f59e0b;
}
.dark .theme-toggle-switch .handle {
  right: 1px; /* dark mode: sun on the right, account for track border */
  left: auto;
  background: #ffffff;
  border: 1px solid #f59e0b;
  color: #f59e0b;
}
.dark .theme-toggle-switch .handle::before { content: '☀'; }

/* Flash messages */
.flash {
  padding: 12px 14px;
  margin: 0 0 16px 0;
  border-radius: 6px;
}
.flash.error {
  position: fixed;
  top: 96px; /* Gap from header */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 860px;
  z-index: 1000;
  display: flex;
  justify-content: flex-end; /* Align toast to the right within the container */
  padding: 0 20px; /* Add padding to match content spacing */
  margin: 0; /* Override base .flash margin */
  animation: toastSlideIn 0.3s ease-out;
  background: transparent; /* Make container invisible */
  border: none; /* Remove any borders */
  outline: none; /* Remove any outlines */
  box-shadow: none; /* Remove any shadows */
}

.flash.error .toast-content {
  background: rgba(220, 38, 38, 0.95);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  max-width: 300px;
}
/* Toast notification container - constrains to 860px width like header/content */
.flash.success {
  position: fixed;
  top: 96px; /* Gap from header */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 860px;
  z-index: 1000;
  display: flex;
  justify-content: flex-end; /* Align toast to the right within the container */
  padding: 0 20px; /* Add padding to match content spacing */
  animation: toastSlideIn 0.3s ease-out;
}

/* Toast notification content */
.flash.success .toast-content {
  background: rgba(16, 163, 74, 0.95);
  color: #fff;
  border: none;
  border-radius: 8px; /* Reduced from 20px to match button styling */
  padding: 8px 12px; /* Reduced right padding from 16px to 12px */
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px; /* Add gap between message and close button */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1); /* Enhanced shadow */
  backdrop-filter: blur(8px);
  max-width: 300px;
}

/* Info/neutral toast container - constrains to 860px width like header/content */
.flash.info {
  position: fixed;
  top: 96px; /* Gap from header */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 860px;
  z-index: 1000;
  display: flex;
  justify-content: flex-end; /* Align toast to the right within the container */
  padding: 0 20px; /* Add padding to match content spacing */
  animation: toastSlideIn 0.3s ease-out;
}

/* Info toast notification content */
.flash.info .toast-content {
  background: rgba(59, 130, 246, 0.95); /* Blue for neutral actions */
  color: #fff;
  border: none;
  border-radius: 8px; /* Match button styling */
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  max-width: 300px;
}

/* Inline warning banner (non-toast). Use with: <div class="flash warning"> */
.flash.warning {
  position: static;
  transform: none;
  width: 100%;
  max-width: 860px;
  margin: 12px auto;
  padding: 12px 14px;
  background: #fff7ed; /* light amber */
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 6px;
}

.dark .flash.warning {
  background: #1f2937;
  border-color: #374151;
  color: #fbbf24;
}

/* Inline success banner (non-toast). Use with: <div class="flash inline-success"> */
.flash.inline-success {
  position: static;
  transform: none;
  width: 100%;
  margin: 12px 0 0 0;
  padding: 12px 14px;
  background: #ecfdf5; /* emerald-50 */
  border: 1px solid #a7f3d0; /* emerald-200 */
  color: #065f46; /* emerald-800 */
  border-radius: 6px;
}

.dark .flash.inline-success {
  background: #052e2b; /* deep teal */
  border-color: #115e59;
  color: #34d399;
}

/* Inline error banner (non-toast). Use with: <div class="flash error inline-error"> */
.flash.error.inline-error {
  position: static;
  transform: none;
  width: 100%;
  max-width: 860px;
  margin: 12px auto;
  padding: 12px 14px;
  background: #fef2f2; /* red-50 */
  border: 1px solid #fecaca; /* red-200 */
  color: #991b1b; /* red-800 */
  border-radius: 6px;
  display: block;
  z-index: auto;
  left: auto;
  top: auto;
  justify-content: flex-start;
  animation: none;
  box-shadow: none;
}

.flash.error.inline-error h2 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #991b1b;
}

.flash.error.inline-error p {
  margin: 0;
  color: #991b1b;
}

.dark .flash.error.inline-error {
  background: #1f1f1f;
  border-color: #7f1d1d;
  color: #fca5a5;
}

.dark .flash.error.inline-error h2 {
  color: #fca5a5;
}

.dark .flash.error.inline-error p {
  color: #fca5a5;
}

/* Center and constrain inline banners inside verify card */
.verify-inline {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

/* OTP slots */
.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 16px 0;
}

.otp-slot {
  width: 44px;
  height: 56px;
  text-align: center;
  font-size: 28px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  border: none;
  border-bottom: 3px solid #c7cff5;
  outline: none;
  background: transparent;
}

.otp-slot:focus {
  border-bottom-color: var(--bs-primary);
}

.dark .otp-slot {
  border-bottom-color: #3b3f72;
  color: #e5e7eb;
}

.dark .otp-slot:focus {
  border-bottom-color: var(--bs-primary);
}

/* Toast message text */
.toast-message {
  display: flex;
  align-items: center;
}

/* Toast close button - lighter and smaller with maintained hit area */
.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5); /* Lighter color */
  font-size: 0.85rem; /* Smaller font size */
  cursor: pointer;
  padding: 8px; /* Maintain 36-40px hit area (8px padding + 20px content = 36px total) */
  margin: 0;
  opacity: 0.7; /* Reduced opacity for lighter appearance */
  transition: all 0.2s ease;
  border-radius: 4px;
  width: 20px; /* Content area */
  height: 20px; /* Content area */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box; /* Include padding in dimensions */
}

.toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

/* Enhanced toast animations */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.95); /* Slide in from top */
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1); /* Final position */
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.95); /* Slide out to top */
  }
}

/* Dark mode toast */
.dark .flash.success .toast-content {
  background: rgba(34, 197, 94, 0.95);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2); /* Enhanced dark shadow */
}

.dark .flash.info .toast-content {
  background: rgba(96, 165, 250, 0.95); /* Lighter blue for dark mode */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Promotional banner (not a toast) */
.promotional-banner {
  background: #e9ffef;
  color: #1b6e37;
  border: 1px solid #bde8c9;
  border-radius: 8px;
  padding: 8px 16px;
  margin: 2px auto;
  text-align: center;
  font-size: 1rem;
  line-height: 1.5;
  display: inline-block;
  width: fit-content;
}

.dark .promotional-banner {
  background: #0f2d1c;
  color: #bbf7d0;
  border-color: #065f46;
}

.dark .promotional-banner strong[style*="color: #0d6efd"] {
  color: #aeb8ff !important;
}

/* Small note styling in promotional banner */
.promotional-banner small {
  color: #6b7280;
  font-style: italic;
  font-size: 0.85rem;
  display: block;
  margin-top: 4px;
}

.dark .promotional-banner small {
  color: #9ca3af;
}

/* Plan details styling */
.promotional-banner .plan-details {
  font-weight: bold;
}

/* Create Account button styling inside promotional banner */
.promotional-banner a {
  display: inline-block;
  background: #1b6e37;
  color: white !important;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  margin-left: 12px;
  transition: all 0.2s ease;
  border: 1px solid #15803d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.promotional-banner a:hover {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(27, 110, 55, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.dark .promotional-banner a {
  background: #059669;
  border-color: #047857;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.dark .promotional-banner a:hover {
  background: #047857;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* Mobile layout for promotional banner - screens under 480px */
@media (max-width: 480px) {
  .promotional-banner {
    display: block;
    text-align: center;
  }
  
  .promotional-banner strong {
    display: block;
    margin-bottom: 2px;
  }
  
  .promotional-banner .plan-details {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9em;
  }
  
  .promotional-banner a {
    display: block;
    margin: 8px auto 0 auto;
    width: fit-content;
  }
  
  .promotional-banner small {
    margin-top: 4px;
  }
}

/* Tablet/Medium layout for promotional banner - screens between 480px and 800px */
@media (min-width: 481px) and (max-width: 800px) {
  .promotional-banner a {
    display: block;
    margin: 8px auto 0 auto;
    width: fit-content;
  }
  
  .promotional-banner small {
    display: inline;
    margin-top: 0;
    margin-left: 8px;
  }
}

/* Desktop layout for promotional banner - screens above 800px */
@media (min-width: 801px) {
  .promotional-banner small {
    display: inline;
    margin-top: 0;
    margin-left: 8px;
  }
}

/* Anonymous user limit errors - clean styling */
.flash.error.anon-limit-error {
  background: #fef7f7;
  border: 1px solid #fecaca;
  color: #991b1b;
  margin-bottom: 0;
  padding: 12px 16px;
  border-radius: 8px;
}

.flash.error.anon-limit-error strong {
  color: #7f1d1d;
  font-weight: 700;
}

.dark .flash.error.anon-limit-error {
  background: #1a1212;
  border: 1px solid #3a2323;
  color: #fca5a5;
}

.dark .flash.error.anon-limit-error strong {
  color: #f87171;
  font-weight: 700;
}

/* Error action container - separate from error box */
.error-action-container {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

/* Button wrapper to control note alignment */
.error-action-container .btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Error CTA button styling */
.error-cta-btn {
  background: #059669 !important;
  border: 1px solid #047857 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2) !important;
}

.error-cta-btn:hover {
  background: #047857 !important;
  border-color: #065f46 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3) !important;
}

.error-cta-btn:focus {
  outline: 2px solid #059669 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2) !important;
}

/* No credit card required note */
.no-credit-card-note {
  color: #6b7280 !important;
  font-size: 0.8rem !important;
  font-style: italic !important;
  margin-top: 2px !important;
  margin-left: 4px !important;
}

.dark .no-credit-card-note {
  color: #9ca3af !important;
}

/* Responsive layout */
@media (max-width: 640px) {
  .error-action-container {
    align-items: stretch;
  }
  
  .error-action-container .btn-wrapper {
    align-items: stretch;
  }
  
  .error-cta-btn {
    width: 100% !important;
    text-align: center !important;
  }
  
  .no-credit-card-note {
    text-align: center !important;
    margin-top: 4px !important;
    font-size: 0.75rem !important;
  }
}


/* Card container */
.card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Dedicated home card wrapper to add gentle separation */
.home-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

/* History list with thumbnails */
.history-list {
  --date-col: 600px; /* position where the date column starts */
}

/* History header with filter */
.history-header {
  display: flex;
  flex-direction: column;
  gap: 0px;
  margin-top: 20px;
  margin-bottom: 4px;
}

.history-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.history-header-top > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-header-top .back-to-home {
  margin: 0;
}

.history-header h2 {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.filter-icon {
  color: #9ca3af;
  flex-shrink: 0;
}

.filter-input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 300px !important;  /* Increased from 250px to 280px, !important to override mobile rules */
  height: 40px; /* Match dropdown height */
  box-sizing: border-box; /* Include padding in height calculation */
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-input:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.filter-input::placeholder {
  color: #6b7280;  /* Increased contrast from #9ca3af to #6b7280 */
  opacity: 0.8;  /* Added opacity for better visibility */
}

.no-results-message {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
  font-style: italic;
  background: #f9fafb;
  border-radius: 8px;
  margin: 20px 0;
}

/* Dark mode styles for filter */
.dark .filter-icon {
  color: #6b7280;
}

.dark .filter-input {
  background: #1f2937;
  border-color: #374151;
  color: #e6e6e6;
}

.dark .filter-input:focus {
  border-color: #aeb8ff;
  box-shadow: 0 0 0 3px rgba(174, 184, 255, 0.1);
}

.dark .filter-input::placeholder {
  color: #d1d5db;  /* Increased contrast from #9ca3af to #d1d5db */
  opacity: 0.8;  /* Added opacity for better visibility */
}

.dark .no-results-message {
  background: #1f2937;
  color: #9ca3af;
}

.history-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 2px 0 16px 0; /* Increased bottom padding from 12px to 16px */
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
}

.history-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06); /* deeper shadow */
}

.dark .history-item:hover {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1), 0 2px 4px rgba(255, 255, 255, 0.05); /* lighter shadow for dark mode */
}

.history-item:last-child {
  border-bottom: none;
}

/* Selection mode styles */
.history-item.select-mode {
  position: relative;
  cursor: pointer;
}

.history-item.select-mode .history-title a {
  pointer-events: none;
  cursor: default;
}

.item-checkbox-wrapper {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-top: 2px;
}

.history-item.select-mode .item-checkbox-wrapper {
  display: flex;
}

.item-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0d6efd;
}

/* Bulk action bar */
.bulk-action-bar {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 10px;
  margin: 4px 0 4px 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 70px;
  z-index: 99;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bulk-action-info {
  font-weight: 500;
  color: #6b7280;
  font-size: 0.85rem;
}

.bulk-action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bulk-action-btn {
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  color: #6b7280;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
}

.bulk-action-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.bulk-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bulk-favorite-btn {
  background: #fef3c7;
  border-color: #fde68a;
}

.bulk-favorite-btn:hover:not(:disabled) {
  background: #fde68a;
}

.bulk-unfavorite-btn {
  background: #fef3c7;
  border-color: #fde68a;
}

.bulk-unfavorite-btn:hover:not(:disabled) {
  background: #fde68a;
}

.bulk-delete-btn {
  background: #fee2e2;
  border-color: #fecaca;
}

.bulk-delete-btn:hover:not(:disabled) {
  background: #fecaca;
}

.bulk-cancel-btn {
  margin-left: 12px;
}

/* Select and filter group */
.select-and-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 42px;
}
/* Selection mode toggle button */
.select-mode-btn {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  color: #6b7280;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px; /* Match filter input height */
  white-space: nowrap;
  box-sizing: border-box;
  margin: 0;
}

.select-mode-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.select-mode-btn.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* Dark mode styles */
.dark .bulk-action-bar {
  background: #1f2937;
  border-color: #2a3441;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dark .bulk-action-info {
  color: #6b7280;
}

.dark .bulk-action-btn {
  background: #374151;
  border-color: #4b5563;
  color: #9ca3af;
}

.dark .bulk-action-btn:hover:not(:disabled) {
  background: #4b5563;
}

.dark .bulk-favorite-btn {
  background: #4a4228; /* Less intense dark yellow */
  border-color: #5a5230;
  color: #fbbf24;
}

.dark .bulk-favorite-btn:hover:not(:disabled) {
  background: #5a5230;
}

.dark .bulk-unfavorite-btn {
  background: #374151;
  border-color: #4b5563;
  color: #9ca3af;
}

.dark .bulk-unfavorite-btn:hover:not(:disabled) {
  background: #4b5563;
}

.dark .bulk-delete-btn {
  background: #4b2934;
  border-color: #5e3441;
  color: #d89fa9;
}

.dark .bulk-delete-btn:hover:not(:disabled) {
  background: #5e3441;
}

.dark .bulk-cancel-btn {
  margin-left: 12px;
}

.dark .select-mode-btn {
  background: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}

.dark .select-mode-btn:hover {
  background: #374151;
  color: #e5e7eb;
}

.dark .select-mode-btn.active {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #93c5fd;
}

/* Responsive styling for select and filter group - medium screens (480px-812px) */
@media (min-width: 480px) and (max-width: 812px) {
  .select-and-filter-group {
    gap: 6px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
  }
  
  .select-mode-btn {
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
    height: 32px !important;
    min-width: auto !important;
  }
  
  .view-filter-select {
    min-width: 90px !important;
    font-size: 0.8rem !important;
    height: 32px !important;
    padding: 6px 8px !important;
  }
  
  /* Reduce gap in filters group if needed */
  .filters-group {
    gap: 8px !important;
  }
  
  /* Dark mode adjustments for medium screens */
  .dark .select-mode-btn {
    font-size: 0.8rem !important;
  }
  
  .dark .view-filter-select {
    font-size: 0.8rem !important;
  }
  
  /* Adjust bulk action bar for medium screens */
  .bulk-action-bar {
    padding: 6px 10px !important;
    gap: 10px !important;
  }
  
  .bulk-action-buttons {
    gap: 5px !important;
    flex-wrap: wrap !important;
  }
  
  .bulk-action-btn {
    padding: 3px 8px !important;
    font-size: 0.75rem !important;
  }
}

.history-thumbnail {
  flex-shrink: 0;
  width: 140px;
  aspect-ratio: 16 / 9; /* keep consistent, avoid fractional heights */
  border-radius: 6px;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px; /* Move thumbnail slightly lower */
}

.thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fill the 16:9 box; crop sides if needed, no top/bottom bars */
  transition: transform 0.2s ease;
}

.thumbnail-img:hover {
  transform: scale(1.05);
}

.thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  color: #6c757d;
}

.placeholder-icon {
  font-size: 24px;
  opacity: 0.6;
}

.history-content {
  flex: 1;
  min-width: 0;
}

.history-title {
  margin-bottom: 0px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.history-title a {
  color: #0a107d; /* Match generate button color */
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.4;
  flex: 1;
}

.history-title a:hover {
  color: #222abe; /* Match generate button hover color */
  text-decoration: underline;
}

.summary-type {
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 400;
}

.history-date {
  color: #6c757d;
  font-size: 0.82rem;
  white-space: nowrap;
margin-left: 6px;  /* margin-top: 2px;
  margin-bottom: 6px; */
}

/* Pagination styles */
.pagination-container {
  margin-top: 6px;
  padding: 4px 0;
  border-top: 1px solid #9ca3af;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.pagination-info {
  color: #6b7280;
  font-size: 0.85rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn {
  display: inline-block;
  padding: 4px 16px;
  background: #f3f4f6;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid #d1d5db;
}

.pagination-btn:hover {
  background: #e5e7eb;
  color: #111827;
  text-decoration: none;
}

.pagination-current {
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Dark mode pagination */
.dark .pagination-container {
  border-top-color: #4b5563;
}

.dark .pagination-info {
  color: #9ca3af;
}

.dark .pagination-btn {
  background: #374151;
  color: #d1d5db;
  border-color: #4b5563;
}

.dark .pagination-btn:hover {
  background: #4b5563;
  color: #f9fafb;
}

.dark .pagination-current {
  color: #9ca3af;
}

/* Mobile responsive pagination */
@media (max-width: 768px) {
  .pagination-container {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .pagination-controls {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .per-page-container {
    justify-content: center;
    order: -1; /* Move per-page selector to top on mobile */
  }
  
  .per-page-select {
    min-width: 50px;
    font-size: 0.8rem;
  }
}

/* Mobile responsive history layout */
@media (max-width: 768px) {
  .history-header {
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
  }
  
  .history-header-top {
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important; /* Reduced from 12px to prevent big space */
    width: 100% !important;
  }
  
  .history-header h2 {
    min-width: auto !important;
    text-align: center !important;
  }
  
  .history-header-controls {
    flex-direction: row !important; /* Keep horizontal on mobile */
    align-items: center !important;
    gap: 12px !important;
    justify-content: center !important;
  }
  
  .filters-group {
    flex-direction: row !important; /* Changed from column to row to prevent overlapping */
    align-items: center !important;
    justify-content: center !important; /* Center all filter elements */
    width: 100% !important;
    display: flex !important;
    gap: 8px !important; /* Reduced from 12px */
    flex-wrap: wrap !important; /* Allow wrapping if needed */
  }
  
  .select-and-filter-group {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; /* Center the group horizontally */
    gap: 6px !important; /* Reduced from 8px */
    margin: 0 auto !important; /* Center horizontally */
    order: 0 !important;
  }
  
  .view-filter {
    display: flex !important;
    justify-content: center !important;
  }
  
  .select-mode-btn {
    height: 24px !important;
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    margin: 0 !important;
  }
  
  .view-filter-select {
    min-width: 100px;
    font-size: 0.85rem;
    height: 24px; /* Slightly smaller on mobile */
    margin: 0 !important;
  }
  
  .filter-input {
    height: 36px; /* Match mobile dropdown height */
  }
  
  .history-filter {
    width: auto !important; /* Changed from 100% to auto */
    flex: 1; /* Allow it to grow */
    min-width: 200px !important; /* Ensure minimum width */
    margin: 0 auto !important; /* Center horizontally */
    display: flex !important;
    justify-content: center !important;
    gap: 2px !important; /* Reduced gap between icon and input */
  }
  
  .view-filter {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important; /* Center horizontally */
  }
  
  .show-more-container {
    text-align: right;
    padding-right: 16px;
  }
  
  .filter-input {
    width: 100%;
  }
  
  .history-item {
    gap: 12px;
    padding: 6px 0 20px 0; /* Increased bottom padding for mobile */
  }
  
  .history-thumbnail {
    width: 100px;
    height: 56px;
  }
  
  .placeholder-icon {
    font-size: 20px;
  }
  
  .history-title a {
    font-size: 0.95rem;
  }
  
  .summary-type {
    font-size: 0.85rem;
  }
  
  .history-date {
    font-size: 0.8rem;
  }

  /* Reduce gap between filters and bulk action bar */
  .bulk-action-bar {
    margin: 4px 0 4px 0 !important;
    position: sticky !important;
    top: 160px !important;
    z-index: 99 !important;
  }
}

/* Specific fix for usage text in Usage card at 768-860px */
@media (min-width: 768px) and (max-width: 860px) {
  .account-card .usage-text {
    font-size: 0.82rem; /* Very small font (10.4px) */
    gap: 0px;           /* No gaps between elements */
  }
  
  .account-card .usage-text span {
    white-space: nowrap;
    flex-shrink: 1;
  }
  
  .account-grid {
    gap: 0px; /* Reduced gap between cards */
  }
}

/* Targeted fix for problematic 768px-930px range only */
@media (min-width: 768px) and (max-width: 930px) {
  /* More aggressive usage text styling for this range only */
  .usage-text {
    font-size: 0.7rem; /* Even smaller font */
    gap: 0px;          /* No gap between elements */
  }
  
  .usage-text span {
    white-space: nowrap;        /* prevent individual spans from wrapping */
    flex-shrink: 1;             /* allow spans to compress if needed */
  }
  /* More aggressive layout optimization for this range only */
  .account-grid {
    gap: 8px; /* Reduced gap for better spacing */
  }
  
  .account-card {
    padding: 8px; /* Even smaller padding for maximum space */
  }
}

@media (max-width: 480px) {
  .history-item {
    gap: 10px;
    padding: 4px 0 18px 0; /* Increased bottom padding for small mobile */
  }
  
  .history-thumbnail {
    width: 80px;
    height: 45px;
  }
  
  .placeholder-icon {
    font-size: 18px;
  }
  
  .history-title a {
    font-size: 0.9rem;
  }
  
  .summary-type {
    font-size: 0.8rem;
  }
  
  .history-date {
    font-size: 0.75rem;
  }
}

/* Form controls */
label { display: inline-block; margin-top: 12px; }
input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* Homepage form spacing */
.home-form { margin-top: 6px; padding-bottom: 8px; }
.home-form .form-row { margin: 15px 0 17px; }
.home-form .form-row.tight { margin: 11px 0 9px; }
.home-form .radio-group label { margin-top: 11px; }
.home-form .actions { margin-top: 13px; display: flex; justify-content: center; }

/* Compact spacing for Bootstrap form elements */
.home-form .mb-3 { margin-bottom: 1rem !important; }
.home-form .form-check { margin-bottom: 0.5rem; }
.home-form .form-check:last-child { margin-bottom: 0; }

/* Emphasize primary submit button with a slightly thicker border */
#submitBtn { border-width: 3px; }
.dark #submitBtn { border-width: 3px; }

/* Reduce space before progress area for tighter layout */
#progressContainer { margin-top: -12px; }

/* Buttons and links styled as buttons */
button, a.button {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
button:hover, a.button:hover { background: #f7f7f7; }

/* Markdown output formatting */
.mdout {
  line-height: 1.55; /* NEW: slightly taller line spacing for readability */
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  margin: 0;
  color: #374151;
}
.mdout h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 14px 0 6px;
}
.mdout h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 10px 0 4px;
}
/* UPDATED: list margins/spacing */
.mdout ul, .mdout ol {
  margin: 8px 0 12px 22px;   /* more consistent spacing */
  padding-left: 0;           /* avoid double-indenting */
}
.mdout li {
  margin: 0px 0;             /* more breathing room between bullets */
  padding: 2px 0;            /* add padding for better spacing on desktop */
}
.mdout ul ul, .mdout ol ol {
  margin-top: 6px;
  margin-bottom: 6px;
}
/* NEW: inline emphasis */
.mdout strong { font-weight: 700; }
.mdout em { font-style: italic; }
/* NEW: links */
.mdout a {
  text-decoration: underline;
  word-break: break-word;    /* prevent overflow on long URLs */
}
/* NEW: inline and block code */
.mdout code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: #f6f8fa;
  padding: 0 4px;
  border-radius: 4px;
}
.mdout pre code {
  display: block;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 6px;
}

/* Diagnostics */
details {
  margin-top: 20px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fafafa;
}

/* Error block for summary failures */
.error {
    padding: 12px 14px;
    margin: 12px 0 16px 0;
    border-radius: 6px;
    background: #ffe5e5;
    color: #7a0b0b;
    border: 1px solid #f3b8b8;
    white-space: pre-wrap; /* preserve line breaks if any */
}

/* Dark mode error block */
.dark .error:not(.flash) {
    background: #431317;
    color: #fee2e2;
    border: 1px solid #7f1d1d;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(127,29,29,.4), 0 8px 24px rgba(0,0,0,.3);
}

/* Two-line summary header (UI) */
.summary-header { margin: 16px 0 8px; }
.summary-header .summary-kind {
  /* a bit larger than regular h2 */
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: #0a107d;
}
.summary-header .summary-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 2px 0;  /* Reduced from 4px to 2px for tighter grouping */
  color: #222abe; /* blue */
}

/* Video thumbnail styling */
.video-thumbnail-container {
  margin: 16px 0;
  text-align: center;
}

.video-thumbnail-img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Video metadata styling */
.video-metadata {
  display: flex;
  gap: 20px;
  margin: 8px 0;
  flex-wrap: wrap;
  justify-content: center;  /* Center align the metadata */
}

.video-metadata span {
  font-size: 0.9rem;
  color: #6b7280;
}

.metadata-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 10px 0;
}

/* Video title styling (standalone) */
.summary-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 16px 0 8px;
  text-align: center;
  color: #222abe;
}

/* Summary type header after metadata */
.summary-type-header {
  margin: 16px 0 8px;
  text-align: center;
}

.summary-type-header .summary-kind {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  color: #0a107d;
}

/* Copy summary button + status */
.summary-actions {
  margin: 14px 0px 16px 0px;  /* Reduced top margin from 12px to 8px for tighter grouping */
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;  /* Right align the buttons */
}

.summary-actions .button {
  padding: 6px 10px;  /* Reduced padding to make button smaller */
  border-radius: 6px;
  border: 1px solid #222abe;
  background: #222abe;
  color: #fff;
  font-size: 0.9rem;  /* Slightly smaller font */
  margin-top: 0 !important;
}

.summary-actions .button:hover {
  background: #0a107d;
}

.summary-actions button {
  padding: 6px 10px;  /* Reduced padding to match PDF button */
  border-radius: 6px;
  border: 1px solid #0a107d;
  background: #fff;
  color: #0a107d;
  cursor: pointer;
  font-size: 0.9rem;  /* Slightly smaller font */
  margin-top: 0 !important;
}

.summary-actions button:hover {
  background: #eef1ff;
}

.summary-actions #copySummaryStatus {
  font-size: 0.9rem;
  color: #0a107d;
}

/* Dark mode: make copy status text readable */
.dark .summary-actions #copySummaryStatus {
  color: #fff;
}

/* Summary toolbar: ensure segmented buttons don't inherit global top margin */
.summary-toolbar .segmented .seg-btn {
  margin-top: 0 !important;
  margin-bottom: 0;
}

/* Summary toolbar (shared across result/history/popular pages) */
.summary-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 18px 0; /* tighter rhythm; line sits on toolbar */
  padding-bottom: 10px;  /* space before the hairline */
  border-bottom: 1px solid #cfd5e3; /* render divider as part of toolbar */
}
.dark .summary-toolbar { border-bottom-color: #3a4763; }
.summary-toolbar .left { display: flex; align-items: center; gap: 12px; }
.summary-toolbar .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.summary-toolbar .segmented { margin: 0; }
.summary-toolbar .summary-actions { margin: 0; }

/* Normalize control heights so baselines match */
.summary-toolbar .segmented .seg-btn,
.summary-toolbar .left .seg-badge,
.summary-toolbar .left .type-badge,
.summary-toolbar .right .button,
.summary-toolbar .right button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  box-sizing: border-box;
}

/* Segmented control */
.segmented { display: inline-flex; }
.segmented .seg-btn {
  padding: 6px 12px;
  font-size: 0.9rem;
  border: 1px solid #0a107d; /* match outline buttons */
  background: #fff;
  color: #0a107d;
}
/* Light mode: make inactive language text slightly less prominent */
.segmented .seg-btn:not(.active) { color: rgba(10, 16, 125, 0.60); }
.segmented .seg-btn:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none; /* remove inner border */
}
.segmented .seg-btn:last-child  {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;  /* remove inner border */
}
/* No negative overlap now that inner borders are removed */
.segmented .seg-btn + .seg-btn { margin-left: 0; }
/* Preserve default backgrounds on hover for language toggle */
.segmented .seg-btn:not(.active):hover {
  background: #fff;
  color: rgba(10, 16, 125, 0.60);
  border-color: #0a107d;
}
.segmented .seg-btn.active:hover {
  background: #e3eaff;
  color: #0a107d;
  border-color: #0a107d;
}
/* Soft-fill active style to differentiate from primary CTA */
.segmented .seg-btn.active { background: #e3eaff; color: #0a107d; border-color: #0a107d; cursor: default; }
.segmented .seg-btn:disabled { opacity: 0.7; cursor: pointer; }
/* Keep active (selected) toggle vivid even when disabled to prevent greyed look */
.segmented .seg-btn.active:disabled { opacity: 1; }

/* Dark mode styles aligned with toolbar buttons */
.dark .segmented .seg-btn {
  background: #24304a; /* inactive base */
  color: #aeb8ff;
  border-color: #2a3b8f;
  opacity: 0.88; /* slightly less prominent for inactive */
}
/* Dark mode: keep the same backgrounds on hover */
.dark .segmented .seg-btn:not(.active):hover {
  background: #24304a;
  color: #aeb8ff;
  border-color: #2a3b8f;
  opacity: 0.88;
}
.dark .segmented .seg-btn.active:hover {
  background: #1b2236;
  color: #ffffff;
  border-color: #2a3b8f;
  opacity: 1;
}
/* Dark mode swapped: active uses previous inactive */
.dark .segmented .seg-btn.active {
  background: #1b2236;
  border-color: #2a3b8f;
  color: #ffffff; /* more prominent */
  opacity: 1; /* ensure active stands out */
}
/* Dark mode: don't dim the active disabled toggle */
.dark .segmented .seg-btn.active:disabled { opacity: 1; }

/* Non-interactive language badge (shown when original language is English) */
.seg-badge {
  padding: 6px 12px;
  font-size: 0.9rem; /* match toolbar controls */
  border-radius: 8px;
  border: 1px solid #0a107d;
  background: #e3eaff; /* match active light */
  color: #0a107d;
  user-select: none;
  pointer-events: none; /* unresponsive */
}
.dark .seg-badge {
  background: #1b2236; /* match active dark */
  border-color: #2a3b8f;
  color: #ffffff;
}

/* Subtle, display-only badge variant for English-only cases */
.seg-badge.subtle {
  background: #f4f6ff;       /* lighter than active */
  border-color: #c9d2ff;
  color: rgba(10, 16, 125, 0.60);
}
.dark .seg-badge.subtle {
  background: #1f2738;       /* lighter than active dark */
  border-color: #364579;
  color: #aeb8ff;
  opacity: 0.95;
}

/* Compact summary type badge placed in the toolbar */
.type-badge {
  padding: 6px 12px;
  min-height: 36px;           /* align with toolbar controls */
  border-radius: 9999px;       /* pill shape */
  font-size: 0.9rem;
  font-weight: 500;
  background: #f4f6ff;         /* lighter than action buttons */
  color: rgba(10, 16, 125, 0.75);
  border: 1px solid #dbe2ff;
  cursor: default;
  pointer-events: none;        /* non-interactive */
}
.dark .type-badge {
  background: #1f2738;
  color: rgba(174, 184, 255, 0.85);
  border-color: #364579;
}

/* Hide large summary type header; replaced by toolbar badge */
.summary-type-header { display: none; }

/* Legacy divider node (now rendered as toolbar border). Hide if present. */
.summary-divider { display: none !important; }

@media (max-width: 768px) {
  .summary-toolbar {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 18px 0 24px 0;   /* more space above/below divider on narrow screens */
    padding-bottom: 12px;    /* extra breathing room before the hairline */
  }
  .summary-toolbar .right { justify-content: center; }
}

/* Copy status below Copy button */
.summary-actions .copy-group { position: relative; display: flex; flex-direction: column; align-items: center; }
.summary-actions #copySummaryStatus {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  display: block;
  white-space: nowrap;
}
.summary-actions #copySummaryStatus:empty { display: none; }

.summary-next {
  margin: 24px 0 16px;
  display: flex;
  justify-content: center;
}

.summary-next-btn {
  padding: 10px 18px;
  border-radius: 999px;
  background: #0a107d;
  color: #fff;
  border: 1px solid #0a107d;
}

.summary-next-btn:hover {
  background: #222abe;
  border-color: #222abe;
}

/* View Insights CTA (prominent, green, bold) */
.view-insights-btn {
  padding: 12px 20px;
  border-radius: 6px;
  background: #16a34a; /* green-600 */
  color: #fff;
  border: 1px solid #16a34a;
  font-weight: 800;
}
.view-insights-btn:hover {
  background: #15803d; /* green-700 */
  border-color: #15803d;
}

/* Dark mode root */
.dark body {
  color: #e6e6e6;
  background:
      radial-gradient(
        clamp(1000px, 60vw, 1900px) clamp(700px, 44vh, 1200px) at 22% 78%,
        rgba(96, 165, 250, 0.22) 0%, transparent 60%
      ),
      radial-gradient(
        clamp(800px, 50vw, 1600px) clamp(600px, 37vh, 1000px) at 78% 18%,
        rgba(139, 92, 246, 0.18) 0%, transparent 60%
      ),
      radial-gradient(
        clamp(700px, 40vw, 1400px) clamp(500px, 29vh, 800px) at 50% 105%,
        rgba(96, 165, 250, 0.12) 0%, transparent 65%
      ),
    #242830;
}

@media (min-width: 1024px) {
  .dark body {
    background-attachment: fixed;
  }
}
.dark a { color: #9bbcff; }
.dark .card { background: #12161a; border-color: #222; }
.dark .home-card { background: #12161a; border-color: #2a2f36; box-shadow: 0 14px 40px rgba(0,0,0,0.45); }

/* Brand logo styling */
.brand-logo {
  max-width: 250px;
  height: auto;
  margin: 28px auto 20px auto;
  display: block;
  transition: opacity 0.3s ease;
}

.dark .brand-logo {
  opacity: 0;
  position: absolute;
}

.brand-logo.dark-logo {
  opacity: 0;
  position: absolute;
}

.dark .brand-logo.dark-logo {
  opacity: 1;
  position: relative;
}

@media (max-width: 768px) {
  .brand-logo {
    margin: 0px auto 26px auto;
    margin-top: 8px;
    margin-bottom: 28px;
  }
}

.dark .flash.error {
  background: transparent !important; /* Make container invisible in dark mode */
  border: none !important; /* Remove any borders */
  outline: none !important; /* Remove any outlines */
  box-shadow: none !important; /* Remove any shadows */
  margin: 0 !important; /* Override base .flash margin */
}

.dark .flash.error .toast-content {
  background: rgba(239, 68, 68, 0.95);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}
.dark input[type="text"] { background: #0f1215; color: #e6e6e6; border-color: #334155; }
.dark button, .dark a.button { background: #1a1f26; color: #e6e6e6; border-color: #333; }
.dark button:hover, .dark a.button:hover { background: #202632; }
.dark .mdout {
  background: #1f2937;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  color: #d1d5db;
}
.dark .mdout code { background: #1b2330; }
.dark details { background: #12161a; border-color: #222; }
.dark .summary-header .summary-kind { color: #aeb8ff; }
.dark .summary-header .summary-title { color: #b1c2ff; }

.dark .summary-title {
  color: #b1c2ff;
}

.dark .summary-type-header .summary-kind {
  color: #aeb8ff;
}

.dark .video-metadata span {
  color: #9ca3af;
}

.dark .metadata-divider {
  background: #374151;
}
.dark .summary-actions .button { background: #2a3b8f; border-color: #2a3b8f; }
.dark .summary-actions .button:hover { background: #21306f; }
.dark .summary-actions button { color: #aeb8ff; border-color: #2a3b8f; }
.dark .summary-actions button:hover { background: #1b2236; }
.dark .history-item {
  border-bottom-color: #374151;
}

.dark .history-thumbnail {
  background: #1f2937;
}

.dark .thumbnail-placeholder {
  background: #374151;
  color: #9ca3af;
}

.dark .history-title a {
  color: #ECEFF6; /* Default title color for dark mode */
}

.dark .history-title a:hover {
  color: #BFD6FF; /* Cool blue hover color */
}

.dark .summary-type {
  color: #9ca3af;
}

.dark .history-item .history-date { 
  color: #9ca3af; 
}

/* Theme toggle link */
.theme-toggle { font-size: 0.95rem; margin-left: 10px; }
.dark .theme-toggle { color: #cbd5ff; }

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 36px;
  background: #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  margin: 20px 0 8px;
  border: 1px solid #d1d5db;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0a107d 0%, #222abe 100%);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 12px;
}

.progress-message {
  font-size: 0.9rem;
  color: #374151;
  margin: 4px 0 0;
  text-align: center;
}

/* Dark mode progress bar */
.dark .progress-bar {
  background: #1f2937;
  border-color: #374151;
}

.dark .progress-fill {
  background: linear-gradient(90deg, #3b4db8 0%, #5c6fd8 100%);
}

.dark .progress-message {
  color: #d1d5db;
}

/* Error styling for progress messages */
.progress-message.error {
  color: #dc2626;
  font-weight: 600;
}

/* Pricing page styles */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px auto;
  max-width: 800px;
}

.pricing-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  contain: style;
  overflow: visible;
}

.pricing-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.pricing-card.featured {
  border-color: #0a107d;
  box-shadow: 0 4px 20px rgba(10,16,125,0.15);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #0a107d;
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;      /* 12px */
  font-weight: 600;
  letter-spacing: .02em;
}

.pricing-header {
  text-align: center;
  margin-bottom: 24px;
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Align prices horizontally between Free and Pro tiers */
.pricing-card:first-child .price {
  margin-top: 51px; /* Push Free price down to align with Pro yearly price */
}

.pricing-card.featured .price-yearly {
  margin-top: 0; /* Keep Pro yearly price at its current position */
}

.pricing-header h3 {
  font-size: 1.375rem;     /* 22px for balance with price */
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #111;
  line-height: 1.2;
}

/* Billing toggle styles */
.billing-toggle {
  margin: 0 0 16px 0;
}

.toggle-group {
  display: inline-flex;
  align-items: stretch;
  background: #e5e7eb;
  border-radius: 8px;
  padding: 4px; /* remove top padding */
  border: 2px solid #d1d5db;
  box-shadow: none; /* remove top highlight that looks like a gap */
  height: 24px;
  position: relative;
  line-height: 0; 
}

.toggle-option {
  flex: 1;
  position: relative;
  cursor: pointer;
  display: flex;
}

.toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}


.toggle-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 230%;
  box-sizing: border-box;
  padding: 8px 8px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: #6b7280;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: transparent;
  margin: -14px 2px;
  line-height: 1;
}

.toggle-option input[type="radio"]:checked + .toggle-label {
  background: #fff;
  color: #0a107d;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  border: 1px solid #e5e7eb;
}

.toggle-option:hover .toggle-label {
  color: #374151;
}

.toggle-option input[type="radio"]:checked + .toggle-label:hover {
  color: #0a107d;
}

/* Save text styling */
.save-text {
  font-size: 1.2rem;
  color: #059669;
  font-weight: 500;
}

.price {
  font-size: 2.75rem;      /* clearer step above plan name */
  font-weight: 800;
  color: #0a107d;
  margin: 0;
  line-height: 1;          /* tight */
  font-feature-settings: "tnum" 1, "lnum" 1; /* tabular, lining numerals */
}

.price .period {
  font-size: 0.9375rem;    /* 15px */
  font-weight: 400;
  color: #6b7280;
}

.price-yearly {
  font-size: 0.9375rem;
  color: #059669;
  font-weight: 500;
  margin-top: 4px;
  line-height: 1.4;
}

.pricing-features ul {
  list-style: none;
  padding: 3px;
  margin: 0 0 24px 0;
  min-height: 200px;
}

/* Reduce gap above Pro tier features */
.pricing-card.featured .pricing-features ul {
  margin-top: 0;
}

.pricing-features li {
  padding: 9px 0;          /* slightly taller rows */
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;     /* keep rows consistent */
  gap: 8px;
  font-size: 0.9875rem;    /* ~15.8px, reads a hair larger than body */
  line-height: 1.5;
}

/* Remove extra margin from Free tier to align bullets */
.pricing-card:first-child .pricing-features ul {
  margin-top: 0;
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-features li::before {
  content: '✓';
  color: #059669;
  font-weight: bold;
  margin-right: 8px;
  font-size: 1.125rem;     /* 18px check */
  display: inline-block;
  line-height: 1;            /* no extra vertical slack */
}

/* Fully reset the inline info button */
.pricing-features .tooltip-trigger {
  margin: 0 0 0 4px;       /* override global margin-top:16px */
  padding: 0;              /* already set, keep it */
  border: none;            /* already set */
  background: none;        /* already set */
  width: 1em; height: 1em;
  line-height: 1;
  font-size: 1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.1em;  /* baseline tweak */
}
.pricing-features .tooltip-trigger svg { 
  display: block; 
  width: 1em; 
  height: 1em; 
}

.pricing-cta {
  text-align: center;
  width: 100%;
}

.pricing-cta .button {
  width: 100%;
  padding: 12px 24px;
  font-size: 1rem;         /* keep */
  font-weight: 600;
  margin: 0;
  box-sizing: border-box;
  line-height: 1;          /* no vertical wobble */
}

.pricing-cta .button.primary {
  background: #0a107d;
  color: #fff;
  border-color: #0a107d;
}

.pricing-cta .button.primary:hover {
  background: #222abe;
  border-color: #222abe;
}

.current-plan {
  color: #059669;
  font-weight: 600;
  padding: 12px 24px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  display: inline-block;
}

.downgrade {
  color: #6b7280;
  font-style: italic;
  padding: 12px 24px;
}

.pricing-faq {
  margin: 48px 0;
  max-width: 1000px;
}

.pricing-faq h3 {
  font-size: 2rem;            /* 32px for better balance with hero */
  margin-bottom: 24px;
  color: #111;
  text-align: center;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em; /* slightly tighter for large display text */
}

/* Pricing hero section */
.pricing-hero {
  text-align: center;
  margin: 24px 0 48px 0;
}

.pricing-hero h2 {
  font-size: 2.125rem;    /* 34px approx for a stronger header */
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #111;
  line-height: 1.15;
  letter-spacing: -0.01em; /* slightly tighter for large display text */
}

.pricing-hero p {
  font-size: 1rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

/* Tooltip styles */
.tooltip-trigger {
  background: none;
  border: none;
  color: #0a107d;
  font-size: 1em;            /* match surrounding text size */
  cursor: pointer;
  padding: 0;
  margin-left: 4px;          /* a touch more breathing room */
  border-radius: 50%;
  width: 1em;                /* scale with text */
  height: 1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  line-height: 1;            /* no extra internal leading */
  vertical-align: -0.125em;  /* sit on the text baseline nicely */
  transform: none;           /* was translateY(1px) */
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
  background-color: #eef1ff;
  outline: none;
}

/* If the icon is an SVG inside the button, remove its internal padding */
.tooltip-trigger svg {
  display: block;            /* kill descender gap */
  width: 1em;
  height: 1em;
}

.tooltip {
  position: absolute;
  background: #1f2937;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  max-width: 330px; /* Increased width to prevent bullet point wrapping */
  z-index: 1000;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 12px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid #1f2937;
}

/* Mobile tooltip positioning for screens under 480px */
@media (max-width: 480px) {
  .tooltip {
    max-width: 280px !important;
    min-width: 200px !important;
    font-size: 0.8rem;
    padding: 8px 12px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    line-height: 1.4 !important;
    right: 0 !important;
    left: auto !important;
    transform: translateX(-10%) !important;
  }
  
  .tooltip::before {
    top: 12px;
    left: auto;
    right: -4px;
    border-left: 4px solid #1f2937;
    border-right: none;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
  }
}

/* FAQ Accordion styles */
.faq-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.faq-control-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.faq-control-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.faq-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 2px;
}

.faq-item .faq-question {
  border: none;
  box-shadow: none;
}

.faq-question {
  width: 100%;
  padding: 18px 20px;  /* Increased vertical padding */
  background: #fff;
  border-radius: 6px;
  text-align: left;
  font-size: 1.0625rem;    /* ~17px */
  font-weight: 600;
  color: #111;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  margin: 0;
  line-height: 1.5;
}

.faq-question:hover {
  background-color: #f9fafb;
  transform: translateY(-1px);
}

.faq-question:focus {
  outline: 2px solid #0a107d;
  outline-offset: -2px;
}

.faq-icon {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-answer {
  padding: 0 20px 16px 20px;
  display: none;
}

.faq-answer p {
  margin: 0;
  color: #6b7280;
  line-height: 1.7;        /* comfy read */
  font-size: 0.9875rem;    /* ~15.8px */
}

/* Account page styles */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px auto; /* center the two cards horizontally */
  max-width: 820px;
}

.account-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  margin-left: auto;  /* allow centering within grid column */
  margin-right: auto; /* allow centering within grid column */
  width: 100% !important; /* Force full width */
  max-width: 600px !important; /* Consistent max width */
  min-width: 366px !important; /* Prevent shrinking below this */
}

.account-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  color: #111;
}

.account-info {
  margin-bottom: 24px;
}

.info-row {
  display: flex;
  justify-content: flex-start;   /* align start so values can align in a column */
  align-items: center;
  gap: 16px;                     /* consistent gap between label and value */
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  font-weight: 500;
  color: #6b7280;
  flex: 0 0 150px;               /* fixed label column for consistent alignment */
  font-size: 14px;
}

.info-row .value {
  font-weight: 600;
  color: #111;
  text-align: left;
  font-size: 16px;
}

.value.tier-free { color: #059669; }
.value.tier-pro { color: #0a107d; }
.value.status-active { color: #059669; }
.value.status-canceled { color: #dc2626; }
.value.status-past_due { color: #d97706; }
.value.status-none { color: #6b7280; }

.account-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.account-actions .button {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.account-actions .button.secondary {
  background: #fff;
  color: #dc2626;
  border-color: #dc2626;
}

.account-actions .button.secondary:hover {
  background: #fef2f2;
}

.usage-stats {
  margin-bottom: 24px;
}

.usage-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.usage-fill {
  height: 100%;
  background: linear-gradient(90deg, #0a107d 0%, #222abe 100%);
  transition: width 0.3s ease;
}

.usage-text {
  display: flex;
  justify-content: flex-start; /* keep labels near each other */
  align-items: baseline;       /* align text nicely */
  gap: 4px;                   /* add small space between labels on desktop too */
  font-size: 0.87rem;
  margin-bottom: 4px;
}

.usage-text span {
  white-space: nowrap;        /* prevent individual spans from wrapping */
  flex-shrink: 1;             /* allow spans to shrink if needed */
}
.usage-text .used {
  color: #6b7280;
}

/* When showing total instead of used */
.usage-text .total {
  color: #6b7280;
}

.usage-text .remaining {
  color: #059669;
  font-weight: 500;
}

.usage-text .renewal {
  color: #6b7280;
}

.usage-total {
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
}

.low-balance-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
  color: #dc2626;
}

.low-balance-warning .upgrade-link,
.low-balance-warning .topup-link {
  color: #dc2626;
  font-weight: 600;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.account-links {
  margin: 26px auto; /* center - reduced from 48px */
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Compact spacing when two account sections are adjacent */
.account-links--quick-actions { margin-bottom: 10px; }
.account-links--contact { margin-top: 10px; }

.account-links h3 {
  font-size: 1.75rem;
  margin-bottom: 24px;
  color: #111;
  text-align: center; /* center Quick Actions header */
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* 2-card grid for account settings */
.action-grid.two-cards {
  grid-template-columns: repeat(2, 1fr);
  max-width: 600px;
  margin: 0 auto;
}

/* Make single Contact Us card span both columns without affecting other cards */
.account-links .action-grid .action-card.contact-card {
  grid-column: 1 / -1;
  max-width: 520px;
  padding: 12px 18px;
  margin: 0px auto 0 auto; /* reduced top margin */
  text-align: center;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-style: solid; /* solid border per request */
  border-color: rgba(0, 0, 0, var(--contact-card-border-alpha-light)); /* adjustable via CSS var */
  border-width: 2px;           /* more prominence */
}

.account-links .action-grid .action-card.contact-card h4 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin: 0;
}

.account-links .action-grid .action-card.contact-card h4::after { content: none; }

.account-links .action-grid .action-card.contact-card:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.dark .account-links .action-grid .action-card.contact-card {
  border-color: rgba(255, 255, 255, var(--contact-card-border-alpha-dark)); /* adjustable via CSS var */
}

/* Stack contact card text vertically on very small screens */
@media (max-width: 480px) {
  .account-links .action-grid .action-card.contact-card {
    flex-direction: column;
    gap: 6px;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }
  /* Ensure container stretches full width despite parent align-items:center */
  .account-links--contact { 
    align-items: stretch;
    width: 100%;                 /* Full width of parent */
  }
  .account-links--contact .action-grid {
    width: 100%;
    display: grid;               /* keep as grid so items stretch naturally */
    grid-template-columns: 1fr;
    justify-items: stretch;      /* grid items fill the column */
  }
  .account-links--contact .action-grid > .action-card.contact-card {
    display: block;              /* ensure block-level sizing */
    width: 100%;                 /* fill container width */
    max-width: none;             /* remove 520px cap */
    margin: 0;                   /* cancel centering */
    justify-self: stretch;       /* explicit stretch in grid */
    align-self: stretch;         /* stretch vertically if needed */
  }
  .account-links--quick-actions { margin-bottom: 14px !important; }
  .account-links--contact { margin-top: 14px !important; }
}

/* Account settings form improvements - match signup page spacing */
.account-settings-form {
  max-width: 600px !important;
  width: 100% !important;
  margin: 0 auto;
  min-width: 366px !important; /* Prevent content-driven shrinking */
}

.account-settings-form .mb-3 {
  margin-bottom: 1rem !important;
}

/* Tighter spacing for confirmation fields */
.account-settings-form .mb-3.tight-spacing {
  margin-bottom: 0.1rem !important;
}

/* Even tighter spacing for password form */
.account-settings-form .mb-3.tight-spacing.password-field {
  margin-bottom: 0.25rem !important;
}

/* Override Bootstrap mb-3 for password confirmation field */
.account-settings-form .mb-3.password-confirm {
  margin-top: -0.75rem !important; /* Negative margin to pull it closer */
  margin-bottom: 1rem !important;
}

.account-settings-form .form-label {
  font-weight: 500;
  margin-bottom: 4px;
  color: #374151;
}

.account-settings-form .form-control {
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-settings-form .form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
  outline: none;
}

/* Read-only email input styling */
.account-settings-form .form-control[readonly] {
  background-color: #f9fafb;
  color: #6b7280;
  border-color: #e5e7eb;
  cursor: default;
  transition: none;
}

.account-settings-form .form-control[readonly]:focus {
  border-color: #e5e7eb;
  box-shadow: none;
  background-color: #f9fafb;
}

/* Form button improvements - match website branding exactly */
.account-settings-form .btn-group {
  display: flex !important;
  align-items: stretch !important; /* Ensure buttons stretch to same height */
  gap: 12px;
  margin-top: 16px;
}

.account-settings-form .btn {
  flex: 1 !important; /* Make buttons equal width and properly aligned */
  padding: 10px 14px !important;
  border-radius: 8px !important;
  border: 1px solid #ddd !important;
  background: #fff !important;
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer !important;
  font-size: 1rem !important;
  transition: all 0.2s ease !important;
  height: 40px !important; /* Fixed height for consistency */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: auto !important; /* Override any width constraints */
  line-height: 1 !important; /* Remove any line height differences */
  margin: 0 !important; /* Remove any margins */
  vertical-align: top !important; /* Ensure consistent vertical alignment */
  box-sizing: border-box !important; /* Include padding in height calculation */
}

.account-settings-form .btn:hover {
  background: #f7f7f7;
}

.account-settings-form .btn-primary {
  background: #0a107d !important; /* Use your brand blue, not Bootstrap blue */
  border-color: #0a107d !important;
  color: #fff !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(10, 16, 125, 0.2) !important;
  transition: all 0.2s ease !important;
}

.account-settings-form .btn-primary:hover {
  background: #222abe !important; /* Use your brand hover color */
  border-color: #222abe !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(10, 16, 125, 0.3) !important;
}

.account-settings-form .btn-primary:active {
  transform: translateY(0) !important;
}

.account-settings-form .btn-outline-secondary {
  background: #fff;
  border-color: #ddd;
  color: #374151;
}

.account-settings-form .btn-outline-secondary:hover {
  background: #f7f7f7;
  border-color: #bbb;
}

/* Dark mode form improvements - match signup page */
.dark .account-settings-form .form-label {
  color: #d1d5db;
}

.dark .account-settings-form .form-control {
  background-color: #0f1215;
  border-color: #334155;
  color: #e6e6e6;
}

.dark .account-settings-form .form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark .account-settings-form .form-control[readonly] {
  background-color: #374151;
  color: #9ca3af;
  border-color: #4b5563;
}

.dark .account-settings-form .form-control[readonly]:focus {
  border-color: #4b5563;
  box-shadow: none;
  background-color: #374151;
}

.dark .account-settings-form .btn {
  flex: 1 !important; /* Ensure buttons remain equal width in dark mode */
  background: #1a1f26 !important;
  color: #e6e6e6 !important;
  border-color: #333 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: auto !important;
  line-height: 1 !important; /* Remove any line height differences */
  margin: 0 !important; /* Remove any margins */
  vertical-align: top !important; /* Ensure consistent vertical alignment */
  box-sizing: border-box !important; /* Include padding in height calculation */
}

.dark .account-settings-form .btn:hover {
  background: #202632 !important;
}

.dark .account-settings-form .btn-outline-secondary {
  background: #1a1f26;
  border-color: #333;
  color: #e6e6e6;
}

.dark .account-settings-form .btn-outline-secondary:hover {
  background: #202632;
  border-color: #444;
}

/* Make text-muted brighter in dark mode for account settings */
.dark .account-card .text-muted,
.dark .account-settings-form .text-muted {
  color: #d1d5db !important; /* Bright gray for better visibility in dark mode */
}

/* Make primary button use theme indigo, brighter in dark mode for account settings */
.dark .account-settings-form .btn-primary {
  background: #1a1fb8 !important; /* Brighter indigo than theme #0a107d */
  border-color: #1a1fb8 !important;
  color: #fff !important;
  box-shadow: 0 2px 4px rgba(26, 31, 184, 0.3) !important;
}

.dark .account-settings-form .btn-primary:hover {
  background: #222abe !important; /* Theme hover indigo */
  border-color: #222abe !important;
  box-shadow: 0 4px 8px rgba(34, 42, 190, 0.4) !important;
}

/* Responsive grid for 6 cards */
@media (min-width: 1200px) {
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1199px) and (min-width: 768px) {
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.action-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px; /* Increased from 20px for better click targets */
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.action-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #111;
}

.action-card p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Dark mode styles for pricing and account pages */
.dark .pricing-card,
.dark .account-card,
.dark .action-card {
  background: #12161a;
  border-color: #222;
}

/* Dark mode for warning banners */
.dark .account-card div[style*="background: #fef3cd"] {
  background: #451a03 !important;
  border-color: #f59e0b !important;
}

.dark .account-card div[style*="background: #fef3cd"] p {
  color: #fed7aa !important;
}

.dark .pricing-card:hover,
.dark .action-card:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.dark .pricing-card.featured {
  border-color: #3b4db8;
  box-shadow: 0 4px 20px rgba(59,77,184,0.2);
}

/* Dark mode: Match "See Plans" button gradient for Pro card badge and CTA */
.dark .pricing-card.featured .pricing-badge {
  background: linear-gradient(135deg,
              color-mix(in srgb, var(--bs-primary, #5166de) 92%, black 8%) 0%,
              color-mix(in srgb, var(--bs-primary, #5166de) 80%, black 20%) 100%);
  box-shadow: 0 4px 12px rgba(81,102,222,0.22);
}

.dark .pricing-card.featured .pricing-cta .button.primary {
  background: linear-gradient(135deg,
              color-mix(in srgb, var(--bs-primary, #5166de) 92%, black 8%) 0%,
              color-mix(in srgb, var(--bs-primary, #5166de) 80%, black 20%) 100%);
  border: none;
  box-shadow: 0 10px 22px rgba(81,102,222,0.22);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.dark .pricing-card.featured .pricing-cta .button.primary:hover {
  background: linear-gradient(135deg,
              color-mix(in srgb, var(--bs-primary, #5166de) 95%, black 5%) 0%,
              color-mix(in srgb, var(--bs-primary, #5166de) 85%, black 15%) 100%);
  box-shadow: 0 14px 28px rgba(81,102,222,0.28);
  transform: translateY(-1px);
}

/* Shimmer animation for Pro card CTA (matching "See Plans" button) */
.dark .pricing-card.featured .pricing-cta .button.primary::after {
  content: '';
  position: absolute;
  top: 0; left: -40%; height: 100%; width: 40%;
  background: linear-gradient(110deg, rgba(255,255,255,0.0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.0) 100%);
  transform: skewX(-20deg);
  opacity: 0; pointer-events: none;
}

.dark .pricing-card.featured .pricing-cta .button.primary:hover::after {
  left: 120%; opacity: 1; transition: left .6s ease, opacity .6s ease;
}

.dark .pricing-header h3,
.dark .account-card h3,
.dark .account-links h3,
.dark .pricing-faq h3,
.dark .faq-item h4,
.dark .action-card h4 {
  color: #e6e6e6;
}

.dark .account-title {
  color: #e6e6e6;
}

.dark .toggle-group {
  background: #374151;
  border-color: #4b5563;
  box-shadow: none; /* remove inset highlight in dark too */
}

.dark .toggle-label {
  color: #9ca3af;
}

.dark .toggle-option input[type="radio"]:checked + .toggle-label {
  background: #1f2937;
  color: #aeb8ff;
  border-color: #4b5563;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dark .toggle-option:hover .toggle-label {
  color: #d1d5db;
}

.dark .toggle-option input[type="radio"]:checked + .toggle-label:hover {
  color: #aeb8ff;
}

.dark .save-text {
  color: #6ee7b7;
}

.dark .pricing-faq h3 {
  color: #e6e6e6;
}

.dark .pricing-hero h2 {
  color: #e6e6e6;
}

.dark .pricing-hero p {
  color: #a0a0a0;
}

.dark .tooltip-trigger {
  color: #aeb8ff;
  font-size: 1em;            /* match surrounding text size */
  transform: none;           /* was translateY(1px) */
}

.dark .tooltip-trigger:hover,
.dark .tooltip-trigger:focus {
  background-color: #1b2236;
}

.dark .tooltip {
  background: #374151; /* Lighter gray instead of very dark #1f2937 */
  color: #e6e6e6;
}

.dark .tooltip::before {
  border-bottom-color: #374151; /* Match the new lighter background */
}

/* Dark mode mobile tooltip positioning for screens under 480px */
@media (max-width: 480px) {
  .dark .tooltip::before {
    border-left-color: #374151;
  }
}

.dark .faq-item {
  background: #12161a;
  border-color: #222;
}

/* Bootstrap component dark mode integration */
.dark .form-control {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

.dark .form-control:focus {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.dark .form-check-input {
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

.dark .form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.dark .btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.dark .btn-primary:hover {
  background-color: #21306f;
  border-color: #21306f;
}

.dark .btn-outline-secondary {
  color: #d1d5db;
  border-color: #4b5563;
}

.dark .btn-outline-secondary:hover {
  background-color: #374151;
  border-color: #6b7280;
  color: #f9fafb;
}

.dark .invalid-feedback {
  color: #fca5a5;
}

.dark .form-label {
  color: var(--bs-body-color);
}

/* Ensure Bootstrap components don't break Recapify's layout */
.form-control {
  font-family: inherit;
}

.btn {
  font-family: inherit;
}

/* Override Bootstrap's default focus styles to match Recapify */
.form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Fix Bootstrap form-check alignment */
.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  min-height: auto;
}

.form-check-input {
  margin-top: 0 !important;
  margin-right: 0.5rem;
  margin-bottom: 0;
  flex-shrink: 0;
  position: relative;
  top: 0;
}

.form-check-label {
  margin-bottom: 0;
  margin-top: 0;
  cursor: pointer;
  line-height: 1.5;
  display: flex;
  align-items: center;
}

/* Fix tooltip button alignment within form-check */
.form-check .btn {
  margin-top: 0;
  margin-bottom: 0;
  vertical-align: baseline;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1;
}

/* Add visual separation for fact-check option */
.form-check:has(input[type="checkbox"]) {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.dark .form-check:has(input[type="checkbox"]) {
  border-top-color: #374151;
}

/* Home: summary options (placed after global .form-check rules) */
.home .home-form .summary-option {
  margin-top: 6px;
  margin-bottom: 12px;
  margin-left: 28px;
  display: grid;
  grid-template-columns: 0px 1fr;
  column-gap: 2px;
  align-items: start;
}

.home .home-form .summary-option .summary-hint {
  margin: 2px 0 0 0; /* already indented by parent */
  font-size: 0.93rem;
  line-height: 1.25;
  color: rgba(148, 163, 184, 0.95);
}

.dark .home .home-form .summary-option .summary-hint {
  color: rgba(148, 163, 184, 0.76);
}

.home .home-form .summary-option .form-check-input {
  grid-column: 1;
  grid-row: 1;               /* align with label row only */
  align-self: center;         /* vertical align with label */
  margin-top: 0;
  margin-right: 0 !important; /* override global margin */
  transform: translateY(-1px); /* micro baseline nudge */
}

.home .home-form .summary-option .form-check-label {
  grid-column: 2;
  align-self: center;
  margin: 0;
}

.home .home-form .summary-option .summary-hint { grid-column: 2; }

@media (max-width: 480px) {
  .home .home-form .summary-option .summary-hint { font-size: 0.9rem; }
}

/* Disabled fact-check styling */
.fact-check-disabled {
  color: #9ca3af !important;
  cursor: not-allowed;
}

.form-check-input:disabled + .fact-check-disabled {
  color: #9ca3af !important;
}

/* Pro feature badge */
.pro-feature-badge {
  display: inline-block;
  background: linear-gradient(135deg, #0a107d 0%, #222abe 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dark mode for disabled fact-check */
.dark .fact-check-disabled {
  color: #6b7280 !important;
}

.dark .form-check-input:disabled + .fact-check-disabled {
  color: #6b7280 !important;
}

/* Verify Email page */
.verify-form .verify-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.verify-form .verify-btn {
  width: 100%;
  max-width: 320px;
  padding: 12px 20px;
  font-weight: 600;
  color: #fff;
  background-color: var(--bs-primary);
  border: 1px solid var(--bs-primary);
  border-radius: 12px;
}

.verify-form .verify-btn:hover {
  background-color: #21306f;
  border-color: #21306f;
}

.dark .verify-form .verify-btn {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.dark .verify-form .verify-btn:hover {
  background-color: #21306f;
  border-color: #21306f;
}

/* Single OTP input appearance */
.otp-single {
  text-align: left;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 8px auto !important; /* override inline margins to center perfectly */
  box-sizing: border-box;
}

/* Reserve space to avoid layout shift for inline verify messages */
.verify-messages {
  min-height: 32px;
}

.verify-countdown { margin-left: 6px; }
.is-hidden { display: none; }

/* Verification label spacing */
.verify-form label[for="verification_code"] {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  text-align: center;
}

/* Verify logo */
.verify-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.verify-logo-img {
  height: 44px;
  width: auto;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.dark .verify-logo-img {
  background: #111827;
  border-color: #374151;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* ========================================
   Fact Check Results Styling
   ======================================== */

/* Fact check section wrapper (for detailed/brief) */
.fact-check-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.fact-check-section h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: #111827;
}

/* List container for detailed/brief mode */
.fact-check-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Individual fact-check card */
.fact-check-card {
  background: #ffffff;
  border-left: 4px solid #d1d5db;
  border-radius: 4px;
  padding: 1rem;
  margin: 0.75rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Verdict-specific left rail colors */
.fact-check-card.fc-verdict-supported {
  border-left-color: #10b981;
}

.fact-check-card.fc-verdict-mixed {
  border-left-color: #f59e0b;
}

.fact-check-card.fc-verdict-refuted {
  border-left-color: #ef4444;
}

.fact-check-card.fc-verdict-unverifiable {
  border-left-color: #9ca3af;
}
/* For insights mode - card styling under each insight */
/* Match all fact-check cards that come after an <li>, not just the first one */
.mdout ol > li ~ .fact-check-card {
  margin: -0.2rem 0 0.2rem 24px;
}

/* Container for badge and claim on one line */
.fc-badge-and-claim {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* Verdict badge container */
.fc-verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Verdict icon */
.fc-verdict-icon {
  font-size: 1.1rem;
  line-height: 1;
  font-weight: bold;
}

/* Verdict label */
.fc-verdict-label {
  line-height: 1;
}

/* Supported (green) */
.fc-verdict-supported {
  background: #e6f7ed;
  color: #065f46;
  border-color: #6ee7b7;
}

/* Mixed (yellow/amber) */
.fc-verdict-mixed {
  background: #fef8e8;
  color: #92400e;
  border-color: #fcd34d;
}

/* Refuted (red) */
.fc-verdict-refuted {
  background: #ffe9e9;
  color: #991b1b;
  border-color: #fca5a5;
}

/* Unverifiable (gray) */
.fc-verdict-unverifiable {
  background: #f5f5f5;
  color: #4b5563;
  border-color: #d1d5db;
}

/* Claim text */
.fc-claim {
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

.fc-claim em {
  font-style: italic;
}

/* Small screens: stack verdict label above claim for readability */
@media (max-width: 480px) {
  .fc-badge-and-claim {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .fc-claim {
    width: 100%;
  }
}

/* Rationale text */
.fc-rationale {
  color: #111827;
  font-size: 0.95rem;
  line-height: 1.6;
  display: inline;
}

.fc-rationale br {
  line-height: 0;
}

/* Citation markers [n] */
.fc-citation-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  vertical-align: super;
  padding: 0 0.15rem;
  cursor: pointer;
  line-height: 0;
}

.fc-citation-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.dark .fc-citation-link {
  color: #7dd3fc;
}

.dark .fc-citation-link:hover {
  color: #a5e9ff;
}

/* Sources section */
.fact-check-sources {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.fact-check-sources h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: #111827;
}

.fact-check-sources ol {
  margin: 0;
  padding-left: 1.5rem;
  counter-reset: source-counter;
}

.fact-check-sources ol li {
  margin: 0.5rem 0;
  line-height: 1.6;
  scroll-margin-top: 4rem;
}

.fact-check-sources a {
  color: #2563eb;
  text-decoration: none;
  word-break: break-word;
  font-size: 0.9rem;
}

.fact-check-sources a:hover {
  text-decoration: underline;
}

/* Dark mode styles */
.dark .fact-check-section {
  background: #1f2937;
  border-color: #374151;
}

.dark .fact-check-section h2 {
  color: #f9fafb;
}

.dark .fact-check-card {
  background: rgba(17, 24, 39, 0.6);
  box-shadow: none;
  padding: 0.875rem;
}

/* Dark mode verdict-specific tinted overlays - increased opacity for better visibility */
.dark .fact-check-card.fc-verdict-supported {
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.dark .fact-check-card.fc-verdict-mixed {
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.dark .fact-check-card.fc-verdict-refuted {
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.dark .fact-check-card.fc-verdict-unverifiable {
  background: rgba(156, 163, 175, 0.07);
  border: 1px solid rgba(156, 163, 175, 0.2);
}

/* Dark mode verdict badges - fully saturated colors */
.dark .fc-verdict-supported {
  background: rgba(16, 185, 129, 0.2);
  color: #4ade80;
  border-color: rgba(16, 185, 129, 0.4);
}

.dark .fc-verdict-mixed {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.dark .fc-verdict-refuted {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.dark .fc-verdict-unverifiable {
  background: rgba(156, 163, 175, 0.2);
  color: #e5e7eb;
  border-color: rgba(156, 163, 175, 0.4);
}

.dark .fc-claim {
  color: #b0b5bb;
}

.dark .fc-rationale {
  color: #f3f4f6;
}

.dark .fact-check-sources {
  background: #1f2937;
  border-color: #374151;
}

.dark .fact-check-sources h3 {
  color: #f9fafb;
}

.dark .fact-check-sources a {
  color: #7dd3fc;
}

.dark .fact-check-sources a:hover {
  color: #a5e9ff;
}

/* Custom Radio Button Styles */
.form-check-input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background-color: white;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-check-input[type="radio"]:checked {
  border-color: #0d6efd;
  background-color: #0d6efd;
  opacity: 1;
}

.form-check-input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: white;
}

.form-check-input[type="radio"]:hover {
  border-color: #0d6efd;
}

/* Dark mode support for custom radio buttons */
.dark .form-check-input[type="radio"] {
  background-color: var(--bs-body-bg);
  border-color: #6b7280;
}

.dark .form-check-input[type="radio"]:checked {
  border-color: var(--bs-primary);
  background-color: var(--bs-primary);
}

.dark .form-check-input[type="radio"]:hover {
  border-color: var(--bs-primary);
}

/* Custom Checkbox Styles */
.form-check-input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid #4c5464;
  border-radius: 4px;
}

.form-check-input[type="checkbox"]:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.form-check-input[type="checkbox"]:hover {
  border-color: #0d6efd;
}

/* Dark mode support for custom checkboxes */
.dark .form-check-input[type="checkbox"] {
  border-color: #6b7280;
}

.dark .form-check-input[type="checkbox"]:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.dark .form-check-input[type="checkbox"]:hover {
  border-color: #0d6efd;
}

/* Fix placeholder text visibility */
.form-control::placeholder,
input::placeholder,
textarea::placeholder,
select::placeholder {
  opacity: 0.4;
}

/* Dark mode placeholder colors */
.dark .form-control::placeholder,
.dark input::placeholder,
.dark textarea::placeholder,
.dark select::placeholder {
  color: #6b7280;
}

.dark input[type="text"]::placeholder,
.dark input[type="email"]::placeholder,
.dark input[type="password"]::placeholder,
.dark input[type="search"]::placeholder,
.dark input[type="url"]::placeholder {
  color: #6b7280;
}

/* Signup page body styling */
body.signup-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 100px;
}

/* Center signup form on desktop */
@media (min-width: 769px) {
  body.signup-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 100px; /* Keep top padding for header clearance */
  }
  
  body.signup-page .card {
    margin: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
}

/* Login page body styling */
body.login-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 100px;
}

/* Center login form on desktop */
@media (min-width: 769px) {
  body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 100px; /* Keep top padding for header clearance */
  }
  
  body.login-page .card {
    margin: 0;
  }
}

body.login-page .card .login-form {
  max-width: 300px !important;
  width: 300px !important;
}

/* Forgot password page body styling */
body.forgot-password-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 100px;
}

/* Signup form specific styling */
.signup-form {
  max-width: 560px;
  margin: 0 auto;
}

/* Login form specific styling */
.login-form {
  max-width: 560px;
  margin: 0 auto;
}

/* Forgot password form specific styling */
.forgot-password-form {
  max-width: 560px;
  margin: 0 auto;
}

.signup-header {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #0a107d;
  margin: 0 0 1rem 0;
  padding-top: 10px;
  padding-bottom: 12px;
}

.signup-benefits {
  text-align: center;
  margin-bottom: 1.5rem;
}

.benefits-pill {
  display: inline-block;
  padding: 5px 11px;
  background: rgba(10, 16, 125, 0.08);
  color: #475569;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  border: 1px solid rgba(2, 6, 23, 0.08);
  margin-bottom: 10px;
}

.login-header {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #0a107d;
  margin: 0 0 1rem 0;
  padding-top: 10px;
  padding-bottom: 12px;
}

.login-error {
  margin-top: 8px;
  margin-bottom: 12px;
}

/* Make login page error messages display inline instead of as fixed toasts */
body.login-page .flash.error.login-error {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  width: 100%;
  max-width: 100%;
  z-index: auto;
  display: block;
  justify-content: flex-start;
  padding: 0;
  margin: 8px 0 12px 0;
  background: transparent;
  box-shadow: none;
  animation: none;
  color: #dc2626;
  font-size: 0.875rem;
  text-align: center;
}

body.login-page .flash.error.login-error .toast-content {
  background: transparent;
  color: #dc2626;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  max-width: 100%;
  display: block;
}

.dark body.login-page .flash.error.login-error {
  color: #fca5a5;
}

.forgot-password-header {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #0a107d;
  margin: 0 0 1rem 0;
  padding-top: 10px;
  padding-bottom: 10px;
}

.forgot-password-description {
  text-align: center;
  color: #6c757d;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.signup-form .mb-3 {
  margin-bottom: 1rem !important;
}

.login-form .mb-3 {
  margin-bottom: 1rem !important;
}

.forgot-password-form .mb-3 {
  margin-bottom: 1.5rem !important;
}

.signup-form .form-label {
  margin-bottom: 4px;
  font-weight: 500;
}

.login-form .form-label {
  margin-bottom: 4px;
  font-weight: 500;
}

.forgot-password-form .form-label {
  margin-bottom: 4px;
  font-weight: 500;
}

.signup-form .form-control::placeholder {
  color: #6c757d;
}

.login-form .form-control::placeholder {
  color: #6c757d;
}

.login-form .invalid-feedback {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 4px;
  display: block !important;
}

.login-form .form-control.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.login-form .form-control.is-invalid ~ .invalid-feedback {
  display: block !important;
}

/* Remove Bootstrap validation icons from password fields */
.login-form .password-input.is-invalid {
  background-image: none !important;
}

.account-settings-form .invalid-feedback {
  font-size: 0.875rem;
  color: #ef4444;
  margin-top: 4px;
  display: block !important;
}

.account-settings-form .form-control.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.account-settings-form .form-control.is-invalid ~ .invalid-feedback {
  display: block !important;
}

.forgot-password-form .form-control::placeholder {
  color: #6c757d;
}

/* Enhanced input styling with focus state only */
.signup-form .form-control {
  transition: all 0.2s ease;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.signup-form .form-control:focus {
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
  border-color: #0d6efd;
  outline: none;
}

.login-form .form-control {
  transition: all 0.2s ease;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.login-form .form-control:focus {
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
  border-color: #0d6efd;
  outline: none;
}

.forgot-password-form .form-control {
  transition: all 0.2s ease;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.forgot-password-form .form-control:focus {
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
  border-color: #0d6efd;
  outline: none;
}

/* Floating label container */
.signup-form .form-floating {
  position: relative;
}

.login-form .form-floating {
  position: relative;
}

.forgot-password-form .form-floating {
  position: relative;
}

.signup-form .form-floating .form-control {
  height: calc(3.5rem + 2px);
  padding: 1.25rem 0.75rem 0.5rem;
  position: relative;      /* create local stacking context for clarity */
  z-index: 0;              /* keep under the floating label */
}

.login-form .form-floating .form-control {
  height: calc(3.5rem + 2px);
  padding: 1.25rem 0.75rem 0.5rem;
  position: relative;      /* create local stacking context for clarity */
  z-index: 0;              /* keep under the floating label */
}

.forgot-password-form .form-floating .form-control {
  height: calc(3.5rem + 2px);
  padding: 1.25rem 0.75rem 0.5rem;
  position: relative;      /* create local stacking context for clarity */
  z-index: 0;              /* keep under the floating label */
}

.signup-form .form-floating label {
  position: absolute;
  top: 0.85rem;
  left: 0.75rem;
  transform: none;
  padding: 0;
  pointer-events: none;
  transform-origin: 0 0;
  transition: all 0.18s ease;
  color: #6c757d;
  font-size: 1rem;
  background: transparent;
  z-index: 3;               /* ensure label is above input box until it floats */
  opacity: 0.7;
}

.login-form .form-floating label {
  position: absolute;
  top: 0.85rem;
  left: 0.75rem;
  transform: none;
  padding: 0;
  pointer-events: none;
  transform-origin: 0 0;
  transition: all 0.18s ease;
  color: #6c757d;
  font-size: 1rem;
  background: transparent;
  z-index: 3;               /* ensure label is above input box until it floats */
  opacity: 0.7;
}

.forgot-password-form .form-floating label {
  position: absolute;
  top: 0.85rem;
  left: 0.75rem;
  transform: none;
  padding: 0;
  pointer-events: none;
  transform-origin: 0 0;
  transition: all 0.18s ease;
  color: #6c757d;
  font-size: 1rem;
  background: transparent;
  z-index: 3;               /* ensure label is above input box until it floats */
  opacity: 0.7;
}

.signup-form .form-floating .form-control:focus ~ label,
.signup-form .form-floating .form-control:not(:placeholder-shown) ~ label {
  top: -0.9rem;
  transform: scale(0.85);
  padding: 0 0.25rem;
  background: white;
  color: #0d6efd;
}

.login-form .form-floating .form-control:focus ~ label,
.login-form .form-floating .form-control:not(:placeholder-shown) ~ label {
  top: -0.9rem;
  transform: scale(0.85);
  padding: 0 0.25rem;
  background: white;
  color: #0d6efd;
}

.forgot-password-form .form-floating .form-control:focus ~ label,
.forgot-password-form .form-floating .form-control:not(:placeholder-shown) ~ label {
  top: -0.9rem;
  transform: scale(0.85);
  padding: 0 0.25rem;
  background: white;
  color: #0d6efd;
}

/* Shorter input fields for all form fields */
.signup-form #first_name,
.signup-form #last_name {
  max-width: 250px;
}

.signup-form #email {
  max-width: 550px;
}

.signup-form #password {
  width: 300px;
  max-width: 300px;
}

/* Password input with toggle button inside */
.signup-form .password-input-wrapper {
  position: relative;
  display: block;
  width: 300px;
  max-width: 300px;
}

.signup-form .form-floating .password-input-wrapper {
  width: 100%;
  max-width: 300px;
}

.login-form .form-floating .password-input-wrapper {
  width: 100%;
  max-width: 300px;
}

.signup-form .form-floating .password-input-wrapper label {
  position: absolute;
  top: 0.85rem;
  left: 0.75rem;
  transform: none;
  padding: 0;
  pointer-events: none;
  transform-origin: 0 0;
  transition: all 0.18s ease;
  color: #6c757d;
  font-size: 1rem;
  background: transparent;
  z-index: 3;
  opacity: 0.7;
}

.login-form .form-floating .password-input-wrapper label {
  position: absolute;
  top: 0.85rem;
  left: 0.75rem;
  transform: none;
  padding: 0;
  pointer-events: none;
  transform-origin: 0 0;
  transition: all 0.18s ease;
  color: #6c757d;
  font-size: 1rem;
  background: transparent;
  z-index: 3;
  opacity: 0.7;
}

.signup-form .form-floating .password-input-wrapper .password-input:focus ~ label,
.signup-form .form-floating .password-input-wrapper .password-input:not(:placeholder-shown) ~ label {
  top: -0.9rem;
  transform: scale(0.85);
  padding: 0 0.25rem;
  background: white;
  color: #0d6efd;
}

.login-form .form-floating .password-input-wrapper .password-input:focus ~ label,
.login-form .form-floating .password-input-wrapper .password-input:not(:placeholder-shown) ~ label {
  top: -0.9rem;
  transform: scale(0.85);
  padding: 0 0.25rem;
  background: white;
  color: #0d6efd;
}

.signup-form .password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: #6b7280;
  transition: color 0.2s ease;
  height: 32px;
  line-height: 1;
}
.login-form .password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: #6b7280;
  transition: color 0.2s ease;
  height: 32px;
  line-height: 1;
}

.signup-form .password-toggle-btn:hover {
  color: #374151;
}

.login-form .password-toggle-btn:hover {
  color: #374151;
}

.signup-form .password-toggle-btn:focus {
  outline: none;
}

.login-form .password-toggle-btn:focus {
  outline: none;
}

.signup-form .eye-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.login-form .eye-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.signup-form .password-input {
  padding: 1.25rem 45px 0.5rem 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 1px;
  height: calc(3.5rem + 2px);
  width: 100%;
  position: relative;
  z-index: 0;
}

.login-form .password-input {
  padding: 1.25rem 45px 0.5rem 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 1px;
  height: calc(3.5rem + 2px);
  width: 100%;
  position: relative;
  z-index: 0;
}

.signup-form .password-input::placeholder {
  font-size: 1rem;
  letter-spacing: normal;
}

.login-form .password-input::placeholder {
  font-size: 1rem;
  letter-spacing: normal;
}

/* Password strength indicator */
.password-strength {
  margin-top: 4px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.strength-bar {
  width: 60px;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-weak { background: #ef4444; width: 25%; }
.strength-fair { background: #f59e0b; width: 50%; }
.strength-good { background: #10b981; width: 75%; }
.strength-strong { background: #059669; width: 100%; }

/* Email validation indicator */
.email-validation {
  margin-top: 4px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.email-valid { color: #059669; }
.email-invalid { color: #ef4444; }

/* Error states */
.signup-form .form-control.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.signup-form .invalid-feedback {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 4px;
  display: block !important;
}

.signup-form .form-control.is-invalid ~ .invalid-feedback {
  display: block !important;
}

/* Remove Bootstrap validation icons from password fields */
.signup-form .password-input.is-invalid {
  background-image: none !important;
}

.login-form .password-input.is-invalid {
  background-image: none !important;
}


/* Form icons */
.signup-form .input-group {
  position: relative;
}

.signup-form .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 16px;
  pointer-events: none;
  z-index: 2;
}

.signup-form .form-control.has-icon {
  padding-left: 40px;
}

/* Enhanced button styling */
.signup-form .btn-primary {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
  transition: all 0.2s ease;
}

.signup-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.signup-form .btn-primary:active {
  transform: translateY(0);
}

.signup-form .btn-primary {
  margin-bottom: 2rem;
}

.login-form .btn-primary {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
  transition: all 0.2s ease;
}

.login-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.login-form .btn-primary:active {
  transform: translateY(0);
}

.forgot-password-form .btn-primary {
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
  transition: all 0.2s ease;
}

.forgot-password-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.forgot-password-form .btn-primary:active {
  transform: translateY(0);
}

.login-form .btn-primary {
  margin-bottom: 2rem;
}

.forgot-password-form .btn-primary {
  margin-bottom: 2rem;
}

.forgot-password-container {
  margin-top: -2px;
  margin-bottom: 4px;
}

.forgot-password-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
  display: inline-block;
}

.forgot-password-link:hover {
  color: #0d6efd;
  text-decoration: underline;
}

.dark .forgot-password-link {
  color: #9ca3af;
}

.dark .forgot-password-link:hover {
  color: #aeb8ff;
}

.back-to-login-link {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.back-to-login-link:hover {
  color: #0d6efd;
  text-decoration: underline;
}

.dark .back-to-login-link {
  color: #9ca3af;
}

.dark .back-to-login-link:hover {
  color: #aeb8ff;
}

/* Dark mode support for signup form */
.dark .signup-header {
  color: #aeb8ff;
}

.dark .benefits-pill {
  background: rgba(96, 165, 250, 0.12);
  color: #9ca3af;
  border-color: rgba(255, 255, 255, 0.18);
}

/* Dark mode support for login form */
.dark .login-header {
  color: #aeb8ff;
}

/* Dark mode support for forgot password form */
.dark .forgot-password-header {
  color: #aeb8ff;
}

.dark .forgot-password-description {
  color: #9ca3af;
}

.dark .signup-form .form-control::placeholder {
  color: #6b7280;
}

.dark .login-form .form-control::placeholder {
  color: #6b7280;
}

.dark .forgot-password-form .form-control::placeholder {
  color: #6b7280;
}

.dark .signup-form .form-control {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .login-form .form-control {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .forgot-password-form .form-control {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .signup-form .form-control:focus {
  box-shadow: 0 4px 12px rgba(81, 102, 222, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.dark .login-form .form-control:focus {
  box-shadow: 0 4px 12px rgba(81, 102, 222, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.dark .forgot-password-form .form-control:focus {
  box-shadow: 0 4px 12px rgba(81, 102, 222, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.dark .signup-form .form-floating label {
  color: #9ca3af;
  opacity: 0.6;
}

.dark .login-form .form-floating label {
  color: #9ca3af;
  opacity: 0.6;
}

.dark .forgot-password-form .form-floating label {
  color: #9ca3af;
  opacity: 0.6;
}

.dark .signup-form .form-floating .form-control:focus ~ label,
.dark .signup-form .form-floating .form-control:not(:placeholder-shown) ~ label {
  color: #aeb8ff;
  background: #12161a;
}

.dark .login-form .form-floating .form-control:focus ~ label,
.dark .login-form .form-floating .form-control:not(:placeholder-shown) ~ label {
  color: #aeb8ff;
  background: #12161a;
}

.dark .forgot-password-form .form-floating .form-control:focus ~ label,
.dark .forgot-password-form .form-floating .form-control:not(:placeholder-shown) ~ label {
  color: #aeb8ff;
  background: #12161a;
}

.dark .signup-form .form-floating .password-input-wrapper label {
  color: #9ca3af;
  opacity: 0.6;
}

.dark .signup-form .form-floating .password-input-wrapper .password-input:focus ~ label,
.dark .signup-form .form-floating .password-input-wrapper .password-input:not(:placeholder-shown) ~ label {
  color: #aeb8ff;
  background: #12161a;
}


.dark .signup-form .input-icon {
  color: #9ca3af;
}

.dark .signup-form .btn-primary {
  box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

.dark .signup-form .btn-primary:hover {
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.4);
}

.dark .signup-form .password-toggle-btn {
  color: #9ca3af;
}

.dark .signup-form .password-toggle-btn:hover {
  color: #d1d5db;
}

.dark .login-form .password-toggle-btn {
  color: #9ca3af;
}

.dark .login-form .password-toggle-btn:hover {
  color: #d1d5db;
}

/* Revert password page - text styling */
.dark .login-form p.text-muted {
  color: #d1d5db !important; /* Bright gray for better visibility in dark mode */
}

.dark .login-form p {
  color: #d1d5db; /* Bright gray for paragraphs in dark mode */
}

/* Revert password page - button styling */
.login-form .btn-danger {
  background-color: #dc2626; /* Red color */
  border-color: #dc2626;
  color: white;
}

.login-form .btn-danger:hover {
  background-color: #b91c1c; /* Darker red on hover */
  border-color: #b91c1c;
  color: white;
}

.login-form .btn-danger:focus {
  background-color: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
  color: white;
}

.dark .login-form .btn-danger {
  background-color: #dc2626; /* Red color */
  border-color: #dc2626;
  color: white;
}

.dark .login-form .btn-danger:hover {
  background-color: #b91c1c; /* Darker red on hover */
  border-color: #b91c1c;
  color: white;
}

.dark .login-form .btn-danger:focus {
  background-color: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
  color: white;
}

/* Responsive design */
@media (max-width: 768px) {
  .signup-form #first_name,
  .signup-form #last_name,
  .signup-form #email,
  .signup-form #password {
    max-width: 100%;
    width: 100%;
  }
  
  .signup-form .password-input-wrapper {
    width: 100%;
    max-width: 100%;
  }
  
  .signup-form .row .col-md-6 {
    margin-bottom: 1rem;
  }
}

/* Video Info Container */
.video-info-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.video-thumbnail {
  width: 120px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.video-details {
  flex: 1;
  min-width: 0;
}

.video-details h3 {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-details p {
  margin: 0;
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Dark mode support for video info */
.dark .video-info-container {
  background: #1a1f26;
  border-color: #334155;
}

.dark .video-details h3 {
  color: #e6e6e6;
}

.dark .video-details p {
  color: #9ca3af;
}

/* View Insights Container - Enhanced Success Styling */
.view-insights-container {
  margin-top: 0px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
  border-radius: 12px;
  border: 2px solid #28a745;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
  animation: successFadeIn 0.5s ease-out;
}

@keyframes successFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Success decoration above button */
.view-insights-decoration {
  text-align: center;
  margin-bottom: 10px;
}

.success-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  background-color: #28a745;
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  line-height: 32px;
  margin-bottom: 8px;
  animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.success-message {
  color: #28a745;
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

/* Enhanced View Insights Button */
#viewInsightsBtn {
  background-color: #28a745;
  border-color: #28a745;
  color: white;
  min-width: 200px;
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

#viewInsightsBtn:hover {
  background-color: #218838;
  border-color: #1e7e34;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}

#viewInsightsBtn .btn-text {
  margin-right: 8px;
}

#viewInsightsBtn .btn-arrow {
  font-size: 18px;
  transition: transform 0.3s ease;
}

#viewInsightsBtn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Dark mode support for View Insights container */
.dark .view-insights-container {
  background: linear-gradient(135deg, #1a2e1a 0%, #0f1f0f 100%);
  border-color: #28a745;
}

.dark .success-message {
  color: #4ade80;
}

.dark #viewInsightsBtn {
  background-color: #28a745;
  border-color: #28a745;
}

.dark #viewInsightsBtn:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

.dark .faq-question {
  color: #e6e6e6;
  background: #12161a;
  border-color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dark .faq-question:hover {
  background: #22272d;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.dark .faq-item {
  background: #1a1f26;
  border-color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dark .faq-item .faq-question {
  background: #1a1f26;
}

.dark .faq-control-btn {
  background: #12161a;
  border-color: #374151;
  color: #e6e6e6;
}

.dark .faq-control-btn:hover {
  background: #1a1f26;
  border-color: #4b5563;
}

.dark .faq-question:focus {
  outline-color: #3b4db8;
}

.dark .faq-icon {
  color: #a0a0a0;
}

.dark .faq-icon path {
  stroke: currentColor;
}

.dark .faq-answer p {
  color: #a0a0a0;
}

.dark .price {
  color: #aeb8ff;
}

.dark .price-yearly {
  color: #6ee7b7;
}

.dark .pricing-features li,
.dark .info-row {
  border-bottom-color: #222;
}

.dark .info-row .label,
.dark .action-card p,
.dark .faq-item p {
  color: #a0a0a0;
}

.dark .info-row .value {
  color: #e6e6e6;
}

.dark .current-plan {
  background: #064e3b;
  border-color: #065f46;
  color: #6ee7b7;
}

.dark .downgrade {
  color: #6b7280;
}

.dark .usage-bar {
  background: #1f2937;
}

.dark .usage-text .renewal {
  color: #9ca3af;
}

.dark .low-balance-warning {
  background: #431317;
  border-color: #7f1d1d;
  color: #fca5a5;
}

.dark .low-balance-warning .upgrade-link,
.dark .low-balance-warning .topup-link {
  color: #fca5a5;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.dark .faq-item {
  border-bottom-color: #222;
}

/* Back to home button spacing and font adjustments */
.back-to-home {
  margin-top: 12px;  /* 12-16px below navbar */
  margin-bottom: 2px;  /* Reduced from 4px to 2px for tighter spacing */
  max-width: 860px;  /* Match content column width */
  margin-left: auto;
  margin-right: auto;
  padding: 0 8px;  /* Match content padding */
  text-align: left !important;  /* Force left alignment */
  align-self: flex-start !important;  /* Override parent centering */
  width: 100%;  /* Take full width of container */
}

.back-to-home a {
  display: inline-block;
  padding: 12px 16px;  /* Comfy hit area: 40-44px tall with padding */
  font-size: 0.9rem;
  color: #6b7280;
  text-decoration: none;
  border-radius: 20px;  /* Pill shape */
  transition: all 0.15s ease;  /* Short transition: 120-160ms */
  min-height: 40px;  /* Ensure minimum 40px height */
  line-height: 1.2;
  display: inline-flex;  /* Changed from flex to inline-flex */
  align-items: center;
  background: transparent;
  width: auto;  /* Only as wide as content */
}

.back-to-home a:hover {
  color: #0a107d;
  text-decoration: underline;  /* Only underline on hover */
}

.back-to-home a:focus {
  color: #0a107d;
  text-decoration: underline;  /* Only underline on focus */
  outline: none;  /* Remove outline */
}

/* Dark mode for back to home button */
.dark .back-to-home a {
  color: #9ca3af;
}

.dark .back-to-home a:hover {
  color: #aeb8ff;
  text-decoration: underline;
}

.dark .back-to-home a:focus {
  color: #aeb8ff;
  text-decoration: underline;
  outline: none;  /* Remove outline */
}

/* Back to account button - account settings page specific */
.back-to-account {
  margin-top: 12px;  /* 12-16px below navbar */
  margin-bottom: 10px;  /* 8-12px above title */
  max-width: 860px;  /* Match content column width */
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;  /* Match content padding */
  text-align: left !important;  /* Force left alignment */
  align-self: flex-start !important;  /* Override parent centering */
  width: 100%;  /* Take full width of container */
}

.back-to-account a {
  display: inline-block;
  padding: 12px 16px;  /* Comfy hit area: 40-44px tall with padding */
  font-size: 0.9rem;
  color: #6b7280;
  text-decoration: none;
  border-radius: 20px;  /* Pill shape */
  transition: all 0.15s ease;  /* Short transition: 120-160ms */
  min-height: 40px;  /* Ensure minimum 40px height */
  line-height: 1.2;
  display: inline-flex;  /* Changed from flex to inline-flex */
  align-items: center;
  background: transparent;
  width: auto;  /* Only as wide as content */
}

.back-to-account a:hover {
  color: #0a107d;
  text-decoration: underline;  /* Only underline on hover */
}

.back-to-account a:focus {
  color: #0a107d;
  text-decoration: underline;  /* Only underline on focus */
  outline: none;  /* Remove outline */
}

/* Dark mode for back to account button */
.dark .back-to-account a {
  color: #9ca3af;
}
.dark .back-to-account a:hover {
  color: #aeb8ff;
  text-decoration: underline;
}

.dark .back-to-account a:focus {
  color: #aeb8ff;
  text-decoration: underline;
  outline: none;  /* Remove outline */
}



/* Simplified header styles - unified design */

/* Simplified cell styles - unified design */


.summary-title-table {
  font-weight: 500;
  line-height: 1.3;
  font-size: 0.9rem;
  max-width: 500px;
  word-wrap: break-word;
  white-space: normal;
}

/* Unified popular summary type badge */
.popular-summary-type-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  padding: 4px 4px; /* Balanced padding */
  border-radius: 0px; /* Straight edges */
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: capitalize;
}

/* Light mode */
:not(.dark) .popular-summary-type-badge {
  background: rgba(59, 130, 246, 0.1) !important;
  color: #2563eb !important;
  font-size: 0.75rem !important;
  padding: 4px 4px !important;
  border-radius: 0px !important;
}

/* Dark mode */
.dark .popular-summary-type-badge {
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  padding: 4px 4px !important;
  border-radius: 0px !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3) !important;
}

/* ==============================
   Recommended Section - CONSOLIDATED
   ============================== */

/* Base Section Styles */
.recommended-section {
  width: 940px;
  max-width: 940px;
  margin: 2rem auto;
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  /* left: 50%;
  transform: translateX(-50%); */
}

/* Header Styles */
.recommended-header {
  text-align: center;
}

.recommended-header h3 {
  color: #2d3748;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.recommended-subtitle {
  color: #718096;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Table Styles */
.recommended-table {
  overflow: visible;
}

.recommended-table .table {
  width: 100%;
  margin-bottom: 0;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  table-layout: fixed;
}

.recommended-table .table td {
  background: #f8f9fa;
  border: none;
  padding: 1rem;
}

.recommended-table .table th {
  background: #e9ecef;
  border: none;
  padding: 0.75rem 1rem;
}

/* Dark Mode Styles */
.dark .recommended-section {
  background: #12161a !important;
  border: 1px solid #2a2f36 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.dark .recommended-header h3 {
  color: #e2e8f0 !important;
}

.dark .recommended-subtitle {
  color: #a0aec0 !important;
}

.dark .recommended-table .table {
  background: #2d3748 !important;
  border: 1px solid #4a5568 !important;
}

.dark .recommended-table .table td {
  background: #2d3748 !important;
  color: #e2e8f0 !important;
  border: none !important;
}

.dark .recommended-table .table th {
  background: #4a5568 !important;
  color: #e2e8f0 !important;
  border: none !important;
}

.dark .recommended-table .table tbody tr,
.dark .recommended-table .table tbody tr td {
  border-bottom: 1px solid #6b7280 !important;
}

/* Light Mode Overrides */
:not(.dark) .recommended-section {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 1rem;
}

:not(.dark) .recommended-header h3 {
  color: #000000;
  font-weight: 600;
}

:not(.dark) .recommended-subtitle {
  color: #374151;
}

:not(.dark) .recommended-table .table {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

:not(.dark) .recommended-table .table th {
  background: rgba(251, 191, 36, 0.1);
  color: #000000;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  border-left: none;
  border-right: none;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
}

:not(.dark) .recommended-table .table tbody tr {
  border-bottom: 1px solid #d1d5db !important;
}

/* Recommended Grid Styles */
.recommended-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  width: 100%;
}

.recommended-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #d1d5db; /* slightly more prominent in light mode */
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.recommended-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

/* Dark mode: light (white) shadow for lift */
.dark .recommended-card { box-shadow: 0 1.5px 3px rgba(255,255,255,.06); }
.dark .recommended-card:hover { box-shadow: 0 6px 20px rgba(255,255,255,.10); }


.recommended-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #e9ecef;
}

.recommended-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recommended-card-thumb--placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  color: #64748b;
}

.recommended-card-body {
  padding: 12px;
  gap: 8px;
  display: flex;
  flex-direction: column;
}

.recommended-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25rem;
  max-height: 2.5rem; /* ~2 lines */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* show up to 2 lines */
  line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.recommended-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.recommended-duration {
  color: #64748b;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 992px) {
  .recommended-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .recommended-grid { grid-template-columns: 1fr; }
}

/* Small phones: slightly smaller cards and clearer hierarchy */
@media (max-width: 480px) {
  .recommended-grid { gap: 24px; }
  .recommended-card { border-radius: 6px; }
  .recommended-card-body { padding: 12px; }

  .recommended-card-title {
    font-size: 0.84rem;
    line-height: 1.2rem;
    max-height: 2.4rem; /* keep 2 lines */
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .popular-summary-type-badge {
    font-size: 0.70rem !important;
    padding: 2px 4px !important;
  }

  .recommended-duration { font-size: 0.8rem; }

  /* Slightly reduce thumbnail footprint while keeping 16:9 */
  .recommended-card-thumb {
    width: 94%;
    margin: 6px auto 0;
    border-radius: 8px;
  }
  .recommended-card-thumb img { border-radius: 8px; }
}

/* Dark mode */
.dark .recommended-card { background: #1f2937; border-color: #374151; }
.dark .recommended-card-thumb { background: #2a2f36; }
.dark .recommended-card-title { color: #e5e7eb; }
.dark .recommended-duration { color: #9ca3af; }

/* Fallback for browsers without -webkit-line-clamp support */
@supports not (-webkit-line-clamp: 2) {
  .recommended-card-title {
    white-space: nowrap;
  }
}

/* Recommended Thumbnail Styles */
.recommended-thumbnail {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.recommended-thumbnail-placeholder {
  width: 120px;
  height: 80px;
  background: #f3f4f6;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 1.2rem;
}

/* Desktop responsive sizing */
@media (min-width: 1025px) {
  .recommended-thumbnail {
    width: 144px;
    height: 96px;
  }
  
  .recommended-thumbnail-placeholder {
    width: 144px;
    height: 96px;
  }
}

/* Desktop Column Widths */
@media (min-width: 1025px) {
  .recommended-table .table th:nth-child(1),
  .recommended-table .table td:nth-child(1) {
    width: 160px !important;
  }
  
  .recommended-table .table th:nth-child(2),
  .recommended-table .table td:nth-child(2) {
    width: 280px !important;
    max-width: 280px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 0.1rem !important;
  }
  
  .recommended-table .table th:nth-child(3),
  .recommended-table .table td:nth-child(3) {
    width: 130px !important;
  }
  
  .recommended-table .table th:nth-child(4),
  .recommended-table .table td:nth-child(4) {
    width: 80px !important;
  }
  
  .recommended-table .table {
    table-layout: fixed !important;
  }
  
  /* Smaller font size for duration values on desktop */
  .recommended-table .duration-value {
    font-size: 0.9rem !important;
  }
}

/* Additional Column Rules */
.recommended-table .table td:nth-child(3) {
  min-width: 140px !important;
  width: 140px !important;
}

.recommended-table .table th:nth-child(3),
.recommended-table .table td:nth-child(3) {
  width: 140px !important;
}

.recommended-table .summary-title-table {
  max-width: 100% !important;
  width: 100% !important;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .recommended-section {
    width: 90%;
    max-width: 90%;
    margin: 1.5rem auto;
    padding: 0.75rem;
  }
}

/* Hover effect for video titles on desktop/tablet */
@media (min-width: 769px) {
  .recommended-table .summary-title-table {
    transition: text-decoration 0.2s ease;
  }

  .recommended-table .summary-title-table:hover {
    text-decoration: underline;
  }
}

@media (max-width: 768px) {
  .recommended-section {
    width: 95%;
    max-width: 95%;
    margin: 1rem auto;
    padding: 0.5rem;
  }
  
  .recommended-header h3 {
    font-size: 1.25rem;
  }
  
  .recommended-subtitle {
    font-size: 0.8rem;
  }
  
  .recommended-table .table th,
  .recommended-table .table td {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .recommended-table .table th:nth-child(1),
  .recommended-table .table td:nth-child(1) {
    width: 80px;
  }
  
  .recommended-table .table th:nth-child(3),
  .recommended-table .table td:nth-child(3) {
    width: 70px;
  }
  
  .recommended-table .table th:nth-child(4),
  .recommended-table .table td:nth-child(4) {
    width: 80px;
  }
  
  .recommended-table .table th:nth-child(5),
  .recommended-table .table td:nth-child(5) {
    width: 60px;
  }
  
  .summary-title-table {
    max-width: 200px;
    font-size: 0.8rem;
  }
  
  .duration-value,
  .views-value {
    font-size: 0.80rem;
  }
}

@media (max-width: 480px) {
  .recommended-section {
    width: 98%;
    max-width: 98%;
    margin: 2.2rem auto;
    padding: 0;
    left: auto;
    transform: none;
  }
  
  .recommended-header h3 {
    font-size: 1.1rem;
  }
  
  .recommended-subtitle {
    font-size: 0.75rem;
    padding-bottom: 0.6rem;
  }
  
  .recommended-table {
    overflow: visible;
  }
  
  .recommended-table .table {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
  }
  
  .recommended-table .table thead {
    display: none;
  }
  
  .recommended-table .table tbody {
    display: block;
    width: 100%;
  }
  
  .recommended-table .table tbody tr {
    display: block;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
  }
  
  .recommended-table .table tbody tr td {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
  }
  
  .recommended-table .table tbody tr td:nth-child(1) {
    float: left;
    width: 60px;
    margin-right: 0.75rem;
  }
  
  .recommended-table .table tbody tr td:nth-child(2) {
    overflow: hidden;
    margin-bottom: 0.25rem;
  }
  
  .recommended-table .table tbody tr td:nth-child(3),
  .recommended-table .table tbody tr td:nth-child(4),
  .recommended-table .table tbody tr td:nth-child(5) {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.65rem;
    color: #9ca3af;
    border: none !important;
    white-space: nowrap;
  }
  
  .summary-title-table {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
  }
  
  .duration-value,
  .views-value {
    font-size: 0.7rem;
  }
  
  .recommended-table .table tbody tr::after {
    content: "";
    display: table;
    clear: both;
  }
  
  .dark .recommended-table .table tbody tr {
    background: #2d3748 !important;
    border: 1px solid #4a5568 !important;
  }
  
  :not(.dark) .recommended-table .table tbody tr {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
  }
  
  :not(.dark) .recommended-table .table tbody tr td:nth-child(3),
  :not(.dark) .recommended-table .table tbody tr td:nth-child(4),
  :not(.dark) .recommended-table .table tbody tr td:nth-child(5) {
    color: #6b7280;
  }
}

/* Medium Screen Styles */
@media (min-width: 481px) and (max-width: 1024px) {
  #recommended-section {
    width: 90% !important;
    max-width: 800px !important;
    margin: 1.5rem auto !important;
    padding: 1rem !important;
    left: auto !important;
    transform: none !important;
  }
  
  #recommended-table .table th:nth-child(1),
  #recommended-table .table td:nth-child(1) {
    width: 18% !important;
    min-width: 60px !important;
    max-width: 120px !important;
    padding-right: 8px !important;
  }
  
  #recommended-table .table th:nth-child(2),
  #recommended-table .table td:nth-child(2) {
    width: 46% !important;
    padding-left: 8px !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  #recommended-table .table th:nth-child(3),
  #recommended-table .table td:nth-child(3) {
    width: 20% !important;
  }
  
  #recommended-table .table th:nth-child(4),
  #recommended-table .table td:nth-child(4) {
    width: 12% !important;
    min-width: 50px !important;
    padding: 4px 4px 4px 8px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }
  
  #recommended-table .table td:nth-child(4) {
    padding: 16px 0px !important;
  }
  
  #recommended-table .duration-value {
    font-size: 0.75rem !important;
  }
  
  #recommended-table .table {
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  #recommended-table .table td:nth-child(1) img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  #recommended-table .popular-summary-type-badge {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .popular-summary-type-badge {
    font-size: 0.7rem;
    padding: 6px 6px;
  }
}

@media (max-width: 480px) {
  .popular-summary-type-badge {
    font-size: 0.7rem !important;
    padding: 4px 6px !important;
  }
}



.dark .summary-title-table {
  color: #ECEFF6 !important;
  font-weight: 500 !important;
}

.dark .duration-value,
.dark .views-value {
  color: #9ca3af !important;
  font-weight: 500 !important;
}




/* -----------------------
   Popular Summary Page
   ----------------------- */

.popular-summary-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 80px;
}

.popular-summary-header {
  text-align: center;
  margin-bottom: 32px;
}

.popular-summary-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 16px;
  line-height: 1.3;
}

.summary-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}


.duration-info {
  color: #6b7280;
  font-size: 0.9rem;
}

.free-badge {
  background: #10b981;
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.summary-content-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #374151;
}

.summary-text h1, .summary-text h2, .summary-text h3 {
  color: #111;
  margin-top: 24px;
  margin-bottom: 12px;
}

.summary-text h1:first-child,
.summary-text h2:first-child,
.summary-text h3:first-child {
  margin-top: 0;
}

.summary-text p {
  margin-bottom: 16px;
}

.summary-text ul, .summary-text ol {
  margin-bottom: 16px;
  padding-left: 24px;
}
.summary-text li {
  margin-bottom: 8px;
}

.summary-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.summary-actions .btn {
  padding: 12px 24px;
  font-weight: 500;
  border-radius: 8px;
}

/* Dark mode for popular summary page */
.dark .popular-summary-header h1 {
  color: #e6e6e6;
}

.dark .duration-info {
  color: #9ca3af;
}

.dark .summary-content-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .summary-text {
  color: #d1d5db;
}

.dark .summary-text h1, 
.dark .summary-text h2, 
.dark .summary-text h3 {
  color: #e6e6e6;
}

/* Responsive adjustments for popular summary page */
@media (max-width: 768px) {
  .popular-summary-container {
    padding: 16px;
  }
  
  .popular-summary-header h1 {
    font-size: 1.5rem;
  }
  
  .summary-info {
    gap: 12px;
  }
  
  .summary-content-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .summary-actions {
    gap: clamp(8px, calc(5vw - 10px), 14px);  /* Scales from 8px to 14px */
    justify-content: center;  /* Center them */
    flex-wrap: wrap;  /* Allow wrapping if needed on tiny screens */
  }
  
  .summary-actions .button,
  .summary-actions button {
    padding: 6px 10px;  /* Smaller padding */
    font-size: 0.85rem;  /* Slightly smaller text */
  }
  
  .summary-actions .btn {
    padding: 8px 12px;  /* Smaller size for popular summary page */
    font-size: 0.85rem;
  }
}


/* -----------------------
   History Privacy Controls
   ----------------------- */

.privacy-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* History list meta (badge + date) */
.privacy-controls .summary-type {
  font-size: 0.78rem;
  font-weight: 500;
  background: #eef2ff;          /* light indigo bg */
  color: #374151;               /* slate-700 text */
  padding: 2px 8px;
  border-radius: 999px;         /* pill */
}

.privacy-controls .history-date {
  font-size: 0.8rem;
  color: #6b7280;               /* muted */
}

.privacy-controls .history-date::before {
  content: none;
  margin: 0;
}

.dark .privacy-controls .summary-type {
  background: #1f2937;          /* gray-800 */
  color: #cbd5ff;               /* indigo-200 */
}

@media (max-width: 768px) {
  .privacy-controls { gap: 6px; flex-wrap: wrap; }
  .privacy-controls .history-date::before { content: none; }
}

.privacy-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  height: 28px;
  box-sizing: border-box;
}

.privacy-badge.public {
  background: #10b981;
  color: #fff;
}

.privacy-badge.private {
  background: #6b7280;
  color: #fff;
}

.privacy-toggle-btn {
  padding: 4px 8px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  white-space: nowrap;
  height: 28px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0 !important; /* Override global button margin */
}

.privacy-toggle-btn.make-public {
  color: #10b981;
  border-color: #10b981;
}

.privacy-toggle-btn.make-public:hover {
  background: #10b981;
  color: #fff;
}

.privacy-toggle-btn.make-private {
  color: #6b7280;
  border-color: #6b7280;
}

.privacy-toggle-btn.make-private:hover {
  background: #6b7280;
  color: #fff;
}

/* Dark mode for privacy controls */
.dark .privacy-toggle-btn.make-public {
  color: #34d399;
  border-color: #34d399;
}

.dark .privacy-toggle-btn.make-public:hover {
  background: #34d399;
  color: #1f2937;
}

.dark .privacy-toggle-btn.make-private {
  color: #9ca3af;
  border-color: #9ca3af;
}

.dark .privacy-toggle-btn.make-private:hover {
  background: #9ca3af;
  color: #1f2937;
}

/* Delete button styling */
.delete-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 6px;
  margin-top: 1px;
  opacity: 0.7;
  height: 22px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
}

.delete-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
  opacity: 1;
}

.delete-btn:focus {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.dark .delete-btn {
  border-color: #4b5563;
  color: #9ca3af;
}

.dark .delete-btn:hover {
  background: #431317;
  border-color: #fca5a5;
  color: #fca5a5;
}

.dark .delete-btn:focus {
  outline-color: #fca5a5;
}

/* Fresh delete action button - ghost/outline destructive style */
.delete-action-btn {
  background: #fdf2f8; /* rose-50 */
  border: 1px solid #fecaca; /* rose-300 */
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #be185d; /* rose-700 */
  text-decoration: none;
  display: inline-flex;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0px;
  margin-right: 0px;
  margin-top: 0px !important;
  line-height: 1.2;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
}

.delete-action-btn:hover {
  background: #fce7f3; /* rose-100 */
  border-color: #fecaca; /* rose-300 */
  color: #be185d; /* rose-700 */
  text-decoration: none;
}

.delete-action-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(252, 165, 165, 0.6); /* rose-300/60 */
  text-decoration: none;
}

.delete-action-btn:visited {
  color: #be185d; /* rose-700 */
  text-decoration: none;
}

.dark .delete-action-btn {
  background: rgba(244, 63, 94, 0.1); /* rose-500/10 */
  border-color: rgba(251, 113, 133, 0.3); /* rose-400/30 */
  color: #fda4af; /* rose-300 */
}

.dark .delete-action-btn:hover {
  background: rgba(244, 63, 94, 0.15); /* rose-500/15 */
  border-color: rgba(251, 113, 133, 0.3); /* rose-400/30 */
  color: #fecaca; /* rose-200 */
}

.dark .delete-action-btn:focus {
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.5); /* rose-400/50 */
}

.dark .delete-action-btn:visited {
  color: #fda4af; /* rose-300 */
}

/* -----------------------
   No Results Message
   ----------------------- */

.no-results-message {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 8px;
  margin: 20px 0;
}

.no-results-message p {
  margin: 10px 0;
}

.no-results-message a {
  color: #0d6efd;
  text-decoration: none;
}

.no-results-message a:hover {
  text-decoration: underline;
}

/* Dark mode for no results message */
.dark .no-results-message {
  background: #1f2937;
  color: #9ca3af;
}

.dark .no-results-message a {
  color: #aeb8ff;
}

.dark .no-results-message a:hover {
  color: #c7d2fe;
}

/* -----------------------
   Search Loading State
   ----------------------- */

.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: #6b7280;
  font-size: 0.9rem;
  background: #f9fafb;
  border-radius: 8px;
  margin: 20px 0;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #0d6efd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dark mode for search loading */
.dark .search-loading {
  background: #1f2937;
  color: #9ca3af;
}

.dark .loading-spinner {
  border-color: #374151;
  border-top-color: #aeb8ff;
}

/* -----------------------
   Original Video Link
   ----------------------- */

.original-video-link {
  margin: 24px 0;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.original-video-link p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.original-video-link a {
  color: var(--link-color);
  text-decoration: none;
  word-break: break-all;
}

.original-video-link a:hover {
  text-decoration: underline;
}

.dark .original-video-link {
  background: var(--card-bg-dark);
  border-color: var(--border-color-dark);
}

.dark .original-video-link p {
  color: var(--text-secondary-dark);
}

.dark .original-video-link a {
  color: var(--link-color-dark);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .original-video-link {
    margin: 16px 0;
    padding: 12px;
  }
  
  .original-video-link p {
    font-size: 0.95rem;
  }
}

/* -----------------------
   History Header Controls
   ----------------------- */

.history-header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.select-and-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-filter {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px; /* Reduced from 8px to bring icon closer to input */
  margin-top: 42px;  /* Reduced from 24px to bring it closer to back button */
  margin-bottom: 0px;  /* Add bottom margin to separate from history items */
  max-width: 860px;  /* Match content column width */
  margin-left: auto;
  margin-right: auto;
  padding: 0 0px;  /* Match content padding */
}

/* -----------------------
   Show More Button
   ----------------------- */

.show-more-container {
  text-align: center;
  margin: 6px 0 12px 0;
  padding-right: 8px;
}

.show-more-link {
  color: #0d6efd;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.show-more-link:hover {
  text-decoration: underline;
  color: #0b5ed7;
}

.show-more-link:active {
  color: #0a58ca;
}

/* Dark mode for show more link */
.dark .show-more-link {
  color: #aeb8ff;
}

.dark .show-more-link:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

.dark .show-more-link:active {
  color: #93a5ff;
}

/* -----------------------
   Per-Page Selector
   ----------------------- */

.per-page-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
  flex-shrink: 0;
}

.per-page-label {
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
  margin-top: 0 !important; /* Override global label margin */
  vertical-align: middle; /* Align with select element */
}

.per-page-select {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.per-page-select:hover {
  border-color: #9ca3af;
}

.per-page-select:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Dark mode for per-page selector */
.dark .per-page-label {
  color: #9ca3af;
}

.dark .per-page-select {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .per-page-select:hover {
  border-color: #4b5563;
}

.dark .per-page-select:focus {
  border-color: #aeb8ff;
  box-shadow: 0 0 0 3px rgba(174, 184, 255, 0.1);
}

/* -----------------------
   Privacy Confirmation Modal
   ----------------------- */

.privacy-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.privacy-modal-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.privacy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.privacy-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.privacy-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.privacy-modal-close:hover {
  color: #374151;
}

.privacy-modal-body {
  padding: 20px 24px;
}

.privacy-modal-body p {
  margin: 0 0 16px;
  color: #374151;
  line-height: 1.5;
}

.privacy-modal-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
}

.privacy-modal-summary strong {
  color: #0d6efd;
  font-weight: 500;
}

.privacy-modal-actions {
  display: flex;
  gap: 12px;
  padding: 16px 24px 24px;
  justify-content: flex-end;
}

.privacy-modal-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
}

.privacy-modal-cancel {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.privacy-modal-cancel:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.privacy-modal-confirm {
  color: #fff;
}

.privacy-modal-confirm.make-public {
  background: #10b981;
  border-color: #10b981;
}

.privacy-modal-confirm.make-public:hover {
  background: #059669;
  border-color: #059669;
}

.privacy-modal-confirm.make-private {
  background: #6b7280;
  border-color: #6b7280;
}

.privacy-modal-confirm.make-private:hover {
  background: #4b5563;
  border-color: #4b5563;
}

/* Dark mode for privacy modal */
.dark .privacy-modal-content {
  background: #1f2937;
  border: 1px solid #374151;
}

.dark .privacy-modal-header {
  border-bottom-color: #374151;
}

.dark .privacy-modal-header h3 {
  color: #f9fafb;
}

.dark .privacy-modal-close {
  color: #9ca3af;
}

.dark .privacy-modal-close:hover {
  color: #d1d5db;
}

.dark .privacy-modal-body p {
  color: #d1d5db;
}

.dark .privacy-modal-summary {
  background: #374151;
  border-color: #4b5563;
}

.dark .privacy-modal-summary strong {
  color: #aeb8ff;
}

.dark .privacy-modal-cancel {
  background: #374151;
  color: #d1d5db;
  border-color: #4b5563;
}

.dark .privacy-modal-cancel:hover {
  background: #4b5563;
  border-color: #6b7280;
}

.dark .privacy-modal-confirm.make-public {
  background: #22c55e;
  border-color: #22c55e;
  color: #000;
}

.dark .privacy-modal-confirm.make-public:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #000;
}

.dark .privacy-modal-confirm.make-private {
  background: #9ca3af;
  border-color: #9ca3af;
}

.dark .privacy-modal-confirm.make-private:hover {
  background: #6b7280;
  border-color: #6b7280;
}
/* Sticky Footer */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 0; /* straight edges */
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0px 0;
  margin: 0px 0px 0px 0px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08), 0 -1px 3px rgba(0, 0, 0, 0.1);
}

.footer-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 0px 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.footer-link {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.footer-link:hover {
  color: #6b7280;
  background: #f8fafc;
  border-color: #e2e8f0;
  text-decoration: none;
}

/* Dark mode footer */
.dark .sticky-footer {
  background: rgba(15, 18, 21, 0.95);
  border-radius: 0; /* straight edges */
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3), 0 -1px 3px rgba(0, 0, 0, 0.3);
}

.dark .footer-link {
  color: #6b7280;
}

.dark .footer-link:hover {
  color: #9ca3af;
  background: #1a1f26;
  border-color: #374151;
}

/* Add bottom padding to body to prevent content from being hidden behind footer */
body {
  padding-bottom: 60px !important;
}

/* Responsive design */
@media (min-width: 768px) {
  body { font-size: 17px; }     /* subtle bump */
  h1   { font-size: 28px; }
  
  .pricing-hero h2 { font-size: 2.375rem; }  /* ~38px on desktop */
  .pricing-hero p  { font-size: 1.0625rem; } /* ~17px */
  
  .price         { font-size: 3rem; }        /* ~48px number */
  .pricing-header h3 { font-size: 1.5rem; }  /* 24px on desktop */
  .pricing-features li { font-size: 1rem; }  /* 16px on desktop */
  .pricing-cta .button { font-size: 1.0625rem; } /* ~17px */
  
  .pricing-badge { font-size: 0.8125rem; } /* 13px on desktop */
  
  .pricing-faq h3 { font-size: 2.25rem; }  /* 36px desktop */
  
  .faq-question { font-size: 1.125rem; }  /* 18px on desktop */
  .faq-answer p { font-size: 1rem; }      /* 16px on desktop */
  .faq-icon { width: 18px; height: 18px; }      /* 18px icon */
  
  .faq-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  
  .pricing-grid { gap: 24px; }
  .pricing-faq   { margin: 56px 0; }  /* slightly more air on desktop */
}

/* Topbar responsive design */
@media (max-width: 1024px) {
  .topbar .right {
    gap: 6px;
  }
  
  .user-info {
    font-size: 0.82rem;
    gap: 4px;
  }
  
  .mini-progress-bar {
    width: 50px;
    height: 5px;
  }
  
  .mini-progress-text {
    font-size: 0.8rem;
  }
  
  .user-links {
    font-size: 0.85rem;
    gap: 2px;
  }
  
  .user-links a {
    font-size: 0.80rem;
    padding: 6px 12px;
  }
  
  .user-links a[title="Account"] {
    font-size: 1rem;
    padding: 7px 7px;
  }
}


@media (max-width: 768px) {
  body {
    padding-top: 24px !important;
  }
  
  .sticky-footer {
    display: none;
  }
  
  /* Mobile responsive login form */
  body.login-page .card .login-form {
    max-width: 100% !important;
    width: 100% !important;
  }
  
  .login-form .form-control {
    max-width: 100% !important;
    width: 100% !important;
  }
  
  .login-form .password-input-wrapper {
    max-width: 100% !important;
    width: 100% !important;
  }
  
  .home-hero {
    padding: 16px 16px;
    margin: 4px 0 24px; /* Increased bottom margin for more space before form */
  }
  
  .home-hero h1, .home-hero h2 {
    font-size: 2rem;
    margin-bottom: 6px;
  }
  
  .home-hero p {
    font-size: 1.1rem;
  }
  
  .topbar {
    flex-direction: row; /* Keep horizontal layout */
    align-items: center; /* Center content vertically */
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px 16px 6px 16px;
  }
  
  .topbar .left {
    justify-content: flex-start; /* Keep logo left */
  }
  
  .topbar .right {
    flex-direction: row;
    gap: 8px;
    width: auto; /* Let it size naturally */
    justify-content: flex-end; /* Align buttons to right */
  }
  
  .user-info {
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
    gap: 6px;
  }
  
  .mini-progress-bar {
    width: 45px;
    height: 5px;
  }
  
  .mini-progress-text {
    font-size: 0.8rem;
  }
  
  .user-links {
    justify-content: center;
    gap: 12px;
  }
  
  .user-links a {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
  
  .user-links a[title="Account"] {
    font-size: 1.1rem;
    padding: 8px 8px;
  }
}

/* Tablet portrait and small desktop - 768px to 480px - OVERRIDE conflicting rules */
@media (max-width: 768px) and (min-width: 481px) {
  body {
    padding-top: 140px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  
  .topbar {
    margin-bottom: 20px;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  .topbar-inner {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 8px 12px !important;
  }
  
  .topbar .left {
    justify-content: center !important;
    width: 100% !important;
  }
  
  .topbar .right {
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
  }
  
  .history-filter {
    margin-bottom: 20px;
  }
  
  .user-info {
    font-size: 0.9rem !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center !important;
  }
  
  .mini-progress-bar {
    width: 40px !important;
    height: 4px !important;
  }
  
  .mini-progress-text {
    font-size: 0.75rem !important;
  }
  
  .user-links {
    gap: 10px !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
  }
  
  .user-links a {
    font-size: 0.85rem !important;
    padding: 7px 10px !important;
  }
  
  .user-links a[title="Account"] {
    font-size: 1rem !important;
    padding: 8px 8px !important;
  }
  
  /* Mobile spacing tweak for Usage text labels */
  .usage-text { 
    justify-content: flex-start !important; 
    gap: 8px !important; 
  }
  .usage-text .total { 
    margin-left: 6px !important; 
  }
  
  /* Mobile footer adjustments */
  .footer-content {
    gap: 16px !important;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 140px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  
  .topbar {
    margin-bottom: 20px;
  }
  
  .history-filter {
    margin-bottom: 20px;
  }
  
  .user-info {
    font-size: 0.9rem;
    gap: 6px;
    flex-wrap: wrap;
  }
  
  .mini-progress-bar {
    width: 40px;
    height: 4px;
  }
  
  .mini-progress-text {
    font-size: 0.75rem;
  }
  
  .user-links {
    gap: 10px;
  }
  
  .user-links a {
    font-size: 0.85rem;
    padding: 7px 10px;
  }
  
  .user-links a[title="Account"] {
    font-size: 1rem;
    padding: 8px 8px;
  }
  
  /* Mobile spacing tweak for Usage text labels */
  .usage-text { justify-content: flex-start; gap: 8px; }
  .usage-text .total { margin-left: 6px; }
  
  /* Mobile footer adjustments */
  .footer-content {
    gap: 16px;
    padding: 0 12px;
  }
  
  .footer-link {
    font-size: 0.85rem;
    padding: 5px 10px;
  }
}

/* Mobile screens under 480px */
@media (max-width: 480px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 16px 12px 16px;
  }
  
  .topbar-inner {
    flex-direction: column;
    gap: 8px;
  }
  
  .topbar .left {
    justify-content: center;
    width: 100%;
  }
  
  .topbar .right {
    flex-direction: column;
    gap: 6px;
    width: 100%;
    align-items: center;
  }
  
  .user-info {
    font-size: 0.85rem;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  
  .user-links {
    font-size: 0.85rem;
    gap: 4px;
  }
  
  .guest-links {
    margin-left: 0 !important; /* Override auto margin */
  }
  
  /* Account page mobile fixes */
  .account-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 16px auto;
    max-width: 100%;
  }
  
  .account-card {
    margin: 0;
    padding: 16px;
    width: auto;
    min-width: auto !important; /* Remove min-width constraint on mobile */
    max-width: calc(100vw - 80px) !important; /* Account for margins */
  }
  
  /* Contact page: override inline styles for full-width on mobile */
  .account-content-wrapper .account-card {
    max-width: calc(100vw - 80px) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Account settings form mobile fixes */
  .account-settings-form {
    max-width: 100% !important;
    min-width: auto !important; /* Remove min-width constraint on mobile */
    width: 100% !important;
  }
  
  .account-settings-form .form-control {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .account-settings-form .btn-group {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .account-settings-form .btn {
    width: 100% !important;
    flex: none !important;
  }
  
  .account-card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
  }
  
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 6px 0;
  }
  
  .info-row .label {
    flex: 0 0 auto;
    font-size: 0.9rem;
    margin-bottom: 2px;
  }
  
  .info-row .value {
    font-size: 0.95rem;
  }
  
  .account-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .account-actions .button {
    min-width: auto;
    width: 100%;
    text-align: center;
  }
  
  .usage-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .usage-text .total {
    margin-left: 0;
  }
  
  .account-links {
    margin: 26px auto; /* reduced from 32px */
    max-width: 100%;
  }
  
  .action-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .action-card {
    padding: 16px;
  }
  
  .action-card h4 {
    font-size: 1rem;
  }
  
  .action-card p {
    font-size: 0.85rem;
  }
  
  /* Pricing page mobile fixes */
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 16px auto;
  }
  
  .pricing-card {
    padding: 16px;
  }
  
  .pricing-header {
    height: auto;
    margin-bottom: 16px;
  }
  
  .pricing-header h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }
  
  .price {
    font-size: 2.2rem;
  }
  
  .pricing-features ul {
    min-height: auto;
    margin-bottom: 16px;
  }
  
  .pricing-features li {
    padding: 6px 0;
    font-size: 0.9rem;
  }
  
  /* History page mobile fixes */
  .history-header {
    flex-direction: column;
    align-items: center;
    gap: 8px !important; /* Increased gap between header elements */
  }
  
  .history-header h2 {
    text-align: center !important;
    font-size: 1.8rem !important; /* Bigger header for small screens */
    margin: 0 auto !important; /* Center horizontally */
  }
  
  .history-filter {
    width: 100%;
    max-width: calc(100vw - 40px) !important; /* Prevent overflow, account for padding */
    margin: 10px auto 0px !important; /* Increased bottom margin for more spacing */
    box-sizing: border-box;
  }
  
  .select-mode-btn {
    height: 30px !important;
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    margin: 0 !important;
  }
  
  .view-filter-select {
    height: 30px !important; /* Shorter dropdown for very small screens */
    font-size: 0.8rem !important;
    padding: 4px 8px !important; /* Reduce padding to fit text better */
    min-width: 80px !important; /* Ensure minimum width for text visibility */
    margin: 0 !important;
  }
  
  .filter-input {
    width: 100%;
  }
  
  .back-to-home {
    display: none !important; /* Hide back to account button on small screens */
  }

  /* Stack filters vertically for very small screens */
  .filters-group {
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .history-filter {
    width: 100% !important;
    order: 0 !important; /* Search filter appears first */
  }

  .select-and-filter-group {
    order: 1 !important; /* Select and view filter appears below search */
    justify-content: center !important;
  }

  /* Reduce gap between filters and bulk action bar */
  .bulk-action-bar {
    margin: 4px 0 4px 0 !important;
    position: sticky !important;
    top: 156px !important;
    z-index: 99 !important;
  }

  .history-item {
    flex-direction: column;
    gap: 8px;
    padding: 4px 0 18px 0; /* Increased bottom padding for mobile */
  }
  
  .history-thumbnail {
    width: 100%;
    height: 120px;
    align-self: center;
  }
  
  .history-content {
    text-align: center;
  }
  
  .history-title a {
    font-size: 0.9rem;
  }
  
  .summary-type {
    font-size: 0.8rem;
  }
  
  .history-date {
    font-size: 0.75rem;
  }
  
  /* Legal pages mobile fixes */
  .legal-page {
    padding: 20px 12px;
  }
  
  .legal-content {
    padding: 24px 16px;
  }
  
  .legal-content h1 {
    font-size: 2rem;
  }
  
  .legal-content h2 {
    font-size: 1.3rem;
  }
  
  .legal-content h3 {
    font-size: 1.1rem;
  }
  
  /* Form pages mobile fixes */
  .signup-form,
  .login-form,
  .forgot-password-form {
    max-width: 100%;
    padding: 0 8px;
  }
  
  .signup-header,
  .login-header,
  .forgot-password-header {
    font-size: 1.6rem;
  }
  
  .benefits-pill {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  
  /* Card mobile fixes */
  .card {
    padding: 12px;
    margin: 0 8px;
  }
  
  /* Homepage mobile fixes */
  .home-hero {
    padding: 12px 12px;
    margin: 4px 0 30px; /* Increased bottom margin for more space before form */
  }
  
  .home-hero h1, .home-hero h2 {
    font-size: 1.8rem;
    margin-bottom: 4px;
  }
  
  .home-hero p {
    font-size: 1rem;
  }
  
  .ai-badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }
  
  /* Mobile markdown output spacing - padding approach */
  .mdout li,
  .mdout ul li,
  .mdout ol li {
    padding: 5px 0 !important;  /* Padding creates the spacing between list items */
  }
  
  /* Email settings form - reduce field spacing on small screens */
  .account-settings-form .mb-3 {
    margin-bottom: 0rem !important; /* Reduce from default 1rem to 0.75rem */
  }
  
  .account-settings-form .mb-3.tight-spacing {
    margin-bottom: 0rem !important; /* Even tighter spacing for specific fields */
  }
  
  /* Reduce margin above "Change Email Address" header */
  .account-title {
    margin-top: -36px !important; /* Reduce top margin for email settings page */
  }
  
  /* Increase margin above "Account Overview" header */
  .account-content-wrapper h2:first-of-type {
    margin-top: 14px !important; /* Increase top margin for account overview page */
  }
}

/* Narrower width for summary pages only */
.summary-page,
.history-detail-page {
  max-width: 700px !important;  /* Narrower width for better readability on summary pages */
}
@media (max-width: 768px) {
  .pricing-grid { gap: 20px; }
  
  .pricing-grid,
  .account-grid {
    grid-template-columns: 1fr;
  }
  
  /* Ensure both cards fill full width on mobile */
  .account-card {
    margin-left: 4px;
    margin-right: 4px;
    width: auto;
  }
  
  /* Add small vertical gap between label and value for period row on narrow screens */
  .account-card .period-row { align-items: flex-start; }
  .account-card .period-row .label { margin-bottom: 4px; }
  .account-card .period-row { flex-direction: column; }

  /* Mobile layout fixes for all subscription info rows */
  .account-card .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .account-card .info-row .label {
    flex: 0 0 auto; /* remove fixed label width on mobile */
  }
  
  .action-grid {
    grid-template-columns: 1fr;
  }
  
  .account-actions {
    flex-direction: column;
  }
  
  .account-actions .button {
    min-width: auto;
  }
  
  .faq-grid {
    gap: 16px;
  }
  
  .faq-controls {
    display: none;
  }
  
  .faq-question {
    padding: 14px 16px;
    font-size: 0.95rem;
    margin: 0;
  }
  
  .faq-answer {
    padding: 0 16px 14px 16px;
  }
  
  /* Mobile markdown output spacing for tablets */
  .mdout li {
    margin: 10px 0 !important;  /* Increased spacing for tablet/mobile */
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }
  
  .mdout ul, .mdout ol {
    margin: 10px 0 14px 22px !important;  /* Increased spacing for tablet/mobile */
  }
  
  .mdout ul li, .mdout ol li {
    margin: 10px 0 !important;  /* More specific selector for tablets */
  }
  
  .mdout li p {
    margin: 6px 0 !important;  /* Space between paragraphs within list items for tablets */
  }
}

/* ===== Option B experiment: transparent label background ===== */
.signup-form .form-floating label,
.signup-form .form-floating .password-input-wrapper label,
.login-form .form-floating label,
.forgot-password-form .form-floating label{
  z-index:3; /* keep above input */
  background:transparent !important; /* allow text to show through */
}
.signup-form .form-floating label::after,
.signup-form .form-floating .password-input-wrapper label::after,
.login-form .form-floating label::after,
.forgot-password-form .form-floating label::after{
  display:none !important; /* remove Bootstrap's ::after pseudo-element */
}
.signup-form .form-floating .form-control,
.signup-form .password-input,
.login-form .form-floating .form-control,
.forgot-password-form .form-floating .form-control{
  position:relative;
  z-index:0; /* below label */
}

/* Kebab Menu Styles */
.kebab-menu {
  position: relative;
  display: inline-block;
}

.kebab-trigger {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.75rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin-top: 0px;
  margin-left: 6px;
  transform: translateY(-2px);
}

.kebab-trigger:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

.kebab-dropdown {
  position: absolute;
  top: calc(100% - 6px);
  right: 0;
  left: auto;
  background: #f1f5f9;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.15), 0 4px 8px -2px rgba(0, 0, 0, 0.1);
  z-index: 50;
  width: 154px;
  margin-top: 0;
  padding: 0;
  /* margin-left: -16px; Nudge 16px to the left */
  transform-origin: top right;
  transition: opacity 0.15s ease, transform 0.15s ease;
  /* Right-align by shifting dropdown to the right */
  transform: translateX(80%);
}

.kebab-dropdown.flipped {
  right: auto;
  left: 0;
  transform-origin: top left;
  transform: translateX(0);
}

/* Dark mode for kebab menu */
.dark .kebab-trigger {
  border-color: #4b5563;
  color: #9ca3af;
}

.dark .kebab-trigger:hover {
  background: #374151;
  border-color: #6b7280;
  color: #d1d5db;
}

.dark .kebab-dropdown {
  background: #4b5563;
  border: 2px solid #6b7280;
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.4), 0 4px 8px -2px rgba(0, 0, 0, 0.3);
}


.kebab-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: transparent;
  text-align: left;
  font-size: 0.8rem;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 0;
}

.kebab-item:first-child {
  border-radius: 0;
  border-top: none;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  margin-top: 0;
}

.kebab-item:last-child {
  border-radius: 0 0 6px 6px;
  border-bottom: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
}

.kebab-item:only-child {
  border-radius: 0;
}

.kebab-item:hover {
  background: #f9fafb;
}

.kebab-item.kebab-item-danger {
  color: #dc2626;
}

.kebab-item.kebab-item-danger:hover {
  background: #fef2f2;
}

.kebab-item.kebab-item-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9fafb;
  color: #9ca3af;
}

.kebab-item.kebab-item-disabled:hover {
  background: #f9fafb;
  color: #9ca3af;
}

/* Dark mode for kebab items */
.dark .kebab-item {
  color: #d1d5db;
  background: transparent;
  border-color: #6b7280;
  border-bottom-color: #6b7280;
}

.dark .kebab-item:hover {
  background: #6b7280;
}

.dark .kebab-item:first-child {
  border-top: none;
  border-left-color: #6b7280;
  border-right-color: #6b7280;
  margin-top: 0;
}

.dark .kebab-item:last-child {
  border-radius: 0 0 6px 6px;
  border-bottom-color: #6b7280;
  border-left-color: #6b7280;
  border-right-color: #6b7280;
}

.dark .kebab-item.kebab-item-danger {
  color: #f87171;
}

.dark .kebab-item.kebab-item-danger:hover {
  background: #7f1d1d;
}

.dark .kebab-item.kebab-item-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #374151;
  color: #6b7280;
}

.dark .kebab-item.kebab-item-disabled:hover {
  background: #374151;
  color: #6b7280;
}

/* Delete Confirmation Modal */
.delete-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.delete-modal-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
}

.delete-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.delete-modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.delete-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.delete-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.delete-modal-body {
  padding: 20px 24px;
}

.delete-modal-body p {
  margin: 0 0 12px;
  color: #374151;
  line-height: 1.5;
}

.delete-modal-body p:last-child {
  margin-bottom: 0;
}

.delete-modal-warning {
  color: #dc2626 !important;
  font-size: 0.875rem;
  font-weight: 500;
}

.delete-warning {
  color: #dc2626 !important;
  font-size: 0.875rem;
  font-weight: 500;
}

.delete-modal-actions {
  padding: 16px 24px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.delete-modal-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.delete-modal-cancel {
  background: #f9fafb;
  color: #374151;
  border-color: #d1d5db;
}

.delete-modal-cancel:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.delete-modal-confirm {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.delete-modal-confirm:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Dark mode styles for delete modal */
.dark .delete-modal-content {
  background: #1f2937;
  border-color: #374151;
}

.dark .delete-modal-header {
  border-bottom-color: #374151;
}

.dark .delete-modal-header h3 {
  color: #f9fafb;
}

.dark .delete-modal-close {
  color: #9ca3af;
}

.dark .delete-modal-close:hover {
  background: #374151;
  color: #d1d5db;
}

.dark .delete-modal-body p {
  color: #d1d5db;
}

.dark .delete-modal-warning {
  color: #fca5a5 !important;
}

.dark .delete-warning {
  color: #fca5a5 !important;
}

.dark .delete-modal-cancel {
  background: #374151;
  color: #d1d5db;
  border-color: #4b5563;
}

.dark .delete-modal-cancel:hover {
  background: #4b5563;
  border-color: #6b7280;
}

.dark .delete-modal-confirm {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.dark .delete-modal-confirm:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Reset Modal Styles */
#resetModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#resetModal .modal-content {
  background: white;
  border-radius: 12px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#resetModal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
}

#resetModal .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

#resetModal .modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

#resetModal .modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

#resetModal .modal-body {
  padding: 20px 24px;
}

#resetModal .modal-body p {
  margin: 0 0 16px 0;
  color: #374151;
  line-height: 1.5;
}

#resetModal .modal-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 16px;
  color: #92400e;
  font-size: 0.9rem;
}

#resetModal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid #e5e7eb;
}

#resetModal .btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

#resetModal .btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

#resetModal .btn-secondary:hover {
  background: #e5e7eb;
}

#resetModal .btn-primary {
  background: #3b82f6;
  color: white;
}

#resetModal .btn-primary:hover {
  background: #2563eb;
}

/* Dark mode styles for reset modal */
.dark #resetModal .modal-content {
  background: #1f2937;
}

.dark #resetModal .modal-header {
  border-bottom-color: #374151;
}

.dark #resetModal .modal-header h3 {
  color: #f9fafb;
}

.dark #resetModal .modal-close {
  color: #9ca3af;
}

.dark #resetModal .modal-close:hover {
  background: #374151;
  color: #d1d5db;
}

.dark #resetModal .modal-body p {
  color: #d1d5db;
}

.dark #resetModal .modal-warning {
  background: #451a03;
  border-color: #d97706;
  color: #fbbf24;
}

.dark #resetModal .modal-footer {
  border-top-color: #374151;
}

.dark #resetModal .btn-secondary {
  background: #374151;
  color: #d1d5db;
}

.dark #resetModal .btn-secondary:hover {
  background: #4b5563;
}

.dark #resetModal .btn-primary {
  background: #3b82f6;
  color: white;
}

.dark #resetModal .btn-primary:hover {
  background: #2563eb;
}

/* Status chips - subtle and compact */
/* Privacy status chips removed - no longer used */

/* Toggle buttons - more subtle and compact */
.privacy-toggle-btn {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 6px 7px 5px 6px; /* Reduced vertical padding */
  border-radius: 4px; /* Match chip radius */
  font-size: 0.72rem; /* 12px - smaller font */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 22px; /* Match chip height */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.privacy-toggle-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.privacy-toggle-btn.feature-popular:focus {
  outline: 2px solid rgba(110, 231, 183, 0.6); /* focus:ring-emerald-300/60 */
  outline-offset: 2px;
}

.privacy-toggle-btn.remove-featured:focus {
  outline: 2px solid rgba(252, 165, 165, 0.6); /* focus:ring-rose-300/60 */
  outline-offset: 2px;
}

/* Feature in Popular - subtle green outline */
.privacy-toggle-btn.feature-popular {
  border-color: #6ee7b7; /* border-emerald-300 */
  color: #047857;        /* text-emerald-700 */
  background: #ecfdf5;   /* bg-emerald-50 */
  opacity: 0.7;         /* Reduce overall opacity */
}

.privacy-toggle-btn.feature-popular:hover {
  background: #d1fae5;   /* bg-emerald-100 */
  border-color: #6ee7b7; /* border-emerald-300 */
  color: #047857;        /* text-emerald-700 */
  opacity: 1;            /* Full opacity on hover */
}

/* Remove from Popular - subtle red outline */
.privacy-toggle-btn.remove-featured {
  border-color: #fca5a5; /* border-rose-300 */
  color: #be123c;        /* text-rose-700 */
  background: #fff1f2;   /* bg-rose-50 */
  opacity: 0.7;         /* Reduce overall opacity */
}

.privacy-toggle-btn.remove-featured:hover {
  background: #ffe4e6;   /* bg-rose-100 */
  border-color: #fca5a5; /* border-rose-300 */
  color: #9f1239;        /* darker text on hover */
  opacity: 1;            /* Full opacity on hover */
}

.dark .privacy-toggle-btn {
  background: transparent;
  border-color: #4b5563;
  color: #d1d5db;
}

.dark .privacy-toggle-btn:hover {
  background: #374151;
  border-color: #6b7280;
  color: #f9fafb;
}

.dark .privacy-toggle-btn:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.dark .privacy-toggle-btn.feature-popular {
  border-color: #059669;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1); /* Subtle emerald tint */
  opacity: 0.7; /* Reduce opacity to match chips */
}

.dark .privacy-toggle-btn.feature-popular:hover {
  background: rgba(16, 185, 129, 0.2); /* Slightly more emerald tint */
  border-color: #10b981;
  color: #6ee7b7;
  opacity: 1; /* Full opacity on hover */
}

.dark .privacy-toggle-btn.remove-featured {
  border-color: #dc2626;
  color: #f87171;
  background: rgba(239, 68, 68, 0.1); /* Subtle rose tint */
  opacity: 0.7; /* Reduce opacity to match chips */
}

.dark .privacy-toggle-btn.remove-featured:hover {
  background: rgba(239, 68, 68, 0.2); /* Slightly more rose tint */
  border-color: #ef4444;
  color: #fca5a5;
  opacity: 1; /* Full opacity on hover */
}

/* View filter dropdown */
.view-filter {
  display: flex;
  align-items: center;
  margin: 0;
}

.view-filter-select {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  min-width: 110px;
  height: 34px; /* Match filter input height */
  box-sizing: border-box;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 6px;
  font-variant-numeric: tabular-nums; /* Ensures consistent digit spacing */
  margin: 0;
}

.view-filter-select:hover {
  border-color: #9ca3af;
}

.view-filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark .view-filter-select {
  background: #1f2937;
  border-color: #4b5563;
  color: #d1d5db;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%9ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

.dark .view-filter-select:hover {
  border-color: #6b7280;
}

.dark .view-filter-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
/* Favorite button styling */
.favorite-btn {
  background: none !important;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  margin-left: 0px;
  opacity: 0;
  transition: all 0.2s ease;
  border-radius: 4px;
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0px;
  color: #6b7280; /* gray-500 for outline */
}

/* Show on row hover - but not for favorited items */
.history-item:hover .favorite-btn:not(.favorited) {
  opacity: 0.6;
}

/* Make favorited stars full opacity on row hover */
.history-item:hover .favorite-btn.favorited {
  opacity: 1;
}

/* Favorited state */
.favorite-btn.favorited {
  opacity: 0.7;
  color: #F59E0B; /* amber-500 */
  background: none !important;
}

.favorite-btn:hover {
  opacity: 1;
}

.favorite-btn.favorited:hover {
  background: none !important;
}

/* Dark mode */
.dark .favorite-btn {
  color: #9ca3af; /* gray-400 for outline in dark mode */
}

.dark .favorite-btn.favorited {
  color: #FCD34D; /* amber-300 */
  background: none !important;
}

.dark .favorite-btn.favorited:hover {
  background: none !important;
}

/* Filters group - provides flexbox layout for horizontal alignment */
.filters-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* Center the entire body.home content within viewport */
body.home {
  margin: 40px auto !important; /* Override any conflicting margin rules */
  max-width: 980px !important; /* Set a reasonable max width */
}

/* Medium screens (481px-1024px) - ID selectors for maximum specificity */

/* ========================================
   Homepage Info Sections (separate container)
   ======================================== */
.homepage-info {
  width: 800px;
  max-width: 95vw;
  margin: 3.2rem auto 3.5rem;
  padding: 1.25rem 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.homepage-info .info-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 10px;
  margin-bottom: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 999px;
  background: transparent; /* ghost variant */
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  font-weight: 400;
}

.homepage-info .info-nav a {
  color: #0a107d;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
}

.homepage-info .info-nav a:hover {
  background: rgba(10,16,125,0.05);
}

.homepage-info .info-nav .sep { display: none; }

.homepage-info .info-card {
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 32px;
  position: relative;
  overflow: visible; /* allow outer glow to render */
  transition: transform .18s ease-in-out, opacity .18s ease-in-out, box-shadow .16s ease, border-color .16s ease;
  will-change: transform, opacity;
  max-width: 720px; /* constrain card width */
  margin-left: auto;
  margin-right: auto;
  margin-top: 30px;
  isolation: isolate; /* ensure pseudo-elements stack within card */
  scroll-margin-top: 100px; /* ensure titles are visible when navigated via anchor */
  /* Derived accent stops: calculate directly from --card-accent (set by per-card rules) */
  --accent-border-a: color-mix(in srgb, var(--card-accent, #0a107d) 88%, white 12%);
  --accent-border-b: color-mix(in srgb, var(--card-accent, #0a107d) 88%, black 12%);
  --accent-border-a-alpha: color-mix(in srgb, var(--accent-border-a) 60%, transparent);
  --accent-border-b-alpha: color-mix(in srgb, var(--accent-border-b) 60%, transparent);
  --accent-stripe-a: var(--accent-border-a);
  --accent-stripe-b: var(--accent-border-b);
  --stripe-fade: 12px; /* feather length to blend into rounded corners */
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.96)) padding-box,
    linear-gradient(135deg, var(--accent-border-a-alpha), var(--accent-border-b-alpha)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22), /* subtle unified top hairline */
    0 8px 22px rgba(0,0,0,0.06);
  background-clip: padding-box, border-box;
}

/* Scroll-reveal states (no scale/bounce) */
.homepage-info .info-card.reveal-hidden { opacity: 0; transform: translateY(10px); }
.homepage-info .info-card.reveal-visible { opacity: 1; transform: none; }

.homepage-info .info-card + .info-card {
  margin-top: 64px; /* 56-72px range */
}

.homepage-info .info-card > * + * {
  margin-top: 24px; /* 24-32px internal spacing */
}

/* Subtle animated lift + accent strip */
/* removed old ::before top accent (now on ::after) */

.homepage-info .info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}

/* Per-card accent colors (unified) */
.homepage-info .info-card:nth-of-type(1) {
  /* Primary (brand) */
  --accent: #0a107d;
  --card-accent: var(--accent);
}
.homepage-info .info-card:nth-of-type(2) {
  /* Secondary (teal) */
  --accent: #0ea5e9;
  --card-accent: var(--accent);
}
.homepage-info .info-card:nth-of-type(3),
.homepage-info .info-card:nth-of-type(5) {
  /* Neutral (soft gray/indigo) */
  --accent: #64748b;
  --card-accent: var(--accent);
}
.homepage-info .info-card:nth-of-type(4) {
  /* Trust (amber) */
  --accent: #f59e0b;
  --card-accent: var(--accent);
  /* Soften border specifically for amber */
  --accent-border-a-alpha: color-mix(
    in srgb,
    color-mix(in srgb, var(--accent) 88%, white 12%) 45%,
    transparent
  );
  --accent-border-b-alpha: color-mix(
    in srgb,
    color-mix(in srgb, var(--accent) 88%, black 12%) 45%,
    transparent
  );
  /* Soften top stripe colors for amber */
  --accent-stripe-a: color-mix(in srgb, color-mix(in srgb, var(--accent) 88%, white 12%) 70%, transparent);
  --accent-stripe-b: color-mix(in srgb, color-mix(in srgb, var(--accent) 88%, black 12%) 70%, transparent);
}

/* Dark-mode soft tuning */
.dark .homepage-info .info-card:nth-of-type(1) {
  --accent: #5166de;
}
.dark .homepage-info .info-card:nth-of-type(3),
.dark .homepage-info .info-card:nth-of-type(5) {
  --accent: #94a3b8;
}

.homepage-info h2 {
  margin: 0;
  font-size: 1.34rem; /* px */
  font-weight: 600;   /* medium */
  color: #0a107d;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Icon container replacing emoji pseudo-elements */
.homepage-info h2 .info-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--card-accent, #0a107d);
  background: color-mix(in srgb, var(--card-accent, #0a107d) 14%, transparent);
}
.homepage-info h2 .info-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  opacity: .65;
  vector-effect: non-scaling-stroke;
}
.dark .homepage-info h2 .info-icon {
  background: color-mix(in srgb, var(--card-accent, #5166de) 20%, transparent);
}
.dark .homepage-info h2 .info-icon svg { opacity: .9; }

.homepage-info p,
.homepage-info .info-list li {
  font-size: 1rem;     /* 16px */
  line-height: 1.6;    /* 1.5-1.7 */
}

/* Add vertical rhythm between bullet items */
.homepage-info .info-list li + li { margin-top: 8px; }

.homepage-info p { color: #374151; }

.homepage-info .info-list { margin: 0; padding: 0; }

/* Enhanced markers for bullets in key lists */
.homepage-info #why .info-list li::marker,
.homepage-info #who .info-list li::marker {
  color: var(--card-accent, #0a107d);
}

/* Improve marker contrast in dark mode for Why Recapify */
.dark .homepage-info #why .info-list li::marker {
  color: #93c5fd; /* light blue for contrast */
}

/* Indentation for bullet lists in specific cards */
.homepage-info #why .info-list,
.homepage-info #who .info-list {
  padding-left: 1.80rem; /* indent bullets */
  list-style: disc outside;
}

/* Extra spacing for title and lists in Why/Who */
.homepage-info #why h2,
.homepage-info #who h2 {
  margin-bottom: 28px; /* slightly larger gap below title */
}

.homepage-info #why .info-list,
.homepage-info #who .info-list {
  margin-bottom: 8px; /* add breathing room below bullets */
}

.homepage-info .info-cta {
  margin-top: 0.5rem;
  margin-left: auto;
  margin-right: auto; /* center CTA within card */
  display: block;
  width: fit-content;
  min-width: 180px;
}

/* Dark mode */
.dark .homepage-info {
  background: #12161a;
  border: 1px solid #2a2f36;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.dark .homepage-info .info-card {
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, rgba(18,22,26,0.86), rgba(18,22,26,0.94)) padding-box,
    linear-gradient(135deg, var(--accent-border-a-alpha), var(--accent-border-b-alpha)) border-box;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  background-clip: padding-box, border-box;
}

.dark .homepage-info .info-nav {
  background: transparent; /* ghost variant */
  border-color: #2a2f36;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}
.dark .homepage-info .info-nav a:hover {
  background: rgba(255,255,255,0.12);
}
.dark .homepage-info .info-nav a { color: #aeb8ff; }
.dark .homepage-info .info-nav .sep { display: none; }
.dark .homepage-info h2 { color: #aeb8ff; }
.dark .homepage-info h2::before {
  background: color-mix(in srgb, var(--card-accent, #5166de) 20%, transparent);
  color: #c7d2fe;
}
.dark .homepage-info p,
.dark .homepage-info .info-list li { color: #d1d5db; }

/* Responsive tweaks aligned with homepage layout */
@media (max-width: 1024px) {
  .homepage-info {
    width: 90%;
    max-width: 90%;
    padding: 0.75rem;
  }
}

@media (max-width: 768px) {
  .homepage-info {
    width: 95%;
    max-width: 95%;
    padding: 0.5rem;
  }
  .homepage-info h2 { font-size: 1.15rem; }
  .homepage-info .info-card { scroll-margin-top: 170px; }
  /* Slightly tighter pill nav on tablets/small laptops */
  .homepage-info .info-nav {
    gap: 8px;
    padding: 5px 8px;
    margin-bottom: 14px;
  }
  .homepage-info .info-nav a {
    padding: 5px 9px;
  }
}

@media (max-width: 480px) {
  .homepage-info {
    width: 98%;
    max-width: 98%;
    margin: 2.5rem auto 2rem;
    padding: 0.5rem;
    padding-top: 0.80rem; /* add a bit more space above the pill nav */
  }
  /* Tighter pill nav layout on very small screens */
  .homepage-info .info-nav {
    gap: 6px;
    padding: 4px 6px;
    margin-bottom: 10px;
  }
  .homepage-info .info-nav a {
    padding: 4px 8px;
    line-height: 1.2;
  }
  .homepage-info .info-list {
    margin-left: 0.5rem;
  }
  .homepage-info #why .info-list,
  .homepage-info #who .info-list {
    padding-left: 0.8rem;
  }
  .homepage-info .info-list li + li { margin-top: 12px; }
}

/* CTA upgrade */
.homepage-info .info-cta {
  background: linear-gradient(135deg, #0a107d 0%, #222abe 100%);
  border: none;
  box-shadow: 0 10px 22px rgba(10,16,125,0.22);
  color: #ffffff; /* high contrast text */
  font-weight: 600;
}

/* Dark mode: align CTA hue with Generate Insights button */
.dark .homepage-info .info-cta {
  background: linear-gradient(135deg,
              color-mix(in srgb, var(--bs-primary, #5166de) 92%, black 8%) 0%,
              color-mix(in srgb, var(--bs-primary, #5166de) 80%, black 20%) 100%);
  box-shadow: 0 10px 22px rgba(81,102,222,0.22);
  color: #ffffff; /* ensure readable text in dark */
}

.homepage-info .info-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(10,16,125,0.28);
  color: #ffffff;
}

.dark .homepage-info .info-cta:hover {
  box-shadow: 0 14px 28px rgba(81,102,222,0.28);
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .homepage-info .info-card,
  .homepage-info .info-cta { transition: none; }
  .homepage-info .info-card:hover { transform: none; }
  .homepage-info .info-card.reveal-hidden,
  .homepage-info .info-card.reveal-visible { opacity: 1 !important; transform: none !important; }
}

/* ================= Premium Enhancements ================ */
/* Subtle gradient border for container (keeps spacing rules) */
.homepage-info {
  background: linear-gradient(#ffffff, #ffffff) padding-box,
              linear-gradient(135deg, rgba(10,16,125,0.12), rgba(34,42,190,0.10)) border-box;
  border: 1px solid transparent;
}

.dark .homepage-info {
  background: linear-gradient(#12161a, #12161a) padding-box,
              linear-gradient(135deg, rgba(81,102,222,0.28), rgba(10,16,125,0.2)) border-box;
  border: 1px solid transparent;
}

/* (Removed neon ring layers and ::before ring) */


/* Uniform light glow behind all cards (both themes) on ::before */
/* Card halo now handled by box-shadow only (no ::before) */

/* Top accent bar + shimmer stays on ::after */
@keyframes subtle-shimmer { from { transform: translateX(-30%); opacity: .0 } to { transform: translateX(130%); opacity: .25 } }
.homepage-info .info-card::after {
  content: '';
  position: absolute;
  left: 2px; right: 2px; top: 0px; height: 2px; z-index: 2; /* align with 2px border */
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, var(--accent-stripe-a, var(--card-accent, #0a107d)), var(--accent-stripe-b, var(--card-accent, #222abe)));
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--stripe-fade), #000 calc(100% - var(--stripe-fade)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--stripe-fade), #000 calc(100% - var(--stripe-fade)), transparent 100%);
}
.dark .homepage-info .info-card:hover::after {
  background: linear-gradient(90deg, var(--accent-stripe-a, var(--card-accent, #0a107d)), var(--accent-stripe-b, var(--card-accent, #222abe))),
              linear-gradient(90deg, #ffffff, rgba(255,255,255,0));
  background-blend-mode: screen;
}

/* Icon ring polish */
.homepage-info h2 .info-icon {
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06) inset;
}
.dark .homepage-info h2 .info-icon {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
}

/* Active section emphasis via :target (neutralized for consistent appearance) */
.homepage-info .info-card:target {
  border-color: inherit !important;
  box-shadow: inherit !important;
}

/* Glass nav and blur support */
@supports ((-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))) {
  .homepage-info .info-nav {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .homepage-info .info-card {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
}

/* CTA sheen */
.homepage-info .info-cta {
  position: relative;
  overflow: hidden;
}
.homepage-info .info-cta::after {
  content: '';
  position: absolute;
  top: 0; left: -40%; height: 100%; width: 40%;
  background: linear-gradient(110deg, rgba(255,255,255,0.0) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.0) 100%);
  transform: skewX(-20deg);
  opacity: 0; pointer-events: none;
}
.homepage-info .info-cta:hover::after { left: 120%; opacity: 1; transition: left .6s ease, opacity .6s ease; }
