/* LSATPathway rebuild prototype — plain stylesheet, no frameworks. */

:root {
  --ink: #231e14;
  --muted: #6f6350;
  --bg: #faf6ee;
  --card: #fffdf8;
  --line: #e7ddc9;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --brand: #c2410c;
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
}

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

/* Brand type: Fraunces for display, Inter for UI/body */
h1, h2, h3, .brand-name, .hero h1, .hero-marketing h1, .cta-band h2,
.dash-hi, .dt-rest, .page-title, .lesson-title {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: -.01em;
}


body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }

main.container { padding-top: 2rem; padding-bottom: 4rem; }

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

/* Header / nav — warm ink bar, not the accent color, so buttons keep their pop. */
.site-header { background: #231e14; color: #fff; position: sticky; top: 0; z-index: 60; }
/* Timed runners have their own sticky timer bar — let the header scroll away there. */
body:has(.timer-bar) .site-header { position: static; }
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: .75rem; padding-bottom: .75rem; flex-wrap: wrap; gap: .5rem; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: #dbe4f0; text-decoration: none; }
.nav-links a:hover { color: #fff; }
.nav-user { color: #dbe4f0; font-size: .9rem; }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: none; color: #dbe4f0; cursor: pointer; font: inherit; padding: 0; }
.link-btn:hover { color: #fff; text-decoration: underline; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 1rem 0; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: .4rem;
  padding: .55rem 1.1rem;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.15rem; border-radius: .5rem; }
.btn-small { padding: .35rem .8rem; font-size: .9rem; }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }

/* Hero */
.hero { text-align: center; padding: 3rem 0; }
.hero h1 { font-size: 2rem; margin-bottom: .5rem; }
.hero-links { margin-top: 1.5rem; display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
/* Marketing hero (signed-out homepage). */
.hero-marketing {
  background: linear-gradient(135deg, #2a1e10 0%, #4a2c12 60%, #1f1409 100%);
  color: #fff; border-radius: 1rem; padding: 4rem 2rem 3rem;
  margin: 1rem 0 2.5rem; position: relative; overflow: hidden;
}
.hero-marketing::before {
  content: ''; position: absolute; top: 0; left: 0; width: 6px; top: 0; bottom: 0;
  background: #ea580c;
}
.hero-marketing .eyebrow { color: #fdba74; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; font-weight: 700; margin: 0 0 1rem; }
.hero-marketing h1 { font-size: 2.75rem; line-height: 1.15; margin: 0 0 1rem; color: #fff; max-width: 40rem; margin-left: auto; margin-right: auto; }
.hero-sub { font-size: 1.15rem; color: #e8dcc8; max-width: 44rem; margin: 0 auto; line-height: 1.6; }
.hero-sub strong { color: #fff; }
.hero-marketing .hero-links { margin-top: 2rem; }
.hero-marketing .btn-outline { border-color: rgba(255,255,255,.5); color: #fff; }
.hero-marketing .btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.hero-note { margin: 1.75rem 0 0; color: #c9b797; font-size: .9rem; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (max-width: 640px) {
  .hero-marketing { padding: 2.5rem 1.25rem 2rem; }
  .hero-marketing h1 { font-size: 2rem; }
}

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .6rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.plan-card h2 { margin: 0; }
.plan-price { font-size: 1.8rem; font-weight: 700; margin: 0; }
a.card.drill-card { text-decoration: none; color: inherit; }
a.card.drill-card:hover { border-color: var(--accent); }

/* Lists, badges, misc */
.muted { color: var(--muted); }
.error { color: var(--red); font-weight: 600; }
.badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border-radius: .3rem;
  font-size: .75rem;
  padding: .1rem .45rem;
  margin-left: .5rem;
  vertical-align: middle;
}
.badge-ok { background: #dcfce7; color: #166534; }
.section-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: .3rem;
  font-size: .8rem;
  padding: .1rem .5rem;
  margin-right: .5rem;
}
.unit { margin-bottom: 2rem; }
.lesson-list { list-style: none; padding: 0; }
.lesson-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.lesson-body { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: 1.5rem; }
.lesson-body p { margin: 0 0 1rem; }
.lesson-body ul, .lesson-body ol { margin: 0 0 1rem; padding-left: 1.5rem; }

/* Auth forms */
.auth-form { display: flex; flex-direction: column; gap: 1rem; max-width: 380px; }
.auth-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.auth-form input { padding: .55rem .7rem; font-size: 1rem; border: 1px solid var(--line); border-radius: .4rem; }

/* Tables */
.stats { border-collapse: collapse; background: var(--card); }
.stats th, .stats td { border: 1px solid var(--line); padding: .5rem .9rem; text-align: left; }
.stats th { background: #eef2f7; }

/* Drill pages */
.drill-top { margin-bottom: 1rem; }
.drill-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2rem; align-items: start; }
@media (max-width: 760px) { .drill-grid { grid-template-columns: 1fr; } }
.passage-panel { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: 1.5rem 1.75rem; }
.passage-panel h2 { margin-top: 0; font-size: 1.1rem; }
.passage-text { white-space: pre-wrap; font-size: 1.02rem; line-height: 1.75; max-height: 70vh; overflow-y: auto; }
.question-panel .stimulus { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: 1.25rem; margin-bottom: 1rem; }
.stem { font-size: 1.05rem; }
.choices { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.choice {
  display: flex; gap: .75rem; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: .5rem;
  padding: .7rem .9rem; cursor: pointer;
}
.choice-letter { font-weight: 700; min-width: 1.25rem; }
.choice.correct { border-color: var(--green); background: var(--green-bg); }
.choice.wrong { border-color: var(--red); background: var(--red-bg); }
.tag { font-size: .75rem; font-weight: 700; border-radius: .3rem; padding: .1rem .45rem; margin-left: auto; white-space: nowrap; }
.tag-correct { background: var(--green); color: #fff; }
.tag-wrong { background: var(--red); color: #fff; }
.explanation { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: 1.25rem; margin: 1rem 0; }
.explanation h3 { margin-top: 0; }
.score-line { font-size: 1.25rem; }
.review-list { list-style: none; padding: 0; }
.review-list li { padding: .5rem .8rem; border: 1px solid var(--line); border-radius: .4rem; margin-bottom: .4rem; background: var(--card); }
.review-correct { border-left: 4px solid var(--green); }
.review-wrong { border-left: 4px solid var(--red); }

/* Timed test runner (diagnostic + timed sections) */
.timer-bar {
  position: sticky; top: 0; z-index: 60;
  background: var(--accent); color: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .65rem 1rem; border-radius: .5rem;
  font-weight: 700; font-size: 1.05rem; margin-bottom: 1rem;
}
.timer-bar.danger { background: var(--red); }
.runner-wrap { max-width: 720px; margin: 0 auto; }
.runner-wrap:has(.rc-runner-grid) { max-width: 1120px; }
.rc-runner-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2rem; align-items: start; }
main.container:has(.drill-grid) { max-width: 1120px; }
.rc-passage-sticky { position: sticky; top: .75rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
@media (max-width: 760px) {
  .rc-runner-grid { grid-template-columns: 1fr; }
  .rc-passage-sticky { position: static; max-height: 42vh; }
}
.qnav { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.qnav-btn {
  min-width: 2.75rem; min-height: 2.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: .4rem; background: var(--card);
  text-decoration: none; color: var(--ink); font-weight: 600;
}
.qnav-btn.answered { background: var(--accent); border-color: var(--accent); color: #fff; }
.qnav-btn.flagged { border-color: var(--red); box-shadow: inset 0 -3px 0 var(--red); }
.qnav-btn.current { outline: 2px solid var(--ink); outline-offset: 1px; }
.runner-nav { display: flex; gap: .6rem; margin: 1.25rem 0; flex-wrap: wrap; }
.choice.picked { border-color: var(--accent); background: #eef2f7; }
.flag-row { margin: .9rem 0; }
.review-card { background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: 1.25rem; margin-bottom: 1.25rem; }
.cta-row { margin-top: 1.25rem; }
details summary { cursor: pointer; font-weight: 600; margin-bottom: .5rem; }

/* Mobile: roomy touch targets, readable measure, no horizontal scroll */
@media (max-width: 480px) {
  .choice { padding: 1rem .9rem; font-size: 1.02rem; }
  .btn { padding: .7rem 1.2rem; }
  .conf-pill { padding: .6rem 1.1rem; }
  .focus-toggle { padding: .6rem; margin: -.6rem 0; }
  .kbd-hint { display: none; }
  .timer-bar { font-size: 1rem; padding: .6rem .8rem; }
  .timer-bar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .container { padding-left: 1rem; padding-right: 1rem; }
  .stimulus, .passage-text { overflow-wrap: break-word; }
  .stats { font-size: .85rem; }
  .stats th, .stats td { padding: .4rem .5rem; }
}

/* Admin + tutor */
.small { font-size: .85rem; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
.nowrap { white-space: nowrap; }
.notice {
  background: var(--green-bg); border: 1px solid var(--green);
  border-radius: .5rem; padding: .8rem 1rem;
}
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.toolbar input[type="search"], .toolbar select, .toolbar input[type="text"] {
  padding: .5rem .7rem; font-size: 1rem; border: 1px solid var(--line); border-radius: .4rem;
}
.stack-form { display: flex; flex-direction: column; gap: .9rem; max-width: 560px; margin: 1rem 0; }
.stack-form.wide { max-width: 760px; }
.stack-form label, .stack-form fieldset { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.stack-form fieldset { border: 1px solid var(--line); border-radius: .4rem; padding: .8rem 1rem; }
.stack-form input[type="text"], .stack-form input[type="search"], .stack-form input[type="tel"],
.stack-form select, .stack-form textarea {
  padding: .55rem .7rem; font-size: 1rem; font-weight: 400;
  border: 1px solid var(--line); border-radius: .4rem; width: 100%;
}
.stack-form textarea { font-family: inherit; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; }
.check-label { flex-direction: row !important; align-items: center; gap: .5rem !important; font-weight: 400; }
.check-group { gap: .5rem !important; }
.check-group .check-label { font-weight: 400; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #991b1b; color: #fff; }
.danger-link { color: var(--red); }
.danger-link:hover { color: #991b1b; }
.pager { display: flex; gap: .6rem; margin: 1rem 0; }

/* Progress dashboard */
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { font-size: 11px; fill: var(--muted); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; }
.chart-line-strong { stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--accent); }
.activity-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: .35rem; margin: 1rem 0 2rem; }
.activity-cell { aspect-ratio: 1; border: 1px solid var(--line); border-radius: .3rem; display: flex; align-items: center; justify-content: center; }
.activity-cell span { font-size: .62rem; color: var(--muted); }
.activity-cell.lv1 { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.activity-cell.lv2 { background: color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }
.activity-cell.lv2 span { color: #fff; }
.activity-cell.lv3 { background: var(--accent); border-color: var(--accent); }
.activity-cell.lv3 span { color: #fff; }
@media (max-width: 560px) { .activity-grid { grid-template-columns: repeat(6, 1fr); } }

/* Break screen */
.break-card { text-align: center; }
.break-timer { font-size: 3rem; font-weight: 700; margin: .5rem 0; font-variant-numeric: tabular-nums; }
.break-timer.danger { color: var(--red); }

/* Forms */
.auth-form select, .auth-form textarea, .inline-form input[type="text"] {
  padding: .55rem .7rem; font-size: 1rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit;
}
.auth-form textarea { resize: vertical; }
.table-wrap { overflow-x: auto; }
.small { font-size: .85rem; }

/* Annotations: highlighter, underline, strikethrough, notes */
.annotatable { cursor: text; }
.mark.hl-y { background: #fef08a; }
.mark.hl-p { background: #fecdd3; }
.mark.hl-g { background: #bbf7d0; }
.mark.ul { text-decoration: underline; text-decoration-thickness: 2px; }
.mark.strike { text-decoration: line-through; }
#annot-bar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  display: flex; gap: .35rem; align-items: center;
  background: #1f2937; border-radius: .6rem; padding: .45rem .6rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.3); z-index: 60;
}
#annot-bar[hidden] { display: none; }
#annot-bar button {
  border: 0; background: #374151; color: #fff; border-radius: .4rem;
  width: 2.4rem; height: 2.4rem; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#annot-bar button:active { background: #4b5563; }
#annot-bar .sw { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: .2rem; }
#annot-bar .sw.hl-y { background: #fef08a; }
#annot-bar .sw.hl-p { background: #fecdd3; }
#annot-bar .sw.hl-g { background: #bbf7d0; }
#annot-bar .sw.ul-sw { color: #fff; text-decoration: underline; font-weight: 700; }
#annot-bar .sw.strike-sw { color: #fff; text-decoration: line-through; font-weight: 700; }
.qnote-wrap { margin: 1rem 0; }
.qnote-wrap label { display: block; font-weight: 600; margin-bottom: .35rem; }
.qnote {
  width: 100%; min-height: 4.5rem; padding: .6rem .7rem; font: inherit; font-size: .95rem;
  border: 1px solid var(--line); border-radius: .4rem; resize: vertical; background: #fffef5;
}
.annot-hint { font-size: .8rem; color: var(--muted); margin-top: .5rem; }

/* Gamification: streak, badges, alerts */
.streak-row { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.streak-card { background: var(--card, #f8fafc); border: 1px solid var(--line); border-radius: .6rem; padding: .7rem 1.1rem; text-align: center; }
.streak-num { display: block; font-size: 2rem; font-weight: 800; line-height: 1; }
.streak-label { font-size: .8rem; color: var(--muted); }
.badges { display: flex; gap: .4rem; }
.badge { display: inline-block; padding: .25rem .55rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); color: var(--muted); }
.badge.earned { background: #fef3c7; border-color: #f59e0b; color: #92400e; font-weight: 700; }
.badge.due-now { background: #fef3c7; border-color: #f59e0b; color: #92400e; font-weight: 700; }
.alerts { margin: 1rem 0; display: grid; gap: .5rem; }
.alert { margin: 0; padding: .6rem .8rem; border-radius: .5rem; border-left: 4px solid var(--line); background: var(--card, #f8fafc); }
.alert-good { border-left-color: #16a34a; }
.alert-warn { border-left-color: #f59e0b; }
.alert-info { border-left-color: #3b82f6; }

/* Study plan */
.milestones, .checklist { list-style: none; padding: 0; display: grid; gap: .4rem; }
.milestone, .checklist li { display: flex; align-items: center; gap: .6rem; }
.milestone.done .ms-check, .goal.done span:first-of-type { color: #16a34a; }
.ms-check { font-weight: 700; width: 1.4rem; }
.goal.done span:nth-of-type(2) { text-decoration: line-through; color: var(--muted); }
.inline-add { display: flex; gap: .5rem; margin: .8rem 0; flex-wrap: wrap; }
.inline-add input[type="text"] { flex: 1; min-width: 12rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit; }
.lesson-complete { margin: 1.5rem 0; }

/* Forums */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.card { display: block; border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; text-decoration: none; color: inherit; }
.card:hover { border-color: var(--accent); }
.thread-list { list-style: none; padding: 0; display: grid; gap: .6rem; }
.post { border: 1px solid var(--line); border-radius: .6rem; padding: .8rem 1rem; margin-bottom: .8rem; }
.post-meta { margin-top: 0; }
.post-body p { margin: .4rem 0; }

/* Question reports */
.report-box { margin: 1rem 0; border: 1px dashed var(--line); border-radius: .6rem; padding: .6rem .9rem; }
.report-box summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.report-box summary:hover { color: var(--accent); }
.report-form { display: grid; gap: .6rem; margin-top: .7rem; }
.report-form label { display: grid; gap: .3rem; font-size: .9rem; }
.report-form select, .report-form textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--bg); color: inherit; max-width: 100%; }

/* Trial banner */
.trial-banner { background: #fef3c7; border-bottom: 1px solid #f59e0b; color: #92400e; padding: .6rem 1rem; text-align: center; font-size: .92rem; }
.trial-banner a { color: #92400e; font-weight: 700; }

/* Explanations: preserve the plain-text paragraph breaks in thorough explanations */
.explanation p { white-space: pre-line; }

/* Trial banner dismiss button sits inline at the right */
.trial-banner { display: flex; align-items: center; justify-content: center; gap: .8rem; }
.trial-dismiss { display: inline; }
.trial-dismiss .link-btn { color: #92400e; font-size: 1.1rem; padding: 0 .3rem; }

/* Pricing benefit lists */
.plan-features { list-style: none; margin: .6rem 0 1rem; padding: 0; font-size: .92rem; }
.plan-features li { padding: .28rem 0 .28rem 1.4rem; position: relative; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent, #2b6cb0); font-weight: 700; }

/* Responsive YouTube embeds */
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: .5rem; margin-top: .8rem; background: #000; }
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Live class cards */
.class-card .class-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.class-card .class-head h2 { margin: 0; }
.badge-live { background: #dc2626; color: #fff; border-color: #dc2626; animation: pulse-live 1.6s infinite; }
@keyframes pulse-live { 0%,100% { opacity: 1; } 50% { opacity: .65; } }

/* Admin forms */
.auth-form .check { display: flex; align-items: center; gap: .5rem; font-size: .92rem; }
.auth-form .check input { width: auto; }
.auth-form select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--bg); color: inherit; }

/* === Feature: eliminator (appended 2026-10-06) === */
/* ==========================================================================
   Answer Eliminator (Feature 1)
   Strikethrough + dim styling for eliminated choices, plus the eliminate
   button injected by public/eliminate.js.
   The coordinator appends this file to public/style.css. Dimming is
   opacity-based so it adapts to the light theme and the dark theme
   ([data-theme="dark"]) without theme-specific overrides.
   ========================================================================== */

/* Eliminated choice: dim the whole row; strike through the answer text. */
.choice.eliminated {
  opacity: 0.5;
}

/* Strike the text spans but NOT the letter badge, feedback tags, or button. */
.choice.eliminated > span:not(.choice-letter):not(.tag) {
  text-decoration: line-through;
}

/* The letter badge doubles as an eliminate/restore toggle. */
.choice .choice-letter {
  cursor: pointer;
}

/* The ✕ affordance, injected by JS: right edge of each choice row,
   2.75rem minimum touch target (matches the app's .qnav-btn convention). */
.choice .elim-btn {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.choice .elim-btn:hover {
  color: var(--ink);
  border-color: var(--muted);
}
.choice .elim-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Pressed state: this choice is currently eliminated. */
.choice .elim-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Discoverability hint inserted under the choices by JS. */
.eliminator-hint {
  font-size: 0.85rem;
  margin: 0.25rem 0 0.75rem;
}

/* === Feature: missed (appended 2026-10-06) === */
/* Feature 2 — Missed-questions deck (appended to style.css by coordinator) */

.missed-deck {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.missed-deck form {
  margin-top: 0.5rem;
}

.miss-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
  font-size: 0.95rem;
}

.miss-table th,
.miss-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.miss-table thead th {
  background: var(--card);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}

.miss-table tbody tr:hover {
  background: var(--bg);
}

.miss-wrong {
  font-weight: 700;
  color: var(--red);
}

.miss-correct {
  font-weight: 700;
  color: var(--green);
}

.miss-drill {
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-word;
}

@media (max-width: 640px) {
  .miss-table {
    font-size: 0.85rem;
  }
  .miss-table th,
  .miss-table td {
    padding: 0.4rem 0.45rem;
  }
  .miss-table th:nth-child(6),
  .miss-table td:nth-child(6),
  .miss-table th:nth-child(7),
  .miss-table td:nth-child(7) {
    display: none; /* hide "missed on" and "drill" columns on small screens */
  }
}

/* === Feature: analytics (appended 2026-10-06) === */
/* Feature 3 — Weakness Analytics: pacing cards on /progress.
   The coordinator appends this to public/style.css. */
.pacing-row .streak-card { min-width: 9rem; }
@media (max-width: 480px) {
  .pacing-row .streak-card { flex: 1 1 9rem; }
}

/* === Feature: darkmode (appended 2026-10-06) === */
/* LSATPathway dark mode — appended after style.css by the coordinator.
 * Every rule is scoped to [data-theme="dark"] (set by /theme.js), so the
 * later position in the cascade plus the attribute prefix wins over every
 * base rule, including hardcoded colors in style.css. */

/* ---------- Core palette: warm paper dark mode ---------- */
[data-theme="dark"] {
  --ink: #f4ede0;            /* warm near-white body text */
  --muted: #b3a48d;          /* secondary text */
  --bg: #161210;             /* warm near-black page background */
  --card: #211b15;           /* raised surfaces, one step up from bg */
  --line: #38302a;           /* borders on dark */
  --accent: #fb923c;         /* links, buttons, active states */
  --accent-hover: #fdba74;
  --brand: #fb923c;
  --green: #4ade80;          /* success — meaningful, readable on dark */
  --green-bg: rgba(74, 222, 128, .14);
  --red: #f87171;            /* errors — meaningful, readable on dark */
  --red-bg: rgba(248, 113, 113, .14);
  color-scheme: dark;        /* dark form controls, scrollbars, pickers */
}

/* ---------- Header / nav: deep warm ink so light nav text stays crisp ---------- */
[data-theme="dark"] .site-header { background: #0e0a07; }
[data-theme="dark"] .section-tag { background: #1c2b4a; color: #fff; }

/* ---------- Buttons: accent is light now, so text on it goes dark ---------- */
[data-theme="dark"] .btn { color: #1c1410; }
[data-theme="dark"] .btn:hover { color: #1c1410; }
[data-theme="dark"] .btn-outline:hover { color: #1c1410; }
[data-theme="dark"] .qnav-btn.answered { color: #1c1410; }
[data-theme="dark"] .tag-correct,
[data-theme="dark"] .tag-wrong { color: #1c1410; }

/* ---------- Timer bar: keep prominence, keep white text readable ---------- */
[data-theme="dark"] .timer-bar { background: #4a2e17; }
[data-theme="dark"] .timer-bar.danger { background: #7f1d1d; }

/* ---------- Tables ---------- */
[data-theme="dark"] .stats th { background: #2e241a; color: var(--ink); }

/* ---------- Drill runner ---------- */
[data-theme="dark"] .choice.picked { background: #2e241a; }
[data-theme="dark"] .qnote { background: #171310; color: var(--ink); }

/* ---------- Highlighters: real-world marker look — bright ink, dark text ---------- */
[data-theme="dark"] .mark.hl-y { background: #fbbf24; color: #1a2332; }
[data-theme="dark"] .mark.hl-p { background: #f9a8d4; color: #1a2332; }
[data-theme="dark"] .mark.hl-g { background: #86efac; color: #1a2332; }

/* ---------- Progress: active day cell is light accent now ---------- */
[data-theme="dark"] .activity-cell.active span { color: #1c1410; }

/* ---------- Amber components (badges, trial banner): dark translucent amber ---------- */
[data-theme="dark"] .badge { background: rgba(245, 158, 11, .16); border-color: rgba(245, 158, 11, .5); color: #fcd34d; }
[data-theme="dark"] .badge.earned { background: rgba(245, 158, 11, .2); border-color: #f59e0b; color: #fcd34d; }
[data-theme="dark"] .trial-banner { background: rgba(245, 158, 11, .14); border-bottom-color: rgba(245, 158, 11, .5); color: #fde68a; }
[data-theme="dark"] .trial-banner a { color: #fcd34d; }
[data-theme="dark"] .trial-dismiss .link-btn { color: #fcd34d; }

/* ---------- Alerts / status accents: brighten so they read on dark ---------- */
[data-theme="dark"] .alert-good { border-left-color: #4ade80; }
[data-theme="dark"] .alert-warn { border-left-color: #fbbf24; }
[data-theme="dark"] .alert-info { border-left-color: #60a5fa; }
[data-theme="dark"] .milestone.done .ms-check,
[data-theme="dark"] .goal.done span:first-of-type { color: #4ade80; }

/* ---------- Form controls: explicit dark surfaces everywhere ---------- */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: #100d0a;
  color: var(--ink);
  border-color: var(--line);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #8d7f6d; }

/* ---------- Small polish ---------- */
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
[data-theme="dark"] ::selection { background: rgba(126, 169, 222, .35); }
/* Subtle lift on cards that act as links/buttons. */
a.card, .card-grid .card:has(a.btn, form) { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.card:hover, .card-grid .card:has(a.btn, form):hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px -8px rgb(0 0 0 / .25);
}

/* === Feature: onboarding (appended 2026-10-06) === */
/* FEATURE 5 — Onboarding quiz step indicator.
   Appended to style.css by the coordinator (never edited inline). */
.onboard-steps {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  font-size: .85rem;
}
.onboard-steps li {
  padding: .4rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.onboard-steps li.active {
  border-color: var(--accent);
  color: inherit;
  font-weight: 600;
}

/* Nav dropdowns */
.nav-drop { position: relative; }
.drop-btn::after { content: " ▾"; font-size: .75em; }
/* Nav icons + active states (desktop and mobile). */
.nav-links > a, .nav-links .drop-btn { display: inline-flex; align-items: center; gap: .45rem; }
.nav-links .nav-ico { width: 1rem; height: 1rem; opacity: .7; flex: none; }
.nav-links a.active, .nav-links .drop-btn.active { color: #fff; }
.nav-sep { display: none; }
.nav-account, .nav-account-links, .nav-theme-row { display: contents; }
.nav-user-row { display: inline-flex; align-items: center; gap: .5rem; color: #dbe4f0; font-size: .9rem; }
.nav-avatar {
  width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-weight: 800; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-theme-row > span { display: none; }
.drop-menu {
  display: none;
  position: absolute; top: 100%; left: 0; z-index: 70;
  min-width: 11rem;
  background: var(--card); border: 1px solid var(--line); border-radius: .5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: .35rem;
}
.drop-menu a {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .8rem; border-radius: .35rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.drop-menu a:hover { background: var(--bg); color: var(--ink); }
.nav-drop.open .drop-menu { display: block; }
@media (hover: hover) and (min-width: 761px) {
  .nav-drop:hover .drop-menu { display: block; }
}

/* Mobile nav: hamburger opens a floating sheet. */
#nav-toggle { display: none; font-size: 1.3rem; }
@media (max-width: 760px) {
  #nav-toggle { display: inline-flex; align-items: center; }
  .nav { row-gap: .25rem; position: relative; }
  .nav-links {
    display: none;
    position: absolute; top: calc(100% + .4rem); left: .5rem; right: .5rem;
    width: auto; z-index: 65;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    background: #2b2114;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.5);
    padding: .6rem;
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
  }
  [data-theme="dark"] .nav-links { background: #171009; }
  .nav.menu-open .nav-links { display: flex; }
  .nav-links .nav-ico { width: 1.15rem; height: 1.15rem; opacity: .8; }
  .nav-links > a, .nav-links .drop-btn, .nav-links .link-btn {
    display: flex; align-items: center; gap: .7rem;
    padding: .65rem .7rem;
    border-radius: .65rem;
    text-align: left;
    width: 100%;
    font-weight: 600;
  }
  .nav-links > a:hover, .nav-links .drop-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
  .nav-links a.active, .nav-links .drop-btn.active { background: rgba(255,255,255,.1); color: #fff; }
  .drop-btn::after { margin-left: auto; transition: transform .2s; }
  .nav-drop.open .drop-btn::after { transform: rotate(180deg); }
  .nav-drop .drop-menu {
    position: static;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 .15rem 1.85rem;
    margin: 0;
    min-width: 0;
  }
  .drop-menu a { color: #dbe4f0; font-weight: 500; padding: .55rem .7rem; border-radius: .55rem; }
  .drop-menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .drop-menu a.active { background: rgba(255,255,255,.1); color: #fff; }
  .nav-sep { display: block; border: none; border-top: 1px solid rgba(255,255,255,.1); margin: .45rem .2rem; }
  .nav-search { margin-bottom: .35rem; }
  .nav-account, .nav-account-links, .nav-theme-row { display: block; }
  .nav-account {
    background: rgba(255,255,255,.05);
    border-radius: .75rem;
    padding: .7rem;
    margin-top: .3rem;
  }
  .nav-user-row { font-size: .9rem; }
  .nav-avatar { width: 2.1rem; height: 2.1rem; font-size: 1rem; }
  .nav-user-meta { min-width: 0; flex: 1; display: block; }
  .nav-user-meta strong { display: block; font-size: .85rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-user-meta span { font-size: .75rem; color: #dbe4f0; }
  .nav-account-links { display: flex; gap: .3rem; margin-top: .6rem; }
  .nav-account-links a, .nav-account-links .link-btn {
    flex: 1; justify-content: center;
    padding: .55rem .25rem; border-radius: .55rem;
    background: rgba(255,255,255,.07);
    font-size: .85rem; font-weight: 600;
  }
  .nav-account-links .inline-form { flex: 1; display: flex; margin: 0; }
  .nav-account-links .inline-form .link-btn { width: 100%; }
  .nav-theme-row > span { display: inline; }
  .nav-theme-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: .55rem .7rem; color: #dbe4f0; font-size: .9rem;
  }
}

/* PWA install banner */
#pwa-banner {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  display: flex; gap: .75rem; align-items: center;
  background: var(--accent); color: #fff; border-radius: .6rem;
  padding: .7rem 1rem; box-shadow: 0 6px 24px rgba(0,0,0,.3); z-index: 70;
  max-width: calc(100vw - 2rem); font-size: .92rem;
}
#pwa-banner .btn-small { background: #fff; color: var(--accent); white-space: nowrap; }
#pwa-banner-close {
  border: 0; background: transparent; color: #fff; font-size: 1.3rem;
  cursor: pointer; padding: 0 .25rem; line-height: 1;
}

/* Animated day/night theme toggle: sun sets, moon rises */
.theme-toggle { background: none; border: none; padding: .25rem; cursor: pointer; }
.tt-sky {
  display: block; position: relative; overflow: hidden;
  width: 3.4rem; height: 1.9rem; border-radius: 999px;
  background: linear-gradient(180deg, #7dd3fc 0%, #e0f2fe 100%);
  border: 1px solid var(--line);
  transition: background .6s ease;
}
[data-theme="dark"] .tt-sky { background: linear-gradient(180deg, #0b1026 0%, #243b63 100%); }
.tt-stars { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease .2s; }
[data-theme="dark"] .tt-stars { opacity: 1; }
.tt-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; }
.tt-stars i:nth-child(1) { top: 22%; left: 58%; }
.tt-stars i:nth-child(2) { top: 55%; left: 74%; }
.tt-stars i:nth-child(3) { top: 28%; left: 84%; }
.tt-stars i:nth-child(4) { top: 62%; left: 52%; }
.tt-knob {
  position: absolute; top: .2rem; left: .2rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  overflow: hidden;
  transition: transform .65s cubic-bezier(.6, 0, .3, 1.15);
}
[data-theme="dark"] .tt-knob { transform: translateX(1.5rem); }
.tt-sun, .tt-moon {
  position: absolute; left: .1rem; top: .1rem; width: 1.3rem; height: 1.3rem;
  transition: transform .65s ease, opacity .45s ease;
}
.tt-sun { transform: translateY(0); opacity: 1; }
.tt-moon { transform: translateY(-180%); opacity: 0; }
[data-theme="dark"] .tt-sun { transform: translateY(180%); opacity: 0; transition-delay: 0s, .1s; }
[data-theme="dark"] .tt-moon { transform: translateY(0); opacity: 1; transition-delay: .12s, .2s; }
/* Auto-mode badge: a tiny "A" pill, visible only while following the system. */
.tt-auto {
  position: absolute; right: .18rem; bottom: .12rem;
  min-width: 1rem; height: 1rem; border-radius: 999px;
  display: none; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700; line-height: 1;
  color: #fff; background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(255, 255, 255, .65);
  transition: opacity .4s ease, transform .4s ease;
  opacity: 0; transform: scale(.6);
  pointer-events: none;
}
#theme-toggle[data-mode="auto"] .tt-auto { display: inline-flex; opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .tt-knob, .tt-sun, .tt-moon, .tt-sky, .tt-stars, .tt-auto { transition: none; }
}

/* ==========================================================================
   Minimalist metrics (progress page) — Linear/Apple direction.
   Generous whitespace, one accent color, 1px dividers, tabular numerals.
   All colors via vars so [data-theme="dark"] just works.
   ========================================================================== */
:root {
  --amber: #92400e;
  --amber-bg: #fef3c7;
}
[data-theme="dark"] {
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, .14);
}

.metric { padding: 1.75rem 0; border-top: 1px solid var(--line); }
.metric:first-of-type { border-top: none; padding-top: .5rem; }
.m-label {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 .75rem;
}
.m-value {
  font-size: 2.1rem; font-weight: 700; line-height: 1.1; margin: 0;
  font-variant-numeric: tabular-nums;
}
.m-value small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.m-sub { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
/* Breadcrumb trail (lesson pages). */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden="true"] { margin: 0 .35rem; }
/* Cards/list view toggle + list search. */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; margin: .5rem 0 1rem; }
.view-toggle a { padding: .4rem 1rem; color: var(--muted); text-decoration: none; font-size: .9rem; }
.view-toggle a.active { background: var(--brand); color: #fff; font-weight: 600; }
.list-search { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 1rem; }
.list-search input[type="search"] { flex: 1; min-width: 12rem; }
/* Scroll reveal: hidden state only applies when JS confirms it will animate
   (html.js-reveal). No-JS and reduced-motion users always see the content. */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.js-reveal .reveal.in { opacity: 1; transform: none; }
/* Landing: interactive sample question. */
.try-card { max-width: 44rem; }
.try-stem { font-size: 1.05rem; }
.try-q { margin-top: 1rem; }
.try-choices { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.try-choices button {
  display: flex; gap: .75rem; align-items: baseline; text-align: left;
  background: var(--bg); border: 1px solid var(--line); border-radius: .5rem;
  padding: .7rem .9rem; font: inherit; color: var(--ink); cursor: pointer;
}
.try-choices button:not(:disabled):hover { border-color: var(--accent); }
.try-choices button:disabled { cursor: default; opacity: .85; }
.try-choices button.try-right { border-color: var(--green); background: var(--green-bg); }
.try-choices button.try-picked-wrong { border-color: var(--red); background: var(--red-bg); }
.try-feedback { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.try-verdict { font-size: 1.05rem; }
.try-cta { background: var(--bg); border: 1px solid var(--line); border-radius: .75rem; padding: 1.25rem 1.25rem 1rem; margin-top: 1.25rem; text-align: center; }
.try-cta p:first-child { margin-top: 0; }
.try-cta .muted.small { margin-bottom: 0; }
/* Landing: checklist + CTA band. */
.check-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: .4rem; }
.check-list li { padding-left: 1.6rem; position: relative; }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.cta-band {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 1rem; padding: 2.5rem 1.5rem; margin: 2.5rem 0;
}
.cta-band h2 { margin-top: 0; font-size: 1.75rem; }
.cta-band p { color: var(--muted); margin-bottom: 1.5rem; }
/* Landing: sticky join bar for scrollers. */
#join-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: #231e14; color: #fff; border-top: 1px solid #3a3129;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: .65rem 1rem; transform: translateY(110%); transition: transform .3s ease;
  box-shadow: 0 -2px 12px rgba(0,0,0,.25);
}
#join-bar.show { transform: none; }
#join-bar p { margin: 0; font-size: .95rem; }
#join-bar p span { color: #c9b797; }
#join-bar [data-dismiss] { background: none; border: none; color: #c9b797; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: .2rem .5rem; }
#join-bar [data-dismiss]:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) {
  #join-bar { transition: none; }
}
body.has-joinbar #to-top { bottom: 4.75rem; }
/* Landing: hero value trio. */
.hero-trio { list-style: none; display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; margin: 1.75rem 0 0; padding: 1.5rem 0 0; border-top: 1px solid rgba(255,255,255,.14); }
.hero-trio li { display: flex; flex-direction: column; gap: .15rem; text-align: left; max-width: 13rem; }
.hero-trio strong { color: #fff; font-size: 1rem; }
.hero-trio strong::before { content: '✓ '; color: #fdba74; }
.hero-trio span { color: #c9b797; font-size: .85rem; }
/* Landing: curriculum preview. */
.curr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.curr-track h3 { margin-top: 0; display: flex; align-items: center; gap: .6rem; }
.track-tag {
  display: inline-block; background: var(--brand); color: #fff; font-size: .75rem;
  font-weight: 700; border-radius: .35rem; padding: .15rem .5rem; letter-spacing: .05em;
}
.curr-unit { font-weight: 700; margin: 1rem 0 .25rem; }
.curr-unit:first-of-type { margin-top: .5rem; }
.curr-lessons { list-style: none; margin: 0 0 .5rem; padding: 0; }
.curr-lessons li { padding: .2rem 0 .2rem 1.2rem; position: relative; }
.curr-lessons li::before { content: '→'; position: absolute; left: 0; color: var(--muted); }
/* 404 page. */
.notfound { text-align: center; padding: 3rem 0; max-width: 34rem; margin: 0 auto; }
.notfound-code { font-size: 4rem; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }
.notfound-search { max-width: 28rem; margin: 1.5rem auto; }
/* Font-size control. */
.font-size-ctl { display: inline-flex; gap: .25rem; align-items: center; margin-left: .5rem; vertical-align: middle; }
.font-size-ctl button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: .35rem; padding: .1rem .5rem; font-size: .8rem; cursor: pointer; line-height: 1.4;
}
.font-size-ctl button:hover { color: var(--brand); border-color: var(--brand); }
/* Reading progress bar (lesson pages). */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; background: transparent; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--brand); }
/* Back to top. */
#to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--brand);
  font-size: 1.25rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
#to-top.show { opacity: 1; pointer-events: auto; }
#to-top:hover { background: var(--brand); color: #fff; }
/* Keyboard shortcut hints. */
.kbd-hint kbd {
  display: inline-block; padding: .05rem .35rem; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: .3rem; font-size: .75rem;
  background: var(--card); font-family: inherit;
}
/* Password strength meter. */
.pw-meter { margin-top: .4rem; display: flex; align-items: center; gap: .6rem; }
.pw-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .2s ease; background: var(--muted); }
.pw-bar .pw-weak { background: #dc2626; }
.pw-bar .pw-fair { background: #ea580c; }
.pw-bar .pw-good { background: #ca8a04; }
.pw-bar .pw-strong { background: #16a34a; }
.pw-label { font-size: .8rem; color: var(--muted); min-width: 5rem; }
/* Print: study plan prints as a clean black-on-white document. */
@media print {
  .site-header, .site-footer, .flash-wrap, .cta-row, #print-plan-btn,
  .alert, .theme-toggle, #nav-toggle, .nav-search { display: none !important; }
  body { background: #fff; color: #000; }
  .container { max-width: 100%; padding: 0; }
  .card, .checklist li { break-inside: avoid; }
  .card { border: 1px solid #999; box-shadow: none; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: none; }
}
/* Visible keyboard focus everywhere; inputs get a brand ring. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: .25rem;
}
input[type="text"]:focus-visible, input[type="email"]:focus-visible,
input[type="password"]:focus-visible, input[type="search"]:focus-visible,
input[type="tel"]:focus-visible, input[type="number"]:focus-visible,
input[type="date"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
/* Flash messages: appear once after a redirect, fade out via CSS. */
.flash-wrap { display: grid; gap: .5rem; margin-bottom: 1rem; }
.flash {
  margin: 0; padding: .7rem 1rem; border-radius: .5rem; font-weight: 600;
  border: 1px solid transparent;
  animation: flash-in .25s ease-out, flash-out .5s ease-in 4s forwards;
}
.flash-ok { background: #dcfce7; border-color: #86efac; color: #166534; }
.flash-err { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes flash-out { to { opacity: 0; transform: translateY(-6px); display: none; } }
/* Respect users who prefer reduced motion: no pulses, rises, or auto-fades. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .flash { animation: none; }
}
.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.5rem; }
.avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; flex-shrink: 0;
}
img.avatar-lg { object-fit: cover; padding: 0; }
/* FAQ accordion. */
.faq details { border: 1px solid var(--line); border-radius: .5rem; margin-bottom: .5rem; background: var(--card); }
.faq summary { padding: .9rem 1.1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--brand); font-size: 1.2rem; font-weight: 400; flex-shrink: 0; }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 1.1rem 1rem; margin: 0; }
/* Activity heatmap (profile pages). */
.heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 3px; overflow-x: auto; padding-bottom: .25rem; }
.hm-cell { width: 12px; height: 12px; border-radius: 2px; background: var(--line); display: inline-block; }
.hm-1 { background: #fed7aa; }
.hm-2 { background: #fdba74; }
.hm-3 { background: #f97316; }
.hm-4 { background: #c2410c; }
.hm--1 { visibility: hidden; }
.hm-key { display: inline-flex; gap: 3px; vertical-align: middle; margin: 0 .4rem; }
.m-action { color: var(--muted); font-size: .92rem; margin: .8rem 0 0; max-width: 42rem; }
.m-action strong { color: var(--ink); font-weight: 600; }
.m-duo { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: .5rem; }
.m-duo .m-value { font-size: 1.6rem; }

.pill {
  display: inline-block; font-size: .75rem; font-weight: 700;
  border-radius: 999px; padding: .22rem .75rem; margin-bottom: .6rem;
}
.pill-good { background: var(--green-bg); color: var(--green); }
.pill-warn { background: var(--amber-bg); color: var(--amber); }
.pill-bad { background: var(--red-bg); color: var(--red); }
.pill-neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

.mrow {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.mrow:first-child { border-top: none; }
.mrow .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .n { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.mbar { height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .4rem 0 .2rem; }
.mbar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.mbar-thin { max-width: 16rem; }

/* Goal line on the trajectory chart */
.chart-goal { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 4; opacity: .55; }
.chart-goal-label { fill: var(--muted); }

@media (max-width: 480px) {
  .m-value { font-size: 1.8rem; }
  .metric { padding: 1.4rem 0; }
}

/* ==========================================================================
   Dashboard — calm, premium landing page. Serif greeting, elevated Today
   card, staggered entrance. All colors via vars so dark mode just works.
   ========================================================================== */
:root {
  --gold: #c9a227;
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px -14px rgba(31, 58, 95, .22);
}
[data-theme="dark"] {
  --gold: #e3b94e;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .55);
}

.dash { max-width: 780px; margin: 0 auto; }
.dash-hero { padding: 1.5rem 0 1.75rem; }
.dash-eyebrow {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 .6rem;
}
.dash-hi {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.15rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.15;
  margin: 0 0 .4rem; color: var(--ink);
}
.dash-sub { color: var(--muted); font-size: 1.02rem; margin: 0; }

/* Today card — the hero */
.dash-today {
  background: var(--card); border: 1px solid var(--line); border-radius: 1rem;
  box-shadow: var(--shadow-soft); padding: 1.4rem 1.5rem 1.25rem; margin-bottom: 1.5rem;
}
.dt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .25rem; }
.dt-head .m-label { margin: 0; }
.dt-streak { margin: 0; font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: .45rem; }
.dt-streak strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.dt-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.dt-tasks { list-style: none; margin: .5rem 0 0; padding: 0; }
.dt-tasks li + li { border-top: 1px solid var(--line); }
.dt-task {
  display: flex; align-items: center; gap: 1rem; padding: .95rem .25rem;
  text-decoration: none; color: inherit; border-radius: .5rem;
  transition: background .18s ease;
}
.dt-task:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.dt-num {
  font-size: .78rem; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; letter-spacing: .06em; min-width: 1.6rem;
}
.dt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.dt-label { font-weight: 600; font-size: .98rem; }
.dt-sub { color: var(--muted); font-size: .85rem; }
.dt-arrow { color: var(--muted); transition: transform .18s ease, color .18s ease; }
.dt-task:hover .dt-arrow { transform: translateX(4px); color: var(--accent); }
.dt-foot { margin: 1rem 0 0; font-size: .85rem; color: var(--muted); }
.dt-cta-copy { color: var(--muted); margin: .5rem 0 1rem; max-width: 34rem; }

/* Lower grid: snapshot + quick links */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.dash-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 1rem;
  box-shadow: var(--shadow-soft); padding: 1.35rem 1.4rem;
}
.dash-stats { display: flex; margin: .25rem 0 .5rem; }
.dash-stats > div { flex: 1; padding: 0 1rem; }
.dash-stats > div:first-child { padding-left: 0; }
.dash-stats > div + div { border-left: 1px solid var(--line); }
.dash-stats .m-value { font-size: 1.55rem; }
.dash-pace { margin: .9rem 0 0; }
.dash-pace .pill { margin-bottom: 0; }
.dash-more { margin: 1rem 0 0; font-size: .9rem; }
.dash-more a { text-decoration: none; }
.dash-more a:hover { text-decoration: underline; }

.dash-links { display: flex; flex-direction: column; margin: 0 -.5rem; }
.dash-link {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t a" "s a";
  column-gap: .75rem; align-items: center; padding: .7rem .5rem;
  text-decoration: none; color: inherit; border-radius: .6rem;
  transition: background .18s ease;
}
.dash-link + .dash-link { border-top: 1px solid var(--line); border-radius: 0; }
.dash-link:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.dl-t { grid-area: t; font-weight: 600; font-size: .95rem; }
.dl-s { grid-area: s; color: var(--muted); font-size: .83rem; }
.dl-a { grid-area: a; color: var(--muted); transition: transform .18s ease, color .18s ease; }
.dash-link:hover .dl-a { transform: translateX(4px); color: var(--accent); }

/* Gentle staggered entrance */
@keyframes dash-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.dash-hero { animation: dash-rise .5s ease both; }
.dash-today { animation: dash-rise .5s ease .08s both; }
.dash-grid .dash-card:first-child { animation: dash-rise .5s ease .16s both; }
.dash-grid .dash-card:last-child { animation: dash-rise .5s ease .24s both; }

@media (max-width: 640px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-hi { font-size: 1.75rem; }
  .dash-today, .dash-card { padding: 1.15rem 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-hero, .dash-today, .dash-grid .dash-card { animation: none; }
  .dt-task, .dash-link, .dt-arrow, .dl-a { transition: none; }
}

/* ==========================================================================
   Dashboard gamification — symbols over words. Game strip, badges, tiles.
   ========================================================================== */
:root { --flame: #f97316; }
[data-theme="dark"] { --flame: #fb923c; }

.ico { width: 1.1rem; height: 1.1rem; flex: none; }

/* Game strip: streak · level/XP · weekly ring */
.game-strip {
  display: flex; align-items: stretch; gap: .75rem; margin: 0 0 1.25rem;
}
.gs-item {
  flex: 1; display: flex; align-items: center; gap: .7rem;
  background: var(--card); border: 1px solid var(--line); border-radius: .9rem;
  box-shadow: var(--shadow-soft); padding: .8rem .95rem; min-width: 0;
}
.gs-ico { width: 1.3rem; height: 1.3rem; }
.gs-flame { color: var(--flame); }
.gs-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.gs-text strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.gs-text span { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.gs-level { gap: .8rem; }
.gs-lvl {
  font-weight: 800; font-size: .95rem; color: #fff; background: var(--accent);
  border-radius: .6rem; padding: .45rem .6rem; white-space: nowrap;
}
.gs-xpwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.xp-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.xp-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; transition: width .6s ease; }
.gs-sub { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ring { width: 1.8rem; height: 1.8rem; transform: rotate(-90deg); flex: none; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 3.5; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }

.dash-goal { margin: 0 0 1.25rem; }
.dash-goal .pill { margin-bottom: 0; }

/* Badge shelf */
.badge-shelf {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem;
  margin: 0 0 1.5rem;
}
.badge {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  background: var(--card); border: 1px solid var(--line); border-radius: .8rem;
  padding: .8rem .4rem; opacity: .42;
}
.badge.earned { opacity: 1; border-color: var(--gold); }
.badge.earned .b-ico { color: var(--gold); }
.b-ico { width: 1.2rem; height: 1.2rem; color: var(--muted); }
.badge span { font-size: .68rem; color: var(--muted); text-align: center; line-height: 1.2; }
.badge.earned span { color: var(--ink); font-weight: 600; }

/* Icon tiles */
.tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  background: var(--card); border: 1px solid var(--line); border-radius: .9rem;
  box-shadow: var(--shadow-soft); padding: 1.1rem .5rem;
  text-decoration: none; color: inherit; font-weight: 600; font-size: .92rem;
  transition: transform .16s ease, border-color .16s ease;
}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.t-ico { width: 1.25rem; height: 1.25rem; color: var(--accent); }

/* Today card: task icons + minutes chip + rest day */
.dt-ico { width: 1.05rem; height: 1.05rem; color: var(--accent); }
.dt-minutes {
  margin: 0; font-size: .8rem; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-radius: 999px; padding: .2rem .7rem; font-variant-numeric: tabular-nums;
}
.dt-rest {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem; margin: .5rem 0;
}

/* Study plan: day group headers */
.day-head {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; list-style: none;
  margin: .9rem 0 .15rem; padding: 0 !important;
}
.day-head:first-child { margin-top: .25rem; }

/* Staggered entrance for the new blocks */
.game-strip { animation: dash-rise .5s ease .05s both; }
.dash-goal { animation: dash-rise .5s ease .1s both; }
.badge-shelf { animation: dash-rise .5s ease .2s both; }
.tile-grid { animation: dash-rise .5s ease .28s both; }

@media (max-width: 640px) {
  .game-strip { flex-wrap: wrap; }
  .gs-item { flex: 1 1 100%; }
  .gs-level { flex: 1 1 100%; }
  .badge-shelf { grid-template-columns: repeat(3, 1fr); }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .game-strip, .dash-goal, .badge-shelf, .tile-grid { animation: none; }
  .tile { transition: none; }
  .xp-bar > span { transition: none; }
}

/* ==========================================================================
   Dashboard tap-to-reveal + leaderboard
   ========================================================================== */
/* Game strip items and badges are buttons now — reset button chrome. */
button.gs-item, button.badge { font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.gs-item:hover { border-color: var(--accent); }
button.badge { align-items: center; }
.gs-item[aria-expanded="true"] { border-color: var(--accent); }
.badge[aria-expanded="true"] { border-color: var(--accent); opacity: 1; }

.gs-panel, .badge-detail {
  background: var(--card); border: 1px solid var(--line); border-radius: .8rem;
  box-shadow: var(--shadow-soft); padding: .7rem 1rem; margin: 0 0 1.25rem;
  font-size: .87rem; color: var(--muted);
}
.badge-detail { margin-top: -.75rem; }

/* Leaderboard */
.lb-mini, .lb-full {
  background: var(--card); border: 1px solid var(--line); border-radius: 1rem;
  box-shadow: var(--shadow-soft); padding: .4rem 1.1rem; margin: 0 0 1.5rem;
}
.lb-row {
  display: flex; align-items: center; gap: .8rem; padding: .6rem 0;
  font-variant-numeric: tabular-nums;
}
.lb-row + .lb-row { border-top: 1px solid var(--line); }
.lb-rank { font-weight: 800; color: var(--muted); min-width: 1.6rem; font-size: .9rem; }
.lb-row:nth-child(1) .lb-rank { color: var(--gold); }
.lb-handle { flex: 1; font-weight: 600; font-size: .93rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { flex: 2; height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 3rem; }
.lb-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.lb-pct { font-weight: 700; min-width: 3rem; text-align: right; }
.lb-n { font-size: .8rem; min-width: 3.2rem; text-align: right; }
.lb-me { background: color-mix(in srgb, var(--gold) 8%, transparent); margin: 0 -1.1rem; padding-left: 1.1rem; padding-right: 1.1rem; }
.lb-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0 .4rem; }
.lb-foot .pill { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .gs-panel, .badge-detail { transition: none; }
}

/* Diagnostic choice: preferred card */
.diag-pick h2 { margin-top: 0; }
.diag-recommended { border-color: var(--gold); border-width: 2px; }
.cta-row { margin: 1.25rem 0 0; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* Admin revenue dashboard */
.admin-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.admin-head .back { text-decoration: none; color: var(--muted); }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.rev-grid .stat { cursor: default; }
.m-value.big { font-size: 2rem; }
.m-sub { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 7rem; margin: 1rem 0 2rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar { width: 100%; max-width: 1.4rem; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-x { font-size: .55rem; color: var(--muted); margin-top: .2rem; overflow: hidden; white-space: nowrap; }
.bar-col:nth-child(even) .bar-x { visibility: hidden; }
.fine { font-size: .8rem; margin-top: 2rem; }

/* Refunds */
.reason-cell { max-width: 16rem; }
.inline-note { width: 9rem; padding: .35rem .5rem; font-size: .85rem; margin-right: .4rem; }
.badge-ok { background: var(--green, #15803d); }
.badge-muted { background: var(--muted); }
td.actions { white-space: nowrap; }

/* Drill setup */
.setup-form h2 { margin-top: 1.5rem; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem; margin: .75rem 0; }
.pick-card { display: block; border: 1px solid var(--line); border-radius: .6rem; padding: .9rem; cursor: pointer; }
.pick-card:hover { border-color: var(--accent); }
.pick-card input { margin-right: .4rem; }
.pick-card strong { display: block; margin-bottom: .25rem; }
.pick-card.disabled { opacity: .55; cursor: default; }

/* Blind review */
.conf-row { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.conf-pill { border: 1px solid var(--line); border-radius: 2rem; padding: .35rem .9rem; cursor: pointer; font-size: .9rem; }
.conf-pill input { margin-right: .3rem; }
.conf-pill:has(input:checked) { border-color: var(--accent); background: var(--accent-bg, #eff6ff); }
.choice-picked { border-color: var(--accent); }
.review-revisit { border-left: 3px solid var(--gold, #b45309); }
.review-confident { opacity: .85; }

/* Test-day forecast */
.forecast-card { border-width: 2px; }
.forecast-range { font-size: 2.4rem; font-weight: 800; margin: .25rem 0 .5rem; font-variant-numeric: tabular-nums; }

/* Tutor reviews */
.stars { color: var(--gold, #b45309); font-size: 1.1rem; letter-spacing: .1rem; }
.stars-input { display: inline-flex; gap: .5rem; margin-left: .5rem; }
.stars-input label { cursor: pointer; }
.review-form { margin-top: 1rem; }
.review-form textarea { width: 100%; margin: .5rem 0; }

/* Delight pack: tiny moments of joy. All motion gated on no-preference. */
@media (prefers-reduced-motion: no-preference) {
  /* Streak flame: three unsynchronized layers read as a living flame.
     Wrapper sways slow, the flame itself licks fast, the glow breathes. */
  .flame-flick { display: inline-flex; transform-origin: 50% 90%; animation: flame-sway 3.7s ease-in-out infinite; }
  @keyframes flame-sway {
    0%, 100% { transform: rotate(-3deg) translateX(0); }
    30% { transform: rotate(2.4deg) translateX(.8px); }
    55% { transform: rotate(-1.4deg) translateX(-.5px); }
    80% { transform: rotate(1.8deg) translateX(.4px); }
  }
  .gs-flame {
    transform-origin: 50% 92%;
    animation:
      flame-lick 1.15s ease-in-out infinite,
      flame-glow 2.6s ease-in-out infinite;
  }
  @keyframes flame-lick {
    0%, 100% { transform: scale(1, 1) skewX(0deg); }
    22% { transform: scale(.985, 1.1) skewX(2.2deg); }
    48% { transform: scale(1.01, .96) skewX(-1.6deg); }
    74% { transform: scale(.99, 1.07) skewX(1deg); }
  }
  @keyframes flame-glow {
    0%, 100% { filter: drop-shadow(0 0 3px rgba(249, 115, 22, .35)); }
    50% { filter: drop-shadow(0 0 9px rgba(249, 115, 22, .65)); }
  }
  /* Earned badges pop in with a golden flash, one after another. */
  .ach.earned { animation: badge-pop .55s cubic-bezier(.34, 1.4, .64, 1) backwards; }
  .ach.earned:nth-of-type(2) { animation-delay: .07s; }
  .ach.earned:nth-of-type(3) { animation-delay: .14s; }
  .ach.earned:nth-of-type(4) { animation-delay: .21s; }
  .ach.earned:nth-of-type(5) { animation-delay: .28s; }
  .ach.earned:nth-of-type(6) { animation-delay: .35s; }
  .ach.earned:nth-of-type(n+7) { animation-delay: .42s; }
  @keyframes badge-pop {
    0% { transform: scale(.3) rotate(-10deg); opacity: 0; box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
    55% { transform: scale(1.14) rotate(3deg); opacity: 1; box-shadow: 0 0 24px 4px rgba(201, 162, 39, .55); }
    78% { transform: scale(.95) rotate(-1deg); box-shadow: 0 0 10px 1px rgba(201, 162, 39, .3); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
  }
  /* Picking an answer: squash-and-stretch snap, like a physical button. */
  .choice { transition: transform .12s ease, border-color .15s ease, background-color .15s ease; }
  .choice.picked { animation: pick-snap .28s ease; }
  @keyframes pick-snap {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.022, .972); }
    55% { transform: scale(.991, 1.014); }
    80% { transform: scale(1.005, .997); }
    100% { transform: scale(1, 1); }
  }
  /* XP bar: a shine sweeps across as it fills on load. */
  .xp-bar > span { position: relative; }
  .xp-bar > span::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
    transform: translateX(-110%);
    animation: xp-shine 1.1s ease .35s 1;
  }
  @keyframes xp-shine { to { transform: translateX(110%); } }
  /* Under five minutes the timer breathes urgency — soft red halo. */
  .timer-bar.danger { animation: timer-breathe 2s ease-in-out infinite; }
  @keyframes timer-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0), inset 0 0 0 0 rgba(220, 38, 38, 0); }
    50% { box-shadow: 0 0 14px 2px rgba(220, 38, 38, .28), inset 0 0 8px 0 rgba(220, 38, 38, .12); }
  }
  /* "New best" badge: a joyful little bounce-wiggle. */
  .badge.new-best { display: inline-block; animation: best-wiggle 2s ease-in-out infinite; transform-origin: 50% 80%; }
  @keyframes best-wiggle {
    0%, 100% { transform: rotate(-3deg) scale(1); }
    12% { transform: rotate(2deg) scale(1.08); }
    24% { transform: rotate(-2deg) scale(1.03); }
    36%, 100% { transform: rotate(0deg) scale(1); }
  }
  /* Level-up number glows gently behind the modal. */
  .levelup-big { animation: level-glow 2.4s ease-in-out infinite; }
  @keyframes level-glow {
    0%, 100% { text-shadow: 0 0 12px rgba(194, 65, 12, .25); }
    50% { text-shadow: 0 0 26px rgba(194, 65, 12, .55); }
  }
}

/* Rewards shelf. */
.rewards-card { margin-bottom: 1.5rem; }
.rewards-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.reward-stat { display: flex; align-items: center; gap: .5rem; }
.reward-stat strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.reward-stat span:last-child { font-size: .76rem; color: var(--muted); }
.reward-ico { font-size: 1.3rem; }
.title-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin: .5rem 0; }
.title-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; }
.title-form select { padding: .5rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--card); color: var(--ink); font-size: .95rem; }
.rewards-next { margin-bottom: 0; }
.user-title {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold);
  border-radius: 999px; padding: .1rem .55rem; margin-left: .5rem; vertical-align: middle;
}

/* Level-up celebration modal. */
.levelup-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(20, 12, 6, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.levelup-card { max-width: 26rem; text-align: center; padding: 2rem 1.75rem; }
.levelup-kicker {
  text-transform: uppercase; letter-spacing: .2em; font-size: .75rem; font-weight: 800;
  color: var(--brand); margin: 0 0 .25rem;
}
.levelup-big { font-size: 3rem; font-weight: 800; margin: 0 0 .5rem; line-height: 1; }
.levelup-rewards { list-style: none; margin: 1.25rem 0; padding: 0; text-align: left; }
.levelup-rewards li { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: .6rem; margin-bottom: .5rem; background: var(--bg); }
.levelup-rico { font-size: 1.2rem; margin-right: .35rem; }
@media (prefers-reduced-motion: no-preference) {
  .levelup-card { animation: levelup-in .5s cubic-bezier(.34, 1.56, .64, 1); }
  @keyframes levelup-in {
    from { transform: scale(.7) translateY(30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
  }
}

/* Achievement shelf: every achievement is progress toward a real reward. */
.ach-sub { margin: -.5rem 0 .75rem; }
.ach-shelf {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: .6rem;
  margin: 0 0 1.5rem;
}
.ach {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  background: var(--card); border: 1px solid var(--line); border-radius: .8rem;
  padding: .8rem .4rem; opacity: .75; cursor: pointer; color: var(--ink);
  font: inherit; transition: transform .15s ease, border-color .15s ease, opacity .15s ease;
}
.ach:hover { transform: translateY(-2px); }
.ach-wrap { position: relative; }
.ach-wrap .ach { width: 100%; height: 100%; }
.ach-share {
  position: absolute; top: .25rem; right: .4rem; font-size: .85rem;
  color: var(--gold); text-decoration: none; opacity: .8; line-height: 1;
}
.ach-share:hover { opacity: 1; }
.ach.earned { opacity: 1; border-color: var(--gold); }
.ach.earned .b-ico { color: var(--gold); }
.ach .b-ico { width: 1.2rem; height: 1.2rem; color: var(--muted); }
.ach-label { font-size: .68rem; color: var(--muted); text-align: center; line-height: 1.2; }
.ach.earned .ach-label { color: var(--ink); font-weight: 700; }
.ach-prog { width: 100%; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.ach-prog > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; }
.ach-count { font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ach-reward-tag {
  font-size: .62rem; font-weight: 700; color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  border-radius: 999px; padding: .1rem .5rem; white-space: nowrap;
}
@media (max-width: 640px) {
  .ach-shelf { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .ach.earned .ach-reward-tag { animation: reward-tag-in .5s ease .3s backwards; }
  @keyframes reward-tag-in {
    from { transform: scale(.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

/* Prediction mode: stem + choices stay blurred until the student predicts. */
.predict-blur {
  filter: blur(9px);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.predict-blur.predict-off {
  filter: blur(0);
  pointer-events: auto;
}
@media (prefers-reduced-motion: no-preference) {
  .predict-blur { transition: filter .55s ease; }
  .predict-prompt.predict-done { transition: opacity .5s ease, transform .5s ease; opacity: 0; transform: translateY(8px); }
}
.predict-prompt {
  background: linear-gradient(160deg, var(--card), color-mix(in srgb, var(--brand) 7%, var(--card)));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: .9rem;
  padding: 1.25rem 1.25rem 1rem;
  margin: 1rem 0;
  box-shadow: var(--shadow-soft);
}
.predict-kicker {
  text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 800;
  color: var(--brand); margin: 0 0 .5rem;
}
.predict-ask { margin: 0 0 .9rem; font-size: 1.02rem; }
.predict-label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .35rem; }
.predict-input {
  width: 100%; box-sizing: border-box; min-height: 4.2rem; resize: vertical;
  border: 1px solid var(--line); border-radius: .6rem; padding: .7rem .85rem;
  background: var(--bg); color: var(--ink); font: inherit; font-size: .95rem;
  margin-bottom: .9rem;
}
.predict-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.predict-prompt .btn { margin-bottom: .6rem; }
.tag-predict { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); }
/* Prediction shown in review, next to the explanation. */
.predict-recall {
  border-left: 3px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--card));
  border-radius: 0 .6rem .6rem 0;
  padding: .7rem 1rem; margin: .8rem 0;
}
.predict-recall p { margin: .15rem 0; }
.predict-recall .predict-kicker { margin-bottom: .2rem; }

/* Profile hub: game-style status bar, identity, icon grid, week strip. */
.hub-bar {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 1rem;
  box-shadow: var(--shadow-soft); padding: .8rem 1rem; margin-bottom: 1.25rem;
}
.hub-id { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; }
.hub-id .avatar { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; flex: none; }
.hub-lv { min-width: 0; flex: 1; max-width: 12rem; }
.hub-lv strong { font-size: .95rem; }
.hub-xpbar { height: 8px; margin-top: .25rem; }
.hub-stat { display: flex; align-items: center; gap: .35rem; font-size: 1.05rem; white-space: nowrap; }
.hub-stat strong { font-variant-numeric: tabular-nums; }
.hub-gear { font-size: 1.3rem; text-decoration: none; opacity: .75; }
.hub-gear:hover { opacity: 1; }
.hub-identity { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.25rem; }
.hub-name { margin: 0; font-size: 2rem; }
.hub-title {
  margin: .1rem 0 0; font-size: 1.35rem; font-weight: 800; letter-spacing: .01em;
  background: linear-gradient(100deg, var(--gold) 10%, var(--brand) 55%, #7c2d12 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hub-medal-wrap { text-align: center; flex: none; }
.medal {
  width: 5.2rem; height: 5.2rem; border-radius: 50%; margin: 0 auto .3rem;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, #ffe9a8 0%, #f3c93e 38%, #c9930f 72%, #9a6f08 100%);
  box-shadow: 0 6px 18px rgba(201, 146, 15, .45), inset 0 2px 6px rgba(255, 255, 255, .55), inset 0 -4px 8px rgba(120, 80, 5, .5);
  border: 3px solid #8a6407;
  position: relative; overflow: hidden;
}
.medal-ico { width: 2.4rem; height: 2.4rem; color: #5c430a; }
.medal::after {
  content: ''; position: absolute; inset: -40%;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .65) 50%, transparent 58%);
  transform: translateX(-70%) rotate(8deg);
}
@media (prefers-reduced-motion: no-preference) {
  .medal::after { animation: medal-shine 4.5s ease-in-out infinite; }
  @keyframes medal-shine {
    0%, 55% { transform: translateX(-70%) rotate(8deg); }
    85%, 100% { transform: translateX(70%) rotate(8deg); }
  }
}
.medal-empty { background: var(--line); border-color: var(--muted); box-shadow: none; }
.medal-empty span { font-size: 1.8rem; font-weight: 800; color: var(--muted); }
.medal-sm { width: 3rem; height: 3rem; border-width: 2px; }
.medal-sm .medal-ico { width: 1.4rem; height: 1.4rem; }
.hub-medal-label { margin: 0; }
.hub-medals { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.hub-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem;
  margin-bottom: 1.5rem;
}
.hub-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem;
  background: var(--card); border: 1px solid var(--line); border-radius: .9rem;
  padding: .9rem .3rem; text-decoration: none; color: var(--ink); font-size: .72rem; font-weight: 600;
  box-shadow: var(--shadow-soft); transition: transform .15s ease, border-color .15s ease;
  text-align: center;
}
.hub-tile:hover { transform: translateY(-3px); border-color: var(--brand); }
.hub-emoji { font-size: 1.7rem; line-height: 1; }
.hub-badge {
  position: absolute; top: -.4rem; right: -.2rem;
  background: #dc2626; color: #fff; font-size: .68rem; font-weight: 800;
  border-radius: 999px; padding: .1rem .45rem; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.hub-week { margin-bottom: 1.5rem; }
.hub-week-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.hub-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .45rem; }
.hub-day {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: .7rem;
  padding: .55rem .2rem; color: var(--muted);
}
.hub-day span { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; }
.hub-day strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hub-day.on { background: color-mix(in srgb, var(--brand) 14%, var(--card)); border-color: var(--brand); color: var(--ink); }
.hub-day.on strong { color: var(--brand); }
.hub-day.today { box-shadow: 0 0 0 2px var(--brand); }
.hub-day.future { opacity: .45; }
@media (max-width: 640px) {
  .hub-grid { grid-template-columns: repeat(5, 1fr); gap: .45rem; }
  .hub-tile { font-size: .62rem; padding: .7rem .2rem; }
  .hub-emoji { font-size: 1.4rem; }
  .hub-name { font-size: 1.6rem; }
  .medal { width: 4.2rem; height: 4.2rem; }
}

/* Dashboard QoL: streak-saver nudge, Monday recap, weakest-type shortcut. */
.streak-saver, .weakest-card {
  display: flex; align-items: center; gap: .8rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 12%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 1rem; padding: .9rem 1rem; margin-bottom: 1rem;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-soft);
  transition: transform .15s ease;
}
.streak-saver:hover, .weakest-card:hover { transform: translateY(-2px); }
.streak-saver-flame { font-size: 1.6rem; }
.streak-saver-go { margin-left: auto; font-size: 1.2rem; color: var(--brand); }
.weakest-card { margin-bottom: 1.25rem; }
.weakest-card > span:last-child { margin-left: auto; color: var(--brand); font-size: 1.2rem; }
.recap-card { margin-bottom: 1rem; border-left: 3px solid var(--gold); }
.recap-line { font-size: 1.05rem; margin: .25rem 0 .5rem; }
.recap-line strong { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .streak-saver-flame { display: inline-block; animation: saver-flick 2s ease-in-out infinite; transform-origin: 50% 90%; }
  @keyframes saver-flick {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12, 1.18); }
  }
}

/* Focus mode: distraction-free drilling. */
body.focus-mode .site-header, body.focus-mode .site-footer { display: none; }
.focus-toggle { margin: 0 .5rem; }
body.focus-mode .focus-toggle { color: var(--brand); font-weight: 700; }

/* Dashboard QoL batch 2: rest-day, about-you (learner), QOTD, weekly goal ring. */
.rest-card {
  display: flex; align-items: center; gap: .8rem;
  margin-bottom: 1rem; border-left: 3px solid var(--brand);
}
.about-card {
  display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 10%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
}
.about-ico { font-size: 1.6rem; }
.about-more { margin-left: auto; white-space: nowrap; font-size: .85rem; }
.qotd-card {
  display: flex; align-items: center; gap: .8rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 12%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 1rem; padding: .9rem 1rem; margin-bottom: 1rem;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-soft);
  transition: transform .15s ease;
}
.qotd-card:hover { transform: translateY(-2px); }
.qotd-card > span:last-child { margin-left: auto; color: var(--brand); font-size: 1.2rem; }
.goal-card { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.25rem; }
.goal-card .ring { width: 3rem; height: 3rem; flex: none; }
.goal-text { flex: 1 1 auto; }
.goal-form { display: flex; align-items: center; gap: .4rem; }
.goal-form input[type="number"] { width: 4rem; }
.qotd-win { border-left: 3px solid #2f9e44; }
.qotd-miss { border-left: 3px solid var(--brand); }

/* Progress: "How you learn" insight cards. */
.insight-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); margin-bottom: 1.5rem; }
.insight-card { display: flex; gap: .7rem; align-items: flex-start; }
.insight-ico { font-size: 1.5rem; line-height: 1.2; }
.insight-card p { margin: .15rem 0 0; }

/* Profile: wall of wins timeline. */
.wins-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .5rem; }
.win-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; background: var(--card); border: 1px solid var(--line); border-radius: .75rem; }
.win-ico { font-size: 1.3rem; }
.win-date { margin-left: auto; white-space: nowrap; }

/* Drill runner: in-session hot streak pill. */
.hot-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  background: linear-gradient(140deg, #ff6b35, #f59e0b); color: #fff;
  border-radius: 999px; padding: .25rem .7rem; font-weight: 700; font-size: .85rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, .45);
}
@media (prefers-reduced-motion: no-preference) {
  .hot-pill { animation: hot-pop .35s cubic-bezier(.2, 1.4, .4, 1); }
  @keyframes hot-pop { from { transform: scale(.6); } to { transform: scale(1); } }
}

/* Drills page: beat-your-best nudge on type cards. */
.best-nudge { display: block; margin-top: .3rem; font-size: .8rem; color: var(--gold); font-weight: 600; }

/* Dashboard QoL batch 3: announcement, resume, milestones, lesson, quick drill. */
.announce-card {
  display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem;
  border-left: 3px solid var(--gold);
}
.ann-dismiss {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--muted); line-height: 1; padding: .25rem;
}
.ann-dismiss:hover { color: var(--ink); }
.resume-card, .lesson-card {
  display: flex; align-items: center; gap: .8rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 14%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--brand) 50%, var(--line));
  border-radius: 1rem; padding: .9rem 1rem; margin-bottom: 1rem;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-soft);
  transition: transform .15s ease;
}
.resume-card:hover, .lesson-card:hover { transform: translateY(-2px); }
.resume-card > span:last-child, .lesson-card > span:last-child { margin-left: auto; color: var(--brand); font-size: 1.2rem; }
.lesson-card { margin-bottom: 1.25rem; }
.milestone-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-size: .88rem; color: var(--muted); margin: 0 0 1rem;
}
.milestone-strip span { white-space: nowrap; }
.ms-dot { opacity: .5; }
.quick-card { border-style: dashed; }
.wow-line { color: var(--gold); font-weight: 600; }

/* Today card: progress bar + done tasks. */
.dt-progress {
  height: .45rem; border-radius: 999px; background: var(--line);
  overflow: hidden; margin: .1rem 0 .25rem;
}
.dt-progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transition: width .6s ease;
}
.dt-prog-label { margin: 0 0 .6rem; }
.dt-task.dt-done { opacity: .65; }
.dt-task.dt-done .dt-label { text-decoration: line-through; }

/* Study plan header stats. */
.plan-stats { display: grid; gap: .75rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 0 0 .25rem; }
.plan-stat .hud-goal-top { margin-bottom: .25rem; }
.readiness-strip {
  background: var(--card); border: 1px solid var(--line); border-radius: .75rem;
  padding: .6rem .9rem; font-size: .9rem; box-shadow: var(--shadow-soft);
}

/* Admin: announcement form. */
.drill-progress { margin: .35rem 0 .75rem; }
.ann-form { display: grid; gap: .6rem; max-width: 32rem; }
.ann-form input[type="text"] { width: 100%; }

/* Dashboard research-spec rebuild: compact HUD, linear bars, score strip, week strip. */
.hud {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 1rem;
  padding: .7rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow-soft);
}
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.hud-streak-word { font-size: .85rem; font-weight: 600; color: var(--muted); }
.hud-streak {
  display: flex; align-items: center; gap: .35rem;
  background: none; border: none; cursor: pointer; font: inherit; color: var(--ink);
  font-size: 1.2rem; font-weight: 800; padding: .2rem;
}
.hud-streak .gs-ico { width: 1.5rem; height: 1.5rem; }
.hud-freeze { font-size: .78rem; font-weight: 600; }
.hud-goal { flex: 1 1 auto; min-width: 0; }
.hud-goal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.hud-goal-top strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.hud-level { background: none; border: none; cursor: pointer; font: inherit; color: var(--muted); font-size: .85rem; font-weight: 700; padding: .2rem; white-space: nowrap; }
.bar { height: .5rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--gold)); transition: width .8s ease; }
.bar-thin { height: .35rem; }
@media (prefers-reduced-motion: reduce) {
  .bar > span { transition: none; }
}

/* Score trajectory strip. */
.score-strip { margin-bottom: 1rem; }
.ss-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .4rem; }
.ss-head .m-label { margin: 0; }
.ss-chip { font-size: .78rem; }
.ss-score { display: flex; align-items: center; gap: .7rem; margin: .2rem 0 .5rem; }
.ss-mid { font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.spark { width: 120px; height: 36px; color: var(--brand); margin-left: auto; flex: none; }
.ss-sec { display: flex; align-items: center; gap: .6rem; margin-top: .35rem; font-size: .88rem; }
.ss-name { min-width: 2.2rem; color: var(--muted); }
.ss-sec .bar { flex: 1 1 auto; }
.ss-sec strong { font-variant-numeric: tabular-nums; }
.ss-weak { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.ss-goal { margin: .5rem 0 0; }
.ss-more { margin: .35rem 0 0; font-size: .85rem; }

/* This-week strip. */
.week-section { margin-bottom: 1.25rem; }
.ws-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.ws-head .m-label { margin: 0; }
.goal-inline { display: flex; align-items: center; gap: .35rem; }
.goal-inline input[type="number"] { width: 3.6rem; }
.ws-days { display: flex; gap: .35rem; margin: 0 0 .6rem; }
.ws-day {
  flex: 1 1 0; text-align: center; font-size: .72rem; font-weight: 600;
  padding: .4rem 0; border-radius: .5rem; background: var(--line); color: var(--muted);
}
.ws-day.on { background: color-mix(in srgb, var(--brand) 28%, var(--card)); color: var(--ink); }
.ws-day.today { outline: 2px solid var(--brand); outline-offset: -2px; }
.ws-day.future { opacity: .45; }
.ws-sub { margin: .35rem 0 0; }

/* Shortcut cheat-sheet overlay for the question runners (views/partials/shortcuts-overlay.ejs).
   Toggled with ? from public/runner-keys.js. Entrance animation only runs
   under prefers-reduced-motion: no-preference. */
.sc-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(35, 30, 20, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.sc-overlay[hidden] { display: none; }
.sc-dialog {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: .8rem;
  box-shadow: 0 12px 40px rgba(35, 30, 20, .25);
  max-width: 22rem; width: 100%;
  padding: 1.25rem 1.5rem 1rem; position: relative;
}
.sc-dialog h3 { margin: 0 0 .75rem; }
.sc-close {
  position: absolute; top: .5rem; right: .75rem;
  background: none; border: none; color: var(--ink);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: .25rem;
}
.sc-list { margin: 0; }
.sc-row {
  display: flex; gap: .75rem; align-items: baseline;
  padding: .3rem 0; border-top: 1px solid var(--line);
}
.sc-row:first-child { border-top: none; }
.sc-row dt { white-space: nowrap; }
.sc-row dd { margin: 0; }
.sc-dialog kbd {
  font-family: inherit; font-size: .85em; font-weight: 700;
  background: var(--paper, #f6f1e7); color: var(--ink);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: .3rem;
  padding: .1em .45em;
}
.sc-hint { font-size: .9em; opacity: .8; margin: .75rem 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .sc-overlay:not([hidden]) .sc-dialog { animation: sc-pop .18s ease-out; }
  @keyframes sc-pop {
    from { transform: scale(.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

/* ---------- Smooth UI transitions ---------- */
/* Cross-document view transitions (Chrome/Edge): every page navigation crossfades. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s ease-out both; }
::view-transition-new(root) { animation: vt-in .26s ease-out both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(5px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(7px); } }

/* JS fallback for browsers without cross-document view transitions (Safari/Firefox). */
.js-page-transitions body { animation: page-enter .26s ease-out both; }
.js-page-transitions.page-leaving body {
  animation: none; opacity: 0; transform: translateY(6px);
  transition: opacity .16s ease-out, transform .16s ease-out;
}
@keyframes page-enter { from { opacity: 0; transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) {
  .js-page-transitions body { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Mobile nav sheet: glide open, ease closed. */
@media (max-width: 760px) {
  .nav.menu-open .nav-links { animation: sheet-in .24s cubic-bezier(.2,.9,.3,1.15) both; }
  .nav.menu-closing .nav-links { display: flex; animation: sheet-out .18s ease-in both; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* Desktop dropdown menus: fade/slide open instead of snapping. */
.nav-drop.open .drop-menu { animation: drop-in .18s ease-out both; transform-origin: top left; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } }

/* Accordions: keep the summary affordance crisp while JS animates the height. */
details > summary { cursor: pointer; }

/* ---------- "Get help" (ask-a-tutor) ---------- */
.help-wrap { margin-top: .75rem; position: relative; }
.help-btn .ico, .help-sent .ico { width: 1em; height: 1em; vertical-align: -0.12em; }
.help-sent {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--green, #15803d); font-weight: 600; font-size: .92rem;
}
.help-note { margin-top: .5rem; max-width: 28rem; }
.help-note label { display: block; font-size: .85rem; font-weight: 600; }
.help-note textarea {
  width: 100%; margin-top: .3rem; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: .5rem;
  font: inherit; font-size: .9rem; background: var(--card); color: var(--ink);
  resize: vertical;
}
.help-saved { margin: .25rem 0 0; }
.help-nudge {
  position: absolute; z-index: 40; margin-top: .4rem; max-width: 19rem;
  padding: .9rem 1rem; box-shadow: 0 12px 32px rgba(0,0,0,.16);
}
.help-nudge p { margin: 0 0 .5rem; }
.help-nudge p:last-child { margin-bottom: 0; }
.help-nudge .cta-row { display: flex; gap: .6rem; align-items: center; }

/* ---------- Tutor flags queue (/teach) ---------- */
.flag-student { margin-bottom: 1rem; }
.flag-student h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.flag-prep { margin: 0 0 .75rem; }
.flag-card {
  border-top: 1px solid var(--line); padding: .75rem 0;
}
.flag-card:first-of-type { border-top: none; padding-top: .25rem; }
.flag-meta { margin: 0 0 .3rem; }
.flag-stem { margin: 0 0 .4rem; }
.flag-note {
  margin: 0 0 .4rem; padding: .5rem .7rem; font-size: .9rem;
  background: var(--bg); border-left: 3px solid var(--accent); border-radius: 0 .4rem .4rem 0;
}
.flag-detail { margin: .4rem 0 .6rem; font-size: .92rem; }
.flag-detail summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.flag-choices { margin: .4rem 0; padding-left: 1.4rem; }
.flag-choices li { margin-bottom: .3rem; }

/* ---------- Tutor replies + session recaps ---------- */
.help-reply {
  margin-top: .6rem; max-width: 28rem; padding: .7rem .9rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: .6rem;
}
.help-reply-text { margin: 0; font-size: .92rem; white-space: pre-wrap; }
.flag-reply {
  margin: 0 0 .4rem; padding: .5rem .7rem; font-size: .9rem;
  background: var(--bg); border-left: 3px solid var(--green, #15803d); border-radius: 0 .4rem .4rem 0;
}
.flag-reply-form { margin: .4rem 0 .6rem; max-width: 32rem; }
.flag-reply-form label { display: block; font-size: .85rem; font-weight: 600; }
.flag-reply-form textarea {
  width: 100%; margin: .3rem 0 .5rem; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: .5rem;
  font: inherit; font-size: .9rem; background: var(--card); color: var(--ink);
  resize: vertical;
}
.recap-preview { margin: 0 0 .3rem; }
.recap-textarea {
  width: 100%; margin-top: .3rem; padding: .5rem .6rem;
  border: 1px solid var(--line); border-radius: .5rem;
  font: inherit; font-size: .9rem; background: var(--card); color: var(--ink);
  resize: vertical;
}
