/* ──────────────────────────────────────────────
   theupscale.app — Design System ("Clay")
   Light only. Deep-navy ink, indigo primary, one pastel hue per study
   method, plush rounded surfaces, 3D clay icons as the visual device.
────────────────────────────────────────────── */

/* Nunito, variable weight 200–1000, latin subset, self-hosted. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito/nunito-variable.acfce21e9f6e.woff2") format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/nunito/nunito-italic-variable.6842266a3708.woff2") format('woff2');
}

/* ── Tokens ──
   Rules: text is --ink*, fills are --primary or a method --hue, tints are
   the only coloured surfaces, and --xp/--right/--wrong/--pro are the four
   semantic accents. Components read a method's colour through the four
   scoped variables set by [data-method="<slug>"]. */
:root {
  /* Surfaces */
  /* Lavender, matching the landing deck's resting tint — the app read as grey
     and flat next to it. Surfaces stay white so cards lift off the page. */
  --bg-base:        #EDEBFF;
  --bg-surface:     #FFFFFF;
  --bg-raised:      #FFFFFF;
  --bg-card:        var(--bg-surface);
  --bg-card-hover:  #FFFFFF;
  --bg-soft:        #EEEDF6;
  --border-subtle:  rgba(30, 27, 75, 0.08);
  --border-rule:    rgba(30, 27, 75, 0.14);
  --border-active:  rgba(79, 70, 229, 0.45);
  --glass:          rgba(255, 255, 255, 0.72);
  --glass-strong:   rgba(255, 255, 255, 0.88);

  /* Ink */
  --ink:            #1E1B4B;
  --ink-2:          #4B4A6A;
  --ink-3:          #7A7A94;
  --text-primary:   var(--ink);
  --text-secondary: var(--ink-2);
  --text-muted:     var(--ink-3);
  --text-accent:    var(--primary-text);

  /* Primary — indigo */
  --primary:        #4F46E5;
  --primary-hover:  #4338CA;
  --primary-text:   #4338CA;
  --primary-soft:   #E9E7FF;
  --primary-soft-2: #F3F1FF;
  --primary-rgb:    79, 70, 229;
  --on-primary:     #FFFFFF;
  --accent:         var(--primary);
  --accent-hover:   var(--primary-hover);
  --accent-text:    var(--primary-text);
  --accent-rgb:     var(--primary-rgb);
  --accent-dim:     var(--primary-soft);

  /* Semantic accents */
  --xp:             #F59E0B;  --xp-soft:    #FEF3C7;  --xp-text:    #B45309;
  --right:          #10B981;  --right-soft: #D1FAE5;  --right-text: #047857;
  --wrong:          #EC4899;  --wrong-soft: #FCE7F3;  --wrong-text: #BE185D;
  --pro:            #F97316;  --pro-soft:   #FFEDD5;
  --success:        var(--right);
  --warning:        var(--xp);
  --danger:         var(--wrong);
  --success-rgb:    16, 185, 129;
  --warning-rgb:    245, 158, 11;
  --danger-rgb:     236, 72, 153;

  /* Method hues: strong / tint pair / text-safe */
  --m-story-mode:          #4F46E5; --m-story-mode-tint:     #EDEBFF; --m-story-mode-tint2:     #F7F5FF; --m-story-mode-text:     #4338CA; --m-story-mode-rgb:     79, 70, 229;
  --m-flashcard-duel:      #F59E0B; --m-flashcard-duel-tint: #FFF6D6; --m-flashcard-duel-tint2: #FFFBEA; --m-flashcard-duel-text: #B45309; --m-flashcard-duel-rgb: 245, 158, 11;
  --m-knock-knock:         #14B8A6; --m-knock-knock-tint:    #DDF7F0; --m-knock-knock-tint2:    #F0FBF7; --m-knock-knock-text:    #0F766E; --m-knock-knock-rgb:    20, 184, 166;
  --m-map-master:          #3B82F6; --m-map-master-tint:     #DCEBFF; --m-map-master-tint2:     #EFF6FF; --m-map-master-text:     #1D4ED8; --m-map-master-rgb:     59, 130, 246;
  --m-three-truths:        #EC4899; --m-three-truths-tint:   #FFE4EF; --m-three-truths-tint2:   #FFF1F6; --m-three-truths-text:   #BE185D; --m-three-truths-rgb:   236, 72, 153;
  --m-match-maker:         #EF4444; --m-match-maker-tint:    #FFE8DC; --m-match-maker-tint2:    #FFF4EE; --m-match-maker-text:    #B91C1C; --m-match-maker-rgb:    239, 68, 68;
  --m-crossword:           #7C3AED; --m-crossword-tint:      #EDE9FE; --m-crossword-tint2:      #F5F3FF; --m-crossword-text:      #6D28D9; --m-crossword-rgb:      124, 58, 237;

  /* Default scoped hue (indigo) so components outside a method still work */
  --hue:            var(--primary);
  --tint:           var(--primary-soft);
  --tint-2:         var(--primary-soft-2);
  --hue-text:       var(--primary-text);
  --hue-rgb:        var(--primary-rgb);

  /* Type */
  --font-display:   'Nunito', system-ui, -apple-system, sans-serif;
  --font-body:      'Nunito', system-ui, -apple-system, sans-serif;
  --font-serif:     'Nunito', system-ui, sans-serif;
  --fs-display:     44px;
  --fs-h1:          34px;
  --fs-h2:          26px;
  --fs-h3:          20px;
  --fs-body-lg:     16.5px;
  --fs-body:        15px;
  --fs-small:       13px;
  --fs-micro:       11.5px;

  /* Shape */
  --radius-sm:      12px;
  --radius-md:      16px;
  --radius-lg:      20px;
  --radius-xl:      24px;
  --radius-2xl:     28px;
  --radius-full:    9999px;
  --r-sm: var(--radius-sm); --r-md: var(--radius-md); --r-lg: var(--radius-lg); --r-xl: var(--radius-xl); --r-pill: var(--radius-full);

  /* Elevation — layered, with an inset top highlight for the plush look */
  --shadow-soft:        0 2px 6px rgba(30, 27, 75, 0.06);
  --shadow-card:        0 1px 2px rgba(30, 27, 75, 0.05), 0 12px 30px -12px rgba(30, 27, 75, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --shadow-card-hover:  0 2px 4px rgba(30, 27, 75, 0.06), 0 24px 48px -16px rgba(30, 27, 75, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-float:       0 14px 40px -14px rgba(30, 27, 75, 0.28), 0 2px 8px rgba(30, 27, 75, 0.06);
  --shadow-btn:         0 10px 24px -10px rgba(79, 70, 229, 0.6), 0 2px 4px rgba(79, 70, 229, 0.18);
  --shadow-modal:       0 32px 80px -20px rgba(30, 27, 75, 0.35), 0 4px 12px rgba(30, 27, 75, 0.08);
  --shadow-glow-indigo: 0 0 0 3px var(--primary-soft);

  /* Motion */
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
  --ease-bounce:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring:    cubic-bezier(0.22, 1.25, 0.36, 1);
  --dur-fast:       150ms;
  --dur-base:       220ms;
  --dur-slow:       480ms;
  --transition-fast:  var(--dur-fast) ease;
  --transition-base:  var(--dur-base) ease;
  --transition-slow:  var(--dur-slow) var(--ease-out);

  /* Chrome */
  --overlay-rgb:    30, 27, 75;
  --navbar-bg:      var(--glass);
  --nav-panel-bg:   #FFFFFF;
  --scrim-bg:       rgba(30, 27, 75, 0.45);
  --legal-text:     var(--ink-2);
  --glass-bg:       #FFFFFF;
  --glass-bg-hover: #FFFFFF;

  /* Legacy aliases — remapped onto the new roles so un-migrated pages keep
     resolving. Delete this block once every page is on the Clay kit. */
  --indigo:         var(--primary);
  --indigo-light:   var(--primary-text);
  --indigo-dark:    var(--primary-hover);
  --indigo-rgb:     var(--primary-rgb);
  --purple:         var(--m-crossword);
  --purple-light:   var(--m-crossword-text);
  --purple-rgb:     var(--m-crossword-rgb);
  --gold:           var(--xp);
  --gold-light:     var(--xp-text);
  --gold-rgb:       var(--warning-rgb);
  --amber:          var(--xp);
  --amber-light:    var(--xp-text);
  --amber-rgb:      var(--warning-rgb);
  --emerald:        var(--right);
  --emerald-light:  var(--right-text);
  --emerald-rgb:    var(--success-rgb);
  --rose:           var(--wrong);
  --rose-light:     var(--wrong-text);
  --rose-rgb:       var(--danger-rgb);
  --game-story:     var(--m-story-mode);      --game-story-rgb:  var(--m-story-mode-rgb);
  --game-quiz:      var(--m-knock-knock);     --game-quiz-rgb:   var(--m-knock-knock-rgb);
  --game-map:       var(--m-map-master);      --game-map-rgb:    var(--m-map-master-rgb);
  --game-match:     var(--m-match-maker);     --game-match-rgb:  var(--m-match-maker-rgb);
  --game-cards:     var(--m-flashcard-duel);  --game-cards-rgb:  var(--m-flashcard-duel-rgb);
  --game-truths:    var(--m-three-truths);    --game-truths-rgb: var(--m-three-truths-rgb);
  --color-bolt:     var(--xp);
  --color-fire:     var(--pro);
  --color-map:      var(--m-map-master);
  --color-book:     var(--m-story-mode);
  --color-target:   var(--m-three-truths);
  --color-link:     var(--m-match-maker);
  --color-academic: var(--m-knock-knock);
}

/* ── Method scoping: put data-method="<slug>" on any element and every kit
   component inside it paints with that method's hue. ── */
[data-method="story-mode"]     { --hue: var(--m-story-mode);     --tint: var(--m-story-mode-tint);     --tint-2: var(--m-story-mode-tint2);     --hue-text: var(--m-story-mode-text);     --hue-rgb: var(--m-story-mode-rgb); }
[data-method="flashcard-duel"] { --hue: var(--m-flashcard-duel); --tint: var(--m-flashcard-duel-tint); --tint-2: var(--m-flashcard-duel-tint2); --hue-text: var(--m-flashcard-duel-text); --hue-rgb: var(--m-flashcard-duel-rgb); }
[data-method="knock-knock"]    { --hue: var(--m-knock-knock);    --tint: var(--m-knock-knock-tint);    --tint-2: var(--m-knock-knock-tint2);    --hue-text: var(--m-knock-knock-text);    --hue-rgb: var(--m-knock-knock-rgb); }
[data-method="map-master"]     { --hue: var(--m-map-master);     --tint: var(--m-map-master-tint);     --tint-2: var(--m-map-master-tint2);     --hue-text: var(--m-map-master-text);     --hue-rgb: var(--m-map-master-rgb); }
[data-method="three-truths"]   { --hue: var(--m-three-truths);   --tint: var(--m-three-truths-tint);   --tint-2: var(--m-three-truths-tint2);   --hue-text: var(--m-three-truths-text);   --hue-rgb: var(--m-three-truths-rgb); }
[data-method="match-maker"]    { --hue: var(--m-match-maker);    --tint: var(--m-match-maker-tint);    --tint-2: var(--m-match-maker-tint2);    --hue-text: var(--m-match-maker-text);    --hue-rgb: var(--m-match-maker-rgb); }
[data-method="crossword"]      { --hue: var(--m-crossword);      --tint: var(--m-crossword-tint);      --tint-2: var(--m-crossword-tint2);      --hue-text: var(--m-crossword-text);      --hue-rgb: var(--m-crossword-rgb); }

/* Surface tints that used to need a stronger floor in light mode. */
.form-input,
.exam-card-inner,
.prep-card-inner,
.subject-chip-inner {
  background: rgba(var(--overlay-rgb), 0.045);
}
.xp-bar-track {
  background: rgba(var(--overlay-rgb), 0.1);
}

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

::selection {
  background: rgba(var(--accent-rgb), 0.35);
  color: var(--text-primary);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 8-step type scale (display/h1/h2/h3/body-lg/body/small/micro). Every
   h1/h2/h3 in the app today already sets its own font-size via a class
   (.auth-heading, .hero-title, .legal-page h1/h2) or inline style, so
   these defaults only affect a BARE <h1>/<h2>/<h3> — there are none in
   current templates, but this keeps the tag itself from silently
   rendering at the browser's unstyled 2em/1.5em/1.17em if one is ever
   added without a class. */
h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.20;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

a { color: var(--text-accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* ──────────────────────────────────────────────
   EDITORIAL PRIMITIVES
────────────────────────────────────────────── */

/* Tracked uppercase label — replaces emoji-prefixed section titles */
.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Thin horizontal rule */
.rule {
  border: none;
  border-top: 1px solid var(--border-rule);
}

/* Newspaper-style thick/thin section divider, sits above a heading */
.editorial-divider {
  border: none;
  border-top: 3px solid var(--text-primary);
  margin-bottom: 3px;
}
.editorial-divider + .rule {
  margin-bottom: 14px;
}

/* Oversized numeral used for stats / pull quotes */
.pull-number {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
}

/* Icon sizing — paired with templates/partials/icons.svg <use> references */
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 26px; height: 26px; }
.icon-xl { width: 36px; height: 36px; }

/* ──────────────────────────────────────────────
   BACKGROUND
   One fixed, static vignette per theme. The floating orbs, particle
   canvas, dot grid and paper light-sweep are gone: depth now comes from
   surface steps and shadows, not from an animated backdrop.
────────────────────────────────────────────── */
.page-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(var(--accent-rgb), 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(0, 0, 0, 0.35) 0%, transparent 70%);
}
.page-vignette {
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(255, 255, 255, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(var(--accent-rgb), 0.05) 0%, transparent 70%);
}
/* Old background layers, kept inert in case a template still emits them. */
.bg-animation, .bg-orb-3, .bg-grid, .paper-sheen-global, #particles-canvas { display: none !important; }

/* ──────────────────────────────────────────────
   LAYOUT
────────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ──────────────────────────────────────────────
   NAVBAR
────────────────────────────────────────────── */
/* Same floating glass pill as the landing topbar (.topbar / .topbar-inner).
   Its container is 48px wider than the default so the pill lines up with the
   1200px dashboard content; the footer pill below does the same. */
.navbar .container,
.site-footer .container { max-width: 1248px; }
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 14px;
  border-radius: 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  text-decoration: none;
  padding-bottom: 2px;
}

/* ── Flat mark — replaces 3D bevel button ── */
.logo-home-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-rule);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.logo:hover .logo-home-btn { border-color: var(--accent); color: var(--text-accent); }

/* ── Pure SVG Logo — all composition inside SVG, no web font needed ── */
.logo-svg {
  height: 38px;
  width: auto;
  display: block;
  overflow: visible;
  flex-shrink: 0;
}

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* Theme toggle — always visible in navbar and landing masthead */
.theme-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-rule);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.theme-nav-btn:hover { border-color: var(--accent); color: var(--text-accent); }

/* ──────────────────────────────────────────────
   CARD
────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base), box-shadow var(--transition-base),
              border-color var(--transition-base), background var(--transition-base);
}
.glass-card:hover {
  background: var(--bg-raised);
  border-color: var(--border-rule);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

/* ──────────────────────────────────────────────
   BUTTONS
────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1px;
  cursor: pointer;
  border: none;
  transition: background var(--transition-base), border-color var(--transition-base),
              color var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-card);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-card); }

/* .btn-gold is a legacy name (Unlock Pro). An upgrade is a primary action,
   so it renders exactly like .btn-primary. */
.btn-gold { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-card); }
.btn-gold:hover { background: var(--primary-hover); color: var(--on-primary); box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-rule);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* No fill, no border — text-only action, underline on hover */
.btn-text {
  background: transparent;
  color: var(--text-accent);
  padding: 0;
  border-radius: 0;
}
.btn-text:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }

/* Loading state */
.btn.loading {
  pointer-events: none;
  opacity: 0.75;
}

/* ──────────────────────────────────────────────
   FORM INPUTS
────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(var(--overlay-rgb), 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(var(--overlay-rgb), 0.05);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input.error {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(var(--danger-rgb), 0.16);
}

/* Select override */
select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A5754' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

select.form-input option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.form-error {
  font-size: 12px;
  color: var(--rose);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Password strength indicator */
.password-match {
  font-size: 12px;
  margin-top: 6px;
  transition: color var(--transition-fast);
}
.password-match.ok   { color: var(--emerald); }
.password-match.fail { color: var(--rose); }

/* Checkbox */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────
   MESSAGES (Toast notifications)
────────────────────────────────────────────── */
.messages-container {
  position: fixed;
  top: 80px;
  right: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  margin-left: auto;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.toast .icon { color: currentColor; }

.toast-success { border-color: rgba(var(--success-rgb), 0.4); color: var(--success); }
.toast-error   { border-color: rgba(var(--danger-rgb), 0.4);  color: var(--danger); }
.toast-info    { border-color: rgba(var(--accent-rgb), 0.35); color: var(--text-accent); }
.toast-warning { border-color: rgba(var(--warning-rgb), 0.4); color: var(--warning); }

.toast { box-shadow: 0 6px 20px rgba(28,23,14,0.14); }

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

/* ──────────────────────────────────────────────
   AUTH PAGES (Login / Register)
────────────────────────────────────────────── */
.auth-page {
  /* the floating header and the footer share the screen with the card */
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: clamp(28px, 5vw, 44px) clamp(20px, 5vw, 40px);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.auth-heading {
  font-size: 26px;
  margin-bottom: 8px;
}

.auth-subheading {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-divider-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--text-accent);
  font-weight: 500;
}

.auth-footer a:hover { color: var(--accent-hover); }

/* ──────────────────────────────────────────────
   ONBOARDING
────────────────────────────────────────────── */
.onboarding-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.onboarding-card {
  width: 100%;
  max-width: 560px;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 44px);
}

/* Progress steps */
.steps-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  transition: all var(--transition-slow);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-circle.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-accent);
}

.step-circle.done {
  border-color: var(--emerald);
  background: rgba(47, 125, 79, 0.15);
  color: var(--emerald-light);
}

.step-label {
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
  color: var(--text-muted);
  white-space: nowrap;
}

.step-label.active  { color: var(--text-accent); }
.step-label.done    { color: var(--emerald-light); }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  margin: 0 8px;
  transition: background var(--transition-slow);
}
.step-connector.done { background: var(--emerald); }

.onboarding-heading {
  font-size: 24px;
  margin-bottom: 8px;
}

.onboarding-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Exam radio cards */
.exam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.exam-card {
  position: relative;
  cursor: pointer;
}

.exam-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.exam-card-inner {
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(var(--overlay-rgb), 0.025);
  transition: all var(--transition-base);
  text-align: center;
}

.exam-card input[type="radio"]:checked + .exam-card-inner {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.exam-card-inner:hover {
  border-color: var(--text-muted);
}

.exam-card-icon { color: var(--text-secondary); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; }
.exam-card-name { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.exam-card-desc { font-size: 11px; color: var(--text-muted); }

/* Prep level cards */
.prep-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.prep-card {
  position: relative;
  cursor: pointer;
}

.prep-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.prep-card-inner {
  padding: 20px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(var(--overlay-rgb), 0.025);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 16px;
}

.prep-card input[type="radio"]:checked + .prep-card-inner {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.prep-card-inner:hover {
  border-color: var(--text-muted);
}

.prep-icon { color: var(--text-secondary); flex-shrink: 0; display: flex; align-items: center; }

.prep-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.prep-info p  { font-size: 12px; color: var(--text-muted); }

/* Subject chips */
.subjects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.subject-chip {
  position: relative;
  cursor: pointer;
}

.subject-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.subject-chip-inner {
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(var(--overlay-rgb), 0.025);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 6px;
}

.subject-chip input[type="checkbox"]:checked + .subject-chip-inner {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-accent);
}

.subject-chip-inner:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Avatar upload */
.avatar-upload-area {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1.5px dashed var(--border-rule);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-base);
  cursor: pointer;
}

.avatar-upload-area:hover { border-color: var(--accent); }

.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.avatar-upload-text p  { font-size: 12px; color: var(--text-muted); }

input[type="file"].avatar-upload { display: none; }

/* Onboarding nav */
.onboarding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ──────────────────────────────────────────────
   DASHBOARD
────────────────────────────────────────────── */
.dashboard-page {
  padding: 32px 0 60px;
}

/* Greeting section */
.greeting-section {
  margin-bottom: 36px;
}

.greeting-text {
  font-size: 28px;
  margin-bottom: 4px;
}

.greeting-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* Stats row */
/* ── Dashboard: progress panel + section links (Clay pass) ──
   The old six-up .stats-row mixed three statistics with three navigation
   cards. Stats now sit with the XP bar they describe; the destinations are
   their own row below. .stats-row/.stat-card remain for other pages. */
.dash-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px; align-items: center;
  padding: 22px 26px;
  margin-bottom: 16px;
}
.dash-progress-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.dash-stat { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.dash-stat .clay { flex: 0 0 auto; }
.dash-stat-value { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--ink); line-height: 1.15; }
.dash-stat-label { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.dash-stat-link { border-radius: var(--radius-md); transition: transform var(--transition-base); }
.dash-stat-link:hover { transform: translateY(-2px); }
.dash-progress-head, .dash-progress-foot { display: flex; justify-content: space-between; align-items: baseline; }
.dash-progress-title { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--ink); }
.dash-progress-num { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dash-progress-head { margin-bottom: 8px; }
.dash-progress-foot { margin-top: 7px; font-size: 11px; color: var(--ink-3); }

.dash-links {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-bottom: 36px;
}
.dash-link {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 16px 18px; text-decoration: none; color: inherit;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.dash-link .clay { margin-bottom: 6px; transition: transform var(--transition-base); }
.dash-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.dash-link:hover .clay { transform: scale(1.08) rotate(-4deg); }
.dash-link-name { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--ink); }
.dash-link-sub { font-size: 12px; color: var(--ink-3); }
.dash-link.is-locked { opacity: 0.55; cursor: not-allowed; }
.dash-link.is-locked:hover { transform: none; box-shadow: var(--shadow-card); }

@media (max-width: 900px) {
  .dash-progress { grid-template-columns: 1fr; gap: 18px; }
  .dash-progress-stats { justify-content: space-between; gap: 14px; }
  .dash-links { grid-template-columns: 1fr; }
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 14px 12px 12px;
  border-top: 1px solid var(--border-rule);
  position: relative;
}

.stat-card.locked {
  cursor: not-allowed;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.stat-card.locked:hover .game-lock-overlay { opacity: 1; }

/* Stat tiles are monochrome: the value is ink and the icon is secondary.
   Navigational tiles colour only their title, via --text-accent inline. */
.stat-card::before { content: none; }
.stat-card .stat-icon  { color: var(--text-secondary); }
.stat-card .stat-value { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.stat-icon {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* XP Bar */
.xp-section {
  margin-bottom: 40px;
}

.xp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.xp-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: var(--font-body);
  border: 1px solid var(--border-rule);
  color: var(--text-secondary);
}

.level-badge.indigo, .level-badge.emerald, .level-badge.gold,
.level-badge.purple, .level-badge.rose {
  background: var(--accent-dim); color: var(--accent-text); border-color: rgba(var(--accent-rgb), 0.3);
}

.xp-numbers {
  font-size: 13px;
  color: var(--text-muted);
}

.xp-bar-track {
  height: 6px;
  background: rgba(var(--overlay-rgb), 0.07);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 1.3s var(--ease-out);
  position: relative;
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--border-rule);
}

.section-title-icon.indigo, .section-title-icon.gold, .section-title-icon.emerald {
  background: var(--accent-dim); color: var(--accent-text); border-color: rgba(var(--accent-rgb), 0.3);
}

/* Game cards grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.game-card {
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base),
              border-color var(--transition-base), background var(--transition-base);
  cursor: default;
}

.game-card:not(.locked):hover { transform: translateY(-3px); }

/* Each method card now carries its own hue, as on the landing deck: a soft
   tint wash so the six read as a colourful set rather than six grey boxes,
   with the name and count in the method's deeper text shade. data-method is
   already on the card, so --tint/--hue resolve per method with no extra work. */
.game-card[data-method] {
  background: linear-gradient(160deg, var(--tint-2, #fff) 0%, var(--tint, #fff) 100%);
  border-color: rgba(var(--hue-rgb, 79, 70, 229), 0.18);
}
.game-card[data-method] .game-name { color: var(--hue-text, var(--ink)); }
.game-card[data-method] .game-count-badge {
  background: rgba(var(--hue-rgb, 79, 70, 229), 0.14);
  color: var(--hue-text, var(--ink-2));
}
.game-card:not(.locked):hover {
  border-color: rgba(var(--hue-rgb, var(--accent-rgb)), 0.45);
  box-shadow: var(--shadow-card-hover);
}
/* the Open button picks up the method's hue too */
.game-card[data-method] .game-play-btn {
  background: var(--hue, var(--primary));
  border-color: transparent;
  color: #fff;
}

.game-card.locked { cursor: not-allowed; }
.game-card-bg-glow { display: none; }

/* ── Game card header: icon + name side by side ── */
.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.game-card-header .game-icon-wrap { margin-bottom: 0; }
.game-card-header .game-name      { margin-bottom: 0; }

.game-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--scrim-bg);
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 2;
}

.game-card:hover .game-lock-overlay { opacity: 1; }

.game-lock-overlay svg {
  width: 22px; height: 22px;
  color: var(--text-secondary);
}

.game-lock-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.game-icon-wrap {
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.game-icon-wrap .icon-lg { width: 30px; height: 30px; }

/* Method card art: the clay icon for the method, sitting in the card's bottom
   right. Replaces the greyscale photo thumbnails (and ~75 lines of mask-composite
   fade) that the Clay pass retired — the icons are already per-method, so the
   card no longer hardcodes an image per slug. */
.game-card-art {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 72px;
  height: 72px;
  pointer-events: none;
  opacity: 0.92;
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.game-card-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.game-card:not(.locked):hover .game-card-art { transform: translateY(-3px) scale(1.06) rotate(-3deg); opacity: 1; }
.game-card.locked .game-card-art { opacity: 0.38; filter: grayscale(0.7); }

.game-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  font-family: var(--font-body);
  color: var(--text-primary);  /* force white even inside <a> cards */
}

.game-desc {
  font-size: 12px;
  line-height: 1.5;
}

/* Plain italic — the marker-highlight band was dropped: with the muted game
   accents it read as a stray underline rather than a highlighter, and it
   competed with the card's own tint. */
.game-desc span {
  font-style: italic;
  color: var(--text-secondary);
}


/* Light mode: 0.20 is nearly invisible on a light card — bump strength. */

/* Play Now pill — colour matched to the card's tint */
.game-play-btn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--border-rule);
  color: var(--text-secondary);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.game-play-btn { color: var(--accent-text); border-color: rgba(var(--accent-rgb), 0.4); }
.game-card:not(.locked):hover .game-play-btn { background: var(--accent-dim); }

/* Category-count label — subtle text next to the game name, no pill/border,
   tinted with the card's accent colour at reduced opacity */
.game-count-badge {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  opacity: 0.35;
  white-space: nowrap;
}

.game-count-badge { color: var(--text-muted); opacity: 1; }

.game-coming-badge {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-rule);
}

/* Dashboard two-column layout */
.dashboard-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-bottom: 40px;
}

/* Announcement category pill + CTA link */
.an-cat-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--text-accent);
}

/* Outline pill, not a filled gradient — a filled button gets *lighter* on
   hover to show interactivity, which washes out white text at the exact
   moment someone's looking at it. An outline only changes a subtle
   background wash on hover, so the colored text stays readable throughout.
   Same treatment as the game cards' own .game-play-btn. */
.an-dash-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: transparent;
  border: 1.5px solid var(--border-rule);
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

/* One accent for every method link. */
.an-cta-indigo, .an-cta-gold, .an-cta-emerald, .an-cta-purple, .an-cta-rose, .an-cta-amber, .an-cta-blue {
  color: var(--accent-text); border-color: rgba(var(--accent-rgb), 0.4);
}
.an-cta-indigo:hover, .an-cta-gold:hover, .an-cta-emerald:hover, .an-cta-purple:hover, .an-cta-rose:hover, .an-cta-amber:hover, .an-cta-blue:hover {
  background: var(--accent-dim);
}

.an-cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Sanitized rich-text announcement body — headings, lists, links, blockquote,
   code, table, hr. Mirrors story_mode's .sm-story-text prose styling (same
   sanitizer allowlist, same "make plain HTML look themed" need) since
   dashboard pages don't load story_mode's stylesheet. */
.an-rich-body > *:first-child { margin-top: 0; }
.an-rich-body > *:last-child { margin-bottom: 0; }

.an-rich-body p { margin: 0 0 14px; }

.an-rich-body h1, .an-rich-body h2, .an-rich-body h3, .an-rich-body h4 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin: 22px 0 10px;
}
.an-rich-body h1 { font-size: 22px; }
.an-rich-body h2 { font-size: 19px; }
.an-rich-body h3 { font-size: 16px; }
.an-rich-body h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }

.an-rich-body ul, .an-rich-body ol { margin: 0 0 14px; padding-left: 24px; }
.an-rich-body ul { list-style: disc; }
.an-rich-body ol { list-style: decimal; }
.an-rich-body li { margin: 6px 0; }
.an-rich-body li::marker { color: var(--text-accent); }

.an-rich-body a { color: var(--text-accent); text-decoration: underline; text-underline-offset: 2px; }
.an-rich-body strong, .an-rich-body b { color: var(--text-primary); font-weight: 700; }
.an-rich-body em, .an-rich-body i { font-style: italic; }
.an-rich-body u { text-decoration: underline; text-underline-offset: 2px; }
.an-rich-body s, .an-rich-body strike { text-decoration: line-through; }

.an-rich-body img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  margin: 8px 0 16px;
  display: block;
}

.an-rich-body blockquote {
  margin: 0 0 14px;
  padding: 8px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}

.an-rich-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}
.an-rich-body pre {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow-x: auto;
}
.an-rich-body pre code { background: none; padding: 0; }

.an-rich-body hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 20px 0; }

.an-rich-body table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
.an-rich-body th, .an-rich-body td {
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  background: transparent;
}
.an-rich-body th, .an-rich-body thead td {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-primary);
  font-weight: 600;
}
.an-rich-body th,
.an-rich-body thead td {
  background: rgba(28, 23, 14, 0.06);
}
@media (max-width: 640px) {
  .an-rich-body table { display: block; overflow-x: auto; }
}

/* Empty states */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon { margin-bottom: 12px; opacity: 0.6; display: flex; align-items: center; justify-content: center; }
.empty-state-text { font-size: 14px; line-height: 1.6; }

/* Streak widget */
.streak-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.streak-flame { color: var(--color-fire); transition: transform var(--transition-fast); }
.streak-flame.hot { color: var(--color-fire); animation: flamePulse 1.4s ease-in-out infinite; }
@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.14); }
}

.streak-count {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.streak-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Goals widget */
.goals-widget { padding: 24px; }
.goals-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.goals-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 20px 0; }

/* User avatar in navbar */
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid var(--border-rule);
  transition: border-color var(--transition-fast);
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb),0.25); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info { text-align: right; }
.user-name  { font-size: 14px; font-weight: 600; }
.user-plan  {
  font-size: 11px;
  color: var(--accent-text);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.user-plan.free { color: var(--text-muted); }

/* ──────────────────────────────────────────────
   MOBILE NAVBAR
────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--bg-soft);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.hamburger:hover { background: var(--bg-card); }
.hamburger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-base);
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
}

.mobile-nav-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(300px, 85vw);
  height: 100%;
  background: var(--nav-panel-bg);
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 8px;
  overflow-y: auto;
}

.mobile-nav.open { display: block; }
.mobile-nav.open .mobile-nav-backdrop { opacity: 1; }
.mobile-nav.open .mobile-nav-panel { transform: translateX(0); }

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-nav-close {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.mobile-nav-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.mobile-nav-link .nav-icon { width: 22px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }

.mobile-nav-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ──────────────────────────────────────────────
   RESPONSIVE — Tablet  ≤ 1024px
────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ──────────────────────────────────────────────
   RESPONSIVE — Small tablet / large phone  ≤ 900px
────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row      { grid-template-columns: repeat(3, 1fr); }
  .dashboard-body { grid-template-columns: 1fr; }
  .dashboard-sidebar { display: none; }
  .exam-grid      { grid-template-columns: 1fr 1fr; }

  /* Show hamburger, hide desktop nav actions */
  .hamburger    { display: flex; }
  .nav-actions  { display: none; }
}

/* ──────────────────────────────────────────────
   RESPONSIVE — Mobile  ≤ 640px
────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Safe edge padding on container */
  .container { padding: 0 12px; }

  /* Auth pages — card must breathe */
  .auth-page,
  .onboarding-page {
    padding: 20px 16px;
    align-items: flex-start;
    padding-top: 32px;
  }
  .auth-card,
  .onboarding-card {
    padding: 28px 20px;
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
  .auth-heading  { font-size: 22px; }
  .auth-subheading { font-size: 13px; }

  /* Social buttons stack on very small screens */
  .social-btns { flex-direction: column; gap: 8px; }

  /* Dashboard — use padding-top/bottom only; horizontal comes from .container */
  .dashboard-page { padding-top: 20px; padding-bottom: 48px; }
  .greeting-text  { font-size: 21px; }
  .greeting-date  { font-size: 12px; }

  /* Stats — 3 column compact (2 rows of 3) */
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .stat-card     { padding: 12px 10px; }
  .stat-value    { font-size: 18px; }
  .stat-icon     { margin-bottom: 8px; }

  /* XP section */
  .xp-section    { padding: 18px 16px !important; }
  .xp-header     { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Games — 2 columns on mobile */
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .game-card  { padding: 16px 14px; }
  .game-card-header .game-name { font-size: 13px; }
  .game-card-header { gap: 7px; margin-bottom: 8px; }
  .game-count-badge { font-size: 9.5px; }

  /* Onboarding */
  .onboarding-heading { font-size: 20px; }
  .onboarding-sub     { font-size: 13px; }
  .exam-grid          { grid-template-columns: 1fr 1fr; gap: 8px; }
  .exam-card-inner    { padding: 12px 8px; }
  .exam-card-name     { font-size: 12px; }
  .exam-card-desc     { font-size: 10px; }
  .prep-card-inner    { padding: 14px 16px; gap: 12px; }
  .onboarding-nav     { flex-direction: column-reverse; gap: 10px; }
  .onboarding-nav .btn { width: 100%; justify-content: center; }

  /* Step indicator — hide text labels */
  .step-label    { display: none; }
  .steps-indicator { margin-bottom: 28px; }

  /* Streak widget compact */
  .streak-widget { padding: 14px 16px; }
  .streak-count  { font-size: 27px; }
}

/* ──────────────────────────────────────────────
   RESPONSIVE — Small phone  ≤ 400px
────────────────────────────────────────────── */
@media (max-width: 400px) {
  .auth-card,
  .onboarding-card { padding: 24px 16px; }

  .exam-grid { grid-template-columns: 1fr; }

  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-card { padding: 10px 8px; }
  .stat-value { font-size: 15px; }
  .stat-label { font-size: 10px; }

  .section-title { font-size: 16px; }

  .games-grid { gap: 10px; }
  .game-card  { padding: 20px 16px; }

  .logo-svg { height: 28px; }
}

/* ──────────────────────────────────────────────
   UTILITIES
────────────────────────────────────────────── */
.text-indigo  { color: var(--text-accent); }
.text-gold    { color: var(--gold-light); }
.text-emerald { color: var(--emerald-light); }
.text-muted   { color: var(--text-muted); }

.mt-0  { margin-top: 0; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.d-flex         { display: flex; }
.align-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Fluent Emoji image icons ── */
.emoji-icon {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.emoji-icon-sm { width: 16px; height: 16px; display: inline-block; vertical-align: middle; }
.emoji-icon-lg { width: 30px; height: 30px; display: block; flex-shrink: 0; }
.emoji-icon-xl { width: 40px; height: 40px; display: block; flex-shrink: 0; }

/* ── Game table progress bars — animated fill on load ── */
.gt-bar-fill {
  animation: barSlide 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: left center;
}
@keyframes barSlide {
  from { transform: scaleX(0); opacity: 0.6; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* ── Footer ─────────────────────────────────────────────────── */
/* Same glass pill as the landing footer (.lp-footer-inner), in normal flow. */
.site-footer {
  margin-top: auto;
  padding: 24px 0 16px;
  position: relative;
  z-index: 10;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--ink-2); }
.footer-links {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--primary-text); }
.footer-link-btn {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.footer-link-btn:hover { color: var(--primary-text); }

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; border-radius: 20px; }
}

/* ── Legal pages ─────────────────────────────────────────────── */
.legal-page {
  max-width: 780px;
  margin: 48px auto 80px;
  padding: 0 20px;
}
.legal-page h1 {
  font-size: clamp(26px, 4vw, 38px);
  margin-bottom: 8px;
}
.legal-page .legal-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 40px;
}
.legal-page h2 {
  font-size: 19px;
  color: var(--text-primary);
  margin: 36px 0 12px;
}
.legal-page p, .legal-page li {
  font-size: 15px;
  color: var(--legal-text);
  line-height: 1.75;
}
.legal-page ul {
  padding-left: 20px;
  margin: 8px 0 16px;
}
.legal-page li { margin-bottom: 6px; }
.legal-page a { color: var(--text-accent); }
.legal-page a:hover { color: var(--accent-hover); }
.legal-table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
}
.legal-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--legal-text);
}
.legal-table th, .legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.6;
}
.legal-table th {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}
.legal-table code {
  font-size: 13px;
  color: var(--text-accent);
}
.legal-inline-link {
  font: inherit;
  font-size: 15px;
  color: var(--text-accent);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
.legal-inline-link:hover { color: var(--accent-hover); }

/* ── Cookie preferences dialog ───────────────────────────────── */
.cookie-dialog {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cookie-dialog[hidden] { display: none; }
.cookie-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.cookie-dialog-panel {
  position: relative;
  width: min(440px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--nav-panel-bg, var(--bg-card));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
}
.cookie-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cookie-dialog-header h2 {
  font-size: 18px;
  color: var(--text-primary);
}
.cookie-dialog-intro {
  font-size: 14px;
  color: var(--legal-text);
  line-height: 1.6;
  margin-bottom: 20px;
}
.cookie-dialog-intro a { color: var(--text-accent); }
.cookie-pref-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
}
.cookie-pref-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cookie-pref-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
.cookie-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.cookie-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border-subtle);
  border-radius: 999px;
  transition: background var(--transition-fast);
}
.cookie-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}
.cookie-toggle input:checked + .cookie-toggle-track { background: var(--accent); }
.cookie-toggle input:checked + .cookie-toggle-track .cookie-toggle-thumb { transform: translateX(18px); }
.cookie-toggle-locked input { cursor: not-allowed; }
.cookie-toggle-locked .cookie-toggle-track { opacity: 0.6; }
.cookie-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
@media (max-width: 480px) {
  .cookie-dialog-actions { flex-direction: column-reverse; }
  .cookie-dialog-actions .btn { width: 100%; }
}

/* ──────────────────────────────────────────────
   TEST SERIES
────────────────────────────────────────────── */

.ts-header {
  margin-bottom: 28px;
}
.ts-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ts-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}
.ts-cycle-range {
  font-size: 12px;
  color: var(--text-muted);
}
.ts-header-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 6px;
}

.ts-back-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 12px;
}
.ts-back-link:hover { color: var(--text-secondary); }

/* Landing-page grid — one card per TestSeries product */
.ts-series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.ts-series-card {
  padding: 22px;
  text-decoration: none;
  display: block;
  color: inherit;
}
.ts-series-card-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.ts-series-price-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ts-series-price-badge.free {
  background: rgba(var(--emerald-rgb), 0.16);
  color: var(--emerald);
  border: 1px solid rgba(var(--emerald-rgb), 0.35);
}
.ts-series-price-badge.paid {
  background: rgba(251, 191, 36, 0.16);
  color: var(--color-bolt);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.ts-series-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.ts-series-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.ts-series-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Series-wide progress bar — cloned from .xp-bar-track/.xp-bar-fill per the
   app's "clone under feature-specific class names" convention. */
.ts-series-bar-track {
  height: 8px;
  background: rgba(var(--overlay-rgb), 0.07);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.ts-series-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.ts-series-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,0.18) 50%, transparent 80%);
  display: none;
  border-radius: inherit;
}

/* Smaller per-test progress bar, same idiom, thinner track. */
.ts-milestone-progress-track {
  height: 5px;
  background: rgba(var(--overlay-rgb), 0.07);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 10px;
}
.ts-milestone-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.ts-milestone-progress-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Vertical milestone timeline */
.ts-timeline {
  position: relative;
}

.ts-timeline-item {
  position: relative;
  display: flex;
  gap: 18px;
  margin-bottom: 14px;
}
.ts-timeline-item::before {
  /* the connecting rail, drawn per-item so it only spans the item stack */
  content: '';
  position: absolute;
  left: 89px;
  top: 8px;
  bottom: -14px;
  width: 2px;
  background: var(--border-rule);
}
.ts-timeline-item:last-child::before { display: none; }

.ts-timeline-date-col {
  position: relative;
  flex: 0 0 80px;
  padding-top: 16px;
  text-align: right;
}
.ts-timeline-date-col::after {
  content: '';
  position: absolute;
  right: -13px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-rule);
  border: 2px solid var(--bg-base, #0a0a0b);
  z-index: 1;
}
.ts-timeline-item:has(.ts-milestone.unlocked) .ts-timeline-date-col::after,
.ts-timeline-item:has(.ts-milestone.in-progress) .ts-timeline-date-col::after,
.ts-timeline-item:has(.ts-milestone.complete) .ts-timeline-date-col::after { background: var(--accent-hover); }
.ts-timeline-item:has(.ts-milestone.complete) .ts-timeline-date-col::after { background: var(--success); }

.ts-timeline-date-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.ts-timeline-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ts-timeline-date-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Two tests sharing one unlock date (e.g. a GS Paper I + II pair) sit side
   by side under that one shared date rather than each repeating the date
   on its own timeline row — wraps to stacked on narrow screens. */
.ts-milestone-pair {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.ts-milestone {
  flex: 1 1 260px;
  min-width: 0;
  padding: 16px 18px;
  text-decoration: none;
  display: block;
}

.ts-milestone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ts-milestone-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ts-milestone-title {
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
}
.ts-milestone-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.5;
}

.ts-milestone.complete {
  border-top: 2px solid var(--success);
}
.ts-milestone-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--game-cards);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ts-milestone-new-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: rgba(var(--game-cards-rgb), 0.18);
  color: var(--game-cards);
  border: 1px solid rgba(var(--game-cards-rgb), 0.35);
  animation: tsNewPulse 2s ease-in-out infinite;
}
@keyframes tsNewPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Reuses .game-lock-overlay/.game-lock-text verbatim via .game-card.locked;
   this just supplies the date/purchase reason text layout inside it. */
.ts-lock-reason {
  font-size: 10.5px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
  padding: 0 12px;
}

@media (max-width: 640px) {
  .ts-timeline-item { flex-direction: column; gap: 6px; padding-left: 20px; }
  .ts-timeline-item::before { left: 3px; top: 26px; bottom: -8px; }
  .ts-timeline-date-col {
    flex: none;
    text-align: left;
    padding-top: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .ts-timeline-date-col::after { right: auto; left: -21px; top: 5px; }
  .ts-milestone-pair { flex-direction: column; }
  .ts-milestone { flex-basis: auto; }
  .ts-milestone-top { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Test detail — syllabus checklist */
.ts-test-header {
  margin-bottom: 24px;
}
.ts-test-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.ts-test-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.ts-syllabus-list {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 20px;
}
.ts-syllabus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  cursor: pointer;
}
.ts-syllabus-row:first-child { border-top: none; }
.ts-syllabus-row:hover { background: rgba(var(--overlay-rgb), 0.03); }
.ts-syllabus-topic-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ts-syllabus-topic-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.ts-syllabus-topic-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Checkbox reuses .subject-chip's hidden-input + styled-label toggle idiom,
   sized down for an inline list row rather than a pill filter chip. */
.ts-check {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.ts-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ts-check-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-rule);
  border-radius: 6px;
  color: transparent;
  transition: all var(--transition-base);
}
.ts-check input:checked + .ts-check-box {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ts-practice-panel {
  display: none;
  padding: 10px 18px 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(var(--overlay-rgb), 0.02);
}
.ts-practice-panel.is-open { display: block; }
.ts-practice-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
}
.ts-practice-link-label {
  color: var(--text-accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ts-practice-link-kind {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ts-practice-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.ts-start-test-btn {
  margin-top: 24px;
  opacity: 0.6;
  cursor: not-allowed;
}
.ts-test-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.ts-start-test-btn-active {
  margin-top: 24px;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

/* Bigger checkbox variant for the inline series-page syllabus checklist —
   same hidden-input toggle idiom as .ts-check/.ts-check-box, just larger
   per product request ("bigger box to check") since it's now the primary
   interaction on this page rather than a secondary list on its own page. */
.ts-check-lg .ts-check-box-lg {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}
.ts-check-lg.is-disabled {
  cursor: default;
}
.ts-check-lg.is-disabled .ts-check-box-lg {
  opacity: 0.5;
}

.ts-syllabus-list-inline {
  margin-top: 16px;
}
.ts-syllabus-row.is-readonly {
  cursor: default;
}
.ts-syllabus-row.is-readonly:hover {
  background: transparent;
}

.ts-lock-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(var(--overlay-rgb), 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
}

.ts-not-included-note {
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Under the series title: reference links on the left, the purchase on the
   right. Both sides are centred on one line the height of the purchase
   button; what belongs under the button hangs below that line. */
.ts-purchase-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
}
.ts-series-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 46px;
}
.ts-purchase-row .ts-purchase-status { margin-left: auto; align-self: center; }
.ts-purchase-btn {
  padding: 10px 22px;
  font-size: 13px;
}
.ts-purchase-terms {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.ts-purchase-terms a { color: var(--text-accent); }
/* The button with the line that goes with it, as one right-aligned unit. */
.ts-purchase-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  text-align: right;
}
@media (max-width: 640px) {
  /* On a phone the purchase comes first, on its own line; the links follow. */
  .ts-purchase-action, .ts-purchase-row .ts-purchase-status { order: -1; width: 100%; }
  .ts-purchase-row .ts-purchase-status { width: auto; }
  .ts-series-links { width: 100%; min-height: 0; gap: 6px; }
  /* Slightly smaller, so the two sit side by side on most phones; they still
     wrap to two lines on a very narrow one. */
  .ts-series-links .btn { height: 34px; padding: 0 12px; font-size: 12px; }
}
@media (max-width: 380px) {
  .ts-series-links .btn { padding: 0 10px; font-size: 11.5px; }
}
.ts-purchase-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ts-purchase-status-owned {
  background: rgba(var(--emerald-rgb), 0.16);
  color: var(--emerald);
  border: 1px solid rgba(var(--emerald-rgb), 0.35);
}

/* Celebration burst — pure CSS, no asset/library dependency. */
.ts-celebrate {
  animation: tsCelebratePulse 0.6s ease-out;
}
@keyframes tsCelebratePulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.04); box-shadow: 0 0 24px rgba(var(--game-cards-rgb), 0.5); }
  100% { transform: scale(1); }
}
.ts-confetti-piece {
  position: fixed;
  width: 6px;
  height: 10px;
  pointer-events: none;
  z-index: 999;
  animation: tsConfettiBurst 0.9s ease-out forwards;
}
@keyframes tsConfettiBurst {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: var(--ts-confetti-end, translate(0, -80px)) rotate(360deg); opacity: 0; }
}

/* ── Test Series: exam-taking page ── */
.ts-exam-page {
  padding: 24px 0 60px;
}
/* Floating pill, like the Flashcard Duel / Knock Knock session headers. */
.ts-exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 18px;
  background: #fff;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card);
}
.ts-exam-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
}
.ts-exam-header-title .clay { flex: none; }
.ts-exam-header-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-exam-timer {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: #EDEBFF;
  border: 0;
  color: #4338CA;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.ts-exam-timer.is-low {
  background: #FFE4EF;
  color: #BE185D;
  animation: tsNewPulse 1s ease-in-out infinite;
}

/* Desktop: question ~70%, OMR sheet ~30%, side by side (like the original
   palette layout). Mobile: single column, OMR becomes an off-canvas panel
   (see .ts-omr / .ts-omr-scrim below) opened by .ts-omr-open-btn. */
.ts-exam-body {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 20px;
  align-items: start;
}
.ts-exam-question-panel {
  padding: 24px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.ts-exam-q-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.ts-exam-q-text {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}
/* Paragraphs inside a question (the stem, then each statement or lettered
   line) get clear separation instead of sitting one line-height apart. */
.ts-exam-q-text p,
.ts-review-question p {
  margin: 0 0 12px;
}
.ts-exam-q-text p:last-child,
.ts-review-question p:last-child {
  margin-bottom: 0;
}
/* An option or an explanation can hold more than one line too; keep those
   lines apart without adding space around a single-line answer. */
.ts-exam-option-text p,
.ts-review-answer p,
.ts-review-explanation-text p {
  margin: 0 0 6px;
}
.ts-exam-option-text p:last-child,
.ts-review-answer p:last-child,
.ts-review-explanation-text p:last-child {
  margin-bottom: 0;
}
.ts-review-explanation-text { flex: 1; min-width: 0; line-height: 1.6; }
.ts-review-explanation .icon-sm { flex-shrink: 0; margin-top: 2px; }
/* Numbered statements are real lists: the number sits in its own column and
   a statement that wraps stays clear of it. The global reset zeroes the
   padding that column needs, so it is given back here. */
.ts-exam-q-text ul, .ts-exam-q-text ol,
.ts-exam-option-text ul, .ts-exam-option-text ol,
.ts-review-question ul, .ts-review-question ol,
.ts-review-answer ul, .ts-review-answer ol,
.ts-review-explanation-text ul, .ts-review-explanation-text ol {
  margin: 0 0 12px;
  padding-left: 2.4em;
}
.ts-exam-q-text ul, .ts-exam-option-text ul, .ts-review-question ul,
.ts-review-answer ul, .ts-review-explanation-text ul { list-style: disc outside; }
/* No list-style-type on <ol>, on purpose. The numbering an author chose
   (type="I" for a second set of statements) is part of the question: the
   answer codes refer to it. The browser applies `type` itself, and tells
   "I" from "i"; a CSS selector on that attribute cannot (it matches without
   regard to case), so a rule here would turn I, II, III into i, ii, iii. */
.ts-exam-q-text ol, .ts-exam-option-text ol, .ts-review-question ol,
.ts-review-answer ol, .ts-review-explanation-text ol { list-style-position: outside; }
.ts-exam-q-text li, .ts-exam-option-text li, .ts-review-question li,
.ts-review-answer li, .ts-review-explanation-text li { margin-bottom: 8px; padding-left: 0.35em; }
.ts-exam-q-text li:last-child, .ts-exam-option-text li:last-child, .ts-review-question li:last-child,
.ts-review-answer li:last-child, .ts-review-explanation-text li:last-child { margin-bottom: 0; }
.ts-exam-q-text li::marker, .ts-review-question li::marker { font-variant-numeric: tabular-nums; }
/* A list is followed by the closing line of the question, never by nothing;
   when it is the last thing in a stem it needs no gap below. */
.ts-exam-q-text > :last-child, .ts-review-question > :last-child { margin-bottom: 0; }
/* Emphasis an author marked is meaning, not decoration (a species name, the
   term being asked about): make sure nothing upstream flattens it. */
.ts-exam-q-text em, .ts-exam-q-text i, .ts-exam-option-text em, .ts-exam-option-text i,
.ts-review-question em, .ts-review-question i, .ts-review-answer em, .ts-review-answer i,
.ts-review-explanation-text em, .ts-review-explanation-text i { font-style: italic; }
.ts-exam-q-text strong, .ts-exam-q-text b, .ts-exam-option-text strong, .ts-exam-option-text b,
.ts-review-question strong, .ts-review-question b, .ts-review-answer strong, .ts-review-answer b,
.ts-review-explanation-text strong, .ts-review-explanation-text b { font-weight: 800; }
.ts-exam-q-text u, .ts-exam-option-text u, .ts-review-question u,
.ts-review-answer u, .ts-review-explanation-text u { text-decoration: underline; }
.ts-exam-q-text blockquote, .ts-review-question blockquote {
  margin: 0 0 12px;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--border-subtle);
  color: var(--text-secondary);
}
/* A wide table scrolls inside the question on a phone instead of pushing the
   page sideways. */
.ts-exam-q-text, .ts-review-question { overflow-x: auto; }
/* Sanitized question/option HTML can include a table (e.g. "match List-I
   with List-II") — style it explicitly since the browser default is
   borderless and unreadable against the app's dark surfaces. Scoped to
   Test Series' rendered rich text, not a global `table` rule. */
.ts-exam-q-text table,
.ts-exam-option table,
.ts-review-question table,
.ts-review-answer table,
.ts-review-explanation-text table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  font-size: 0.95em;
}
.ts-exam-q-text th, .ts-exam-q-text td,
.ts-exam-option th, .ts-exam-option td,
.ts-review-question th, .ts-review-question td,
.ts-review-answer th, .ts-review-answer td,
.ts-review-explanation-text th, .ts-review-explanation-text td {
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  text-align: left;
}
.ts-exam-q-text th, .ts-review-question th {
  background: rgba(var(--overlay-rgb), 0.04);
  font-weight: 700;
}
.ts-exam-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.ts-exam-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1.5px rgba(30, 27, 75, 0.05);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-base);
}
.ts-exam-option:hover { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.45); }
.ts-exam-option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(30, 27, 75, 0.08);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-base);
}
.ts-exam-option-text { flex: 1; }
.ts-exam-option.is-selected {
  background: #EDEBFF;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.ts-exam-option.is-selected .ts-exam-option-letter {
  background: var(--accent);
  color: #fff;
}

.ts-exam-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#ts-btn-review.is-active {
  background: #FFF6D6;
  border-color: transparent;
  color: #B45309;
}

/* Mobile-only trigger for the off-canvas OMR panel — hidden on desktop,
   where the panel sits in the grid instead (see .ts-exam-body). */
.ts-omr-open-btn {
  display: none;
  margin-bottom: 16px;
  gap: 8px;
}
.ts-omr-close-btn {
  display: none;
}
.ts-omr-scrim {
  display: none;
}

/* ── OMR-style answer sheet — replaces the old number-palette navigator ── */
.ts-omr {
  padding: 20px 24px 24px;
  position: sticky;
  top: 20px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.ts-omr-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border-subtle);
}
.ts-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.ts-dot.answered { background: var(--accent-hover); }
.ts-dot.review { background: var(--color-bolt); }
.ts-dot.unanswered { background: var(--border-rule); }

/* Paper-and-shading look: a warm off-white surface (independent of the
   dark/light theme accent colors) with a faint inner shadow, evoking the
   physical OMR sheet without copying its red ink. */
.ts-omr-sheet {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.015) 0px, rgba(0, 0, 0, 0.015) 1px,
    transparent 1px, transparent 38px
  ), var(--bg-card);
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px rgba(30, 27, 75, 0.07), inset 0 1px 4px rgba(0, 0, 0, 0.05);
  /* Holds every question; about nine rows show at once and the rest are
     reached by wheel/trackpad/touch, with no visible scrollbar. */
  position: relative;
  max-height: min(360px, calc(100vh - 250px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.ts-omr-sheet::-webkit-scrollbar { display: none; }
.ts-omr-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-base);
}
.ts-omr-row:last-child { border-bottom: none; }
.ts-omr-row:hover { background: rgba(var(--overlay-rgb), 0.03); }
.ts-omr-row.is-current {
  background: rgba(var(--accent-rgb), 0.09);
  box-shadow: inset 3px 0 0 var(--accent);
}
.ts-omr-num {
  width: 28px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ts-omr-row.answered .ts-omr-num { color: var(--accent-hover); }
.ts-omr-row.review .ts-omr-num { color: var(--color-bolt); }
.ts-omr-bubbles {
  display: flex;
  gap: 10px;
}
.ts-omr-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-rule);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}
.ts-omr-bubble.is-filled {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.ts-omr-row.review .ts-omr-bubble.is-filled {
  background: var(--color-bolt);
  border-color: var(--color-bolt);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

@media (max-width: 480px) {
  .ts-omr-row { gap: 10px; padding: 8px 12px; }
  .ts-omr-bubbles { gap: 6px; }
  .ts-omr-bubble { width: 20px; height: 20px; font-size: 9px; }
}

/* Mobile fallback: no side-by-side layout — the OMR sheet becomes an
   off-canvas panel triggered by a button above the question, sliding in
   over a dimmed scrim rather than pushing the question out of view. */
@media (max-width: 900px) {
  .ts-exam-body { grid-template-columns: 1fr; }
  .ts-omr-open-btn { display: inline-flex; }
  .ts-omr-scrim {
    display: block;
    position: fixed;
    top: 80px;
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--scrim-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 89;
  }
  .ts-omr-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .ts-omr {
    /* Starts below the navbar rather than at the true viewport top — the
       navbar is a sibling of .page-wrapper with its own higher-priority
       stacking context (nav z-index:100 vs. page-wrapper z-index:1 at the
       body level), so no z-index on this panel can ever paint above it;
       the panel would otherwise render its top ~67px hidden underneath
       the sticky nav regardless of z-index. */
    position: fixed;
    top: 80px;
    right: 0;
    bottom: 0;
    width: min(360px, 88vw);
    max-width: none;
    border-radius: 24px 0 0 24px;
    box-shadow: var(--shadow-float);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 90;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  /* In the off-canvas panel the sheet fills the space between the legend
     and the Submit button and is the only thing that scrolls. */
  .ts-omr .ts-omr-sheet { flex: 1; min-height: 0; max-height: none; }
  .ts-omr.is-open {
    transform: translateX(0);
  }
  .ts-omr-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--bg-soft);
    color: var(--ink-2);
    font-size: 16px;
    cursor: pointer;
    z-index: 1;
    touch-action: manipulation;
  }
  .ts-omr-close-btn:hover { background: #EDEBFF; color: var(--ink); }
  /* Room for the 44px close button so the legend row never sits under it. */
  .ts-omr-legend { padding-right: 52px; }
}

/* Submit confirmation modal */
.ts-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--scrim-bg);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.ts-modal-overlay.is-open { display: flex; }
.ts-modal {
  padding: 28px;
  max-width: 380px;
  width: 90%;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-float);
}
.ts-modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.ts-modal-body {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}
.ts-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Test Series: results page ── */
.ts-result-banner {
  padding: 36px 32px;
  text-align: center;
  margin-bottom: 20px;
}
.ts-result-score {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ts-result-score-max {
  font-size: 16px;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 500;
}
.ts-result-xp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: rgba(var(--accent-rgb), 0.15);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-accent);
  margin-bottom: 16px;
}
.ts-result-counts {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
}
.ts-result-count.correct { color: var(--emerald); }
.ts-result-count.incorrect { color: var(--danger); }
.ts-result-count.skipped { color: var(--text-muted); }

.ts-result-section {
  padding: 24px 28px;
  margin-bottom: 20px;
}
.ts-breakdown-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
}
.ts-breakdown-label {
  width: 160px;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.ts-breakdown-count {
  width: 50px;
  text-align: right;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ts-review-row {
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
}
.ts-review-row:first-child { border-top: none; }
.ts-review-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ts-review-tag { font-weight: 700; }
.ts-review-tag.correct { color: var(--emerald); }
.ts-review-tag.wrong { color: var(--danger); }
.ts-review-tag.skipped { color: var(--text-muted); }
.ts-review-question {
  font-size: 13px;
  margin-bottom: 8px;
}
.ts-review-answer {
  font-size: 12px;
  color: var(--text-secondary);
}
.ts-review-answer.correct-answer { color: var(--emerald); }
.ts-review-explanation {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(var(--overlay-rgb), 0.04);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
}

/* ──────────────────────────────────────────────
   MOTION BASELINE
────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.gt-table td, .xp-numbers, .stat-value, .streak-count { font-variant-numeric: tabular-nums; }

/* ══════════════════════════════════════════════
   CLAY KIT — shared components. Appended last so it wins over the legacy
   component rules above while pages migrate. Every colour comes from the
   tokens; a method's hue arrives through [data-method] scoping.
══════════════════════════════════════════════ */

/* ── Type ── */
.t-display { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.025em; line-height: 1.02; color: var(--ink); }
.t-title   { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.t-lead    { font-size: var(--fs-body-lg); line-height: 1.55; color: var(--ink-2); font-weight: 500; }
.t-muted   { color: var(--ink-3); }
.t-hue     { color: var(--hue-text); }

/* ── Floating glass top bar ── */
.topbar { position: sticky; top: 12px; z-index: 100; padding: 12px 0 0; }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px 10px 14px;
  border-radius: 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Wordmark: navy tile mark + "theupscale.app" ── */
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.wordmark-mark {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 16px -8px rgba(30, 27, 75, 0.6);
}
.wordmark-mark svg { width: 24px; height: 24px; }
.wordmark-text { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.wordmark-text span { font-weight: 600; color: var(--ink-3); }

/* ── Buttons: every button is a pill ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px;
  border: 0; border-radius: var(--radius-full);
  font-family: var(--font-display); font-size: 15px; font-weight: 800; letter-spacing: 0.005em; line-height: 1;
  color: var(--ink); background: #fff;
  box-shadow: var(--shadow-soft), inset 0 0 0 1.5px var(--border-rule);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--dur-base) var(--ease-bounce), box-shadow var(--dur-base) ease, background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover), inset 0 0 0 1.5px var(--border-rule); }
.btn:active { transform: translateY(0) scale(0.97); transition-duration: 80ms; }
.btn:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: 2px; }
.btn-primary, .btn-gold { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-btn), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-primary:hover, .btn-gold:hover { background: var(--primary-hover); color: var(--on-primary); box-shadow: 0 16px 32px -12px rgba(79, 70, 229, 0.65), 0 2px 4px rgba(79, 70, 229, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25); transform: translateY(-2px) scale(1.02); }
.btn-primary:active, .btn-gold:active { transform: translateY(0) scale(0.97); box-shadow: var(--shadow-btn); }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); box-shadow: none; }
.btn-soft:hover { background: #DEDBFF; color: var(--primary-text); box-shadow: var(--shadow-soft); }
.btn-hue { background: var(--hue); color: #fff; box-shadow: 0 10px 24px -10px rgba(var(--hue-rgb), 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-hue:hover { color: #fff; box-shadow: 0 16px 32px -12px rgba(var(--hue-rgb), 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-outline-hue { background: rgba(255, 255, 255, 0.55); color: var(--hue-text); box-shadow: inset 0 0 0 2px var(--hue); }
.btn-outline-hue:hover { background: #fff; color: var(--hue-text); box-shadow: inset 0 0 0 2px var(--hue), var(--shadow-soft); }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-ghost:hover { color: var(--ink); background: #fff; }
.btn-text { background: none; box-shadow: none; color: var(--primary-text); padding: 0 6px; height: auto; }
.btn-text:hover { transform: none; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.btn-square { width: 46px; padding: 0; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn-sm.btn-square { width: 36px; }
.btn-lg { height: 54px; padding: 0 30px; font-size: 16.5px; }
.btn-lg.btn-square { width: 54px; }
.btn-full { width: 100%; }
.btn-icon { width: 46px; padding: 0; }
.btn .icon, .btn .icon-sm { width: 18px; height: 18px; }

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-display); font-size: 13px; font-weight: 700; line-height: 1;
  color: var(--ink-2); background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--border-rule);
  white-space: nowrap;
}
.chip .icon, .chip .icon-sm { width: 14px; height: 14px; }
.chip-soft { background: var(--primary-soft); color: var(--primary-text); box-shadow: none; }
.chip-hue { background: var(--tint); color: var(--hue-text); box-shadow: none; }
.chip-xp { background: var(--xp-soft); color: var(--xp-text); box-shadow: none; }
.chip-right { background: var(--right-soft); color: var(--right-text); box-shadow: none; }
.chip-wrong { background: var(--wrong-soft); color: var(--wrong-text); box-shadow: none; }
.chip-pro { background: var(--pro-soft); color: var(--pro); box-shadow: none; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 900; }
.chip-lg { height: 38px; padding: 0 16px; font-size: 14.5px; }
.chip img.clay { width: 18px; height: 18px; }

/* ── Aspirant / plan chip in the top bar ── */
.aspirant { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--radius-full); background: var(--bg-soft); }
.aspirant-name { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--ink); }
.aspirant .chip { height: 26px; padding: 0 10px; font-size: 11.5px; }
.avatar-btn {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--primary-soft); color: var(--primary-text);
  font-family: var(--font-display); font-weight: 900; font-size: 16px;
  box-shadow: inset 0 0 0 2px #fff, var(--shadow-soft);
  text-decoration: none;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ── Panels ── */
.panel {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.panel-tint { background: linear-gradient(135deg, var(--tint) 0%, var(--tint-2) 100%); }
.panel-soft { background: var(--bg-soft); box-shadow: none; }

/* ── Method card (dashboard / landing) ── */
.method-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  min-height: 210px;
  padding: 26px 28px 24px;
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, var(--tint) 0%, var(--tint-2) 100%);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--dur-slow) var(--ease-bounce), box-shadow var(--dur-slow) ease;
}
.method-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-hover); }
.method-card-top { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-right: 42%; }
.method-card-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.method-card-count { font-family: var(--font-display); font-size: 15px; font-weight: 800; color: var(--hue-text); white-space: nowrap; }
.method-card-desc { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0; max-width: 58%; }
.method-card-method { font-family: var(--font-display); font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hue-text); margin: 0 0 4px; }
.method-card-cta { align-self: flex-start; }
.method-card-art {
  position: absolute; right: 18px; bottom: 14px;
  width: 44%; max-width: 170px; aspect-ratio: 1;
  display: grid; place-items: center;
  pointer-events: none;
}
.method-card-art .clay { width: 100%; height: auto; transition: transform var(--dur-slow) var(--ease-bounce); }
.method-card:hover .method-card-art .clay { transform: translateY(-8px) rotate(-5deg) scale(1.06); }
.method-card-art .sparks { position: absolute; inset: -6% -6% auto auto; width: 34%; color: var(--xp); }
.method-card.is-locked { filter: saturate(0.5); }
.method-card.is-locked .method-card-art .clay { opacity: 0.55; }

/* ── Page header: back square + clay icon + title + chips ── */
.page-header { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.page-header-art { flex: none; width: 92px; height: 92px; display: grid; place-items: center; }
.page-header-art .clay { width: 100%; height: auto; }
.page-header-body { flex: 1 1 260px; min-width: 0; }
.page-header-kicker { font-family: var(--font-display); font-size: 12.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hue-text); margin: 0 0 4px; }
.page-header-title { font-family: var(--font-display); font-size: clamp(30px, 4vw, 42px); font-weight: 900; letter-spacing: -0.025em; line-height: 1.02; margin: 0; color: var(--ink); }
.page-header-sub { font-size: 15px; color: var(--ink-2); margin: 6px 0 0; }
.page-header-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.page-header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* Hub extras around {% method_header %}: the "how it works" strip each hub
   carried as inline-styled spans, and the optional right-hand action
   (Flashcards' My Stats) that has to sit beside the header rather than
   inside it. */
.hub-rules { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 24px; }
.hub-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hub-head .page-header { flex: 1 1 320px; }
.hub-head-action { flex: none; margin-top: 6px; }

/* ── Score card (end of round) ──
   One partial for all four method results pages; each previously repeated the
   same banner with ~24 inline styles and its own if/elif ladder. */
.score-card { text-align: center; padding: 38px 32px 32px; margin-bottom: 24px; }
.score-card-art { display: block; margin: 0 auto 12px; }
.score-card-title {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -0.02em; color: var(--ink); margin: 0;
}
.score-card-number {
  font-family: var(--font-display); font-weight: 900; font-size: 52px; line-height: 1.05;
  color: var(--hue, var(--primary)); margin: 10px 0 0; font-variant-numeric: tabular-nums;
}
.score-card-number span { font-size: 26px; color: var(--ink-3); }
.score-card-unit { font-size: 13.5px; color: var(--ink-3); margin: 2px 0 0; }
.score-card-xp {
  display: inline-flex; align-items: center; gap: 7px; margin: 16px 0 0;
  padding: 8px 18px; border-radius: var(--radius-full);
  background: rgba(var(--hue-rgb, 79, 70, 229), 0.12);
  color: var(--hue-text, var(--primary-text));
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
}
.score-card-caption { font-size: 13px; color: var(--ink-3); margin: 14px 0 0; }

.sub-clay { display: block; margin: 0 auto 14px; }

/* ── Note bar ── */
.note-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border-radius: 22px;
  background: var(--primary-soft-2);
  box-shadow: inset 0 0 0 1.5px var(--primary-soft);
  color: var(--ink);
  font-size: 15px; line-height: 1.5;
}
.note-bar .clay { flex: none; width: 56px; height: 56px; }
.note-bar strong { font-weight: 800; }
.note-bar-hue { background: var(--tint-2); box-shadow: inset 0 0 0 1.5px var(--tint); }

/* ── Progress ── */
.progress { position: relative; height: 10px; border-radius: var(--radius-full); background: var(--primary-soft); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--primary); transition: width var(--dur-slow) var(--ease-out); }
.progress-hue { background: var(--tint); }
.progress-hue .progress-fill { background: var(--hue); }
.progress-lg { height: 14px; }

/* ── Option rows (answers, choices) ── */
.option-row {
  display: flex; align-items: center; gap: 16px;
  width: 100%; text-align: left;
  padding: 14px 16px;
  border: 0; border-radius: 20px;
  background: #fff; color: var(--ink);
  font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1.4;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-bounce), box-shadow var(--dur-base) ease, background var(--dur-fast) ease;
}
.option-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.option-row:active { transform: scale(0.99); }
.option-row.is-selected { box-shadow: var(--shadow-card), inset 0 0 0 2.5px var(--primary); background: var(--primary-soft-2); }
.option-row.is-right { background: var(--right-soft); box-shadow: var(--shadow-card), inset 0 0 0 2.5px var(--right); }
.option-row.is-wrong { background: var(--wrong-soft); box-shadow: var(--shadow-card), inset 0 0 0 2.5px var(--wrong); }
.option-row.is-dim { opacity: 0.55; }
.letter-badge {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-text);
  font-family: var(--font-display); font-weight: 900; font-size: 18px;
}
.is-right .letter-badge { background: var(--right); color: #fff; }
.is-wrong .letter-badge { background: var(--wrong); color: #fff; }
.is-selected .letter-badge { background: var(--primary); color: #fff; }

/* ── Clay icons ── */
.clay {
  display: block; height: auto;
  user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 12px 16px rgba(30, 27, 75, 0.16));
}
.clay-float { animation: clay-float 4.4s ease-in-out infinite; }
.clay-float-2 { animation: clay-float 5.2s ease-in-out infinite reverse; }
@keyframes clay-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-9px) rotate(2deg); }
}
.clay-wobble:hover { animation: clay-wobble 0.7s var(--ease-bounce); }
@keyframes clay-wobble {
  0% { transform: rotate(0) scale(1); }
  30% { transform: rotate(-8deg) scale(1.08); }
  60% { transform: rotate(6deg) scale(1.04); }
  100% { transform: rotate(0) scale(1); }
}
[data-pop] { opacity: 0; transform: translateY(18px) scale(0.72); }
[data-pop].is-in { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.75s var(--ease-bounce); }
html.no-js [data-pop] { opacity: 1; transform: none; }
.sparks { pointer-events: none; }

/* ── Shake for a wrong pick ── */
.shake { animation: clay-shake 0.5s ease; }
@keyframes clay-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ── Confetti canvas host ── */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }

@media (prefers-reduced-motion: reduce) {
  .clay-float, .clay-float-2 { animation: none; }
  [data-pop] { opacity: 1; transform: none; transition: none; }
  .btn, .method-card, .option-row { transition: none; }
}

/* ──────────────────────────────────────────────
   TEST SERIES — public series page (no sign-in)
────────────────────────────────────────────── */
.tsp-page { max-width: 1040px; }
.tsp-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 36px 40px;
  background: linear-gradient(135deg, #FFFFFF 0%, var(--primary-soft-2) 100%);
}
.tsp-hero:hover { transform: none; }
.tsp-hero-copy { flex: 1; min-width: 0; }
.tsp-hero-art { flex-shrink: 0; width: 220px; height: 220px; object-fit: contain; }
.tsp-eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.tsp-title {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink);
}
.tsp-tagline { max-width: 560px; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); }
.tsp-offer { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 20px 32px; margin-top: 26px; }
.tsp-price { display: flex; flex-direction: column; gap: 2px; }
.tsp-price-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--xp-text);
}
.tsp-price-amount { font-family: var(--font-display); font-size: 34px; font-weight: 900; line-height: 1.1; color: var(--ink); }
.tsp-price-note { font-size: 13px; color: var(--ink-3); }
.tsp-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.tsp-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.tsp-fact { padding: 18px 20px; }
.tsp-fact:hover, .tsp-step:hover, .tsp-papers:hover, .tsp-terms:hover, .tsp-closing:hover, .tsp-test:hover { transform: none; box-shadow: var(--shadow-card); }
.tsp-fact-value { font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--ink); }
.tsp-fact-label { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

.tsp-section { margin-top: 44px; scroll-margin-top: 90px; }
.tsp-h2 { font-family: var(--font-display); font-size: 26px; font-weight: 900; color: var(--ink); }
.tsp-lead { margin: 4px 0 18px; font-size: 14px; color: var(--ink-3); }
.tsp-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.tsp-step { padding: 18px 20px; }
.tsp-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 800;
}
.tsp-step-title { margin-top: 12px; font-size: 15px; font-weight: 800; color: var(--ink); }
.tsp-step-body { margin-top: 4px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.tsp-papers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px 32px; margin-top: 14px; padding: 18px 20px; }
.tsp-paper-name { font-size: 15px; font-weight: 800; color: var(--ink); }
.tsp-paper-facts { margin-top: 2px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }

.tsp-terms { padding: 28px 32px; }
.tsp-terms h3 { margin: 26px 0 8px; font-size: 16px; font-weight: 800; color: var(--ink); }
.tsp-terms p, .tsp-terms li { font-size: 14.5px; line-height: 1.7; color: var(--legal-text); }
.tsp-terms ul { margin: 0; padding-left: 20px; list-style: disc; }
.tsp-terms li { margin-bottom: 6px; }
.tsp-terms a { color: var(--text-accent); }

.tsp-closing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 32px;
  margin-top: 44px;
  padding: 26px 32px;
}
.tsp-closing-title { font-family: var(--font-display); font-size: 20px; font-weight: 900; color: var(--ink); }
.tsp-closing-note { margin-top: 2px; font-size: 14px; color: var(--ink-2); }

@media (max-width: 760px) {
  .tsp-hero { flex-direction: column-reverse; align-items: flex-start; gap: 12px; padding: 24px 22px; }
  .tsp-hero-art { width: 120px; height: 120px; }
  .tsp-cta, .tsp-cta .btn { width: 100%; }
  .tsp-terms { padding: 20px 18px; }
  .tsp-closing { padding: 22px 20px; }
}
