/* ===========================================================================
   RizzPilot — "Noir Ember" Design System
   Warm dark luxury, editorial serif elegance, premium interactions
   Mobile-first, multi-theme, touch-optimized
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1. Design Tokens
   --------------------------------------------------------------------------- */
:root {
  /* Core palette — Warm dark */
  --bg: #09090b;
  --bg-soft: #101014;
  --bg-surface: #18181c;
  --bg-elevated: #202024;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-strong: rgba(255, 255, 255, 0.06);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.10);

  /* Text — Warm whites (high contrast for readability) */
  --text: #f5f5f0;
  --text-soft: #d4d0c9;
  --text-dim: #a8a29e;
  --text-muted: #8a8578;
  --text-inverse: #09090b;

  /* Accent — Ember Coral */
  --accent: #f43f5e;
  --accent-light: #fb7185;
  --accent-soft: rgba(244, 63, 94, 0.10);
  --accent-soft-15: rgba(244, 63, 94, 0.15);
  --accent-glow: rgba(244, 63, 94, 0.25);
  --accent-glow-strong: rgba(244, 63, 94, 0.40);
  --gradient-accent: linear-gradient(135deg, #f43f5e, #f59e0b);
  --gradient-subtle: linear-gradient(180deg, rgba(244, 63, 94, 0.05), transparent);

  /* Secondary — Warm Amber */
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.10);
  --amber-glow: rgba(245, 158, 11, 0.20);

  /* Contrast — Electric Teal */
  --teal: #14b8a6;
  --teal-soft: rgba(20, 184, 166, 0.10);
  --teal-glow: rgba(20, 184, 166, 0.20);

  /* Semantic */
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.10);
  --green-glow: rgba(34, 197, 94, 0.20);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.10);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.10);
  --amber-sem: #f59e0b;
  --amber-sem-bg: rgba(245, 158, 11, 0.10);

  /* Vibe colors */
  --vibe-smooth: #14b8a6;
  --vibe-smooth-bg: rgba(20, 184, 166, 0.10);
  --vibe-funny: #3b82f6;
  --vibe-funny-bg: rgba(59, 130, 246, 0.10);
  --vibe-bold: #f43f5e;
  --vibe-bold-bg: rgba(244, 63, 94, 0.10);

  /* Typography */
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'DM Serif Display', 'Outfit', Georgia, serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;

  /* Radii */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 4px 24px var(--accent-glow);
  --shadow-warm: 0 4px 32px rgba(244, 63, 94, 0.08), 0 1px 4px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --dur: 0.3s;
  --dur-fast: 0.18s;

  /* Layout */
  --max-width: 1100px;
  --max-width-wide: 1200px;
  --nav-height: 64px;

  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Light Theme — Crisp Studio White (clean, premium, SOTA) */
[data-theme="light"] {
  /* Core palette — Clean, warm whites with premium feel */
  --bg: #f8f7f4;
  --bg-soft: #f0efeb;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --bg-input: #f0efeb;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --bg-glass-strong: rgba(255, 255, 255, 0.95);

  --border: rgba(0, 0, 0, 0.07);
  --border-hover: rgba(0, 0, 0, 0.14);
  --border-strong: rgba(0, 0, 0, 0.10);

  /* Text — High contrast, refined readability */
  --text: #121210;
  --text-soft: #2c2c28;
  --text-dim: #5c5c55;
  --text-muted: #8a8a80;
  --text-inverse: #f8f7f4;

  /* Accent — Rose that pops cleanly on white */
  --accent: #e11d48;
  --accent-light: #f43f5e;
  --accent-soft: rgba(225, 29, 72, 0.06);
  --accent-soft-15: rgba(225, 29, 72, 0.10);
  --accent-glow: rgba(225, 29, 72, 0.10);
  --accent-glow-strong: rgba(225, 29, 72, 0.22);
  --gradient-accent: linear-gradient(135deg, #e11d48, #d97706);
  --gradient-subtle: linear-gradient(180deg, rgba(225, 29, 72, 0.03), transparent);

  /* Secondary — Warm Amber */
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.08);
  --amber-glow: rgba(217, 119, 6, 0.14);

  /* Semantic colors — slightly adjusted for white bg */
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.08);
  --green-glow: rgba(22, 163, 74, 0.14);
  --blue: #2563eb;
  --blue-bg: rgba(37, 99, 235, 0.08);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.08);
  --amber-sem: #d97706;
  --amber-sem-bg: rgba(217, 119, 6, 0.08);
  --teal: #0d9488;
  --teal-soft: rgba(13, 148, 136, 0.08);
  --teal-glow: rgba(13, 148, 136, 0.14);

  /* Vibe colors for light bg */
  --vibe-smooth: #0d9488;
  --vibe-smooth-bg: rgba(13, 148, 136, 0.08);
  --vibe-funny: #2563eb;
  --vibe-funny-bg: rgba(37, 99, 235, 0.08);
  --vibe-bold: #e11d48;
  --vibe-bold-bg: rgba(225, 29, 72, 0.08);

  /* Shadows — Subtle, layered, premium */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.07), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 4px 20px rgba(225, 29, 72, 0.10);
  --shadow-warm: 0 2px 8px rgba(225, 29, 72, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.82) !important;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .loading-overlay { background: rgba(248, 247, 244, 0.94); }

/* Light theme: crisp text rendering — Outfit shines on light bg */
[data-theme="light"] body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient glow — light theme gets a refined, cooler atmosphere */
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(225, 29, 72, 0.03) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 15%, rgba(217, 119, 6, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 85%, rgba(13, 148, 136, 0.02) 0%, transparent 55%);
}

[data-theme="light"] body::after {
  opacity: 0.015;
}

[data-theme="light"] .nav-links a { font-weight: 500; }
[data-theme="light"] .footer-tagline,
[data-theme="light"] .footer-bottom { font-weight: 500; }

/* Light theme: subtle, layered shadows — SOTA design approach */
[data-theme="light"] .feature-card,
[data-theme="light"] .how-card,
[data-theme="light"] .price-card,
[data-theme="light"] .benefit-card,
[data-theme="light"] .dash-stat,
[data-theme="light"] .dash-card,
[data-theme="light"] .hist-card,
[data-theme="light"] .settings-card,
[data-theme="light"] .auth-card,
[data-theme="light"] .v5-upload-card,
[data-theme="light"] .v5-rizz-card,
[data-theme="light"] .v5-reply-card,
[data-theme="light"] .v5-faq-item,
[data-theme="light"] .trust-grid,
[data-theme="light"] .billing-balance,
[data-theme="light"] .sub-active,
[data-theme="light"] .settings-danger,
[data-theme="light"] .qp-card,
[data-theme="light"] .glass-card,
[data-theme="light"] .modal-card,
[data-theme="light"] .paypop-modal,
[data-theme="light"] .chat-mockup,
[data-theme="light"] .cta-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .feature-card:hover,
[data-theme="light"] .how-card:hover,
[data-theme="light"] .price-card:hover,
[data-theme="light"] .benefit-card:hover,
[data-theme="light"] .dash-stat:hover,
[data-theme="light"] .dash-card:hover,
[data-theme="light"] .hist-card:hover,
[data-theme="light"] .settings-card:hover,
[data-theme="light"] .v5-reply-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .price-card.popular {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 0 24px var(--accent-glow);
}

[data-theme="light"] .auth-card,
[data-theme="light"] .v5-upload-card,
[data-theme="light"] .v5-rizz-card,
[data-theme="light"] .billing-balance,
[data-theme="light"] .sub-active,
[data-theme="light"] .settings-danger {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .modal-card,
[data-theme="light"] .paypop-modal {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .chat-mockup {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .glass-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255,255,255,0.6);
}

[data-theme="light"] .price-table-wrap,
[data-theme="light"] .rizz-card,
[data-theme="light"] .reply-card,
[data-theme="light"] .v5-reply-card,
[data-theme="light"] .red-flags-card,
[data-theme="light"] .v5-redflags-card,
[data-theme="light"] .glass,
[data-theme="light"] .memory-bar,
[data-theme="light"] .memory-status-bar {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .reply-card:hover,
[data-theme="light"] .v5-reply-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* ---------------------------------------------------------------------------
   2. Reset & Base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  padding-top: var(--nav-height);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

/* Ambient warm glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(244, 63, 94, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 15%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 85%, rgba(20, 184, 166, 0.03) 0%, transparent 55%);
  background-attachment: fixed;
}

/* Subtle noise overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

::selection { background: var(--accent-soft); color: var(--text); }
::-moz-selection { background: var(--accent-soft); color: var(--text); }

/* ---------------------------------------------------------------------------
   3. Typography — Editorial Serif Headings
   --------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--gradient-accent);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease-in-out infinite;
}

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

.section-header {
  text-align: center;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.section-header h2 {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 400;
  margin-bottom: clamp(8px, 1.5vw, 14px);
  line-height: 1.1;
}

.section-header p {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
  font-family: var(--font);
}

/* ---------------------------------------------------------------------------
   4. Layout
   --------------------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 24px);
}

.container-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 24px);
}

.page-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 100px) 16px;
}

.page-header {
  text-align: center;
  margin-bottom: clamp(36px, 6vw, 56px);
}

.page-header h1 {
  font-size: clamp(34px, 5vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  line-height: 1.1;
}

.page-header p {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------------
   5. Navigation — Mobile-First, Warm Dark
   --------------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  view-transition-name: nav-bar;
  height: var(--nav-height);
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--dur) var(--ease);
  padding-top: var(--safe-top);
}

.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 24px);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  transition: opacity var(--dur) var(--ease);
}
.logo:hover { opacity: 0.85; }

.logo-icon {
  font-size: clamp(20px, 3vw, 22px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(245, 158, 11, 0.15));
}

.logo-text {
  font-family: var(--font-display);
  font-size: clamp(19px, 3vw, 21px);
  font-weight: 400;
  letter-spacing: -0.5px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

/* Desktop nav links */
.nav-links { display: none; }

.nav-controls {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 10px);
  flex-shrink: 0;
}

/* Mobile: keep hamburger + nav-controls together on the right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .nav-right {
    margin-left: 0;
  }
}

/* Hamburger */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: background var(--dur-fast) var(--ease);
  position: relative;
  z-index: 110;
  touch-action: manipulation;
}
.nav-hamburger:hover { background: var(--bg-card); }

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-soft);
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 22px; }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 22px; }

/* Mobile Sidebar */
.nav-sidebar {
  position: fixed;
  inset: 0;
  z-index: 105;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s var(--dur);
}
.nav-sidebar.open {
  visibility: visible;
  transition-delay: 0s;
}

.nav-sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.nav-sidebar.open .nav-sidebar-backdrop { opacity: 1; }

.nav-sidebar-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 80vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  padding: calc(var(--nav-height) + var(--safe-top) + 16px) 12px 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--dur) var(--ease-spring);
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: auto;
}
.nav-sidebar.open .nav-sidebar-panel { transform: translateX(0); }

.nav-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: var(--radius);
  transition: all var(--dur-fast) var(--ease);
  min-height: 48px;
  text-decoration: none;
  touch-action: manipulation;
}
.nav-sidebar-link:hover {
  background: var(--bg-card);
  color: var(--text);
}
.nav-sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent-light);
}

.nav-sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

/* Sidebar theme toggle */
.sidebar-theme-toggle {
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}
.sidebar-theme-toggle .sidebar-theme-label-light { display: none; }
[data-theme="light"] .sidebar-theme-toggle .sidebar-theme-label { display: none; }
[data-theme="light"] .sidebar-theme-toggle .sidebar-theme-label-light { display: inline; }

/* Nav credits badge */
.nav-credits {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(244, 63, 94, 0.12);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: clamp(12px, 1.6vw, 13px);
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.nav-credits:hover {
  border-color: var(--accent-glow);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(245, 158, 11, 0.12));
}
.nav-credits.low { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }

.credit-icon { font-size: 12px; }
.credit-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.credit-label { color: var(--text-dim); font-size: clamp(11px, 1.4vw, 12px); }
.credit-rollover {
  font-size: clamp(10px, 1.3vw, 11px);
  font-weight: 500;
  color: var(--amber);
  margin-left: 4px;
  padding-left: 6px;
  border-left: 1px solid var(--border);
}

/* Plan badge in nav */
.plan-badge-nav {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  flex-shrink: 0;
  font-size: 16px;
}
.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-card);
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Verify Banner */
.verify-banner {
  background: var(--amber-sem-bg);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  text-align: center;
  padding: clamp(8px, 1.5vw, 10px) 16px;
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--amber-sem);
}
.verify-banner a { color: var(--amber-sem); text-decoration: underline; cursor: pointer; }

/* Auth Buttons (nav) */
.btn-nav-primary {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  font-family: var(--font);
  font-size: clamp(13px, 1.6vw, 14px);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--amber));
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--dur) var(--ease-spring);
  white-space: nowrap;
  min-height: 40px;
  text-decoration: none;
}
.btn-nav-primary:hover {
  box-shadow: 0 4px 24px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-nav-primary:active { transform: scale(0.97); }

.btn-nav-ghost {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: clamp(13px, 1.6vw, 14px);
  font-weight: 500;
  color: var(--text-soft);
  border-radius: var(--radius-full);
  transition: all var(--dur-fast) var(--ease);
  cursor: pointer;
  white-space: nowrap;
  min-height: 40px;
  text-decoration: none;
}
.btn-nav-ghost:hover {
  color: var(--text);
  background: var(--bg-card);
}

/* User Menu */
.user-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  transition: all var(--dur-fast) var(--ease);
  min-height: 40px;
}
.user-menu-trigger:hover { background: var(--bg-card); }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.user-name {
  font-size: clamp(12px, 1.5vw, 13px);
  font-weight: 500;
  color: var(--text-soft);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron-down {
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease);
}
.user-menu-wrap.open .chevron-down { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(244, 63, 94, 0.04);
  z-index: 120;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  transition: all var(--dur-fast) var(--ease-spring);
  transform-origin: top right;
}
.user-dropdown.user-dropdown--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.user-dropdown-header {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.user-dropdown-name {
  font-weight: 700;
  font-size: 14px;
}
.user-dropdown-plan {
  font-size: 11px;
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.user-dropdown-credits {
  font-size: 12px;
  color: var(--accent-light);
  font-weight: 600;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: none;
  color: var(--text-soft);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-align: left;
  transition: background var(--dur-fast) var(--ease);
  min-height: 44px;
}
.dropdown-item:hover { background: var(--bg-card); color: var(--text); }
.dropdown-item-danger { color: var(--red); }
.dropdown-item-danger:hover { background: var(--red-bg); }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

/* Notification bell */
.nav-bell { position: relative; }
.nav-bell-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.nav-bell-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-card);
}
.nav-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--bg);
}
.nav-notif-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 340px;
  max-width: 90vw;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 120;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease-spring);
  transform-origin: top right;
}
.nav-notif-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.nav-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}
.nav-notif-mark-all {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.nav-notif-mark-all:hover { text-decoration: underline; }
.nav-notif-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Desktop Nav */
@media (min-width: 769px) {
  .nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
  }
  .nav-links a {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    border-radius: var(--radius-full);
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
    white-space: nowrap;
    text-decoration: none;
  }
  .nav-links a:hover { color: var(--text-soft); background: var(--bg-card); }
  .nav-links a.active {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent-glow);
  }

  .nav-hamburger { display: none; }
  .nav-sidebar { display: none !important; }
  .mobile-only { display: none !important; }
}

/* Page content fade-in — smooth transition between page loads */
.page-content {
  animation: pageFadeIn 0.25s ease-out;
  view-transition-name: page-content;
  will-change: opacity, transform;
}

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

/* Exit animation — triggered by JS before navigating to a new page */
.page-content.page-leaving {
  animation: pageLeave 0.2s ease-in both;
  pointer-events: none;
}

@keyframes pageLeave {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}

/* Navbar fade-out — matches the content exit so the whole page fades
   uniformly instead of the navbar blinking out on unload. */
.navbar.page-leaving {
  animation: navLeave 0.2s ease-in both;
  pointer-events: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .page-content,
  .page-content.page-leaving,
  .navbar.page-leaving {
    animation: none !important;
  }
}

/* ==========================================================================
   Cross-document View Transitions
   Smooth, editorial page navigation — old content fades + compresses
   while new content fades + expands in. No SPA needed.
   Chrome 111+, Edge 111+, Opera 97+; no-op in Firefox/Safari.
   ========================================================================== */

/* Fade old page out with a subtle scale-compress, fade new page in */
::view-transition-old(page-content) {
  animation: vtFadeOut 0.25s ease-out both;
}
::view-transition-new(page-content) {
  animation: vtFadeIn 0.3s ease-out 0.05s both;
}

@keyframes vtFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}
@keyframes vtFadeIn {
  from { opacity: 0; transform: scale(1.005) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Navbar crossfades quickly — active tab updates without flicker */
::view-transition-old(nav-bar) {
  animation: vtNavFadeOut 0.12s ease-out both;
}
::view-transition-new(nav-bar) {
  animation: vtNavFadeIn 0.12s ease-out both;
}

@keyframes vtNavFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes vtNavFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Root transition — subtle crossfade for background/ambient elements */
::view-transition-old(root) {
  animation: vtRootFadeOut 0.2s ease-out both;
}
::view-transition-new(root) {
  animation: vtRootFadeIn 0.25s ease-out 0.1s both;
}

@keyframes vtRootFadeOut {
  from { opacity: 1; }
  to   { opacity: 0.5; }
}
@keyframes vtRootFadeIn {
  from { opacity: 0.3; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(page-content),
  ::view-transition-new(page-content),
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   6. Buttons — Ember Accents
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--dur) var(--ease-spring);
  border: none;
  text-decoration: none;
  line-height: 1.2;
  min-height: 44px;
  max-width: 100%;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e11d48);
  color: #fff;
  box-shadow: var(--shadow-warm);
}
.btn-primary:hover {
  box-shadow: 0 4px 28px var(--accent-glow), var(--shadow-warm);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-card);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn-lg { padding: 14px 32px; font-size: 16px; min-height: 52px; border-radius: var(--radius-lg); }
@media (max-width: 480px) {
  .btn-lg { padding: 12px 24px; font-size: 15px; }
}
.btn-sm { padding: 7px 16px; font-size: 12px; min-height: 36px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* Glow button variant */
.btn-glow {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-glow:hover {
  box-shadow: 0 0 40px var(--accent-glow-strong);
  transform: translateY(-2px) scale(1.02);
}
.btn-glow:active { transform: scale(0.97); }

/* Copy button */
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  min-height: 40px;
}
.btn-copy:hover {
  color: var(--text-soft);
  border-color: var(--border-hover);
  background: var(--bg-card);
}
.btn-copy.copied {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-bg);
}

/* ---------------------------------------------------------------------------
   7. Forms & Inputs
   --------------------------------------------------------------------------- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-field label {
  font-size: clamp(12px, 1.5vw, 13px);
  font-weight: 500;
  color: var(--text-dim);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 11px 16px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all var(--dur-fast) var(--ease);
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
}

.form-error {
  font-size: 13px;
  color: var(--red);
  padding: 10px 14px;
  background: var(--red-bg);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.form-error.hidden { display: none; }

/* Password strength */
.pwd-strength {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.pwd-strength-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
  width: 0;
}
.pwd-strength-bar.strength-weak { background: var(--red); }
.pwd-strength-bar.strength-fair { background: var(--amber-sem); }
.pwd-strength-bar.strength-good { background: var(--blue); }
.pwd-strength-bar.strength-strong { background: var(--green); }

.pwd-strength-text {
  font-size: 11px;
  font-weight: 500;
  display: block;
  margin-top: 3px;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; font-weight: 500; }
.toggle-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.toggle-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(18px); }

/* ---------------------------------------------------------------------------
   8. Cards — Warm Glass
   --------------------------------------------------------------------------- */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.glass:hover {
  border-color: var(--border-hover);
}

.glass-strong {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border: 1px solid var(--border);
}

.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.3s ease;
}
.glass-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-hover);
}

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
}
[data-theme="light"] .glass-card:hover {
  background: rgba(255, 255, 255, 0.85);
}

.glass-glow {
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-glow);
  transition: all 0.3s ease;
}

.card-gradient {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, rgba(245, 158, 11, 0.04) 50%, transparent 100%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
}

[data-theme="light"] .card-gradient {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.04) 0%, rgba(217, 119, 6, 0.02) 50%, transparent 100%);
}

/* ---------------------------------------------------------------------------
   9. Auth Pages
   --------------------------------------------------------------------------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  padding: clamp(24px, 5vw, 40px) 16px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 5vw, 48px);
  max-width: 920px;
  width: 100%;
  align-items: start;
}

.auth-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(32px, 4vw, 44px);
  width: 100%;
}

.auth-header {
  margin-bottom: clamp(24px, 4vw, 32px);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(245, 158, 11, 0.08));
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: clamp(12px, 1.6vw, 13px);
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 18px;
}

.auth-header h1 {
  font-size: clamp(30px, 4vw, 36px);
  font-weight: 400;
  margin-bottom: 8px;
}

.auth-header p {
  font-size: clamp(14px, 2vw, 16px);
  color: var(--text-dim);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-divider {
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-social {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  min-height: 48px;
}
.btn-social:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.auth-footer a {
  color: var(--accent);
  font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

/* Auth benefits sidebar */
.auth-benefits {
  padding-top: 16px;
}

.auth-benefits h2 {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 24px;
}

.benefit-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--dur-fast) var(--ease);
}
.benefit-card:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.benefit-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
  margin-top: 2px;
}

.benefit-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 3px;
}

.benefit-desc {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

@media (min-width: 700px) {
  .auth-grid { grid-template-columns: 1fr 1fr; }
  .auth-benefits:empty { display: none; }
}

/* ---------------------------------------------------------------------------
   10. Hero Section — Editorial Layout
   --------------------------------------------------------------------------- */
.hero {
  padding: clamp(48px, 8vw, 100px) 16px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 55%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(244, 63, 94, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -15%;
  right: -10%;
  width: 45%;
  height: 55%;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-left {
  animation: fadeUp 0.7s ease-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.10), rgba(245, 158, 11, 0.06));
  border: 1px solid rgba(244, 63, 94, 0.12);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  font-size: clamp(12px, 1.5vw, 13px);
  font-weight: 500;
  color: var(--amber);
  margin-bottom: clamp(18px, 3vw, 28px);
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: clamp(16px, 2vw, 24px);
}

.hero-sub {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--text-dim);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: clamp(28px, 4vw, 40px);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(32px, 4vw, 44px);
}

.hero-stats {
  display: flex;
  gap: clamp(24px, 4vw, 44px);
  flex-wrap: wrap;
}

.hero-stat { display: flex; flex-direction: column; gap: 1px; }
.hero-stat-number { font-size: 18px; font-weight: 700; }
.hero-stat-label { font-size: 12px; color: var(--text-muted); }

/* Hero Mockup */
.hero-right {
  animation: fadeUp 0.7s ease-out 0.1s both;
}

.chat-mockup {
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 20px 16px 24px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 80px rgba(244, 63, 94, 0.04);
  transition: box-shadow 0.5s ease;
}
.chat-mockup:hover {
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 80px rgba(244, 63, 94, 0.08);
}

.chat-notch {
  width: 90px;
  height: 20px;
  background: var(--bg);
  border-radius: 0 0 12px 12px;
  margin: -20px auto 16px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.chat-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
}

.chat-status {
  font-size: 11px;
  color: var(--green);
}

.chat-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.chat-msg {
  max-width: 83%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-msg-them {
  align-self: flex-start;
  background: var(--bg-card);
  border-radius: 18px 18px 18px 4px;
}

.chat-msg-me {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  border-radius: 18px 18px 4px 18px;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.chat-analysis {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08), rgba(245, 158, 11, 0.04));
  padding: 8px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
  border: 1px solid rgba(244, 63, 94, 0.12);
}
.chat-analysis-label {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
}
.chat-analysis-score {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
}
.chat-analysis-status {
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
}

.chat-tones {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-tones-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.chat-tone-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tone-pill {
  cursor: pointer;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid;
  transition: all 0.2s;
  font-family: inherit;
  background: transparent;
}
.tone-pill:hover { transform: scale(1.03); }
.tone-pill.active { transform: scale(1.05); }

.tone-pill-smooth {
  background: rgba(20, 184, 166, 0.12);
  color: var(--vibe-smooth);
  border-color: rgba(20, 184, 166, 0.25);
}
.tone-pill-smooth.active { background: rgba(20, 184, 166, 0.2); }

.tone-pill-funny {
  background: rgba(59, 130, 246, 0.10);
  color: var(--vibe-funny);
  border-color: rgba(59, 130, 246, 0.2);
}
.tone-pill-funny.active { background: rgba(59, 130, 246, 0.18); }

.tone-pill-bold {
  background: rgba(244, 63, 94, 0.10);
  color: var(--accent);
  border-color: rgba(244, 63, 94, 0.2);
}
.tone-pill-bold.active { background: rgba(244, 63, 94, 0.18); }

.chat-preview {
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.chat-preview-smooth {
  background: rgba(20, 184, 166, 0.06);
  border: 1px solid rgba(20, 184, 166, 0.15);
}
.chat-preview-funny {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.chat-preview-bold {
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.15);
}
.chat-preview-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.chat-preview-label-smooth { color: var(--vibe-smooth); }
.chat-preview-label-funny { color: var(--vibe-funny); }
.chat-preview-label-bold { color: var(--accent); }

.chat-typing {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding: 0 4px;
  opacity: 0.4;
}
.chat-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

/* ═══════════════════════════════════════════════════════════════════════════
   Chat Carousel — multi-language slideshow
   ═══════════════════════════════════════════════════════════════════════════ */
.chat-carousel {
  position: relative;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
}
.carousel-viewport {
  overflow: hidden;
  border-radius: 32px;
}
.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}
.carousel-slide .chat-mockup {
  margin: 0;
  max-width: 100%;
}

/* ── Carousel arrows — overlap mockup edges for a compact, balanced look ── */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.25s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
}
.chat-carousel:hover .carousel-arrow {
  opacity: 1;
  pointer-events: auto;
}
.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.12);
}
.carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}
.carousel-arrow-left  { left: 8px; }
.carousel-arrow-right { right: 8px; }

/* ── Carousel dots ── */
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 3px;
  border: none;
  background: var(--text-muted);
  opacity: 0.25;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0;
}
.carousel-dot.active {
  opacity: 1;
  background: var(--accent);
  width: 20px;
  min-width: 20px;
}
.carousel-dot:hover {
  opacity: 0.5;
}

/* ── Language badge — glass chip, always readable ── */
.carousel-lang-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* Responsive: always show arrows on mobile, slightly smaller */
@media (max-width: 768px) {
  .carousel-arrow { opacity: 1; pointer-events: auto; width: 28px; height: 28px; font-size: 15px; }
  .carousel-arrow-left  { left: 6px; }
  .carousel-arrow-right { right: 6px; }
}

@media (min-width: 769px) {
  .hero-actions { flex-direction: row; }
}

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-right { max-width: none; }
  .chat-mockup { max-width: 100%; transform: perspective(1000px) rotateY(-3deg) rotateX(1deg); transition: transform 0.6s ease, box-shadow 0.6s ease; }
  .chat-mockup:hover { transform: perspective(1000px) rotateY(-1deg) rotateX(0deg); box-shadow: 0 28px 80px rgba(0,0,0,0.5), 0 0 60px var(--accent-glow); }
}

/* ---------------------------------------------------------------------------
   11. Trust Bar
   --------------------------------------------------------------------------- */
.trust-section {
  max-width: var(--max-width);
  margin: 0 auto clamp(48px, 6vw, 64px);
  padding: 0 16px;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(12px, 2vw, 16px);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 3vw, 28px);
}

.trust-item {
  text-align: center;
  padding: clamp(8px, 1.5vw, 16px);
  transition: transform var(--dur-fast) var(--ease);
}
.trust-item:hover { transform: translateY(-2px); }

.trust-icon { font-size: 28px; margin-bottom: 6px; }
.trust-label { font-size: clamp(13px, 1.6vw, 14px); font-weight: 700; margin-bottom: 2px; }
.trust-sub { font-size: clamp(11px, 1.3vw, 12px); color: var(--text-muted); }

@media (min-width: 640px) {
  .trust-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------------------------------------------------------------------
   12. Features / Bento Grid
   --------------------------------------------------------------------------- */
.features-section {
  padding: clamp(56px, 10vw, 100px) 16px;
  background: var(--bg-soft);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature-card {
  padding: clamp(28px, 3vw, 36px);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: all var(--dur) var(--ease);
}
.feature-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-glass-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: inline-block;
}

.feature-card h3 {
  font-family: var(--font);
  font-size: clamp(17px, 2vw, 19px);
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.feature-card p {
  font-size: clamp(13px, 1.5vw, 14px);
  color: var(--text-dim);
  line-height: 1.6;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

@media (min-width: 1024px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------------------
   13. How It Works
   --------------------------------------------------------------------------- */
.how-section {
  padding: clamp(56px, 10vw, 100px) 16px;
}

.how-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3vw, 36px);
  max-width: 800px;
  margin: 0 auto;
}

.how-card {
  text-align: center;
  padding: 36px 28px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: all var(--dur) var(--ease);
}
.how-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.how-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12), rgba(245, 158, 11, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  transition: all var(--dur) var(--ease);
}
.how-card:hover .how-icon-wrap {
  transform: translateY(-3px);
  box-shadow: 0 0 24px var(--accent-glow);
}

.how-card h3 {
  font-family: var(--font);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}

.how-card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.65;
  max-width: 320px;
  margin: 0 auto;
}

@media (min-width: 700px) {
  .how-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------------------
   14. CTA Section
   --------------------------------------------------------------------------- */
.cta-section {
  padding: clamp(56px, 10vw, 100px) 16px;
  background: var(--bg-soft);
}

.cta-card {
  padding: clamp(48px, 8vw, 80px) clamp(28px, 4vw, 48px);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.05), rgba(245, 158, 11, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  text-align: center;
  position: relative;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -25%;
  width: 150%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(244, 63, 94, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.cta-card h2 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: clamp(14px, 2vw, 18px);
  position: relative;
}

.cta-card p {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--text-dim);
  max-width: 500px;
  margin: 0 auto clamp(28px, 4vw, 36px);
  position: relative;
}

/* ---------------------------------------------------------------------------
   15. Footer — Warm Dark
   --------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.5);
  padding: clamp(48px, 8vw, 64px) 16px clamp(24px, 3vw, 32px);
}

[data-theme="light"] .footer {
  background: rgba(0, 0, 0, 0.02);
  border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .footer-tagline { color: var(--text-dim); font-weight: 450; }
[data-theme="light"] .footer-bottom { color: var(--text-dim); font-weight: 450; }
[data-theme="light"] .footer-col a { color: var(--text-soft); }
[data-theme="light"] .footer-col a:hover { color: var(--text); opacity: 0.8; }
[data-theme="light"] .footer-col h4 { color: var(--text-dim); }

.footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 48px);
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 260px;
  line-height: 1.5;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 48px);
}

.footer-col h4 {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  padding: 4px 0;
  transition: color var(--dur-fast) var(--ease);
}
.footer-col a:hover { color: var(--text-soft); }

.footer-bottom {
  max-width: var(--max-width-wide);
  margin: clamp(32px, 5vw, 48px) auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr 2fr;
  }
}

/* ---------------------------------------------------------------------------
   16. Upload Zone
   --------------------------------------------------------------------------- */
.upload-section {
  max-width: 620px;
  margin: 0 auto clamp(40px, 6vw, 60px);
  padding: 0 16px;
}

.upload-box {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(44px, 6vw, 60px) clamp(20px, 3vw, 28px);
  cursor: pointer;
  transition: all var(--dur) var(--ease-spring);
  background: var(--bg-glass);
  text-align: center;
}
.upload-box:hover,
.upload-box.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.upload-box.has-files {
  border-style: solid;
  border-color: var(--border);
  padding: clamp(24px, 2.5vw, 28px);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  color: var(--text-muted);
  transition: all var(--dur) var(--ease);
}
.upload-box:hover .upload-icon { color: var(--accent); transform: scale(1.1); }

.upload-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.upload-sub {
  font-size: clamp(13px, 1.6vw, 14px);
  color: var(--text-muted);
}

.preview-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.preview-item {
  position: relative;
  width: clamp(80px, 12vw, 96px);
  height: clamp(80px, 12vw, 96px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color var(--dur) var(--ease);
}
.preview-item:hover { border-color: var(--accent); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
  position: absolute;
  top: -4px; right: -4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--red);
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.preview-item:hover .preview-remove { opacity: 1; }

.btn-analyze {
  margin-top: 20px;
  width: 100%;
  padding: 14px 32px;
  font-family: var(--font);
  font-size: clamp(15px, 2vw, 16px);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #e11d48);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--dur) var(--ease-spring);
  min-height: 52px;
}
.btn-analyze:hover:not(:disabled) {
  box-shadow: 0 8px 32px var(--accent-glow);
  transform: translateY(-2px);
}
.btn-analyze:active:not(:disabled) { transform: scale(0.98); }
.btn-analyze:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-analyze-loader {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

.upload-hint {
  margin-top: 10px;
  font-size: clamp(12px, 1.5vw, 13px);
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   17. Loading Overlay
   --------------------------------------------------------------------------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.loading-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(36px, 5vw, 52px);
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(244, 63, 94, 0.04);
  animation: fadeUp 0.3s ease-out;
  width: 100%;
  max-width: 360px;
}

.loading-ripple {
  position: relative;
  width: 48px; height: 48px;
  margin: 0 auto 20px;
}
.loading-ripple::before,
.loading-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: ripple 1.5s ease-out infinite;
}
.loading-ripple::after { animation-delay: 0.75s; }

.loading-card p {
  font-size: clamp(16px, 2vw, 18px);
  font-weight: 600;
  margin-bottom: 4px;
}
.loading-sub { font-size: clamp(13px, 1.6vw, 14px); color: var(--text-muted); }

/* ---------------------------------------------------------------------------
   18. Results
   --------------------------------------------------------------------------- */
.results-section {
  max-width: 900px;
  margin: 0 auto clamp(48px, 8vw, 80px);
  padding: 0 16px;
}

.results-title {
  text-align: center;
  font-size: clamp(26px, 3.5vw, 32px);
  font-weight: 400;
  margin-bottom: clamp(24px, 3vw, 32px);
  margin-top: clamp(32px, 4vw, 44px);
}

/* Rizz Score Card */
.rizz-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.04), rgba(245, 158, 11, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(28px, 3vw, 36px);
  margin-bottom: 20px;
  animation: fadeUp 0.4s ease-out;
  text-align: center;
}

.rizz-meter {
  position: relative;
  width: clamp(92px, 12vw, 108px);
  height: clamp(92px, 12vw, 108px);
  flex-shrink: 0;
}
.rizz-meter svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.rizz-meter-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}
.rizz-meter-fill {
  fill: none;
  stroke: url(#rizzGradient);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.rizz-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.rizz-number {
  font-size: clamp(26px, 4vw, 30px);
  font-weight: 800;
  line-height: 1;
}
.rizz-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 2px;
}

.rizz-info { flex: 1; }
.rizz-vibe {
  font-size: clamp(20px, 2.5vw, 22px);
  font-weight: 700;
  margin-bottom: 4px;
}
.rizz-detail {
  font-size: clamp(13px, 1.6vw, 14px);
  color: var(--text-dim);
  line-height: 1.5;
}

@media (min-width: 640px) {
  .rizz-card {
    flex-direction: row;
    text-align: left;
  }
}

/* Reply Cards */
.replies-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.reply-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 20px 18px;
  transition: all var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.5s ease-out both;
}
.reply-card:nth-child(1) { animation-delay: 0.05s; }
.reply-card:nth-child(2) { animation-delay: 0.1s; }
.reply-card:nth-child(3) { animation-delay: 0.15s; }

.reply-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.reply-card.smooth:hover { border-color: var(--vibe-smooth); }
.reply-card.funny:hover { border-color: var(--vibe-funny); }
.reply-card.bold:hover { border-color: var(--accent); }

.reply-tag {
  display: inline-block;
  font-size: clamp(10px, 1.3vw, 11px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  align-self: flex-start;
}
.tag-smooth { background: var(--vibe-smooth-bg); color: var(--vibe-smooth); }
.tag-funny { background: var(--vibe-funny-bg); color: var(--vibe-funny); }
.tag-bold { background: var(--vibe-bold-bg); color: var(--vibe-bold); }

.reply-text {
  font-size: clamp(14px, 1.8vw, 15px);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 14px;
}

@media (min-width: 640px) {
  .replies-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* Red Flags */
.red-flags-card {
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-xl);
  padding: clamp(18px, 2.5vw, 22px) clamp(20px, 3vw, 26px);
  margin-top: 16px;
}

.red-flags-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 10px;
}

.red-flags-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.red-flag-item {
  font-size: clamp(13px, 1.6vw, 14px);
  line-height: 1.5;
  color: var(--red);
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.red-flags-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--green);
}

/* Memory Context Bar */
.memory-bar {
  max-width: 640px;
  margin: 0 auto 12px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}
.memory-text {
  font-weight: 500;
  font-size: clamp(13px, 1.5vw, 14px);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Memory Status Bar (history page) */
.memory-status-bar {
  max-width: 640px;
  margin: 0 auto 20px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-radius: var(--radius-lg);
  font-size: 13px;
}
.memory-status-bar.disabled {
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border);
  color: var(--text-dim);
}
.memory-status-bar.empty {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.memory-status-bar.active {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.2);
  color: var(--text);
}

[data-theme="light"] .memory-status-bar.disabled {
  background: rgba(0,0,0,0.02);
}
[data-theme="light"] .memory-status-bar.empty {
  background: rgba(0,0,0,0.01);
}
[data-theme="light"] .memory-status-bar.active {
  background: rgba(13,148,136,0.06);
  border-color: rgba(13,148,136,0.18);
}
.memory-status-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}
.memory-status-track {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.memory-status-fill {
  height: 100%;
  background: #10b981;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.memory-status-fill.warning {
  background: #f59e0b;
}
.memory-status-fill.danger {
  background: #ef4444;
}

/* Primary "Add to Memory" button on history cards */
.hist-mem-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 999px;
  border: 1px solid rgba(139,92,246,0.25);
  background: rgba(139,92,246,0.1);
  color: #a78bfa;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.hist-mem-btn:hover:not(:disabled) {
  background: rgba(139,92,246,0.2);
  border-color: rgba(139,92,246,0.4);
  transform: translateY(-1px);
}
.hist-mem-btn.loaded {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.25);
  color: #34d399;
  cursor: default;
  opacity: 0.8;
}
.hist-mem-btn:disabled {
  cursor: default;
  opacity: 0.7;
}
.hist-mem-btn.loaded:disabled {
  opacity: 0.8;
}
.hist-mem-btn.remove {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
  color: #f87171;
  cursor: pointer;
}
.hist-mem-btn.remove:hover:not(:disabled) {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.35);
  transform: translateY(-1px);
}

/* Context Selector */
.context-section {
  max-width: 640px;
  margin: 0 auto 20px;
}

.context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.context-header h4 {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}
.context-count {
  font-size: 12px;
  color: var(--text-dim);
}

.context-char-bar {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.context-char-track {
  height: 5px;
  background: var(--bg-input);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}
.context-char-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.context-char-fill.warning { background: var(--amber-sem); }
.context-char-fill.danger { background: var(--red); }

.context-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.context-item:hover { border-color: var(--border-hover); }
.context-item.disabled { opacity: 0.4; pointer-events: none; }

.context-check { display: flex; align-items: center; }
.context-check input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

.context-vibe {
  font-size: 14px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.context-info { flex: 1; min-width: 0; }
.context-score {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}
.context-snippet {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.context-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.context-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--dur-fast);
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.context-delete:hover { color: var(--red); background: var(--red-bg); }

/* Error Banner */
.error-banner {
  max-width: 580px;
  margin: 0 auto 24px;
  padding: clamp(10px, 2vw, 12px) clamp(16px, 2.5vw, 20px);
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.error-text { font-size: clamp(13px, 1.6vw, 14px); color: var(--red); flex: 1; }
.error-close {
  background: none; border: none;
  color: var(--red); font-size: 22px;
  cursor: pointer; padding: 4px;
  line-height: 1; min-width: 32px; min-height: 32px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------------------------------------------------------------------------
   19. Pricing
   --------------------------------------------------------------------------- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  max-width: 960px;
  margin: 0 auto 48px;
}

.price-card {
  position: relative;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 40px 34px;
  text-align: center;
  transition: all var(--dur) var(--ease-spring);
  display: flex;
  flex-direction: column;
}
.price-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-hover);
}

/* Dark theme: price cards need a visible surface */
[data-theme="dark"] .price-card {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.08);
}

.price-card.popular {
  border-color: var(--accent-glow);
  box-shadow: 0 0 32px var(--accent-glow), 0 4px 24px rgba(0,0,0,0.3);
}

.price-card.current {
  border: 1px solid var(--teal) !important;
  background: rgba(20, 184, 166, 0.03) !important;
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-accent);
  color: #fff;
  font-size: clamp(11px, 1.4vw, 12px);
  font-weight: 700;
  padding: 4px 18px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  text-transform: uppercase;
}


.price-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.price-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 20px;
}
.price-amount {
  font-size: clamp(34px, 4.5vw, 38px);
  font-weight: 800;
  letter-spacing: -1px;
}
.price-period {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 400;
}
.price-local {
  font-size: 13px;
  color: var(--text-muted);
}
.price-features {
  flex: 1;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.price-features li {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.price-features li strong { color: var(--text); }
.price-features li .feat-missing { color: var(--text-muted); }

@media (min-width: 700px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Pricing tables */
.price-table-wrap {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.price-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.price-table th {
  padding: 20px 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.price-table td {
  padding: 16px 24px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.price-table tr:last-child td { border-bottom: none; }
.price-table .feature-label { color: var(--text-dim); }

/* ---------------------------------------------------------------------------
   20. Dashboard
   --------------------------------------------------------------------------- */
.dashboard-page {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) 16px clamp(48px, 6vw, 80px);
}

.dash-header {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 48px);
}
.dash-header h1 {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 400;
  margin-bottom: 4px;
}
.dash-header p {
  color: var(--text-dim);
  font-size: clamp(14px, 2vw, 16px);
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(12px, 2vw, 16px);
  margin-bottom: clamp(28px, 5vw, 48px);
}

.dash-stat {
  padding: clamp(20px, 2.5vw, 28px);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
  transition: all var(--dur-fast) var(--ease);
}
.dash-stat:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.dash-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.dash-stat-value {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
}

.dash-grid {
  display: grid;
  gap: 28px;
}

.dash-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 3vw, 28px);
  transition: all var(--dur) var(--ease);
}
.dash-card:hover { border-color: var(--border-hover); }

.dash-card-header h3 {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
}

.dash-cta-card {
  padding: clamp(36px, 5vw, 48px);
  background: linear-gradient(135deg, var(--accent), #e11d48);
  border-radius: var(--radius-xl);
  text-align: center;
}
.dash-cta-card h2 {
  font-family: var(--font-display);
  color: #fff;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 400;
  margin-bottom: 8px;
}
.dash-cta-card p {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-bottom: 20px;
}

.dash-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-full);
  transition: all var(--dur) var(--ease-spring);
}
.dash-cta-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* ---------------------------------------------------------------------------
   21. History
   --------------------------------------------------------------------------- */
.history-page {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) 16px clamp(48px, 6vw, 80px);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: clamp(24px, 3vw, 32px);
}
.history-header h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 400;
  margin-bottom: 4px;
}
.history-header p {
  color: var(--text-dim);
  font-size: clamp(13px, 1.8vw, 15px);
}

.history-list {
  display: grid;
  gap: 12px;
}

.hist-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: visible;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--dur) var(--ease);
  cursor: default;
}
.hist-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-glass-strong);
}
.hist-card.expanded {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim, rgba(255,45,149,0.15));
}
.hist-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  cursor: pointer;
  user-select: none;
}
.hist-summary:active {
  opacity: 0.85;
}
.hist-expand-icon {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  display: inline-block;
}
.hist-card.expanded .hist-expand-icon {
  transform: rotate(180deg);
}

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

.hist-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.hist-snippet {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-soft);
}

.hist-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.hist-detail {
  display: none;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--glass-border);
  animation: histSlideIn 0.25s ease;
}
.hist-card.expanded .hist-detail {
  display: block;
}

@keyframes histSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Loaded-in-memory indicator on card */
.hist-card.loaded-in-memory {
  border-color: rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.03);
}
.hist-card.loaded-in-memory .hist-summary {
  opacity: 0.85;
}
/* Card at max memory capacity (not loaded, can't load more) */
.hist-card.hist-maxed {
  opacity: 0.6;
}

.hist-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.hist-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--dur-fast) var(--ease);
}
.hist-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-card);
}

.hist-loading {
  text-align: center;
  padding: 48px 16px;
}

.hist-empty {
  text-align: center;
  padding: 64px 16px;
  color: var(--text-dim);
}
.hist-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.hist-empty h3 {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-soft);
}
.hist-empty p {
  font-size: 14px;
  margin-bottom: 20px;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.page-info {
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------------------
   22. FAQ
   --------------------------------------------------------------------------- */
.faq-page {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) 16px clamp(48px, 6vw, 80px);
}

.v5-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--dur) var(--ease);
  background: var(--bg-glass);
}
.v5-faq-item:hover { border-color: var(--border-hover); }
.v5-faq-item[open] {
  border-color: var(--accent-glow);
}

.v5-faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  list-style: none;
}
.v5-faq-item summary::-webkit-details-marker { display: none; }

.v5-faq-icon {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-dim);
  transition: transform var(--dur) var(--ease);
  flex-shrink: 0;
  margin-left: 12px;
}
.v5-faq-item[open] .v5-faq-icon { transform: rotate(45deg); }

.v5-faq-answer {
  padding: 0 24px 18px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ---------------------------------------------------------------------------
   23. Settings / Profile / Billing
   --------------------------------------------------------------------------- */
.settings-page {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) 16px clamp(48px, 6vw, 80px);
}

.settings-header {
  margin-bottom: clamp(28px, 4vw, 40px);
}
.settings-header h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 400;
  margin-bottom: 4px;
}
.settings-header p {
  color: var(--text-dim);
  font-size: clamp(14px, 2vw, 16px);
}

.settings-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 3vw, 32px);
  margin-bottom: 20px;
}
.settings-card h2 {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.settings-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}
.settings-field input {
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all var(--dur-fast) var(--ease);
}
.settings-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.settings-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 3vw, 28px);
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-xl);
  flex-wrap: wrap;
}
.settings-danger h3 {
  font-family: var(--font);
  font-weight: 700;
  color: var(--red);
  margin-bottom: 4px;
}
.settings-danger p {
  font-size: 13px;
  color: var(--text-dim);
}

/* Billing specific */
.billing-balance {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.06), rgba(245, 158, 11, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(28px, 4vw, 40px);
  text-align: center;
  margin-bottom: 20px;
}

[data-theme="light"] .billing-balance {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.04), rgba(217, 119, 6, 0.02));
}

.billing-amount {
  font-size: clamp(40px, 6vw, 52px);
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub-active {
  background: var(--teal-soft);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 3vw, 28px);
  margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
   24. Modals
   --------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(28px, 4vw, 36px);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease-out;
}

.modal-title {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
}

.modal-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
   25. Pricing Gateway Modal (legacy picker in pricing.js)
   --------------------------------------------------------------------------- */
.pricing-gateway-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pricing-gateway-modal {
  width: 100%;
  max-width: 440px;
  padding: clamp(28px, 4vw, 40px);
  position: relative;
  animation: fadeUp 0.3s ease-out;
}
.pricing-gateway-modal h3 {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

.pricing-gateway-buttons {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.gw-btn-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  width: 100%;
}
.gw-btn-icons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.gw-btn-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.gw-btn-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.gateway-cancel-btn {
  width: 100%;
  color: var(--text-dim) !important;
}

/* ---------------------------------------------------------------------------
   26. Payment Popup
   --------------------------------------------------------------------------- */
.paypop-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.paypop-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(28px, 4vw, 40px);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(244, 63, 94, 0.04);
  animation: fadeUp 0.3s ease-out;
  position: relative;
}

.paypop-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--dur-fast) var(--ease);
}
.paypop-close:hover {
  background: var(--bg-card);
  color: var(--text);
}

.paypop-title {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.paypop-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.5;
}

.paypop-options {
  display: grid;
  gap: 12px;
}

.paypop-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  text-align: left;
  font-family: var(--font);
  width: 100%;
  color: var(--text);
}
.paypop-option:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateX(2px);
}

.paypop-option-icon {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--radius);
}

.paypop-option-icon--globe {
  background: var(--teal-soft);
  color: var(--teal);
}

.paypop-option-label {
  font-weight: 600;
  font-size: 15px;
  color: #fff !important;
}

[data-theme="light"] .paypop-option-label {
  color: var(--text) !important;
}

.paypop-option-desc {
  font-size: 12px;
  color: var(--text-dim);
  grid-column: 2;
}

.paypop-option-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-glass-strong);
  color: var(--text-soft);
  align-self: start;
}

.paypop-cancel {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--dur-fast) var(--ease);
  font-family: var(--font);
}
.paypop-cancel:hover {
  color: var(--text);
  background: var(--bg-card);
}

/* ---------------------------------------------------------------------------
   27. Toast Notifications
   --------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
}

.toast {
  pointer-events: auto;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  animation: slideUp 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }

/* ---------------------------------------------------------------------------
   28. Animations
   --------------------------------------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-8px); }
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

@keyframes ripple {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal-stagger.visible > *,
.reveal-stagger > .visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for bento grid */
.reveal-stagger.visible .stagger-1,
.reveal-stagger > .stagger-1.visible { transition-delay: 0s; }
.reveal-stagger.visible .stagger-2,
.reveal-stagger > .stagger-2.visible { transition-delay: 0.05s; }
.reveal-stagger.visible .stagger-3,
.reveal-stagger > .stagger-3.visible { transition-delay: 0.1s; }
.reveal-stagger.visible .stagger-4,
.reveal-stagger > .stagger-4.visible { transition-delay: 0.15s; }
.reveal-stagger.visible .stagger-5,
.reveal-stagger > .stagger-5.visible { transition-delay: 0.2s; }
.reveal-stagger.visible .stagger-6,
.reveal-stagger > .stagger-6.visible { transition-delay: 0.25s; }

/* ---------------------------------------------------------------------------
   29. App Page — Override Classes (v4, v5 prefixes kept for JS compat)
   --------------------------------------------------------------------------- */
.v5-app-main {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) 16px clamp(48px, 6vw, 80px);
}

.v5-app-container {
  width: 100%;
}

/* Upload card */
.v5-upload-card {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(40px, 6vw, 56px) clamp(20px, 3vw, 28px);
  cursor: pointer;
  transition: all var(--dur) var(--ease-spring);
  background: var(--bg-glass);
  text-align: center;
}
.v5-upload-card:hover,
.v5-upload-card.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.v5-upload-card.has-files {
  border-style: solid;
  border-color: var(--border);
  padding: clamp(16px, 2vw, 20px);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}
.v5-upload-card.has-files #uploadDefault {
  flex-shrink: 0;
}
.v5-upload-card.has-files #uploadDefault .v5-upload-icon {
  font-size: 24px;
  margin-bottom: 4px;
}
.v5-upload-card.has-files #uploadDefault .v5-upload-title {
  font-size: 13px;
  font-weight: 500;
}
.v5-upload-card.has-files #uploadPreview {
  flex: 1;
  min-width: 0;
}

.v5-upload-icon {
  font-size: 44px;
  margin-bottom: 14px;
  display: block;
  color: var(--text-muted);
  transition: all var(--dur) var(--ease);
}
.v5-upload-card:hover .v5-upload-icon { color: var(--accent); transform: scale(1.1); }

.v5-upload-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}
.v5-upload-sub {
  font-size: clamp(13px, 1.6vw, 14px);
  color: var(--text-muted);
}

.v5-preview-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Rizz meter v5 */
.v5-rizz-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.04), rgba(245, 158, 11, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(24px, 3vw, 32px);
  margin-bottom: 20px;
  animation: fadeUp 0.4s ease-out;
  text-align: center;
}

.v5-rizz-meter {
  position: relative;
  width: clamp(88px, 12vw, 104px);
  height: clamp(88px, 12vw, 104px);
  flex-shrink: 0;
}
.v5-rizz-meter svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.v5-meter-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}
.v5-meter-fill {
  fill: none;
  stroke: url(#rizzGradient);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.v5-rizz-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.v5-rizz-num {
  font-size: clamp(24px, 4vw, 28px);
  font-weight: 800;
  line-height: 1;
}
.v5-rizz-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 2px;
}

.v5-rizz-info { flex: 1; }
.v5-rizz-info h3 {
  font-family: var(--font);
  font-size: clamp(18px, 2.5vw, 20px);
  font-weight: 700;
  margin-bottom: 4px;
}
.v5-rizz-desc {
  font-size: clamp(13px, 1.6vw, 14px);
  color: var(--text-dim);
  line-height: 1.5;
}

@media (min-width: 640px) {
  .v5-rizz-card { flex-direction: row; text-align: left; }
}

.v5-replies-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.v5-reply-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 18px 18px;
  transition: all var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.5s ease-out both;
}
.v5-reply-card:nth-child(1) { animation-delay: 0.05s; }
.v5-reply-card:nth-child(2) { animation-delay: 0.1s; }
.v5-reply-card:nth-child(3) { animation-delay: 0.15s; }

.v5-reply-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.v5-reply-tag {
  display: inline-block;
  font-size: clamp(10px, 1.3vw, 11px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  align-self: flex-start;
}
.v5-tag-smooth { background: var(--vibe-smooth-bg); color: var(--vibe-smooth); }
.v5-tag-funny { background: var(--vibe-funny-bg); color: var(--vibe-funny); }
.v5-tag-bold { background: var(--vibe-bold-bg); color: var(--vibe-bold); }

.v5-reply-text {
  font-size: clamp(14px, 1.8vw, 15px);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 14px;
}

@media (min-width: 640px) {
  .v5-replies-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.v5-btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  min-height: 40px;
}
.v5-btn-copy:hover {
  color: var(--text-soft);
  border-color: var(--border-hover);
  background: var(--bg-card);
}

/* Red flags v5 */
.v5-redflags-card {
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-xl);
  padding: clamp(16px, 2.5vw, 20px) clamp(18px, 3vw, 24px);
  margin-top: 16px;
}

.v5-redflags-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 10px;
}

.v5-redflags-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v5-redflag-item {
  font-size: clamp(13px, 1.6vw, 14px);
  line-height: 1.5;
  color: var(--red);
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* v4 context section */
.v4-context-section {
  max-width: 620px;
  margin: 0 auto 20px;
}
.v4-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.v4-context-header h4 {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}
.v4-context-count {
  font-size: 12px;
  color: var(--text-dim);
}
.v4-context-char-bar {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.v4-char-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.v4-context-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.v4-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.v4-context-item:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.v4-context-item.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.v4-context-check {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.v4-context-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.v4-context-vibe {
  font-size: 18px;
  width: 28px;
  flex-shrink: 0;
  text-align: center;
}
.v4-context-info {
  flex: 1;
  min-width: 0;
}
.v4-context-score {
  font-size: 13px;
  font-weight: 600;
}
.v4-context-snippet {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.v4-context-meta {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-top: 2px;
}
.v4-context-delete {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.v4-context-delete:hover {
  background: var(--red-bg, rgba(239,68,68,0.12));
  color: var(--red, #ef4444);
}
.v4-spinner {
  display: inline-block;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Results wrap v5 */
.v5-results-wrap {
  margin-top: 32px;
}

/* Hidden utility */
.hidden { display: none !important; }
.desktop-only { display: none; }
@media (min-width: 769px) {
  .desktop-only { display: initial; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Queue Progress Card — async job processing UI
   ═══════════════════════════════════════════════════════════════════════════ */
.qp-card {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: qpFadeIn 0.3s ease-out;
}

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

.qp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.qp-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: qpSpin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes qpSpin {
  to { transform: rotate(360deg); }
}

.qp-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.qp-message {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Progress bar */
.qp-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.qp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f472b6);
  border-radius: 3px;
  transition: width 0.5s ease-out;
  width: 0%;
}

/* Stage indicators */
.qp-stages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.qp-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.qp-stage.active {
  opacity: 1;
}

.qp-stage.active .qp-stage-icon {
  animation: qpPulse 1.2s ease-in-out infinite;
}

.qp-stage.done {
  opacity: 0.7;
}

.qp-stage.done .qp-stage-icon {
  filter: none;
}

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

.qp-stage-icon {
  font-size: 20px;
  line-height: 1;
}

.qp-stage-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}

.qp-stage-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  max-width: 40px;
  border-radius: 1px;
}

.qp-stage.done + .qp-stage-connector {
  background: var(--accent);
  opacity: 0.5;
}

.qp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.qp-footer-stats {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.qp-sep {
  color: var(--border-strong);
  margin: 0 2px;
}

.qp-confidence {
  font-size: 11px;
  color: var(--text-muted);
}

/* Tier badge */
.qp-tier-badge {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.qp-tier-free {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.qp-tier-starter {
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid rgba(20, 184, 166, 0.2);
}

.qp-tier-popular {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.qp-tier-pro {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
}

/* Enhanced position row */
.qp-position-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.qp-position-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  text-align: center;
  transition: transform 0.2s var(--ease-spring);
  font-family: var(--font-display);
}

.qp-position-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qp-position-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.qp-wait-estimate {
  font-size: 11px;
  color: var(--text-dim);
}

/* Confidence indicator */
.qp-confidence-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.qp-confidence-dot.conf-high {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-glow);
}

.qp-confidence-dot.conf-medium {
  background: var(--amber-sem-bg);
  color: var(--amber-sem);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.qp-confidence-dot.conf-low {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Cancel button */
.qp-cancel-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.qp-cancel-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Light theme overrides for queue progress card */
[data-theme="light"] .qp-card {
  background: var(--bg-surface);
  border-color: var(--border);
}
[data-theme="light"] .qp-spinner {
  border-color: rgba(0, 0, 0, 0.12);
  border-top-color: var(--accent);
}
[data-theme="light"] .qp-progress-track {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .qp-stage-connector {
  background: var(--border);
}
[data-theme="light"] .qp-footer {
  border-top-color: var(--border);
}
[data-theme="light"] .qp-position-row {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--border);
}
[data-theme="light"] .qp-position-number {
  color: var(--text);
}
[data-theme="light"] .qp-tier-free {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Confirm Dialog — matches webapp glass-morphism design
   ═══════════════════════════════════════════════════════════════════════════ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.confirm-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: clamp(32px, 5vw, 40px) clamp(24px, 4vw, 36px);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(244, 63, 94, 0.04);
  animation: fadeUp 0.3s ease-out;
  position: relative;
  text-align: center;
}

.confirm-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--dur-fast) var(--ease);
  font-family: var(--font);
}
.confirm-close:hover {
  background: var(--bg-card);
  color: var(--text);
}

.confirm-icon-wrap {
  margin-bottom: 16px;
}

.confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 28px;
  background: var(--amber-sem-bg);
  border-radius: 50%;
}

.confirm-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 400;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.confirm-message {
  font-size: clamp(14px, 1.8vw, 15px);
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 28px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
  min-height: 48px;
}

.confirm-actions .btn-primary {
  background: linear-gradient(135deg, var(--accent), #e11d48);
  color: #fff;
}

@keyframes fadeIn {
  from { opacity: 0; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

/* ===========================================================================
   Language Selector (bottom-right floating pill, scrolls with page)
   =========================================================================== */
.lang-selector {
  margin-top: 32px;
  text-align: right;
  padding: 0 20px 20px;
  position: relative;
  z-index: 50;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-family: var(--font);
  line-height: 1;
}

.lang-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-glass-strong);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.lang-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 20px;
  min-width: 200px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  padding: 6px;
  z-index: 100;
}

.lang-popover.hidden {
  display: none;
}

.lang-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.1s ease;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.lang-item:hover {
  background: var(--bg-glass-strong);
  color: var(--text);
}

.lang-item.active {
  background: var(--accent-soft);
  color: var(--accent-light);
  font-weight: 600;
}

.lang-flag {
  font-size: 16px;
  line-height: 1;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.lang-native {
  flex: 1;
  font-weight: 500;
}

.lang-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Light theme overrides */
[data-theme="light"] .lang-btn {
  background: #fff;
  border-color: #e5e5e5;
  color: #444;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="light"] .lang-btn:hover {
  border-color: #ccc;
  color: #111;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

[data-theme="light"] .lang-popover {
  background: #fff;
  border-color: #e5e5e5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

[data-theme="light"] .lang-item {
  color: #555;
}

[data-theme="light"] .lang-item:hover {
  background: #f5f5f5;
  color: #111;
}

[data-theme="light"] .lang-item.active {
  background: #fef2f2;
  color: #e11d48;
}

[data-theme="light"] .lang-label {
  color: #999;
}

/* ===========================================================================
   Navbar language selector override
   =========================================================================== */
.nav-lang-mount .lang-selector {
  margin: 0;
  padding: 0;
  text-align: left;
  display: flex;
  align-items: center;
}
.nav-lang-mount .lang-btn {
  padding: 4px 10px;
  font-size: 12px;
  box-shadow: none;
  background: transparent;
  border-color: transparent;
}
.nav-lang-mount .lang-btn:hover {
  background: var(--bg-glass-strong);
  border-color: var(--border);
}
.nav-lang-mount .lang-popover {
  position: absolute;
  top: calc(100% + 6px);
  bottom: auto;
  right: 0;
  min-width: 180px;
  max-height: 320px;
}
.nav-lang-mount .lang-popover.hidden {
  display: none;
}
/* Smaller padding on mobile */
@media (max-width: 480px) {
  .nav-lang-mount .lang-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  .nav-lang-mount .lang-popover {
    min-width: 160px;
  }
}

/* Hide navbar language selector on mobile — shown in sidebar instead */
@media (max-width: 768px) {
  .nav-lang-mount { display: none; }
}

/* Sidebar language section */
.sidebar-lang-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-lang-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 12px 12px;
}
.sidebar-lang-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  font-family: var(--font);
  line-height: 1;
}
.sidebar-lang-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card);
  color: var(--text);
}
.sidebar-lang-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-light);
  font-weight: 600;
}
[data-theme="light"] .sidebar-lang-item {
  border-color: #e5e5e5;
  color: #555;
}
[data-theme="light"] .sidebar-lang-item:hover {
  border-color: #ccc;
  background: #f5f5f5;
  color: #111;
}
[data-theme="light"] .sidebar-lang-item.active {
  border-color: #e11d48;
  background: #fef2f2;
  color: #e11d48;
}

/* Hide language selector on print */
@media print {
  .lang-selector { display: none; }
}

/* Mobile: smaller popover */
@media (max-width: 480px) {
  .lang-selector {
    padding: 0 12px 12px;
  }
  .lang-popover {
    right: 12px;
    min-width: 180px;
  }
}

/* Custom scrollbar for the popover */
.lang-popover::-webkit-scrollbar {
  width: 4px;
}
.lang-popover::-webkit-scrollbar-track {
  background: transparent;
}
.lang-popover::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Script-Specific Typography Normalization

   Different writing scripts have inherently different visual densities
   at the same CSS font-size. These rules normalize the perceived size
   and spacing across all supported languages so the page always looks
   balanced, symmetrical, and equally readable regardless of script.

   How it works:
   1. Font stacks — each script gets an appropriate font designed for its
      proportions (Noto Sans variants pair visually with Outfit).
   2. Base font-size — the <html> font-size is subtly scaled per script
      so inherited text sizes normalize visually.
   3. Line-height — adjusted per script family for consistent rhythm.
   4. Word/overflow handling — CJK and other scripts get appropriate
      break rules so text doesn't overflow or cause layout shifts.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── DEVANAGARI (Hindi, Marathi) ──
   Characters have a horizontal headline (shirorekha) that makes them
   appear ~13-15% taller than Latin at the same measured font-size.
   Noto Sans Devanagari is designed to be optically proportional to
   Latin fonts, so it's far better than OS fallbacks.          */
:root:lang(hi),
:root:lang(mr) {
  --font: 'Outfit', 'Noto Sans Devanagari', 'Nirmala UI', 'Devanagari MT', system-ui, sans-serif;
  --font-display: 'DM Serif Display', 'Noto Sans Devanagari', 'Nirmala UI', 'Devanagari MT', serif;
}
html:lang(hi),
html:lang(mr) {
  font-size: 14px;   /* ~87.5% of 16px baseline — narrows the visual gap */
}
body:lang(hi),
body:lang(mr) {
  line-height: 1.65;  /* more breathing room for the headline + diacritics */
}

/* ── CJK (Chinese, Japanese) ──
   CJK characters are more square and occupy more horizontal space.
   Noto Sans SC / Noto Sans JP provide proper CJK glyphs that pair
   well with Outfit. */
:root:lang(zh) {
  --font: 'Outfit', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-display: 'DM Serif Display', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', serif;
}
:root:lang(ja) {
  --font: 'Outfit', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
  --font-display: 'DM Serif Display', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', serif;
}
html:lang(zh),
html:lang(ja) {
  font-size: 14.5px;
}
body:lang(zh),
body:lang(ja) {
  line-height: 1.65;
  word-break: keep-all;  /* prevents mid-word breaks in CJK text */
  overflow-wrap: break-word;
}

/* ── BENGALI ──
   Similar to Devanagari — has a horizontal headline. Appears larger
   than Latin at the same font-size. */
:root:lang(bn) {
  --font: 'Outfit', 'Noto Sans Bengali', 'Nirmala UI', 'Bangla MN', system-ui, sans-serif;
  --font-display: 'DM Serif Display', 'Noto Sans Bengali', 'Nirmala UI', 'Bangla MN', serif;
}
html:lang(bn) {
  font-size: 14.2px;
}
body:lang(bn) {
  line-height: 1.65;
}

/* ── SOUTH INDIAN SCRIPTS (Telugu, Tamil, Kannada, Malayalam) ──
   These scripts have complex conjuncts and rounded forms that can
   make them appear visually larger. Nirmala UI / system-ui handle
   these well — Noto counterparts loaded on-demand. */
:root:lang(te) {
  --font: 'Outfit', 'Noto Sans Telugu', 'Nirmala UI', system-ui, sans-serif;
  --font-display: 'DM Serif Display', 'Noto Sans Telugu', 'Nirmala UI', serif;
}
:root:lang(ta) {
  --font: 'Outfit', 'Noto Sans Tamil', 'Nirmala UI', system-ui, sans-serif;
  --font-display: 'DM Serif Display', 'Noto Sans Tamil', 'Nirmala UI', serif;
}
:root:lang(kn) {
  --font: 'Outfit', 'Noto Sans Kannada', 'Nirmala UI', system-ui, sans-serif;
  --font-display: 'DM Serif Display', 'Noto Sans Kannada', 'Nirmala UI', serif;
}
:root:lang(ml) {
  --font: 'Outfit', 'Noto Sans Malayalam', 'Nirmala UI', system-ui, sans-serif;
  --font-display: 'DM Serif Display', 'Noto Sans Malayalam', 'Nirmala UI', serif;
}
html:lang(te),
html:lang(ta),
html:lang(kn),
html:lang(ml) {
  font-size: 14.5px;
}
body:lang(te),
body:lang(ta),
body:lang(kn),
body:lang(ml) {
  line-height: 1.65;
}

/* ── CYRILLIC (Russian) ──
   Cyrillic characters are slightly wider than Latin but similar in
   height. Minimal adjustment needed. */
html:lang(ru) {
  font-size: 15.5px;
}

/* ── Shared text-overflow safety for all non-Latin scripts ──
   Prevents text clipping / overflow when translated strings are
   longer than their English counterparts.                    */
[lang]:not([lang="en"]) .btn,
[lang]:not([lang="en"]) .btn-nav-primary,
[lang]:not([lang="en"]) .btn-nav-ghost,
[lang]:not([lang="en"]) .nav-links a,
[lang]:not([lang="en"]) .nav-credits,
[lang]:not([lang="en"]) .hero-title,
[lang]:not([lang="en"]) .hero-sub {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── Button text safety — prevent translated text from overflowing ── */
[lang]:not([lang="en"]) .btn {
  white-space: normal;        /* allow buttons to wrap their text */
  line-height: 1.3;
  padding-left: 16px;
  padding-right: 16px;
}
[lang]:not([lang="en"]) .btn-nav-primary,
[lang]:not([lang="en"]) .btn-nav-ghost {
  white-space: normal;
  line-height: 1.3;
  padding-left: 14px;
  padding-right: 14px;
}

/* ── Nav links — prevent overflow with longer translations ── */
[lang]:not([lang="en"]) .nav-links a {
  white-space: normal;
  line-height: 1.2;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* ── Section descriptions — accommodate expanded translated text ── */
[lang]:not([lang="en"]) .section-header p,
[lang]:not([lang="en"]) .page-header p {
  max-width: 620px;  /* wider than default 520px — translations are often longer */
}

/* ── Hero title — accommodate longer translated strings gracefully ── */
[lang]:not([lang="en"]) .hero-title {
  font-size: clamp(32px, 6vw, 56px);  /* slightly smaller max for non-English */
}

