/* =====================================================
   Ari Shapiro Tutoring — Bluebook-style SAT prep
   Shared design system. Used by every page.
   ===================================================== */

:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: #d6d6d6;
  --line-strong: #b5b5b5;
  --accent: #0a4b9c;
  --accent-soft: #e8f0fb;
  --top-bar: #ffffff;
  --bottom-bar: #f4f4f4;
  --selected: #0a4b9c;
  --selected-bg: #e8f0fb;
  --crossed: #9a9a9a;
  --flag: #c0392b;
  --success: #1f7a3a;
  --success-soft: #e6f4ec;
  --error: #c0392b;
  --error-soft: #fbecea;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

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

/* =====================================================
   APP SHELL — used by practice.html
   ===================================================== */
.app {
  display: grid;
  grid-template-rows: 56px 1fr 64px;
  height: 100vh;
}

/* ---------- Top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  background: var(--top-bar);
}
.section-title { font-weight: 600; font-size: 15px; }
.section-title small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.timer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 600;
}
.timer button {
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  color: var(--ink);
}
.timer .pause-btn {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-weight: 600;
}
.timer .pause-btn:hover { opacity: .92; }
.timer .pause-btn.paused {
  background: var(--success);
  border-color: var(--success);
}

/* Pause overlay — sits between top bar and bottom bar, hides .main */
.pause-overlay {
  position: fixed;
  top: 56px;        /* topbar height */
  left: 0;
  right: 0;
  bottom: 64px;     /* bottombar height */
  background: rgba(245, 247, 250, 0.98);
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pause-overlay.open { display: flex; }
.pause-card { padding: 40px; max-width: 460px; }
.pause-icon {
  font-size: 72px;
  color: var(--muted);
  line-height: 1;
  margin-bottom: 12px;
}
.pause-overlay h2 {
  font-size: 40px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.pause-overlay p {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
}
.pause-overlay .btn { padding: 12px 36px; font-size: 16px; }
.top-tools {
  justify-self: end;
  display: flex;
  gap: 16px;
}
.top-tools button {
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.top-tools .icon { font-size: 18px; line-height: 1; }
.top-tools button.is-on {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Desmos calculator floating panel ---------- */
.calc-panel {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 640px;
  height: 640px;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  z-index: 900;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  resize: both;
  min-width: 320px;
  min-height: 320px;
}
.calc-panel.minimized {
  height: 40px !important;
  resize: none;
}
.calc-panel.minimized iframe { display: none !important; }
.calc-handle {
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  cursor: move;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  height: 40px;
  box-sizing: border-box;
}
.calc-title { font-size: 13px; font-weight: 600; }
.calc-handle-actions { display: flex; gap: 4px; }
.calc-handle-actions button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.calc-handle-actions button:hover { background: rgba(255, 255, 255, 0.15); }

/* ---------- Reference sheet ---------- */
.ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
  align-items: start;
}
.ref-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ref-card .ref-shape svg {
  width: 100%;
  max-width: 130px;
  height: auto;
  display: block;
}
.ref-card .ref-formula {
  font-size: 14px;
  line-height: 1.6;
}
.ref-section-divider {
  grid-column: span 2;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 6px;
}
.ref-notes {
  grid-column: span 2;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.ref-notes p { margin: 0 0 6px; }

/* ---------- Check Your Work review screen ---------- */
.cyw-overlay {
  position: fixed;
  inset: 0;
  background: #fafbfc;
  z-index: 700;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 100px;
}
.cyw-content {
  width: 100%;
  max-width: 920px;
}
.cyw-title {
  font-size: 38px;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 12px;
}
.cyw-sub {
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 28px;
}
.cyw-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 22px 26px;
  margin-bottom: 24px;
}
.cyw-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.cyw-card-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.cyw-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.cyw-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cyw-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.cyw-swatch.cyw-unans { border: 1.5px dashed var(--line-strong); background: transparent; }
.cyw-swatch.cyw-flag  { background: var(--error); }
.cyw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 10px;
}
.cyw-q {
  border: 1.5px dashed var(--line-strong);
  border-radius: 6px;
  background: transparent;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  position: relative;
}
.cyw-q:hover { background: var(--accent-soft); }
.cyw-q.answered {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.cyw-q.answered:hover { opacity: 0.88; }
.cyw-q.flagged::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 14px;
  background: var(--error);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
}
.cyw-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.cyw-actions .btn { padding: 12px 36px; font-size: 16px; }

/* ---------- Main content (test runner) ---------- */
.main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}
.pane {
  overflow-y: auto;
  padding: 28px 48px;
}
.pane.left {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.passage { max-width: 620px; font-size: 17px; line-height: 1.7; }
.passage p { margin: 0 0 1em; }
.passage.scratch-pad {
  min-height: 70vh;
  background: repeating-linear-gradient(180deg, #fafafa 0, #fafafa 31px, #ececec 31px, #ececec 32px);
  border-radius: 8px;
}
.passage.scratch-pad .scratch-hint {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Highlights on passage text (background-color is set inline per highlight) */
.passage mark.hl {
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  cursor: pointer;
  transition: filter .12s;
}
.passage mark.hl:hover { filter: brightness(0.92); }

/* Passage + canvas overlay wrapper — fills the rest of the left pane
   so the type tool can drop notes anywhere on the left side, not just
   over the text itself. */
.passage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 100%;
  width: 100%;
}
.anno-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10;  /* sit above the passage text so pen strokes cover characters */
}

/* The annotation toolbar floats — it never shifts question content.
   It's positioned fixed-bottom-right by default so it overlays the
   page without pushing anything down. Draggable. */
.anno-toolbar.floating {
  position: fixed !important;
  bottom: 70px;
  right: 24px;
  top: auto !important;
  left: auto;
  z-index: 850;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.15);
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 340px;
}
.anno-canvas.active {
  pointer-events: auto;
  cursor: crosshair;
}
.anno-canvas.erase {
  cursor: cell;
}
/* Visual hint when the Highlight tool is active — cursor becomes a marker
   and dragging over text highlights in the current color on release. */
.passage.highlighter-mode {
  cursor: text;
}
.passage.highlighter-mode ::selection {
  background: var(--accent-soft);
}

/* Annotation toolbar — sticky at top of the passage pane */
.anno-toolbar {
  position: sticky;
  top: -28px;            /* counter the .pane padding-top so it pins to true top */
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 6px;
  margin: -10px 0 16px;
  width: max-content;
  max-width: 100%;
  backdrop-filter: blur(6px);
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.anno-tool, .anno-action {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.anno-tool:hover, .anno-action:hover {
  background: var(--line);
  color: var(--ink);
}
.anno-tool.active {
  background: var(--ink);
  color: #fff;
}
.anno-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  cursor: pointer;
  padding: 0;
  margin: 0 1px;
  transition: transform .1s;
}
.anno-color:hover { transform: scale(1.1); }
.anno-color.active {
  outline: 2.5px solid var(--ink);
  outline-offset: 1px;
}
.anno-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
  display: inline-block;
}

/* Pen-width buttons (dots) */
.anno-widths {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.anno-width {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.anno-width:hover { background: var(--line); }
.anno-width.active { border-color: var(--ink); }
.anno-width .w-dot {
  background: var(--ink);
  border-radius: 50%;
  display: inline-block;
}

/* Text-note layer + individual notes */
.anno-notes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.anno-note {
  position: absolute;
  min-width: 110px;
  max-width: 260px;
  background: #fffcdc;
  border: 1.5px solid #d6b900;
  border-radius: 6px;
  padding: 6px 22px 6px 8px;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
  pointer-events: auto;
  z-index: 4;
  transform: translate(-4px, -4px);
}
.anno-note .note-text {
  outline: none;
  min-height: 16px;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.anno-note .note-text:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}
.anno-note .note-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: none;
}
.anno-note:hover .note-del { display: inline-block; }
.anno-note .note-del:hover { background: rgba(0, 0, 0, .08); color: var(--ink); }
.anno-canvas.type {
  cursor: text;
  pointer-events: auto;
}

/* Floating "Highlight" button shown after text selection */
.hl-popup {
  position: fixed;
  z-index: 80;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  padding: 2px;
}
.hl-popup.hidden { display: none; }
.hl-popup button {
  background: transparent;
  border: none;
  color: #fff;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
}
.hl-popup button:hover { background: rgba(255, 255, 255, .12); }

.qheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px;
  margin-bottom: 18px;
}
.qnum {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 4px;
}
.flag-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.flag-btn.active { color: var(--flag); font-weight: 600; }
.flag-btn .pin::before { content: "⚑"; }

.qstem { font-size: 17px; margin-bottom: 22px; max-width: 620px; }
/* When the stem IS an image, we don't want the 620px text cap — let the
   image breathe up to the pane width. */
.qstem:has(> img),
.qstem:has(> .qb-img) { max-width: 100%; }

/* SAT Question Bank rendered-image questions. Used inside .qstem (practice
   runner) and .review-stem (results page review). */
.qb-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 12px;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
/* When an image-stem question has placeholder choices ("A","B","C","D"),
   the real choices live inside the image. Don't show the duplicate text —
   just show large clickable letter circles so the student can click
   their answer (the image already labels A/B/C/D). */
.choices.placeholder-letters .choice .text { display: none; }
.choices.placeholder-letters .choice {
  flex: 1;
  min-width: 60px;
  max-width: 90px;
  justify-content: center;
  padding: 14px 0;
}
.choices.placeholder-letters {
  flex-direction: row;
  gap: 12px;
  max-width: 460px;
}
.choices.placeholder-letters .choice .letter {
  font-size: 16px;
  width: 30px;
  height: 30px;
}
.choices.placeholder-letters .choice .cross-toggle { display: none; }

/* "Heads-up: passage/figure missing" banner shown on ACT Sci/Reading/Eng
   questions that reference context not yet bundled into the image. */
.context-warning {
  background: #fff7e6;
  border: 1.5px solid #ffd48a;
  color: #8a5a00;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
}

/* ===== Review Mode ===== */
/* Triggered by ?review=1; body gets .review-mode class.
   When user checks "Show correct answer + explanation", body also gets .review-revealed. */
.review-reveal-toggle:hover { background: #f0f4ff; }
.review-reveal-toggle input { width: 16px; height: 16px; accent-color: #2563eb; }

/* Correct-choice marker: invisible until revealed */
body.review-mode .choice.review-correct { /* default: no visual cue */ }
body.review-revealed .choice.review-correct {
  border: 2px solid #16a34a !important;
  background: #f0fdf4 !important;
  position: relative;
}
body.review-revealed .choice.review-correct::after {
  content: "✓ correct";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #16a34a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}

/* Explanation panel below choices — hidden until revealed */
.review-explanation {
  display: none;
  margin: 18px 0 0;
  background: #f6f8fb;
  border: 1.5px solid #cfd9e7;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #213040;
}
body.review-revealed .review-explanation { display: block; }
.review-correct-line {
  font-size: 13px;
  color: #16a34a;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cfd9e7;
}
.review-picked-line {
  font-size: 13px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cfd9e7;
}
.review-picked-line.right { color: #16a34a; }
.review-picked-line.wrong { color: #dc2626; }
.review-explanation-text { color: #213040; }

/* "Student picked this" marker — always visible (so tutor can see at a glance),
   but reveals red/green only when the answer reveal checkbox is on. */
body.review-mode .choice.review-picked {
  border-left: 4px solid #6b7eb5;
  position: relative;
}
body.review-mode .choice.review-picked::before {
  content: "you picked";
  position: absolute;
  left: -4px;
  top: -8px;
  background: #6b7eb5;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
/* When revealed AND picked is WRONG (not the correct one), show red */
body.review-revealed .choice.review-picked:not(.review-correct) {
  border: 2px solid #dc2626 !important;
  background: #fef2f2 !important;
}
body.review-revealed .choice.review-picked:not(.review-correct)::before {
  background: #dc2626;
  content: "✗ your answer";
}
/* When revealed AND picked is also correct, the green styling (.review-correct)
   wins for the border; we still want to show it was their pick */
body.review-revealed .choice.review-picked.review-correct::before {
  background: #16a34a;
  content: "✓ you got it!";
}
.choices {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choice {
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  background: #fff;
  transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--ink); }
.choice.selected {
  border-color: var(--selected);
  background: var(--selected-bg);
}
.choice .letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.choice.selected .letter {
  background: var(--selected);
  color: #fff;
  border-color: var(--selected);
}
.choice.crossed .text { text-decoration: line-through; color: var(--crossed); }
.choice.crossed .letter {
  text-decoration: line-through;
  color: var(--crossed);
  border-color: var(--crossed);
}
/* Per-choice elimination button — Bluebook-style circled "ABC" with a slash.
   The ABC text is ALWAYS shown with a strikethrough (to communicate what the
   button does at a glance). Click to cross out a wrong answer; click again
   to restore. */
.cross-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  background: transparent;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  transition: border-color .12s, color .12s, background .12s;
}
.cross-toggle:hover { color: var(--ink); border-color: var(--ink); background: #fafafa; }
/* When the choice is crossed, the button shows it's "on" — different style */
.choice.crossed .cross-toggle {
  text-decoration: line-through;
  color: var(--ink);
  border-color: var(--ink);
  background: #fff;
}

/* SPR (student-produced response) input row */
.choice.spr-input {
  cursor: default;
  border-style: dashed;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice.spr-input:hover { border-color: var(--accent); }
.choice.spr-input .spr-field {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font: inherit;
  padding: 4px 0;
  font-size: 18px;
  color: var(--ink);
}

/* Math-symbol palette for SPR answers */
.spr-palette {
  padding: 8px 0 0;
  list-style: none;
}
.spr-palette-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.spr-sym {
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: -apple-system, "Times New Roman", serif;
  min-width: 36px;
  color: var(--ink);
}
.spr-sym:hover { border-color: var(--ink); background: var(--accent-soft); }
.spr-sym.is-clear {
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
}
.spr-sym.is-clear:hover { color: var(--error); border-color: var(--error); background: #fff; }
.spr-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- multi_select / multi_spr / self_grade (digital test types) ---------- */
/* Hint banner shown above the choice list for multi_select / multi_spr */
.ms-hint {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 10px;
}
.ms-hint b { color: var(--accent); }

/* multi_select — checkbox icon swap-out + selected state */
.multi-select-choice .ms-checkbox {
  font-size: 22px;
  background: transparent;
  border: none;
  color: var(--muted);
}
.multi-select-choice.selected .ms-checkbox { color: var(--accent); }

/* multi_spr — N text inputs in a grid row */
.multi-spr-row { padding: 4px 0; list-style: none; }
.multi-spr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 6px 0 10px;
}
.multi-spr-cell { display: flex; flex-direction: column; gap: 4px; }
.multi-spr-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.multi-spr-field {
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 18px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.multi-spr-field:focus { border-color: var(--accent); }

/* self_grade — reveal-then-self-mark interaction */
.choice.self-grade {
  display: block;
  padding: 14px 16px;
  background: #fafafa;
}
.self-grade-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.self-grade-reveal {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}
.self-grade-reveal:hover { filter: brightness(1.05); }
.self-grade-answer {
  background: #e7f7e7;
  border: 1px solid #3a7a3a;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.self-grade-answer-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #2a5a2a;
  margin-bottom: 4px;
}
.self-grade-answer-text {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.45;
}
.self-grade-buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.self-grade-btn {
  flex: 1;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.self-grade-btn.sg-right.active {
  background: #e7f7e7;
  border-color: #3a7a3a;
  color: #2a5a2a;
}
.self-grade-btn.sg-wrong.active {
  background: #fde7e7;
  border-color: #a33a3a;
  color: #7a2a2a;
}
.self-grade-btn:hover { border-color: var(--ink); }

/* ---------- Bottom bar ---------- */
.bottombar {
  border-top: 1px solid var(--line);
  background: var(--bottom-bar);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
}
.student-name { font-weight: 600; font-size: 14px; }
.qnav-toggle {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .12s, background .12s;
}
.qnav-toggle:hover {
  border-color: var(--ink);
  background: var(--accent-soft);
}
.qnav-toggle .qnav-chev {
  font-size: 9px;
  color: var(--muted);
  line-height: 1;
}
.nav-buttons { justify-self: end; display: flex; gap: 10px; }
.nav-buttons button {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.nav-buttons button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.nav-buttons button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Question navigator drawer ---------- */
.qnav {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
  padding: 18px 22px;
  width: min(640px, 92vw);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 50;
}
.qnav.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.qnav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.qnav h3 { margin: 0; font-size: 15px; }
.qnav-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.qnav-jump input {
  width: 80px;
  padding: 6px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.qnav-jump input:focus { outline: none; border-color: var(--ink); }
.qnav-jump button {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.qnav-jump button:hover { opacity: .92; }
.qnav-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}
.qnav-grid button {
  aspect-ratio: 1;
  border: 1.5px dashed var(--line-strong);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  position: relative;
}
.qnav-grid button.answered {
  border-style: solid;
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.qnav-grid button.current { outline: 2px solid var(--accent); outline-offset: 2px; }
.qnav-grid button .flag-mark {
  position: absolute;
  top: -4px;
  right: -4px;
  color: var(--flag);
  font-size: 14px;
}
.qnav-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.qnav-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.swatch.unans { border: 1.5px dashed var(--line-strong); }
.swatch.ans { background: var(--ink); }
.swatch.flag { background: var(--flag); }

/* Single-column variant (math / standalone) */
.main.single { grid-template-columns: 1fr; }
.main.single .pane.left { display: none; }
.main.single .pane.right { padding-left: 80px; padding-right: 80px; }

/* =====================================================
   PAGE SHELL — used by index.html, admin.html, results.html
   ===================================================== */
.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}
.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
/* When .brand is rendered as an <a> (linking back to Home from every
   page), give it a subtle hover so it reads as clickable. */
a.brand {
  cursor: pointer;
  transition: opacity .12s;
  color: var(--ink);    /* override the global `a { color: accent }` so the
                           brand stays dark on every page (Students-hub,
                           Parents-hub, College advising were going accent-blue) */
}
a.brand:hover { opacity: .7; text-decoration: none; color: var(--ink); }
.brand small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0;
}
.page-nav .links {
  display: flex;
  gap: 22px;
  font-size: 14px;
}
.page-nav .links a { color: var(--muted); }
.page-nav .links a.active { color: var(--ink); font-weight: 600; }

h1.page-title {
  font-size: 36px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
p.page-sub {
  color: var(--muted);
  font-size: 17px;
  margin: 0 0 32px;
  max-width: 640px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, transform .12s;
}
.card:hover {
  border-color: var(--ink);
  text-decoration: none;
  transform: translateY(-1px);
}
.card .card-eyebrow {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.card .card-cta {
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
}

/* Stat / info blocks */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 32px 0 14px;
}
.section-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.section-header .hint { font-size: 13px; color: var(--muted); }

.empty {
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Notice / badge */
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge.warn { background: #fff4d6; color: #8a5a00; }
.badge.muted { background: #efefef; color: var(--muted); }

/* Form bits (admin) */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input[type="text"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus,
.field textarea:focus,
.field select:focus { outline: none; border-color: var(--ink); }

/* Responsive */
@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; }
  .pane.left { border-right: none; border-bottom: 1px solid var(--line); }
  .pane { padding: 20px 22px; }
  .page { padding: 28px 20px 60px; }
  h1.page-title { font-size: 28px; }
}
