:root {
  color-scheme: light;
  --page: #f2f6fb;
  --surface: #fff;
  --ink: #0e263c;
  --muted: #506579;
  --line: #d8e3ed;
  --navy: #0b233b;
  --green: #4de5a5;
  --green-soft: #d9f8eb;
  --blue-soft: #e6eef8;
  --warn: #795008;
  --warn-bg: #fff4d8;
  --danger: #a13239;
  font: 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; }
a { color: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #207d72; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; }
h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); font-weight: 780; letter-spacing: -.055em; }
h2 { font-size: clamp(1.28rem, 2.6vw, 1.7rem); letter-spacing: -.035em; }
h3 { font-size: 1.06rem; }
img { display: block; max-width: 100%; }
.layout { max-width: 1320px; margin: auto; min-height: 100dvh; display: grid; grid-template: auto 1fr / 208px minmax(0,1fr); }
.header {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 78px; padding: 14px clamp(18px, 4vw, 46px);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: block; max-width: min(180px, 48vw); }
.brand img { width: 100%; height: auto; }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.nav { padding: 29px 12px 20px 20px; display: flex; flex-direction: column; gap: 6px; }
.nav button {
  text-align: left; border: 1px solid transparent; background: transparent; border-radius: 13px;
  min-height: 48px; padding: 9px 14px; color: var(--muted); font-size: .9375rem; font-weight: 680;
}
.nav button[aria-current="page"] { color: var(--ink); background: var(--surface); border-color: var(--line); }
.nav button:hover { background: var(--blue-soft); color: var(--ink); }
#content { min-width: 0; padding: 28px clamp(18px, 3.6vw, 46px) 54px 24px; }
.stack { display: grid; gap: 18px; }
.compact { display: grid; gap: 10px; }
.section-title { margin: 12px 0 2px; }
.muted { color: var(--muted); }
.small-text { font-size: .875rem; }
.eyebrow { font-size: .875rem; font-weight: 740; letter-spacing: .02em; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); align-items: center;
  gap: 26px; border-radius: 24px; padding: clamp(23px, 4.6vw, 50px); color: white; background: var(--navy);
  background-image: radial-gradient(ellipse at 87% 22%, #183e56 0, #0b233b 59%);
}
.hero-copy { display: grid; align-content: center; justify-items: start; gap: 13px; }
.hero .eyebrow { color: var(--green); }
.hero p { color: #e1ecf4; max-width: 43ch; }
.numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; align-items: stretch; overflow: hidden; background: #466073; border: 1px solid #466073; border-radius: 17px; }
.numbers div { padding: 16px clamp(10px, 2vw, 19px); background: #102e45; display: grid; gap: 3px; justify-items: start; }
.numbers b { font-size: clamp(1.45rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -.055em; color: #f3fffc; white-space: nowrap; }
.numbers span { color: #e1ecf4; font-size: .875rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 46px;
  padding: 9px 16px; border-radius: 11px; border: 1px solid transparent; text-decoration: none; font-weight: 710;
  line-height: 1.28; color: #092c20; background: var(--green); cursor: pointer;
}
.button:hover { filter: brightness(.96); }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button.dark { background: var(--navy); color: #fff; }
.button.small { font-size: .875rem; padding: 7px 11px; min-height: 40px; }
.button:disabled { opacity: .58; cursor: default; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.topic, .panel {
  min-width: 0; border: 1px solid var(--line); border-radius: 17px;
  background: var(--surface); padding: clamp(15px, 2.7vw, 25px);
}
.topic { display: grid; align-content: start; gap: 7px; }
.topic strong { width: max-content; color: #10634e; background: var(--green-soft); padding: 3px 8px; border-radius: 7px; font-size: .875rem; }
.topic span { color: var(--muted); font-size: .875rem; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.panel h2 { margin-bottom: 8px; }
.page-head { padding: 4px 0 2px; display: grid; gap: 8px; }
.page-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); }
.narrow { max-width: 720px; }
.notice { padding: 11px 14px; border-radius: 11px; background: var(--blue-soft); color: var(--ink); }
.notice.problem { background: #fff1f1; color: var(--danger); }
.notice.warning { background: var(--warn-bg); color: var(--warn); }
.form { display: grid; gap: 13px; }
.field { display: grid; gap: 5px; font-weight: 650; }
.field input, .field select {
  min-height: 46px; min-width: 0; padding: 8px 11px; border-radius: 9px; border: 1px solid #aabacb;
  background: white; color: var(--ink); font-weight: 400;
}
.check { display: flex; align-items: start; gap: 9px; padding: 6px 0; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; }
.exam-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.time { padding: 6px 12px; border-radius: 9px; background: var(--navy); color: white; font-variant-numeric: tabular-nums; font-weight: 760; }
.time[data-low] { background: #ffdc91; color: #503000; }
progress { width: 100%; height: 9px; accent-color: #168364; }
.exam-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(195px, 31%); gap: 14px; align-items: start; }
.exam-grid > aside { position: sticky; top: 12px; }
.question-text { font-size: 1.125rem; font-weight: 620; max-width: 65ch; }
.diagram { max-width: min(100%, 530px); max-height: 340px; object-fit: contain; }
.options { display: grid; gap: 7px; }
.option {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 7px; align-items: start; text-align: left; min-height: 48px;
  color: var(--ink); border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 9px 12px;
}
.option b { color: #365469; }
.option[aria-pressed="true"] { background: var(--green-soft); border-color: #24896d; }
.number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.number {
  position: relative; min-height: 44px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: .9rem; padding: 0;
}
.number[aria-current] { outline: 2px solid var(--navy); outline-offset: -2px; font-weight: 740; }
.number[data-answered] { background: var(--green-soft); }
.number[data-marked]::after { content: "•"; color: var(--warn); position: absolute; right: 4px; top: 1px; }
.number-grid.long { max-height: 335px; overflow: auto; padding: 3px; }
.score { color: #0b5d49; font-size: clamp(2.75rem, 8vw, 4.5rem); line-height: 1; font-weight: 790; letter-spacing: -.06em; }
.score span { color: var(--muted); font-size: 1.3rem; letter-spacing: 0; margin-left: 5px; }
.facts { display: grid; gap: 0; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dd { margin: 0; text-align: end; font-weight: 700; }
.code { font-family: ui-monospace, monospace; overflow-wrap: anywhere; padding: 10px; border-radius: 8px; background: var(--blue-soft); }
.history-entry { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 12px 0; }
summary { min-height: 44px; padding: 8px 0; font-weight: 730; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 5; background: white; padding: 8px 12px; }
@media (min-width: 700px) {
  .nav { grid-row: 2; }
  #content { grid-row: 2; grid-column: 2; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 162px minmax(0,1fr); }
  .nav { padding-left: 10px; }
  .hero { grid-template-columns: 1fr; gap: 17px; }
  .numbers { max-width: 370px; }
}
@media (max-width: 699px) {
  .layout { grid-template: auto 1fr / minmax(0,1fr); }
  .header { min-height: 65px; }
  .nav {
    z-index: 2; position: fixed; inset: auto 0 0; flex-direction: row; background: #fff;
    border-top: 1px solid var(--line); padding: 7px 7px max(7px, env(safe-area-inset-bottom)); gap: 3px;
  }
  .nav button { flex: 1 1 0; min-width: 0; padding: 8px 3px; font-size: .875rem; text-align: center; }
  .nav button[aria-current="page"] { background: var(--green-soft); border-color: transparent; }
  #content { padding: 17px 14px calc(79px + env(safe-area-inset-bottom)); }
  .exam-grid, .split { grid-template-columns: minmax(0,1fr); }
  .exam-grid > aside { position: static; }
}
@media (max-width: 455px) {
  .tiles { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .topic { grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 4px 9px; }
  .topic span { grid-column: 2; }
  .header { padding-inline: 14px; }
  .hero { border-radius: 18px; }
}
