/* ==========================================================================
   quizmaster — dashboard.css  (v2 full rewrite)
   Direction: Linear / Vercel premium DARK. Dark-only, single indigo accent.
   CSP-safe: no inline styles anywhere; dynamic widths use .bar-w-* utilities,
   charts use inline-SVG presentation attributes. Self-hosted fonts.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   0. Fonts (self-hosted, font-display: swap)
   --------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/InterVariable.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/JetBrainsMono-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
}

/* ---------------------------------------------------------------------------
   1. Design tokens — single source of truth
   --------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg:            #08090c;
  --bg-subtle:     #0b0d11;
  --surface:       #0f1116;
  --surface-2:     #14161d;
  --surface-3:     #1b1e27;

  /* Borders / dividers */
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus:  #6e79e8;

  /* Text */
  --fg:            #ededf0;
  --fg-muted:      #9ba0a9;
  --fg-faint:      #6b7077;
  --fg-on-accent:  #ffffff;

  /* Accent (Linear indigo) */
  --accent:        #6366f1;
  --accent-hover:  #757cf5;
  --accent-active: #5258e0;
  --accent-soft:   rgba(99, 102, 241, 0.12);
  --accent-glow:   rgba(99, 102, 241, 0.20);
  --accent-ring:   rgba(99, 102, 241, 0.45);

  /* Semantic score colors */
  --score-high:    #34d399;
  --score-mid:     #fbbf24;
  --score-low:     #f87171;
  --success:       #22c55e;
  --success-soft:  rgba(34, 197, 94, 0.12);
  --warning:       #f59e0b;
  --warning-soft:  rgba(245, 158, 11, 0.12);
  --danger:        #ef4444;
  --danger-soft:   rgba(239, 68, 68, 0.12);
  --info:          #38bdf8;

  --covered:       #34d399;
  --missed:        #f87171;

  /* Radius */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;  --r-xl: 20px;  --r-full: 999px;

  /* Spacing (4px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;  --s-4: 16px;  --s-5: 20px;  --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 16px; --fs-lg: 18px;
  --fs-xl: 21px; --fs-2xl: 26px; --fs-3xl: 33px; --fs-4xl: 44px; --fs-5xl: 58px;
  --lh-tight: 1.15; --lh-snug: 1.35; --lh-normal: 1.6;
  --tracking-tight: -0.02em; --tracking-normal: 0; --tracking-wide: 0.04em;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px var(--accent-ring), 0 8px 30px var(--accent-glow);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms; --t: 180ms; --t-slow: 280ms;

  /* Layout */
  --container: 1120px;
  --container-wide: 1280px;
  --container-prose: 720px;
  --z-nav: 40; --z-sticky: 50; --z-dropdown: 60;
  --z-overlay: 80; --z-modal: 90; --z-toast: 100;
}

/* ---------------------------------------------------------------------------
   2. Reset + base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

img, svg, video, canvas { display: block; max-width: 100%; }
svg { fill: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

ul, ol { list-style: none; padding: 0; }

a { color: inherit; text-decoration: none; }

code, pre, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

::placeholder { color: var(--fg-faint); opacity: 1; }

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

/* Focus rings — visible on every interactive element */
:focus-visible {
  outline: 2px solid transparent;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
}
/* Avoid double-ring on inputs/textareas that define their own focus shadow */
input:focus-visible,
textarea:focus-visible,
select:focus-visible { box-shadow: none; }

/* ---------------------------------------------------------------------------
   3. Skip link + layout primitives
   --------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: var(--z-toast);
  background: var(--surface-3);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-4);
  font-weight: 500;
  transition: top var(--t) var(--ease);
}
.skip-link:focus {
  top: var(--s-4);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.content {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--s-10) var(--s-5) var(--s-20);
}

/* ---------------------------------------------------------------------------
   4. Top header + nav (authed + anon)
   --------------------------------------------------------------------------- */
.page-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  padding: var(--s-4) var(--s-5);
  padding-top: max(var(--s-4), env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: var(--tracking-normal);
  color: var(--fg);
  margin-right: auto;
}

.signed-in-as {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  order: 3;
  flex-basis: 100%;
}

nav[aria-label="Primary"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

/* nav links use the .refresh convention (neutral underlined link) */
.refresh {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: var(--s-1) var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: var(--r-sm);
  transition: color var(--t) var(--ease);
}
.refresh:hover { color: var(--fg); }

.page-header .sep {
  color: var(--fg-faint);
  user-select: none;
}

/* signout — ghost button styled like a nav link */
.signout {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: var(--s-1) var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: var(--r-sm);
  transition: color var(--t) var(--ease);
}
.signout:hover { color: var(--score-low); }

nav[aria-label="Primary"] form { display: inline-flex; }

/* anon CTA — the lone accent in the header */
.nav-cta {
  color: var(--fg-on-accent);
  background: var(--accent);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  font-weight: 500;
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.nav-cta:hover {
  color: var(--fg-on-accent);
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
}
.nav-public .sep { display: none; }

/* ---------------------------------------------------------------------------
   5. Footer
   --------------------------------------------------------------------------- */
.page-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: var(--s-6) var(--s-5);
  padding-bottom: max(var(--s-6), env(safe-area-inset-bottom));
  color: var(--fg-faint);
  font-size: var(--fs-sm);
}
.page-footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  align-items: center;
  justify-content: space-between;
}

/* ---------------------------------------------------------------------------
   6. Eyebrow / headline / subhead / sections
   --------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: var(--s-3);
}

.headline {
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  color: var(--fg);
  margin-bottom: var(--s-4);
  max-width: 24ch;
}

/* Interview question prompt: a readable, COMPACT prompt — not the giant display
   headline. Long Senior questions in the display size span several screens; this
   shrinks the font, relaxes the line-height, drops the tight display tracking, and
   widens the measure so the prompt fits. Higher specificity (h1.question-heading)
   overrides .headline at EVERY breakpoint, including the ≥768 .headline bump. */
h1.question-heading {
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  letter-spacing: normal;
  max-width: 62ch;
}
@media (min-width: 768px) {
  h1.question-heading { font-size: var(--fs-lg); }
}

.subhead {
  font-size: var(--fs-md);
  color: var(--fg-muted);
  line-height: var(--lh-normal);
  max-width: 62ch;
}

.section {
  margin-top: var(--s-16);
}
.section .subhead { margin-bottom: var(--s-6); }

.muted { color: var(--fg-muted); }
.sep { color: var(--fg-faint); user-select: none; }
.null { color: var(--fg-faint); }
.arr { font-family: var(--font-mono); }

/* ---------------------------------------------------------------------------
   7. Buttons
   --------------------------------------------------------------------------- */
.btn,
.auth-submit,
.cta-primary,
.cta-secondary,
.btn-quiet,
.interview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: background var(--t) var(--ease),
              border-color var(--t) var(--ease),
              box-shadow var(--t) var(--ease),
              transform var(--t-fast) var(--ease),
              color var(--t) var(--ease);
}

/* Primary (accent) — .btn.auth-submit, .auth-submit, .cta-primary */
.btn,
.auth-submit,
.cta-primary {
  background: var(--accent);
  color: var(--fg-on-accent);
}
.btn:hover,
.auth-submit:hover,
.cta-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
  color: var(--fg-on-accent);
}
.btn:active,
.auth-submit:active,
.cta-primary:active {
  background: var(--accent-active);
  transform: scale(0.98);
}

/* Secondary — bordered, transparent */
.btn-secondary,
.cta-secondary,
.interview-btn {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-secondary:hover,
.cta-secondary:hover,
.interview-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.btn-secondary:active,
.cta-secondary:active,
.interview-btn:active { transform: scale(0.98); }

/* Ghost / quiet */
.btn-ghost,
.btn-quiet {
  background: transparent;
  color: var(--fg-muted);
  border-color: transparent;
}
.btn-ghost:hover,
.btn-quiet:hover { color: var(--fg); background: var(--surface); }

/* Danger */
.btn-danger,
.interview-btn-danger {
  color: var(--score-low);
  border-color: var(--border-strong);
}
.interview-btn.interview-btn-danger { color: var(--score-low); }
.btn-danger:hover,
.interview-btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--score-low);
}

/* Sizes / modifiers */
.btn-sm { min-height: 36px; padding: var(--s-2) var(--s-4); font-size: var(--fs-sm); }
.btn-lg { min-height: 52px; padding: var(--s-4) var(--s-8); font-size: var(--fs-md); }
.btn-block { width: 100%; }

.btn:disabled,
.auth-submit:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Loading — htmx disables the button mid-request; keep width, show pulse */
.btn.htmx-request,
.auth-submit.htmx-request {
  opacity: 0.7;
  cursor: progress;
}

/* ---------------------------------------------------------------------------
   8. Cards / panels
   --------------------------------------------------------------------------- */
.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}
.card-interactive {
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
              transform var(--t) var(--ease);
}
.card-interactive:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* ---------------------------------------------------------------------------
   9. Score band system  (band-strong / band-mid / band-weak / band-none)
   Used as text color, on chips/pills, and on bar fills.
   --------------------------------------------------------------------------- */
.band-strong { color: var(--score-high); }
.band-mid    { color: var(--score-mid); }
.band-weak   { color: var(--score-low); }
.band-none   { color: var(--fg-faint); }

.num,
.val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Pill / chip variant — add .band-pill alongside a band-* class */
.band-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.band-pill.band-strong { background: var(--success-soft); border-color: rgba(52, 211, 153, 0.25); }
.band-pill.band-mid    { background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.25); }
.band-pill.band-weak   { background: var(--danger-soft);  border-color: rgba(248, 113, 113, 0.25); }
.band-pill.band-none   { background: var(--surface-2);    border-color: var(--border); }

/* Generic score bar (track + colored fill) */
.score-bar {
  position: relative;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  overflow: hidden;
}
.score-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width var(--t-slow) var(--ease);
}
.score-bar-fill.band-strong { background: var(--score-high); }
.score-bar-fill.band-mid    { background: var(--score-mid); }
.score-bar-fill.band-weak   { background: var(--score-low); }
.score-bar-fill.band-none   { background: var(--fg-faint); }

/* Big score display (huge type-led numeral + denominator) */
.score-display {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.score-display .big { font-size: var(--fs-5xl); font-weight: 600; letter-spacing: -0.03em; }
.score-display .den { font-size: var(--fs-xl); color: var(--fg-faint); font-weight: 500; }

/* ---------------------------------------------------------------------------
   10. Badges
   --------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 2px var(--s-2);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  line-height: 1.4;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg-muted);
  white-space: nowrap;
}

.badge-topic { color: var(--fg-muted); }
.badge-ungraded { color: var(--fg-faint); background: var(--bg-subtle); }

/* Tier badges (shared with tier_count micro-labels) */
.badge-tier { text-transform: uppercase; }
.badge-tier-learning { color: var(--fg-muted); }
.badge-tier-familiar { color: var(--score-mid); }
.badge-tier-mastered { color: var(--accent-hover); font-weight: 600; }
.badge.badge-tier-learning { border-color: var(--border); background: var(--surface-2); }
.badge.badge-tier-familiar { border-color: rgba(251, 191, 36, 0.22); background: var(--warning-soft); }
.badge.badge-tier-mastered { border-color: rgba(99, 102, 241, 0.30); background: var(--accent-soft); }

/* tier_count micro-labels (no badge box — inline glyph + count + label) */
.tier-legend .badge-tier-learning,
.tier-legend .badge-tier-familiar,
.tier-legend .badge-tier-mastered {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   11. Streak chip
   --------------------------------------------------------------------------- */
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}
.streak-chip.is-active { color: var(--score-high); }
.streak-freeze { color: var(--fg-muted); }
.streak-sep { color: var(--fg-faint); user-select: none; }
.is-active { color: var(--score-high); }

/* ---------------------------------------------------------------------------
   12. KPI / stat cards  (overview hero stat-band)
   --------------------------------------------------------------------------- */
.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-8);
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.stat-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
}
.stat-figure {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}
.stat-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-4xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--fg);
}
.stat-num.is-active { color: var(--score-high); }
.stat-unit { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--fg-faint); }
.stat-sub { font-size: var(--fs-sm); color: var(--fg-muted); }
.stat-link {
  margin-top: var(--s-1);
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent-hover);
  transition: color var(--t) var(--ease);
}
.stat-link:hover { color: var(--accent); }
.stat-tile--weak { border-color: var(--border-strong); }
/* Streak KPI tile — a quiet emphasis edge (matches the weak tile's weight) so the two
   "signal" tiles read a touch stronger than the neutral middle tiles, without a loud glow. */
.stat-tile--streak { border-color: var(--border-strong); }
.stat-delta { font-family: var(--font-mono); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.stat-delta-up { color: var(--score-high); }
.stat-delta-down { color: var(--score-low); }

/* ---------------------------------------------------------------------------
   13. Action bar
   --------------------------------------------------------------------------- */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
  margin-top: var(--s-8);
}
.action-note {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.action-note a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.action-note a:hover { color: var(--accent); }
.resume-actions { margin-top: var(--s-6); }

/* ---------------------------------------------------------------------------
   14. Progress by track (track-grid)
   --------------------------------------------------------------------------- */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-4);
}
.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.track-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.track-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.track-name {
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}
.track-ready {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-1);
  flex-shrink: 0;
}
.track-ready-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--score-high);
}
.track-ready-num.is-zero { color: var(--fg-faint); }
.track-ready-lbl { font-size: var(--fs-xs); color: var(--fg-faint); text-transform: uppercase; letter-spacing: var(--tracking-wide); }

.track-metric { display: flex; flex-direction: column; gap: var(--s-2); }
.track-metric-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.track-metric-lbl {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--fg-faint);
}
.track-metric-val { font-family: var(--font-mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--fg); }

/* coverage rule (track + fill) */
.cov-rule {
  display: block;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  overflow: hidden;
}
.cov-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--t-slow) var(--ease);
}

/* stacked tier mini-bar */
.tier-bar {
  display: flex;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  overflow: hidden;
}
.tier-seg { display: block; height: 100%; }
.tier-seg-learning { background: var(--fg-faint); }
.tier-seg-familiar { background: var(--score-mid); }
.tier-seg-mastered { background: var(--accent); }
.tier-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-1);
}

/* ---------------------------------------------------------------------------
   15. Per-topic confidence list (topic-list)
   --------------------------------------------------------------------------- */
.topic-list { display: flex; flex-direction: column; gap: var(--s-2); }

/* Per-topic confidence "show all" — native <details> disclosure (no JS, CSP-safe).
   The weakest ~10 render eagerly; the rest collapse here so the dashboard stays
   scannable instead of running thousands of px tall on a full taxonomy. */
.topic-more { margin-top: var(--s-3); }
.topic-more-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  list-style: none;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--t) var(--ease), color var(--t) var(--ease),
    border-color var(--t) var(--ease);
}
.topic-more-summary::-webkit-details-marker { display: none; }
.topic-more-summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--t) var(--ease);
}
.topic-more-summary:hover {
  background: var(--surface-2);
  color: var(--fg);
  border-color: var(--border-strong);
}
.topic-more-summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.topic-more[open] .topic-more-summary::after { transform: rotate(-135deg); }
.topic-more-close-label { display: none; }
.topic-more[open] .topic-more-open-label { display: none; }
.topic-more[open] .topic-more-close-label { display: inline; }
.topic-list-rest { margin-top: var(--s-3); }
.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(160px, 1fr);
  grid-template-areas: "id conf" "sub conf";
  align-items: center;
  gap: var(--s-1) var(--s-4);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.topic-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.topic-id {
  grid-area: id;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  min-width: 0;
}
.topic-name { font-weight: 500; color: var(--fg); }
.topic-conf {
  grid-area: conf;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  align-items: flex-end;
}
.conf-meter {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  justify-content: flex-end;
}
.conf-track {
  flex: 1;
  max-width: 120px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  overflow: hidden;
}
.conf-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width var(--t-slow) var(--ease);
}
.band-strong .conf-fill { background: var(--score-high); }
.band-mid .conf-fill    { background: var(--score-mid); }
.band-weak .conf-fill   { background: var(--score-low); }
.band-none .conf-fill   { background: var(--fg-faint); }
.conf-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
}
.conf-den { color: var(--fg-faint); }
.conf-next { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--fg-faint); }
.topic-sub {
  grid-area: sub;
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.topic-sub .band-strong,
.topic-sub .band-mid,
.topic-sub .band-weak { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.empty-table {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  padding: var(--s-6);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1px 5px;
  color: var(--fg);
}

/* ---------------------------------------------------------------------------
   16. Recent attempts + sparkline
   --------------------------------------------------------------------------- */
.recent-trend {
  margin-bottom: var(--s-5);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.sparkline {
  width: 100%;
  height: 56px;
  display: block;
}
.spark-grid { stroke: var(--border); stroke-width: 0.5; stroke-dasharray: 2 2; }
.spark-line {
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trend-text {
  margin-top: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.recent-list { display: flex; flex-direction: column; }
.recent-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
}
.recent-row:nth-child(odd) { background: var(--bg-subtle); }
.recent-row:last-child { border-bottom: none; }
.recent-date {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  color: var(--fg-faint);
  white-space: nowrap;
}
.recent-topic { color: var(--fg); font-size: var(--fs-sm); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-score { font-family: var(--font-mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; text-align: right; }
.recent-score .val { font-weight: 600; }

/* ---------------------------------------------------------------------------
   17. Confidence line/area chart container (dashboard, future-ready)
   --------------------------------------------------------------------------- */
.chart {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}
.chart-svg { width: 100%; height: 220px; display: block; }
.chart-axis { stroke: var(--border); stroke-width: 1; }
.chart-grid { stroke: var(--border); stroke-width: 0.5; stroke-dasharray: 3 3; }
.chart-line { stroke: var(--accent); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart-line-2 { stroke: var(--info); stroke-dasharray: 5 4; }
.chart-area { fill: var(--accent-soft); stroke: none; }
.chart-point { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart-axis-label { font-family: var(--font-mono); font-size: 10px; fill: var(--fg-faint); }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg);
  box-shadow: var(--shadow-md);
}

/* ---------------------------------------------------------------------------
   18. Empty / overview hero composition
   --------------------------------------------------------------------------- */
.overview.hero,
.overview.empty-state { margin-bottom: var(--s-4); }
.empty-state .subhead { margin-bottom: var(--s-6); }

/* ---------------------------------------------------------------------------
   19. Forms / fields  (auth + interview)
   --------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.field label,
.answer-label,
.field-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg);
}
.field-required { color: var(--accent-hover); margin-left: 2px; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
.invite-input,
textarea,
.answer,
.answer-textarea {
  width: 100%;
  background: var(--bg-subtle);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
.invite-input:focus,
textarea:focus,
.answer:focus,
.answer-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.invite-input { font-family: var(--font-mono); letter-spacing: 0.04em; }

.field-hint {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.auth-first-user { color: var(--fg-muted); }

/* error state */
.auth-error,
.step-error,
.field-error {
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--score-low);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
  margin-bottom: var(--s-4);
}
.step-error { margin-bottom: var(--s-5); }

/* answer textarea — auto-grow-friendly, generous min-height */
.answer-textarea {
  min-height: 160px;
  resize: vertical;
  field-sizing: content;
  line-height: var(--lh-normal);
}

/* ---------------------------------------------------------------------------
   20. Auth pages (login / register / landing-proof)
   --------------------------------------------------------------------------- */
.auth-solo {
  max-width: 420px;
  margin-inline: auto;
}
.auth-back { margin-bottom: var(--s-6); }
.auth-back a {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  transition: color var(--t) var(--ease);
}
.auth-back a:hover { color: var(--fg); }

.auth-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-8);
  box-shadow: var(--shadow-md);
}
.auth-title { font-size: var(--fs-2xl); margin-bottom: var(--s-2); }
.auth-subtitle { color: var(--fg-muted); margin-bottom: var(--s-6); font-size: var(--fs-base); }
.auth-notice {
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
  color: var(--fg);
  margin-bottom: var(--s-5);
}
.auth-submit { width: 100%; margin-top: var(--s-2); }
.auth-helper {
  margin-top: var(--s-6);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  text-align: center;
}
.auth-helper a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.auth-helper a:hover { color: var(--accent); }

/* ---------------------------------------------------------------------------
   21. Landing page
   --------------------------------------------------------------------------- */
.landing { display: flex; flex-direction: column; gap: var(--s-24); }
.landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-10);
  align-items: center;
}
.landing-hero-copy { max-width: 56ch; }
.landing-headline {
  font-size: var(--fs-4xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  margin: var(--s-3) 0 var(--s-5);
}
.landing-sub {
  font-size: var(--fs-lg);
  color: var(--fg-muted);
  line-height: var(--lh-normal);
  max-width: 60ch;
}
.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-8);
}
.landing-cta-foot { justify-content: center; }

/* feature row */
.landing-how { text-align: center; }
.auth-features,
.landing-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  text-align: left;
  margin-top: var(--s-6);
}
.auth-features li,
.landing-features li {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.feat-ic {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.feat-text { color: var(--fg-muted); font-size: var(--fs-base); line-height: var(--lh-normal); }
.feat-text b { color: var(--fg); font-weight: 600; }

/* decorative sample-verdict proof card (landing + reusable) */
.landing-proof,
.auth-proof { margin: 0; }
.proof-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: var(--s-3);
}
.proof-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  box-shadow: var(--shadow-lg);
}
.proof-score-row { display: flex; gap: var(--s-5); align-items: center; }
.proof-score {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.proof-score .big { font-size: var(--fs-4xl); font-weight: 600; }
.proof-score .den { font-size: var(--fs-lg); color: var(--fg-faint); }
.proof-meta { display: flex; flex-direction: column; gap: var(--s-2); }
.proof-band {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.proof-rule {
  display: inline-block;
  width: 18px; height: 2px;
  border-radius: var(--r-full);
  background: currentColor;
}
.proof-q { font-size: var(--fs-sm); color: var(--fg-muted); }
.proof-lists { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.proof-col { display: flex; flex-direction: column; gap: var(--s-2); }
.proof-lbl {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.proof-lbl-covered { color: var(--covered); }
.proof-lbl-missed { color: var(--missed); }
.proof-pt { font-size: var(--fs-sm); color: var(--fg-muted); line-height: var(--lh-snug); }

/* ---------------------------------------------------------------------------
   22. Interview shell
   --------------------------------------------------------------------------- */
.interview { max-width: var(--container-prose); margin-inline: auto; }

/* resume / discard / rate-limited interstitial */
.resume-prompt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-8);
}
.resume-prompt .headline { margin-bottom: var(--s-3); }
.rate-limited { border-color: rgba(245, 158, 11, 0.30); }
.rate-limited h2 { font-size: var(--fs-xl); margin-bottom: var(--s-3); }
.rate-limited p { color: var(--fg-muted); }
.discard-confirm { border-color: var(--border-strong); }

/* ---------------------------------------------------------------------------
   23. Interview — start screen (qstart)
   --------------------------------------------------------------------------- */
.qstart { max-width: var(--container-prose); margin-inline: auto; }
.qhead { margin-bottom: var(--s-8); }
.start-form-title { margin-bottom: var(--s-3); }
.qlede { font-size: var(--fs-md); color: var(--fg-muted); max-width: 56ch; }

.qsec {
  border: none;
  padding: 0;
  margin: 0 0 var(--s-8);
}
.qsec legend.eyebrow { margin-bottom: var(--s-3); padding: 0; }
.qsec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-3);
}
.qsec-head legend { margin-bottom: 0; }
.qsec-meta { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--fg-faint); }

/* track radio-cards (.ml-list) — hide native radio, card carries selection */
.ml-list { display: flex; flex-direction: column; gap: var(--s-2); }
.ml-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.ml-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--t) var(--ease);
}
.ml-row input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.ml-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ml-title { font-weight: 500; color: var(--fg); transition: font-weight var(--t) var(--ease); }
.ml-desc { font-size: var(--fs-sm); color: var(--fg-muted); }
.ml-mark {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border-strong);
  position: relative;
  transition: border-color var(--t) var(--ease);
}
.ml-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: var(--r-full);
  background: var(--accent);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.ml-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
/* selected: accent bar + wash + filled dot + heavier title */
.ml-row:has(input:checked) { background: var(--accent-soft); border-color: rgba(99, 102, 241, 0.40); }
.ml-row:has(input:checked)::before { background: var(--accent); }
.ml-row:has(input:checked) .ml-title { font-weight: 600; }
.ml-row:has(input:checked) .ml-mark { border-color: var(--accent); }
.ml-row:has(input:checked) .ml-mark::after { opacity: 1; transform: scale(1); }
.ml-row:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }

/* segmented control (.qs-strip) — grade + question count */
.qs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  padding: var(--s-1);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.qs-opt { flex: 1 1 auto; min-width: 56px; }
.qs-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.qs-opt label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.qs-opt label:hover { color: var(--fg); background: var(--surface-2); }
.qs-opt input:checked + label {
  background: var(--accent);
  color: var(--fg-on-accent);
}
.qs-opt input:focus-visible + label {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ring);
}

.qfooter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-10);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
}
.qsummary { font-size: var(--fs-sm); color: var(--fg-muted); }
.qsummary b { color: var(--fg); font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
   24. Interview — question step
   --------------------------------------------------------------------------- */
.step { display: flex; flex-direction: column; }
.step-head { margin-bottom: var(--s-6); }
.meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--fg-faint);
  margin-bottom: var(--s-4);
}
.progress-label { font-variant-numeric: tabular-nums; }
.mode { color: var(--fg-muted); }

/* segmented question-progress bar */
.qprogress {
  display: flex;
  gap: var(--s-1);
  margin-bottom: var(--s-5);
}
.qprogress-seg {
  flex: 1;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--surface-2);
}
.qprogress-seg.is-done { background: var(--accent-active); }
.qprogress-seg.is-current { background: var(--accent); }

.topic.badge-topic { margin-bottom: var(--s-4); }
.question-heading {
  font-size: var(--fs-2xl);
  line-height: var(--lh-snug);
  max-width: 40ch;
}

.answer-section { margin-top: var(--s-2); }
.answer-label { display: block; margin-bottom: var(--s-3); }
.answer-section .field-hint { margin-top: var(--s-3); }

/* MCQ radio cards */
.answer-choices { border: none; padding: 0; margin: 0; }
.answer-choices .answer-label { margin-bottom: var(--s-4); }
.choice-option {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  padding: var(--s-4);
  margin-bottom: var(--s-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  touch-action: manipulation;
  /* Tints any native control fallback (no-`appearance` browsers) toward the accent. */
  accent-color: var(--accent);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.choice-option:hover { border-color: var(--border-strong); background: var(--surface-2); }
.choice-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: border-color var(--t) var(--ease);
}
.choice-option input[type="radio"]::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: var(--r-full);
  background: var(--accent);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.choice-option input[type="radio"]:checked { border-color: var(--accent); }
.choice-option input[type="radio"]:checked::after { opacity: 1; transform: scale(1); }
.choice-option:has(input:checked) { border-color: rgba(99, 102, 241, 0.40); background: var(--accent-soft); }
.choice-option input[type="radio"]:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.choice-text { color: var(--fg); min-width: 0; overflow-wrap: anywhere; }

/* grading indicator — hidden unless an ancestor is .htmx-request */
.busy,
.grading-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.htmx-indicator { opacity: 0; display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; display: inline-flex; }
.grading-indicator::before {
  content: "";
  width: 13px; height: 13px;
  border-radius: var(--r-full);
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: qm-spin 0.7s linear infinite;
}
@keyframes qm-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   25. Interview — verdict
   --------------------------------------------------------------------------- */
.verdict { display: flex; flex-direction: column; }
.verdict-hero { margin-bottom: var(--s-6); }
.score-row {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  margin-top: var(--s-2);
}
.score,
.verdict-score {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  flex-shrink: 0;
}
.verdict-score .big,
.score .big { font-size: var(--fs-5xl); font-weight: 700; letter-spacing: -0.03em; }
.verdict-score .den,
.score .den { font-size: var(--fs-xl); color: var(--fg-faint); font-weight: 500; }
.verdict-score.band-none { font-size: var(--fs-5xl); font-weight: 700; }

.verdict-body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.verdict-body .band {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-family: var(--font-mono);
}
.verdict-body .headline { font-size: var(--fs-xl); margin-bottom: 0; max-width: 36ch; }
.question {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  line-height: var(--lh-snug);
  display: flex;
  gap: var(--s-2);
}
.question .q {
  font-family: var(--font-mono);
  color: var(--fg-faint);
  font-weight: 600;
  flex-shrink: 0;
}
.verdict-ungraded-note { font-size: var(--fs-sm); color: var(--fg-muted); }

/* assessment two-column lists */
.assess {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-6);
}
.list-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}
.verdict-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.verdict-label::before {
  content: "";
  width: 16px; height: 16px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
}
.verdict-label-covered { color: var(--covered); }
.verdict-label-covered::before {
  /* check icon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.verdict-label-missed { color: var(--missed); }
.verdict-label-missed::before {
  /* minus icon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}
.list-head .count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  color: var(--fg-faint);
}

.points { display: flex; flex-direction: column; gap: var(--s-3); }
.points li {
  position: relative;
  padding-left: var(--s-5);
  font-size: var(--fs-base);
  color: var(--fg);
  line-height: var(--lh-snug);
}
.verdict-covered .points li::before,
.verdict-missed .points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.45em;
  width: 14px; height: 14px;
  background-repeat: no-repeat;
  background-position: center;
}
.verdict-covered .points li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.verdict-missed .points li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}
.verdict-empty { font-size: var(--fs-sm); color: var(--fg-faint); }
.mcq-recall .verdict-body .headline { max-width: 44ch; }

/* ---------------------------------------------------------------------------
   26. Interview — summary
   --------------------------------------------------------------------------- */
.summary { display: flex; flex-direction: column; }
.summary-hero { margin-bottom: var(--s-4); }
.summary-title { margin-bottom: var(--s-6); }
.summary-score-row {
  display: flex;
  align-items: center;
  gap: var(--s-6);
}
.summary-avg {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  flex-shrink: 0;
}
.summary-avg .big { font-size: var(--fs-5xl); font-weight: 700; letter-spacing: -0.03em; }
.summary-avg .den { font-size: var(--fs-xl); color: var(--fg-faint); font-weight: 500; }
.summary-avg-meta { display: flex; flex-direction: column; gap: var(--s-2); }
.summary-avg-meta .band {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}
.summary-line { font-size: var(--fs-base); }
.summary-ungraded {
  margin-top: var(--s-4);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}

/* per-question recap rows with bars */
.summary-recap { gap: var(--s-3); }
.summary-recap li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: 0;
  padding-left: 0;
}
.summary-recap li::before { display: none; }
.summary-recap-label {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  white-space: nowrap;
}
.recap-bar {
  display: block;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  overflow: hidden;
}
.recap-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width var(--t-slow) var(--ease);
}
.recap-bar-fill.band-strong { background: var(--score-high); }
.recap-bar-fill.band-mid    { background: var(--score-mid); }
.recap-bar-fill.band-weak   { background: var(--score-low); }
.recap-bar-fill.band-none   { background: var(--fg-faint); }
.summary-recap-score {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}
.summary-back { margin-top: 0; }
.summary-helper a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.summary-helper a:hover { color: var(--accent); }

/* ---------------------------------------------------------------------------
   27. Toasts
   --------------------------------------------------------------------------- */
.toast-region {
  position: fixed;
  top: var(--s-5);
  right: var(--s-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-width: min(360px, calc(100vw - var(--s-8)));
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--t-slow) var(--ease);
}
.toast-success { border-color: rgba(34, 197, 94, 0.40); }
.toast-error { border-color: rgba(239, 68, 68, 0.40); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------------
   28. Bar-width utilities (.bar-w-0 … .bar-w-100, step 5 — 21 classes)
   --------------------------------------------------------------------------- */
.bar-w-0   { width: 0%; }
.bar-w-5   { width: 5%; }
.bar-w-10  { width: 10%; }
.bar-w-15  { width: 15%; }
.bar-w-20  { width: 20%; }
.bar-w-25  { width: 25%; }
.bar-w-30  { width: 30%; }
.bar-w-35  { width: 35%; }
.bar-w-40  { width: 40%; }
.bar-w-45  { width: 45%; }
.bar-w-50  { width: 50%; }
.bar-w-55  { width: 55%; }
.bar-w-60  { width: 60%; }
.bar-w-65  { width: 65%; }
.bar-w-70  { width: 70%; }
.bar-w-75  { width: 75%; }
.bar-w-80  { width: 80%; }
.bar-w-85  { width: 85%; }
.bar-w-90  { width: 90%; }
.bar-w-95  { width: 95%; }
.bar-w-100 { width: 100%; }

/* ---------------------------------------------------------------------------
   29. Responsive
   --------------------------------------------------------------------------- */

/* ≥768 — tablet */
@media (min-width: 768px) {
  .content { padding: var(--s-12) var(--s-8) var(--s-24); }
  .headline { font-size: var(--fs-4xl); }
  .landing-headline { font-size: var(--fs-5xl); }
  .auth-features,
  .landing-features { grid-template-columns: repeat(3, 1fr); }
  .stat-band { grid-template-columns: repeat(2, 1fr); }
}

/* ≥1024 — desktop */
@media (min-width: 1024px) {
  .landing-hero { grid-template-columns: 1.05fr 0.95fr; gap: var(--s-16); }
  .stat-band { grid-template-columns: repeat(4, 1fr); }
}

/* ≥1440 — wide */
@media (min-width: 1440px) {
  .content { max-width: var(--container-wide); }
}

/* ≤767 — phone: collapse multi-column blocks */
@media (max-width: 767px) {
  .assess { grid-template-columns: 1fr; gap: var(--s-5); }
  .proof-lists { grid-template-columns: 1fr; }
  .score-row,
  .summary-score-row { gap: var(--s-4); }
  .summary-recap li { grid-template-columns: auto 1fr; grid-template-areas: "label score" "bar bar"; }
  .summary-recap-label { grid-area: label; }
  .summary-recap-score { grid-area: score; }
  .summary-recap .recap-bar { grid-area: bar; }
  .qfooter { flex-direction: column; align-items: stretch; }
  .qfooter .btn { width: 100%; }
  .stat-band { grid-template-columns: 1fr; }
}

/* ≤430 — small phone: tighten gutters, prevent overflow */
@media (max-width: 430px) {
  .content { padding-left: var(--s-4); padding-right: var(--s-4); }
  .verdict-score .big,
  .score .big,
  .summary-avg .big { font-size: var(--fs-4xl); }
  .topic-row {
    grid-template-columns: 1fr;
    grid-template-areas: "id" "conf" "sub";
    gap: var(--s-3);
  }
  .topic-conf { align-items: flex-start; }
  .conf-meter { justify-content: flex-start; }
  .conf-track { max-width: none; }
  .auth-form { padding: var(--s-6); }
  .resume-prompt { padding: var(--s-6); }
}

/* ---------------------------------------------------------------------------
   30. Reduced motion
   --------------------------------------------------------------------------- */
@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;
  }
  .score-bar-fill,
  .cov-fill,
  .conf-fill,
  .recap-bar-fill,
  .ml-mark::after,
  .choice-option input[type="radio"]::after { transition: none; }
  .grading-indicator::before { animation: none; }
}
