:root {
  color-scheme: light;
  --ink: #142f36;
  --muted: #476068;
  --teal: #006459;
  --border: #cadbd5;
  --canvas: #f4f8f6;
  --mint: #e2f0e9;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: var(--teal); }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #965300; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { line-height: 1.08; font-size: clamp(2rem, 5vw, 3.65rem); letter-spacing: -.042em; }
h2, h3 { font-size: 1.32rem; line-height: 1.25; }
.shell { width: min(calc(100% - 2rem), 70rem); margin-inline: auto; }
.skip { position: absolute; top: -8rem; left: 1rem; background: #fff; padding: .75rem; z-index: 1; }
.skip:focus { top: 1rem; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.4rem; min-height: 5rem; padding-block: .65rem; flex-wrap: wrap; }
.brand { width: 10.5rem; display: block; }
.brand img { display: block; }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 650; padding: .6rem .7rem; border-radius: .45rem; }
.site-header nav a:hover, .site-header nav [aria-current] { background: var(--mint); color: var(--teal); }
.preview-note { margin: 1.45rem 0 1.15rem; color: var(--muted); font-size: .875rem; }
main { padding-top: 1.25rem; }
main:has(> .preview-note) { padding-top: 0; }
.hero { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 1.35rem; padding: clamp(1.35rem, 5vw, 3.25rem); border: 1px solid var(--border); border-radius: 1rem; background: #e6f3ed; }
.hero p:last-child { max-width: 46ch; margin-top: .85rem; color: #345058; }
.eyebrow { margin-bottom: .55rem; font-size: .83rem; font-weight: 750; color: var(--teal); letter-spacing: .066em; text-transform: uppercase; }
.hero-action { flex: 0 1 auto; }
.account { overflow-wrap: anywhere; }
.quiz-topics { display: flex; flex-wrap: wrap; gap: .35rem .85rem; margin: .65rem 0 1.2rem; }
.quiz-topics a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.chapters, .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0 2.5rem; }
.card, .panel, .stats > div { padding: clamp(1rem, 3vw, 1.65rem); background: #fff; border: 1px solid var(--border); border-radius: .8rem; }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; border-top: 3px solid #6aa396; }
.card > p:not(.count) { color: var(--muted); flex: 1; }
.count { color: var(--teal); font-size: .83rem; font-weight: 700; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 48px; border: 1px solid transparent; border-radius: .5rem; padding: .55rem 1rem; font-weight: 700; text-decoration: none; text-align: center; }
.primary { color: #fff; background: var(--teal); }
.primary:hover { background: #004c43; }
.outline, .ghost { background: #fff; color: var(--teal); border-color: #779c92; }
.outline:hover, .ghost:hover { background: var(--mint); }
.back, .text-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .65rem; font-weight: 650; }
.notice { background: var(--mint); border-radius: .5rem; margin: .8rem 0 1rem; padding: .7rem .9rem; }
.error { background: #fce9e8; color: #7a2725; border: 1px solid #d9a39e; }
.form-panel, .narrow { max-width: 45rem; }
.form-panel h1, .narrow h1 { font-size: clamp(1.95rem, 4vw, 2.95rem); margin-bottom: .65rem; }
.form-panel .text-link { margin: .65rem 0 0; }
.stack { display: grid; gap: .85rem; margin-top: 1rem; }
.stack label { font-weight: 650; }
.stack label > input:not([type=radio]) { display: block; width: 100%; min-height: 48px; margin-top: .25rem; border-radius: .45rem; border: 1px solid #78958d; padding: .55rem .7rem; }
.stack .button { justify-self: start; }
.muted { color: var(--muted); font-size: .9rem; }
.question { min-inline-size: 0; margin-inline: 0; }
.question legend { font-size: 1.075rem; font-weight: 750; max-width: 100%; }
.quiz-progress { display: grid; gap: .3rem; max-width: 24rem; margin: .95rem 0; color: var(--teal); font-weight: 700; }
.quiz-progress progress { width: 100%; height: .65rem; accent-color: var(--teal); }
.option { display: flex; align-items: center; gap: .7rem; min-height: 48px; padding: .45rem .6rem; border-radius: .4rem; cursor: pointer; }
.option:hover, .option:has(input:checked) { background: var(--mint); }
.option input { flex: 0 0 auto; margin: 0; width: 1.12rem; height: 1.12rem; accent-color: var(--teal); }
.score { display: flex; gap: 1rem; align-items: center; background: var(--mint); padding: 1rem 1.35rem; border-radius: .7rem; }
.score strong { font-size: 2.1rem; }
.review { padding-left: 1.5rem; }
.review li { margin: .75rem 0; }
.review h2 { margin: .35rem 0; }
.review p + p { margin-top: .45rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.result-label { display: inline-block; font-size: .85rem; font-weight: 750; padding: .15rem .55rem; border-radius: .3rem; }
.correct { background: var(--mint); color: #035448; }
.incorrect { background: #fce9e8; color: #7a2725; }
.stats dt { font-weight: 650; }
.stats dd { font-size: 2rem; font-weight: 750; color: var(--teal); }
.table-wrap { overflow: auto; margin: .65rem 0 1.6rem; border: 1px solid var(--border); border-radius: .5rem; background: #fff; }
table { border-collapse: collapse; width: 100%; min-width: 29rem; text-align: left; }
th, td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
th { background: var(--mint); }
.footer { border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: .6rem; padding-block: 1rem; margin-top: 2.5rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 620px) {
  .shell { width: calc(100% - 1.5rem); }
  .header-inner { gap: .45rem; }
  .site-header nav { order: 1; width: 100%; }
  .site-header nav a { padding-inline: .43rem; font-size: .87rem; }
  .brand { width: 8.7rem; }
  .chapters, .stats { grid-template-columns: 1fr; gap: .7rem; }
  .card .button { width: 100%; }
}
