/* NeuroRehab.au shared styles. Every tool page loads this. Colours are tokens only. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --ink: #14213d;
  --muted: #4a5568;
  --line: #d5dae1;
  --line-strong: #6b7685;
  --accent: #0b6767;
  --accent-ink: #ffffff;
  --left: #1f5bbf;
  --right: #a84d08;
  --good: #1d6b3a;
  --warn: #8a5300;
  --error: #b42318;
  --focus: #0b6767;
  --heat-1: #e8f1f1;
  --heat-2: #c4dede;
  --heat-3: #8fc0c0;
  --heat-4: #2f7a7a;
  --heat-5: #0b5e5e;
  --heat-ink-dark: #14213d;
  --heat-ink-light: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 16px rgba(20, 33, 61, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1522;
    --surface: #172133;
    --surface-2: #1f2b40;
    --ink: #e8edf5;
    --muted: #aab5c5;
    --line: #2c3a52;
    --line-strong: #7d8aa0;
    --accent: #5cc8c8;
    --accent-ink: #0e1522;
    --left: #82adff;
    --right: #f2a65f;
    --good: #6fd08f;
    --warn: #f0c060;
    --error: #ff8a80;
    --focus: #5cc8c8;
    --heat-1: #1d3a3d;
    --heat-2: #24585b;
    --heat-3: #3e9396;
    --heat-4: #5fb4b6;
    --heat-5: #8fd6d6;
    --heat-ink-dark: #0e1522;
    --heat-ink-light: #e8edf5;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.55;
}
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 1rem; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--surface-2); font-weight: 700; }

main { padding: 32px 0 48px; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 1.4rem; margin: 0 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: 12px;
  border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.seg label {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
  border: 2px solid var(--line-strong); border-radius: 10px; cursor: pointer; background: var(--surface);
}
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg input:checked + span { font-weight: 700; }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
select { font: inherit; min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .u { font-size: 1rem; font-weight: 400; color: var(--muted); }
.hand-l { color: var(--left); }
.hand-r { color: var(--right); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.swatch.l { background: var(--left); }
.swatch.r { background: var(--right); }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: .85rem; }
.table-scroll { overflow-x: auto; }

.notice { border-left: 4px solid var(--accent); background: var(--surface-2); padding: 12px 16px; border-radius: 8px; }
.notice.warn { border-left-color: var(--warn); }

.site-foot { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }
.site-foot p { margin: 6px 0; max-width: 70ch; }

.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart .lbl { fill: var(--muted); font-size: 13px; }
.chart .line-l { stroke: var(--left); fill: none; stroke-width: 2.5; }
.chart .line-r { stroke: var(--right); fill: none; stroke-width: 2.5; }
.chart .dot-l { fill: var(--left); }
.chart .dot-r { fill: var(--right); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
