/* Melanie's Exam Coach — Design System v2
   Pink + cream palette, Outfit + DM Sans, pill buttons, rounded-rect cards.

   Old palette aliases (--color-*) are preserved and remapped to the new
   pink palette so every prior reference becomes pink automatically.
   That enforces the "no sage anywhere" rule without touching markup. */

:root {
  /* ---------- Pink — the signature color ---------- */
  --pink:            #C0446E;
  --pink-hover:      #A83560;
  --pink-soft:       #F7C5D4;
  --pink-pale:       #FDF0F5;
  --pink-blush:      #FEF7FA;

  /* ---------- Teal — correct / success only ---------- */
  --teal:            #3D8F8F;
  --teal-soft:       #D4EDED;

  /* ---------- Mauve — domain badges only ---------- */
  --mauve:           #9B6B8A;
  --mauve-soft:      #F3ECF5;

  /* ---------- Semantic ---------- */
  --success:         #3D8A5C;
  --success-soft:    #D4EDE0;
  --error:           #C04444;
  --error-soft:      #FDEAEA;

  /* ---------- Backgrounds ---------- */
  --bg-page:         #F5EFE6;
  --bg-card:         #FFFFFF;
  --bg-subtle:       #FAF5F0;

  /* ---------- Text ---------- */
  --text-1:          #1A1A2E;
  --text-2:          #4A4A6A;
  --text-3:          #8A8AA0;

  /* ---------- Borders ---------- */
  --border:          #EDE0E8;
  --border-mid:      #D9C0CC;

  /* ---------- Shadows ---------- */
  --shadow-card:     0 1px 8px rgba(192,68,110,0.07);
  --shadow-raise:    0 4px 20px rgba(192,68,110,0.10);

  /* ---------- Legacy aliases ----------
     Old code referenced --color-* tokens with sage as primary.
     Remap them all to the new palette. Any selector that still uses
     --color-primary will silently become pink — no markup change needed. */
  --color-bg:           var(--bg-page);
  --color-surface:      var(--bg-card);
  --color-text:         var(--text-1);
  --color-text-soft:    var(--text-3);
  --color-primary:      var(--pink);
  --color-primary-dark: var(--pink-hover);
  --color-accent:       var(--mauve);
  --color-warn:         #C09020;
  --color-border:       var(--border);
  --color-pink:         var(--pink);
  --color-pink-dark:    var(--pink-hover);

  /* ---------- Typography ---------- */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --text-base:    16px;
  --leading:      1.6;

  /* ---------- Spacing ---------- */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* ---------- Layout ---------- */
  --max-content: 680px;

  /* ---------- Radius ---------- */
  --radius-pill:     999px;
  --radius-card:     18px;   /* subject/intro cards */
  --radius-card-lg:  22px;   /* hero (question) card */
  --radius-card-sm:  12px;   /* answer options, banners */
  --radius:          var(--radius-card-sm); /* legacy alias */
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--text-1);
  background: var(--bg-page);
  min-height: 100vh;
  /* Bottom breathing room so pages don't end abruptly at the last
     interactive element. Left/right pulled in by 1rem; top stays 0
     so the pink header band can sit flush with the viewport top. */
  padding: 0 var(--space-sm) var(--space-xl);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-content);
  margin: 0 auto;
}

/* ============================================================
   Pink header band — Home greeting
   Full-bleed via viewport negative margins (no markup change).
   ============================================================ */

.greeting {
  background: var(--pink);
  text-align: center;
  padding: 2rem var(--space-md) 1.5rem;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: var(--space-lg);
  color: #FFFFFF;
}

.greeting h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.greeting p {
  color: rgba(255, 255, 255, 0.85);
  margin-top: var(--space-xs);
  font-weight: 400;
}

/* Native [hidden] must win over our display:inline-block */
[hidden] { display: none !important; }

/* Birthday-bonus subline (Tyler voice) — appears below day-streak during
   the 3-day birthday window. White text on the pink band, italic, smaller
   weight so it reads as a P.S. not a primary message. */
.greeting-bonus {
  display: block;
  margin-top: 0.75rem !important;
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 400;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

/* Day-streak pill inside pink header — translucent white */
.day-streak {
  display: inline-block;
  margin-top: var(--space-sm) !important;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
}

/* ============================================================
   Subject cards — rounded rect with pink accents
   ============================================================ */

.subjects {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.subject-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}

.subject-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raise);
  border-color: var(--border-mid);
}

.subject-card:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.subject-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.subject-title {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

.subject-subtitle {
  font-size: 0.85rem;
  color: var(--text-3);
  line-height: 1.4;
  max-width: 28ch;
  font-weight: 400;
}

/* Level pill — pink solid, true pill shape */
.level-pill {
  align-self: flex-start;
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.85rem;
  background: var(--pink);
  color: #FFFFFF;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.subject-progress-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.progress {
  flex: 1;
  height: 7px;
  background: var(--pink-soft);
  border-radius: var(--radius-pill);
  overflow: visible;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--pink);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.progress-label.ready {
  color: var(--pink);
  font-weight: 700;
}

.progress.ready-for-level-up .progress-fill {
  animation: progress-pulse 2.4s ease-in-out infinite;
}

/* Accuracy gauge — shows her % correct in this subject with a vertical
   marker at the 80% TExES retake-eligibility threshold. Per Terry's
   phone-test feedback 2026-05-27: Melanie needs to know where she
   stands relative to that 80% mark at a glance. */

.accuracy-row {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.accuracy-bar {
  position: relative;
  width: 100%;
  height: 7px;
  background: var(--pink-soft);
  border-radius: var(--radius-pill);
  overflow: visible;
}

.accuracy-fill {
  height: 100%;
  width: 0%;
  background: #C09020; /* amber — needs work */
  border-radius: var(--radius-pill);
  transition: width 0.4s ease, background-color 0.3s ease;
}

.accuracy-bar.accuracy-passing .accuracy-fill {
  background: var(--success); /* green — at or above 80% */
}

/* Vertical marker at the 80% line — visual reference point for the
   passing threshold. */
.accuracy-marker {
  position: absolute;
  left: 80%;
  top: -3px;
  width: 2px;
  height: 13px;
  background: var(--text-2);
  border-radius: 1px;
  opacity: 0.7;
}

.accuracy-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.accuracy-label.passing {
  color: var(--success);
}

@keyframes progress-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 68, 110, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(192, 68, 110, 0); }
}

/* ============================================================
   Footer link pills (Home page footer: Stories · How this works · Study tips)
   Per design system: secondary buttons = white bg, --pink border, --pink text, pill
   ============================================================ */

.footer-links {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.footer-links a {
  display: inline-block;
  color: var(--pink);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--pink);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #FFFFFF;
  background: var(--pink);
  outline: none;
}

.footer-links a:active {
  transform: scale(0.97);
}

.footer-links span {
  display: none;
}

/* ============================================================
   Practice / Intro / Tips header (back-link + title + spacer)
   ============================================================ */

.practice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) 0 var(--space-sm);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.back-link {
  display: inline-block;
  color: var(--pink);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.4rem 0.95rem;
  border: 1.5px solid var(--pink);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: #FFFFFF;
  background: var(--pink);
  outline: none;
}

.back-link:active { transform: scale(0.97); }

.practice-subject-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 0.1rem;
}

.practice-subject {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-1);
  letter-spacing: -0.005em;
}

.practice-subject-subtitle {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-3);
  font-style: italic;
  text-align: center;
  letter-spacing: 0;
  line-height: 1.2;
}

.header-spacer {
  display: inline-block;
  width: 5rem;
}

/* ============================================================
   Practice — question card area
   ============================================================ */

.practice {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.question-meta {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Meta row — question label on the left, source-authority badge on the right */
.question-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Source-authority badge — only shown when source_authority="pearson_official".
   Subtle confidence signal: "this is real test wording." */
.source-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.75rem;
  background: var(--mauve-soft);
  color: var(--mauve);
  border-radius: var(--radius-pill);
}

/* ============================================================
   Question stimulus (scenario intro, excerpt, chart)
   Visually distinct from the stem so Melanie sees it as context.
   Mauve left-accent to differentiate from pink (status) treatment.
   ============================================================ */

.question-stimulus {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--mauve);
  border-radius: 0 var(--radius-card-sm) var(--radius-card-sm) 0;
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-line; /* preserve line breaks for charts/quotes */
}

.question-stimulus em {
  color: var(--mauve);
}

.question-stimulus strong {
  color: var(--text-1);
}

/* ============================================================
   Question figure (image with optional caption)
   Responsive, max-width capped so very large images don't overflow.
   ============================================================ */

.question-figure {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1rem;
  margin: 0;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.question-figure img {
  max-width: 100%;
  max-height: 360px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-card-sm);
}

.question-figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* Question stem — the hero element. White card per design system
   ("Question card: 22px — slightly more, it's the hero element"). */
.question-stem {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-1);
  letter-spacing: -0.005em;
  white-space: pre-line;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card-lg);
  padding: 1.5rem var(--space-md);
  box-shadow: var(--shadow-card);
}

/* Filter chips — pills */
.practice-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
  margin-bottom: calc(var(--space-sm) * -1);
}

.practice-filters:empty {
  display: none;
}

.filter-chip {
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.filter-chip:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.filter-chip:active { transform: scale(0.97); }

.filter-chip.active {
  background: var(--pink);
  color: #FFFFFF;
  border-color: var(--pink);
}

.question-stem em {
  font-style: italic;
  color: var(--mauve);
}

/* ============================================================
   Answer options — rounded rects, pink interaction
   ============================================================ */

/* Multi-select hint — appears above options for "select all that apply" Qs.
   Subtle mauve callout so it doesn't compete with the question stem above. */
.multi-select-hint {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mauve);
  font-style: italic;
  margin: 0 0 0.5rem;
  padding-left: 0.25rem;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card-sm);
  padding: 1rem var(--space-md);
  font: inherit;
  font-family: var(--font-body);
  color: var(--text-1);
  cursor: pointer;
  min-height: 52px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.option-card:hover {
  background: var(--pink-blush);
  border-color: var(--pink);
}

.option-card:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.option-card:active { transform: scale(0.99); }

.option-card[aria-pressed="true"] {
  background: var(--pink-pale);
  border-color: var(--pink);
}

.option-letter {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink-pale);
  border: 1.5px solid var(--pink-soft);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--pink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.option-card[aria-pressed="true"] .option-letter {
  background: var(--pink);
  color: #FFFFFF;
  border-color: var(--pink);
}

.option-text {
  flex: 1;
  line-height: 1.5;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-1);
}

/* ============================================================
   Practice actions — Submit (primary pink pill) + Skip
   ============================================================ */

.practice-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: var(--space-md);
}

.primary-action {
  width: 100%;
  max-width: 360px;
  padding: 0.85rem 1.5rem;
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--pink);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.primary-action:hover:not(:disabled) {
  background: var(--pink-hover);
}

.primary-action:active:not(:disabled) {
  transform: scale(0.97);
}

.primary-action:focus-visible {
  outline: 2px solid var(--pink-hover);
  outline-offset: 2px;
}

.primary-action:disabled {
  background: var(--border);
  color: var(--text-3);
  cursor: not-allowed;
}

/* Submit button — now follows the standard primary-action treatment
   (the old outlined-pink rect-pill override is removed; design system
   says solid pink pill for the most important action). */
#commit-answer {
  background: var(--pink);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
}

#commit-answer:hover:not(:disabled) {
  background: var(--pink-hover);
  color: #FFFFFF;
}

#commit-answer:focus-visible {
  outline: 2px solid var(--pink-hover);
  outline-offset: 2px;
}

#commit-answer:disabled {
  background: var(--border);
  color: var(--text-3);
  border: none;
  cursor: not-allowed;
}

.skip-link {
  background: none;
  border: none;
  color: var(--text-3);
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.skip-link:hover {
  color: var(--text-1);
  background: var(--bg-subtle);
}

.skip-link:disabled,
.primary-action:disabled,
.option-card:disabled {
  cursor: default;
  opacity: 0.7;
}

/* ============================================================
   "About this subject" link on practice screen — ghost pill
   ============================================================ */

.practice-about-row {
  text-align: right;
  margin-top: calc(var(--space-md) * -1);
  margin-bottom: 0;
}

.about-link {
  display: inline-block;
  color: var(--text-2);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.about-link:hover,
.about-link:focus-visible {
  color: var(--pink);
  border-color: var(--pink);
  background: var(--bg-card);
  outline: none;
}

/* ============================================================
   Walkthrough — coach's response (3 default sections + 3 expandable)
   ============================================================ */

.walkthrough-loader {
  text-align: center;
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--space-xs) var(--space-md);
  animation: soft-pulse 1.8s ease-in-out infinite;
}

@keyframes soft-pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

.walkthrough {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.walkthrough-domain-tag {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--mauve-soft);
  color: var(--mauve);
}

/* Subject-specific domain tag accents — kept distinct but in-family */
.walkthrough-domain-tag[data-subject="ppr"] {
  color: var(--pink);
  background: var(--pink-pale);
}

.walkthrough-domain-tag[data-subject="science"] {
  color: var(--teal);
  background: var(--teal-soft);
}

.walkthrough-domain-tag[data-subject="social"] {
  color: var(--mauve);
  background: var(--mauve-soft);
}

/* Skeleton — pulse shimmer while walkthrough streams in */
.walkthrough-skeleton .walkthrough-step h2 {
  opacity: 0.55;
}

.walkthrough-skeleton .walkthrough-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skel-line {
  display: block;
  height: 0.85rem;
  border-radius: 6px;
  background: var(--bg-subtle);
  background-image: linear-gradient(90deg,
    var(--bg-subtle) 0%,
    rgba(247, 197, 212, 0.25) 50%,
    var(--bg-subtle) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.6s ease-in-out infinite;
}

.skel-line--mid   { width: 80%; }
.skel-line--short { width: 55%; }

@keyframes skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.walkthrough-verdict {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-1);
  background: var(--pink-pale);
  border-left: 3px solid var(--pink);
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 var(--radius-card-sm) var(--radius-card-sm) 0;
  line-height: 1.55;
}

/* Extra-hard win banner — Melanie's pink win */
.extra-hard-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--pink);
  background: var(--pink-pale);
  border: 1.5px solid var(--pink-soft);
  border-radius: var(--radius-card-sm);
  padding: var(--space-sm) var(--space-md);
}

/* Confidence-recovery banner (Terry's homework 2026-05-27): appears above
   the walkthrough when she's missed 3+ in a row. Mauve-pale background +
   calm italic so it reads as a gentle note, not a warning. */
.confidence-recovery-banner {
  background: var(--mauve-soft);
  border-left: 3px solid var(--mauve);
  border-radius: 0 var(--radius-card-sm) var(--radius-card-sm) 0;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--mauve);
  line-height: 1.55;
}

/* Walkthrough step cards */
.walkthrough-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem var(--space-md);
  box-shadow: var(--shadow-card);
}

/* Step labels — uppercase pink chapter headings */
.walkthrough-step h2 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.walkthrough-body {
  font-family: var(--font-body);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-1);
  font-weight: 400;
}

.walkthrough-body strong {
  color: var(--text-1);
  font-weight: 700;
}

.walkthrough-body em {
  color: var(--mauve);
  font-style: italic;
}

.walkthrough-error {
  text-align: center;
  padding: var(--space-lg);
  background: var(--error-soft);
  border: 1px solid var(--error);
  border-left: 3px solid var(--error);
  border-radius: var(--radius-card-sm);
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.walkthrough-error p {
  color: var(--text-1);
  font-size: 1rem;
}

/* Calming subtext beneath the primary error message — softens the moment. */
.walkthrough-error-subtext {
  color: var(--text-3) !important;
  font-size: 0.9rem !important;
  font-style: italic;
  margin-top: calc(var(--space-xs) * -0.5);
}

/* "Want to know more?" toggle — appears between the 3 default walkthrough
   sections and the 3 expandable ones. The default surface stays light
   (verdict + best answer + real-world example + pattern); the deeper
   reasoning is one tap away. Treatment: outlined-mauve pill, smaller than
   the primary actions so it reads as "optional, not required." */
.walkthrough-expand-btn {
  align-self: center;
  margin: 0.5rem auto 0.25rem;
  padding: 0.5rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--mauve);
  background: var(--bg-card);
  border: 1.5px solid var(--mauve);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.walkthrough-expand-btn:hover {
  background: var(--mauve);
  color: #FFFFFF;
}

.walkthrough-expand-btn:active {
  transform: scale(0.97);
}

/* ============================================================
   Quick Check (Second-Guessing Protocol) — signature moment
   Flat left edge, rounded right. Pink-pale background, pink accent.
   ============================================================ */

.second-guessing {
  margin-top: var(--space-md);
  padding: 1.25rem var(--space-md);
  background: var(--pink-pale);
  border: none;
  border-left: 3px solid var(--pink);
  border-radius: 0 var(--radius-card-sm) var(--radius-card-sm) 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sg-title {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
  margin-bottom: 0.25rem;
}

.sg-prompt {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pink);
  line-height: 1.5;
}

.sg-prompt.sg-affirmation {
  color: var(--text-1);
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 700;
}

.sg-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}

.sg-button {
  text-align: left;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card-sm);
  padding: 0.85rem var(--space-md);
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.sg-button:hover {
  background: var(--pink-blush);
  border-color: var(--pink);
}

.sg-button:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.sg-button:active { transform: scale(0.99); }

.sg-textarea {
  width: 100%;
  margin-top: var(--space-sm);
  padding: 0.85rem var(--space-md);
  font: inherit;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card-sm);
  resize: vertical;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sg-textarea:focus-visible {
  outline: none;
  border-color: var(--pink);
  background: var(--bg-card);
}

.sg-textarea:disabled {
  opacity: 0.7;
}

.sg-reflection {
  margin-top: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-1);
}

/* ============================================================
   Subject Intro / About / Tips
   ============================================================ */

.intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.intro-hero {
  text-align: center;
  padding: var(--space-sm) 0 0;
}

.intro-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
}

.intro-subtitle {
  margin-top: var(--space-xs);
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 400;
}

.intro-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem var(--space-md);
  box-shadow: var(--shadow-card);
}

.intro-heading {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.005em;
}

.intro-body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-1);
  font-weight: 400;
}

.intro-body p {
  margin-bottom: var(--space-sm);
}

.intro-body p:last-child {
  margin-bottom: 0;
}

.intro-body em {
  font-style: italic;
  color: var(--mauve);
}

.intro-body strong {
  font-weight: 700;
  color: var(--text-1);
}

.intro-list {
  margin: var(--space-sm) 0 var(--space-md);
  padding-left: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.intro-list li {
  padding-left: var(--space-xs);
  line-height: 1.55;
}

.intro-list li::marker {
  color: var(--pink);
  font-weight: 700;
}

.intro-current-marker {
  color: var(--pink);
  font-style: italic;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.4rem;
}

.intro-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0 var(--space-lg);
}

.intro-actions .primary-action {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

/* ============================================================
   Level-up celebration modal
   ============================================================ */

.level-up-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
  animation: fade-in 0.3s ease;
}

.level-up-card {
  background: var(--bg-card);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  border-radius: var(--radius-card);
  text-align: center;
  max-width: 480px;
  width: 100%;
  border: 2px solid var(--pink);
  box-shadow: var(--shadow-raise);
  animation: card-rise 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.level-up-confetti {
  font-size: 2.2rem;
  margin-bottom: var(--space-md);
  letter-spacing: 0.5rem;
  animation: confetti-bounce 1.4s ease-in-out infinite;
}

.level-up-heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: -0.01em;
}

.level-up-praise {
  margin-top: var(--space-md);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-1);
  font-weight: 400;
}

.level-up-subtle {
  margin-top: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-3);
  font-style: italic;
}

.level-up-card .primary-action {
  margin-top: var(--space-lg);
  background: var(--pink);
  color: #FFFFFF;
}

.level-up-card .primary-action:hover {
  background: var(--pink-hover);
}

@keyframes confetti-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Stories module — narrative-anchored learning (V1.5)
   List page (stories.html) + single-story reader (story.html).
   Reuses .intro-section card pattern for body + callouts.
   ============================================================ */

/* List of story cards */
.story-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.story-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem var(--space-md);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raise);
  border-color: var(--border-mid);
}

.story-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.story-topic-chip {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  background: var(--mauve-soft);
  color: var(--mauve);
  border-radius: var(--radius-pill);
}

.story-time {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 500;
}

.story-card-title {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  margin: 0.25rem 0 0.35rem;
}

.story-card-teaser {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0;
}

.story-empty {
  text-align: center;
  color: var(--text-3);
  font-style: italic;
  padding: var(--space-lg);
}

/* ----------------------------------------------------------------
   Story reader (story.html)
   ---------------------------------------------------------------- */

.story-reader {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.story-hero {
  text-align: center;
  padding: var(--space-sm) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.story-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
}

.story-hero-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin: 0;
  max-width: 28ch;
  line-height: 1.2;
}

.story-body {
  font-family: var(--font-body);
}

.story-body p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-1);
  margin-bottom: var(--space-sm);
}

.story-body p:last-child { margin-bottom: 0; }

.story-body strong {
  font-weight: 700;
  color: var(--text-1);
}

.story-body em {
  font-style: italic;
  color: var(--mauve);
}

.story-body blockquote {
  margin: var(--space-sm) 0;
  padding: 0.85rem var(--space-md);
  background: var(--pink-pale);
  border-left: 3px solid var(--pink);
  border-radius: 0 var(--radius-card-sm) var(--radius-card-sm) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pink);
}

/* Callout cards — "What the test is really asking", "Takeaway", "Watch out" */
.story-callout {
  /* uses .intro-section as base; just tweak the section-heading color */
}

.story-section-heading {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.story-callout-takeaway .story-section-heading { color: var(--teal); }
.story-callout-takeaway { border-left: 3px solid var(--teal); }

.story-callout-watchout .story-section-heading { color: #C09020; }
.story-callout-watchout { border-left: 3px solid #C09020; background: #FFF8E8; }

.story-callout-asking { border-left: 3px solid var(--pink); }

.story-section-body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-1);
  margin: 0;
}

/* Linked questions card */
.story-linked-questions { background: var(--bg-card); }

.story-question-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.story-question-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card-sm);
  text-decoration: none;
  color: var(--text-1);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.story-question-link:hover {
  background: var(--pink-blush);
  border-color: var(--pink);
}

.story-question-stem {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-1);
}

.story-question-go {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.04em;
  align-self: flex-end;
}

/* Walkthrough → Stories surfacing (in-context "want to read more?") */
.walkthrough-story-suggest {
  background: var(--mauve-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--mauve);
  border-radius: 0 var(--radius-card-sm) var(--radius-card-sm) 0;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.walkthrough-story-suggest-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mauve);
}

.walkthrough-story-suggest-link {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--mauve);
  text-decoration: none;
  line-height: 1.4;
}

.walkthrough-story-suggest-link:hover {
  text-decoration: underline;
}

/* ============================================================
   Mode card (Home, added 2026-05-27)
   Same shape language as .subject-card but distinct treatment so it
   reads as a "mode" (Flashcards), not a subject. Mauve accent +
   leading icon. No progress bar or accuracy gauge (modes don't have
   level state).
   ============================================================ */

.mode-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1.5px solid var(--mauve);
  border-radius: var(--radius-card);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.mode-card:hover,
.mode-card:focus-visible {
  background: var(--mauve-soft);
  outline: none;
}

.mode-card:active {
  transform: scale(0.99);
}

.mode-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.mode-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.mode-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mauve);
}

.mode-card-subtitle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.4;
}

/* ============================================================
   Flashcards mode (V1, added 2026-05-27)
   Per Terry: 4 states (subject → size → cards → end). No tracking.
   Reveal highlights correct option(s) in teal. Multi-select supported.
   ============================================================ */

.flashcards {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fc-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fc-step-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-1);
  margin: var(--space-md) 0 0;
  text-align: center;
}

.fc-step-subtitle {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-2);
  text-align: center;
  margin: 0 0 var(--space-sm);
}

/* Subject picker — same shape as the Home subject cards but tappable buttons. */
.fc-subject-list,
.fc-size-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.fc-subject-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1.5px solid var(--pink-soft);
  border-radius: var(--radius-card);
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.fc-subject-card:hover,
.fc-subject-card:focus-visible {
  background: var(--pink-pale);
  border-color: var(--pink);
  outline: none;
}

.fc-subject-card:active {
  transform: scale(0.99);
}

.fc-subject-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pink);
}

.fc-subject-subtitle {
  font-size: 0.85rem;
  color: var(--text-2);
}

/* Deck-size picker — shorter rows with a big number on the left. */
.fc-size-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1.5px solid var(--pink-soft);
  border-radius: var(--radius-card);
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.fc-size-card:hover,
.fc-size-card:focus-visible {
  background: var(--pink-pale);
  border-color: var(--pink);
  outline: none;
}

.fc-size-card:active {
  transform: scale(0.99);
}

.fc-size-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--pink);
  min-width: 2.5rem;
  text-align: center;
}

.fc-size-label {
  font-size: 1rem;
  color: var(--text-1);
}

/* Progress label above the card */
.fc-progress {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  margin: 0;
}

/* The card itself */
.flashcard {
  background: var(--bg-card);
  border: 1.5px solid var(--pink-soft);
  border-radius: var(--radius-card);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.flashcard-stem {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-1);
  margin: 0;
}

.flashcard-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Single option row — tappable button. She picks her guess BEFORE
   tapping "Show answer." Picking states use the same pink the option-card
   uses in Practice mode (consistent design language). Reveal states use
   teal for correct, error-soft for her wrong pick. */
.flashcard-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem var(--space-md);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.flashcard-option:hover,
.flashcard-option:focus-visible {
  background: var(--pink-pale);
  border-color: var(--pink-soft);
  outline: none;
}

.flashcard-option:active {
  transform: scale(0.99);
}

/* Her pick (before reveal). Matches the option-card aria-pressed treatment. */
.flashcard-option.is-picked {
  background: var(--pink-pale);
  border-color: var(--pink);
}

.flashcard-option.is-picked .option-letter {
  background: var(--pink);
  color: #FFFFFF;
  border-color: var(--pink);
}

/* The reveal: correct option(s) in teal. */
.flashcard-option.is-correct {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.flashcard-option.is-correct .option-letter {
  background: var(--teal);
  color: #FFFFFF;
  border-color: var(--teal);
}

/* The reveal: she picked this one, but it was wrong. Gentle error tint. */
.flashcard-option.is-incorrect-pick {
  background: var(--error-soft);
  border-color: var(--error);
}

.flashcard-option.is-incorrect-pick .option-letter {
  background: var(--error);
  color: #FFFFFF;
  border-color: var(--error);
}

/* Once an answer is revealed, the buttons should look final, not hover-y. */
.flashcard-option.is-correct,
.flashcard-option.is-incorrect-pick {
  cursor: default;
}

.flashcard-option.is-correct:hover,
.flashcard-option.is-incorrect-pick:hover {
  /* keep the reveal colors locked in; ignore hover */
  transform: none;
}

/* End-screen actions */
.fc-end-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .story-card { padding: 1rem var(--space-sm); }
  .story-hero-title { font-size: 1.5rem; }
  .story-body p { font-size: 0.98rem; }
  .story-question-link { padding: 0.75rem 0.85rem; }

  .fc-step-title { font-size: 1.4rem; }
  .flashcard { padding: var(--space-md) var(--space-sm); }
  .flashcard-stem { font-size: 1.02rem; }
  .flashcard-option { padding: 0.7rem var(--space-sm); font-size: 0.92rem; }
  .fc-size-number { font-size: 1.7rem; }
  .fc-subject-title { font-size: 1.05rem; }
}

/* ============================================================
   Practice "Next question →" footer row
   ============================================================ */

.practice-next-row {
  display: flex;
  justify-content: center;
  padding: var(--space-lg) 0 var(--space-xl);
  margin-top: var(--space-md);
  border-top: 1px solid var(--border);
}

/* ============================================================
   Responsive — tablet (≥ 640px) and desktop (≥ 1024px)
   ============================================================ */

@media (min-width: 640px) {
  body {
    padding: 0 1.5rem var(--space-xl);
  }
  .question-stem  { font-size: 1.15rem; }
  .practice-filters { flex-wrap: wrap; }
}

@media (min-width: 1024px) {
  body {
    padding: 0 2rem var(--space-xl);
  }
  .question-stem  { font-size: 1.2rem; padding: 1.75rem 1.75rem; }
}

/* Mobile (≤ 640px) — filter chips scroll horizontally per design system
   ("Filter pills: horizontal scroll row, no wrapping" on mobile). */
@media (max-width: 640px) {
  .practice-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Edge-bleed so chips can scroll without crowding body padding */
    margin-left: calc(var(--space-sm) * -1);
    margin-right: calc(var(--space-sm) * -1);
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
  .practice-filters::-webkit-scrollbar {
    display: none;
  }
}

/* ============================================================
   Mobile tuning (≤ 480px) — phone-first refinements
   ============================================================ */

@media (max-width: 480px) {
  body { padding: 0 var(--space-sm); }

  .greeting {
    padding: 2rem var(--space-sm) 1.25rem;
  }

  .greeting h1 {
    font-size: 1.6rem;
  }

  .subject-progress-row {
    flex-wrap: wrap;
  }

  .progress-label {
    font-size: 0.75rem;
  }

  .practice-subject-subtitle {
    display: none;
  }

  .practice-header {
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
  }

  .practice-subject {
    font-size: 0.95rem;
  }

  .back-link {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
  }

  .question-stem {
    font-size: 1.05rem;
    line-height: 1.5;
    padding: 1.25rem var(--space-sm);
    border-radius: var(--radius-card);
  }

  .option-card {
    padding: 0.85rem var(--space-sm);
    gap: 0.75rem;
  }

  .option-letter {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }

  .option-text {
    font-size: 0.95rem;
  }

  .filter-chip {
    min-height: 36px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
  }

  .walkthrough-step {
    padding: var(--space-md) var(--space-sm);
  }

  .second-guessing {
    padding: var(--space-md) var(--space-sm);
  }

  .intro-section {
    padding: var(--space-md) var(--space-sm);
  }

  .intro-hero {
    padding: var(--space-sm) 0 0;
  }

  .intro-title {
    font-size: 1.6rem;
  }

  .level-up-card {
    padding: var(--space-lg) var(--space-md) var(--space-md);
  }

  .level-up-confetti {
    font-size: 1.8rem;
    letter-spacing: 0.3rem;
    margin-bottom: var(--space-sm);
  }

  .level-up-heading {
    font-size: 1.4rem;
  }

  .level-up-praise {
    font-size: 1rem;
  }

  .day-streak {
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .greeting h1 { font-size: 1.4rem; }
  .question-stem { font-size: 1rem; }
  .filter-chip { font-size: 0.72rem; padding: 0.35rem 0.65rem; }
  .practice-subject { font-size: 0.85rem; }
}
