:root {
  --navy: #001f5b;
  --blue: #0066ff;
  --cyan: #00b8e6;
  --ink: #21324a;
  --muted: #60718a;
  --line: #d7e1ee;
  --surface: #ffffff;
  --wash: #eef4fb;
  --green: #11845b;
  --green-wash: #e8f7f1;
  --orange: #b95d00;
  --orange-wash: #fff4e8;
  --red: #b62b25;
  --red-wash: #fff0ef;
  --shadow: 0 14px 38px rgba(0, 31, 91, .1);
  --title: "Poppins", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--wash); color: var(--ink); font-family: var(--body); line-height: 1.55; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.eval-header { background: linear-gradient(125deg, var(--navy), #083f9c); color: #fff; }
.eval-header-inner { width: min(100% - 32px, 1080px); min-height: 104px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eval-brand { display: flex; align-items: center; gap: 13px; color: #fff; text-decoration: none; }
.eval-brand img { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; background: #fff; box-shadow: 0 5px 16px rgba(0,0,0,.18); }
.eval-brand strong, .eval-brand small { display: block; }
.eval-brand strong { font-family: var(--title); font-size: 1.1rem; }
.eval-brand small { color: #c8dbff; text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
.eval-back { color: #fff; text-decoration: none; font-weight: 700; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 9px 16px; }
.eval-back:hover, .eval-back:focus-visible { background: #fff; color: var(--navy); }

.eval-shell { width: min(100% - 32px, 1080px); margin: 34px auto 60px; }
.eval-intro, .eval-workspace, .eval-results { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(24px, 5vw, 54px); }
.eval-kicker-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.eval-kicker { color: var(--blue); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.eval-free-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; background: var(--green-wash); color: var(--green); font-size: .76rem; font-weight: 800; }
h1, h2, h3 { font-family: var(--title); color: var(--navy); line-height: 1.18; }
h1 { margin: 14px 0 12px; font-size: clamp(2rem, 5vw, 3.35rem); letter-spacing: -.035em; }
.eval-lead { margin: 0; max-width: 850px; color: var(--muted); font-size: 1.08rem; }

.eval-free-notice { margin: 28px 0; padding: 17px 19px; display: flex; gap: 8px 18px; align-items: baseline; flex-wrap: wrap; border: 1px solid #a8dec9; border-left: 5px solid var(--green); border-radius: 13px; background: var(--green-wash); }
.eval-free-notice strong { color: #075b3d; }
.eval-free-notice span { color: #326150; }

.eval-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 26px 0; }
.eval-summary article { min-height: 112px; display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdff; }
.eval-summary strong { font-family: var(--title); font-size: 2rem; color: var(--blue); }
.eval-summary span { font-weight: 700; color: var(--navy); line-height: 1.35; }
.eval-summary small { color: var(--muted); font-weight: 500; }
.eval-instructions { margin-top: 30px; padding: 22px 24px; border-radius: 16px; background: var(--wash); }
.eval-instructions h2 { margin: 0 0 8px; font-size: 1.15rem; }
.eval-instructions ul { margin: 0; padding-left: 22px; }
.eval-instructions li + li { margin-top: 5px; }

.eval-mode-links { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.eval-mode-links strong, .eval-mode-links span { display: block; }
.eval-mode-links strong { color: var(--navy); font-family: var(--title); }
.eval-mode-links span { color: var(--muted); font-size: .9rem; }

.eval-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.eval-intro-actions { margin-top: 28px; }
.eval-btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 2px solid transparent; padding: 11px 18px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.eval-btn:hover { transform: translateY(-1px); }
.eval-btn:focus-visible, .eval-option:has(input:focus-visible) { outline: 3px solid rgba(0,102,255,.28); outline-offset: 3px; }
.eval-btn-primary { color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(0,102,255,.22); }
.eval-btn-primary:hover { background: #0055d7; }
.eval-btn-secondary { color: var(--navy); background: #fff; border-color: #b9c8dc; }
.eval-btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.eval-btn-small { min-height: 38px; padding: 8px 12px; font-size: .86rem; }

.eval-workspace { max-width: 920px; margin: auto; }
.eval-progress-card { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.eval-progress-copy { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.eval-progress-copy span { color: var(--blue); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.eval-progress-copy strong { display: block; margin-top: 4px; font-family: var(--title); color: var(--navy); font-size: 1.1rem; }
#points-label { color: var(--muted); white-space: nowrap; }
.eval-progress-track { height: 9px; margin: 15px 0 18px; overflow: hidden; background: #dbe5f1; border-radius: 999px; }
.eval-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .25s ease; }
.eval-section-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.eval-section-chip { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: .78rem; font-weight: 800; }
.eval-section-chip.current { border-color: var(--blue); background: #eaf3ff; color: var(--blue); }
.eval-section-chip.complete { border-color: #9bd4bd; background: var(--green-wash); color: var(--green); }

.eval-question-card { padding-top: 30px; }
.eval-question-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.eval-question-meta span { border-radius: 999px; padding: 6px 10px; background: #e9f2ff; color: var(--blue); font-size: .76rem; font-weight: 800; }
.eval-question-meta span:last-child { background: #f0f2f6; color: var(--muted); }
.eval-question-card h2 { margin: 18px 0 10px; font-size: clamp(1.35rem, 3.4vw, 2rem); }
.eval-context { margin: 0 0 14px; padding: 16px 18px; border-left: 4px solid var(--cyan); background: #eefaff; border-radius: 10px; }
.eval-select-hint { margin: 12px 0 14px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.eval-question-card fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 10px; }
.eval-numeric-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; max-width: 520px; border: 2px solid #dce5f0; border-radius: 13px; background: #fff; overflow: hidden; }
.eval-numeric-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,102,255,.12); }
.eval-numeric-input { width: 100%; min-height: 60px; border: 0; padding: 14px 16px; color: var(--navy); font-size: 1.2rem; font-weight: 700; outline: 0; }
.eval-numeric-unit { min-width: 86px; display: grid; place-items: center; padding: 0 16px; border-left: 1px solid var(--line); background: #f1f6fc; color: var(--navy); font-weight: 800; }
.eval-equation-hint { margin: 0 0 16px; padding: 10px 13px; border-radius: 9px; background: #f3f7ff; color: var(--navy); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; }
.eval-option { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px; border: 2px solid #dce5f0; border-radius: 13px; background: #fff; cursor: pointer; transition: border .16s ease, background .16s ease; }
.eval-option:hover { border-color: #91baff; background: #f7fbff; }
.eval-option:has(input:checked) { border-color: var(--blue); background: #edf5ff; }
.eval-option input { width: 19px; height: 19px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--blue); }
.eval-option span { line-height: 1.45; }
.eval-validation { margin: 14px 0 0; padding: 11px 13px; background: var(--red-wash); color: var(--red); border-radius: 9px; font-weight: 700; }
.eval-question-actions { margin-top: 25px; display: flex; justify-content: space-between; gap: 12px; }

.eval-results { max-width: 980px; margin: auto; }
.eval-results-hero { text-align: center; }
.eval-score-ring { --score-angle: 0deg; width: 172px; height: 172px; display: grid; place-items: center; margin: 18px auto; border-radius: 50%; background: conic-gradient(var(--blue) var(--score-angle), #dfe8f3 0); position: relative; }
.eval-score-ring::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #fff; }
.eval-score-ring strong { z-index: 1; font-family: var(--title); color: var(--navy); font-size: 2.7rem; }
.eval-score-ring small { font-size: .95rem; color: var(--muted); }
.eval-results-hero h2 { margin: 12px 0 8px; font-size: clamp(1.65rem, 4vw, 2.35rem); }
.eval-results-hero p { max-width: 720px; margin: 0 auto 26px; color: var(--muted); }
.eval-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.eval-result-card { margin-top: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.eval-result-card h3 { margin: 0 0 10px; font-size: 1.06rem; }
.eval-result-card p { margin: 0; color: var(--muted); }
.eval-domains { display: grid; gap: 13px; }
.eval-domain-row { display: grid; grid-template-columns: minmax(180px, 1fr) 2.2fr 58px; align-items: center; gap: 14px; }
.eval-domain-row strong { font-size: .88rem; color: var(--navy); }
.eval-domain-bar { height: 10px; overflow: hidden; border-radius: 999px; background: #e3eaf2; }
.eval-domain-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; }
.eval-domain-row em { font-style: normal; font-weight: 800; color: var(--navy); text-align: right; }
.eval-review-path { margin: 0; padding-left: 22px; }
.eval-review-path li { padding-left: 7px; }
.eval-review-path li + li { margin-top: 9px; }
.eval-review-path strong { color: var(--navy); }
.eval-review-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.eval-review-heading p { margin-top: -5px; }
#answer-review { margin-top: 20px; display: grid; gap: 10px; }
.eval-review-item { border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: 12px; padding: 15px 17px; }
.eval-review-item.needs-work { border-left-color: var(--orange); background: #fffdf9; }
.eval-review-item.incorrect { border-left-color: var(--red); background: #fffafa; }
.eval-review-item header { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.eval-review-item h4 { margin: 0; color: var(--navy); font-family: var(--title); font-size: .96rem; }
.eval-review-item header span { white-space: nowrap; font-weight: 800; color: var(--muted); }
.eval-review-item p { margin-top: 9px; font-size: .9rem; }
.eval-review-item .eval-expected-answer { padding: 8px 10px; border-radius: 8px; background: #edf6ff; color: var(--navy); font-weight: 700; }
.eval-safety-note { margin-top: 20px; padding: 16px 18px; border-left: 5px solid var(--blue); border-radius: 12px; background: var(--wash); color: var(--muted); }
.eval-safety-note strong { color: var(--navy); }
.eval-results-actions { margin-top: 24px; }
.eval-next-chapters { margin-top: 24px; display: flex; align-items: center; gap: 15px; padding: 18px 20px; border: 1px dashed #9eacbf; border-radius: 14px; background: #f3f5f8; color: var(--muted); }
.eval-next-chapters > span { font-size: 1.6rem; }
.eval-next-chapters strong { color: var(--navy); }
.eval-next-chapters p { margin: 2px 0 0; }
.eval-footer { width: min(100% - 32px, 1080px); margin: 0 auto; padding: 20px 0 30px; border-top: 1px solid #cfd9e6; color: var(--muted); text-align: center; font-size: .82rem; }

@media (max-width: 760px) {
  .eval-summary { grid-template-columns: 1fr 1fr; }
  .eval-section-nav { grid-template-columns: 1fr 1fr; }
  .eval-result-grid { grid-template-columns: 1fr; }
  .eval-domain-row { grid-template-columns: 1fr 52px; gap: 6px 10px; }
  .eval-domain-bar { grid-column: 1 / -1; grid-row: 2; }
  .eval-domain-row em { grid-column: 2; grid-row: 1; }
}

@media (max-width: 520px) {
  .eval-header-inner { padding: 16px 0; align-items: flex-start; flex-direction: column; }
  .eval-brand img { width: 62px; height: 62px; }
  .eval-back { width: 100%; text-align: center; }
  .eval-shell { width: min(100% - 20px, 1080px); margin-top: 18px; }
  .eval-intro, .eval-workspace, .eval-results { border-radius: 17px; padding: 21px 17px; }
  .eval-summary { grid-template-columns: 1fr; }
  .eval-summary article { min-height: auto; }
  .eval-progress-copy { align-items: flex-start; }
  .eval-section-nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .eval-section-chip { min-width: 112px; padding: 6px 10px; }
  .eval-question-actions, .eval-review-heading { flex-direction: column; }
  .eval-mode-links { align-items: stretch; }
  .eval-mode-links .eval-actions, .eval-mode-links .eval-btn { width: 100%; }
  .eval-numeric-wrap { grid-template-columns: minmax(0, 1fr) 74px; }
  .eval-question-actions .eval-btn, .eval-results-actions .eval-btn, .eval-review-heading .eval-btn { width: 100%; }
  #next-question { order: -1; }
}

@media print {
  body { background: #fff; }
  .eval-header, .eval-intro, .eval-workspace, .eval-results-actions, .eval-footer, #toggle-review { display: none !important; }
  .eval-shell { width: 100%; margin: 0; }
  .eval-results { display: block !important; padding: 0; box-shadow: none; }
  #answer-review { display: grid !important; }
  .eval-result-card, .eval-review-item { break-inside: avoid; }
}
