:root {
  font-family: Geist, system-ui, -apple-system, sans-serif;
  color: #18223a;
  background: #f5f7fb;
  font-synthesis: none;
  --ink: #18223a;
  --muted: #55617a;
  --line: #dce3ef;
  --paper: #fff;
  --primary: #3549ca;
  --primary-hover: #293bb1;
  --primary-soft: #eef1ff;
  --focus: #5369eb;
  --priority-ink: #794b10;
  --priority-bg: #fff1d5;
  --radius: 16px;
  --shadow: 0 2px 6px #17284307, 0 8px 24px #17284305;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1:focus, h2:focus { outline: none; }

.frame { width: min(calc(100% - 56px), 1152px); margin-inline: auto; }
main.frame { padding-bottom: 40px; }

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.home-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.025em;
}
.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #293b9d;
  box-shadow: 0 2px 4px #293b9d38;
}
.mark i {
  width: 8px;
  height: 12px;
  border: 1.5px solid #fff;
  border-radius: 2px 1px 1px 2px;
  transform: skewY(10deg);
}
.mark i + i {
  border-radius: 1px 2px 2px 1px;
  transform: skewY(-10deg);
}
.unit-label { color: var(--muted); font-size: 13px; font-weight: 550; }

.unit-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin-top: 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.unit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 15px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.unit-link:hover { background: #f2f5fb; color: var(--primary); }
.unit-link[aria-current="page"] { color: #fff; background: #293b9d; }

.hero {
  isolation: isolate;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: 30px;
  overflow: hidden;
  margin-top: 14px;
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid #20325f;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(115deg, #111d39 0%, #192951 55%, #293d81 100%);
  box-shadow: 0 12px 30px #182e611e;
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 93% 35%, #7184ed35, transparent 54%),
    repeating-linear-gradient(125deg, transparent 0 26px, #d2ddff10 27px, transparent 28px 45px);
  mask-image: linear-gradient(90deg, transparent 28%, #000 75%);
}
.eyebrow {
  color: #3449b5;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #c3d0ff; }
.hero h1 {
  margin-top: 12px;
  font-size: clamp(35px, 4.8vw, 58px);
  font-weight: 700;
  letter-spacing: -.065em;
  line-height: 1.04;
  text-wrap: balance;
}
.hero-description {
  margin-top: 14px;
  color: #dce5ff;
  font-size: 15px;
  line-height: 1.5;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #e7eeff13;
  border: 1px solid #e7eeff42;
  border-radius: 13px;
  align-self: end;
}
.hero-stats > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: start;
  gap: 6px;
  min-width: 0;
  padding: 14px clamp(8px, 1.35vw, 17px);
}
.hero-stats > div + div { border-left: 1px solid #e7eeff42; }
.hero-stats dt {
  color: #e0e8ff;
  font-size: clamp(10px, 1.2vw, 12px);
  font-weight: 550;
  line-height: 1.3;
}
.hero-stats dd {
  font-size: clamp(25px, 3.3vw, 36px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.06em;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.setup, .resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-top: 15px;
  padding: 13px 16px;
}
.settings { display: flex; flex-wrap: wrap; align-items: center; gap: 11px 22px; }
.mode-controls {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.mode-description { color: var(--muted); font-size: 14px; line-height: 1.5; }
.filter, .size-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}
.filter { position: relative; cursor: pointer; }
.filter input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}
.filter-track {
  position: relative;
  flex: 0 0 auto;
  width: 37px;
  height: 21px;
  border-radius: 12px;
  border: 1px solid #8794b0;
  background: #e4e9f4;
  transition: background-color 160ms, border-color 160ms;
}
.filter-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border: 1px solid #8794b0;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms;
}
.filter input:checked + .filter-track { background: var(--primary); border-color: var(--primary); }
.filter input:checked + .filter-track::after { transform: translateX(16px); border-color: #fff; }
.filter input:focus-visible + .filter-track { outline: 3px solid var(--focus); outline-offset: 3px; }
select {
  max-width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #f8faff;
  font-size: 14px;
  font-weight: 600;
}
select:hover { border-color: #97a6c7; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
  transition: background-color 160ms, border-color 160ms;
}
.primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 4px #2a3ca025;
}
.primary:hover { background: var(--primary-hover); }
.secondary { color: var(--ink); background: var(--paper); border-color: var(--line); }
.secondary:hover:not(:disabled) { color: var(--primary); border-color: #a4b1d4; background: #f8faff; }
.button:disabled { color: #6c7587; background: #f7f9fc; cursor: default; }
.mixed-button { margin-left: auto; }
.mixed-button .start-arrow { font-size: 17px; line-height: 1; }

.resume { background: #eef2ff; border-color: #ccd7ff; }
.resume p { color: #344371; font-size: 14px; font-weight: 600; line-height: 1.5; }
.topic-heading { margin: 27px 0 12px; font-size: 23px; letter-spacing: -.045em; }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.topic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  min-width: 0;
  min-height: 91px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: left;
  transition: background-color 160ms, border-color 160ms, box-shadow 160ms;
}
.topic-card:hover:not(:disabled) {
  border-color: #a7b5f1;
  background: #fbfcff;
  box-shadow: 0 5px 14px #20338a0e;
}
.topic-card:disabled { opacity: .55; cursor: default; }
.topic-content { min-width: 0; }
.topic-name { display: block; font-size: 15px; line-height: 1.35; font-weight: 700; letter-spacing: -.018em; }
.topic-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 9px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
}
.topic-priority { color: var(--priority-ink); }
.topic-priority::before { content: "·"; margin-right: 8px; color: #838da1; }
.topic-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 16px;
  line-height: 1;
  transition: background-color 160ms, color 160ms;
}
.topic-card:hover:not(:disabled) .topic-arrow { background: var(--primary); color: #fff; }
.priority-note { margin-top: 17px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.priority-note summary { width: fit-content; padding: 5px 0; color: #3449b5; font-weight: 700; }
.priority-note p { margin-top: 4px; }
.source-file { overflow-wrap: anywhere; }
.source-file strong { margin-right: 5px; color: var(--ink); }

.session-heading { padding: 24px 0 17px; }
.session-controls, .session-indicators { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.session-controls { justify-content: space-between; }
.session-mode { font-size: 13px; font-weight: 650; color: var(--muted); }
.mock-timer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
  font-size: 13px;
}
.mock-timer [role="timer"] {
  min-width: 6ch;
  color: var(--primary);
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.mock-timer[data-low-time="true"] { color: var(--priority-ink); background: var(--priority-bg); }
.mock-timer[data-low-time="true"] [role="timer"] { color: var(--priority-ink); }
.session-heading h1 {
  margin-top: 6px;
  font-size: clamp(28px, 4.6vw, 43px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.055em;
}
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}
.text-button:hover { background: var(--primary-soft); border-color: #a7b5f1; }
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 16px;
  align-items: start;
}
.question-panel { padding: clamp(18px, 3vw, 30px); }
.question-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.priority-tag, .status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 750;
  white-space: nowrap;
}
.priority-tag { background: var(--priority-bg); color: var(--priority-ink); }
.question-panel h2 {
  margin-top: 12px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.04em;
  text-wrap: pretty;
}
fieldset { display: grid; gap: 9px; min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 57px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fbfcff;
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
  transition: background-color 160ms, border-color 160ms;
}
.choice:hover { border-color: #9aabe0; background: #f5f7ff; }
.choice:has(:where(input:checked)) { border-color: var(--primary); background: var(--primary-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input { position: absolute; left: 14px; width: 28px; height: 28px; margin: 0; opacity: 0; }
.letter {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 6px;
  color: #354671;
  background: #edf1f9;
  font-size: 12px;
  font-weight: 750;
}
.choice:has(:where(input:checked)) .letter { color: #fff; background: var(--primary); }
.choice::after {
  content: "";
  flex: 0 0 16px;
  height: 16px;
  margin-left: auto;
  border: 1px solid #8794b0;
  border-radius: 50%;
  background: var(--paper);
}
.choice:has(:where(input:checked))::after { border: 5px solid var(--primary); }
.choice.is-correct { border-color: #589475; background: #edf8f1; }
.choice.is-incorrect { border-color: #bd756c; background: #fff1ee; }
.choice.is-correct .letter { color: #235b3a; background: #d9f0e2; }
.choice.is-incorrect .letter { color: #8b382f; background: #f9dfda; }
.choice.is-correct:has(input:checked)::after { border-color: #387b56; }
.choice.is-incorrect::after { border-color: #9d453b; }
.answer-feedback {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fd;
  font-size: 14px;
  line-height: 1.55;
}
.answer-feedback .reference { color: var(--muted); font-size: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.submit-check {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #c8d2fc;
  border-radius: 10px;
  background: var(--primary-soft);
  color: #344371;
  font-size: 14px;
  line-height: 1.5;
}
.submit-check-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.progress-panel { position: sticky; top: 16px; padding: 17px; }
.progress-panel h2 { font-size: 17px; letter-spacing: -.03em; }
.count { margin-top: 5px; color: var(--muted); font-size: 13px; }
progress {
  display: block;
  width: 100%;
  height: 7px;
  margin: 12px 0 15px;
  border: 0;
  border-radius: 12px;
  background: #e3e9fa;
  accent-color: var(--primary);
}
progress::-webkit-progress-bar { background: #e3e9fa; border-radius: 12px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 12px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 12px; }
.range-label { display: grid; gap: 5px; margin-bottom: 11px; color: var(--muted); font-size: 12px; font-weight: 650; }
.question-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.jump {
  position: relative;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: #4b5874;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.jump:hover { color: var(--primary); border-color: #9aabe0; }
.jump.answered { color: var(--primary); background: var(--primary-soft); }
.jump.answered::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.jump[aria-current="step"] { color: var(--primary); border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.submit { width: 100%; margin-top: 13px; }

.results-panel { grid-column: 1 / -1; padding: 12px; }
.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 17px;
  padding: clamp(18px, 3.5vw, 36px);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(115deg, #111d39, #293d81);
}
.score-header .eyebrow { color: #c3d0ff; }
.score {
  margin-top: 6px;
  font-size: clamp(45px, 7vw, 70px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.065em;
}
.score-description { margin-top: 9px; color: #e0e8ff; font-size: 14px; line-height: 1.5; }
.score-header .primary { border-color: #e7eeff; background: #fff; color: #253b9e; }
.score-header .primary:hover { background: #e7eeff; }
.score-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.score-header .secondary { border-color: #a5b3e9; background: transparent; color: #fff; }
.score-header .secondary:hover { border-color: #e7eeff; background: #ffffff1a; color: #fff; }
.score-actions .button:focus-visible { outline-color: #bdccff; }
.review { padding: 8px 12px 10px; }
.review-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.review-heading h3 { font-size: 21px; letter-spacing: -.04em; }
.review-item { border-top: 1px solid var(--line); }
.review-item summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  padding: 13px 4px;
  min-height: 45px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 650;
  list-style: none;
}
.review-item summary::-webkit-details-marker { display: none; }
.review-item summary::before {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  border-right: 1.5px solid var(--primary);
  border-bottom: 1.5px solid var(--primary);
  transform: rotate(-45deg);
}
.review-item[open] summary::before { transform: rotate(45deg); }
.review-item summary:hover { color: var(--primary); }
.review-question { flex: 1 1 215px; min-width: 0; }
.review-flags { display: flex; flex-wrap: wrap; gap: 5px; padding-left: 0; }
.status.correct { background: #e9f6ee; color: #235b3a; }
.status.incorrect { background: #fcece9; color: #8b382f; }
.status.skipped { background: #eef1f7; color: #4f5b73; }
.review-body { display: grid; gap: 6px; margin: 0 0 12px; padding: 11px 13px; border-radius: 9px; background: #f7f9fd; font-size: 14px; line-height: 1.55; }
.review-body .reference { color: var(--muted); font-size: 12px; }
.review-empty { padding: 15px 0; color: var(--muted); font-size: 14px; }

@media (max-width: 890px) {
  .frame { width: calc(100% - 40px); }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { gap: 17px; }
}
@media (max-width: 690px) {
  .masthead-inner { min-height: 58px; }
  .unit-nav { margin-top: 14px; }
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; border-radius: 16px; }
  .hero h1 { max-width: 500px; }
  .hero-stats { align-self: start; }
  .hero-stats > div { padding: 12px 10px; }
  .hero-stats dt { font-size: 11px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .progress-panel { position: static; }
  .topic-heading { margin-top: 22px; }
}
@media (max-width: 470px) {
  .frame { width: calc(100% - 28px); }
  .hero { padding: 20px 16px; }
  .hero h1 { font-size: clamp(30px, 8vw, 38px); }
  .hero-description { font-size: 14px; }
  .unit-label { font-size: 12px; }
  .setup, .resume { gap: 9px; padding: 12px; }
  .settings { display: grid; width: 100%; gap: 2px; }
  .quiz-size-label, .mode-label { justify-content: space-between; }
  .mode-label { width: 100%; }
  .mixed-button { width: 100%; }
  .topic-grid { grid-template-columns: minmax(0, 1fr); }
  .topic-card { min-height: 74px; }
  .question-panel { padding: 15px; }
  .choice { gap: 9px; padding-inline: 9px; font-size: 14px; }
  .choice::after { flex-basis: 14px; height: 14px; }
  .review-flags { padding-left: 18px; }
  .review { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
