/* Study Hub — shared styles */
:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --ink: #1c2433;
  --muted: #5b6472;
  --line: #e3e7ee;
  --actg: #0e7c66;      /* ledger green */
  --actg-soft: #e2f3ee;
  --econ: #4f46e5;      /* regression indigo */
  --econ-soft: #e9e8fd;
  --geog: #0369a1;      /* field-notebook blue */
  --geog-soft: #e2f1fa;
  --ersc: #6d28d9;      /* deep space violet */
  --ersc-soft: #ede9fe;
  --bio: #0f766e;
  --bio-soft: #dcf2ee;
  --je:   #1d4ed8;      /* the John Emmett hub */
  --je-soft: #e3ecfd;
  --racs: #0f766e;      /* Rochester Academy Charter School */
  --racs-soft: #dcf2ee;
  --now: #e05d3d;       /* the needle */
  --good: #15803d;
  --warn: #b45309;
  --bad: #b3261e;
  --shadow-1: 0 1px 2px rgba(28,36,51,.06), 0 4px 12px rgba(28,36,51,.08);
  --shadow-2: 0 2px 4px rgba(28,36,51,.08), 0 12px 28px rgba(28,36,51,.14);
  --r: 14px;
  --sans: "Avenir Next", "Avenir", -apple-system, "Segoe UI", system-ui, sans-serif;
  --serif: "Charter", "Georgia", serif;
  --mono: ui-monospace, "SF Mono", "Menlo", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
code { font-family: var(--mono); font-size: 0.9em; background: #eef1f6; padding: 1px 5px; border-radius: 5px; }
pre code { display: block; padding: 12px 14px; overflow-x: auto; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }
.narrow { max-width: 780px; }

/* ---------- header / top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(242,244,248,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1100px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 14px;
}
.topbar .brand { font-weight: 600; text-decoration: none; font-size: 15px; }
.topbar .brand span { color: var(--muted); font-weight: 500; }
.topbar .spacer { flex: 1; }
.clock { font-family: var(--mono); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* on narrow screens the brand, day switch, pace pill, clock and session button
   do not fit on one line; let them wrap and shrink the clock a touch */
@media (max-width: 520px) {
  .topbar-in { gap: 8px; flex-wrap: wrap; padding: 8px 14px; }
  .clock { font-size: 18px; }
}

/* ---------- cards ---------- */
.card {
  background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow-1); padding: 22px 24px;
}
.card + .card { margin-top: 18px; }
.card.raised { box-shadow: var(--shadow-2); }

/* subject cards on hub */
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 26px; }
.subject-card {
  display: block; text-decoration: none; position: relative;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1);
  padding: 26px 26px 22px; transition: transform .15s ease, box-shadow .15s ease;
  border-top: 4px solid var(--accent, var(--ink));
}
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.subject-card .kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.subject-card h2 { margin: 6px 0 8px; font-size: 24px; }
.subject-card p { color: var(--muted); margin: 0 0 14px; }
.subject-card .links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block; font-size: 13px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  background: var(--soft, #eef1f6); color: var(--accent, var(--ink));
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 18px;
  font-weight: 600; font-size: 15px; color: #fff; background: var(--ink);
  box-shadow: var(--shadow-1); transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn.accent { background: var(--accent, var(--ink)); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(28,36,51,.05); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px #c3cad6, var(--shadow-1); }
.btn.small { padding: 7px 14px; font-size: 13px; border-radius: 999px; }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
:focus-visible { outline: 2.5px solid var(--accent, var(--econ)); outline-offset: 2px; }

/* status pill */
.pill {
  font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.pill.ahead { background: #e4f4e8; color: var(--good); }
.pill.behind { background: #fbeee1; color: var(--warn); }
.pill.onpace { background: #eef1f6; color: var(--muted); }

/* ---------- day layout ---------- */
.day-grid { display: grid; grid-template-columns: 264px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) {
  /* minmax(0,1fr) lets the single column shrink below the rail's nowrap content
     so the rail no longer forces the page wider than the viewport */
  .day-grid { grid-template-columns: minmax(0, 1fr); }
  /* wide tables scroll inside their own box instead of pushing the page sideways */
  .q-table, table.attempts, .scenario table, .mcq table, .explain table, .quiz-lesson table {
    display: block; overflow-x: auto; max-width: 100%;
  }
}

/* the signature: vertical day rail */
.rail {
  position: sticky; top: 64px; max-height: calc(100vh - 84px);
  overflow-y: auto; background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow-1); padding: 14px 0;
}
.rail-block {
  display: grid; grid-template-columns: 52px 14px 1fr; align-items: center;
  padding: 5px 12px 5px 10px; position: relative; min-height: 34px;
  border: 0; background: none; width: 100%; text-align: left; font-size: 13px;
  cursor: pointer; border-radius: 8px; transition: background .12s;
}
.rail-block:hover { background: #f1f3f7; }
.rail-block.viewing { background: var(--soft, #eef1f6); box-shadow: inset 0 0 0 1.5px var(--accent, #7c3aed); }
.rail-block.viewing .lbl { font-weight: 700; }
.rail-block .t { font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail-block .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--actg); justify-self: center; }
.rail-block.break .dot { background: transparent; border: 2px dashed #b9c1cd; border-radius: 50%; width: 9px; height: 9px; }
.rail-block.meal .dot { background: var(--warn); border-radius: 50%; }
.rail-block .lbl { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-block.break .lbl, .rail-block.meal .lbl { color: var(--muted); font-weight: 400; }
.rail-block.done .lbl { text-decoration: line-through; color: #a6adba; }
.rail-block.done .dot { background: #c9cfd9; }
.rail-block.current { background: linear-gradient(90deg, var(--actg-soft), transparent); }
.rail-block.current .lbl { font-weight: 700; }
.rail-block.skipped .lbl { color: #a6adba; font-style: italic; }
/* placed after the base .rail rules so these actually win on small screens:
   the rail drops out of sticky and shortens so it does not cover the questions,
   and minmax(0,1fr) lets long labels ellipsize instead of widening the page */
@media (max-width: 860px) {
  .rail { position: static; max-height: 320px; }
  .rail-block { grid-template-columns: 52px 14px minmax(0, 1fr); }
}
.rail-needle {
  position: absolute; left: 0; right: 0; height: 2px; background: var(--now);
  box-shadow: 0 0 6px rgba(224,93,61,.7); pointer-events: none; z-index: 2;
}
.rail-needle::before {
  content: ""; position: absolute; left: 2px; top: -3.5px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--now);
}

/* now banner */
.now-banner { border-left: 5px solid var(--actg); }
.now-banner.break-mode { border-left-color: var(--warn); background: #fffaf3; }
.now-banner .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.now-banner h2 { margin: 0 0 6px; font-size: 21px; }
.now-banner .meta { color: var(--muted); font-size: 14px; margin: 0; font-variant-numeric: tabular-nums; }
.now-banner ul { margin: 10px 0 0; padding-left: 20px; }
.block-flash { animation: flash 1.2s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 3px rgba(224,93,61,.45), var(--shadow-2); } }

/* ---------- topic sections & questions ---------- */
.topic { margin-top: 26px; scroll-margin-top: 76px; }
.topic-head { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.topic-head h2 { margin: 0; font-size: 22px; }
.topic-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.topic-head .count { color: var(--muted); font-size: 13.5px; }
.topic.known-topic .q-card, .topic.known-topic .intro { opacity: .45; }
.topic .intro { font-family: var(--serif); font-size: 16.5px; color: #333c4d; }

.q-card { margin-top: 14px; }
.q-card .q-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.q-card .q-title { font-weight: 700; font-size: 16.5px; }
.q-card .q-est { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.q-card .prompt { font-family: var(--serif); font-size: 16.5px; }
.q-table { border-collapse: collapse; margin: 10px 0; font-size: 14.5px; width: auto; }
.q-table th, .q-table td { border: 1px solid var(--line); padding: 6px 12px; text-align: right; }
.q-table th:first-child, .q-table td:first-child { text-align: left; }
.q-table th { background: #f6f8fb; font-weight: 600; }
/* tables and R code embedded in scenarios, questions, explanations, and lessons */
.scenario table, .mcq table, .explain table, .quiz-lesson table {
  border-collapse: collapse; margin: 12px 0; font-size: 14px; width: auto; background: #fff;
}
.scenario table th, .scenario table td, .mcq table th, .mcq table td,
.explain table th, .explain table td, .quiz-lesson table th, .quiz-lesson table td {
  border: 1px solid var(--line); padding: 6px 12px; text-align: right;
}
.scenario table th:first-child, .scenario table td:first-child, .mcq table th:first-child, .mcq table td:first-child,
.explain table th:first-child, .explain table td:first-child, .quiz-lesson table th:first-child, .quiz-lesson table td:first-child { text-align: left; }
.scenario table th, .mcq table th, .explain table th, .quiz-lesson table th { background: #f6f8fb; font-weight: 600; }
.mcq pre, .explain pre, .quiz-lesson pre { background: #f6f8fb; border-radius: 8px; padding: 10px 14px; overflow-x: auto; font-size: 13px; margin: 10px 0; }
.mcq pre code, .explain pre code, .quiz-lesson pre code { font-family: var(--mono); background: none; }
.journal { font-family: var(--mono); font-size: 13.5px; background: #f6f8fb; border-radius: 8px; padding: 10px 14px; margin: 8px 0; white-space: pre-wrap; }
.takeaway { border-left: 3px solid var(--actg); padding-left: 10px; color: #333c4d; font-size: 14.5px; }

.hint-toggle { margin-top: 8px; }
.hint-body {
  margin-top: 8px; background: #f3f7f6; border: 1px solid #d8e8e4;
  border-radius: 10px; padding: 12px 16px; font-size: 15px;
}
.answer-area { margin-top: 12px; }
.answer-area textarea {
  width: 100%; min-height: 88px; resize: vertical;
  font: 14px/1.5 var(--mono); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fbfcfe;
}
.answer-area textarea:focus { border-color: var(--actg); outline: none; }
.answer-area .saved { font-size: 12px; color: var(--muted); }

.solution {
  margin-top: 12px; border: 1.5px solid var(--actg-soft); border-radius: 10px;
  padding: 14px 16px; background: #f7fbfa;
}
.solution .sol-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.solution .sol-head strong { color: var(--actg); }
.marks { display: flex; gap: 6px; }
.mark-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mark-btn.on-got { background: #e4f4e8; border-color: var(--good); color: var(--good); }
.mark-btn.on-partial { background: #fbeee1; border-color: var(--warn); color: var(--warn); }
.mark-btn.on-missed { background: #fdecea; border-color: var(--bad); color: var(--bad); }
.backfilled { font-size: 12px; font-weight: 700; color: var(--econ); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- quiz player ---------- */
.scenario { background: #f6f8fb; border-radius: 10px; padding: 14px 18px; margin: 18px 0 6px; }
.scenario .sc-label { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent, var(--econ)); }
.mcq { margin-top: 12px; }
.mcq .prompt { font-weight: 600; }
.opts { display: grid; gap: 8px; margin-top: 8px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 14px; font-size: 15px; width: 100%;
}
.opt:hover { border-color: #b9c1cd; }
.opt .key { font-weight: 700; font-family: var(--mono); color: var(--muted); }
.opt.sel { border-color: var(--accent, var(--econ)); background: var(--soft, var(--econ-soft)); }
.opt.correct { border-color: var(--good); background: #e4f4e8; }
.opt.wrong { border-color: var(--bad); background: #fdecea; }
.explain { margin-top: 10px; border-left: 3px solid var(--accent, var(--econ)); padding: 2px 0 2px 12px; color: #333c4d; font-size: 14.5px; }
.key2success { margin: 10px 0 0; padding: 8px 12px; background: #fff7e6; border: 1px solid #ffe0a3; border-radius: 8px; color: #5a4300; font-size: 14.5px; }
.key2success strong { color: #8a5a00; }
/* Scaffold lesson shown before the questions start */
.quiz-lesson { margin: 4px 0 18px; padding: 16px 18px; background: var(--soft, #eef1f6); border-radius: 12px; border: 1px solid #e3e8f0; }
.quiz-lesson h3 { margin: 0 0 4px; font-size: 17px; }
.quiz-lesson h4 { margin: 12px 0 2px; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.quiz-lesson h4:first-of-type { margin-top: 6px; }
.quiz-lesson p { margin: 2px 0; font-size: 15px; }
/* Backup sub-lesson: a deeper explanation attached to a guessed question, shown in review */
.quiz-lesson.sub { margin: 12px 0 0; background: #f3f0ff; border-color: #d9cffb; border-left: 4px solid #7c3aed; }
.quiz-lesson.sub h3 { color: #5b3ec8; font-size: 15.5px; }
.quiz-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.timer { font-family: var(--mono); font-weight: 700; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.score-line { font-size: 20px; font-weight: 700; }
table.attempts { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.attempts th, table.attempts td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }

/* ---------- misc ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
/* three day panels across inside the narrow column: 260px each would overflow it */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.footer-note { margin-top: 40px; color: var(--muted); font-size: 13px; text-align: center; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.copied { color: var(--good) !important; }

/* ---------- collapsible topic headers ---------- */
.topic-toggle {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 9px;
  font-size: 21px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
}
.topic-toggle:hover { color: var(--actg); }
.topic-toggle .caret { color: var(--muted); font-size: 14px; width: 12px; }
.topic-head .count {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: #eef1f6; padding: 2px 8px; border-radius: 999px;
}
.topic:not(.open) .topic-head { opacity: .9; }
.topic:not(.open) .topic-head:hover { opacity: 1; }

/* ---------- econ day-plan block kinds ---------- */
.rail-block.k-tutor .dot { background: #7c3aed; }
.rail-block.k-exam .dot { background: #dc2626; }
.rail-block.k-equation .dot { background: #2563eb; }
.rail-block.k-gaps .dot { background: var(--warn); }
.rail-block.k-study .dot { background: var(--econ); }
.now-banner.k-tutor { border-left-color: #7c3aed; }
.now-banner.k-exam { border-left-color: #dc2626; }
.now-banner.k-equation { border-left-color: #2563eb; background: #f3f6ff; }
.now-banner.k-gaps { border-left-color: var(--warn); }
.now-banner.k-study { border-left-color: var(--econ); }

/* knowledge-gaps panel */
.gap-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.gap-dot { width: 16px; height: 16px; border-radius: 50%; border: 0; flex: 0 0 auto; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.gap-red .gap-dot { background: #dc2626; }
.gap-yellow .gap-dot { background: #d9a300; }
.gap-green .gap-dot { background: #15803d; }
.gap-name { flex: 1; font-size: 14.5px; }
.gap-search { position: relative; margin-bottom: 12px; }
.gap-search input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 14.5px; background: #fbfcfe; }
.gap-search input:focus { border-color: var(--econ); outline: none; }
.gap-results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.gap-result { all: unset; cursor: pointer; padding: 8px 12px; border-radius: 8px; font-size: 14.5px; }
.gap-result:hover { background: var(--econ-soft); }

/* guess button on quiz questions */
.q-foot { margin-top: 10px; }
.guess-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.guess-btn:hover { border-color: #b9c1cd; }
.guess-btn.on { background: #fff4e0; border-color: var(--warn); color: var(--warn); }

/* equation-sheet questions: blue highlight in the quiz */
.mcq.equation-q { background: #f3f6ff; border-left: 4px solid #2563eb; }
.eq-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #2563eb; background: #e0e9ff; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
/* light-blue "focus on this" highlight: the weak-subject questions to prioritise. Placed after equation-q so it wins when a card is both. */
.mcq.focus-q { background: #e6f4fb; border-left: 4px solid #0284c7; }
.focus-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #0369a1; background: #cfe9f7; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }

/* ---------- bionic reading ---------- */
/* The prefix span is inert until the `bionic` class is on <html>, so the toggle
   never re-touches the DOM. Weight steps up relative to the surrounding text. */
.br { font-weight: inherit; }
html.bionic .br { font-weight: 700; }
html.bionic h1 .br, html.bionic h2 .br, html.bionic h3 .br,
html.bionic .btn .br, html.bionic strong .br, html.bionic b .br { font-weight: 800; }

.bionic-toggle {
  position: fixed; bottom: 14px; left: 14px; z-index: 60;
  font: 600 12px/1 var(--sans); color: var(--muted);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; box-shadow: var(--shadow-1); opacity: .82;
}
.bionic-toggle:hover { opacity: 1; color: var(--ink); }
@media print { .bionic-toggle { display: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ================= GEOG: keyboard quiz + flashcards ================= */

/* --- control legend in the sticky header --- */
.keylegend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.keycap {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  background: #eef1f6; color: var(--muted); white-space: nowrap;
}
.keycap b {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
}
.keycap.is-good { background: #e4f4e8; color: #14622f; }
.keycap.is-warn { background: #fff4e0; color: #8a5a00; }
.keycap.is-bad  { background: #fdecea; color: #97231b; }
.keycap.is-accent { background: var(--soft, #eef1f6); color: var(--accent, var(--ink)); }

/* --- three-slot viewport: prev / current / next --- */
.slots { display: grid; gap: 14px; margin-top: 18px; }
.slot { transition: opacity .18s ease, transform .18s ease; }
.slot.is-ghost { opacity: .42; }
.slot.is-ghost .qcard { box-shadow: var(--shadow-1); }
.slot.is-pinned { opacity: 1; }

/* a question card */
.qcard {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1);
  padding: 20px 22px; border: 2px solid transparent;
}
.slot.is-current .qcard {
  border-color: var(--accent, var(--geog));
  box-shadow: 0 0 0 4px var(--soft, #e2f1fa), var(--shadow-2);
}
.qcard .qhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.qcard .qlabel {
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: var(--accent, var(--geog)); background: var(--soft, #e2f1fa);
  border-radius: 6px; padding: 2px 8px; text-transform: lowercase;
}
.qcard .qprompt { font-weight: 600; font-size: 16.5px; }
.qcard .qprompt p { margin: 0 0 6px; }

/* numbered options, 1-4 */
.nopts { display: grid; gap: 8px; margin-top: 12px; }
.nopt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 14px; font-size: 15px; transition: border-color .12s, background .12s;
}
.nopt .num {
  flex: none; width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  background: #eef1f6; color: var(--muted);
}
.nopt:hover { border-color: #b9c1cd; }
.nopt.sel { border-color: var(--accent, var(--geog)); background: var(--soft, #e2f1fa); }
.nopt.sel .num { background: var(--accent, var(--geog)); color: #fff; }
.nopt.correct { border-color: var(--good); background: #e4f4e8; }
.nopt.correct .num { background: var(--good); color: #fff; }
.nopt.wrong { border-color: var(--bad); background: #fdecea; }
.nopt.wrong .num { background: var(--bad); color: #fff; }

/* pinned figure / passage slot */
.pinned {
  background: var(--soft, #e2f1fa); border: 1px solid #cfe3f2;
  border-radius: var(--r); padding: 16px 18px;
}
.pinned .pin-label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent, var(--geog)); display: block; margin-bottom: 6px;
}
.pinned svg, .pinned img {
  display: block; max-width: 100%; height: auto; margin: 0 auto;
  /* keep the figure from crowding the question out of the viewport: the point
     of the pinned slot is seeing the figure AND the question together */
  max-height: 34vh;
}
/* A sourced diagram is dense, and its labels have to be legible or the question
   is unanswerable. Give photographic figures the container's full width and a
   taller ceiling than the hand-drawn SVGs need. */
.pinned img { width: 100%; max-height: 62vh; object-fit: contain; }
.pinned img { border-radius: 8px; }
.pinned.is-open svg, .pinned.is-open img { max-height: none; }
.pinned .zoom {
  display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600;
  color: var(--accent, var(--geog)); background: none; border: 0; padding: 0;
}
.pinned .credit { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.pinned figure { margin: 0; }

/* answered / flagged markers */
.qflag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 999px; }
.qflag.dunno { background: #fdecea; color: #97231b; }
.qflag.hinted { background: #fff4e0; color: #8a5a00; }
.qcard .hintbox {
  margin-top: 12px; background: #fff7e6; border: 1px solid #ffe0a3;
  border-radius: 10px; padding: 12px 14px; font-size: 14.5px;
}
.qcard .hintbox h4 { margin: 10px 0 2px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .02em; color: var(--muted); }
.qcard .hintbox h4:first-child { margin-top: 0; }
.qcard .hintbox p { margin: 2px 0; }

/* progress strip */
.qprogress { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.qdot { width: 9px; height: 9px; border-radius: 3px; background: #dfe4ec; }
.qdot.done { background: var(--accent, var(--geog)); }
.qdot.dunno { background: var(--bad); }
.qdot.cur { box-shadow: 0 0 0 2px var(--ink); }

/* ---------------- flashcards ---------------- */
.deck { position: relative; height: 400px; margin: 22px auto 0; max-width: 560px; }
.fcard {
  position: absolute; inset: 0; background: var(--card); border-radius: 18px;
  box-shadow: var(--shadow-2); padding: 28px 30px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; border: 2px solid transparent;
  transition: transform .28s cubic-bezier(.22,.61,.36,1), opacity .28s ease;
  will-change: transform;
}
.fcard .front { font-size: 25px; font-weight: 700; line-height: 1.25; }
.fcard .back { margin-top: 14px; font-size: 17px; color: var(--muted); line-height: 1.45; }
.fcard .tap { position: absolute; bottom: 16px; font-size: 12px; color: var(--muted); }
/* stacked cards behind the top one */
.fcard.behind-1 { transform: translateY(10px) scale(.965); opacity: .7; box-shadow: var(--shadow-1); }
.fcard.behind-2 { transform: translateY(20px) scale(.93); opacity: .45; box-shadow: var(--shadow-1); }
/* swipe-out animations */
.fcard.go-left  { transform: translateX(-125%) rotate(-16deg); opacity: 0; }
.fcard.go-right { transform: translateX(125%) rotate(16deg); opacity: 0; }
.fcard.go-up    { transform: translateY(-125%) scale(.9); opacity: 0; }
.fcard.flash-bad   { border-color: var(--bad); box-shadow: 0 0 0 5px #fdecea, var(--shadow-2); }
.fcard.flash-good  { border-color: var(--good); box-shadow: 0 0 0 5px #e4f4e8, var(--shadow-2); }
.fcard.flash-work  { border-color: var(--warn); box-shadow: 0 0 0 5px #fff4e0, var(--shadow-2); }

.tally { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.tally > span { font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px; }
.tally .t-good { background: #e4f4e8; color: #14622f; }
.tally .t-work { background: #fff4e0; color: #8a5a00; }
.tally .t-bad  { background: #fdecea; color: #97231b; }
.tally .t-left { background: #eef1f6; color: var(--muted); }

@media (max-width: 560px) {
  .deck { height: 340px; }
  .fcard .front { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .fcard, .slot { transition: none; }
}
