/* Layout concept: a route sheet. Wide display type on a cobalt hero band,
   two route colors (institution = cobalt, partner = coral) that carry meaning
   everywhere, map-index references in mono, hard ink borders on interactive parts. */
:root {
  --bg: #F1F2F8;
  --surface: #FFFFFF;
  --sunk: #E6E8F3;
  --ink: #0B0D2A;
  --muted: #4A4F72;
  --line: #CDD1E6;
  --strong-line: #0B0D2A;
  --control: #6A6F92;
  --inst: #2A35F5;
  --inst-soft: #E3E5FF;
  --part: #FF5B3A;
  --part-ink: #BF3313;
  --part-soft: #FFE6DF;
  --signal: #CDFF4A;
  --on-signal: #0B0D2A;
  --violet: #6B3DF0;
  --hero-bg: #2A35F5;
  --hero-ink: #FFFFFF;
  --hero-muted: #C9CCFF;
  --focus: #0B0D2A;
  --lv0: #2A35F5; --lv0-ink: #FFFFFF; --lv1: #BCC1FF; --lv1-ink: #0B0D2A; --lv2: #FFD2C6; --lv2-ink: #0B0D2A; --lv3: #FF5B3A; --lv3-ink: #0B0D2A;

  --f-display: "Unbounded", "Arial Black", "Helvetica Neue", sans-serif;
  --f-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --s-0: 0.8125rem; --s-1: 1rem; --s-2: 1.1875rem; --s-3: 1.5rem; --s-4: 2rem; --s-5: clamp(2.25rem, 6vw, 4.25rem);
  --r: 14px;
  --wrap: 72rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080A1A; --surface: #11142C; --sunk: #181C3A; --ink: #EDEEFF; --muted: #A6AACC;
    --line: #2A2F57; --strong-line: #EDEEFF; --control: #8D92B8; --inst: #8C94FF; --inst-soft: #1E2358;
    --part: #FF7A5C; --part-ink: #FF9A80; --part-soft: #3A1C1A; --signal: #CDFF4A; --on-signal: #0B0D2A;
    --violet: #AE90FF; --hero-bg: #1C23C4; --hero-ink: #FFFFFF; --hero-muted: #C9CCFF; --focus: #CDFF4A; --lv0: #8C94FF; --lv0-ink: #080A1A; --lv1: #343C8C; --lv1-ink: #EDEEFF; --lv2: #5C2B22; --lv2-ink: #FFE6DF; --lv3: #FF7A5C; --lv3-ink: #0B0D2A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080A1A; --surface: #11142C; --sunk: #181C3A; --ink: #EDEEFF; --muted: #A6AACC;
  --line: #2A2F57; --strong-line: #EDEEFF; --control: #8D92B8; --inst: #8C94FF; --inst-soft: #1E2358;
  --part: #FF7A5C; --part-ink: #FF9A80; --part-soft: #3A1C1A; --signal: #CDFF4A; --on-signal: #0B0D2A;
  --violet: #AE90FF; --hero-bg: #1C23C4; --hero-ink: #FFFFFF; --hero-muted: #C9CCFF; --focus: #CDFF4A; --lv0: #8C94FF; --lv0-ink: #080A1A; --lv1: #343C8C; --lv1-ink: #EDEEFF; --lv2: #5C2B22; --lv2-ink: #FFE6DF; --lv3: #FF7A5C; --lv3-ink: #0B0D2A;
  color-scheme: dark;
}

@layer base, layout, components, utilities;

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 400 var(--s-1)/1.55 var(--f-body);
    text-rendering: optimizeLegibility;
  }
  h1, h2, h3 { font-family: var(--f-display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
  h1 { font-size: var(--s-5); font-weight: 900; }
  h2 { font-size: var(--s-4); font-weight: 700; }
  h3 { font-size: var(--s-2); font-weight: 700; }
  p { margin: 0; max-width: 65ch; }
  a { color: var(--inst); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
  a:hover { color: var(--part-ink); }
  :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
  ::selection { background: var(--signal); color: var(--on-signal); }
  button, input, select, textarea { font: inherit; color: inherit; }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
}

@layer layout {
  .wrap {
    width: 100%; max-width: calc(var(--wrap) + 2 * 24px); margin-inline: auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  @media (min-width: 720px) { .wrap { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
  .stack { display: flex; flex-direction: column; gap: var(--gap, 1rem); }
  .row { display: flex; flex-wrap: wrap; gap: var(--gap, 0.75rem); align-items: center; }
  main { display: flex; flex-direction: column; gap: clamp(3rem, 7vw, 5rem); padding-block: 0 clamp(3rem, 7vw, 5rem); }
  .section { display: flex; flex-direction: column; gap: 1.5rem; }
  .split { display: grid; gap: 2rem; }
  @media (min-width: 900px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; align-items: start; } }
  .split > * { min-width: 0; }
}

@layer components {
  /* Header */
  .site-head { border-bottom: 2px solid var(--strong-line); background: var(--bg); position: relative; z-index: 10; }
  @media (min-width: 720px) and (min-height: 600px) { .site-head { position: sticky; top: env(safe-area-inset-top, 0px); } html { scroll-padding-top: 6rem; } }
  .site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.75rem; flex-wrap: wrap; }
  .mark { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font: 700 0.875rem/1 var(--f-display); letter-spacing: 0.02em; }
  .mark svg { flex: none; }
  .nav { display: flex; gap: 0.25rem; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.7rem; border-radius: 999px; text-decoration: none; color: var(--ink); font: 600 0.75rem/1 var(--f-mono); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
  @media (max-width: 719px) { .nav .hide-sm { display: none; } .site-head .wrap { padding-block: 0.6rem; } .nav { width: 100%; justify-content: space-between; } }
  .nav a:hover { background: var(--sunk); color: var(--ink); }
  .nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

  /* Hero */
  .hero { background: var(--hero-bg); color: var(--hero-ink); overflow: hidden; position: relative; }
  .hero .wrap { padding-block: clamp(2.5rem, 6vw, 5rem); display: grid; gap: 1.5rem; align-items: center; }
  @media (min-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; } }
  .hero h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
  .hero h1 .alt { color: var(--signal); display: block; }
  .hero p:not(.eyebrow) { color: var(--hero-muted); font-size: var(--s-2); max-width: 46ch; }
  .hero .eyebrow { color: var(--hero-ink); }
  .hero a:not(.btn) { color: var(--signal); }
  .hero :focus-visible { outline-color: var(--signal); }
  .notice.go :focus-visible { outline-color: var(--on-signal); }
  .hero-content { display: grid; gap: 1.25rem; min-width: 0; }
  .hero-art { min-width: 0; height: 9rem; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); }
  .hero-routes { display: block; width: 100%; height: 100%; }
  @media (min-width: 900px) { .hero-art { height: auto; aspect-ratio: 9 / 6; margin-inline: 0 -2rem; } }
  .hero.small .wrap { padding-block: clamp(2rem, 4vw, 3rem); }
  .hero.small h1 { font-size: clamp(1.875rem, 4.2vw, 3rem); }
  .hero.small .hero-art { height: 6rem; }
  @media (min-width: 900px) { .hero.small .hero-art { height: 13rem; aspect-ratio: auto; } }

  .eyebrow { font: 600 0.6875rem/1.3 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
  .lede { font-size: var(--s-2); color: var(--muted); }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; padding: 0 1.15rem;
    border: 2px solid var(--strong-line); border-radius: 999px; background: var(--surface); color: var(--ink);
    font: 700 0.9375rem/1 var(--f-body); text-decoration: none; cursor: pointer; transition: transform .12s ease, background .12s ease;
  }
  .btn:hover { transform: translateY(-1px); background: var(--sunk); color: var(--ink); }
  .btn:active { transform: translateY(0); }
  .btn.primary { background: var(--ink); color: var(--bg); }
  .btn.primary:hover { background: var(--inst); border-color: var(--inst); color: var(--bg); }
  .btn.signal { background: var(--signal); color: var(--on-signal); border-color: var(--signal); }
  .btn.signal:hover { background: var(--hero-ink); border-color: var(--hero-ink); color: var(--on-signal); }
  .btn.ghost { background: transparent; }
  .btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
  .hero .btn.ghost { color: var(--hero-ink); border-color: var(--hero-ink); }
  .hero .btn.ghost:hover { background: rgb(255 255 255 / 0.12); color: var(--hero-ink); }
  .status { font: 600 0.75rem/1.4 var(--f-mono); color: var(--muted); min-height: 1.4em; }

  /* Five-Minute Check */
  .check { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 2px solid var(--strong-line); counter-reset: chk; }
  .check li { counter-increment: chk; display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0.25rem 1rem; padding-block: 1rem; border-bottom: 1px solid var(--line); align-items: baseline; }
  .check li::before { content: counter(chk, decimal-leading-zero); font: 700 1.25rem/1 var(--f-display); color: var(--inst); grid-row: span 2; }
  .check .label { font: 600 0.6875rem/1.3 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .check .prompt { font-size: var(--s-2); font-weight: 600; line-height: 1.35; }

  /* Tool tiles */
  .tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
  .tool { position: relative; display: grid; gap: 0.75rem; align-content: start; padding: 1.5rem; border: 2px solid var(--strong-line); border-radius: var(--r); background: var(--surface); text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
  .tool h3 a { color: inherit; text-decoration: none; }
  .tool h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
  .tool:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
  .tool h3 a:focus-visible { outline: none; }
  .tool:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--tool-shadow, var(--inst)); color: var(--ink); }
  .tool h3 { font-size: var(--s-3); }
  .tool p { color: var(--muted); }
  .tool .go { font: 700 0.75rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }
  .tool.t-compare { --tool-shadow: var(--part); }
  .tool.t-framework { --tool-shadow: var(--violet); }

  /* Map vs landscape */
  .ml { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
  .ml > div { padding: 1.25rem 1.5rem; border-radius: var(--r); display: grid; gap: 0.75rem; align-content: start; }
  .ml .map { background: var(--inst-soft); }
  .ml .land { background: var(--part-soft); }
  .ml ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }

  /* Legend swatches for areas */
  .swatch { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; border: 1.5px solid var(--strong-line); background: var(--sw); flex: none; }
  [data-area="out"] { --sw: var(--inst); }
  [data-area="dec"] { --sw: var(--part); }
  [data-area="cap"] { --sw: var(--signal); }
  [data-area="chg"] { --sw: var(--violet); }

  /* Forms: segmented choices */
  fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
  legend { padding: 0; font: 700 var(--s-1)/1.3 var(--f-body); margin-bottom: 0.6rem; }
  .choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .choice { position: relative; }
  .choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
  .choice > span {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.5rem 1rem; border: 2px solid var(--control);
    border-radius: 999px; background: var(--surface); font-weight: 600; line-height: 1.2; transition: border-color .12s ease, background .12s ease;
  }
  .choice input:hover + span { border-color: var(--strong-line); }
  .choice input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .choice input:checked + span .swatch { border-color: var(--bg); }
  .choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
  .choice small { font: 600 0.6875rem/1 var(--f-mono); opacity: 0.75; }
  .hint-text { color: var(--muted); font-size: var(--s-0); }
  .field { display: grid; gap: 0.4rem; }
  .field label { font-weight: 700; }
  .input, textarea.input {
    width: 100%; min-height: 44px; padding: 0.6rem 0.85rem; border: 2px solid var(--control); border-radius: 10px; background: var(--surface); color: var(--ink);
  }
  .input:hover { border-color: var(--strong-line); }
  .input[aria-invalid="true"], fieldset[data-invalid] .choice > span { border-color: var(--part-ink); }
  .err { color: var(--part-ink); font-weight: 600; font-size: var(--s-0); }
  .err:empty { display: none; }
  textarea.input { min-height: 4.5rem; resize: vertical; line-height: 1.45; }

  /* Builder */
  .panel { background: var(--surface); border: 2px solid var(--strong-line); border-radius: var(--r); padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1.5rem; }
  .panel.sticky { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 5rem); }
  @media (max-width: 899px) { .panel.sticky { position: static; } }
  .result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 1.5rem; }
  .count { font: 900 var(--s-4)/1 var(--f-display); color: var(--inst); }
  .qgroup { display: grid; gap: 0.25rem; }
  .qgroup-head { display: flex; align-items: center; gap: 0.6rem; padding-block: 0.75rem 0.5rem; border-bottom: 2px solid var(--strong-line); }
  .qgroup-head h3 { font-size: var(--s-1); letter-spacing: 0.02em; }
  .qlist { list-style: none; margin: 0; padding: 0; display: grid; }
  .q { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.85rem; padding-block: 0.9rem; border-bottom: 1px solid var(--line); align-items: start; }
  .q input[type="checkbox"] { width: 24px; height: 24px; margin: 0.1rem 0 0; accent-color: var(--inst); cursor: pointer; }
  .q .body { display: grid; gap: 0.3rem; min-width: 0; }
  .q .text { font-weight: 600; font-size: var(--s-1); line-height: 1.4; }
  .q .meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; align-items: center; }
  .q .hint { color: var(--muted); font-size: var(--s-0); }
  .q.off .text, .q.off .hint { opacity: 0.45; text-decoration: line-through; text-decoration-thickness: 1px; }
  .ref { font: 600 0.6875rem/1 var(--f-mono); color: var(--muted); letter-spacing: 0.04em; }
  .tag { display: inline-flex; align-items: center; min-height: 1.4rem; padding: 0 0.5rem; border-radius: 999px; font: 700 0.625rem/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; background: var(--sunk); color: var(--ink); }
  .tag.new { background: var(--signal); color: var(--on-signal); }
  .tag.rec { background: var(--inst-soft); color: var(--ink); }
  .more { justify-self: start; margin-top: 0.5rem; }
  .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

  /* Framework */
  .legend { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
  .legend div { border-top: 2px solid var(--strong-line); padding-top: 0.6rem; display: grid; gap: 0.25rem; }
  .legend strong { font: 700 0.9375rem/1.2 var(--f-display); }
  .legend span { color: var(--muted); font-size: var(--s-0); }
  .area { display: grid; gap: 1.25rem; scroll-margin-top: 6rem; }
  .area-head { display: grid; gap: 0.5rem; }
  .area-head .row { --gap: 0.6rem; }
  .area-head h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
  .lenses { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
  .lens { border: 2px solid var(--strong-line); border-radius: var(--r); background: var(--surface); padding: 1.25rem 1.25rem 0.5rem; display: grid; gap: 0.25rem; align-content: start; }
  .lens h3 { font-size: var(--s-1); }
  .lens .lq { color: var(--muted); font-size: var(--s-0); }
  .lens .qlist .q { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .lens .q:last-child { border-bottom: 0; }
  .jump { display: flex; gap: 0.5rem; flex-wrap: wrap; }

  /* Compare */
  .steps-note { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); counter-reset: st; padding: 0; margin: 0; list-style: none; }
  .steps-note li { counter-increment: st; border-top: 2px solid var(--strong-line); padding-top: 0.6rem; display: grid; gap: 0.25rem; }
  .steps-note li::before { content: counter(st); font: 900 1.5rem/1 var(--f-display); color: var(--part); }
  .rate { display: grid; gap: 0.75rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
  .rate:first-of-type { border-top: 2px solid var(--strong-line); }
  .rate legend { display: grid; gap: 0.2rem; font-weight: 600; font-size: var(--s-2); line-height: 1.35; }
  .rate legend .label { font: 600 0.6875rem/1.3 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .scale { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
  .scale .choice > span { width: 100%; border-radius: 10px; justify-content: flex-start; }
  .lvl { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; font: 700 0.6875rem/1 var(--f-mono); background: var(--sunk); color: var(--ink); flex: none; }
  .choice input:checked + span .lvl { background: var(--signal); color: var(--on-signal); }
  .side-inst { --side: var(--inst); }
  .side-part { --side: var(--part); }
  .who { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; }
  .who::before { content: ""; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--side); border: 1.5px solid var(--strong-line); flex: none; }
  .who.part::before { border-radius: 2px; }
  .notice { padding: 1rem 1.25rem; border-radius: var(--r); background: var(--sunk); display: grid; gap: 0.75rem; }
  .notice.warn { background: var(--part-soft); }
  .notice.go { background: var(--signal); color: var(--on-signal); }
  .notice.go .btn { border-color: var(--on-signal); }

  .people { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
  .cmp { display: grid; gap: 1rem; }
  .cmp-item { border: 2px solid var(--strong-line); border-radius: var(--r); background: var(--surface); padding: 1.25rem; display: grid; gap: 1rem; }
  .cmp-item.flagged { border-color: var(--part); box-shadow: 6px 6px 0 var(--part); }
  .cmp-top { display: grid; gap: 0.35rem; }
  .cmp-top .prompt { font-weight: 700; font-size: var(--s-2); line-height: 1.35; }
  .flags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .flag { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 1.6rem; padding: 0 0.6rem; border-radius: 999px; font: 700 0.6875rem/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; background: var(--part); color: var(--on-signal); }
  .flag.inside { background: var(--ink); color: var(--bg); }
  .flag.ok { background: var(--sunk); color: var(--ink); }
  .flag svg { flex: none; }
  .answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
  .answer { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 0.25rem 1rem; align-items: start; padding-top: 0.6rem; border-top: 1px solid var(--line); }
  @media (max-width: 560px) { .answer { grid-template-columns: minmax(0, 1fr); } }
  .answer .rating { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
  .answer .note { color: var(--muted); grid-column: 2; }
  @media (max-width: 560px) { .answer .note { grid-column: 1; } }
  .meter { display: inline-flex; gap: 3px; }
  .meter i { width: 10px; height: 10px; border-radius: 2px; background: var(--line); }
  .meter i.on { background: var(--side, var(--ink)); }
  .agenda { counter-reset: ag; list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
  .agenda li { counter-increment: ag; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--on-signal); }
  .agenda li::before { content: counter(ag, decimal-leading-zero); font: 900 1.125rem/1.2 var(--f-display); }
  .agenda .why { font-size: var(--s-0); opacity: 0.8; }
  .codebox { font: 400 0.75rem/1.5 var(--f-mono); word-break: break-all; }
  details.box { border: 2px solid var(--strong-line); border-radius: var(--r); background: var(--surface); }
  details.box > summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; min-height: 44px; }
  details.box > summary::-webkit-details-marker { display: none; }
  details.box > summary::after { content: "+" / ""; font: 700 1.25rem/1 var(--f-display); }
  details.box[open] > summary::after { content: "–" / ""; }
  details.box > div { padding: 0 1.25rem 1.25rem; display: grid; gap: 0.75rem; }

  /* Prose pages */
  .prose { display: grid; gap: 1rem; max-width: 65ch; }
  .prose h2 { font-size: var(--s-3); margin-top: 1.5rem; }
  .credits { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); list-style: none; padding: 0; margin: 0; }
  .credits li { border-top: 2px solid var(--strong-line); padding-top: 0.6rem; display: grid; }
  .credits span { color: var(--muted); font-size: var(--s-0); }

  /* Footer */
  .site-foot { border-top: 2px solid var(--strong-line); }
  .site-foot .wrap { padding-block: 2rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; color: var(--muted); font-size: var(--s-0); }
  .site-foot p { max-width: 52ch; }
}

@layer components {
  .skip { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 50; padding: 0.75rem 1rem; border-radius: 10px; background: var(--signal); color: var(--on-signal); font-weight: 700; transform: translateY(-200%); }
  .skip:focus { transform: none; }
}

@layer utilities {
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .muted { color: var(--muted); }
  [data-print-only] { display: none; }
}


@layer components {
  /* Compare Maps: start, share, grid */
  .start { display: grid; gap: 1.5rem; }
  @media (min-width: 900px) { .start { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; } }
  .start .panel { gap: 1.25rem; }
  .sharebar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 1rem 1.25rem; border-radius: var(--r); background: var(--signal); color: var(--on-signal); }
  .sharebar .link { font: 700 clamp(0.9375rem, 2.6vw, 1.25rem)/1.2 var(--f-mono); word-break: break-all; flex: 1 1 14rem; min-width: 0; }
  .sharebar .btn { border-color: var(--on-signal); }
  .sharebar :focus-visible { outline-color: var(--on-signal); }
  .result-top { display: grid; gap: 1rem; }
  .preview-note { font: 600 0.75rem/1.4 var(--f-mono); padding: 0.6rem 0.85rem; border-radius: 10px; background: var(--sunk); justify-self: start; }

  .legend-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; font-size: var(--s-0); }
  .legend-row .key { display: inline-flex; align-items: center; gap: 0.4rem; }
  .chip { display: inline-grid; place-items: center; min-width: 2.25rem; height: 1.5rem; padding: 0 0.4rem; border-radius: 6px; font: 700 0.625rem/1 var(--f-mono); letter-spacing: 0.04em; text-transform: uppercase; }
  .lv0 { background: var(--lv0); color: var(--lv0-ink); }
  .lv1 { background: var(--lv1); color: var(--lv1-ink); }
  .lv2 { background: var(--lv2); color: var(--lv2-ink); }
  .lv3 { background: var(--lv3); color: var(--lv3-ink); }

  .stack > *, .section > * { min-width: 0; max-width: 100%; }
  .grid-wrap { position: relative; width: 100%; overflow-x: auto; border: 2px solid var(--strong-line); border-radius: var(--r); background: var(--surface); }
  .grid-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
  .mapgrid { border-collapse: separate; border-spacing: 4px; width: 100%; font-size: var(--s-0); min-width: calc(15rem + var(--n, 4) * 7rem + 9rem); }
  .mapgrid th, .mapgrid td { text-align: left; vertical-align: middle; }
  .mapgrid thead th { padding: 0.5rem 0.4rem; font-weight: 700; vertical-align: bottom; }
  .mapgrid .group th { font: 700 0.6875rem/1.2 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; text-align: center; border-bottom: 3px solid var(--side); padding-bottom: 0.4rem; }
  .mapgrid .person { min-width: 6.5rem; max-width: 9rem; text-align: center; line-height: 1.25; }
  .mapgrid .person .you { display: block; font: 700 0.625rem/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
  .mapgrid .rowhead { position: sticky; left: 0; z-index: 1; background: var(--surface); padding: 0.6rem 0.75rem 0.6rem 0.5rem; min-width: 15rem; max-width: 22rem; font-weight: 400; }
  .mapgrid thead .rowhead { z-index: 2; }
  .mapgrid .rowhead .label { display: block; font: 600 0.625rem/1.4 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .mapgrid .rowhead .prompt { display: block; font-weight: 600; line-height: 1.3; }
  .mapgrid tr.flagged .rowhead .prompt::after { content: " ▲" / ""; color: var(--part-ink); font-size: 0.75em; }
  .mapgrid td.cell { position: relative; border-radius: 8px; text-align: center; height: 3.25rem; padding: 0.35rem; font: 700 0.6875rem/1.15 var(--f-mono); letter-spacing: 0.03em; text-transform: uppercase; }
  .mapgrid td.cell.noted { box-shadow: inset 0 -4px 0 currentColor; }
  .mapgrid td.status { padding-left: 0.5rem; min-width: 9rem; }
  .mapgrid td.status .flags { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .mapgrid tbody tr + tr .rowhead { border-top: 1px solid var(--line); }
  .grid-foot { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; color: var(--muted); font-size: var(--s-0); }

  .detail { border: 2px solid var(--strong-line); border-radius: var(--r); background: var(--surface); }
  .detail.flagged { border-color: var(--part); }
  .detail > summary { cursor: pointer; list-style: none; padding: 1rem 1.25rem; display: grid; gap: 0.35rem; min-height: 44px; }
  .detail > summary::-webkit-details-marker { display: none; }
  .detail > summary .row { justify-content: space-between; }
  .detail > summary .prompt { font-weight: 700; font-size: var(--s-2); line-height: 1.35; }
  .detail > summary::after { content: "Show answers" / ""; font: 700 0.6875rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
  .detail[open] > summary::after { content: "Hide answers" / ""; }
  .detail > .answers { padding: 0 1.25rem 1.25rem; }
  .answer .rating .chip { min-width: 5.5rem; }
  @media (max-width: 640px) {
    .mapgrid { min-width: calc(6.75rem + var(--n, 4) * 5rem + 7.5rem); border-spacing: 3px; }
    .mapgrid .rowhead { min-width: 6.75rem; max-width: 6.75rem; padding: 0.4rem 0.4rem 0.4rem 0.25rem; }
    .mapgrid .rowhead .label { font-size: 0.6875rem; color: var(--ink); letter-spacing: 0.04em; }
    .mapgrid tbody .rowhead .prompt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .mapgrid .person { min-width: 5rem; max-width: 6rem; font-size: 0.75rem; }
    .mapgrid td.cell { height: 2.75rem; font-size: 0.625rem; }
    .mapgrid td.status { min-width: 7.5rem; }
    .mapgrid tr.flagged .rowhead .label::after { content: " ▲" / ""; color: var(--part-ink); }
  }
}

@media print {
  .grid-wrap { overflow: visible; border-width: 1px; }
  .mapgrid td.cell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mapgrid .rowhead { position: static; }
  .sharebar .btn, .detail > summary::after { display: none; }
  .detail { break-inside: avoid; }
}

/* Unlayered on purpose: embeds and host pages can ship their own unlayered body reset,
   which would beat anything inside @layer. These must win in every context. */
html body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--s-1)/1.55 var(--f-body); }

@media print {
  :root { --bg: #FFFFFF; --surface: #FFFFFF; --ink: #000000; --muted: #333333; --line: #BBBBBB; --strong-line: #000000; }
  .site-head, .site-foot, .hero-routes, .no-print, .actions, .more, .panel.controls, nav { display: none !important; }
  .hero { background: none; color: #000000; }
  .hero h1 .alt, .hero p, .hero .eyebrow { color: #000000; }
  .q.off { display: none; }
  .q input[type="checkbox"] { display: none; }
  .q { grid-template-columns: minmax(0, 1fr); break-inside: avoid; }
  .cmp-item { box-shadow: none !important; break-inside: avoid; }
  [data-print-only] { display: block; }
  main { gap: 1.5rem; }
}

/* Hero route motion: the partner route's dashes travel toward the destination. */
.hero-routes .route.part { animation: march 4s linear 1; }
@keyframes march { to { stroke-dashoffset: -96; } }

main:focus { outline: none; }
