/* quizSite — one stylesheet, mobile first, no external resources. */

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;

  /* Achromatic ledger: paper, ink, one marking pen. */
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f4;
  --ink: #0b0d0f;
  --ink-2: #2b3136;
  --muted: #5f666d;
  --line: #e2e6ea;
  --line-strong: #cfd6dc;
  --control: #cfd6dc;

  --accent: #141414;
  --accent-ink: #ffffff;
  --accent-text: #1d5fbf;
  --accent-soft: #e9f0fa;

  --pen: #1d5fbf;
  --pen-soft: #e9f0fa;
  --pen-line: #b9cdea;

  --ok-text: #1e5c24;
  --ok-soft: #e8f3e9;
  --ok-line: #bfdcc2;
  --warn-text: #74400d;
  --warn-soft: #faf0df;
  --warn-line: #ecd2ae;
  --bad-text: #8f1d15;
  --bad-soft: #fbecea;
  --bad-line: #efc4bf;

  --shadow: 0 8px 28px rgba(11, 13, 15, .16);

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 8px;
  --r-pill: 999px;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-base: 16px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;

  --page: 760px;
  --gutter: 16px;
  --tap: 44px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (min-width: 600px) {
  :root { --gutter: 24px; }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f1113;
  --surface: #16191b;
  --surface-2: #1c2023;
  --surface-3: #22272a;
  --ink: #f1f3f4;
  --ink-2: #c6ccd0;
  --muted: #a2a9ae;
  --line: #272c30;
  --line-strong: #3a4146;
  --control: #3a4146;

  --accent: #f1f3f4;
  --accent-ink: #0b0d0f;
  --accent-text: #8dc0f5;
  --accent-soft: #17242f;

  --pen: #7fb2ef;
  --pen-soft: #16232f;
  --pen-line: #2b4256;

  --ok-text: #8fd8a2;
  --ok-soft: #172a1c;
  --ok-line: #2b4a33;
  --warn-text: #e8bf7a;
  --warn-soft: #2a2115;
  --warn-line: #4a3a20;
  --bad-text: #f0a09a;
  --bad-soft: #2c1816;
  --bad-line: #4d2a26;

  --shadow: 0 8px 28px rgba(0, 0, 0, .55);
}

/* -------------------------------------------------------------- reset/base */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-underline-offset: 2px; }

::selection { background: var(--pen-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ------------------------------------------------------------------ layout */

.topBar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.topBarInner {
  max-width: var(--page);
  margin: 0 auto;
  min-height: 48px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}

.page {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 20px var(--gutter) 48px;
  flex: 1 0 auto;
}

.page:focus { outline: none; }

.siteFooter {
  max-width: var(--page);
  width: 100%;
  margin: 0 auto;
  padding: 20px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
  border-top: 1px solid var(--line);
}

.footerMeta { font-variant-numeric: tabular-nums; }
.footerMeta:empty { display: none; }
.footerNote { margin-top: 4px; }
.footerCredit {
  margin-top: 10px;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.footerCreditName {
  color: var(--ink);
  font-weight: 500;
}

/* ------------------------------------------------------------------- type */

.h1 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
.h2 { font-size: var(--fs-xl); letter-spacing: -0.015em; }
.h3 { font-size: var(--fs-lg); }
.lede { color: var(--muted); font-size: var(--fs-md); line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.pageHead { margin-bottom: 0; }
.pageHead .h1 { margin-bottom: 4px; }

/* ------------------------------------------------------------------ stacks */

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack--tight { gap: 8px; }
.stack--loose { gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}

.cardLink {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color .12s ease, background-color .12s ease;
}

.cardLink:hover { border-color: var(--line-strong); background: var(--surface-2); }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-md);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.btn:hover { background: var(--surface-2); border-color: var(--control, var(--line-strong)); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent); opacity: .9; }

.btn--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--pen);
}
.btn--quiet:hover { background: var(--pen-soft); }

.btn--danger { color: var(--bad-text); border-color: var(--bad-line); background: var(--bad-soft); }
.btn--danger:hover { background: var(--bad-soft); border-color: var(--bad-text); }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.btn--block { width: 100%; }

.iconBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.iconBtn:hover { background: var(--surface-2); color: var(--ink); }

.iconBtn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.iconSun { display: none; }
:root[data-theme="dark"] .iconSun { display: block; }
:root[data-theme="dark"] .iconMoon { display: none; }

.btnRow { display: flex; flex-wrap: wrap; gap: 10px; }
.btnRow > .btn { flex: 1 1 auto; }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge--noDot::before { display: none; }
.badge--high { color: var(--ok-text); background: var(--ok-soft); border-color: var(--ok-line); }
.badge--check { color: var(--warn-text); background: var(--warn-soft); border-color: var(--warn-line); }
.badge--discuss { color: var(--bad-text); background: var(--bad-soft); border-color: var(--bad-line); }
.badge--accent { color: var(--accent-text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.badge--tag { color: var(--ink-2); background: var(--surface-2); }

/* ---------------------------------------------------------------- progress */

.bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--pen);
  transition: width .2s ease;
}

.bar--ok > span { background: var(--ok-text); }

.statRow { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { min-width: 0; padding-right: 12px; }
.stat:last-child { padding-right: 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 12px; }
.statValue { font-family: var(--font-mono); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.statLabel { font-size: 11.5px; color: var(--muted); }

/* ----------------------------------------------------------------- notices */

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.notice--warn { border-left-color: var(--warn-text); background: var(--warn-soft); color: var(--warn-text); }
.notice--bad { border-left-color: var(--bad-text); background: var(--bad-soft); color: var(--bad-text); }
.notice--info { border-left-color: var(--pen); background: var(--pen-soft); color: var(--ink-2); }

.notice .noticeTitle { font-weight: 600; display: block; margin-bottom: 2px; }

/* ------------------------------------------------------------------- empty */

.emptyState {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 24px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.emptyState .h3 { color: var(--ink); margin-bottom: 6px; }

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  text-align: center;
}

/* -------------------------------------------------------------- utilities */

.skipLink {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 600;
}
.skipLink:focus { top: 8px; }

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 90;
}

/* ------------------------------------------------------------- app chrome */

.banners {
  max-width: var(--page);
  width: 100%;
  margin: 12px auto 0;
  padding: 0 var(--gutter);
}
.banners:empty { display: none; }

.backLink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  margin-top: -8px;
  align-self: flex-start;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.backLink:hover { color: var(--ink); }
.backArrow { font-size: 16px; line-height: 1; }

.chev {
  flex: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

/* -------------------------------------------------------------------- home */

.blockGrid { display: grid; gap: 12px; }

@media (min-width: 640px) {
  .blockGrid { grid-template-columns: 1fr 1fr; }
}

.blockCard { display: block; padding: 16px; }

.blockCardTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.blockName {
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

.blockMeta { margin-top: 3px; color: var(--muted); font-size: 13px; }

.progressBlock { display: grid; gap: 7px; margin-top: 14px; }

.progressText {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- block */

.blockHead { display: grid; gap: 10px; }
.blockHead .badgeRow { margin-top: 2px; }
.blockActions { margin-top: 6px; }

.section { margin-top: 6px; }

.sectionTitle {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.sectionCount { font-size: 11px; font-weight: 600; letter-spacing: 0; opacity: .8; }

.rowList {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.rowItem + .rowItem { border-top: 1px solid var(--line); }

.rowLink {
  display: block;
  min-height: var(--tap);
  padding: 13px 16px 14px;
  color: inherit;
  text-decoration: none;
}
.rowLink:hover, .rowLink:active { background: var(--surface-2); }
.rowLink:focus-visible { outline-offset: -3px; }
.groupProgressRow:focus-visible, .mapPanel > summary:focus-visible { outline-offset: -3px; }

.rowTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rowTitle {
  min-width: 0;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
  overflow-wrap: break-word;
}

.rowMeta { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.rowLink .badgeRow { margin-top: 7px; }
.rowLink .progressBlock { margin-top: 11px; gap: 5px; }
.rowLink .bar { height: 4px; }

.rowSub { margin-top: 4px; color: var(--muted); font-size: 12.5px; }

.rowNote { padding: 13px 16px; }
.rowItem--disabled { background: var(--surface-2); }
.rowItem--disabled .rowTitle { color: var(--muted); }

.rowExtra { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }

.linkChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 640;
  text-decoration: none;
}
.linkChip:hover { border-color: var(--line-strong); }
.linkChipArrow { font-size: 13px; opacity: .8; }

/* --------------------------------------------------------------- setup */

.setup { display: grid; gap: 24px; }

.setupField { display: grid; gap: 10px; }

.setupLabel {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.setupHint { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }

.groupList {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.groupOption {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.groupOption + .groupOption { border-top: 1px solid var(--line); }
.groupOption:hover { background: var(--surface-2); }
.groupOption input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.groupOptionName { flex: 1 1 auto; min-width: 0; }
.groupCount { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.chipGrid { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--tap);
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 620;
  cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}
.chipCount { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.chip[aria-pressed="true"] .chipCount { color: inherit; opacity: .75; }

.inlineActions { display: flex; gap: 14px; }

.textButton {
  min-height: var(--tap);
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 620;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.segmented {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.segmented button {
  flex: 1 1 0;
  min-height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 640;
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.segmented button:focus-visible { outline-offset: -3px; }
.segmented--exam { margin-top: 2px; }

.stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stepBtn {
  width: var(--tap);
  height: var(--tap);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.stepBtn:hover { background: var(--surface-2); }

.countInput {
  width: 76px;
  height: var(--tap);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.countInput:disabled { opacity: .5; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.45; }

.optionRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.optionLabel { font-size: 14px; font-weight: 600; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  font-size: 14.5px;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.select {
  min-width: 112px;
  height: var(--tap);
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.startBar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.startBarInner {
  max-width: var(--page);
  margin: 0 auto;
  display: grid;
  gap: 8px;
}
html[data-route="start"] .page { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
html[data-route="start"] .siteFooter { display: none; }


.matchLine { font-size: 14px; font-weight: 500; }
.matchLine--none { color: var(--warn-text); }

/* ------------------------------------------------------------------ run */

.run { display: grid; gap: 12px; }

.runBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.runBarRight {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
}

.runMode { font-size: 12px; color: var(--muted); }

.runCount {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.timer {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.timer--low { color: var(--bad-text); font-weight: 600; }

.runProgress {
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--line);
}
.runProgress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--pen);
  transition: width .2s ease;
}

.questionCard {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.questionMeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.qIndex {
  margin-right: 2px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.qid {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0;
  color: var(--muted);
}

.questionMeta .badge {
  padding: 0;
  border: 0;
  background: transparent;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.questionMeta .badge::before { width: 6px; height: 6px; }
.questionMeta .badge--high { color: var(--ok-text); }
.questionMeta .badge--check { color: var(--warn-text); }
.questionMeta .badge--discuss { color: var(--bad-text); }
.questionMeta .badge--sm { font-size: 11.5px; }

.lectureChip {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.lectureChip--none { color: var(--muted); }

.sourceLine {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.questionText {
  margin: 14px 0 0;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.questionText:focus { outline: none; }

@media (max-width: 359px) {
  .questionText { font-size: 19px; }
}

.options {
  margin: 16px -16px 0;
  border-top: 1px solid var(--line);
}

.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: background-color .12s ease;
}
.option:last-child { border-bottom: 0; }
.option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
.option:hover { background: var(--surface-2); }
.option:active { background: var(--surface-3); }
.option:focus-visible { outline-offset: -3px; }

.optionLetter {
  flex: none;
  width: 18px;
  margin-top: 1px;
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
}

.optionBody { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.optionText { display: block; }

.optionMark {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.option--selected { background: var(--pen-soft); }
.option--selected::before { background: var(--pen); }
.option--selected .optionLetter,
.option--selected .optionMark { color: var(--pen); }

.option--correct { background: var(--ok-soft); }
.option--correct::before { background: var(--ok-text); }
.option--correct .optionLetter,
.option--correct .optionMark { color: var(--ok-text); }

.option--wrong { background: var(--bad-soft); }
.option--wrong::before { background: var(--bad-text); }
.option--wrong .optionLetter,
.option--wrong .optionMark { color: var(--bad-text); }

.option--locked { cursor: default; }
.option--locked:hover,
.option--locked:active { background: transparent; }
.option--locked.option--correct:hover { background: var(--ok-soft); }
.option--locked.option--wrong:hover { background: var(--bad-soft); }
.option--locked.option--selected:hover { background: var(--pen-soft); }

.feedback {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 14px 0 0 14px;
  border-top: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
}
.feedback:focus { outline: none; }
.feedback--ok { border-left-color: var(--ok-text); }
.feedback--bad { border-left-color: var(--bad-text); }

@media (prefers-reduced-motion: no-preference) {
  .feedback { animation: feedbackIn .16s ease-out; }
  .answerBlock { animation: feedbackIn .16s ease-out; }
  @keyframes feedbackIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
  }
}

.feedbackVerdict { font-size: 13px; font-weight: 600; }
.feedbackVerdict--ok { color: var(--ok-text); }
.feedbackVerdict--bad { color: var(--bad-text); }

.feedbackAnswer { font-size: 13.5px; color: var(--ink-2); }
.feedbackExplanation { font-size: 15px; line-height: 1.55; color: var(--ink); }

.detailList { display: grid; gap: 6px; margin-top: 2px; }
.detailRow {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: baseline;
}
.detailRow--wide { grid-template-columns: 1fr; }
.detailLabel {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.detailValue { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

.runActions { display: flex; justify-content: flex-start; margin-top: 12px; }
.reportBtn {
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reportBtn:hover { color: var(--ink); background: transparent; }

.runNav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.runNavInner {
  max-width: var(--page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.runNav .btn { min-height: 48px; }
html[data-route="run"] .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
html[data-route="run"] .siteFooter { display: none; }
html[data-route="run"] .toast { bottom: calc(104px + env(safe-area-inset-bottom)); }

/* exam */

.mapPanel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.mapPanel > summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}
.mapPanel > summary:focus-visible { outline-offset: -3px; }
.mapGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 4px;
  padding: 0 12px 12px;
}
.mapBtn {
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.mapBtn.isAnswered { border-bottom: 2px solid var(--pen); color: var(--pen); }
.mapBtn.isCurrent { border-color: var(--ink); color: var(--ink); }

.confirmPanel {
  display: grid;
  gap: 10px;
  padding: 12px 0 0 14px;
  border: 0;
  border-left: 3px solid var(--warn-text);
  background: transparent;
}
.confirmText { font-size: 14px; font-weight: 500; color: var(--warn-text); }

/* flashcards */

.answerBlock {
  position: relative;
  display: grid;
  gap: 16px;
  margin: 18px 0 0;
  padding: 16px 0 0 14px;
  border-top: 1px solid var(--line);
}
.answerBlock::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--pen);
}
.answerBlock:focus { outline: none; }

.answerSection { display: grid; gap: 8px; }

.answerLabel {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.answerList {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: 6px;
  font-size: 15px;
  line-height: 1.55;
}
.answerList li::marker { color: var(--muted); }
.answerList--alt { color: var(--ink-2); }

.altAnswer { padding-left: 12px; border-left: 1px solid var(--line-strong); }

.flashAnswer { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }

.revealBtn { margin-top: 16px; }

.markRow { display: flex; gap: 10px; margin-top: 4px; }
.markRow .btn { flex: 1 1 0; min-height: 48px; }

.btn--ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-text); }
.btn--ok:hover { background: var(--ok-soft); border-color: var(--ok-text); }
.btn--miss { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-text); }
.btn--miss:hover { background: var(--bad-soft); border-color: var(--bad-text); }

.markNote { font-size: 12px; color: var(--muted); }

/* results */

.summaryCard { padding: 20px 16px; text-align: left; }
.summaryScore {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.summaryCard .muted { font-size: 13px; }

.statCard { padding: 16px; }

.reviewSection { display: grid; gap: 10px; }
.reviewList { display: grid; border-top: 1px solid var(--line); }

.reviewItem {
  display: grid;
  gap: 8px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.reviewItem:last-child { border-bottom: 0; }

.reviewQuestion { font-size: 15px; font-weight: 600; line-height: 1.45; }
.reviewAnswer { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.reviewAnswer .detailLabel { display: inline; margin-right: 6px; }
.reviewAnswer--correct { color: var(--ok-text); }
.reviewExplanation { font-size: 13px; line-height: 1.5; color: var(--muted); }

.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------- progress */

.progressActions { display: flex; flex-wrap: wrap; gap: 10px; }
.progressActions .btn { flex: 1 1 auto; }

.progressCard { padding: 16px; }

.progressCardTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progressBlockName {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink);
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.progressBlockName:hover { color: var(--accent-text); }

.progressCardMeta {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.progressBarWrap { margin-top: 12px; }

.examBreakdown {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.groupProgressList { margin-top: 14px; border-top: 1px solid var(--line); }

.groupProgressRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.groupProgressRow:last-child { border-bottom: 0; }
.groupProgressRow:hover .groupProgressName { color: var(--accent-text); }

.groupProgressName { min-width: 0; font-size: 14px; font-weight: 600; }

.groupProgressStats {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

[hidden] { display: none !important; }


.badgeRow { display: flex; flex-wrap: wrap; gap: 5px; }
.badge--sm { padding: 2px 8px 2px 7px; font-size: 11px; }

.emptyActions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }

.problemList { margin-top: 8px; font-size: 12.5px; }
.problemList summary { cursor: pointer; font-weight: 600; }
.problemList ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }

