/* ==========================================================================
   ABLE Preps · SAT Practice
   Two vocabularies on purpose. The app shell speaks ABLE Preps: the mark's
   orange-to-olive gradient and gold swoosh, warm paper, Fraunces headlines.
   The practice screen speaks Bluebook:
   white, grey hairlines, blue selection, Noto Serif passages. The point of the
   practice screen is to look like the real test, not like us.
   ========================================================================== */

:root {
  /* Sampled from logo-preps.png: the A runs #F29507 at the apex through
     #D98F16 and #BD8728 to #A48037 at the feet; the swoosh is #EAB54D.
     The bright orange only clears 2.2:1 on the page, so it lives in the
     numeral gradients and the mark itself; --accent (3.2:1) is for graphics
     and --accent-dark (5.8:1) for any orange text. */
  --bg: #FBF8F1;
  --paper: #FFFFFF;
  --ink: #2A2210;
  --ink-soft: #5C4E2A;
  --muted: #7A6A3D;
  --line: #EAE2CF;
  --line-strong: #D6CBAE;
  --accent: #C47A0A;
  --accent-dark: #8F5405;
  --accent-tint: #FCEED9;
  --accent-hot: #F29507;
  --accent-deep: #A48037;
  --gold: #EAB54D;
  --preps: #C47A0A;
  --preps-tint: #FCEED9;
  --panel: #2A2210;
  --good: #1E7217;  --good-tint: #E0F7DE;
  --mid: #905804;   --mid-tint: #FCEED9;
  --bad: #BC0606;   --bad-tint: #FCD9D9;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(42, 34, 16, 0.05), 0 2px 8px rgba(42, 34, 16, 0.05);
  --shadow-md: 0 2px 6px rgba(42, 34, 16, 0.06), 0 12px 32px rgba(42, 34, 16, 0.10);
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: "Fraunces", Georgia, serif;
  --sidebar: 248px;

  --bb-ink: #1E1E1E; --bb-soft: #505050; --bb-line: #D9D9D9;
  --bb-blue: #2E5BFF; --bb-blue-tint: #EAF0FF;
  --bb-mark: #D9A400; --bb-mark-tint: #FFF6D6;
  --font-passage: "Noto Serif", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink-soft); font-family: var(--font-body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
::selection { background: var(--gold); color: var(--ink); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; color: var(--ink); line-height: 1.14; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h2 { font-size: 21px; }
p { margin: 0 0 1em; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; display: block; }
.good { color: var(--good); } .mid { color: var(--mid); } .bad { color: var(--bad); } .dim { color: var(--line-strong); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; border: 1px solid transparent; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease; white-space: nowrap; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary { background: var(--panel); color: #fff; }
.btn-primary:hover { background: #4A3A14; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-text { background: none; border: none; color: var(--muted); font-size: 13.5px; text-decoration: underline; padding: 0; }
.btn-text:hover { color: var(--ink); }
.count { opacity: 0.7; font-weight: 500; }

/* ==========================================================================
   APP SHELL
   ========================================================================== */
#app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--paper); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; line-height: 1.15; padding: 4px 8px 18px; }
.brand img { width: 40px; height: auto; }
.brand small { display: block; font-size: 12px; font-weight: 500; color: var(--preps); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 16px 12px 6px; }
.nav-item { display: block; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 500; color: var(--ink-soft); text-decoration: none; transition: background 0.12s ease, color 0.12s ease; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 18px 12px 4px; font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.sidebar-foot a { color: var(--accent-dark); font-weight: 600; text-decoration: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: 12px; padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand-compact { padding: 0; font-size: 16px; }
.brand-compact img { width: 30px; }
.menu-toggle { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: none; display: grid; place-items: center; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { content: ""; display: block; width: 16px; height: 2px; background: var(--ink); position: relative; }
.menu-toggle span::before { position: absolute; top: -5px; } .menu-toggle span::after { position: absolute; top: 5px; }
.page { padding: 40px 40px 72px; max-width: 1180px; width: 100%; }

.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: clamp(30px, 3.6vw, 42px); max-width: 20ch; text-wrap: balance; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 12px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); }
.lede { font-size: 17px; max-width: 68ch; color: var(--ink-soft); }
.fine { font-size: 13px; color: var(--muted); margin: 0; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 28px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.card h2 { margin-bottom: 12px; }
.card > p { font-size: 15px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.two-col > .card { margin-bottom: 0; }
.two-col { margin-bottom: 20px; }

/* ---------- forms ---------- */
.filters { display: grid; gap: 14px; }
.filters label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink); }
.filters select, .filters input[type="text"], .filters input[type="number"], .filters input[type="date"] { font: inherit; font-size: 15px; font-weight: 400; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); width: 100%; }
.filters .btn { margin-top: 4px; justify-self: start; }
.filters-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.filters-row .btn { margin-top: 0; align-self: end; }
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .btn { margin-left: auto; }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.seg button { border: none; background: none; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); }
.seg button.on { background: var(--panel); color: #fff; font-weight: 600; }
.range-row { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.range-row input[type="range"] { flex: 1; accent-color: var(--accent-hot); }
.range-row output { min-width: 2.2em; text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.table tr:last-child td { border-bottom: none; }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; font-size: 14px; }
.ticks li::before { content: "✓"; color: var(--good); font-weight: 700; margin-right: 8px; }

/* ---------- stat bars (shared by dashboard, analytics, results) ---------- */
.stat { font-size: 14px; margin-bottom: 12px; }
.stat:last-child { margin-bottom: 0; }
.stat-label { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.stat-label small { color: var(--muted); font-weight: 500; white-space: nowrap; }
.stat-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-hot), var(--accent)); border-radius: 4px; }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.dash-grid > .card { margin-bottom: 0; }
.card-score { grid-column: span 2; grid-row: span 2; }
.card-streak { grid-column: span 2; display: flex; justify-content: space-around; align-items: center; gap: 12px; text-align: center; }
.card-next { grid-column: span 4; }
.card-actions { grid-column: span 6; }
.card-activity { grid-column: span 6; }
.dash-grid section:nth-child(2) { grid-column: span 2; }
.pred-total { font-family: var(--font-body); font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--accent-dark); background: linear-gradient(160deg, var(--accent-hot) 0%, var(--accent) 45%, var(--accent-deep) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; width: fit-content; margin: 6px 0 4px; }
.pred-total small { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; -webkit-text-fill-color: var(--muted); color: var(--muted); margin-top: 6px; font-weight: 600; }
.pred-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.pred-split div { background: var(--bg); border-radius: var(--radius-md); padding: 12px 14px; }
.pred-split span { display: block; font-size: 12.5px; color: var(--muted); }
.pred-split strong { font-size: 24px; color: var(--ink); }
.pred-empty p { font-size: 14.5px; }
.focus-row { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); margin-bottom: 8px; font-size: 14px; color: var(--ink); }
.focus-row:hover { border-color: var(--accent); }
.focus-row strong { font-size: 15px; }
.streak-num { font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1; }
.streak-num small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 6px; }
.streak-num.warn { color: var(--preps); }
.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.action-grid button { text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); display: grid; gap: 3px; transition: border-color 0.12s ease, transform 0.12s ease; }
.action-grid button:hover { border-color: var(--accent); transform: translateY(-2px); }
.action-grid strong { color: var(--ink); font-size: 15px; }
.action-grid span { font-size: 12.5px; color: var(--muted); }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heatmap i, .heat-legend i { display: block; width: 12px; height: 12px; border-radius: 2px; background: var(--line); }
.hm-1 { background: #F5DFB5 !important; } .hm-2 { background: var(--gold) !important; } .hm-3 { background: var(--accent) !important; } .hm-4 { background: var(--accent-dark) !important; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.heat-legend span { margin: 0 4px; }

/* ---------- question bank ---------- */
.skill-group { padding: 20px 24px; }
.skill-group-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.skill-group-head h2 { margin: 0; font-size: 19px; }
.skill-group-head .btn { margin-left: auto; }
.skill-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.skill-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.skill-name small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.skill-acc { min-width: 46px; text-align: right; font-weight: 700; font-size: 14px; }

/* ---------- planner ---------- */
.week { padding: 20px 24px; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.week-head h2 { margin: 0; font-size: 19px; }
.session { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.session-body { flex: 1; display: grid; gap: 2px; }
.session-body strong { color: var(--ink); font-size: 14.5px; }
.session-body span { font-size: 12.5px; color: var(--muted); }
.session-actions { display: flex; align-items: center; gap: 12px; }
.session.done .session-body strong { text-decoration: line-through; color: var(--muted); }
.session.done .session-body strong::after { content: " ✓"; color: var(--good); text-decoration: none; display: inline-block; }
.card-next .session { border-top: none; padding-top: 4px; }

/* ---------- vocab ---------- */
.flash { min-height: 190px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--bg); display: grid; place-items: center; text-align: center; padding: 22px; cursor: pointer; margin-bottom: 14px; }
.flash-front { font-family: var(--font-head); font-size: 36px; color: var(--ink); }
.flash-back strong { font-family: var(--font-head); font-size: 24px; color: var(--ink); }
.flash-back em { color: var(--muted); font-size: 14px; margin-left: 6px; }
.flash-back p { font-size: 15px; margin: 8px 0 0; color: var(--ink); }
.flash-back .ex { font-size: 13.5px; color: var(--ink-soft); font-style: italic; margin-top: 8px; }
.flash-controls { display: flex; gap: 8px; justify-content: center; }
.quiz-q { font-size: 15.5px; color: var(--ink); }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { text-align: left; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); font-size: 14.5px; color: var(--ink); }
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt.correct { border-color: var(--good); background: var(--good-tint); }
.quiz-opt.wrong { border-color: var(--bad); background: var(--bad-tint); }
.quiz-opt:disabled { cursor: default; }
.quiz-fb { margin-top: 12px; font-size: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.quiz-fb em { color: var(--ink-soft); }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.word-chip { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); font-size: 13px; }
.word-chip strong { color: var(--ink); font-size: 14.5px; }
.word-chip em { color: var(--muted); font-size: 12px; }
.word-chip span { display: block; color: var(--ink-soft); margin-top: 2px; }
.word-chip.mastered { border-color: var(--good); background: var(--good-tint); }

/* ---------- analytics ---------- */
.pace-row { display: grid; grid-template-columns: 90px auto 1fr; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pace-row strong { font-size: 20px; color: var(--ink); }
.pace-row small { color: var(--muted); font-size: 12.5px; }

/* ---------- calculator ---------- */
.calc-out .pred-total { font-size: 56px; }

/* ---------- results ---------- */
#view-results { background: var(--bg); min-height: 100vh; }
.results { max-width: 860px; margin: 0 auto; padding: 48px 28px 80px; }
.results h1 { font-size: clamp(30px, 4vw, 42px); }
.results h2 { font-size: 20px; margin-top: 36px; }
.score-row { display: flex; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-top: 8px; }
.score-big { display: flex; flex-direction: column; }
.score-big span { font-family: var(--font-body); font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--accent-dark); background: linear-gradient(160deg, var(--accent-hot) 0%, var(--accent) 45%, var(--accent-deep) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; width: fit-content; }
.score-big small { font-size: 15px; color: var(--muted); margin-top: 6px; }
.score-time { font-size: 14px; color: var(--muted); padding-bottom: 8px; }
.estimate { display: flex; align-items: center; gap: 22px; margin-top: 24px; padding: 20px 24px; }
.est-num { font-size: 44px; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.est-num .est-dim { color: var(--line-strong); }
.est-label { font-size: 15px; color: var(--ink); }
.est-label small { color: var(--muted); font-size: 12.5px; }
.domain-bars { display: grid; gap: 14px; }
.review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.review-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); font-size: 14.5px; color: var(--ink); }
.review-item:hover { border-color: var(--line-strong); }
.review-num { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.review-num.ok { background: var(--good); } .review-num.no { background: var(--bad); } .review-num.skip { background: var(--muted); }
.review-meta { font-size: 12.5px; color: var(--muted); }
.review-ans { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.results-actions { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; }

/* ==========================================================================
   PRACTICE SCREEN (Bluebook vocabulary)
   ========================================================================== */
#view-practice { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: #fff; color: var(--bb-ink); }
.test-bar, .test-foot { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--bb-line); min-height: 64px; }
.test-foot { border-bottom: none; border-top: 1px solid var(--bb-line); }
.test-bar-left, .test-bar-right, .test-foot-right { display: flex; align-items: center; gap: 22px; min-width: 0; }
.test-bar-right, .test-foot-right { justify-content: flex-end; }
.test-bar-center { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.test-section { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-link { background: none; border: none; color: var(--bb-soft); font-size: 13.5px; padding: 4px 0; white-space: nowrap; }
.test-link:hover { color: var(--bb-ink); text-decoration: underline; }
.chev { font-size: 11px; }
.timer { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.timer.low { color: var(--bad); }
.rush-progress { font-size: 12.5px; color: var(--bb-soft); }
.test-tool { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: var(--bb-ink); font-size: 12px; padding: 4px 2px; }
.test-tool:hover { color: var(--bb-blue); }
.directions { flex: none; padding: 16px 24px; background: #F5F5F5; border-bottom: 1px solid var(--bb-line); font-size: 14px; color: var(--bb-soft); display: flex; gap: 20px; align-items: flex-start; }
.directions p { margin: 0; flex: 1; max-width: 80ch; }
.directions .btn { padding: 6px 14px; border-radius: 6px; background: #fff; border: 1px solid var(--bb-line); color: var(--bb-ink); }
.test-body { flex: 1; min-height: 0; display: flex; }
.pane { flex: 1 1 50%; min-width: 0; overflow-y: auto; padding: 0 44px 36px; }
.pane-left { padding-top: 36px; }
.pane-divider { flex: none; width: 2px; background: var(--bb-line); }
.pane-left.empty { display: none; }
.pane-left.empty + .pane-divider { display: none; }
.test-body.math .pane-right { max-width: 760px; margin: 0 auto; }
.passage { font-family: var(--font-passage); font-size: 16.5px; line-height: 1.75; color: var(--bb-ink); white-space: pre-wrap; }
.passage.mono-table { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6; }
/* The question header runs edge to edge across the right pane, like the
   grey band in Bluebook, and stays put while the choices scroll under it. */
.q-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; background: #F3F3F3; border-bottom: 1px solid var(--bb-line); margin: 0 -44px 20px; padding: 10px 44px; }
.q-num { width: 28px; height: 28px; background: var(--bb-ink); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; flex: none; }
.q-mark { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--bb-soft); font-size: 13.5px; padding: 4px 2px; white-space: nowrap; }
.q-mark:hover { color: var(--bb-ink); }
.q-mark[aria-pressed="true"] { color: var(--bb-mark); font-weight: 600; }
.q-mark[aria-pressed="true"] svg { fill: currentColor; }
.q-elim { margin-left: auto; background: none; border: 1px solid var(--bb-line); border-radius: 4px; padding: 3px 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--bb-soft); }
.q-elim[aria-pressed="true"] { background: var(--bb-ink); color: #fff; border-color: var(--bb-ink); }
.q-stem { font-family: var(--font-passage); font-size: 16.5px; line-height: 1.7; margin-bottom: 22px; white-space: pre-wrap; }
.q-choices { display: grid; gap: 12px; }
.choice { display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left; padding: 12px 14px; border: 1.5px solid var(--bb-ink); border-radius: 8px; background: #fff; font-family: var(--font-passage); font-size: 16px; line-height: 1.55; color: var(--bb-ink); position: relative; transition: background 0.12s ease, border-color 0.12s ease; }
.choice:hover { background: #F7F7F7; }
.choice-letter { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--bb-ink); display: grid; place-items: center; font-family: var(--font-body); font-size: 13px; font-weight: 700; margin-top: 1px; }
.choice.selected { border-color: var(--bb-blue); border-width: 2.5px; padding: 11px 13px; background: var(--bb-blue-tint); }
.choice.selected .choice-letter { background: var(--bb-blue); color: #fff; border-color: var(--bb-blue); }
.choice.eliminated { opacity: 0.5; }
.choice.eliminated .choice-text { text-decoration: line-through; }
.choice .elim-x { display: none; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--bb-ink); background: #fff; font-size: 12px; font-weight: 700; font-family: var(--font-body); place-items: center; }
.elim-mode .choice .elim-x { display: grid; }
.elim-mode .q-choices { padding-right: 20px; }
.choice.correct { border-color: var(--good); background: var(--good-tint); }
.choice.correct .choice-letter { background: var(--good); border-color: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-tint); }
.choice.wrong .choice-letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.choice:disabled { cursor: default; }
.choice:disabled:hover { background: #fff; }
.choice.correct:disabled:hover { background: var(--good-tint); }
.choice.wrong:disabled:hover { background: var(--bad-tint); }
.spr { display: grid; gap: 8px; max-width: 320px; }
.spr label { font-size: 13px; color: var(--bb-soft); }
.spr input { font: inherit; font-family: var(--font-passage); font-size: 18px; padding: 10px 12px; border: 1.5px solid var(--bb-ink); border-radius: 8px; }
.spr input.correct { border-color: var(--good); background: var(--good-tint); }
.spr input.wrong { border-color: var(--bad); background: var(--bad-tint); }
.spr-answer { font-size: 13px; color: var(--bb-soft); }
.q-feedback { margin-top: 22px; padding: 16px 18px; border-radius: 8px; font-size: 15px; line-height: 1.6; border-left: 4px solid var(--bb-line); background: #F7F7F7; }
.q-feedback.correct { border-left-color: var(--good); background: var(--good-tint); }
.q-feedback.wrong { border-left-color: var(--bad); background: var(--bad-tint); }
.q-feedback strong { display: block; margin-bottom: 4px; }
.q-feedback .tag { font-size: 12px; color: var(--bb-soft); margin-top: 8px; }
.test-foot-left { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-nav-btn { background: var(--bb-ink); color: #fff; border: none; border-radius: 6px; padding: 9px 16px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn-nav { padding: 9px 22px; border-radius: 999px; font-size: 14px; background: #fff; border: 1.5px solid var(--bb-blue); color: var(--bb-blue); }
.btn-nav:hover { background: var(--bb-blue-tint); transform: none; }
.btn-nav-primary { background: var(--bb-blue); color: #fff; }
.btn-nav-primary:hover { background: #1F49E6; }
.btn-nav:disabled { opacity: 0.4; }
.btn-nav:disabled:hover { background: #fff; }
.btn-nav-primary:disabled:hover { background: var(--bb-blue); }
.nav-pop { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 30; width: min(560px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--bb-line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); padding: 18px 20px 20px; }
.nav-pop::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%) rotate(45deg); width: 16px; height: 16px; background: #fff; border-right: 1px solid var(--bb-line); border-bottom: 1px solid var(--bb-line); }
.nav-pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.nav-pop-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--bb-soft); }
.nav-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--bb-soft); padding-bottom: 12px; border-bottom: 1px solid var(--bb-line); margin-bottom: 14px; }
.nav-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; display: inline-block; border-radius: 2px; border: 1.5px solid var(--bb-ink); }
.lg-current { border-radius: 50%; background: var(--bb-ink); }
.lg-unanswered { border-style: dashed; }
.lg-marked { background: var(--bb-mark-tint); border-color: var(--bb-mark); }
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 8px 8px; margin-bottom: 16px; padding-top: 6px; }
.nav-q { height: 38px; border-radius: 4px; border: 1.5px dashed var(--bb-ink); background: #fff; font-size: 13px; font-weight: 600; color: var(--bb-ink); position: relative; }
.nav-q.answered { border-style: solid; background: var(--bb-blue-tint); border-color: var(--bb-blue); color: var(--bb-blue); }
.nav-q.marked { background: var(--bb-mark-tint); border-color: var(--bb-mark); border-style: solid; }
.nav-q.marked::after { content: ""; position: absolute; top: -5px; right: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--bb-mark); }
.nav-q.current::before { content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--bb-ink); }
.nav-q.current { border-style: solid; }
.calc-panel {
  position: fixed; top: 76px; right: 16px; width: min(480px, calc(100vw - 32px)); height: calc(100vh - 152px); z-index: 25;
  background: #fff; border: 1px solid var(--bb-line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex; flex-direction: column; overflow: hidden; min-width: min(320px, calc(100vw - 32px)); min-height: min(280px, calc(100vh - 152px));
}
/* Expanded: fills the space between the top and bottom bars. !important so it
   wins over the inline left/top/width/height a drag or resize leaves behind. */
.calc-panel.max { left: 16px !important; top: 76px !important; right: 16px !important; width: auto !important; height: calc(100vh - 152px) !important; }
.calc-head { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--bb-line); font-size: 13.5px; font-weight: 600; cursor: move; user-select: none; touch-action: none; }
.calc-head span { flex: 1; }
.calc-head .grip { color: var(--bb-line); letter-spacing: 1px; margin-right: 6px; font-weight: 400; }
.calc-btn { background: none; border: 1px solid transparent; border-radius: 5px; width: 28px; height: 28px; display: grid; place-items: center; color: var(--bb-soft); font-size: 15px; line-height: 1; }
.calc-btn:hover { background: #F3F3F3; color: var(--bb-ink); }
.calc-panel iframe { flex: 1; border: none; width: 100%; }
/* While dragging or resizing, the iframe must not swallow the pointer. */
.calc-shield { position: absolute; inset: 0; display: none; }
.calc-panel.moving .calc-shield { display: block; }
.calc-panel.moving { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28); }
.calc-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; }
.calc-resize::before { content: ""; position: absolute; right: 4px; bottom: 4px; width: 8px; height: 8px; border-right: 2px solid var(--bb-soft); border-bottom: 2px solid var(--bb-soft); opacity: 0.6; }
.calc-panel.max .calc-resize { display: none; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .card-score, .card-streak, .card-next, .card-actions, .card-activity, .dash-grid section:nth-child(2) { grid-column: span 2; grid-row: auto; }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-md); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; }
  .page { padding: 24px 18px 60px; }
  .two-col { grid-template-columns: 1fr; }
  .skill-row { grid-template-columns: 1fr auto; }
  .skill-row .btn { grid-column: span 2; justify-self: start; }
  .test-body { flex-direction: column; overflow-y: auto; }
  .pane { flex: none; overflow: visible; padding: 0 22px 24px; }
  .pane-left { padding-top: 24px; }
  .pane-divider { width: auto; height: 2px; }
  .q-head { position: static; margin: 0 -22px 18px; padding: 8px 22px; }
  .test-bar, .test-foot { padding: 0 14px; grid-template-columns: auto 1fr auto; gap: 10px; }
  .test-bar-left, .test-bar-right { gap: 12px; }
  .test-tool span, .test-foot-left { display: none; }
  .btn-nav { padding: 9px 16px; }
  .dash-grid { grid-template-columns: 1fr; }
  .card-score, .card-streak, .card-next, .card-actions, .card-activity, .dash-grid section:nth-child(2) { grid-column: span 1; }
  .card-streak { flex-wrap: wrap; }
}
