/* Tokens from ALiF Ecosystem Map v2.1 */
:root {
  color-scheme: light;
  --navy: #1B3A5C; --teal: #2A7F8E; --teal-light: #3A9FB0; --teal-text: #26737f; --dark: #1a1a2e; --mid: #555;
  --light: #f0f5f7; --cream: #fafbfc; --white: #fff; --border: #dde3e8; --card-bg: #fff; --body-bg: #fafbfc;
  --l1: #1B3A5C; --l2: #2A7F8E; --l3: #16803C; --gold: #b8860b; --danger: #b42318; --warn: #b54708; --ok: #16803C;
  --tec: #2563eb; --eva: #7c3aed; --pra: #16803C; --eth: #db2777; --dat: #ea580c;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06); --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --radius: 12px;
  --focus-ring: #1B3A5C; --focus: 0 0 0 3px var(--body-bg), 0 0 0 6px var(--focus-ring);
  --border-strong: #8a97a3;
  --on-accent: #fff;
  --header-h: 60px; --key-h: 0px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --navy: #7db4e0; --teal: #5bc0cd; --teal-light: #6dd5e1; --teal-text: #5bc0cd; --dark: #e8eaed; --mid: #a0a8b4;
  --light: #1e2a38; --cream: #0f1923; --white: #162230; --border: #2a3a4e; --card-bg: #162230; --body-bg: #0f1923;
  --l1: #7db4e0; --l2: #5bc0cd; --l3: #4ade80; --gold: #e0a810; --danger: #f97066; --warn: #f59e0b; --ok: #4ade80;
  --tec: #60a5fa; --eva: #a78bfa; --pra: #4ade80; --eth: #f472b6; --dat: #fb923c;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3); --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --on-accent: #0f1923;
  --focus-ring: #e8eaed; --border-strong: #6b7a8a;
}
/* Follow OS preference when the user hasn't made an explicit choice via the theme toggle
 * (data-theme is only ever "light" or "dark" once set — this block covers the unset default). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy: #7db4e0; --teal: #5bc0cd; --teal-light: #6dd5e1; --teal-text: #5bc0cd; --dark: #e8eaed; --mid: #a0a8b4;
    --light: #1e2a38; --cream: #0f1923; --white: #162230; --border: #2a3a4e; --card-bg: #162230; --body-bg: #0f1923;
    --l1: #7db4e0; --l2: #5bc0cd; --l3: #4ade80; --gold: #e0a810; --danger: #f97066; --warn: #f59e0b; --ok: #4ade80;
    --tec: #60a5fa; --eva: #a78bfa; --pra: #4ade80; --eth: #f472b6; --dat: #fb923c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3); --shadow-md: 0 4px 12px rgba(0,0,0,.4);
    --on-accent: #0f1923;
    --focus-ring: #e8eaed; --border-strong: #6b7a8a;
  }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--key-h) + 24px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--body-bg); color: var(--dark); line-height: 1.55; }
h1, h2, h3 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; line-height: 1.2; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; margin-block: 1.5rem .75rem; } h3 { font-size: 1.15rem; margin-block: 1rem .5rem; }
p { margin-block: .5rem; } ul, ol { padding-inline-start: 1.25rem; margin-block: .5rem; }
a { color: var(--teal-text); }
.wrap { max-width: 860px; margin-inline: auto; padding-inline: 1rem; }
.skip-link { position: fixed; top: -100%; inset-inline-start: 16px; z-index: 1000; padding: 8px 16px; background: var(--navy); color: var(--on-accent); border-radius: 0 0 8px 8px; font-size: 13px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 0; }
.site-header { position: sticky; top: 0; z-index: 50; background: var(--card-bg); border-bottom: 1px solid var(--border); }
/* A static floor, not var(--header-h) — that variable is fed by a ResizeObserver watching
 * .site-header's own rendered height (js/app.js initHeaderHeight), so using it here would make
 * .header-row's min-height and .site-header's observed height chase each other, growing every
 * animation frame. --header-h exists to tell the REST of the page (scroll-padding-top, the
 * sticky .scale-key's top offset) how tall the header actually is — it must never feed back into
 * sizing the header itself. */
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--dark); font-weight: 600; }
.brand-mark { background: var(--navy); color: var(--on-accent); font-family: 'DM Serif Display', serif; padding: .15rem .5rem; border-radius: 6px; }
.brand small { color: var(--mid); font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.progress { width: 140px; height: 6px; background: var(--light); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--l1), var(--l2), var(--l3)); transition: width .3s; }
.progress-text { font-size: .8rem; color: var(--mid); white-space: nowrap; }
.review-actions { position: sticky; bottom: 0; background: var(--body-bg); padding-block: .75rem; border-top: 1px solid var(--border); margin-block-start: 0; }
main { padding-block: 1.5rem 3rem; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--border); padding-block: 1.25rem; font-size: .85rem; color: var(--mid); }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); margin-block: 1rem; }
.card.accent { border-inline-start: 4px solid var(--teal); }
.muted { color: var(--mid); } .small { font-size: .875rem; }
.btn { font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: 8px; border: 1px solid var(--navy); background: var(--navy); color: var(--on-accent); cursor: pointer; }
.btn:hover { filter: brightness(1.1); }
.btn:focus-visible, .tabs button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px;
}
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--navy); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--dark); padding: .4rem .7rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-block: 1.25rem; align-items: center; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card-bg); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal) inset; }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.choice input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--teal); }
.choice-body { display: block; }
.choice-body strong { display: block; }
.choice-desc { display: block; color: var(--mid); font-size: .875rem; }
fieldset { border: 0; padding: 0; margin: 0; } legend { font-weight: 600; padding: 0; }
summary { cursor: pointer; }
.text-input { flex: 1 1 260px; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; background: var(--card-bg); color: var(--dark); }
/* Scale key: two presentations of the same four anchors. .scale-key is the sticky always-open
 * grid used at >=700px; .scale-strip is the collapsible one-line strip used below that (R20) —
 * only one is ever visible at a time. */
.scale-key { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem; position: sticky; top: calc(var(--header-h) + 2px); z-index: 10; background: var(--body-bg); padding-block: .5rem; border-bottom: 1px solid var(--border); }
.scale-key div { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .6rem; font-size: .8rem; }
.scale-key b { display: block; font-size: .95rem; }
.scale-strip { display: none; }
@media (max-width: 699px) {
  .scale-key { display: none; }
  .scale-strip {
    display: block; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg);
    margin-block: .5rem; padding: .4rem .7rem; font-size: .85rem;
  }
  .scale-strip summary { font-weight: 600; list-style: none; }
  .scale-strip summary::-webkit-details-marker { display: none; }
  .scale-strip-body p { margin-block: .3rem; font-size: .8rem; }
}
.group-heading { font-family: 'DM Sans', system-ui, sans-serif; margin-block: 1.5rem .5rem; color: var(--teal-text); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.item { padding: .75rem .5rem; border-bottom: 1px solid var(--border); }
.item-row { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .75rem; align-items: center; }
.item.missing { background: color-mix(in srgb, var(--danger) 12%, transparent); border-radius: 8px; border-inline-start: 3px solid var(--danger); }
.item-text { font-weight: 600; }
.item-n { color: var(--mid); font-variant-numeric: tabular-nums; min-width: 1.75rem; flex: none; }
.chip-missing { display: inline-block; margin-inline-start: .5rem; padding: .1rem .5rem; border-radius: 999px; background: var(--danger); color: var(--on-accent); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.chip-missing[hidden] { display: none; }
.item-scale { display: flex; gap: .35rem; flex-wrap: wrap; }
.item-scale label {
  flex: 0 0 2.75rem; display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border: 1px solid var(--border-strong); border-radius: 8px;
  cursor: pointer; font-weight: 600; position: relative;
}
.item-scale input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.item-scale label:has(input:checked) { background: var(--teal); color: var(--on-accent); border-color: var(--teal); }
.item-scale label:has(input:focus-visible) { box-shadow: var(--focus); }
.item-scale .anchor { display: none; }
@supports not (selector(:has(*))) {
  /* Without :has(), the invisible input can't drive the label's appearance — show it instead. */
  .item-scale input { opacity: 1; position: static; margin-inline-end: .25rem; }
}
@media (min-width: 600px) {
  /* Repeat the short anchor word under each numeral so respondents aren't rating against bare
     numerals once the sticky scale key has scrolled out of view (R20). */
  .item-scale label {
    flex: 0 0 auto; flex-direction: column; gap: 2px; width: auto; height: auto;
    min-width: 4.25rem; min-height: 2.75rem; padding: .35rem .5rem;
  }
  .item-scale .anchor { display: block; font-size: .62rem; font-weight: 500; line-height: 1.1; text-align: center; white-space: nowrap; }
}
@media (max-width: 600px) { .item-row { grid-template-columns: 2.5rem 1fr; } .item-scale { grid-column: 1 / -1; justify-content: flex-end; } }
@media (max-width: 600px) {
  .brand-text small { display: none; }
  .progress { width: 90px; }
  .brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
}
.error { color: var(--danger); font-weight: 600; }
/* charts: responsive HTML rows (see js/ui/charts.js) rather than a fixed-viewBox SVG, so
 * labels reflow and never clip on narrow viewports. */
.barchart { margin-block: .5rem 1rem; }
.bars { list-style: none; padding: 0; margin: 0; }
.bar-row { display: grid; grid-template-columns: minmax(9rem, 16rem) 1fr 3.5rem; gap: .5rem; align-items: center; padding-block: .25rem; }
.bar-label { overflow-wrap: anywhere; font-size: .85rem; }
.band-legend { font-size: .7rem; color: var(--mid); padding-block-end: .25rem; border-bottom: 1px solid var(--border); margin-block-end: .25rem; }
.band-legend-track { display: grid; grid-template-columns: 31.7fr 26.7fr 23.3fr 18.3fr; }
.band-legend-track span:not(:first-child) { border-inline-start: 1px solid var(--border); padding-inline-start: .3rem; }
.bar-track { position: relative; height: 14px; background: var(--light); border-radius: 7px; overflow: hidden; }
/* Physical `to right` gradient (CSS gradients have no logical "to inline-end" keyword) — mirrored
   by hand for RTL via the [dir="rtl"] transform below, same technique as charts.css's
   .dp-track-bg. Safe here for the same reason: the layer carries no text of its own. */
.bar-bands {
  position: absolute; inset: 0;
  background: linear-gradient(to right,
    color-mix(in srgb, var(--l1) 12%, transparent) 0 58.4%,
    color-mix(in srgb, var(--l2) 12%, transparent) 58.4% 81.7%,
    color-mix(in srgb, var(--l3) 12%, transparent) 81.7% 100%);
}
[dir="rtl"] .bar-bands { transform: scaleX(-1); }
/* inset-inline (start end) + inset-block, not the physical `inset: 0 auto 0 0` this used to be —
   the fill must grow from the inline-start edge (the container's right edge in RTL) rather than
   always from the physical left, or an RTL bar would visually grow the wrong way (R24). */
.bar-fill { position: absolute; inset-block: 0; inset-inline: 0 auto; border-radius: 7px; }
.bar-fill.TEC { background: var(--tec); } .bar-fill.EVA { background: var(--eva); } .bar-fill.PRA { background: var(--pra); } .bar-fill.ETH { background: var(--eth); } .bar-fill.DAT { background: var(--dat); } .bar-fill.ROLE { background: var(--navy); }
.bar-score { font-size: .85rem; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) {
  .bar-row { grid-template-columns: 1fr 3.5rem; row-gap: .15rem; }
  .bar-label { grid-column: 1 / -1; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.print-only { display: none; }
.level-pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--on-accent); }
.level-pill.L1B, .level-pill.L1A { background: var(--l1); } .level-pill.L2 { background: var(--l2); } .level-pill.L3 { background: var(--l3); }
/* Logical corner radii, not the physical `border-radius: 0 8px 8px 0` this used to be: the two
   corners against the accent border-inline-start bar stay square, the two far (inline-end)
   corners stay rounded — in RTL the accent bar moves to the right edge, so the square corners
   must move with it rather than staying pinned to the physical left (R24). */
.finding {
  border-inline-start: 4px solid var(--teal); padding: .5rem 1rem; margin-block: .75rem; background: var(--card-bg);
  border-start-start-radius: 0; border-end-start-radius: 0;
  border-start-end-radius: 8px; border-end-end-radius: 8px;
}
.finding.gaps, .finding.datFlag { border-color: var(--warn); } .finding.selfCheck { border-color: var(--gold); }
.finding.strengths { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--card-bg)); }
.finding.headline { border-color: var(--navy); border-inline-start-width: 6px; }
.finding .caveat-note { color: var(--warn); font-size: .8rem; }
.finding-bullets { list-style: disc; padding-inline-start: 1.35rem; margin-block: .75rem; }
.finding-bullets li { margin-block-end: .5rem; }
details.selfcheck { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .9rem; margin-block: .75rem; background: var(--card-bg); }
details.selfcheck summary { font-weight: 600; }
details.selfcheck summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
details.selfcheck .finding { margin-block-start: .5rem; }
/* Results page header line, quality banner and floor-effect caveat (Task 8, spec §5 items 1-3). */
.results-header-line { color: var(--mid); font-size: .95rem; margin-block: -.25rem .5rem; }
.quality-banner { border-inline-start: 4px solid var(--warn); }
.quality-banner ul { margin-block: .35rem; padding-inline-start: 1.25rem; }
.floor-caveat { border-inline-start: 3px solid var(--warn); padding-inline-start: .6rem; color: var(--mid); margin-block: .75rem; }
/* Summary card (spec §5.4) and safety panel (spec §5.5). */
.summary-sentence { font-weight: 600; margin-block: .75rem .5rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin-block: .5rem; }
.chip-row .chip { background: var(--light); border: 1px solid var(--border); border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; }
.jump-links { font-size: .85rem; margin-block: .75rem .25rem; }
.core-average { margin-block-start: .5rem; }
.safety-panel { border-inline-start: 4px solid var(--danger); }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-block: .5rem; }
.tabs button { font: inherit; font-size: .85rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--dark); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--teal); color: var(--on-accent); border-color: var(--teal); }
details.next { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .9rem; margin-block: .5rem; background: var(--card-bg); }
details.next summary { cursor: pointer; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
details.next summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; } th, td { text-align: start; padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.status { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.status.priority { color: var(--danger); } .status.complete, .status.develop, .status.full { color: var(--warn); } .status.review, .status.parallel, .status.accelerated { color: var(--teal); } .status.testout, .status.maintain, .status.skip, .status.direct, .status.eligible, .status.thresholdsMet { color: var(--ok); } .status.withheld, .status.thresholdsNotMet { color: var(--danger); }
.status.start { color: var(--teal); } .status.info { color: var(--mid); }
.ladder { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.ladder li { flex: 1 1 140px; background: var(--light); border-radius: 8px; padding: .5rem .7rem; font-size: .85rem; } .ladder b { display: block; }
.banner { background: var(--light); border: 1px solid var(--border); padding: .75rem 1rem; border-radius: 10px; margin-block: 1rem; }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--dark); color: var(--body-bg); padding: .5rem 1rem; border-radius: 8px; font-size: .9rem; }
/* Print — chrome/layout half (R14). The full custom-property reset that makes this readable when
   printed from dark mode lives at the end of this file, after every other unconditional
   :root/[data-theme] block, so it wins the cascade regardless of source order elsewhere (see the
   comment there). This block only ever toggles display/layout, so it has no such ordering
   constraint and can stay next to the rest of the class definitions it touches. */
@media print {
  @page { margin: 15mm }
  .site-header, .btn, .btn-row, .no-print, .skip-link, .toast { display: none !important; }
  details.next > .tabs { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
  .card, .finding, details.next, .step-item, .bt-tile { box-shadow: none; break-inside: avoid; }
  details.next { display: block; } details.next > *:not(summary) { display: block !important; }
  main { padding: 0; } a { color: inherit; text-decoration: none; }
  /* R14: chart marks/tracks/bands (charts.css carries its own dp-*/db-*/bt-* rules), level pills
     and status chips need print-color-adjust:exact or most browsers drop their background colour
     entirely on paper, leaving e.g. a level pill as invisible white-on-white text. */
  .level-pill, .status, .chip-missing, .chip-lowest, .bar-fill, .bar-bands {
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
}

/* ==== Task 9: pathway stepper, COMPASS groups, role items, work panels, learning order, floors,
   reassess callout, change view (results.pathway.js / results.work.js / results.change.js) ==== */

/* Placement stepper: replaces the static .ladder list with one that shows each step's live
   status inside the step itself. */
.stepper { list-style: none; padding: 0; margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .5rem; }
.step-item { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--border); border-inline-start: 4px solid var(--teal); border-radius: 8px; padding: .5rem .75rem; background: var(--card-bg); }
.step-n { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.step-body { flex: 1 1 auto; }
.status.done { color: var(--ok); }
.status.status-muted, .status-muted { color: var(--mid); }

/* COMPASS grouped lists (R15): replaces the 16-row table with three status-headed lists. */
.compass-group { margin-block: .75rem; }
.compass-group h4 { margin-block: 0 .35rem; font-family: 'DM Sans', system-ui, sans-serif; font-size: .9rem; }
.compass-list { list-style: none; padding: 0; margin: 0; }
.compass-list li { padding-block: .3rem; border-block-end: 1px solid var(--border); font-size: .9rem; }
.compass-list li:last-child { border-block-end: none; }
.close-note { border-inline-start: 3px solid var(--gold); padding-inline-start: .6rem; }
.evidence-gate { border-inline-start: 3px solid var(--border-strong); padding-inline-start: .6rem; }

/* Role modules (R10): the 8 items per role, lowest highlighted. */
.role-items { list-style: none; padding: 0; margin: .5rem 0; }
.role-item { display: grid; grid-template-columns: 2rem 1fr auto; gap: .5rem; align-items: center; padding: .4rem .5rem; border-block-end: 1px solid var(--border); }
.role-item:last-child { border-block-end: none; }
.role-item-n { color: var(--mid); font-variant-numeric: tabular-nums; }
.role-item-rating { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.role-item-lowest { background: color-mix(in srgb, var(--warn) 10%, transparent); border-radius: 6px; }
.chip-lowest { display: inline-block; margin-inline-start: .4rem; padding: .05rem .5rem; border-radius: 999px; background: var(--warn); color: var(--on-accent); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.integrity-note { border-inline-start: 3px solid var(--warn); padding-inline-start: .6rem; }
@media (max-width: 600px) { .role-item { grid-template-columns: 1fr; } .role-item-n { display: none; } }

/* What to work on (R15): one segmented role control for every panel, replacing 48 per-accordion
   buttons; Expand/Collapse all; the lead-in line above each panel's bullets. */
.seg-control { display: flex; flex-wrap: wrap; gap: .4rem; margin-block: .5rem; }
.seg-btn { font: inherit; font-size: .85rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--dark); cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--teal); color: var(--on-accent); border-color: var(--teal); }
.seg-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.work-actions { margin-block: .5rem 1rem; }
.work-panel + .work-panel { margin-block-start: .75rem; padding-block-start: .75rem; border-block-start: 1px dashed var(--border); }
.work-panel .lead-in { font-weight: 600; margin-block-end: .25rem; }

/* Suggested learning order (R15): three phase columns of develop/maintain chips. */
.learning-order-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-block: .5rem 1rem; }
.lo-phase { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: .75rem; }
.lo-chips { list-style: none; padding: 0; margin: .25rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.lo-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--light); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .6rem; font-size: .8rem; }
.lo-dot { width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.lo-chip.lo-develop .lo-dot { background: var(--warn); }
.lo-chip.lo-maintain .lo-dot { background: var(--ok); }

/* Reassess (R18): a callout, not a heading carrying the ISO date. */
.reassess-callout { border-inline-start: 4px solid var(--teal); }

/* Requirements check / floors (R16): stacked cards below 600px instead of a cramped table. */
@media (max-width: 600px) {
  .floors-table table, .floors-table thead, .floors-table tbody, .floors-table tr, .floors-table th, .floors-table td { display: block; width: 100%; }
  .floors-table tr:first-child { display: none; } /* header row: replaced by each cell's own data-th label below */
  .floors-table tr { border: 1px solid var(--border); border-radius: 10px; padding: .5rem .75rem; margin-block-end: .75rem; }
  .floors-table th[scope="row"] { font-family: 'DM Serif Display', Georgia, serif; font-size: 1.05rem; border-block-end: none; padding-block-end: 0; }
  .floors-table td { border-block-end: none; padding-block: .2rem; }
  .floors-table td[data-th]::before { content: attr(data-th) ": "; font-weight: 600; color: var(--mid); }
}

/* WCAG 2.4.7 in forced-colors (Windows High Contrast) mode: box-shadow doesn't render there, so
   the two-tone focus ring and the teal "checked" background both disappear. Give both states a
   real outline in the platform's Highlight colour instead. */
@media (forced-colors: active) {
  .item-scale label:has(input:focus-visible) { outline: 3px solid Highlight; outline-offset: 2px; }
  .item-scale label:has(input:checked) { outline: 2px solid Highlight; }
}

/* --border-strong (light) darkened from #8a97a3 to #828f9c for a 3:1 non-text contrast margin
   against the card/body backgrounds — overrides the base :root definition above via cascade
   rather than editing that declaration in place. Scoped to :not([data-theme="dark"]) so it
   doesn't also win over the dark value in [data-theme="dark"] and the
   prefers-color-scheme:dark block above (equal-specificity attribute/pseudo-class selectors,
   later source order); the two rules below explicitly restore the dark value in both of those
   cases at matching specificity, appended after so they still win there. */
:root:not([data-theme="dark"]) { --border-strong: #828f9c; }
:root[data-theme="dark"] { --border-strong: #6b7a8a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --border-strong: #6b7a8a; }
}

/* Uniform >=44px rating targets at >=600px: a shared fixed width (not min-width) so all four
   anchor labels render the same size instead of the widest word ("No experience") growing past
   the others; anchor text bumped to .7rem to stay legible at that width. */
@media (min-width: 600px) {
  .item-scale label { width: 5.5rem; min-width: 5.5rem; }
  .item-scale .anchor { font-size: .7rem; }
}

/* ==== Task 10: My plan, "Take this to your debrief", Save your results + QR, sources &
   limitations (js/ui/plan.js; disclosuresSection() in js/ui/results.js) ==== */

/* My plan (spec §5 item 15, R17): two goal selects side by side above the two free-text
   Launchpad-M3 prompts; both control types share the field/label rhythm below. */
.plan-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-block: .5rem 1rem; }
.plan-field { margin-block: .85rem; }
.plan-field label { display: block; font-weight: 600; margin-block-end: .35rem; }
.plan-field select, .plan-field textarea {
  width: 100%; font: inherit; font-size: .95rem; padding: .5rem .6rem;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--card-bg); color: var(--dark);
}
.plan-field textarea { resize: vertical; min-height: 4.5rem; }
.plan-field select:focus-visible, .plan-field textarea:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }

/* "Take this to your debrief" (spec §5 item 16, R17): prints by default — no .no-print/.card
   framing, it's meant to read like a hand-off sheet rather than another dashboard panel. */
.debrief { border-block-start: 1px solid var(--border); padding-block-start: 1rem; margin-block-start: 1.5rem; }
.debrief-items { padding-inline-start: 1.25rem; }
.debrief-items li { margin-block-end: .5rem; }
.debrief-notes-label { margin-block-start: 1rem; margin-block-end: 0; }
.note-line { border-block-end: 1px solid var(--border-strong); height: 1.7rem; margin-block: .5rem; }

/* Save your results (spec §5 item 17, R22): the link as selectable text, and two QR renders —
   .qr-print is the permanent print copy (hidden on screen via the shared .print-only rule near
   the top of this file), .qr-onscreen is the "Show QR" toggle target (plain [hidden], no class
   needed since nothing else needs to hide it). */
.link-row { margin-block: .75rem; }
.link-text {
  display: inline-block; max-width: 100%; overflow-wrap: anywhere; user-select: all;
  background: var(--light); border: 1px solid var(--border); border-radius: 6px;
  padding: .35rem .6rem; font-size: .85rem;
}
.qr-print, .qr-onscreen { margin-block: .75rem; }
.qr-render svg { display: block; width: auto; max-width: 100%; height: auto; }

/* Sources and limitations (spec §5 item 18): a collapsed details at the foot of the disclosures
   card — document provenance and this implementation's own heuristic margins, kept out of the
   way of the reading flow above but still one click from anyone who wants it. */
.sources-details { margin-block-start: 1rem; }
.sources-details summary { cursor: pointer; font-weight: 600; }
.sources-details summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.sources-details ul { margin-block: .5rem; }

@media print {
  .note-line { border-block-end-color: #000; }
  .link-text { border-color: #000; background: transparent; }
  .qr-print { break-inside: avoid; }
  /* Print always shows the permanent .qr-print copy regardless of the on-screen toggle state —
     if the respondent had clicked "Show QR" before printing, this stops the on-screen copy from
     also printing and duplicating the code. */
  .qr-onscreen { display: none !important; }
}

/* ==== Task 11: print report, R14 ====
   Complete token reset for print. Placed here — after every other unconditional :root/
   [data-theme]-scoped custom-property block above — so a plain `:root`/`[data-theme="dark"]`
   selector here would win any TIE against an earlier rule of the same specificity purely by
   source order. That is not enough on its own, though: `:root[data-theme="dark"]` and
   `:root:not([data-theme="dark"])` (the Task 9 --border-strong overrides, dark and light) and
   `:root:not([data-theme="light"])` (the prefers-color-scheme:dark block, which redefines every
   token here, not just --border-strong) are all COMPOUND selectors — :root plus an attribute/
   :not() clause — at specificity (0,2,0), strictly higher than a bare `:root` or
   `[data-theme="dark"]` alone at (0,1,0). Higher specificity always wins regardless of source
   order, so without the three extra selector-list alternatives below, printing under any of
   those three states would still lose this reset to that earlier, higher-specificity rule. Each
   alternative here matches the same declaration block at (0,2,0) whenever the higher-specificity
   rule it needs to beat also matches, so it ties on specificity and then wins on being later in
   the source — verified for all three theme states (dark/light/unset) by re-injecting this
   block's rules as an always-on stylesheet appended last and reading resolved
   getComputedStyle(document.documentElement) custom-property values, not just read off the
   source. */
@media print {
  :root, [data-theme="dark"],
  :root[data-theme="dark"], :root:not([data-theme="dark"]), :root:not([data-theme="light"]) {
    --dark: #000; --mid: #444; --light: #f0f0f0; --card-bg: #fff; --body-bg: #fff;
    --border: #999; --border-strong: #666;
    --on-accent: #fff;
    --navy: #1B3A5C; --teal: #2A7F8E; --teal-text: #26737f;
    --l1: #1B3A5C; --l2: #2A7F8E; --l3: #16803C;
    --warn: #b54708; --ok: #16803C; --gold: #b8860b; --danger: #b42318;
    --tec: #2563eb; --eva: #7c3aed; --pra: #16803C; --eth: #db2777; --dat: #ea580c;
  }

  /* Page-1 header block (title, completed date, versions, the self-report/not-a-credential line)
     and the running footer (same versions, repeated on every page via position:fixed — Chrome and
     most engines replicate a fixed-positioned element across each printed page). */
  .print-header { margin-block-end: 1rem; border-block-end: 2px solid #000; padding-block-end: .5rem; }
  .print-header h1 { margin: 0 0 .25rem; }
  .print-header p { margin-block: .15rem; font-size: .85rem; }
  .print-footer {
    position: fixed; inset-inline: 0; inset-block-end: 0; text-align: center;
    font-size: .7rem; color: #444; border-block-start: 1px solid #999; padding-block-start: .2rem;
    background: #fff;
  }

  /* Role descriptor panels (js/ui/results.work.js's "What to work on"): print only the primary
     role's panel plus "All roles" — results.js's beforeprint handler sets every other
     .role-panel's native [hidden] right before printing (and restores whatever was hidden
     on-screen after). !important here only guards against the sibling rule two lines up
     (details.next > *:not(summary) { display: block !important }) — it targets .work-panel, a
     direct child of details.next, not .role-panel itself, but the explicit !important keeps this
     correct even if that selector's reach ever changes. */
  .role-panel[hidden] { display: none !important; }
}
