/* ─────────────────────────────────────────────────────────────────────
   BolBadlo · Editorial Saffron design system
   Implemented from claude.ai/design handoff (chat1.md)
   Cream paper · marigold saffron · warm ink · serif display + Hindi accent
   ───────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Surfaces (warm cream, old-paper feel) */
  --cream:    #FBF5E9;
  --cream-2:  #F4EBD9;
  --cream-3:  #EADFC6;
  --paper:    #FFFDF7;

  /* Ink (warm near-black, not slate) */
  --ink:      #1A1410;
  --ink-2:    #4A3F35;
  --ink-3:    #7A6E5E;
  --muted:    #A89A85;

  /* Brand colors */
  --marigold:        #E86A22;
  --marigold-dark:   #C8551A;
  --marigold-soft:   #FBE4D3;
  --haldi:           #D4A026;
  --haldi-soft:      #F7E9BE;
  --leaf:            #2E7D5B;
  --leaf-soft:       #D4E8DC;
  --rose:            #B8443E;
  --rose-soft:       #F4D9D6;

  /* Hairlines */
  --hair:   rgba(26, 20, 16, 0.08);
  --hair-2: rgba(26, 20, 16, 0.14);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(26, 20, 16, 0.05);
  --shadow-sm: 0 1px 2px rgba(26, 20, 16, 0.04), 0 1px 3px rgba(26, 20, 16, 0.06);
  --shadow:    0 8px 20px -4px rgba(232, 106, 34, 0.45), inset 0 -2px 0 rgba(0,0,0,0.15);
  --shadow-lg: 0 14px 30px -8px rgba(232, 106, 34, 0.50), inset 0 -3px 0 rgba(0,0,0,0.12);
  --shadow-ink: 0 8px 20px -4px rgba(26, 20, 16, 0.35), inset 0 -2px 0 rgba(0,0,0,0.18);

  /* Radii */
  --r-sm:  10px;
  --r:     14px;
  --r-lg:  18px;
  --r-xl:  22px;

  /* Type */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'Geist', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hindi:   var(--font-body); /* legacy alias; Hindi faces dropped in English rebrand */

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;

  /* Legacy aliases — keep existing markup working */
  --primary: var(--marigold);
  --primary-dark: var(--marigold-dark);
  --primary-light: var(--marigold-soft);
  --accent: var(--haldi);
  --accent-light: var(--haldi-soft);
  --green: var(--leaf);
  --green-light: var(--leaf-soft);
  --orange: var(--haldi);
  --orange-light: var(--haldi-soft);
  --bg: var(--cream);
  --white: var(--paper);
  --text: var(--ink);
  --text-mid: var(--ink-2);
  --text-light: var(--ink-3);
  --border: var(--hair-2);
  --bubble-bot: var(--paper);
  --bubble-user: var(--ink);
  --danger: var(--rose);
  --radius: var(--r);
  --radius-lg: var(--r-xl);
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button, input { font-family: inherit; }

/* Display + hindi helper classes */
.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hindi {
  font-family: var(--font-hindi);
  color: var(--ink-3);
  font-weight: 400;
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--marigold);
}

/* SVG icons inherit currentColor */
.ic {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ═══════════════ SCREENS ═══════════════ */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  /* Let each screen scroll its own content. Otherwise long screens
     (like the catalogue with 80 lessons) get clipped at the viewport. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; }

/* Safe top padding so the headline isn't pinned to the status bar. */
#otp-screen, #login-screen {
  padding-top: max(24px, env(safe-area-inset-top, 24px));
}

/* ═══════════════ BUTTONS ═══════════════ */
.btn-primary {
  width: 100%;
  padding: 17px 20px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 180ms ease, transform 160ms ease, box-shadow 200ms ease, opacity 180ms ease;
  box-shadow: var(--shadow-ink);
}
.btn-primary:hover { background: #2A2017; }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled {
  background: var(--cream-3);
  color: var(--ink-3);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-marigold {
  background: var(--marigold);
  color: var(--paper);
  box-shadow: var(--shadow);
}
.btn-marigold:hover { background: var(--marigold-dark); }

/* One secondary button look (trial + chat). Pill, hairline, inverts on hover. */
.btn-secondary,
.chat-action-btn,
.trial-retry {
  appearance: none;
  padding: 9px 16px;
  border: 1.5px solid var(--hair-2);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 140ms ease;
}
.btn-secondary:hover,
.chat-action-btn:hover,
.trial-retry:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.btn-secondary:active,
.chat-action-btn:active,
.trial-retry:active { transform: scale(0.96); }

.icon-btn {
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.icon-btn:hover { background: var(--cream-2); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }

/* ═══════════════ LOGIN / WELCOME ═══════════════ */
#login-screen {
  background: var(--cream);
  flex-direction: column;
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
}

#login-screen::before {
  content: '';
  position: absolute;
  top: -90px; right: -100px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 106, 34, 0.22) 0%, transparent 65%);
  pointer-events: none;
}
#login-screen::after {
  content: '';
  position: absolute;
  bottom: -110px; left: -90px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 160, 38, 0.18) 0%, transparent 65%);
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 412px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  text-align: left;
}

/* Brand row at top */
.login-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* "bol·badlo" wordmark */
.wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
}
.wordmark .dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--marigold);
  margin: 0 2px;
  transform: translateY(-2px);
}

/* Hero block */
.login-hero { margin-top: 72px; }
.login-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--marigold);
  margin-bottom: 14px;
}
.login-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 48px;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.login-title .accent { color: var(--marigold); }

.login-hindi {
  font-family: var(--font-hindi);
  font-size: 32px;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-top: 6px;
}

.login-desc {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 340px;
  font-weight: 400;
}

/* keep legacy classes alive but hide social proof block (replaced by hero copy) */
.login-subtitle, .login-social-proof { display: none; }
.login-logo {
  /* legacy emoji logo — hidden; new wordmark used instead */
  display: none;
}

/* Phone entry */
.login-form {
  margin-top: auto;
  padding-top: 24px;
}
.input-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.phone-input-wrap {
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1.5px solid var(--hair-2);
  border-radius: 14px;
  height: 56px;
  padding: 0 4px 0 16px;
  margin-bottom: 14px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.phone-input-wrap:focus-within {
  border-color: var(--marigold);
  box-shadow: 0 0 0 4px rgba(232, 106, 34, 0.12);
}
.phone-prefix {
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  padding-right: 12px;
  border-right: 1.5px solid var(--hair-2);
  background: transparent;
}
#phone-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 14px;
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.04em;
  background: transparent;
}
#phone-input::placeholder { color: var(--ink-3); font-weight: 400; letter-spacing: 0; }

.login-footer {
  margin-top: 18px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.login-footer strong { color: var(--leaf); font-weight: 600; }

/* ═══════════════ ONBOARDING ═══════════════ */

.onboard-container {
  width: 100%;
  max-width: 412px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

/* Top: back + step indicator */
.onboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.back-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--hair-2);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
}
.back-btn:hover { background: var(--paper); }
.step-dots {
  display: flex;
  gap: 5px;
}
.step-dots .dot {
  width: 28px; height: 4px;
  border-radius: 2px;
  background: var(--hair-2);
}
.step-dots .dot.active { background: var(--marigold); }
.step-count {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}

/* Onboard hero */
.onboard-emoji { display: none; }
.onboard-container h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 4px;
}
.onboard-hindi {
  font-family: var(--font-hindi);
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.onboard-sub {
  font-size: 14px;
  color: var(--ink-3);
  margin-bottom: 22px;
}
.onboard-container h3 {
  font-size: 11px;
  color: var(--ink);
  margin: 22px 0 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.text-input {
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--hair-2);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.text-input::placeholder { color: var(--ink-3); font-weight: 400; }
.text-input:focus {
  border-color: var(--marigold);
  box-shadow: 0 0 0 4px rgba(232, 106, 34, 0.12);
}

/* Level / reason cards */
.level-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.level-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--hair);
  border-radius: 14px;
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 200ms ease, transform 140ms ease;
}
.level-btn:hover { border-color: var(--marigold-soft); }
.level-btn:active { transform: scale(0.985); }
.level-btn.selected {
  border-color: var(--marigold);
  background: var(--marigold-soft);
  box-shadow: 0 0 0 4px rgba(232, 106, 34, 0.12);
}
.level-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--cream-2);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: background 200ms ease, color 200ms ease;
}
.level-btn.selected .level-icon {
  background: var(--marigold);
  color: var(--paper);
}
.level-info { display: flex; flex-direction: column; gap: 2px; }
.level-label {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.level-desc {
  font-family: var(--font-hindi);
  font-size: 13px;
  color: var(--ink-3);
}

/* ═══════════════ CHAT SCREEN ═══════════════ */
#chat-screen {
  flex-direction: column;
  background: var(--cream);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
  flex-shrink: 0;
  z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 19px;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.header-status {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.header-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--marigold);
}
.header-right { display: flex; gap: 2px; }

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 14px;
  scroll-behavior: smooth;
  background: var(--cream);
  scrollbar-width: thin;
  scrollbar-color: var(--hair-2) transparent;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--hair-2); border-radius: 999px; }

.message {
  max-width: 80%;
  margin-bottom: 12px;
  animation: bubbleIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.message.bot  { margin-right: auto; }
.message.user { margin-left: auto; }

.bubble {
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  letter-spacing: -0.003em;
  white-space: pre-wrap;
  word-wrap: break-word;
}
/* Aanya (left): paper bubble, squared bottom-left corner. */
.bot .bubble {
  background: var(--paper);
  border: 1px solid var(--hair);
  color: var(--ink);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 1px 2px rgba(26, 20, 16, 0.06);
}
/* User (right): warm marigold tint, ink text (AA contrast), squared bottom-right corner. */
.user .bubble {
  background: var(--marigold-soft);
  border: 1px solid rgba(232, 106, 34, 0.16);
  color: var(--ink);
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 1px 2px rgba(232, 106, 34, 0.10);
}

.bubble-time {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 4px;
  text-align: right;
  letter-spacing: 0.02em;
}
.message.bot .bubble-time { text-align: left; }

/* ── Voice-note bubble (replayable user audio) ── */
.bubble.voice-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-width: 200px;
}
.vn-play {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--marigold);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  transition: transform 140ms ease, background 160ms ease;
}
.vn-play:hover { background: var(--marigold-dark); }
.vn-play:active { transform: scale(0.94); }
.vn-icon-pause { display: none; }
.voice-note.is-playing .vn-icon-play { display: none; }
.voice-note.is-playing .vn-icon-pause { display: inline; }

.vn-wave {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  min-width: 0;
}
.vn-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 999px;
  background: rgba(232, 106, 34, 0.45);
}
.voice-note.is-playing .vn-bar { background: var(--marigold); }

.vn-duration {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.vn-transcript {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  font-style: italic;
}

/* Lesson card (bot message embed) */
.lesson-card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.lesson-card h3 {
  font-size: 10px;
  font-weight: 700;
  color: var(--marigold);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.lesson-card .content {
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--ink-2);
}

/* Lesson meta: module / level / activity pills */
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--hair-2);
  background: var(--cream-2);
  color: var(--ink-2);
}
.pill.module   { background: var(--marigold-soft); color: var(--marigold-dark); border-color: transparent; }
.pill.level    { background: var(--haldi-soft);    color: #8a6614;            border-color: transparent; }
.pill.activity { background: var(--leaf-soft);     color: var(--leaf);        border-color: transparent; }

/* Cultural tip block */
.tip-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--haldi-soft);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.tip-box .tip-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a6614;
  margin-bottom: 4px;
}

/* Common mistakes block */
.mistakes-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--rose-soft);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.mistakes-box .mistakes-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 4px;
}
.mistakes-box ul { margin: 0; padding-left: 16px; }
.mistakes-box li { margin: 2px 0; }

/* Activity-type variants on the exercise card */
.exercise-card.activity-roleplay   { border-color: var(--leaf); }
.exercise-card.activity-rapid-fire { border-color: var(--marigold); }
.exercise-card.activity-translate  { border-color: var(--rose); }
.exercise-card.activity-describe   { border-color: var(--ink-3); }
.exercise-card.activity-fill-blank { border-color: var(--haldi); }

/* Exercise card */
.exercise-card {
  background: var(--cream-2);
  border: 1.5px solid var(--haldi);
  border-radius: 16px;
  padding: 14px 16px 16px;
  margin-top: 10px;
}
.exercise-card .label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.exercise-card .label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--haldi);
}
.exercise-card .sentence {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.exercise-card .hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 10px;
  font-weight: 500;
}

/* Shared score pill (chat feedback, etc.). Number + scale, color by band. */
.score-pill,
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.score-pill.high, .score-badge.high { background: var(--leaf-soft); color: #1B5A40; }
.score-pill.mid,  .score-badge.mid  { background: var(--haldi-soft); color: #7A5A0E; }
.score-pill.low,  .score-badge.low  { background: var(--rose-soft); color: #7C2622; }

/* Chat action chips (look defined by shared .btn-secondary above) */
.chat-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Typing indicator */
.typing-indicator .bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
}
.typing-dot {
  width: 7px; height: 7px;
  background: var(--ink-3);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite cubic-bezier(0.65, 0, 0.35, 1);
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ═══════════════ CHAT INPUT ═══════════════ */
.chat-input-area {
  padding: 14px 18px 16px;
  background: var(--paper);
  border-top: 1px solid var(--hair);
  flex-shrink: 0;
}
.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-text-input {
  flex: 1;
  height: 52px;
  padding: 0 20px;
  border: 1.5px solid var(--hair-2);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-size: 14.5px;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.chat-text-input::placeholder { color: var(--ink-3); }
.chat-text-input:focus {
  border-color: var(--marigold);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(232, 106, 34, 0.12);
}

.send-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-ink);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background 200ms ease;
}
.send-btn:hover { background: #2A2017; transform: scale(1.04); }
.send-btn:active { transform: scale(0.94); }
.send-btn .ic { stroke: currentColor; }

/* Mic FAB */
.mic-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--marigold);
  color: var(--paper);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -4px rgba(26, 20, 16, 0.18);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background 200ms ease, box-shadow 200ms ease;
}
.mic-btn:hover { transform: scale(1.04); background: var(--marigold-dark); }
.mic-btn:active { transform: scale(0.96); }
.mic-btn.recording,
.mic-btn.is-recording {
  background: var(--rose);
  animation: pulseRing 1.5s infinite;
}
.mic-icon { display: none; }
.mic-btn .ic { stroke-width: 1.8; }
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0   rgba(184, 68, 62, 0.5), 0 4px 12px -4px rgba(26, 20, 16, 0.18); }
  70%  { box-shadow: 0 0 0 18px rgba(184, 68, 62, 0),  0 4px 12px -4px rgba(26, 20, 16, 0.18); }
  100% { box-shadow: 0 0 0 0   rgba(184, 68, 62, 0),  0 4px 12px -4px rgba(26, 20, 16, 0.18); }
}

/* Recording indicator */
.recording-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 0;
  font-size: 12px;
  color: var(--rose);
  font-weight: 600;
}
.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rose);
  animation: blink 1s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.rec-text { color: var(--ink-3); font-weight: 500; }

/* ═══════════════ ENTRY MODAL ═══════════════ */
.entry-modal-content {
  max-width: 460px;
}
.entry-modal-body {
  padding: 26px 22px 22px;
}
.entry-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 6px;
}
.entry-sub {
  font-size: 15px;
  color: var(--ink-3);
  margin: 0 0 20px;
}
.entry-reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.entry-reason {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}
.entry-reason:hover {
  background: var(--marigold-soft);
  border-color: var(--marigold);
}
.entry-reason:active { transform: scale(0.98); }
.entry-reason-emoji {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.entry-reason-label { line-height: 1.25; }
.entry-skip {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color 160ms ease;
}
.entry-skip:hover { color: var(--ink); }

@media (max-width: 420px) {
  .entry-reasons { grid-template-columns: 1fr; }
  .entry-title { font-size: 23px; }
}

/* ═══════════════ MODALS (bottom sheet) ═══════════════ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 16, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  animation: backdropIn 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--cream);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  border-radius: 28px 28px 0 0;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 -16px 48px -12px rgba(26, 20, 16, 0.25);
  animation: slideUp 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-content::before {
  content: '';
  position: sticky;
  top: 8px;
  display: block;
  width: 38px; height: 4px;
  margin: 8px auto -4px;
  background: var(--hair-2);
  border-radius: 999px;
  z-index: 2;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--hair);
  position: sticky;
  top: 0;
  background: var(--cream);
  z-index: 1;
}
.modal-header h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.modal-close {
  width: 36px; height: 36px;
  background: var(--paper);
  border: 1px solid var(--hair);
  cursor: pointer;
  color: var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, transform 140ms ease;
}
.modal-close:hover { background: var(--cream-2); }
.modal-close:active { transform: scale(0.92); }
.modal-body { padding: 20px 22px 24px; }

/* Progress stats */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 14px 14px;
  text-align: left;
}
.stat-value {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 10px;
  color: var(--ink-2);
  margin-top: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* Profile modal */
.profile-info {
  background: var(--ink);
  color: var(--cream);
  border-radius: 22px;
  padding: 22px 22px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  text-align: left;
  border-bottom: 0;
}
.profile-info::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 106, 34, 0.30) 0%, transparent 70%);
}
.profile-avatar {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--marigold);
  color: var(--cream);
  display: inline-grid;
  place-items: center;
  margin-bottom: 14px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  position: relative;
}
.profile-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
  color: var(--cream);
  letter-spacing: -0.01em;
  position: relative;
}
.profile-phone {
  font-size: 12px;
  color: rgba(255, 253, 247, 0.7);
  margin-top: 4px;
  position: relative;
}

.profile-section {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-size: 14.5px;
  background: var(--paper);
}
.profile-row + .profile-row { border-top: 1px solid var(--hair); }
.profile-row span:first-child { color: var(--ink-3); font-weight: 500; }
.profile-row span:last-child  { color: var(--ink);   font-weight: 600; }

.btn-cancel {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--rose);
  border: 1.5px solid var(--rose-soft);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.btn-cancel:hover { background: var(--rose); color: var(--cream); border-color: var(--rose); }
.btn-cancel:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-logout {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--hair-2);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 160ms ease;
}
.btn-logout:hover { background: var(--cream-2); }

/* ═══════════════ PAYMENT / PAYWALL ═══════════════ */
#payment-modal .modal-content {
  max-width: 520px;
}
.payment-content {
  text-align: left;
  padding: 24px 26px 26px;
  position: relative;
  overflow: hidden;
}
.payment-content::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 460px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(232, 106, 34, 0.22) 0%, transparent 65%);
  pointer-events: none;
}
.payment-emoji { display: none; }
.payment-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--haldi-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--ink-2);
  margin-bottom: 16px;
  position: relative;
}
.payment-content h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 40px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
  position: relative;
}
.payment-content h2 .accent { color: var(--marigold); }
.payment-hindi {
  font-family: var(--font-hindi);
  font-size: 16px;
  color: var(--ink-2);
  margin-top: 6px;
  position: relative;
}
.payment-content p {
  margin-top: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  font-size: 14.5px;
  position: relative;
}
.payment-content p strong { color: var(--ink); font-weight: 700; }

/* price card */
.price-card {
  margin-top: 20px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 22px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.price-card::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 106, 34, 0.5) 0%, transparent 70%);
}
.price-amount {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 54px;
  line-height: 0.9;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  position: relative;
}
.price-amount .per {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 15px;
  opacity: 0.7;
  font-weight: 500;
}
.price-sub {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 6px;
  position: relative;
}

.payment-features {
  list-style: none;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.payment-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--cream);
}
.payment-features li::before {
  content: '';
  width: 22px; height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--marigold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFDF7' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-11'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.btn-pay {
  margin-top: 20px;
  width: 100%;
  background: var(--marigold);
  color: var(--paper);
  border: none;
  border-radius: 16px;
  padding: 18px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: background 200ms ease, transform 160ms ease;
}
.btn-pay:hover { background: var(--marigold-dark); }
.btn-pay:active { transform: scale(0.99); }

.payment-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.payment-note .dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--hair-2);
  display: inline-block;
}

/* ═══════════════ LOADING ═══════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(251, 245, 233, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
}
.spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--hair);
  border-top-color: var(--marigold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════ DESKTOP framing ═══════════════ */
@media (min-width: 540px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    background:
      radial-gradient(at 20% 10%, rgba(232, 106, 34, 0.10) 0%, transparent 50%),
      radial-gradient(at 85% 90%, rgba(212, 160, 38, 0.08) 0%, transparent 50%),
      var(--cream-2);
  }
  #trial-screen, #login-screen, #otp-screen, #catalogue-screen, #chat-screen {
    max-width: 440px;
    height: min(900px, 100vh);
    margin: 0 auto;
    border-radius: 32px;
    position: relative;
    box-shadow:
      0 40px 80px -20px rgba(26, 20, 16, 0.30),
      0 0 0 1px rgba(26, 20, 16, 0.04);
    overflow-y: auto;
  }
  .modal-content {
    border-radius: 28px;
    margin-bottom: 20px;
  }
  .modal { align-items: center; }
}

/* ═══════════════ Safe area (notch / home bar) ═══════════════ */
@supports (padding-top: env(safe-area-inset-top)) {
  .chat-header { padding-top: calc(14px + env(safe-area-inset-top)); }
  .chat-input-area { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  #login-screen, #otp-screen { padding-top: calc(24px + env(safe-area-inset-top)); }
}

/* ═══════════════ Reduced motion ═══════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TRIAL SCREEN (try-lesson-before-phone)
   ═══════════════════════════════════════════════════════════════ */
#trial-screen { padding: 0; }
.trial-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.trial-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.trial-home-link {
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid var(--hair, #E8E1D2);
  padding-bottom: 2px;
}
.trial-home-link:hover { color: var(--ink); }
.trial-step { display: flex; flex-direction: column; gap: 22px; flex: 1; }
.trial-step[hidden] { display: none; }

.trial-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* One Aanya avatar everywhere. Size via --sz (default 44px). */
.aanya-avatar {
  --sz: 44px;
  width: var(--sz); height: var(--sz);
  border-radius: 50%;
  /* Aanya's photo, face-framed; marigold + "A" show as fallback if it is missing. */
  background: var(--marigold) url('/img/aanya.jpg') center 22% / cover no-repeat;
  color: transparent;
  display: grid;
  place-items: center;
  font-size: calc(var(--sz) * 0.41);
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -4px rgba(232, 106, 34, 0.45);
}
.trial-celebrate .aanya-avatar { margin-bottom: 12px; }
.trial-meta { line-height: 1.2; }
.trial-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.trial-status {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.trial-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}

.trial-title {
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 12px 0 4px;
}
.trial-sub {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.45;
}

.trial-scenarios {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.trial-scenario {
  appearance: none;
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 16px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 160ms ease, transform 140ms ease, box-shadow 200ms ease;
}
.trial-scenario:hover {
  border-color: var(--marigold);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -16px rgba(232,106,34,0.35);
}
.trial-scenario-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.trial-scenario-sub {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.35;
}

.trial-footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 8px;
}

/* Lesson runner */
.trial-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.trial-back-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 999px;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
}
.trial-back-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.trial-progress-dots {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.trial-pdot {
  width: 24px; height: 4px;
  border-radius: 2px;
  background: var(--hair, #E8E1D2);
  transition: background 200ms ease;
}
.trial-pdot.active { background: var(--marigold); }
.trial-pdot.done { background: var(--ink); }
.trial-step-label { font-size: 13px; color: var(--ink-3); font-weight: 600; }

.trial-card {
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  flex: 1;
}

/* ── Trial as a chat thread (shares .message / .bubble / .voice-note) ── */
.trial-chat {
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  /* Bound the chat so the input bar (mic) is always in view; the thread
     scrolls internally instead of pushing the mic below the viewport. */
  max-height: calc(100dvh - 180px);
}
.trial-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hair, #E8E1D2);
  background: var(--paper);
}
.trial-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.trial-input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--hair, #E8E1D2);
  background: var(--paper);
  flex-shrink: 0;
}
.trial-rec-indicator {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.trial-rec-indicator[hidden] { display: none; }
.trial-rec-indicator .trial-wave { height: 28px; }
.trial-rec-indicator .trial-wave span { width: 3px; }
.trial-rec-text { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.trial-stop-btn { background: var(--rose); }
.trial-stop-btn[hidden] { display: none; }
.trial-stop-square {
  width: 16px; height: 16px;
  border-radius: 3px;
  background: var(--paper);
}

.trial-prompt-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--marigold);
  font-weight: 700;
}
.trial-script {
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.trial-hint { font-size: 12px; color: var(--ink-3); }

.trial-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 56px;
}
.trial-wave span {
  width: 4px;
  background: var(--accent, #E86A22);
  border-radius: 2px;
  animation: trialWave 1s ease-in-out infinite;
}
.trial-wave span:nth-child(1) { animation-delay: -1.0s; }
.trial-wave span:nth-child(2) { animation-delay: -0.85s; }
.trial-wave span:nth-child(3) { animation-delay: -0.7s; }
.trial-wave span:nth-child(4) { animation-delay: -0.55s; }
.trial-wave span:nth-child(5) { animation-delay: -0.4s; }
.trial-wave span:nth-child(6) { animation-delay: -0.25s; }
.trial-wave span:nth-child(7) { animation-delay: -0.1s; }
@keyframes trialWave { 0%, 100% { height: 10px; } 50% { height: 48px; } }

.trial-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--hair, #E8E1D2);
  border-top-color: var(--accent, #E86A22);
  border-radius: 50%;
  animation: trialSpin 0.8s linear infinite;
}
@keyframes trialSpin { to { transform: rotate(360deg); } }

.trial-actions { display: flex; gap: 10px; align-items: center; justify-content: center; padding-top: 4px; }
/* .trial-retry look defined by shared .btn-secondary above. */
.trial-next {
  padding: 10px 18px !important;
  font-size: 14px !important;
  border-radius: 999px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trial-link {
  appearance: none;
  background: none;
  border: none;
  color: var(--accent, #E86A22);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* Completion screen */
.trial-celebrate { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.trial-summary {
  width: 100%;
  background: var(--cream, #FBF5E9);
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trial-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--ink-2);
}
.trial-summary-row strong { color: var(--ink); font-weight: 700; }
.trial-summary-row .trial-summary-score {
  font-weight: 800;
  color: var(--accent, #E86A22);
}
.trial-unlock {
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 18px;
  padding: 20px;
  width: 100%;
  text-align: center;
  margin-top: 8px;
}
.trial-unlock h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.trial-unlock p {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.trial-unlock .btn-primary { width: 100%; justify-content: center; }
.trial-skip {
  appearance: none;
  background: none;
  border: none;
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 10px 0 0;
  text-decoration: underline;
}
.trial-skip:hover { color: var(--ink-2); }

/* ═══════════════════════════════════════════════════════════════
   CATALOGUE SCREEN
   ═══════════════════════════════════════════════════════════════ */
#catalogue-screen { padding: 0; background: var(--cream, #FBF5E9); }
.cat-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.cat-header {
  padding: 20px 18px 16px;
  background: #FFFDF7;
  border-bottom: 1px solid var(--hair, #E8E1D2);
  position: sticky; top: 0;
  z-index: 10;
}
.cat-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cat-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cat-hello { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.cat-tagline { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.cat-brand-actions { display: flex; align-items: center; gap: 6px; }

/* First-run coach note (onboarding orientation, localStorage-gated) */
.cat-coachnote {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 14px 18px 0;
  padding: 13px 14px;
  background: var(--marigold-soft);
  border: 1px solid rgba(232, 106, 34, 0.18);
  border-radius: var(--r);
  animation: coachNoteIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-coachnote[hidden] { display: none; }
.cat-coachnote-text {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 1px 0 0;
}
.cat-coachnote-close {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--ink-3);
  padding: 2px; border-radius: 6px;
  transition: color 160ms ease, background 160ms ease;
}
.cat-coachnote-close:hover { color: var(--ink); background: rgba(26, 20, 16, 0.05); }
@keyframes coachNoteIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cat-progress-card {
  background: var(--cream, #FBF5E9);
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.cat-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.cat-progress-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.cat-progress-stat { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cat-progress-bar {
  height: 6px;
  background: var(--hair, #E8E1D2);
  border-radius: 3px;
  overflow: hidden;
}
.cat-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent, #E86A22), #F4A261);
  border-radius: 3px;
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-paywall-strip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(135deg, #FFF5E6, #FFE9CC);
  border: 1px solid rgba(232, 106, 34, 0.18);
  border-radius: 14px;
}
.cat-paywall-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  text-align: center;
}
.cat-paywall-text strong { font-weight: 700; }
.cat-price { color: var(--accent, #E86A22); font-weight: 700; }
.cat-paywall-btn {
  padding: 10px 16px !important;
  font-size: 13.5px !important;
  border-radius: 999px !important;
  width: auto !important;
  align-self: center;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px !important;
  white-space: nowrap;
  min-height: 0 !important;
  height: auto !important;
}
.cat-paywall-btn .ic { width: 14px !important; height: 14px !important; }

@media (min-width: 520px) {
  .cat-paywall-strip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
  }
  .cat-paywall-text { text-align: left; flex: 1; min-width: 0; }
  .cat-paywall-btn { align-self: auto; }
}
.cat-paywall-strip.hidden { display: none; }

.cat-list {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.cat-module-block { display: flex; flex-direction: column; gap: 10px; }
.cat-module-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.cat-module-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cat-module-count {
  font-size: 11.5px;
  color: var(--ink-3);
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 999px;
  padding: 2px 8px;
}

.cat-lesson {
  appearance: none;
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 160ms ease, transform 140ms ease;
  width: 100%;
}
.cat-lesson:hover { border-color: var(--accent, #E86A22); transform: translateX(2px); }

.cat-lesson-num {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--cream, #FBF5E9);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  flex-shrink: 0;
}
.cat-lesson-body { flex: 1; min-width: 0; }
.cat-lesson-topic { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.cat-lesson-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.cat-lesson-tag {
  font-size: 10.5px;
  font-weight: 600;
  background: var(--cream, #FBF5E9);
  color: var(--ink-3);
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cat-lesson-tag.free { background: rgba(34,197,94,0.12); color: #15803d; }
.cat-lesson-tag.level-beginner { background: rgba(34,197,94,0.10); color: #15803d; }
.cat-lesson-tag.level-intermediate { background: rgba(234,179,8,0.14); color: #92400e; }
.cat-lesson-tag.level-advanced { background: rgba(232,106,34,0.14); color: var(--accent, #E86A22); }

.cat-lesson-state {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-lesson-state svg { width: 16px; height: 16px; color: var(--ink-3); }

.cat-lesson.is-free {
  background: linear-gradient(135deg, #FFF5E6, #FFFDF7);
  border-color: rgba(232, 106, 34, 0.25);
  box-shadow: 0 10px 24px -16px rgba(232, 106, 34, 0.4);
}
.cat-lesson.is-free .cat-lesson-num { background: var(--accent, #E86A22); color: #FFFDF7; }
.cat-lesson.is-free .cat-lesson-state { background: var(--accent, #E86A22); }
.cat-lesson.is-free .cat-lesson-state svg { color: #FFFDF7; }

.cat-lesson.is-locked {
  opacity: 0.85;
  cursor: pointer;
}
.cat-lesson.is-locked .cat-lesson-state { background: var(--cream, #FBF5E9); border: 1px solid var(--hair, #E8E1D2); }

.cat-lesson.is-completed .cat-lesson-num {
  background: #15803d; color: #FFFDF7;
}
.cat-lesson.is-completed .cat-lesson-state { background: rgba(34,197,94,0.15); }
.cat-lesson.is-completed .cat-lesson-state svg { color: #15803d; }

.cat-lesson.is-current {
  border-color: var(--accent, #E86A22);
  box-shadow: 0 8px 20px -12px rgba(232,106,34,0.35);
}
.cat-lesson.is-current .cat-lesson-state {
  background: var(--accent, #E86A22);
  animation: catPulse 2s ease-in-out infinite;
}
.cat-lesson.is-current .cat-lesson-state svg { color: #FFFDF7; }
@keyframes catPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(232,106,34,0.45); }
  50% { box-shadow: 0 0 0 8px rgba(232,106,34,0); }
}

/* ═══════════════════════════════════════════════════════════════
   SOFT PAYWALL MODAL (locked-lesson click)
   ═══════════════════════════════════════════════════════════════ */
.soft-paywall-content {
  max-width: 400px;
  padding: 28px 24px 24px;
  text-align: center;
  position: relative;
}
.soft-paywall-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--cream, #FBF5E9);
  display: grid;
  place-items: center;
  color: var(--accent, #E86A22);
  margin: 0 auto 14px;
  border: 1px solid var(--hair, #E8E1D2);
}
.soft-paywall-content h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.soft-paywall-topic {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
}
.soft-paywall-pitch {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
  margin: 0 0 20px;
}
.soft-paywall-cta {
  width: 100%;
  justify-content: center;
  margin-bottom: 8px;
}
.soft-paywall-skip {
  appearance: none;
  background: none;
  border: none;
  color: var(--ink-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
  text-decoration: underline;
}
.soft-paywall-skip:hover { color: var(--ink-2); }

/* ═══════════════════════════════════════════════════════════════
   FULL-SCREEN PAYWALL (post-lesson-1)
   ═══════════════════════════════════════════════════════════════ */
.paywall {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(180deg, #FBF5E9 0%, #FFFDF7 60%);
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 18px 32px;
}
.paywall.is-open { display: flex; }
.paywall-inner {
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.paywall-close {
  align-self: flex-end;
  appearance: none;
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-3);
}
.paywall-close:hover { color: var(--ink); }

.paywall-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.paywall-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: rgba(232,106,34,0.12);
  color: var(--accent, #E86A22);
  border: 1px solid rgba(232,106,34,0.2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.paywall-title {
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.paywall-title span { color: var(--accent, #E86A22); }
.paywall-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}
.paywall-subtitle strong { color: var(--ink); font-weight: 700; }

.paywall-score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.paywall-score-card {
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.paywall-score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 700;
}
.paywall-score-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent, #E86A22);
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.paywall-score-num small {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
}

.paywall-card {
  background: #FFFDF7;
  border: 1px solid var(--hair, #E8E1D2);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 14px 36px -20px rgba(26,20,16,0.18);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.paywall-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.paywall-card-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 700;
  margin-bottom: 4px;
}
.paywall-card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.paywall-price-amt {
  font-size: 40px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.paywall-price-per {
  font-size: 16px;
  color: var(--ink-2);
  font-weight: 500;
}
.paywall-card-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.paywall-card-anchor {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.paywall-card-anchor-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 700;
}
.paywall-card-anchor-old {
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: line-through;
}

.paywall-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--hair, #E8E1D2);
  padding-top: 16px;
}
.paywall-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
}
.paywall-features .ic {
  flex-shrink: 0;
  color: var(--accent, #E86A22);
  background: rgba(232,106,34,0.12);
  border-radius: 50%;
  padding: 4px;
  width: 22px !important;
  height: 22px !important;
  stroke-width: 2.5;
}
.paywall-cta {
  width: 100%;
  justify-content: center;
  padding: 14px !important;
  font-size: 15px !important;
}
.paywall-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.paywall-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  padding-top: 8px;
}
.paywall-proof-stars { font-size: 14px; }
