:root {
  color-scheme: light;
  --ink: #14253e;
  --muted: #42536a;
  --blue: #1d4ed8;
  --blue-dark: #173da6;
  --line: #cbd5e1;
  --paper: #fff;
  --background: #f5f8fc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--background); line-height: 1.65; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: var(--blue-dark); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #173da6; outline-offset: 4px; }
h1:focus { outline: none; }
h1, h2, h3 { line-height: 1.24; letter-spacing: -.02em; }
h1 { margin: .35rem 0 1rem; font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { margin: 0 0 1rem; font-size: 1.45rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: .65rem; }
.skip-link { position: absolute; left: 1rem; top: -6rem; padding: .7rem 1rem; background: #fff; z-index: 5; }
.skip-link:focus { top: 1rem; }
.site-header { max-width: 1160px; margin: auto; padding: 1.1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); }
.brand { font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.header-label { color: var(--muted); font-size: 1rem; }
.container { max-width: 1100px; margin: auto; padding: 0 1.5rem; }
.hero { max-width: 890px; padding: 3rem 0 1.8rem; }
.eyebrow { color: var(--blue); font-weight: 700; letter-spacing: .04em; margin-bottom: .6rem; }
.lead { max-width: 800px; color: var(--muted); font-size: 1.18rem; }
.notice { background: #eaf1ff; border: 1px solid #afc7ef; border-left: 4px solid var(--blue); border-radius: .55rem; padding: 1rem 1.2rem; margin: 1.5rem 0; }
.notice p:last-child { margin-bottom: 0; }
.notice-error { background: #fff3ef; color: #702b19; border-color: #c78d7b; }
.privacy-support:empty { display: none; }
.path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.path-card { display: flex; flex-direction: column; gap: .85rem; width: 100%; padding: 1.4rem; min-height: 270px; color: var(--ink); background: var(--paper); border: 1px solid #aab9cf; border-radius: .85rem; text-align: left; line-height: 1.5; box-shadow: 0 3px 10px #17345408; }
.path-card:hover:not(:disabled) { border-color: var(--blue); background: #f4f7ff; }
.path-title { font-size: 1.2rem; font-weight: 750; line-height: 1.3; }
.path-description { color: var(--muted); }
.path-action { color: var(--blue); font-weight: 700; margin-top: auto; }
.privacy-note, .faq, .sources { margin: 2.7rem 0; max-width: 900px; }
.privacy-note { padding-left: 1.2rem; border-left: 3px solid #9eafc5; }
.privacy-note p, .sources p { color: var(--muted); }
.emergency { background: #fff7ee; border-color: #d2a16a; border-left-color: #8e4e12; max-width: 900px; }
.emergency h2 { font-size: 1.18rem; }
details { border-top: 1px solid var(--line); padding: 1rem 0; }
details:last-child { border-bottom: 1px solid var(--line); }
summary { font-weight: 700; cursor: pointer; padding: .3rem 1.7rem .3rem 0; }
details p { margin: .7rem 0 0; max-width: 820px; }
.source-language { color: var(--muted); }
.clinical-resource { max-width: 900px; margin: 2.7rem 0; padding: 1.3rem 1.4rem; border: 1px solid var(--line); border-radius: .65rem; background: #fff; }
.clinical-resource p:last-child { margin-bottom: 0; }
.session-panel, .results-panel { max-width: 850px; padding: 2.4rem 0 3rem; }
.session-panel h1, .results-panel h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
#stage, #report { overflow-wrap: anywhere; }
#stage > :first-child, #report > :first-child { margin-top: 0; }
.button, #stage button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; max-width: 100%; padding: .75rem 1.1rem; border: 2px solid var(--blue); border-radius: .5rem; background: var(--blue); color: #fff; font-weight: 650; text-decoration: none; line-height: 1.4; text-align: center; white-space: normal; }
.button:hover:not(:disabled), #stage button:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.button-secondary, #stage button.secondary { background: #fff; color: var(--blue); }
.button-secondary:hover:not(:disabled), #stage button.secondary:hover:not(:disabled) { background: #eaf1ff; color: var(--blue-dark); }
.session-footer, .result-actions { display: flex; flex-wrap: wrap; gap: .8rem; padding-top: 1.4rem; margin-top: 1.4rem; border-top: 1px solid var(--line); }
.session-status { min-height: 1.6em; margin-top: 1rem; font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.4rem 0 1rem; }
.actions > button { flex: 1 1 220px; }
.choice-list { margin: 1.25rem 0; }
.choice { display: flex; align-items: center; gap: .7rem; min-height: 60px; margin: .65rem 0; padding: .8rem .9rem; border: 1px solid #a5b4c8; border-radius: .5rem; background: #fff; cursor: pointer; line-height: 1.5; }
.choice span { min-width: 0; }
.choice:hover { background: #f0f5ff; border-color: var(--blue); }
.choice:has(input:checked) { background: #eaf1ff; border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
.choice:focus-within { outline: 3px solid #173da6; outline-offset: 3px; }
.choice input[type="radio"], .choice input[type="checkbox"] { flex: 0 0 24px; width: 24px; height: 24px; margin: 0; }
.choice-list:empty { display: none; }
.study-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 680px; margin: 1.4rem 0; }
.study-card { display: flex; flex-direction: column; gap: .45rem; padding: 1.2rem; border: 1px solid #a5b4c8; border-radius: .6rem; background: #fff; }
.study-card strong { color: var(--blue-dark); font-size: 1.15rem; }
.study-card span { color: var(--muted); }
.symbol-practice { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0; }
.symbol-example { display: flex; align-items: center; gap: .8rem; max-width: 520px; margin: 1.2rem 0; padding: .8rem 1rem; border-left: 4px solid var(--blue); background: #eaf1ff; }
.symbol-example svg { flex: 0 0 46px; width: 46px; height: 46px; }
.symbol-grid { display: grid; grid-template-columns: repeat(6, minmax(52px, 1fr)); gap: .55rem; max-width: 520px; margin: 1.4rem 0; }
#stage .symbol-grid button, #stage .symbol-practice button { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 52px; min-height: 62px; padding: 6px; border: 2px solid #8192aa; background: #fff; color: var(--ink); }
#stage .symbol-practice button { flex: 0 0 76px; width: 76px; }
#stage .symbol-grid button:hover:not(:disabled), #stage .symbol-practice button:hover:not(:disabled) { background: #eaf1ff; color: var(--ink); border-color: var(--blue); }
#stage .symbol-grid button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue-dark); box-shadow: inset 0 0 0 3px #fff; }
#stage .symbol-grid button[aria-pressed="true"]:hover { background: var(--blue-dark); color: #fff; }
.symbol-grid svg, .symbol-practice svg { display: block; flex-shrink: 0; width: 46px; height: 46px; pointer-events: none; }
.word-sequence { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin: 1.3rem 0; padding: 0; list-style-position: inside; }
.word-sequence li { margin: 0; padding: 1rem .7rem; border: 1px solid #a5b4c8; border-radius: .5rem; background: #fff; font-weight: 700; }
.word-sequence li::marker { color: var(--blue); }
.sequence-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; max-width: 620px; margin: 1.2rem 0; }
#stage .sequence-options button { width: 100%; min-width: 0; min-height: 60px; padding: .7rem; overflow-wrap: anywhere; }
.sequence-answer { min-height: 70px; margin: 1.1rem 0; padding: 1rem; border: 2px solid #9eafc5; border-radius: .5rem; background: #fff; font-weight: 700; line-height: 1.6; }
.pair-question { margin-top: 1.5rem; }
.pair-question legend { color: var(--blue-dark); font-size: 1.15rem; }
.session-note, .report-notice { margin: 1.1rem 0 1.4rem; padding: .9rem 1rem; border-left: 4px solid var(--blue); border-radius: .3rem; background: #eaf1ff; color: var(--ink); }
.urgent-box { margin: 1.3rem 0; padding: 1.2rem; border: 2px solid #a75e20; border-radius: .65rem; background: #fff4e8; color: #542d10; }
.urgent-box p { font-weight: 650; }
.print-note { color: var(--muted); }
fieldset { margin: 1.3rem 0; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: .6rem; min-width: 0; }
legend { font-weight: 700; padding: 0 .3rem; max-width: 100%; }
label { display: block; margin: .65rem 0; }
input[type="radio"], input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: .2rem .5rem .2rem 0; vertical-align: middle; accent-color: var(--blue); flex-shrink: 0; }
input[type="text"], input[type="number"], textarea, select { width: 100%; padding: .75rem; border: 1px solid #8192aa; border-radius: .4rem; background: #fff; color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
table { width: 100%; border-collapse: collapse; margin: 1.1rem 0; }
th, td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { background: #eaf1ff; }
progress { width: 100%; height: 12px; accent-color: var(--blue); }
.page-footer { max-width: 1100px; margin: auto; padding: 1.5rem; color: var(--muted); border-top: 1px solid var(--line); }
.page-footer p { margin: 0 0 .35rem; }
@media (max-width: 800px) {
  .path-grid { grid-template-columns: 1fr; }
  .path-card { min-height: 0; }
  .hero { padding-top: 2rem; }
}
@media (max-width: 640px) {
  .symbol-grid { grid-template-columns: repeat(4, minmax(52px, 1fr)); gap: 8px; max-width: 400px; }
  #stage .symbol-grid button, #stage .symbol-practice button { min-height: 58px; padding: 6px; }
  .symbol-grid svg, .symbol-practice svg, .symbol-example svg { width: 36px; height: 36px; }
  .symbol-example svg { flex-basis: 36px; }
  .word-sequence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-card { padding: .9rem; }
}
@media (max-width: 480px) {
  .site-header { flex-wrap: wrap; padding: 1rem; }
  .container { padding: 0 1rem; }
  .header-label { font-size: 1rem; }
  .notice { padding: .9rem 1rem; }
  .button, #stage button { width: 100%; }
  .result-actions, .session-footer { flex-direction: column; }
  th, td { padding: .5rem .35rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media print {
  @page { margin: 16mm; }
  :root { font-size: 12pt; }
  body { background: #fff; color: #111; }
  .site-header, .skip-link, #hub, #session, .privacy-support, .page-footer, .result-actions { display: none !important; }
  .container { max-width: none; padding: 0; }
  .results-panel { max-width: none; padding: 0; }
  h1, h2, h3 { break-after: avoid; }
  p, li, tr { orphans: 3; widows: 3; }
  .notice, fieldset { border: 1px solid #777; background: #fff; color: #111; break-inside: avoid; }
  a { color: #111; }
}
