/* =====================================================================
   Minimal theme · light & dark
   Theme = OS setting by default; the header toggle sets data-theme on <html>.
   ===================================================================== */
:root {
  color-scheme: light;
  --page: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --ink: #111111;
  --ink-2: #6b6b6b;
  --ink-3: #9a9a9a;
  --line: #e7e7e5;
  --line-strong: #cfcfcc;
  --grid: #ededeb;
  --axis: #c9c9c6;
  --accent: #1b64be;
  --accent-ink: #ffffff;
  --accent-soft: #eef4fc;
  --focus: #257de0;
  --good: #0a7a1f;
  --warn-bg: #fbf7ea;
  --warn-ink: #6b5200;

  /* Phase ramp – one hue, ordinal, light → dark */
  --p0: #b4b4b2; --p1: #8f8f8c; --p2: #6b6b68; --p3: #454543; --p4: #1c1c1b;
  --p0-ink: #0b0b0b; --p1-ink: #0b0b0b; --p2-ink: #ffffff; --p3-ink: #ffffff; --p4-ink: #ffffff;

  /* Heatmap ends (sequential) */
  --heat-lo: #f4f4f3; --heat-hi: #3a3a38; --heat-lo-ink: #111111; --heat-hi-ink: #ffffff;

  /* Dimension colours (identity) – validated for colour-blind separation; order matters */
  --dA: #1b64be; --dB: #e0621f; --dC: #009e7f; --dD: #7a5af0; --dE: #d6408a;
  --on-dim: #ffffff;

  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Dark tokens: OS dark (unless the user picked light) … */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f0f0f; --surface: #0f0f0f; --surface-2: #1a1a1a;
    --ink: #ededed; --ink-2: #a1a1a1; --ink-3: #6f6f6f;
    --line: #262626; --line-strong: #3a3a3a; --grid: #242424; --axis: #444444;
    --accent: #6aabf1; --accent-ink: #0b0b0b; --accent-soft: #13202f; --focus: #6aabf1;
    --good: #53c556; --warn-bg: #221d0d; --warn-ink: #e8cf86;
    --p0: #4a4a4a; --p1: #6e6e6e; --p2: #959595; --p3: #bdbdbd; --p4: #ececec;
    --p0-ink: #ffffff; --p1-ink: #ffffff; --p2-ink: #0b0b0b; --p3-ink: #0b0b0b; --p4-ink: #0b0b0b;
    --heat-lo: #16202c; --heat-hi: #9dc8f7; --heat-lo-ink: #ededed; --heat-hi-ink: #0b0b0b;
    --dA: #338ced; --dB: #e76624; --dC: #00a888; --dD: #9887ef; --dE: #e24d8b; --on-dim: #0b0b0b;
  }
}
/* … or explicitly chosen dark. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0f; --surface: #0f0f0f; --surface-2: #1a1a1a;
  --ink: #ededed; --ink-2: #a1a1a1; --ink-3: #6f6f6f;
  --line: #262626; --line-strong: #3a3a3a; --grid: #242424; --axis: #444444;
  --accent: #6aabf1; --accent-ink: #0b0b0b; --accent-soft: #13202f; --focus: #6aabf1;
  --good: #53c556; --warn-bg: #221d0d; --warn-ink: #e8cf86;
  --p0: #4a4a4a; --p1: #6e6e6e; --p2: #959595; --p3: #bdbdbd; --p4: #ececec;
  --p0-ink: #ffffff; --p1-ink: #ffffff; --p2-ink: #0b0b0b; --p3-ink: #0b0b0b; --p4-ink: #0b0b0b;
  --heat-lo: #16202c; --heat-hi: #9dc8f7; --heat-lo-ink: #ededed; --heat-hi-ink: #0b0b0b;
  --dA: #338ced; --dB: #e76624; --dC: #00a888; --dD: #9887ef; --dE: #e24d8b; --on-dim: #0b0b0b;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15.5px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.025em; }
h2 { font-size: 1.35rem; letter-spacing: -.015em; }
h3 { font-size: 1.05rem; letter-spacing: -.005em; }
h4 { font-size: .98rem; }
p { margin: 0 0 1em; max-width: 70ch; }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
main { min-height: 70vh; outline: none; }
main:focus, main:focus-visible { outline: none; }
.tnum { font-variant-numeric: tabular-nums; }
code { font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ===== Header / footer ===== */
.site-header { background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-weight: 600; font-size: .95rem; }
.brand small { color: var(--ink-2); font-size: .75rem; }
.brand-mark { width: 26px; height: 26px; }
.brand-mark rect:first-child { fill: var(--ink); }
.brand-mark rect:not(:first-child) { fill: var(--page); }
.nav-wrap { display: flex; align-items: center; gap: 8px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 6px 10px; font-size: .9rem; border-radius: var(--radius-sm); }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 600; }
.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 44px; font-size: .8rem; color: var(--ink-2); }
.site-footer p { max-width: none; margin-bottom: .6em; }

/* ===== Layout ===== */
.section { padding: 44px 0; }
.section-tight { padding: 20px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: .35em; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.eyebrow { font-size: .78rem; font-weight: 500; color: var(--ink-2); margin-bottom: 10px; letter-spacing: .01em; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius-sm); font: inherit; font-weight: 500; font-size: .9rem; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background-color .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--ink); color: var(--page); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink); opacity: .86; }
.btn-ghost { border-color: transparent; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: .84rem; }

/* ===== Home ===== */
.hero { padding: 72px 0 36px; }
.hero h1 { max-width: 20ch; }
.hero p.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; }
.hero .row { margin-top: 26px; }
.stairs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; align-items: stretch; margin-top: 12px; border-bottom: 1px solid var(--line); }
.stair { padding: 14px 14px 16px; position: relative; border-left: 1px solid var(--line); }
.stairs .stair:first-child { border-left: 0; padding-left: 0; }
.stair::before { content: ""; display: block; height: 3px; width: 28px; background: var(--pc); border-radius: 2px; margin-bottom: 12px; }
.stair .n { font-size: .75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stair h4 { margin: 2px 0 6px; }
.stair p { font-size: .84rem; color: var(--ink-2); margin: 0; }
.grid-5 .stair { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
@media (max-width: 820px) { .stairs { grid-template-columns: 1fr; } .stair { min-height: 0 !important; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); } }

.dim-list { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border-top: 1px solid var(--line); }
.dim-item { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.dim-item .letter { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.dim-item h4 { margin: 8px 0 6px; min-height: 2.5em; display: flex; align-items: flex-end; line-height: 1.25; }
@media (max-width: 700px) { .dim-item h4 { min-height: 0; } }
.dim-item p { font-size: .84rem; color: var(--ink-2); margin: 0; }
.grid-3 .card .eyebrow { font-variant-numeric: tabular-nums; }

/* ===== Assessment ===== */
.stepper { display: flex; gap: 6px; margin: 16px 0 28px; flex-wrap: wrap; }
.stepper button { display: flex; flex-direction: column; justify-content: flex-start; flex: 1 1 120px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font: inherit; color: var(--ink-3); }
.stepper .bar { height: 3px; border-radius: 2px; background: var(--line); margin-bottom: 8px; overflow: hidden; }
.stepper .bar i { display: block; height: 100%; background: var(--ink); }
.stepper .lbl { font-size: .76rem; }
.stepper button[aria-current="step"] .lbl { color: var(--ink); font-weight: 600; }
.stepper button:hover .lbl { color: var(--ink); }

.q { min-width: 0; background: transparent; border: 0 !important; border-top: 1px solid var(--line) !important; border-radius: 0; padding: 26px 0 22px; margin: 0; }
.q-head { display: flex; gap: 10px; align-items: baseline; }
.q-id { font-weight: 500; color: var(--ink-3); font-size: .82rem; font-variant-numeric: tabular-nums; }
.q-cap { font-size: .76rem; color: var(--ink-2); }
.q-cap::before { content: "·"; margin-right: 8px; color: var(--ink-3); }
.q h3 { margin: 4px 0 4px; }
.q .def { color: var(--ink-2); font-size: .88rem; margin-bottom: 4px; }
.q .ask { margin-bottom: 14px; }
.opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 900px) { .opts { grid-template-columns: 1fr; } }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt label { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font-size: .86rem; background: var(--surface); transition: border-color .12s, background-color .12s; }
.opt label:hover { border-color: var(--line-strong); }
.opt .lv { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.opt .lv i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc); display: inline-block; }
.opt input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt input:checked + label .lv { color: var(--ink); }
.opt input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.dk { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--ink-2); cursor: pointer; }
.dk input { accent-color: var(--ink); }

.dim-intro { padding: 0 0 20px; margin: 0; }
.dim-intro p { margin: 0; color: var(--ink-2); font-size: .95rem; }

.form-grid { display: grid; gap: 18px 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.field label { display: flex; align-items: flex-end; min-height: 2.6em; line-height: 1.3; font-weight: 500; font-size: .86rem; margin-bottom: 6px; }
.toolbar .field label { min-height: 0; }
.field .hint { font-size: .76rem; color: var(--ink-3); margin-top: 4px; }
input[type=text], select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: .92rem; background: var(--surface); color: var(--ink); }
input[type=text]:hover, select:hover { border-color: var(--ink-3); }
.step-nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.notice { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; border-radius: var(--radius-sm); font-size: .88rem; }
.info { background: var(--surface-2); padding: 12px 16px; border-radius: var(--radius-sm); font-size: .86rem; color: var(--ink-2); }
.info b { color: var(--ink); font-weight: 600; }

/* ===== Results ===== */
.result-hero { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 860px) { .result-hero { grid-template-columns: 1fr; } }
.phase-badge { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.phase-badge .big { font-size: 3.2rem; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.phase-badge .name { font-size: 1.05rem; font-weight: 500; color: var(--ink-2); margin-top: 6px; }
.phase-badge .idx { font-size: .84rem; color: var(--ink-2); }
.phase-badge .idx b { color: var(--ink); font-weight: 600; }
.phase-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 8px; }
.phase-track span { height: 6px; border-radius: 3px; background: var(--line); }
.phase-track span.on { background: var(--pc); }

.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: .78rem; color: var(--ink-2); }
.stat .v { font-size: 1.75rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; margin-top: 6px; }
.stat .s { font-size: .78rem; color: var(--ink-2); margin-top: 2px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }

.dimbars { display: grid; gap: 16px; }
.dimbar .top { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; margin-bottom: 6px; }
.dimbar .top b { font-weight: 500; }
.dimbar .track { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; }
.dimbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.dimbar .ticks { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); pointer-events: none; }
.dimbar .ticks i { border-right: 2px solid var(--page); }
.dimbar .ticks i:last-child { border-right: 0; }
.dimbar .scale { display: flex; justify-content: space-between; font-size: .7rem; color: var(--ink-3); margin-top: 4px; }

/* Matrix */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; font-size: .8rem; }
.matrix th, .matrix td { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; }
.matrix th:last-child, .matrix td:last-child { border-right: 0; }
.matrix thead th { position: sticky; top: 0; background: var(--surface); font-size: .78rem; font-weight: 600; z-index: 1; }
.matrix thead th .bar { display: block; height: 3px; width: 24px; border-radius: 2px; background: var(--pc); margin-bottom: 8px; }
.matrix th.dim { writing-mode: vertical-rl; transform: rotate(180deg); text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; font-weight: 600; color: var(--ink-3); text-align: center; width: 32px; padding: 10px 6px; }
.matrix th.cap { font-weight: 500; width: 150px; }
.matrix td { color: var(--ink-2); }
.matrix td.here { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.matrix td.next { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 8px); color: var(--ink); }
.matrix td .tag { display: block; font-size: .68rem; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.matrix tr.grp-end td, .matrix tr.grp-end th { border-bottom-color: var(--line-strong); }
.matrix tbody tr:last-child td, .matrix tbody tr:last-child th { border-bottom: 0; }

/* Pathway */
.actions { display: grid; gap: 0; counter-reset: act; border-top: 1px solid var(--line); }
.action { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.action::before { counter-increment: act; content: counter(act); font-size: .9rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 1px; }
.action h4 { margin: 0 0 10px; }
.fromto { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; font-size: .86rem; }
@media (max-width: 700px) { .fromto { grid-template-columns: 1fr; } .fromto .arrow { transform: rotate(90deg); justify-self: start; } }
.fromto > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--ink-2); }
.fromto .lab { display: block; font-size: .7rem; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.fromto .to { border-color: var(--accent); color: var(--ink); }
.fromto .to .lab { color: var(--accent); }
.fromto .arrow { border: 0 !important; align-self: center; color: var(--ink-3); padding: 0 !important; }

/* ===== Charts ===== */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-2); font-family: var(--font); font-size: 12px; }
.chart .t-strong { fill: var(--ink); font-weight: 500; }
.chart .grid line, .chart .grid polygon, .chart .grid circle { stroke: var(--grid); fill: none; }
.chart .axis line { stroke: var(--axis); }
.chart .series-fill { fill: var(--accent); fill-opacity: .14; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .series-dot { fill: var(--accent); stroke: var(--page); stroke-width: 2; }
.chart .ref-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .hit { fill: transparent; cursor: default; }
.chart .bar { stroke: var(--page); stroke-width: 2; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--page);
  padding: 8px 10px; border-radius: 6px; font-size: .8rem; max-width: 280px; line-height: 1.45; }
.tooltip b { font-weight: 600; }

/* Heatmaps */
.heat-wrap { overflow-x: auto; }
table.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: .8rem; }
.heat th { font-weight: 500; text-align: left; padding: 6px 8px; color: var(--ink-2); white-space: nowrap; }
.heat thead th { text-align: center; font-size: .74rem; vertical-align: bottom; white-space: normal; min-width: 64px; color: var(--ink-3); }
.heat td { text-align: center; padding: 8px 6px; border-radius: 3px; font-variant-numeric: tabular-nums; font-weight: 500; min-width: 56px; }
.heat td.na { color: var(--ink-3); background: transparent; font-weight: 400; }
.scale-legend { display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--ink-3); margin-top: 12px; flex-wrap: wrap; }
.scale-legend .grad { width: 140px; height: 8px; border-radius: 4px; }

/* Dashboard */
.toolbar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.toolbar .field { flex: 1 1 170px; max-width: 240px; }
.toolbar .field label { font-size: .74rem; color: var(--ink-2); font-weight: 400; margin-bottom: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 4px; font: inherit; font-size: .84rem; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.seg button[disabled] { opacity: .4; cursor: not-allowed; }
.toolbar .field:has(.seg) { max-width: none; flex: 0 0 auto; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: .86rem; }
.banner.demo { background: var(--warn-bg); color: var(--warn-ink); }
.drop { display: block; cursor: pointer; border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--ink-2); transition: border-color .15s, background-color .15s; }
.drop:hover { border-color: var(--ink-3); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.drop b { color: var(--ink); font-weight: 500; }
table.data { border-collapse: collapse; width: 100%; font-size: .8rem; }
.data th, .data td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data th { font-weight: 500; color: var(--ink-2); }
.data td.n { text-align: right; font-variant-numeric: tabular-nums; }
details > summary { cursor: pointer; font-weight: 500; }
details[open] > summary { margin-bottom: 12px; }

/* About */
.people { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); border-top: 1px solid var(--line); }
.person { padding: 14px 0; border-bottom: 1px solid var(--line); }
.person b { display: block; font-weight: 500; }
.person span { font-size: .84rem; color: var(--ink-2); }

/* ===== Print ===== */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 10.5pt; }
  .site-header, .site-footer, .no-print, .nav, .tooltip, .theme-toggle { display: none !important; }
  .card, .action, .stat { break-inside: avoid; }
  .matrix-wrap { overflow: visible; }
  table.matrix { min-width: 0; font-size: 7.5pt; }
  .section { padding: 12px 0; }
  a { color: inherit; text-decoration: none; }
}

/* =====================================================================
   Dimension colours × phase intensity
   .dim-X sets the hue (--dc); .lv-N sets the intensity for phase N.
   ===================================================================== */
.dim-A { --dc: var(--dA); } .dim-B { --dc: var(--dB); } .dim-C { --dc: var(--dC); } .dim-D { --dc: var(--dD); } .dim-E { --dc: var(--dE); }
.lv-0 { --lv: 16%; --tint: 3%; }  .lv-1 { --lv: 36%; --tint: 8%; }  .lv-2 { --lv: 58%; --tint: 14%; }
.lv-3 { --lv: 80%; --tint: 21%; } .lv-4 { --lv: 100%; --tint: 29%; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px;
  background: color-mix(in srgb, var(--dc, var(--ink-2)) var(--lv, 100%), var(--page)); }
.dl { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; margin-right: 8px; font-size: .7rem; font-weight: 700;
  background: var(--dc); color: var(--on-dim); vertical-align: 1px; }

/* Home */
.dim-item .letter { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--dc); color: var(--on-dim); font-weight: 700; font-size: .75rem; }
.ramp { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin-top: auto; padding-top: 14px; max-width: 150px; }
.ramp i { height: 6px; border-radius: 2px; background: color-mix(in srgb, var(--dc) var(--lv), var(--page)); }

/* Colour key (model page) */
.dim-key { display: grid; gap: 4px; font-size: .78rem; }
.dim-key-head, .dim-key-row { display: grid; grid-template-columns: 220px repeat(5, 44px); gap: 4px; align-items: center; }
.dim-key-head span { color: var(--ink-3); font-size: .7rem; text-align: center; }
.dim-key-row .nm { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dim-key-row .nm b { color: var(--ink); margin-right: 4px; }
.dim-key-row .sw { width: 44px; height: 18px; margin: 0; border-radius: 3px; }
.dim-card { border-top: 3px solid var(--dc); display: flex; flex-direction: column; }
.dim-card > p:last-child { margin-top: auto !important; padding-top: 8px; }

/* Assessment */
.stepper .bar[class*="dim-"] i { background: var(--dc); }
.dim-intro[class*="dim-"] { border-left: 3px solid var(--dc); padding: 2px 0 2px 16px; margin-bottom: 20px; }
.q[class*="dim-"] .q-id { color: var(--dc); font-weight: 600; }
.q .opt .lv i { background: color-mix(in srgb, var(--dc, var(--ink-2)) var(--lv), var(--page)); width: 10px; height: 10px; border-radius: 3px; }
.q[class*="dim-"] .opt input:checked + label { border-color: var(--dc); box-shadow: inset 0 0 0 1px var(--dc);
  background: color-mix(in srgb, var(--dc) 6%, var(--page)); }

/* Results */
.dimbar[class*="dim-"] .fill { background: var(--dc); }
.dimbar[class*="dim-"] .chip::before { background: color-mix(in srgb, var(--dc) var(--lv), var(--page)); width: 10px; height: 10px; border-radius: 3px; }
.action[class*="dim-"] { border-left: 3px solid var(--dc); padding-left: 14px; }
.action[class*="dim-"]::before { color: var(--dc); }
.fromto .from { background: color-mix(in srgb, var(--dc) var(--tint), var(--page)); }
.fromto .to { border-color: var(--dc); background: color-mix(in srgb, var(--dc) var(--tint), var(--page)); }
.fromto .to .lab { color: var(--ink-2); }

/* Matrix: each row in its dimension colour, cells deepen with the phase */
.matrix tr[class*="dim-"] td { background: color-mix(in srgb, var(--dc) var(--tint), var(--page)); color: var(--ink-2); }
.matrix tr[class*="dim-"] th.dim { box-shadow: inset 3px 0 0 var(--dc); color: var(--ink-2); }
.matrix tr[class*="dim-"] td.here { color: var(--ink); box-shadow: inset 0 0 0 2px var(--dc); font-weight: 500; }
.matrix tr[class*="dim-"] td.next { color: var(--ink);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--dc) var(--tint), var(--page)) 0 6px, color-mix(in srgb, var(--dc) calc(var(--tint) + 10%), var(--page)) 6px 8px); }
.matrix tr[class*="dim-"] td .tag { color: var(--ink); }
.matrix tr[class*="dim-"] td .tag::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--dc); margin-right: 6px; }
