* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* ===========================================
     BRAND COLORS
     =========================================== */
  --brand-primary: #667eea;
  --brand-secondary: #764ba2;
  --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);

  /* ===========================================
     TEXT COLORS
     =========================================== */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --text-on-brand: #ffffff;
  --text-on-light: rgba(255, 255, 255, 0.80);
  --text-on-light-muted: rgba(255, 255, 255, 0.65);

  /* ===========================================
     BACKGROUND COLORS
     =========================================== */
  --bg-white: #ffffff;
  --bg-light: #f2f3f5;
  --bg-muted: #f3f4f6;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;

  /* ===========================================
     BORDER COLORS
     =========================================== */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-focus: var(--brand-primary);

  /* ===========================================
     SEMANTIC COLORS
     =========================================== */
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;
  --color-info: #6366f1;
  --color-info-light: #eef2ff;
  --color-persona-label: var(--brand-primary);

  /* ===========================================
     BORDER RADIUS
     =========================================== */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 100px;

  /* ===========================================
     SHADOWS
     =========================================== */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
  --shadow-brand: 0 4px 12px rgba(102, 126, 234, 0.25);
  --shadow-brand-lg: 0 12px 28px rgba(102, 126, 234, 0.35);

  /* ===========================================
     SPACING (based on 4px grid)
     =========================================== */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ===========================================
     TRANSITIONS
     =========================================== */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-spring: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* ===========================================
     LAYOUT
     =========================================== */
  --header-height: 76px;
  --max-width-content: 980px;
  --max-width-wide: 1280px;

  /* ===========================================
     LEGACY (for backwards compatibility)
     =========================================== */
  --brandA: var(--brand-primary);
  --brandB: var(--brand-secondary);
  --ink: #101828;
  --muted: var(--text-on-light);
  --muted2: var(--text-on-light-muted);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 100vh;
  background: var(--brand-gradient);
  background-attachment: fixed;
}

.hidden { display: none !important; }

/* Mobile-only elements - hidden on desktop */
.dash-account.dash-account-mobile,
.dash-recent-inline,
.quick-practice-tray,
.quick-practice-backdrop,
.quick-practice-drawer,
.action-expand-btn {
  display: none !important;
}

/* ---------- Landing (full page) ---------- */
.landing {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.landing-bg {
  position: absolute;
  inset: -60px;
  background:
    radial-gradient(900px 520px at 18% 28%, rgba(255,255,255,0.22), transparent 62%),
    radial-gradient(760px 460px at 82% 60%, rgba(255,255,255,0.16), transparent 58%);
  pointer-events: none;
}

.landing-wrap {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  padding: 16px 18px 36px;
}


.landing-top {
  display: flex;
  align-items: center;
  justify-content: center;
}


.landing-top::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.06),
    rgba(0,0,0,0.06)
  );
  pointer-events: none;
}

.landing-top-inner {
  max-width: 1440px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 0 20px;
}

/* Landing brand - same visual style as dashboard app-brand-fixed */
.landing-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.landing-brand:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.landing-brand:hover .app-brand-tagline {
  color: var(--text-light);
  border-left-color: var(--border-light);
}

.landing-brand:active {
  transform: translateY(0);
}

.landing-brand .app-brand-wordmark {
  height: 24px;
  width: auto;
  object-fit: contain;
  filter: brightness(1..05);
}

.landing-brand .app-brand-tagline {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.landing-auth {
  display: flex;
  align-items: center;
  gap: 24px;
}

.landing-login-link {
  color: rgba(255,255,255,0.80);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-base);
  padding: 8px 4px;
}

.landing-login-link:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.landing-login-btn {
  padding: 12px 24px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 10px;
  color: rgba(255,255,255,0.95);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.landing-login-btn:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.30);
  transform: translateY(-1px);
}

.landing-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

/* Hero Row: side-by-side layout on desktop */
.landing-hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 60px;
  width: 100%;
  max-width: 1280px;
}

.landing-hero {
  text-align: left;
  color: white;
  flex: 1;
  max-width: 680px;
}

/* Desktop: pricing group spans full width, sits under hero+preview row */
.landing-upgrade-group {
  flex-basis: 100%;
  text-align: center;
  margin-top: -20px;
  order: 3; /* Ensure it stays at the bottom in flex layouts */
}

.landing-title {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  margin-top: 32px;
  color: rgba(255, 255, 255, 1);
}

/* Add spacing after first line */
.landing-title br {
  content: "";
  display: block;
  margin-bottom: 16px;
}

/* Second line: much more punch */
.landing-title span {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: -0.03em;
  display: inline-block;
  margin-top: 12px;
}

.landing-subtitle {
  max-width: 500px;
  margin: 0 0 28px;
  font-size: 1.15rem;
  color: #fff;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  opacity: .7;
}

.landing-steps{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.step-item{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.step-number{
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.20);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.step-text{
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.90);
}

.step-arrow{
  font-size: 1.2rem;
  color: rgba(255,255,255,0.60);
  font-weight: 300;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 32px 0 0;
}


.landing-free-badge{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  margin-top: 16px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.free-badge-icon{
  font-size: 1.1rem;
  color: #34d399;
  font-weight: bold;
}

.free-badge-text{
  color: rgba(255,255,255,0.95);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.landing-meta{
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  margin-top: 12px;
  text-align: center;
}

.subscribe-link{
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: opacity 0.2s;
}

.subscribe-link:hover{
  opacity: 0.85;
}

.landing-social-proof{
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.proof-users{
  color: rgba(255,255,255,0.88);
  font-weight: 600;
}

.proof-rating{
  color: rgba(255,255,255,0.90);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.proof-rating span{
  color: rgba(255,255,255,0.75);
  font-weight: 400;
}

.landing-btn{
  width: 600px;
  min-width: 260px;
  padding: 14px 22px;
  border-radius: 14px;
}

/* Landing CTA should not inherit form-button full width */
/* HERO CTA — intentionally breaks the glass system */

/* HERO CTA — stronger than normal primary */
button.landing-btn.primary-btn--hero{
  min-width: 340px;
  padding: 22px 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f2f4ff 100%);
  color: #4f46e5;
  box-shadow:
    0 20px 50px rgba(0,0,0,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cta-icon{
  font-size: 1.2rem;
  line-height: 1;
}

.landing-btn:has(.landing-btn-detail) {
  flex-direction: column;
  gap: 2px;
}

.landing-btn-detail {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.6;
}


@keyframes softPulse {
  0% { box-shadow: 0 18px 45px rgba(0,0,0,0.22); }
  50% { box-shadow: 0 24px 60px rgba(0,0,0,0.30); }
  100% { box-shadow: 0 18px 45px rgba(0,0,0,0.62); }
}

@keyframes breathe {
  0%, 100% {
    transform: translateY(0px) scale(1);
    box-shadow: 0 18px 45px rgba(0,0,0,0.22), inset 0 -1px 0 rgba(0,0,0,0.10);
  }
  50% {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 22px 55px rgba(0,0,0,0.26), inset 0 -1px 0 rgba(0,0,0,0.10);
  }
}

.primary-btn--hero:hover{
  transform: translateY(-3px);
  box-shadow: 0 26px 65px rgba(0,0,0,0.28);
  filter: brightness(1.05);
}

.primary-btn--hero:active{
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.24);
}

.landing .primary-btn{
  width: auto;
  min-width: 260px;
  padding: 14px 26px;
  border-radius: 14px;

  background: linear-gradient(135deg, #ffffff 0%, #f2f4ff 100%);
  color: #4f46e5; /* strong indigo */

  border: none;

  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.2px;

  box-shadow:
    0 10px 30px rgba(0,0,0,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.08);

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}


.landing .primary-btn:hover{
  background: rgba(255,255,255,0.9);
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(0,0,0,0.26);
}

/* Landing helper text (below CTA) */
.landing-helper {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 4px;
  text-align: center;
}

/* "Go to dashboard" secondary pill button on landing page */
.landing-new-convo-link {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 24px;
  margin-top: 12px;
  text-decoration: none;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s, border-color 0.15s;
}

.landing-new-convo-link:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.landing-new-convo-link:active {
  background: rgba(255, 255, 255, 0.3);
}

.landing-new-convo-link.hidden {
  display: none;
}

/* Secondary upgrade link - subtle text link, not a button */
.landing-upgrade-link {
  display: inline-block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  margin-top: 16px;
  padding: 0;
  background: none;
  border: none;
  transition: all var(--transition-base);
}

.landing-upgrade-link:hover {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

/* Desktop: show full text, hide short */
.upgrade-text-full { display: inline; }
.upgrade-text-short { display: none; }

.landing-upgrade-subtext {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-top: 8px;
}

/* ===========================================
   PRODUCT PREVIEW - High-fidelity to real UI
   =========================================== */
.landing-preview {
  width: 380px;
  flex-shrink: 0;
}

.preview-card {
  background: #fff;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.22);
}

/* Header bar - mimics real conversation controls */
.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.preview-lang-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: #eef2ff;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.preview-scenario-pill {
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  background: #f3f4f6;
  padding: 6px 12px;
  border-radius: 100px;
}

/* Partner bubble - matches real AI message bubble */
.preview-partner-bubble {
  margin: 16px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  border-radius: 16px;
  padding: 14px 18px;
  color: #fff;
  width: fit-content;
}

.preview-role-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 8px;
}

.preview-partner-text {
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 0;
  font-weight: 500;
}

/* Inline feedback - matches real feedback card */
.preview-inline-feedback {
  margin: 0 16px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #22c55e;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.preview-feedback-check {
  color: #22c55e;
  font-size: 0.9rem;
  font-weight: 700;
}

.preview-feedback-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #22c55e;
}

.preview-inline-feedback .preview-feedback-text {
  width: 100%;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.4;
  margin-top: 2px;
}

/* User message - right aligned bubble */
.preview-user-msg {
  margin: 0 16px 16px;
  text-align: right;
}

.preview-user-bubble {
  margin-left: auto;
  max-width: 80%;
  background: #f3f4f6;
  padding: 14px 18px;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  text-align: left;
  margin-left: auto;
  margin-bottom: 16px;
  margin-right: 16px;
}

.preview-user-bubble .preview-user-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
  margin-bottom: 8px;
}

.preview-user-bubble .preview-user-text {
  color: #1f2937;
  font-size: 1.05rem;
  line-height: 1.45;
  font-weight: 500;
  margin: 0;
  width: fit-content;
}

.preview-user-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9ca3af;
  margin-bottom: 6px;
  width: fit-content;
}

.preview-user-text {
  display: inline-block;
  background: #f3f4f6;
  color: #1f2937;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
  text-align: left;
}

/* Responsive: stack on tablet/mobile */
@media (max-width: 960px) {
  .landing-hero-row {
    flex-direction: column;
    gap: 40px;
    text-align: center;
  }

  .landing-hero {
    text-align: center;
    max-width: 600px;
    order: 1;
  }

  .landing-preview {
    width: 100%;
    max-width: 380px;
    order: 2;
  }

  .landing-upgrade-group {
    order: 3;
    margin-top: 0;
  }

  .landing-subtitle {
    margin: 0 auto 28px;
  }

  .landing-actions {
    align-items: center;
  }

  /* Tablet: pricing link styling */
  .landing-hero-row > .landing-upgrade-link {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  .landing-preview {
    max-width: 100%;
    padding: 0 12px;
  }

  .preview-card {
    border-radius: 16px;
  }

  .preview-partner-text {
    font-size: 0.95rem;
  }

  .landing-title {
    font-size: 2.2rem;
  }
}

/* ===========================================
   BENEFIT CARD HOVER STATES
   =========================================== */
.benefit-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.20);
}


.landing-benefits {
  width: 100%;
  max-width: 1100px;
  margin: 40px auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  text-align: left;
}

.benefit-card{
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  padding: 22px 20px 20px;
  color: white;
  box-shadow: 0 14px 44px rgba(0,0,0,0.14);
  backdrop-filter: blur(10px);
  cursor: default;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
  display: flex;
  flex-direction: column;
}

.benefit-card:nth-child(1) { animation-delay: 0.2s; }
.benefit-card:nth-child(2) { animation-delay: 0.4s; }
.benefit-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.benefit-icon{
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
  line-height: 1;
}

.benefit-card.primary {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 14px 44px rgba(0,0,0,0.14);
}

.benefit-card.emphasized {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  transform: scale(1.02);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.benefit-card.primary {
  animation: fadeInUpPrimary 0.6s ease forwards;
  animation-delay: 0.2s;
}

@keyframes fadeInUpPrimary {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.benefit-title {
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: 0.1px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.benefit-subline {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.4;
}

.benefit-desc {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.benefit-stat {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  font-weight: 600;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}


@media (max-width: 860px){
  .landing-benefits{ grid-template-columns: 1fr; }
}

/* ---------- App top header (hidden - branding moved inline) ---------- */
.app-top{
  display: none;
}

/* Fixed brand in top-left corner */
.app-brand-fixed {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.app-brand-fixed:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.app-brand-fixed:hover .app-brand-tagline {
  color: var(--text-light);
  border-left-color: var(--border-light);
}

.app-brand-fixed:active {
  transform: translateY(0);
}

.app-brand-wordmark {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.app-brand-tagline {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
  .app-brand-fixed {
    top: 8px;
    left: 8px;
    padding: 6px 10px;
  }

  .app-brand-tagline {
    display: none;
  }

  .app-brand-wordmark {
    height: 20px;
  }
}


header {
  background: var(--brand-gradient);
  color: white;
  padding: 16px;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

main {
  padding: 30px;
}

.hidden {
  display: none !important;
}



/* Hide landing when moving on */
.landing-section.hidden {
  display: none;
}


/* Setup Section */

/* App shell spacing on gradient background */
.app-main{
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 22px 40px;
}



/* White card inside the app shell */
.app-card{
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 46px rgba(0,0,0,0.22);

  /* ✅ new */
  max-width: var(--max-width-content);
  width: 100%;
  margin: 0 auto;
  padding: 34px;
}

/* Constrain card height only when conversation is active */
.app-card:has(.conversation-section:not(.hidden)) {
  max-height: 860px;
  overflow: hidden;
}


/* optional: on smaller screens reduce padding */
@media (max-width: 640px){
  .app-main{ padding: 18px; }
  .app-card{ padding: 18px; }
}

.setup-section{
  max-width: 920px;
  margin: 0 auto;
}


.setup-section h2 {
  margin-bottom: 0px;
  color: var(--brand-primary);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.quick-scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 0px;
  margin-top: 16px;
}

.scenario-form-container {
  margin-top: 32px;
}

.preset-btn {
  padding: 16px;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all var(--transition-spring);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
    height: 80px;
}

.preset-btn:hover {
  background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
  border-color: var(--brand-primary);
  transform: translateY(-3px);
  box-shadow:
    0 12px 24px rgba(102, 126, 234, 0.15),
    0 4px 8px rgba(102, 126, 234, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.preset-btn.selected {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border: 2px solid var(--brand-primary);
  box-shadow:
    0 4px 16px rgba(102, 126, 234, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.preset-btn-featured {
  position: relative;
  overflow: visible;
}

.preset-hint {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-spring);
  background: var(--bg-white);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.04),
    0 0 0 0 rgba(102, 126, 234, 0);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: #fafbff;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.04),
    0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Scenario textarea - single line look on desktop */
.form-group textarea#scenario {
  resize: none;
  overflow: hidden;
  min-height: 48px;
  height: 48px;
  line-height: 1.4;
}

/* Setup steps */
.setup-step { width: 100%; }
.subtitle-2 {
  margin-top: 16px;
  margin-bottom: 0px;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

/* Setup subhead */
.setup-subhead {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 4px 0 32px;
}

/* Scenario alternatives row */
.scenario-alternatives {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0px;
}

.alt-option {
  background: none;
  border: none;
  color: var(--brand-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  transition: all var(--transition-fast);
}

.alt-option:hover {
  opacity: 0.7;
}

.alt-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Generating animation for alt-option */
.alt-option.is-generating {
  opacity: 0.8;
}

.generating-dots::after {
  content: '';
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

.alt-divider-dot {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Generated scenario display */
.generated-scenario {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  text-align: center;
  margin-top: 16px;
}

.generated-scenario-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Custom scenario form */
#customScenarioForm {
  margin-bottom: 20px;
}

#customScenarioForm .form-group {
  margin-bottom: 0;
}

#customScenarioForm textarea {
  text-align: center;
}

/* Example chips for custom scenario */
.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.example-chip {
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.example-chip:hover {
  background: var(--bg-white);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* Scenario helper text */
.scenario-helper {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* Setup CTA group - contains button and reassurance */
.setup-cta-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Setup reassurance text */
.setup-reassurance {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Language cards */
.language-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 16px 0 36px;
}

@media (max-width: 860px) {
  .language-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .language-grid {
    grid-template-columns: 1fr;
  }
}

/* More languages toggle (inside language-grid) */
.more-languages-grid {
  display: contents;
}

.more-languages-grid.hidden {
  display: none !important;
}

.more-languages-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.more-languages-label::before,
.more-languages-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.more-languages-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px 16px;
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.04) 0%, rgba(118, 75, 162, 0.04) 100%);
  border: 1px dashed rgba(102, 126, 234, 0.2);
  border-radius: var(--radius-md);
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.more-languages-toggle:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border-color: rgba(102, 126, 234, 0.3);
}

.more-languages-toggle:active {
  transform: scale(0.98);
}

.more-languages-toggle .toggle-icon {
  transition: transform 0.2s ease;
}

.more-languages-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

.language-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 20px 28px 60px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
  background: var(--bg-white);
  cursor: pointer;
  transition: all 0.15s ease-out;
  text-align: left;
  min-height: 64px;
  overflow: visible;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
    height: 80px;
}

.language-card:hover {
  border-color: var(--brand-primary);
  background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
  transform: translateY(-2px);
  box-shadow:
    0 8px 20px rgba(102, 126, 234, 0.12),
    0 4px 8px rgba(102, 126, 234, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.language-card:active {
  transform: scale(0.97);
  background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
  border-color: var(--brand-primary);
  box-shadow:
    0 2px 4px rgba(102, 126, 234, 0.15),
    inset 0 1px 2px rgba(102, 126, 234, 0.1);
  transition: all 0.08s ease-out;
}

.language-card:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}

.language-card:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

.language-card.selected {
  border-color: var(--brand-primary);
  border-width: 2.5px;
  background: var(--brand-gradient);
  box-shadow:
    0 8px 20px rgba(102, 126, 234, 0.35),
    0 2px 8px rgba(118, 75, 162, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
}

.language-card.selected .lang-name {
  color: white;
  font-weight: 700;
}

.language-card.selected .lang-flag-icon {
  transform: scale(1.1);
  filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.language-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  animation: checkmarkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  backdrop-filter: blur(4px);
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.language-card.selected:hover {
  transform: scale(1.02) translateY(-2px);
  box-shadow:
    0 12px 28px rgba(102, 126, 234, 0.4),
    0 4px 12px rgba(118, 75, 162, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.lang-flag-icon {
  display: none;
}

/* Language code badge */
.language-card::before {
  content: attr(data-lang-code);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1.5px solid #dee2e6;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: all var(--transition-spring);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
}

.language-card:hover::before {
  transform: translateY(-50%) scale(1.1);
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-color: #c7d2fe;
  color: #6366f1;
  box-shadow:
    0 3px 10px rgba(99, 102, 241, 0.2),
    inset 0 -1px 0 rgba(99, 102, 241, 0.1);
}

.language-card.selected::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(254, 254, 255, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.6);
  color: #5b21b6;
  font-weight: 900;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.08);
}

.lang-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
  transition: all var(--transition-spring);
}

/* Footer controls */
.setup-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.setup-footer.active {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.selected-pill {
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--transition-base);
}

.selected-pill.has-selection {
  background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
  border-color: rgba(102,126,234,0.3);
  color: var(--brand-primary);
  font-weight: 600;
}

/* Step header (back button + title) */
.step-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.step-header h2 {
  flex: 1;
  margin-bottom: 0;
}

.step-badge {
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.08) 100%);
  border: 1.5px solid rgba(102,126,234,0.25);
  font-weight: 700;
  color: var(--brand-primary);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Make Continue button not full width in step 1 */
#continueBtn {
  width: auto;
  min-width: 180px;
}

/* Mobile tweaks */
@media (max-width: 520px) {
  #continueBtn { width: 100%; }
  .setup-footer { width: 100%; }
  .selected-pill { width: 100%; text-align: center; }
}

/* dropdown */
.language-dropdown {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
}

.dropdown-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-label::before {
  content: '📚';
  font-size: 1.1rem;
}

.language-select {
  width: 100%;
  padding: 16px 18px;
  padding-right: 40px;
  border-radius: var(--radius-md);
  border: 2px solid #e9ecef;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: all var(--transition-base);
  font-weight: 500;
  color: #343a40;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px;
}

.language-select:hover {
  border-color: var(--brand-primary);
  background-color: #f8f9ff;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.language-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(102,126,234,0.15);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.setup-footer { display: flex; gap: 10px; margin-top: 16px; }
.pill.hidden, .badge.hidden { display: none; }


/* Buttons */
.primary-btn,
.secondary-btn,
.danger-btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

/* ✅ Default buttons are auto width */
.primary-btn {
  background: var(--brand-gradient);
  color: white;
  width: auto;
  box-shadow:
    0 4px 12px rgba(102, 126, 234, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6841a0 100%);
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px rgba(102, 126, 234, 0.35),
    0 4px 10px rgba(118, 75, 162, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.primary-btn:active {
  transform: translateY(0px);
  box-shadow:
    0 6px 16px rgba(102, 126, 234, 0.25),
    0 2px 6px rgba(118, 75, 162, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.primary-btn:disabled {
  background: var(--border-light);
  color: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.primary-btn:disabled:hover {
  background: var(--border-light);
  transform: none;
  box-shadow: none;
}

/* ✅ Only use when you WANT full width */
.btn-block {
  width: 100%;
  display: block;
}

.secondary-btn {
  background: var(--bg-white);
  color: var(--text-muted);
  border: 2px solid var(--border-light);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.secondary-btn:hover {
  background: var(--bg-light);
  border-color: var(--border-medium);
  color: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.danger-btn {
  background: #dc3545;
  color: white;
}

.danger-btn:hover {
  background: #c82333;
}


/* Conversation Section - Side-by-side layout */
.conversation-section {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  /* Hug content, with hard max cap */
  max-height: 792px; /* 860px card - 68px padding */
}

/* Hide header when in conversation view for more space */
.conversation-section:not(.hidden) ~ * .app-top,
body:has(.conversation-section:not(.hidden)) .app-top {
  display: none;
}

.conversation-main {
  min-width: 0; /* Prevent grid blowout */
  align-self: stretch;
  max-height: 100%; /* Constrained by parent grid */

  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.conversation-main::-webkit-scrollbar {
  width: 8px;
}

.conversation-main::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-main::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 4px;
}

.conversation-main::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

#startSpeakingBtn {
  width: fit-content;
}

#startBtn {
  margin-top: 48px;
}

.controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
  overflow: visible;
}

/* Back Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--bg-light);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.back-btn .back-arrow {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.back-btn:hover .back-arrow {
  transform: translateX(-2px);
}

/* Icon-only back button variant */
.back-btn.back-btn-icon {
  padding: 10px;
  gap: 0;
}

.back-btn-text {
  line-height: 1;
}

/* Session Context Badge */
.session-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  min-width: 0;
  flex: 0 1 auto;
}

.context-lang {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.context-scenario {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4f46e5;
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  padding: 6px 10px 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

/* Attention animation when banner closes - draws eye to the pill */
.context-scenario.attention {
  animation: pillAttention 0.6s ease-out;
}

#userInput {
  padding: 0px;
  height: auto;
  align-items: center;
  width: 100%;
}

@keyframes pillAttention {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  30% {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

.context-scenario-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.session-context:hover .context-scenario {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}

/* Chevron indicating clickable - expands banner */
.context-scenario::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-left: 1.5px solid #6366f1;
  border-bottom: 1.5px solid #6366f1;
  transform: rotate(-45deg) translateY(-1px);
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.session-context:hover .context-scenario::after {
  transform: rotate(-45deg) translateY(1px);
}

.session-context {
  position: relative;
}

@media (max-width: 600px) {
  .controls {
    flex-wrap: wrap;
  }

  .session-context {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
    justify-content: center;
  }
}

/* Toggle Switch */
.toggle-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  transition: background 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.toggle-label:hover {
  background: var(--bg-muted);
}

.toggle-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-medium);
  border-radius: var(--radius-full);
  transition: all var(--transition-spring);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-spring);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--brand-gradient);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(19px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.toggle-label:hover .toggle-slider {
  background: #9ca3af;
}

.toggle-label:hover .toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

/* Desktop Conversation Audio Group - Hover to reveal speed below */
.conv-audio-group {
  position: relative;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 0;
  transition: background 0.2s ease;
  margin-left: auto;
}

.conv-audio-group .toggle-label {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: transparent;
}

.conv-audio-group .toggle-label:hover {
  background: transparent;
}

.conv-speak-icon {
  color: var(--brand-primary);
  flex-shrink: 0;
}

.conv-audio-group.speak-disabled .conv-speak-icon .sound-waves {
  opacity: 0.3;
}

/* Hide "Speak replies" text by default, show on hover */
.conv-audio-group .toggle-text {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.25s ease, opacity 0.2s ease;
}

.conv-audio-group:hover .toggle-text {
  max-width: 100px;
  opacity: 1;
}

.conv-audio-group:hover {
  background: #f1f5f9;
}

.conv-speed-row {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 0 0 12px 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-base);
  z-index: 10;
}

.conv-audio-group:hover .conv-speed-row {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.conv-audio-group:hover {
  border-radius: 12px 12px 0 0;
}

.conv-speed-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.conv-speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--brand-gradient);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
  transition: transform 0.15s ease;
}

.conv-speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.conv-speed-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--brand-gradient);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.conv-speed-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-primary);
  min-width: fit-content;
}

/* Don't show speed row when speak is off */
.conv-audio-group.speak-disabled:hover .conv-speed-row {
  opacity: 0;
  visibility: hidden;
}

.conv-audio-group.speak-disabled:hover {
  border-radius: var(--radius-md);
}

/* ==========================================================================
   SCENARIO BANNER - Desktop
   Info-card style, distinct from AI message bubble
   ========================================================================== */
.scenario-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  animation: fadeInUp 0.4s ease;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.15s ease;
  cursor: pointer;
}

.scenario-banner:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
}

.scenario-banner.hidden {
  display: none;
}

.scenario-banner.hiding {
  opacity: 0;
  transform: translateY(-10px);
}

.scenario-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px;
}

.scenario-banner-lang {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  opacity: 0.8;
}

.scenario-banner-close {
  background: rgba(99, 102, 241, 0.1);
  border: none;
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: none; /* Only show when manually opened */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  opacity: 0.8;
}

.scenario-banner-close svg {
  width: 16px;
  height: 16px;
}

.scenario-banner-close:hover {
  background: rgba(99, 102, 241, 0.2);
  opacity: 1;
}

.scenario-banner[data-manual-open="true"] .scenario-banner-close {
  display: flex;
}

.scenario-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0px;
  line-height: 1.3;
}

.scenario-banner-goals {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Loading shimmer for goals - desktop uses indigo tones */
.scenario-banner-goals.loading {
  position: relative;
  color: rgba(99, 102, 241, 0.3);
}

.scenario-banner-goals.loading::after {
  content: 'Adapting to you...';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 20%,
    rgba(99, 102, 241, 0.8) 50%,
    transparent 80%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: goalsShimmer 2s linear infinite;
}

@keyframes goalsShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Input area always visible (previously hidden during banner) */
/* Keeping these commented out in case we want to restore later:
.conversation-main.banner-active .input-area {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.conversation-main:not(.banner-active) .input-area {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s ease 0.2s;
}
.conversation-main.banner-active.input-revealed .input-area {
  opacity: 1;
  pointer-events: auto;
}
*/

/* Desktop session context - make it clickable to reopen banner */
.session-context {
  cursor: pointer;
  transition: all 0.2s ease;
}

.session-context:hover {
  background: var(--bg-subtle);
}

/* Hide scenario in header when banner is active */
.session-context.banner-active .context-scenario {
  display: none;
}

/* AI Message Bubble */
.ai-message-bubble {
  background: var(--brand-gradient);
  color: white;
  padding: 16px; /* More compact */
  border-radius: var(--radius-lg);
  margin-bottom: 12px; /* Reduced margin */
  box-shadow:
    0 4px 16px rgba(102, 126, 234, 0.2), /* Lighter shadow */
    0 2px 8px rgba(118, 75, 162, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: fadeInUp 0.4s ease;
  cursor: pointer; /* Indicate tappable for translation */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* AI Bubble Header - contains label and play button */
.ai-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ai-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
  font-weight: 700;
}

/* AI Play Button */
.ai-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-play-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.ai-play-btn:active {
  transform: scale(0.95);
}

.ai-play-btn.playing {
  background: rgba(255, 255, 255, 0.35);
}

.ai-play-btn.loading {
  pointer-events: none;
}

.ai-play-btn .play-icon,
.ai-play-btn .pause-icon,
.ai-play-btn .loading-icon {
  display: block;
}

.ai-play-btn .hidden {
  display: none;
}

/* Hide actions while typing indicator is showing */
.ai-message-bubble:has(.typing-indicator) .ai-bubble-actions {
  display: none;
}

/* AI Bubble Actions Container */
.ai-bubble-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* AI Translate Button */
.ai-translate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  opacity: 0.8;
}

.ai-translate-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
  opacity: 1;
}

.ai-translate-btn:active {
  transform: scale(0.95);
}

.ai-translate-btn.active {
  background: rgba(255, 255, 255, 0.35);
  opacity: 1;
}

.ai-translate-btn svg {
  width: 16px;
  height: 16px;
}

/* Tooltips for AI bubble action buttons */
.ai-translate-btn,
.ai-play-btn {
  position: relative;
}

.ai-translate-btn::after,
.ai-play-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--text-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.ai-translate-btn:hover::after,
.ai-play-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Hide tooltip on mobile (touch devices) */
@media (max-width: 768px) {
  .ai-translate-btn::after,
  .ai-play-btn::after {
    display: none;
  }
}

/* Translation display under AI text */
.ai-translation {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
  opacity: 0.9;
  font-style: italic;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 0.9; transform: translateY(0); }
}

/* Loading skeleton for partner label */
.label-skeleton {
  display: inline-block;
  width: 60px;
  height: 0.7rem;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.2) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 3px;
  vertical-align: middle;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ai-text {
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 600;
}

/* Feedback Card - Premium minimal design */
.feedback-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 10px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  animation: feedbackSlideIn 0.35s ease-out backwards;
  overflow: hidden;
}

@keyframes feedbackSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-section {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-left: 3px solid transparent;
  background: var(--bg-white);
  position: relative;
  transition: background 0.2s ease;
}

.feedback-section:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.feedback-section:last-child {
  margin-bottom: 0;
}

/* Positive feedback - green accent */
.feedback-positive {
  border-left-color: #22c55e;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.04) 0%, transparent 100%);
}

/* Correction/improvement - amber accent */
.feedback-improve {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.04) 0%, transparent 100%);
}

/* Explanation/why - slate accent */
.feedback-why {
  border-left-color: #64748b;
  background: linear-gradient(90deg, rgba(100, 116, 139, 0.04) 0%, transparent 100%);
}

/* Collapsible feedback sections */
.feedback-collapsible {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.feedback-collapsible:hover {
  background: rgba(0, 0, 0, 0.02);
}

.feedback-collapse-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  pointer-events: none;
}

.feedback-collapse-toggle .feedback-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-collapse-toggle .feedback-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.feedback-collapse-toggle .feedback-title {
  margin-bottom: 0;
}

.feedback-chevron {
  color: #94a3b8;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.feedback-collapsible.collapsed .feedback-chevron {
  transform: rotate(-90deg);
}

.feedback-collapse-content {
  width: 100%;
  /* Align text under the title, not the icon */
  /* Icon width (20px) + gap (10px) + left padding (16px) = 46px */
  padding: 0 16px 12px 46px;
}

.feedback-collapse-content .feedback-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: left;
}

.feedback-collapsible.collapsed .feedback-collapse-content {
  display: none;
}

/* Encouragement - purple accent */
.feedback-encourage {
  border-left-color: #8b5cf6;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.04) 0%, transparent 100%);
}

.feedback-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.feedback-content {
  flex: 1;
  min-width: 0;
}

.feedback-title {
  font-weight: 600;
  font-size: 0.7rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.feedback-positive .feedback-title {
  color: #16a34a;
}

.feedback-improve .feedback-title {
  color: #d97706;
}

.feedback-why .feedback-title {
  color: #64748b;
}

.feedback-encourage .feedback-title {
  color: #7c3aed;
}

.feedback-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  /* Constrain long text */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Correction arrow: de-emphasize the error, emphasize the fix */
.feedback-text .correction-from {
  font-size: 0.85em;
  opacity: 0.55;
}

/* Hints Panel */
.hints-panel {
  background: rgba(102, 126, 234, 0.06);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.hints-toggle {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.15s ease;
  gap: 2px;
}

.hints-toggle:hover {
  background: rgba(102, 126, 234, 0.04);
}

.hints-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hints-toggle-text {
  text-align: left;
}

.hints-toggle-arrow {
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.hints-panel.expanded .hints-toggle-arrow {
  transform: rotate(180deg);
}

.hints-toggle:hover .hints-toggle-arrow {
  color: var(--brand-primary);
}

.hints-reassurance {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: left;
  font-weight: 400;
  display: none;
  margin-top: 4px;
}

.hints-panel.expanded .hints-reassurance {
  display: block;
}

/* Faded state when user is typing */
.hints-panel.faded {
  opacity: 0.4;
}

.hints-content {
  padding: 0 16px 14px;
}

.hints-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hints-list li {
  padding: 12px 14px;
  background: var(--bg-white);
  border-radius: 10px;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.15s ease;
  cursor: pointer;
  font-weight: 600;
  border: 1.5px solid transparent;
}

.hints-list li:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
  border-color: rgba(102, 126, 234, 0.2);
  transform: translateY(-1px);
}

.hints-list li:active {
  transform: translateY(0);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
}

.hints-list li:hover .hint-text {
  color: var(--brand-primary);
}

/* Hint text and translation layout */
.hint-text {
  display: block;
  line-height: 1.4;
}

.hint-translation {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

/* Hints skeleton loading */
.hints-list li.hint-skeleton {
  cursor: default;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hints-list li.hint-skeleton:hover {
  box-shadow: none;
  transform: none;
  background: var(--bg-white);
  border-color: var(--border-light);
}

.hints-list .skeleton-text {
  background: linear-gradient(90deg, #eeeff1 25%, #f7f8f9 50%, #eeeff1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  opacity: 0.7;
}

/* Skeleton for target language text - matches .hint-text size */
.hints-list .skeleton-hint-text {
  height: 1rem;
  width: 75%;
  margin-bottom: 4px;
}

/* Skeleton for translation - matches .hint-translation size */
.hints-list .skeleton-hint-translation {
  height: 0.78rem;
  width: 55%;
}

/* Vary widths per item for natural look */
.hints-list li.hint-skeleton:nth-child(1) .skeleton-hint-text { width: 70%; }
.hints-list li.hint-skeleton:nth-child(1) .skeleton-hint-translation { width: 50%; }
.hints-list li.hint-skeleton:nth-child(2) .skeleton-hint-text { width: 85%; }
.hints-list li.hint-skeleton:nth-child(2) .skeleton-hint-translation { width: 60%; }
.hints-list li.hint-skeleton:nth-child(3) .skeleton-hint-text { width: 60%; }
.hints-list li.hint-skeleton:nth-child(3) .skeleton-hint-translation { width: 40%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Input Area */
.input-area {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-light);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* Make input sticky at bottom for better mobile UX */
  position: sticky;
  bottom: 16px;
  z-index: 10;
  /* Add stronger shadow when sticky to show it's floating */
  box-shadow:
    0 -4px 20px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 12px;

}

.input-wrapper:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.15);
}

.input-field-container {
  width: 100%;
}

.input-field {
  flex: 1;
  min-height: 24px;
  max-height: 150px;
  padding: 10px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  font-family: inherit;
  resize: none;
  border: none;
  background: transparent;
  overflow-y: hidden;
  outline: none;
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for Chrome/Safari */
.input-field::-webkit-scrollbar {
  display: none;
}

.input-field:focus {
  outline: none;
}

.input-field::placeholder {
  color: var(--text-light);
}

.mic-btn {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  font-size: 1.25rem;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* Mic button tooltip */
.mic-btn::after {
  content: 'Voice input';
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: #1f2937;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.mic-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Hide tooltip when listening */
.mic-btn.listening::after {
  display: none;
}

.mic-btn:hover {
  background: var(--brand-gradient);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mic-btn:hover .mic-icon {
  transform: scale(1.1);
}

.mic-btn.listening {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Mic disabled while AI audio is playing */
.mic-btn.audio-playing,
.mic-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6);
  }
}

.mic-icon {
  font-size: 1.3rem;
  transition: transform 0.2s ease;
}

/* Send button inside input-wrapper - hidden by default, shown when has content */
.input-wrapper #sendBtn {
  display: none;
  width: 40px;
  height: 40px;
  min-width: 40px;
  max-height: 40px;
  padding: 0;
  font-size: 0;
  border-radius: 50%;
  border: none;
  background: var(--brand-gradient);
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all var(--transition-base);
}

.input-wrapper #sendBtn::before {
  content: '';
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.input-wrapper #sendBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.input-wrapper #sendBtn:active {
  transform: scale(0.95);
}

/* Show send button when input has content */
.input-wrapper.has-content #sendBtn {
  display: flex;
}

/* Fade mic button when input has content */
.input-wrapper.has-content .mic-btn {
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

/* Keep mic at full opacity when actively listening */
.input-wrapper.has-content .mic-btn.listening {
  opacity: 1;
}

.input-wrapper .mic-btn {
  transition: opacity 0.2s ease;
}

/* Send button tooltip */
.input-wrapper #sendBtn {
  position: relative;
}

.input-wrapper #sendBtn::after {
  content: 'Send (Enter)';
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: #1f2937;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.input-wrapper #sendBtn:hover::after {
  opacity: 1;
  visibility: visible;
}

.input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-message {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.85rem;
  text-align: left;
  transition: all 0.3s ease;
}

.status-message:empty {
  display: none;
}

.status-message.listening {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1.5px solid #6ee7b7;
}

.status-message.error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border: 1.5px solid #f87171;
}

.status-message.processing {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border: 1.5px solid #60a5fa;
}

.status-message.hint {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: var(--text-muted);
  border: 1.5px solid #d1d5db;
  animation: fadeInHint 0.3s ease;
}

.status-message.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1.5px solid #fcd34d;
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes fadeInHint {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* History Sidebar */
.history {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
  /* Hug content at top, scroll when exceeds max */
  align-self: start;
  max-height: 792px;
  display: flex;
  flex-direction: column;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.history-header:hover {
  background: linear-gradient(180deg, #f8f9fb 0%, #f1f5f9 100%);
}

.history h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: -0.01em;
}

.history-toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.history-toggle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-toggle-arrow {
  font-size: 0.65rem;
  color: #64748b;
  transition: transform 0.25s ease;
  transform: rotate(180deg);
}

.history.collapsed .history-toggle-arrow {
  transform: rotate(0deg);
}

.history.collapsed .history-content {
  display: none;
}

.history-content {
  overflow-y: auto;
  padding: 14px;
  flex: 1;
  min-height: 0;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);

  /* Custom scrollbar for history */
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.history-content::-webkit-scrollbar {
  width: 6px;
}

.history-content::-webkit-scrollbar-track {
  background: transparent;
}

.history-content::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 3px;
}

.history-content::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

.empty-history {
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  padding: 24px;
}

.history-turn {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  animation: messageSlideIn 0.25s ease;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-turn:last-child {
  margin-bottom: 0;
}

/* Hide the avatar div - not needed in this design */
.history-turn-avatar {
  display: none;
}

/* Message bubble container */
.history-turn-content {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  width: auto;
}

.history-turn.assistant .history-turn-content {
  max-width: 90%;
}

/* User messages align right */
.history-turn.user {
  align-items: flex-end;
}

/* Assistant messages align left */
.history-turn.assistant {
  align-items: flex-start;
}

/* Speaker labels - important for immersion */
.history-turn strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 5px;
  margin-top: 4px;
  opacity: 0.8;
}



.history-turn.user strong {
  display: none;
}

/* But show strong tags in feedback text (for corrections like "museoz → museo") */
.history-turn.user .feedback-text strong {
  display: inline;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  opacity: 1;
  font-size: 14px;
}

.history-turn.user .feedback-text .correction-from {
  font-size: 0.85em;
  opacity: 0.55;
}

/* Message bubble */
.history-turn-message {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  position: relative;
  word-wrap: break-word;
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
}

/* User bubble - right aligned with tail on right */
.history-turn.user .history-turn-message {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #334155;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Assistant bubble - left aligned with tail on left - light purple (secondary to main AI response) */
.history-turn.assistant .history-turn-message {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(139, 92, 246, 0.12);
  box-shadow: 0 1px 3px rgba(139, 92, 246, 0.08);
}

/* Hover effects */
.history-turn:hover .history-turn-message {
  transform: scale(1.01);
}

.history-turn.user:hover .history-turn-message {
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.history-turn.assistant:hover .history-turn-message {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.12);
}

/* History user message with feedback - grouped container (matches mobile stack-feedback) */
.history-user-grouped {
  background: var(--bg-white);
  border-radius: 12px 12px 3px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.03);
  padding: 8px 12px;
}

/* Feedback sections inside grouped container */
.history-user-grouped .feedback-section {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.history-user-grouped .feedback-section:last-of-type {
  margin-bottom: 0;
}

/* Solid background colors with matching border */
.history-user-grouped .feedback-positive {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.history-user-grouped .feedback-improve {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.history-user-grouped .feedback-why {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

/* Collapsible in history */
.history-user-grouped .feedback-collapsible {
  padding: 0;
  display: block;
}

.history-user-grouped .feedback-collapse-toggle {
  padding: 10px 12px;
  gap: 8px;
}

.history-user-grouped .feedback-collapse-toggle .feedback-title {
  margin-bottom: 0;
}

.history-user-grouped .feedback-collapse-content {
  padding: 0 12px 10px 36px;
}

.history-user-grouped .feedback-collapse-content .feedback-text {
  font-size: 12px;
}

.history-user-grouped .feedback-encourage {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}

.history-user-grouped .feedback-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-user-grouped .feedback-title {
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-user-grouped .feedback-positive .feedback-title {
  color: #16a34a;
}

.history-user-grouped .feedback-improve .feedback-title {
  color: #d97706;
}

.history-user-grouped .feedback-why .feedback-title {
  color: #64748b;
}

.history-user-grouped .feedback-encourage .feedback-title {
  color: #7c3aed;
}

.history-user-grouped .feedback-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.45;
}

/* "You said" at bottom - right-aligned user bubble style */
.history-user-said {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.history-user-said-label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 4px;
  margin-top: 2px;
}

.history-user-said-text {
  font-size: 12px;
  color: #334155;
  padding: 6px 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px 10px 3px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  max-width: 85%;
}

/* Legacy class for backwards compatibility */
.history-feedback-item {
  margin-top: 0;
  margin-bottom: 6px;
}

.history-feedback-item:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 968px) {
  /* Stack conversation layout on tablets/mobile */
  .conversation-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .history {
    position: static;
    max-height: 400px;
  }

  /* More compact spacing on mobile */
  .conversation-main {
    max-height: calc(100vh - 40px);
  }

  .ai-message-bubble {
    padding: 14px;
    margin-bottom: 10px;
  }

  .ai-text {
    font-size: 1.1rem;
  }

  .ai-label {
    font-size: 0.65rem;
    margin-bottom: 6px;
  }

  .feedback-card {
    padding: 10px;
    margin-bottom: 10px;
  }

  .feedback-section {
    padding: 10px 12px;
    margin-bottom: 6px;
    gap: 10px;
  }

  .feedback-icon {
    font-size: 1rem;
    width: 20px;
    height: 20px;
  }

  .feedback-title {
    font-size: 0.75rem;
    margin-bottom: 3px;
  }

  .feedback-text {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .feedback-collapse-toggle {
    padding: 10px 12px;
  }

  .feedback-collapse-content {
    /* Mobile: Icon width (20px) + gap (10px) + left padding (12px) = 42px */
    padding: 0 12px 10px 42px;
  }

  .input-area {
    padding: 14px;
    bottom: 10px;
    margin-bottom: 0;
  }

  .input-field {
    min-height: 70px;
    font-size: 0.95rem;
  }

  .trial-badge {
    padding: 8px 12px;
    margin-bottom: 12px;
  }

  .trial-count {
    font-size: 0.85rem;
  }

  .trial-progress {
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .quick-scenarios {
    padding: 0px 16px !important;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-text {
    font-size: 1.15rem;
  }

  .feedback-card {
    padding: 18px;
  }

  .feedback-section {
    padding: 12px;
  }

  .input-area {
    padding: 16px;
  }

  .input-field {
    min-height: 70px;
  }

  .input-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .status-message {
    text-align: center;
  }

  .history {
    max-height: 300px;
  }
}

/* Trial Badge */
.trial-badge {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
  border: 1px solid rgba(102, 126, 234, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  animation: fadeInDown 0.4s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trial-count {
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.trial-message {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}

.trial-upgrade-link {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  transition: all 0.2s ease;
}

.trial-upgrade-link:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.18) 100%);
  text-decoration: none;
}

/* Inline upgrade link style (within text) */
.trial-message .trial-upgrade-link {
  padding: 0;
  background: none;
  text-decoration: underline;
  text-decoration-color: rgba(102, 126, 234, 0.4);
  text-underline-offset: 2px;
}

.trial-message .trial-upgrade-link:hover {
  background: none;
  text-decoration-color: var(--brand-primary);
}

.trial-progress {
  color: #059669;
  font-size: 0.7rem;
  font-weight: 500;
}

.trial-badge.trial-exhausted {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.12) 100%);
  border-color: rgba(239, 68, 68, 0.2);
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.trial-exhausted-text {
  color: #991b1b;
  font-weight: 700;
  font-size: 1rem;
}

/* Trial Modal */
.trial-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.trial-modal.show {
  opacity: 1;
  pointer-events: all;
}

.trial-modal-content {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.trial-modal-content h2 {
  color: var(--brand-primary);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.trial-modal-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

.trial-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#trialEmail {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.25s ease;
  background: var(--bg-white);
}

#trialEmail:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: #fafbff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#trialSubscribeBtn {
  width: 100%;
  padding: 16px 24px;
  background: var(--brand-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#trialSubscribeBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#trialCloseBtn {
  width: 100%;
  padding: 14px 24px;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

#trialCloseBtn:hover {
  background: var(--bg-light);
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .trial-modal-content {
    padding: 30px 24px;
  }

  .trial-modal-content h2 {
    font-size: 1.5rem;
  }
}

/* Progress Visual */
.trial-progress-visual {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 28px 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  border: 3px solid #e5e7eb;
  background: var(--bg-white);
  color: var(--text-light);
  transition: all 0.3s ease;
}

.progress-step.completed .step-circle {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.progress-step.pending .step-circle {
  background: var(--bg-light);
  border-color: var(--border-medium);
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-step.completed .step-label {
  color: #10b981;
}

/* Pricing Card */
.pricing-card {
  background: linear-gradient(135deg, #fafbff 0%, #f3f4f6 100%);
  border: 1.5px solid rgba(102, 126, 234, 0.2);
  border-radius: 14px;
  padding: 18px 16px;
  margin: 12px 0;
  box-shadow:
    0 4px 14px rgba(102, 126, 234, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  position: relative;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 14px 14px 0 0;
}

.price {
  font-size: 2.2rem;
  font-weight: 900;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.price-period {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pricing-features span {
  padding: 8px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  display: block;
  transition: all var(--transition-base);
  line-height: 1.3;
}

.pricing-features span:hover {
  border-color: rgba(102, 126, 234, 0.3);
  background: #fafbff;
}

/* Fine Print */
.modal-fine-print {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 16px;
  margin-bottom: 0;
}

/* Subscribe Modal */
.subscribe-modal-content {
  position: relative;
  text-align: center;
}

.subscribe-modal-content h2 {
  margin-bottom: 8px;
}

.subscribe-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 24px;
}

.subscribe-tagline {
  font-size: 0.875rem;
  color: #9ca3af;
  font-weight: 400;
  text-align: center;
  margin: 32px 0;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-secondary);
}

/* Returning Subscriber Notice Modal */
.returning-notice-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.returning-notice-modal.show {
  opacity: 1;
  pointer-events: all;
}

.returning-notice-content {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.returning-notice-modal.show .returning-notice-content {
  animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.returning-notice-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.returning-notice-close:hover {
  color: var(--text-secondary);
}

.returning-notice-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.returning-notice-body {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.returning-notice-helper {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.returning-notice-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.returning-notice-primary {
  width: 100%;
  padding: 16px 24px;
  background: var(--brand-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.returning-notice-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.returning-notice-secondary {
  width: 100%;
  padding: 14px 24px;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.returning-notice-secondary:hover {
  background: var(--bg-light);
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .returning-notice-content {
    padding: 32px 24px;
  }

  .returning-notice-title {
    font-size: 1.35rem;
  }
}

/* Payment Choice Modal (Android) */
.payment-choice-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.payment-choice-modal.show {
  opacity: 1;
  pointer-events: all;
}

.payment-choice-content {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.payment-choice-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.payment-choice-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-option-google {
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  color: var(--text-primary);
}

.payment-option-google:hover {
  border-color: #4285F4;
  background: rgba(66, 133, 244, 0.05);
}

.payment-option-card {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.payment-option-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.payment-option svg {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .payment-choice-content {
    padding: 32px 24px;
  }
}

/* Play Store Success Toast */
.play-store-success-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.35);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
}

.play-store-success-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.play-store-success-toast svg {
  flex-shrink: 0;
  color: white;
}

@media (max-width: 600px) {
  .play-store-success-toast {
    bottom: 80px;
    padding: 14px 20px;
    font-size: 0.9rem;
  }
}

/* Stripe Success Toast */
.stripe-success-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.35);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
}

.stripe-success-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.stripe-success-toast .toast-icon {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

@media (max-width: 600px) {
  .stripe-success-toast {
    bottom: 80px;
    padding: 14px 20px;
    font-size: 0.9rem;
  }
}

/* Stripe checkout loading overlay */
.checkout-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.checkout-loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.checkout-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: checkoutSpin 0.8s linear infinite;
}

@keyframes checkoutSpin {
  to { transform: rotate(360deg); }
}

.checkout-loading-text {
  margin-top: 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

/* Trial Complete Inline UI - Celebration Design */
.trial-complete-inline {
  background: white;
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow:
    0 8px 32px rgba(102, 126, 234, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.04);
  border: 2px solid var(--brand-primary);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.trial-complete-inline.celebration {
  animation: celebrationPulse 0.6s ease-out;
}

@keyframes celebrationPulse {
  0% { transform: scale(0.95); opacity: 0; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* Confetti */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) rotate(720deg);
    opacity: 0;
  }
}

/* Hero Accomplishment - Celebration */
.hero-accomplishment {
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.celebration-emoji {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: emojiPop 0.5s ease-out 0.2s both;
}

@keyframes emojiPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Scenario is the hero - what they actually DID */
.hero-scenario {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  animation: textReveal 0.5s ease-out 0.3s both;
}

/* Language is supporting context */
.hero-language {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  line-height: 1.2;
  animation: textReveal 0.5s ease-out 0.4s both;
  margin: 12px 0px 24px;
}

@keyframes textReveal {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Insight - Genuine, not salesy */
.hero-insight {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 24px 0;
  line-height: 1.5;
  font-weight: 500;
  animation: textReveal 0.5s ease-out 0.5s both;
}

.hero-insight em {
  color: #10b981;
  font-style: 1.4rem !important;
  font-weight: 900;
}

.hero-scenarios-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  opacity: 0.75;
}

/* Decision Section - Clear single CTA */
.decision-section {
  margin-bottom: 0px;
  animation: textReveal 0.5s ease-out 0.6s both;
}

.decision-section .primary-btn {
  font-size: 1rem;
  padding: 16px 24px;
  font-weight: 700;
}

.trial-note {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 10px 0 0 0;
  font-weight: 500;
}

.trial-wait-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 8px 0 0 0;
  font-weight: 400;
}

/* Secondary text button */
.text-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  transition: color 0.2s;
  animation: textReveal 0.5s ease-out 0.7s both;
}

.text-btn:hover {
  color: var(--brand-primary);
}

/* Subtle variant for exit/cooldown */
.text-btn-subtle {
  color: #9ca3af;
  margin-top: 8px;
}

.text-btn-subtle:hover {
  color: #6b7280;
}

/* Trial complete close button */
.trial-complete-close {
  display: none;
}

@media (max-width: 600px) {
  .trial-complete-inline {
    padding: 60px 28px 40px;
    /* Make full page on mobile */
    position: fixed;
    inset: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    background: linear-gradient(180deg, #7b8be8 0%, #a89cc9 20%, #d4cfe8 45%, #ffffff 70%);
  }

  .trial-complete-close {
    display: flex;
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    z-index: 101;
  }

  .trial-complete-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
  }

  .trial-complete-close:active {
    background: rgba(0, 0, 0, 0.1);
  }

  .trial-complete-inline .celebration-emoji {
    font-size: 2.5rem;
    margin-bottom: 20px;
  }

  .trial-complete-inline .hero-accomplishment {
    align-items: flex-start;
    margin-bottom: 24px;
  }

  .trial-complete-inline .hero-insight {
    text-align: left;
    margin-bottom: 32px;
  }

  .trial-complete-inline .decision-section {
    width: 100%;
    margin-bottom: 24px;
  }

  .trial-complete-inline .primary-btn {
    width: 100%;
  }

  .trial-complete-inline .trial-note {
    text-align: left;
  }

  .hero-number {
    font-size: 3.2rem;
  }

  .hero-label {
    font-size: 1rem;
  }

  .trial-complete-header h3 {
    font-size: 1.15rem;
  }

  .trial-subtitle {
    font-size: 0.75rem;
  }

  .accomplishment-icon {
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
  }

  .accomplishment-text {
    font-size: 0.75rem;
  }

  .cooldown-message {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding: 8px 10px;
  }

  .cooldown-icon {
    font-size: 1.25rem;
  }

  .cooldown-title {
    font-size: 0.75rem;
  }

  .cooldown-subtitle {
    font-size: 0.7rem;
  }

  .value-description {
    font-size: 0.75rem;
  }

  .price {
    font-size: 1.8rem;
  }

  .pricing-features span {
    font-size: 0.75rem;
    padding: 7px 9px;
  }
}

@media (max-width: 600px) {
  .trial-progress-visual {
    gap: 12px;
  }

  .step-circle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .step-label {
    font-size: 0.75rem;
  }

  .price {
    font-size: 2rem;
  }
}

/* Browser Translation Warning Banner */
.translation-warning-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  animation: fadeInDown 0.4s ease;
}

.translation-warning-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.warning-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.warning-text {
  flex: 1;
  color: #92400e;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  min-width: 250px;
}

.warning-text strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.warning-instructions {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
}

.warning-dismiss-btn {
  padding: 8px 16px;
  background: var(--bg-white);
  border: 2px solid #f59e0b;
  border-radius: var(--radius-sm);
  color: #92400e;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.warning-dismiss-btn:hover {
  background: #fef3c7;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.warning-dismiss-btn:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .translation-warning-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .warning-text {
    min-width: auto;
    text-align: center;
  }

  .warning-dismiss-btn {
    width: 100%;
  }
}

/* ============================================
   AUTH MODAL STYLES
   ============================================ */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.auth-modal.show {
  opacity: 1;
  pointer-events: all;
}

.auth-modal-content {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

/* Auth loading overlay */
.auth-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-white);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

.auth-loading-overlay.hidden {
  display: none;
}

.auth-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: statusSpin 0.8s linear infinite;
}

.auth-loading-overlay p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Google Sign In Button */
.google-signin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.google-signin-btn:hover {
  background: var(--bg-light);
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.google-signin-btn svg {
  flex-shrink: 0;
}

/* Auth Main Options (ChatGPT-style) */
.auth-main-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Auth method toggle button (Continue with email/phone) - matches Google button */
.auth-method-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-method-btn:hover {
  background: var(--bg-light);
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-method-icon {
  flex-shrink: 0;
}

/* Phone input fields container */
#phoneInputFields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Email input field (inline style matching phone) */
.auth-input-field {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-white);
  transition: border-color 0.2s ease;
}

.auth-input-field:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.auth-input-field::placeholder {
  color: var(--text-muted);
}

/* Country code selector - standalone bordered field */
.country-code-select {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-white);
  cursor: pointer;
  transition: border-color 0.2s ease;
  color: var(--text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.country-code-select:focus {
  outline: none;
  border-color: var(--brand-primary);
}

/* Phone number input - standalone bordered field */
.phone-number-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-white);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.phone-number-input:focus-within {
  border-color: var(--brand-primary);
}

.phone-prefix {
  padding: 14px 0 14px 12px;
  font-size: 0.95rem;
  color: var(--text-muted);
  background: var(--bg-white);
  white-space: nowrap;
}

.phone-number-input input {
  flex: 1;
  padding: 14px 12px 14px 4px;
  border: none;
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
  margin-left: 4px;
}

.phone-number-input input:focus {
  outline: none;
}

.phone-number-input input::placeholder {
  color: var(--text-muted);
}

/* Verification Step */
.verification-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.verification-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

.verification-input {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 1.1rem;
  font-family: inherit;
  letter-spacing: 0.2em;
  text-align: center;
  transition: border-color 0.2s ease;
}

.verification-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.verification-input::placeholder {
  letter-spacing: normal;
  color: var(--text-muted);
}

/* Name Step (after phone verification) */
.name-step {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hide main auth header when name step is visible */
.auth-modal-content:has(.name-step:not(.hidden)) > .auth-header {
  display: none;
}

.name-step-header {
  text-align: center;
  margin-bottom: 8px;
}

.name-step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.name-step-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.name-field-wrapper {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--bg-white);
  transition: border-color 0.2s ease;
}

.name-field-wrapper:focus-within {
  border-color: var(--primary);
}

.name-field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.name-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
  background: transparent;
  padding: 0;
}

.name-input::placeholder {
  color: var(--text-muted);
}

.skip-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px;
  text-align: center;
  transition: color 0.2s ease;
}

.skip-link:hover {
  color: var(--text-secondary);
}

/* Password Step (ChatGPT-style) */
.password-step {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hide main auth header when password step is visible */
.auth-modal-content:has(.password-step:not(.hidden)) > .auth-header {
  display: none;
}

.password-step-header {
  text-align: center;
  margin-bottom: 8px;
}

.password-step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.password-step-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Credential display (email/phone with Edit link) */
.credential-display {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg-white);
}


#emailInputFields {
  height: 54px;
}

#authEmailInline {
  height: 100%;
  padding: 14px 12px;
}

.credential-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.credential-value-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.credential-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.edit-link {
  background: none;
  border: none;
  color: var(--brand-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.edit-link:hover {
  opacity: 0.8;
}

/* Password field wrapper */
.password-field-wrapper {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg-white);
  transition: border-color 0.2s ease;
}

.password-field-wrapper:focus-within {
  border-color: var(--brand-primary);
}

.password-field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.password-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-input-box input {
  flex: 1;
  border: none;
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
  padding: 0;
}

.password-input-box input:focus {
  outline: none;
}

.password-input-box .password-toggle-btn {
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-input-box .password-toggle-btn:hover {
  color: var(--text-secondary);
}

/* Password step footer */
.password-step-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.password-step-footer a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.password-step-footer a:hover {
  color: var(--brand-primary);
}

.password-step-footer .footer-divider {
  color: var(--border-light);
  font-size: 0.85rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-primary);
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
  align-self: flex-start;
}

.back-link:hover {
  opacity: 0.7;
}

.phone-auth-error {
  margin-top: 12px;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 0.9rem;
}

#recaptcha-container {
  margin-top: 12px;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-divider span {
  padding: 0 16px;
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-form-group input {
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Password input with toggle */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle-btn {
  position: absolute;
  right: 52px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all var(--transition-base);
}

.password-toggle-btn:hover {
  color: var(--brand-primary);
  background: rgba(102, 126, 234, 0.08);
}

.password-toggle-btn .eye-icon {
  display: block;
}

.password-toggle-btn .eye-icon.hidden {
  display: none;
}

.auth-error {
  padding: 12px 16px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-toggle .text-btn {
  color: var(--brand-primary);
  font-weight: 600;
  padding: 4px 8px;
}

.auth-toggle .text-btn:hover {
  color: #5568d3;
}

/* ============================================
   USER MENU STYLES
   ============================================ */
.user-menu {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  animation: fadeInDown 0.3s ease;
}

.user-menu-content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 260px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-light);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-email {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-status.subscribed {
  color: #10b981;
  font-weight: 600;
}

.user-menu-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0;
}

.user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
}

.user-menu-item:hover {
  background: var(--bg-muted);
  color: var(--text-secondary);
}

/* Update landing login button when logged in */
.landing-login-btn.logged-in {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
}

.landing-login-btn.logged-in:hover {
  background: rgba(16, 185, 129, 0.3);
}

.landing-login-btn .user-avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: white;
}

/* Logged in status indicator */
.logged-in-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  color: #10b981;
  font-weight: 600;
}

.logged-in-indicator.show {
  display: flex;
}

.logged-in-indicator .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (max-width: 600px) {
  .auth-modal-content {
    padding: 30px 24px;
  }

  .user-menu {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: 20px;
  }

  .user-menu-content {
    width: 100%;
  }
}

/* ============================================
   TYPING INDICATOR & LOADING STATES
   ============================================ */

/* Typing indicator animation */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Disabled input states - whole wrapper */
.input-wrapper:has(.input-disabled) {
  background: var(--bg-muted);
  border-color: var(--border-light);
  box-shadow: none;
  opacity: 0.7;
  pointer-events: none;
}

.input-wrapper:has(.input-disabled) .input-field {
  color: var(--text-light);
  cursor: not-allowed;
}

.input-wrapper:has(.input-disabled) .input-field::placeholder {
  color: var(--text-light);
  font-style: italic;
}

.input-wrapper:has(.input-disabled) .mic-btn {
  background: var(--border-light);
  opacity: 0.5;
  pointer-events: none;
}

.input-wrapper:has(.input-disabled) #sendBtn {
  background: var(--border-light);
  box-shadow: none;
  opacity: 0.5;
  pointer-events: none;
}

.input-wrapper:has(.input-disabled) #sendBtn::before {
  opacity: 0.3;
}

.primary-btn.btn-disabled,
.mic-btn.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Processing status with spinner */
.status-message.processing::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: statusSpin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes statusSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Input character limit hint */
.input-hint {
  display: inline-block;
  font-size: 0.75rem;
  color: #92400e;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 6px 12px;
  margin-top: -4px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #fcd34d;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.input-hint:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

.input-hint.limit-exceeded {
  color: #991b1b;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #f87171;
}

/* Voice Judgment UI */
.voice-judgment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.85rem;
  font-weight: 500;
  animation: vjFadeIn 0.3s ease;
  flex-wrap: wrap;
}

.voice-judgment.hidden {
  display: none;
}

.voice-judgment.recovery {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #6b7280;
  border: 1.5px solid #d1d5db;
}

.voice-judgment.support {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #166534;
  border: 1.5px solid #86efac;
}

.vj-text {
  flex-shrink: 0;
}

.vj-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.vj-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: var(--bg-white, #fff);
  color: var(--text-primary, #1f2937);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.vj-btn:hover {
  border-color: var(--brand-primary, #667eea);
  color: var(--brand-primary, #667eea);
  background: #f0f4ff;
}

.vj-btn:active {
  transform: scale(0.97);
}

.vj-btn:focus-visible {
  outline: 2px solid var(--brand-primary, #667eea);
  outline-offset: 2px;
}

.vj-btn-icon {
  font-size: 0.85rem;
}

@keyframes vjFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   MOBILE-ONLY ELEMENTS (Hidden on Desktop)
   ============================================ */

/* Hide mobile-specific elements on desktop */
.mobile-history-trigger,
.history-backdrop,
.history-close-btn,
.mobile-gesture-hint,
.mobile-turn-indicator,
.feedback-header,
.feedback-user-said,
.mobile-message-stack,
.user-message-display,
.mobile-only,
.mobile-overflow-btn,
.mobile-overflow-menu {
  display: none;
}

/* Show desktop-only elements */
.desktop-only {
  display: block;
}

/* On desktop, feedback body is always visible (no collapse) */
.feedback-body {
  max-height: none;
}

/* These elements are shown via mobile.css @media queries */

/* ===============================================
   LEGAL FOOTER & COOKIE CONSENT
   =============================================== */

/* Landing Footer */
.landing-footer {
  margin-top: auto;
  padding: 24px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.80);
  font-size: 13px;
}

.footer-links {
  margin-bottom: 8px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-divider {
  margin: 0 10px;
  opacity: 0.6;
}

.footer-copyright {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.70);
}

/* Cookie Consent Banner - softened to match calm aesthetic */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(30, 30, 50, 0.92);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 20px;
  z-index: 10000;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
  animation: slideUpDelayed 0.4s ease-out 1s both;
}

@keyframes slideUpDelayed {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-consent-content {
  max-width: var(--max-width-content);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cookie-consent-text {
  flex: 1;
}

.cookie-consent-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

.cookie-consent-text a {
  color: var(--brand-primary);
  text-decoration: underline;
}

.cookie-consent-text a:hover {
  color: #8fa4f0;
}

.cookie-consent-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.cookie-btn-settings {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.cookie-btn-settings:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.cookie-btn-accept {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.cookie-btn-accept:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Cookie Settings Modal */
.cookie-settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
}

.cookie-settings-content {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cookie-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.cookie-settings-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1a1a2e;
}

.cookie-settings-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #888;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.cookie-settings-close:hover {
  color: #333;
}

.cookie-settings-body {
  padding: 20px 24px;
}

.cookie-setting-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.cookie-setting-item:last-child {
  border-bottom: none;
}

.cookie-setting-info {
  flex: 1;
  padding-right: 16px;
}

.cookie-setting-title {
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.cookie-setting-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

.cookie-setting-toggle {
  position: relative;
  flex-shrink: 0;
}

.cookie-setting-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-toggle-slider {
  display: block;
  width: 48px;
  height: 26px;
  background: #ccc;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.cookie-toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-setting-toggle input:checked + .cookie-toggle-slider {
  background: #667eea;
}

.cookie-setting-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(22px);
}

.cookie-toggle-slider.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-settings-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
}

.cookie-btn-save {
  width: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.cookie-btn-save:hover {
  filter: brightness(1.1);
}

/* Auth Consent Checkbox */
.auth-consent {
  margin: 16px 0;
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}

.consent-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.consent-text {
  color: #555;
}

.consent-text a {
  color: var(--brand-primary);
  text-decoration: underline;
}

.consent-text a:hover {
  color: #4a5ed4;
}

/* Responsive Cookie Banner */
@media (max-width: 600px) {
  .cookie-consent-content {
    flex-direction: column;
    text-align: center;
  }

  .cookie-consent-actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
  }
}