:root {
  color-scheme: light;
  --ink: #142738;
  --muted: #4f6270;
  --line: #d6e1e5;
  --paper: #f0f5f6;
  --navy: #0b2133;
  --green: #006557;
  --mint: #67e5c5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 system-ui, sans-serif; }
button, input, select { font: inherit; }
button:not(:disabled), select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #008e79; outline-offset: 4px; }
.wrap { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
.masthead { color: #fff; background: var(--navy); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 64px; border-bottom: 1px solid #365062; gap: 16px; }
.nav a { color: #dcebee; text-decoration: none; }
.nav a:hover, .source:hover { text-decoration: underline; }
.nav .brand { font-weight: 850; font-size: 1.18rem; color: white; }
.hero { padding-block: clamp(28px, 5vw, 62px); }
.eyebrow, .small { font-size: .72rem; letter-spacing: .12em; font-weight: 800; margin: 0; }
.hero .eyebrow, .hero h1 span { color: var(--mint); }
.hero h1 { font-size: clamp(2.2rem, 5.7vw, 4.6rem); line-height: 1.02; margin: .3em 0 .18em; letter-spacing: -.058em; }
.hero > p:last-child { color: #dcebee; margin: 0; font-size: 1.08rem; }
.layout { display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: start; margin-block: 30px 0; }
.sidebar, .panel { border: 1px solid var(--line); border-radius: 16px; background: white; padding: clamp(18px, 3.5vw, 36px); }
.sidebar { padding: 24px; }
.sidebar .eyebrow, .topic, .headline-stat { color: var(--green); }
.headline-stat { font-size: clamp(2.9rem, 6vw, 4.4rem); font-weight: 850; letter-spacing: -.06em; line-height: 1; margin: .18em 0; font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
h2, h3 { line-height: 1.25; margin: 0 0 10px; }
.sidebar h2 { font-size: 1.05rem; }
.panel h2 { font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.025em; }
.muted, footer { color: var(--muted); }
.panel > .muted { margin-top: 0; }
.distribution { font-size: .91rem; }
.distribution div { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 9px; }
dd { margin: 0; font-weight: 750; }
.source { color: var(--green); display: inline-block; font-size: .88rem; }
#setup-form label { display: block; margin-top: 22px; margin-bottom: 7px; font-weight: 750; }
select, input[type=number] { min-height: 46px; border-radius: 9px; border: 1px solid #a9bec7; background: #fff; color: var(--ink); padding: 8px 12px; }
select { width: 100%; }
input[type=number] { width: 100px; }
.count-row, .actions, .presets { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.hint { font-size: .9rem; min-height: 1.5em; }
button { min-height: 44px; border-radius: 9px; border: 1px solid transparent; padding: 8px 14px; font-weight: 730; }
.primary { background: var(--green); color: white; }
.primary:hover:not(:disabled) { background: #004c41; }
button:disabled { opacity: .53; cursor: default; }
.secondary, .presets button { border-color: var(--line); background: var(--paper); color: var(--ink); }
.presets button { min-width: 44px; padding-inline: 10px; }
.plain { background: none; color: var(--muted); text-decoration: underline; padding-inline: 6px; }
.meters { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.meters div { display: grid; gap: 3px; }
.meters div:last-child { text-align: right; }
.small { color: var(--muted); }
.meters strong { font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 9px; border: 0; border-radius: 9px; overflow: hidden; appearance: none; margin-block: 12px 21px; background: var(--paper); }
progress::-webkit-progress-bar { background: var(--paper); }
progress::-webkit-progress-value { background: var(--green); border-radius: 9px; }
progress::-moz-progress-bar { background: var(--green); border-radius: 9px; }
.topic { margin-bottom: 8px; }
#question { overflow-wrap: anywhere; }
fieldset { margin: 18px 0; border: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.option { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: baseline; gap: 11px; min-height: 44px; overflow-wrap: anywhere; }
.option:has(input:not(:disabled)) { cursor: pointer; }
.option:has(input:not(:disabled)):hover, .option:has(input:checked) { background: var(--paper); border-color: var(--green); }
.option input { margin: 0; flex: none; accent-color: var(--green); }
.option .letter { font-weight: 780; }
.option.right { background: #e2f6ec; border-color: #2f8761; }
.option.wrong { background: #fff0ed; border-color: #ae4b40; }
.feedback { border-left: 4px solid var(--green); padding: 14px 16px; background: #e9f6f1; border-radius: 4px 10px 10px 4px; margin-block: 14px; }
.feedback.incorrect { border-color: #af4a40; background: #fff0ed; }
.feedback p { margin: 4px 0 0; }
#play .actions { margin-top: 12px; }
.breakdown { padding: 0; margin: 0 0 20px; list-style: none; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.breakdown strong { flex: none; }
details { margin-top: 20px; }
summary { color: var(--green); font-weight: 700; }
#review-list { padding-left: 24px; }
#review-list li { margin-block: 14px; overflow-wrap: anywhere; }
#review-list p { margin: 4px 0; }
footer { padding-block: 22px 32px; font-size: .88rem; }
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
  .sidebar { order: 2; }
}
@media (max-width: 400px) {
  .wrap { width: calc(100% - 24px); }
  .meters .small { letter-spacing: .04em; }
}

#reading { margin: 14px 0; padding: 10px 12px; background: var(--paper); border-radius: 9px; }
.excerpts { display: grid; gap: 8px; max-width: 100%; overflow: auto; }
.excerpts canvas { display: block; max-width: 100%; height: auto; }
.excerpts canvas:first-child { margin-top: 8px; }
#past-question.zoomed canvas { max-width: none; }
.past-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-block: 8px; }
.answer-caption { font-weight: 700; margin-bottom: 4px; }
#answers.letters { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#answers.letters .option { justify-content: center; align-items: center; gap: 4px; padding-inline: 3px; }
