:root {
  --navy: #0a2440;
  --navy-2: #102f50;
  --blue: #0757b8;
  --blue-2: #0c6ddd;
  --blue-soft: #eaf3ff;
  --sky: #d8ecff;
  --gold: #f7b32b;
  --ink: #162332;
  --muted: #5e6c7d;
  --line: #d9e0e8;
  --line-dark: #b8c4d1;
  --paper: #ffffff;
  --canvas: #f2f5f8;
  --green: #16834e;
  --green-soft: #e9f8f0;
  --red: #bd3139;
  --red-soft: #fff0f1;
  --purple: #7752c7;
  --shadow: 0 16px 40px rgba(19, 42, 65, 0.11);
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(12, 109, 221, 0.33); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: 0.56; }
[hidden] { display: none !important; }

.site-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px clamp(20px, 4vw, 64px);
  color: white;
  background: var(--navy);
  border-bottom: 4px solid var(--blue-2);
}

.brand { justify-self: start; display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px 10px 10px 3px; background: var(--blue-2); color: white; font-weight: 900; font-size: 1.35rem; box-shadow: inset -7px -7px 0 rgba(0,0,0,.08); }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 1.1rem; letter-spacing: .01em; }
.brand small { margin-top: 5px; color: #afc1d2; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }

.course-label { display: flex; align-items: center; gap: 12px; }
.course-label span { padding: 5px 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: #bdd9f6; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.course-label strong { font-size: .95rem; }

.quiet-button { min-height: 40px; padding: 0 15px; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; color: white; background: rgba(255,255,255,.08); font-weight: 750; }
.quiet-button:hover { background: rgba(255,255,255,.15); }
.header-refresh { justify-self: end; }
.header-refresh span { margin-right: 5px; font-size: 1.1rem; }

.start-shell { width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding: clamp(34px, 6vw, 76px) 0 42px; }
.start-card { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .78fr); overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.start-intro { position: relative; padding: clamp(34px, 6vw, 76px); background: linear-gradient(145deg, #fff 0%, #fff 74%, #f5f9fd 100%); }
.start-intro::after { content: ""; position: absolute; right: 0; top: 0; width: 6px; height: 100%; background: linear-gradient(var(--blue-2), var(--gold)); }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--blue); font-size: .78rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow span { width: 28px; height: 3px; background: var(--gold); }
.start-intro h1 { max-width: 720px; margin: 20px 0 18px; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.55rem, 5vw, 4.75rem); font-weight: 600; line-height: .99; letter-spacing: -.045em; }
.start-intro h1 em { color: var(--blue); font-weight: 400; }
.start-intro > p { max-width: 700px; margin: 0; color: var(--muted); font-size: 1.06rem; line-height: 1.7; }
.version-ready { width: fit-content; display: flex; align-items: center; gap: 10px; margin-top: 28px; padding: 7px 10px 7px 12px; border: 1px solid #c8d9eb; border-radius: 8px; background: #f7fbff; }
.version-ready span { color: var(--muted); font-size: .79rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.version-ready strong { padding: 3px 8px; border-radius: 4px; background: var(--navy); color: white; font-size: .82rem; letter-spacing: .07em; }
.start-actions, .result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.practice-note { margin-top: 18px !important; color: #667586 !important; font-size: .88rem !important; line-height: 1.55 !important; }

.primary-button, .secondary-button, .check-button, .submit-button, .tool-button, .nav-submit {
  min-height: 43px;
  padding: 0 17px;
  border-radius: 7px;
  font-weight: 800;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.primary-button { border: 1px solid var(--blue); color: white; background: var(--blue); }
.primary-button:hover { background: #064a9c; transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line-dark); color: var(--navy); background: white; }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.large { min-height: 50px; padding: 0 22px; }

.quiz-brief { padding: 30px; color: white; background: linear-gradient(155deg, #0757b8 0%, #063d82 100%); }
.brief-heading { display: flex; align-items: center; gap: 15px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.18); }
.brief-heading > div { display: grid; }
.brief-heading small { color: #b9d9ff; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.brief-heading strong { margin: 2px 0; font-size: 1.22rem; }
.brief-heading span:last-child { color: #e0edfb; font-size: .9rem; }
.calendar-icon { width: 54px; height: 54px; display: grid; place-items: center; position: relative; border-radius: 8px; background: white; color: var(--blue); font-size: 1.2rem; font-weight: 900; }
.calendar-icon i { position: absolute; inset: 0 0 auto; height: 13px; border-radius: 8px 8px 0 0; background: var(--gold); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; }
.stat-grid div { display: grid; place-items: center; padding: 17px 7px; text-align: center; }
.stat-grid div + div { border-left: 1px solid rgba(255,255,255,.2); }
.stat-grid strong { font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.stat-grid span { margin-top: 7px; color: #c8def6; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.rules-list { margin: 0; }
.rules-list div { display: grid; grid-template-columns: 118px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.13); }
.rules-list dt { color: #aecdff; font-size: .83rem; font-weight: 750; }
.rules-list dd { margin: 0; font-size: .88rem; font-weight: 650; }
.formula-preview { display: grid; gap: 8px; margin-top: 23px; padding: 17px; border-radius: 10px; background: rgba(5,31,64,.43); box-shadow: inset 3px 0 0 var(--gold); }
.formula-preview span { color: #aacdf3; font-size: .73rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.formula-preview code { color: white; font-family: "SFMono-Regular", Consolas, monospace; font-size: .96rem; }

.coverage-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.coverage-strip div { position: relative; display: grid; gap: 1px; min-height: 84px; padding: 18px 18px 18px 55px; }
.coverage-strip div + div { border-left: 1px solid var(--line); }
.coverage-strip span { position: absolute; left: 16px; top: 20px; color: var(--blue); font-family: Georgia, serif; font-weight: 800; }
.coverage-strip strong { color: var(--navy); }
.coverage-strip small { color: var(--muted); }

.exam-shell { min-height: calc(100vh - 72px); }
.exam-toolbar { position: sticky; z-index: 20; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; min-height: 78px; padding: 10px clamp(18px, 3.5vw, 54px); color: white; background: #0b64c8; box-shadow: 0 4px 18px rgba(6, 55, 112, .18); }
.attempt-identity { display: grid; justify-self: start; line-height: 1.2; }
.attempt-identity span { color: #cae4ff; font-size: .72rem; font-weight: 850; letter-spacing: .11em; }
.attempt-identity strong { margin-top: 4px; }
.timer-block { display: flex; align-items: baseline; gap: 10px; padding: 7px 18px; border: 1px solid rgba(255,255,255,.28); border-radius: 8px; background: rgba(3,40,82,.18); }
.timer-block small { color: #d9eafe; font-weight: 700; }
.timer-block strong { min-width: 66px; font-variant-numeric: tabular-nums; font-size: 1.35rem; letter-spacing: .03em; }
.timer-block.warning { background: #9a292d; animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255,255,255,.13); } }
.toolbar-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tool-button { min-height: 39px; border: 1px solid rgba(255,255,255,.35); color: white; background: rgba(255,255,255,.09); }
.tool-button:hover { background: rgba(255,255,255,.17); }
.tool-button span { margin-right: 4px; }
.submit-button { min-height: 39px; border: 1px solid #f6c35f; color: #2b220d; background: var(--gold); }
.submit-button:hover { background: #ffca59; }

.exam-layout { width: min(1460px, calc(100% - 36px)); display: grid; grid-template-columns: 215px minmax(0, 1fr) 268px; align-items: start; gap: 22px; margin: 0 auto; padding: 28px 0 50px; }
.question-nav { position: sticky; top: 106px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.nav-title { display: grid; gap: 2px; margin-bottom: 15px; }
.nav-title small { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.nav-title strong { color: var(--navy); }
.nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.nav-grid button { position: relative; aspect-ratio: 1; border: 1px solid var(--line-dark); border-radius: 6px; color: var(--navy); background: white; font-weight: 850; }
.nav-grid button:hover, .nav-grid button.is-current { border-color: var(--blue); color: white; background: var(--blue); }
.nav-grid button.has-answer:not(.is-current)::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.nav-grid button.is-checked:not(.is-current) { border-color: #6ab68f; background: var(--green-soft); color: #075d35; }
.nav-grid button.is-checked:not(.is-current)::after { content: "✓"; width: auto; height: auto; bottom: 1px; background: transparent; font-size: .61rem; font-weight: 900; }
.nav-grid button.is-flagged::before { content: ""; position: absolute; left: 0; top: 0; border-top: 9px solid var(--gold); border-right: 9px solid transparent; }
.nav-legend { display: grid; gap: 7px; margin: 16px 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .74rem; }
.nav-legend span { display: flex; align-items: center; gap: 7px; }
.nav-legend i { width: 8px; height: 8px; border-radius: 50%; }
.nav-legend .answered { background: var(--blue); }
.nav-legend .checked { background: var(--green); }
.nav-legend .flagged { border-radius: 1px; background: var(--gold); }
.nav-submit { width: 100%; border: 1px solid var(--line-dark); color: var(--navy); background: #f7f9fb; }
.nav-submit:hover { border-color: var(--blue); color: var(--blue); }

.question-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 8px 28px rgba(25,55,82,.07); }
.question-header { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 20px; border-top: 5px solid var(--blue); border-bottom: 1px solid var(--line); background: #f0f2f4; }
.question-header > div { display: flex; align-items: center; gap: 14px; }
.question-header span { color: var(--navy); font-size: .93rem; font-weight: 850; }
.question-header strong { padding-left: 14px; border-left: 1px solid var(--line-dark); color: var(--muted); font-size: .78rem; font-weight: 700; }
.flag-button { border: 0; color: #526276; background: transparent; font-size: .82rem; font-weight: 720; }
.flag-button span { margin-right: 4px; color: #738296; }
.flag-button[aria-pressed="true"] { color: #8b5e00; }
.flag-button[aria-pressed="true"] span { color: var(--gold); }
.question-body { min-height: 520px; padding: clamp(24px, 4vw, 44px); }
.topic-line { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.topic-line span { padding: 4px 8px; border-radius: 4px; color: var(--blue); background: var(--blue-soft); font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.topic-line strong { color: var(--muted); font-size: .8rem; }
.question-body h1 { margin: 0 0 16px; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.65rem, 2.7vw, 2.25rem); line-height: 1.18; }
.question-prompt { color: #2f3c4a; line-height: 1.65; }
.question-prompt p { margin: 0 0 16px; }
.question-prompt strong { color: var(--navy); }
.data-table-wrap { max-width: 100%; overflow-x: auto; margin: 20px 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: .91rem; }
.data-table th { padding: 9px 11px; border: 1px solid #0b59ad; color: white; background: var(--blue); text-align: left; }
.data-table td { padding: 9px 11px; border: 1px solid #cbd6e0; background: #fdfefe; }
.data-table td.number, .data-table th.number { text-align: right; font-variant-numeric: tabular-nums; }
.instruction-note { padding: 11px 14px; border-left: 3px solid var(--gold); color: #526070; background: #fff9ea; font-size: .88rem; }
.response-area { margin-top: 25px; }

.option-list { display: grid; gap: 10px; }
.answer-option { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 13px; padding: 15px 16px; border: 1px solid var(--line-dark); border-radius: 8px; color: #2b3947; background: white; transition: border .15s, background .15s; }
.answer-option:hover { border-color: var(--blue); background: #f9fcff; }
.answer-option input { width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--blue); }
.answer-option span { line-height: 1.5; }
.answer-option.is-selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.answer-option.is-correct { border-color: #62aa85; background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
.answer-option.is-incorrect { border-color: #d8878c; background: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); }
.answer-option.is-locked { cursor: default; }

.fill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fill-field { display: grid; gap: 6px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.fill-field label { color: #33475a; font-size: .84rem; font-weight: 800; }
.input-shell { display: flex; align-items: center; min-height: 43px; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 6px; background: white; }
.input-shell:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(12,109,221,.11); }
.input-shell span { flex: 0 0 auto; padding: 0 0 0 11px; color: var(--muted); font-weight: 700; }
.input-shell input { width: 100%; min-width: 0; padding: 9px 10px; border: 0; outline: 0; color: var(--navy); background: transparent; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.fill-field small { color: var(--muted); font-size: .74rem; }
.fill-field.is-correct { border-color: #70b18e; background: var(--green-soft); }
.fill-field.is-incorrect { border-color: #d78a8f; background: var(--red-soft); }

.fset-wrap { max-width: 100%; overflow-x: auto; border: 1px solid #bdd0e1; }
.fset-table { min-width: 900px; width: 100%; border-collapse: collapse; }
.fset-table thead tr:first-child th { padding: 8px; border: 1px solid #0753a8; color: white; background: var(--blue); text-align: center; font-size: .78rem; letter-spacing: .03em; }
.fset-table thead tr:last-child th { padding: 8px 5px; border: 1px solid #3c79ba; color: white; background: #156bc7; font-size: .75rem; line-height: 1.2; }
.fset-table td { min-width: 93px; padding: 6px; border: 1px solid #bdd0e1; background: #edf8fb; }
.fset-table td:first-child { min-width: 145px; color: #33475a; background: #fff; font-size: .8rem; font-weight: 750; }
.fset-table input { width: 100%; padding: 7px 6px; border: 1px solid #aebecb; border-radius: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.fset-table td.is-correct { background: var(--green-soft); }
.fset-table td.is-incorrect { background: var(--red-soft); }
.fset-key { margin-top: 7px; color: var(--muted); font-size: .78rem; }

.answer-feedback { margin-top: 24px; padding: 18px 19px; border-radius: 8px; border-left: 5px solid var(--green); background: var(--green-soft); }
.answer-feedback.incorrect { border-left-color: var(--red); background: var(--red-soft); }
.answer-feedback.partial { border-left-color: var(--gold); background: #fff8e5; }
.answer-feedback > strong { display: block; margin-bottom: 6px; color: var(--navy); font-size: 1rem; }
.answer-feedback p { margin: 0; color: #425161; line-height: 1.6; }
.answer-feedback .work-line { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(34,64,90,.13); color: var(--navy); font-family: "SFMono-Regular", Consolas, monospace; font-size: .85rem; }
.question-footer { display: flex; justify-content: space-between; gap: 14px; padding: 15px 20px; border-top: 1px solid var(--line); background: #f7f9fb; }
.footer-primary { display: flex; gap: 10px; }
.check-button { border: 1px solid var(--green); color: white; background: var(--green); }
.check-button:hover { background: #106f41; }

.exam-aide { position: sticky; top: 106px; display: grid; gap: 14px; }
.aide-card { padding: 19px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.aide-kicker { color: var(--blue); font-size: .71rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.aide-card h2 { margin: 3px 0 15px; color: var(--navy); font-family: Georgia, serif; font-size: 1.25rem; }
.formula-line { display: grid; grid-template-columns: 48px 12px 1fr; align-items: center; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.formula-line strong { color: var(--blue); }
.formula-line code { font-size: .78rem; font-weight: 750; }
.rule-card p { margin: 12px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.5; }
.coverage-card ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: #425161; font-size: .84rem; }
.coverage-card li { display: flex; align-items: center; gap: 9px; }
.coverage-card li span { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.one-shot-note { margin: 0; padding: 13px 15px; border: 1px dashed #c0cbd6; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.62); font-size: .79rem; line-height: 1.5; }

.results-shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: clamp(34px, 6vw, 70px) 0; }
.results-card { display: grid; grid-template-columns: 380px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.score-panel { display: flex; flex-direction: column; align-items: center; padding: 42px 34px; color: white; background: linear-gradient(150deg, var(--navy), #0a4f93); text-align: center; }
.result-kicker { color: #bbd8f2; font-size: .75rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.score-ring { --score: 0deg; width: 190px; aspect-ratio: 1; display: grid; place-items: center; margin: 24px auto; border-radius: 50%; background: conic-gradient(var(--gold) var(--score), rgba(255,255,255,.14) 0); }
.score-ring::before { content: ""; grid-area: 1/1; width: 158px; aspect-ratio: 1; border-radius: 50%; background: var(--navy-2); }
.score-ring div { z-index: 1; grid-area: 1/1; display: grid; }
.score-ring strong { font-family: Georgia, serif; font-size: 3rem; line-height: 1; }
.score-ring span { margin-top: 7px; color: #c4d7e8; font-size: .84rem; }
.score-panel h1 { margin: 2px 0 8px; font-family: Georgia, serif; font-size: 1.7rem; }
.score-panel > p { margin: 0; color: #c5d7e8; }
.score-panel .secondary-button { color: white; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.08); }
.score-panel .primary-button { border-color: var(--gold); color: #261f12; background: var(--gold); }
.result-detail { padding: clamp(27px, 4vw, 45px); }
.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.result-heading small { color: var(--blue); font-weight: 800; letter-spacing: .06em; }
.result-heading h2 { margin: 3px 0 0; color: var(--navy); font-family: Georgia, serif; font-size: 1.65rem; }
.result-heading > span { color: var(--muted); font-size: .84rem; }
.breakdown-list { border-top: 1px solid var(--line); }
.breakdown-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.breakdown-row > span:first-child { width: 30px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-weight: 850; }
.breakdown-row.partial > span:first-child { background: var(--gold); color: #30240a; }
.breakdown-row.incorrect > span:first-child { background: var(--red); }
.breakdown-row div { display: grid; }
.breakdown-row div strong { color: var(--navy); font-size: .9rem; }
.breakdown-row div small { color: var(--muted); }
.breakdown-row > small { color: var(--muted); font-size: .75rem; }
.breakdown-row > b { min-width: 48px; color: var(--navy); text-align: right; font-size: .84rem; }
.next-focus { margin-top: 23px; padding: 16px 18px; border-left: 4px solid var(--blue); background: var(--blue-soft); }
.next-focus strong { display: block; color: var(--navy); }
.next-focus p { margin: 4px 0 0; color: #4b5c6d; font-size: .88rem; }

dialog { padding: 0; border: 0; border-radius: 13px; box-shadow: 0 30px 90px rgba(4,22,39,.35); }
dialog::backdrop { background: rgba(6,24,41,.62); backdrop-filter: blur(3px); }
.utility-dialog { width: min(420px, calc(100% - 28px)); }
.calculator-card header, .formula-dialog-card header { display: flex; justify-content: space-between; align-items: center; padding: 17px 19px; color: white; background: var(--navy); }
.calculator-card header div, .formula-dialog-card header div { display: grid; }
.calculator-card header small, .formula-dialog-card header small { color: #9fbed8; font-size: .69rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.dialog-close { border: 0; color: white; background: transparent; font-size: 1.55rem; line-height: 1; }
.calculator-card output { min-height: 90px; display: flex; align-items: end; justify-content: flex-end; overflow: hidden; padding: 18px; color: var(--navy); background: #eef3f7; font-size: 2.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.calculator-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #cbd4dc; }
.calculator-keys button { min-height: 62px; border: 0; background: white; color: var(--navy); font-weight: 800; }
.calculator-keys button:hover { background: #f0f5f9; }
.calculator-keys .operator { color: var(--blue); background: #eef5fd; }
.calculator-keys .equals { color: white; background: var(--blue); }
.calculator-keys .zero { grid-column: span 2; }
.formula-dialog-card { background: white; }
.formula-dialog-card > div:not(header) { display: grid; gap: 5px; padding: 21px; border-bottom: 1px solid var(--line); }
.formula-dialog-card > div span { color: var(--muted); font-size: .8rem; font-weight: 750; }
.formula-dialog-card > div code { color: var(--navy); font-size: 1.08rem; font-weight: 800; }
.formula-dialog-card > p { margin: 0; padding: 16px 21px; color: var(--muted); font-size: .82rem; }
.confirm-dialog { width: min(490px, calc(100% - 28px)); }
.confirm-card { padding: 33px; text-align: center; }
.confirm-icon { width: 56px; aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 50%; color: white; background: var(--green); font-size: 1.6rem; font-weight: 900; }
.confirm-icon.refresh { background: var(--blue); }
.confirm-card h2 { margin: 0 0 8px; color: var(--navy); font-family: Georgia, serif; }
.confirm-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.confirm-card > div { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(520px, calc(100% - 30px)); padding: 12px 17px; border-radius: 8px; color: white; background: var(--navy); box-shadow: 0 14px 35px rgba(0,0,0,.24); font-weight: 720; }

@media (max-width: 1180px) {
  .exam-layout { grid-template-columns: 180px minmax(0,1fr); }
  .exam-aide { position: static; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .one-shot-note { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .course-label { display: none; }
  .start-card { grid-template-columns: 1fr; }
  .start-intro::after { width: 100%; height: 5px; top: auto; bottom: 0; }
  .coverage-strip { grid-template-columns: repeat(2, 1fr); }
  .coverage-strip div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .coverage-strip div:nth-child(4) { border-top: 1px solid var(--line); }
  .exam-toolbar { grid-template-columns: auto 1fr; }
  .timer-block { justify-self: end; }
  .toolbar-actions { grid-column: 1 / -1; }
  .exam-layout { grid-template-columns: 1fr; }
  .question-nav { position: static; }
  .nav-grid { grid-template-columns: repeat(7, minmax(38px, 1fr)); }
  .nav-grid button { aspect-ratio: auto; min-height: 42px; }
  .nav-legend, .nav-submit { display: none; }
  .results-card { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  body { font-size: 15px; }
  .site-header { min-height: 64px; padding: 9px 14px; }
  .brand small { display: none; }
  .header-refresh { min-height: 36px; padding: 0 10px; font-size: .82rem; }
  .start-shell, .results-shell { width: min(100% - 22px, 1280px); padding-top: 18px; }
  .start-intro { padding: 28px 22px 34px; }
  .start-intro h1 { font-size: clamp(2.3rem, 13vw, 3.5rem); }
  .quiz-brief { padding: 24px 20px; }
  .start-actions, .result-actions { display: grid; }
  .coverage-strip { grid-template-columns: 1fr; }
  .coverage-strip div, .coverage-strip div:nth-child(2), .coverage-strip div:nth-child(3), .coverage-strip div:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .coverage-strip div:first-child { border-top: 0; }
  .exam-toolbar { position: static; display: flex; flex-wrap: wrap; padding: 10px 13px; }
  .attempt-identity { flex: 1; }
  .timer-block { padding: 5px 10px; }
  .timer-block small { display: none; }
  .toolbar-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .submit-button { grid-column: 1 / -1; }
  .exam-layout { width: min(100% - 20px, 1460px); padding-top: 12px; }
  .question-nav { padding: 12px; }
  .nav-title { grid-template-columns: 1fr auto; }
  .nav-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .question-header { padding: 9px 13px; }
  .question-header strong { display: none; }
  .question-body { min-height: auto; padding: 24px 17px 30px; }
  .question-footer { flex-wrap: wrap; padding: 13px; }
  .footer-primary { flex: 1; justify-content: end; }
  .fill-grid { grid-template-columns: 1fr; }
  .exam-aide { grid-template-columns: 1fr; }
  .one-shot-note { grid-column: auto; }
  .score-panel, .result-detail { padding: 30px 20px; }
  .result-heading { align-items: start; flex-direction: column; }
  .breakdown-row { grid-template-columns: 34px minmax(0,1fr) auto; }
  .breakdown-row > small { display: none; }
  .confirm-card { padding: 28px 20px; }
  .confirm-card > div { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
