/* Shared accessibility layer, loaded LAST on every page (after the page's own styles). Driven by data attributes that /a11y.js sets on <html>
   from the person's display choices (text size, contrast, motion) and by the device's own settings. Nothing here claims conformance to a standard:
   see docs/ACCESSIBILITY.md for what is covered and what needs a human audit. */
:root{--focus:#4B3DB5;--focus-halo:#fff}
/* Focus: one visible ring on every control, in every colour scheme. */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,canvas:focus-visible,[tabindex]:focus-visible,
.scroll:focus-visible,.btn:focus-visible,.tile:focus-visible,.ans:focus-visible,.key:focus-visible{outline:3px solid var(--focus);outline-offset:2px;box-shadow:0 0 0 6px var(--focus-halo)}
/* Skip link: first thing a keyboard or switch user reaches. */
.skip-link{position:absolute;left:8px;top:-80px;z-index:100;background:#fff;color:#172A2D;border:3px solid #172A2D;border-radius:10px;padding:12px 18px;font:700 16px system-ui,sans-serif;text-decoration:none}
.skip-link:focus{top:8px}
.sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
main:focus{outline:none}
input[type=time]:focus-within,input[type=date]:focus-within,input[type=datetime-local]:focus-within{outline:3px solid var(--focus);outline-offset:2px;box-shadow:0 0 0 6px var(--focus-halo)}
/* Rows of buttons wrap instead of running off a narrow screen, at any text size. */
.bar,.steps,.opts,.row,.tabs{flex-wrap:wrap}
/* Links are never told apart by colour alone. */
main a:not(.btn){text-decoration:underline;text-underline-offset:2px}
/* Display settings panel (built by a11y.js). */
.a11y-panel{max-width:640px;margin:24px auto 48px;padding:0 16px;font:16px/1.5 system-ui,sans-serif;color:#172A2D}
.a11y-panel .a11y-toggle{min-height:48px;padding:0 18px;border-radius:12px;border:3px solid #4A5C5F;background:#fff;color:#172A2D;font:700 16px system-ui,sans-serif;cursor:pointer}
.a11y-panel .a11y-body{margin-top:12px;background:#fff;border:2px solid #4A5C5F;border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:14px}
.a11y-panel h2{margin:0;font-size:20px}
.a11y-panel fieldset{border:2px solid #D5DCD8;border-radius:12px;margin:0;padding:10px 12px;display:flex;flex-wrap:wrap;gap:8px}
.a11y-panel legend{font-weight:700;padding:0 6px}
.a11y-panel label.a11y-opt{display:inline-flex;flex-direction:row;align-items:center;gap:8px;min-height:48px;padding:0 14px;border:3px solid #4A5C5F;border-radius:12px;background:#fff;color:#172A2D;font-weight:600;font-size:16px;cursor:pointer}
.a11y-panel label.a11y-opt input{width:24px;height:24px;margin:0;flex:none}
.a11y-panel label.a11y-opt:has(input:checked){background:#E1EFEC;border-color:#17605C;border-width:3px;font-weight:800}
.a11y-panel label.a11y-opt:has(input:checked)::after{content:" (chosen)"}
.a11y-panel label.a11y-opt:has(input:focus-visible){outline:3px solid var(--focus);outline-offset:2px}
.a11y-panel .a11y-note{margin:0;color:#4A5C5F;font-size:14px}
.a11y-panel button.a11y-reset{min-height:48px;padding:0 18px;border-radius:12px;border:3px solid #4A5C5F;background:#fff;color:#172A2D;font:700 16px system-ui,sans-serif;cursor:pointer;align-self:flex-start}
/* Switch and key scanning: a thick dashed frame AND a label, so it never relies on colour alone. */
.scan-target{outline:6px dashed #000!important;outline-offset:4px!important;box-shadow:0 0 0 10px #FFD400!important;position:relative;z-index:1}
.a11y-scanstatus{position:fixed;left:8px;right:8px;bottom:8px;z-index:90;background:#000;color:#fff;border:3px solid #FFD400;border-radius:12px;padding:10px 14px;font:700 18px system-ui,sans-serif;text-align:center}
/* Text size. zoom scales the whole layout, including the pixel sizes the pages use. */
html[data-text=large] body{zoom:1.25}
html[data-text=larger] body{zoom:1.5}
html[data-text=larger] button,html[data-text=larger] .btn,html[data-text=larger] .tile,html[data-text=larger] .ans{min-height:64px}
/* Low-sensory mode (migration 1870): on by default for children, a person's own switch. Calm, desaturated colours, no movement of any kind, no shadows or
   glow, no decoration. It keeps the same words, the same order and the same controls, so nothing is hidden that a task needs. Contrast stays strong:
   the muted ink and teal below are chosen to pass on the muted background. High contrast, when chosen, still wins (it is defined after this block). */
html[data-sensory=low]{--bg:#F1F1ED;--ink:#1F2A2B;--mute:#46514F;--line:#C9CFCB;--teal:#2E5B57;--soft:#E5EBE8;--amber:#EDE8DC;--amberink:#58472B;--gold:#D8D2C2}
html[data-sensory=low] body{background:var(--bg);color:var(--ink)}
html[data-sensory=low] *,html[data-sensory=low] *::before,html[data-sensory=low] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;text-shadow:none!important}
html[data-sensory=low] .card,html[data-sensory=low] .btn,html[data-sensory=low] button,html[data-sensory=low] .tile,html[data-sensory=low] .ans,html[data-sensory=low] .badge,html[data-sensory=low] .chip,html[data-sensory=low] .screen,html[data-sensory=low] .msg{box-shadow:none}
html[data-sensory=low] [data-decor],html[data-sensory=low] .decor,html[data-sensory=low] .confetti,html[data-sensory=low] .sparkle,html[data-sensory=low] .glow{display:none!important}
html[data-sensory=low] main[data-bna-child]{line-height:1.6}
html[data-sensory=low] main[data-bna-child] .card{padding:18px}

/* High contrast: black on white, solid borders, no tinted fills. Chosen by the person, or by the device's prefers-contrast when nothing is chosen. */
html[data-contrast=high]{--bg:#fff;--ink:#000;--mute:#000;--line:#000;--teal:#00403B;--soft:#fff;--amber:#fff;--amberink:#000;--gold:#fff;--focus:#0000CC}
html[data-contrast=high] body{background:#fff;color:#000}
html[data-contrast=high] .card,html[data-contrast=high] .btn,html[data-contrast=high] button,html[data-contrast=high] input,html[data-contrast=high] select,html[data-contrast=high] textarea,
html[data-contrast=high] .tile,html[data-contrast=high] .ans,html[data-contrast=high] .badge,html[data-contrast=high] .chip,html[data-contrast=high] .screen,html[data-contrast=high] .msg{border-color:#000!important;border-style:solid!important}
html[data-contrast=high] .chip,html[data-contrast=high] .msg,html[data-contrast=high] .chip.ok{background:#fff!important;color:#000!important;border:2px solid #000}
html[data-contrast=high] .btn.go,html[data-contrast=high] button.go,html[data-contrast=high] .tabs button[aria-selected=true]{background:#000!important;color:#fff!important;border-color:#000!important}
html[data-contrast=high] [aria-pressed=true],html[data-contrast=high] .tile[aria-pressed=true]{background:#000!important;color:#fff!important;border-color:#000!important;text-decoration:underline}
html[data-contrast=high] a,html[data-contrast=high] .note,html[data-contrast=high] .eyebrow,html[data-contrast=high] th,html[data-contrast=high] label{color:#000}
html[data-contrast=high] a{text-decoration:underline}
@media (prefers-contrast:more){
  html:not([data-contrast=standard]){--bg:#fff;--ink:#000;--mute:#000;--line:#000;--teal:#00403B;--soft:#fff;--amber:#fff;--amberink:#000;--gold:#fff;--focus:#0000CC}
  html:not([data-contrast=standard]) body{background:#fff;color:#000}
  html:not([data-contrast=standard]) .card,html:not([data-contrast=standard]) .btn,html:not([data-contrast=standard]) button,html:not([data-contrast=standard]) input,html:not([data-contrast=standard]) select,html:not([data-contrast=standard]) textarea{border-color:#000!important}
  html:not([data-contrast=standard]) a{text-decoration:underline}
}
/* Motion: nothing animates when the person or the device asks for less. (The pages have almost none; this stops the rest.) */
html[data-motion=reduce] *,html[data-motion=reduce] *::before,html[data-motion=reduce] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media (prefers-reduced-motion:reduce){
  html *,html *::before,html *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
/* Forced colours (Windows high contrast): keep the system colours and keep borders. */
@media (forced-colors:active){
  .btn,button,.tile,.ans,input,select,textarea,.card{border:2px solid ButtonText}
  .scan-target{outline:6px dashed Highlight!important}
}

/* "Not today" view on child pages (shown by a11y.js; fixed words, no server call) */
#nottoday-view,[data-bna-view]{display:flex;flex-direction:column;gap:14px;align-items:center;text-align:center;padding:20px}
[data-bna-view] .big{font-size:34px;font-weight:800}
