@import url("fonts.css");

/* Layout concept: a research dossier. Persistent chapter rail on the left, a ~68ch reading
   column with full-width figures and tables, an on-page contents rail on the right.
   Fjord-petrol ink on cool paper; lingonberry red is the single accent. */
:root {
  /* palette */
  --bg: #f2f5f5;
  --surface: #fbfcfc;
  --surface-2: #e8eeee;
  --ink: #0f1e21;
  --ink-2: #3b4a4e;
  --muted: #5a6a6e;
  --rule: #d3dcdd;
  --rule-strong: #a9b7b9;
  --accent: #a61e3c;
  --accent-ink: #ffffff;
  --accent-wash: #f6e3e7;
  --fjord: #0b5566;
  --fjord-wash: #dcecef;
  --focus: #0b5566;

  /* semantic status (fixed hues, always paired with icon + label) */
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --warning-text: #7a5200;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #b42323;
  --good-wash: rgba(12, 163, 12, 0.10);
  --warning-wash: rgba(250, 178, 25, 0.16);
  --serious-wash: rgba(236, 131, 90, 0.18);
  --critical-wash: rgba(208, 59, 59, 0.12);

  /* chart palette (validated: dataviz reference categorical, light) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
  --series-dim: #c3c9ca;
  --chart-grid: #e1e6e7;
  --chart-axis: #b9c3c5;

  /* sequential heat (scores 1-5) */
  --heat-1: #e3eefb; --heat-1-ink: #0f1e21;
  --heat-2: #b7d3f6; --heat-2-ink: #0f1e21;
  --heat-3: #6da7ec; --heat-3-ink: #0f1e21;
  --heat-4: #276fc7; --heat-4-ink: #ffffff;
  --heat-5: #184f95; --heat-5-ink: #ffffff;

  /* type */
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-body: "Source Serif 4", "Iowan Old Style", Charter, Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* type scale (1.25) */
  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: 1.25rem;
  --t-lg: 1.5625rem;
  --t-xl: 1.953rem;
  --t-2xl: 2.441rem;
  --t-3xl: 3.2rem;

  /* spacing */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;

  --radius: 3px;
  --measure: 68ch;
  --sidebar-w: 17.5rem;
  --toc-w: 14rem;
  --main-max: 64rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1315; --surface: #111c1f; --surface-2: #182629;
    --ink: #e6eded; --ink-2: #b1c0c2; --muted: #8a9da1;
    --rule: #24363a; --rule-strong: #3a5054;
    --accent: #f2687f; --accent-ink: #1a0a0e; --accent-wash: #3b1820;
    --fjord: #6cc4d4; --fjord-wash: #12313a; --focus: #6cc4d4;
    --good-text: #3fc43f; --warning-text: #fab219; --critical-text: #ff7b7b;
    --good-wash: rgba(12, 163, 12, 0.16); --warning-wash: rgba(250, 178, 25, 0.14);
    --serious-wash: rgba(236, 131, 90, 0.16); --critical-wash: rgba(208, 59, 59, 0.20);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --series-dim: #3a4b4f; --chart-grid: #1f2f33; --chart-axis: #34494d;
    --heat-1: #15283a; --heat-1-ink: #e6eded;
    --heat-2: #1c3f66; --heat-2-ink: #e6eded;
    --heat-3: #1f5fa8; --heat-3-ink: #ffffff;
    --heat-4: #3987e5; --heat-4-ink: #0b1315;
    --heat-5: #86b6ef; --heat-5-ink: #0b1315;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1315; --surface: #111c1f; --surface-2: #182629;
  --ink: #e6eded; --ink-2: #b1c0c2; --muted: #8a9da1;
  --rule: #24363a; --rule-strong: #3a5054;
  --accent: #f2687f; --accent-ink: #1a0a0e; --accent-wash: #3b1820;
  --fjord: #6cc4d4; --fjord-wash: #12313a; --focus: #6cc4d4;
  --good-text: #3fc43f; --warning-text: #fab219; --critical-text: #ff7b7b;
  --good-wash: rgba(12, 163, 12, 0.16); --warning-wash: rgba(250, 178, 25, 0.14);
  --serious-wash: rgba(236, 131, 90, 0.16); --critical-wash: rgba(208, 59, 59, 0.20);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --series-dim: #3a4b4f; --chart-grid: #1f2f33; --chart-axis: #34494d;
  --heat-1: #15283a; --heat-1-ink: #e6eded;
  --heat-2: #1c3f66; --heat-2-ink: #e6eded;
  --heat-3: #1f5fa8; --heat-3-ink: #ffffff;
  --heat-4: #3987e5; --heat-4-ink: #0b1315;
  --heat-5: #86b6ef; --heat-5-ink: #0b1315;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--fjord); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent-wash); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); text-wrap: balance; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, var(--t-3xl)); font-weight: 750; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 0.9vw, var(--t-xl)); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: var(--t-md); font-weight: 650; letter-spacing: -0.005em; }
h4 { font-size: var(--t-base); font-weight: 650; }
p, ul, ol, dl, blockquote { margin: 0; }
strong, b { font-weight: 650; }
small { font-size: var(--t-sm); }
code, kbd { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-2); padding: 0.08em 0.35em; border-radius: 2px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-6) 0; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.2em; cursor: help; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  min-height: 100vh;
}
.main {
  min-width: 0;
  padding-block: var(--s-7) var(--s-9);
  padding-left: max(var(--s-6), env(safe-area-inset-left, 0px));
  padding-right: max(var(--s-6), env(safe-area-inset-right, 0px));
}
.main > * { max-width: var(--main-max); margin-inline: auto; }

/* sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--rule);
  background: var(--surface);
  padding: var(--s-6) var(--s-5) var(--s-6);
  padding-left: max(var(--s-5), env(safe-area-inset-left, 0px));
  font-family: var(--font-ui);
  display: flex; flex-direction: column; gap: var(--s-5);
}
.brand { display: grid; gap: var(--s-1); text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { display: flex; align-items: center; gap: var(--s-2); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.1; }
.brand-mark svg { flex: none; width: 28px; height: 28px; }
.brand-sub { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.nav-group { display: grid; gap: 2px; }
.nav-group-label { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 var(--s-2) var(--s-1); }
.nav-link {
  display: grid; grid-template-columns: 1.9rem 1fr; align-items: baseline; gap: var(--s-1);
  padding: 0.38rem var(--s-2); border-radius: var(--radius);
  color: var(--ink-2); text-decoration: none; font-size: 0.9375rem; line-height: 1.3;
}
.nav-link .n { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--fjord-wash); color: var(--ink); font-weight: 650; }
.nav-link[aria-current="page"] .n { color: var(--accent); }
.sidebar-foot { margin-top: auto; display: grid; gap: var(--s-3); font-size: var(--t-xs); color: var(--muted); }
.theme-switch { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; width: max-content; }
.theme-switch button { font: 500 0.75rem/1 var(--font-ui); padding: 0.45rem 0.6rem; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.theme-switch button + button { border-left: 1px solid var(--rule); }
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* on-page toc */
.toc {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: var(--s-7) var(--s-5) var(--s-6) 0;
  padding-right: max(var(--s-5), env(safe-area-inset-right, 0px));
  font-family: var(--font-ui); font-size: 0.8125rem;
}
.toc-label { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-2); }
.toc ol { list-style: none; padding: 0; display: grid; gap: 1px; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 0.3rem 0 0.3rem var(--s-3); margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.active { border-left-color: var(--accent); color: var(--ink); font-weight: 600; }

/* mobile top bar */
.topbar { display: none; }
.scrim { display: none; }

@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  html { scroll-padding-top: 4.5rem; }
  .shell { display: block; }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding-block: var(--s-3);
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    font-family: var(--font-ui);
  }
  .topbar .brand-mark { font-size: 1rem; }
  .topbar button { font: 600 0.875rem/1 var(--font-ui); padding: 0.55rem 0.8rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
  .sidebar {
    position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(20rem, 86vw); height: auto;
    padding-top: calc(var(--s-5) + env(safe-area-inset-top, 0px));
    transform: translateX(-102%); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform 0.22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.2); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(5, 12, 14, 0.45); }
  .main { padding-block: var(--s-6) var(--s-8); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}

/* ---------- chapter head ---------- */
.chapter-head { display: grid; gap: var(--s-4); padding-bottom: var(--s-6); border-bottom: 1px solid var(--rule); margin-bottom: var(--s-6); }
.eyebrow { font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; }
.eyebrow .chap { color: var(--accent); font-weight: 600; }
.lede { font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: var(--measure); }
.meta-row { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: center; font-family: var(--font-ui); font-size: var(--t-sm); color: var(--muted); }
.lenses { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.lens { display: inline-flex; align-items: center; gap: 0.4em; font: 500 0.75rem/1 var(--font-ui); padding: 0.35rem 0.6rem 0.35rem 0.5rem; border: 1px solid var(--rule); border-radius: 99px; color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.lens::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--lens, var(--muted)); }
.lens--strategy { --lens: var(--accent); }
.lens--product { --lens: var(--series-1); }
.lens--tech { --lens: var(--series-7); }
.lens--legal { --lens: var(--series-2); }
.lens--finance { --lens: var(--series-3); }
.lens--ops { --lens: var(--series-4); }

/* ---------- body flow ---------- */
.body { display: grid; gap: var(--s-8); }
.body > section { display: grid; gap: var(--s-5); scroll-margin-top: var(--s-6); }
.body > section > * { min-width: 0; }
.prose, .body > section > p, .body > section > ul:not(.flow), .body > section > ol:not(.flow):not(.timeline), .body section > h3 + p { max-width: var(--measure); }
.body > section > p + p, .subsection > p + p { margin-top: calc(-1 * var(--s-2)); }
.sec-head { display: grid; gap: var(--s-2); }
.sec-num { font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: 0.08em; color: var(--accent); text-transform: uppercase; }
.body ul, .body ol { padding-left: 1.25em; display: grid; gap: var(--s-2); }
.body li::marker { color: var(--muted); }
.subsection { display: grid; gap: var(--s-4); }
.subsection > * { min-width: 0; }
.subsection > p, .subsection > ul, .subsection > ol { max-width: var(--measure); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: var(--s-5); }
.two-col > * { min-width: 0; }
.note { font-family: var(--font-ui); font-size: var(--t-sm); color: var(--muted); }
.kicker { font-family: var(--font-ui); font-weight: 600; color: var(--ink); }

/* key takeaways */
.keypoints { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-5) var(--s-6); display: grid; gap: var(--s-4); margin-bottom: var(--s-7); }
.keypoints h2 { font-size: var(--t-xs); font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.keypoints ol, .keypoints ul { list-style: none; padding: 0; display: grid; gap: var(--s-3); counter-reset: kp; }
.keypoints li { position: relative; padding-left: 2.5rem; counter-increment: kp; line-height: 1.5; }
.keypoints li::before { content: counter(kp, decimal-leading-zero); position: absolute; left: 0; top: 0.2em; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.keypoints li strong { font-family: var(--font-ui); }
@media (max-width: 600px) { .keypoints { padding: var(--s-4); } }

/* callouts: tinted panel + mono label, no side rail */
.callout { background: var(--cw, var(--surface-2)); border-radius: var(--radius); padding: var(--s-4) var(--s-5); display: grid; gap: var(--s-2); max-width: var(--measure); }
.callout > * { min-width: 0; }
.callout-label { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cl, var(--ink-2)); display: flex; align-items: center; gap: 0.45em; }
.callout-label::before { content: var(--ci, "■"); font-size: 0.85rem; line-height: 1; }
.callout p { font-size: 0.98rem; }
.callout ul { padding-left: 1.1em; display: grid; gap: var(--s-1); font-size: 0.98rem; }
.callout--insight { --cw: var(--fjord-wash); --cl: var(--fjord); --ci: "◆"; }
.callout--opportunity { --cw: var(--good-wash); --cl: var(--good-text); --ci: "▲"; }
.callout--risk { --cw: var(--critical-wash); --cl: var(--critical-text); --ci: "!"; }
.callout--decision { --cw: var(--accent-wash); --cl: var(--accent); --ci: "→"; }
.callout--term { --cw: var(--surface-2); --cl: var(--ink-2); --ci: "Æ"; }
.callout--wide { max-width: none; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: var(--s-4) var(--s-4) var(--s-4); display: grid; gap: var(--s-1); align-content: start; font-family: var(--font-ui); }
.stat-label { font-size: 0.8125rem; color: var(--muted); line-height: 1.3; }
.stat-value { font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.stat-value .unit { font-size: 0.55em; font-weight: 600; color: var(--ink-2); margin-left: 0.15em; letter-spacing: 0; }
.stat-note { font-size: 0.78rem; color: var(--ink-2); line-height: 1.35; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.875rem; line-height: 1.4; }
table.data caption { caption-side: top; text-align: left; padding: var(--s-3) var(--s-4); font-weight: 650; font-size: 0.9375rem; color: var(--ink); border-bottom: 1px solid var(--rule); }
table.data th, table.data td { padding: 0.6rem 0.85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
table.data thead th { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data tbody tr:hover > * { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.data tbody th { font-weight: 650; color: var(--ink); }
/* Numerals: never use tabular-nums with Schibsted Grotesk. Its tnum feature also sets the comma and full stop to figure
   width, so "5,570" renders as "5 , 570". Its default proportional figures read normally in tables, charts and tips. */
table.data .num, table.data td.num, table.data th.num { text-align: right; font-variant-numeric: normal; white-space: nowrap; }
table.data .center { text-align: center; }
table.data tr.group > * { background: var(--surface-2); font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding-block: 0.4rem; }
table.data tr.highlight > * { background: var(--accent-wash); }
table.data--compact th, table.data--compact td { padding: 0.4rem 0.6rem; }
table.data--wide { min-width: 46rem; }
table.data--xwide { min-width: 68rem; }
.table-foot { font-family: var(--font-ui); font-size: 0.78rem; color: var(--muted); padding: var(--s-2) var(--s-4) var(--s-3); border-top: 1px solid var(--rule); background: var(--surface); }

/* score heat cells */
td.heat, th.heat { text-align: center; font-weight: 650; min-width: 2.6rem; }
.h1 { background: var(--heat-1) !important; color: var(--heat-1-ink); }
.h2 { background: var(--heat-2) !important; color: var(--heat-2-ink); }
.h3 { background: var(--heat-3) !important; color: var(--heat-3-ink); }
.h4 { background: var(--heat-4) !important; color: var(--heat-4-ink); }
.h5 { background: var(--heat-5) !important; color: var(--heat-5-ink); }
.heat-legend { display: inline-flex; align-items: center; gap: 2px; font-family: var(--font-ui); font-size: 0.75rem; color: var(--muted); }
.heat-legend span { width: 1.6rem; height: 0.8rem; display: inline-block; }
.heat-legend b { font-weight: 500; margin: 0 0.4rem; }

/* dot score (1-5) */
.score { display: inline-flex; gap: 3px; vertical-align: middle; }
.score i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--rule); display: block; }
.score.s1 i:nth-child(-n+1), .score.s2 i:nth-child(-n+2), .score.s3 i:nth-child(-n+3), .score.s4 i:nth-child(-n+4), .score.s5 i:nth-child(-n+5) { background: var(--fjord); }

/* status pills: icon + label, never colour alone */
.pill { display: inline-flex; align-items: center; gap: 0.35em; font: 600 0.75rem/1 var(--font-ui); padding: 0.28rem 0.5rem; border-radius: 99px; white-space: nowrap; background: var(--pw, var(--surface-2)); color: var(--pc, var(--ink-2)); }
.pill::before { content: var(--pi, "•"); font-weight: 700; }
.pill--yes, .pill--good { --pw: var(--good-wash); --pc: var(--good-text); --pi: "✓"; }
.pill--partial, .pill--warn { --pw: var(--warning-wash); --pc: var(--warning-text); --pi: "◐"; }
.pill--no, .pill--bad { --pw: var(--critical-wash); --pc: var(--critical-text); --pi: "✕"; }
.pill--unknown { --pi: "?"; }
.pill--high { --pw: var(--critical-wash); --pc: var(--critical-text); --pi: "▲"; }
.pill--med { --pw: var(--warning-wash); --pc: var(--warning-text); --pi: "■"; }
.pill--low { --pw: var(--good-wash); --pc: var(--good-text); --pi: "▼"; }
.pill--plain { --pi: ""; }
.pill--plain::before { display: none; }

/* figures */
.fig { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-5); display: grid; gap: var(--s-3); align-content: start; min-width: 0; }
.fig-title { font-family: var(--font-display); font-weight: 650; font-size: 1.0625rem; line-height: 1.3; color: var(--ink); }
.fig-sub { font-family: var(--font-ui); font-size: 0.8125rem; color: var(--muted); margin-top: calc(-1 * var(--s-2)); }
.fig figcaption, .fig .fig-caption { font-family: var(--font-ui); font-size: 0.8125rem; line-height: 1.45; color: var(--ink-2); }
.fig figcaption .src, .fig .src { color: var(--muted); }
.fig .diagram { overflow-x: auto; }
.fig .diagram svg { display: block; width: 100%; height: auto; min-width: var(--diagram-min, 0); }
.fig svg text { font-family: var(--font-ui); }
.fig--bare { background: transparent; border: 0; padding: 0; }
@media (max-width: 600px) { .fig { padding: var(--s-4); } }

/* svg diagram helper classes (use inside inline svg) */
.dg-box { fill: var(--surface); stroke: var(--rule-strong); stroke-width: 1.25; }
.dg-box--accent { fill: var(--accent-wash); stroke: var(--accent); }
.dg-box--fjord { fill: var(--fjord-wash); stroke: var(--fjord); }
.dg-box--muted { fill: var(--surface-2); stroke: var(--rule); }
.dg-box--dashed { fill: none; stroke: var(--rule-strong); stroke-dasharray: 5 4; }
.dg-line { stroke: var(--ink-2); stroke-width: 1.4; fill: none; }
.dg-line--accent { stroke: var(--accent); stroke-width: 2; fill: none; }
.dg-line--fjord { stroke: var(--fjord); stroke-width: 1.6; fill: none; }
.dg-line--dashed { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; fill: none; }
.dg-arrowhead { fill: var(--ink-2); }
.dg-arrowhead--accent { fill: var(--accent); }
.dg-arrowhead--fjord { fill: var(--fjord); }
.dg-text { fill: var(--ink); font-size: 13px; font-family: var(--font-ui); }
.dg-text--strong { fill: var(--ink); font-size: 13.5px; font-weight: 650; font-family: var(--font-ui); }
.dg-text--muted { fill: var(--muted); font-size: 11.5px; font-family: var(--font-ui); }
.dg-text--label { fill: var(--ink-2); font-size: 11px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.dg-text--accent { fill: var(--accent); font-size: 12px; font-weight: 600; font-family: var(--font-ui); }
.dg-text--fjord { fill: var(--fjord); font-size: 12px; font-weight: 600; font-family: var(--font-ui); }
.dg-text--invert { fill: var(--bg); font-size: 12.5px; font-weight: 650; font-family: var(--font-ui); }
.dg-fill-ink { fill: var(--ink); }
.dg-fill-accent { fill: var(--accent); }
.dg-fill-fjord { fill: var(--fjord); }
.dg-fill-surface { fill: var(--surface); }
.dg-fill-bg { fill: var(--bg); }
.dg-zone { fill: var(--surface-2); stroke: none; }
.dg-zone--accent { fill: var(--accent-wash); stroke: none; }
.dg-zone--fjord { fill: var(--fjord-wash); stroke: none; }

/* JS charts */
.chart { display: grid; gap: var(--s-3); min-width: 0; }
.chart-canvas { position: relative; min-width: 0; }
.chart-canvas svg { display: block; overflow: visible; }
.chart .chart-legend, .chart-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-family: var(--font-ui); font-size: 0.8125rem; color: var(--ink-2); list-style: none; padding: 0; }
.chart .chart-legend li { display: inline-flex; align-items: center; gap: 0.45em; }
.chart-legend .key { width: 0.8rem; height: 0.8rem; border-radius: 2px; display: inline-block; }
.chart-legend .key--line { height: 2px; width: 1rem; border-radius: 1px; }
.chart-table { font-family: var(--font-ui); font-size: 0.8125rem; }
.chart-table > summary { cursor: pointer; color: var(--muted); width: max-content; max-width: 100%; list-style: none; display: flex; gap: 0.5rem; align-items: baseline; border-radius: 2px; }
.chart-table > summary:hover { color: var(--ink); }
.chart-table .table-wrap { margin-top: var(--s-2); }
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 9rem; max-width: 18rem;
  background: var(--ink); color: var(--bg); border-radius: var(--radius);
  padding: 0.5rem 0.65rem; font: 0.8125rem/1.35 var(--font-ui);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.chart-tip .tv { font-weight: 700; font-size: 0.95rem; }
.chart-tip .tl { opacity: 0.8; }
.chart-tip .row { display: flex; align-items: center; gap: 0.45rem; }
.chart-tip .lk { width: 0.85rem; height: 2px; flex: none; }
.chart-canvas text { font-family: var(--font-ui); }
.c-text, .c-label { fill: var(--ink-2); font-size: 12px; }
.c-tick { fill: var(--muted); font-size: 11px; }
.c-value { fill: var(--ink); font-size: 12px; font-weight: 600; }
.c-inlabel { fill: #ffffff; font-size: 11px; font-weight: 600; }
.c-inlabel--dark { fill: #0f1e21; }
.c-axis { fill: var(--muted); font-size: 11.5px; font-weight: 500; }
.c-quad { fill: var(--muted); font-size: 11px; font-family: var(--font-mono) !important; letter-spacing: 0.04em; text-transform: uppercase; }
.c-quad--hi { fill: var(--fjord); font-weight: 600; }
.c-plabel { fill: var(--ink); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.c-chip { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--font-mono) !important; }
.c-mark { cursor: default; transition: opacity 0.12s; }
.c-mark:focus { outline: none; }
.c-mark:focus-visible { stroke: var(--focus); stroke-width: 2px; }
.chart-canvas[data-hovering] .c-mark:not(.is-hot) { opacity: 0.55; }

/* process flow (HTML) */
.flow { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--s-3) !important; counter-reset: flow; }
.flow > li { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-4); display: block; counter-increment: flow; font-family: var(--font-ui); font-size: 0.875rem; line-height: 1.45; color: var(--ink-2); }
.flow > li::before { content: counter(flow, decimal-leading-zero); display: block; margin-bottom: var(--s-2); font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.flow > li strong { color: var(--ink); font-size: 0.9375rem; }
.flow > li > strong:first-child { display: block; margin-bottom: var(--s-1); }
.flow .dur { display: block; margin-top: var(--s-2); font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

/* timeline */
.timeline { list-style: none; padding: 0 !important; display: grid; gap: 0 !important; border-left: 1px solid var(--rule-strong); margin-left: 0.4rem; }
.timeline > li { position: relative; padding: 0 0 var(--s-5) var(--s-5); display: block; }
.timeline .when, .timeline .what, .timeline .why { display: block; }
.timeline .what { margin-top: var(--s-1); }
.timeline .why { margin-top: var(--s-1); }
.timeline > li::before { content: ""; position: absolute; left: -0.36rem; top: 0.45rem; width: 0.62rem; height: 0.62rem; border-radius: 50%; background: var(--bg); border: 2px solid var(--fjord); }
.timeline > li.key::before { background: var(--accent); border-color: var(--accent); }
.timeline > li.future::before { border-style: dashed; border-color: var(--muted); }
.timeline .when { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--muted); }
.timeline .what { font-family: var(--font-ui); font-weight: 650; color: var(--ink); line-height: 1.35; }
.timeline .why { font-size: 0.95rem; color: var(--ink-2); max-width: var(--measure); }

/* gantt (CSS grid, months) */
.gantt { --months: 36; display: grid; gap: 6px; font-family: var(--font-ui); font-size: 0.8125rem; min-width: 40rem; }
.gantt-scale, .gantt-row { display: grid; grid-template-columns: 13rem 1fr; gap: var(--s-3); align-items: center; }
.gantt-ticks { position: relative; height: 1.2rem; display: grid; grid-template-columns: repeat(var(--months), 1fr); font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); border-bottom: 1px solid var(--rule); }
.gantt-ticks span { border-left: 1px solid var(--rule); padding-left: 3px; }
.gantt-track { position: relative; height: 1.5rem; display: grid; grid-template-columns: repeat(var(--months), 1fr); background: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / var(--months) * 6 - 1px), var(--chart-grid) calc(100% / var(--months) * 6 - 1px), var(--chart-grid) calc(100% / var(--months) * 6)); }
.gantt-bar { grid-column: var(--s) / var(--e); height: 100%; border-radius: 3px; background: var(--gb, var(--series-1)); display: flex; align-items: center; padding: 0 0.45rem; color: #fff; font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; }
.gantt-bar.ms { background: transparent; color: var(--ink); padding: 0; overflow: visible; }
.gantt-bar.ms::before { content: "◆"; color: var(--accent); margin-right: 0.3rem; font-size: 0.9rem; }
.gantt-label { color: var(--ink); font-weight: 600; line-height: 1.25; }
.gantt-label small { display: block; color: var(--muted); font-weight: 400; font-size: 0.72rem; }
.gantt-group { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: var(--s-2); }
.gb-1 { --gb: var(--series-1); } .gb-2 { --gb: var(--series-2); } .gb-3 { --gb: var(--series-3); } .gb-4 { --gb: var(--series-4); }
.gb-5 { --gb: var(--series-5); } .gb-6 { --gb: var(--series-6); } .gb-7 { --gb: var(--series-7); } .gb-accent { --gb: var(--accent); }

/* option / route cards (use sparingly) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--s-4); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-5); display: grid; gap: var(--s-3); align-content: start; min-width: 0; }
.card h3 { font-size: 1.0625rem; }
.card p, .card li { font-size: 0.95rem; color: var(--ink-2); }
.card ul { padding-left: 1.1em; display: grid; gap: var(--s-1); }
.card .card-tag { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card--recommended { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.card--recommended .card-tag { color: var(--accent); }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-3); font-family: var(--font-ui); font-size: 0.8125rem; }
.card dt { color: var(--muted); }
.card dd { margin: 0; color: var(--ink); font-weight: 600; }

/* pros / cons */
.procon { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--s-4); }
.procon > div { min-width: 0; display: grid; gap: var(--s-2); align-content: start; }
.procon h4 { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; }
.procon .pro h4 { color: var(--good-text); }
.procon .con h4 { color: var(--critical-text); }
.procon ul { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.procon li { padding-left: 1.3em; position: relative; font-size: 0.95rem; }
.procon .pro li::before { content: "+"; position: absolute; left: 0; color: var(--good-text); font-weight: 700; font-family: var(--font-mono); }
.procon .con li::before { content: "−"; position: absolute; left: 0; color: var(--critical-text); font-weight: 700; font-family: var(--font-mono); }

/* ---------- collapsible detail: details.deep (the report's one collapse component; style guide 11.7) ----------
   Markup: <details class="deep"><summary>Title <span class="hint">3 min</span></summary><div class="deep-body">…</div></details>
   Summary = plain text plus one optional .hint. Body children: p, ul/ol, h3, .table-wrap, .fig, .code, .callout.
   The only other disclosure is details.chart-table, which charts.js generates; it shares the marker below. */
details.deep { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); max-width: 100%; min-width: 0; }
details.deep > summary {
  cursor: pointer; list-style: none; padding: var(--s-3) var(--s-4); border-radius: var(--radius);
  font-family: var(--font-ui); font-weight: 600; line-height: 1.4; color: var(--ink);
  display: grid; grid-template-columns: 1ch minmax(0, 1fr) auto; column-gap: var(--s-3); align-items: baseline;
}
details.deep > summary::-webkit-details-marker, .chart-table > summary::-webkit-details-marker { display: none; }
details.deep > summary::before, .chart-table > summary::before { content: "+"; font-family: var(--font-mono); font-weight: 600; color: var(--accent); }
details.deep[open] > summary::before, .chart-table[open] > summary::before { content: "\2212"; }
details.deep > summary:hover { background: var(--surface-2); }
details.deep > summary:focus-visible, .chart-table > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
details.deep[open] > summary { border-bottom: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0; }
details.deep > summary .hint { font-weight: 400; color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }
details.deep > .deep-body { padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 1ch + var(--s-3)); display: grid; gap: var(--s-3); min-width: 0; }
details.deep > .deep-body > * { max-width: var(--measure); min-width: 0; margin: 0; }
details.deep > .deep-body > .table-wrap, details.deep > .deep-body > .fig, details.deep > .deep-body > .code { max-width: none; }
@media (max-width: 600px) {
  details.deep > summary { grid-template-columns: 1ch minmax(0, 1fr); padding: var(--s-3); }
  details.deep > summary .hint { grid-column: 2; }
  details.deep > .deep-body { padding: var(--s-3); }
}

/* citations */
a.cite { font-family: var(--font-mono); font-size: 0.68em; vertical-align: super; line-height: 0; text-decoration: none; color: var(--fjord); padding: 0 0.1em; white-space: nowrap; }
a.cite:hover { color: var(--accent); text-decoration: underline; }
.sources-block { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--rule); display: grid; gap: var(--s-3); }
.sources-block h2 { font-size: var(--t-md); }
ol.sources { padding-left: 2.2em; display: grid; gap: var(--s-2); font-family: var(--font-ui); font-size: 0.8125rem; line-height: 1.45; color: var(--ink-2); }
ol.sources li { scroll-margin-top: var(--s-7); padding-left: var(--s-1); }
ol.sources li::marker { font-family: var(--font-mono); color: var(--muted); font-size: 0.75rem; }
ol.sources li:target { background: var(--accent-wash); border-radius: 2px; }
ol.sources a { word-break: break-word; }
ol.sources .pub { color: var(--muted); }

/* glossary */
dl.glossary { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); border-top: 1px solid var(--rule); }
dl.glossary dt, dl.glossary dd { padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); margin: 0; }
dl.glossary dt { font-family: var(--font-ui); font-weight: 650; padding-right: var(--s-4); }
dl.glossary dt .no { display: block; font-weight: 400; font-style: italic; color: var(--muted); font-size: 0.85rem; }
dl.glossary dd { color: var(--ink-2); font-size: 0.97rem; }
@media (max-width: 640px) { dl.glossary { grid-template-columns: 1fr; } dl.glossary dt { border-bottom: 0; padding-bottom: 0; } }

/* pager */
.pager { margin-top: var(--s-8); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); font-family: var(--font-ui); }
.pager a { display: grid; gap: var(--s-1); padding: var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); }
.pager a:hover { border-color: var(--fjord); color: var(--ink); }
.pager .dir { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager .t { font-weight: 650; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

/* index-only pieces */
.hero { display: grid; gap: var(--s-5); padding-bottom: var(--s-7); border-bottom: 1px solid var(--rule); margin-bottom: var(--s-7); }
.hero h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: var(--s-4); }
.role { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-5); display: grid; gap: var(--s-3); align-content: start; }
.role h3 { font-size: 1.0625rem; display: flex; align-items: center; gap: var(--s-2); }
.role p { font-size: 0.95rem; color: var(--ink-2); }
.role ol { list-style: none; padding: 0; display: grid; gap: 2px; counter-reset: rp; font-family: var(--font-ui); font-size: 0.875rem; }
.role ol li { counter-increment: rp; position: relative; padding-left: 1.5rem; }
.role ol li::before { content: counter(rp); position: absolute; left: 0; top: 0.15em; font-family: var(--font-mono); color: var(--muted); font-size: 0.75rem; }
.chapter-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--s-5) var(--s-4); }
.chapter-map .grp { display: grid; gap: var(--s-2); align-content: start; }
.chapter-map .grp-label { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: var(--s-2); }
.chapter-map a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); padding: var(--s-2) 0; }
.chapter-map a .t { font-family: var(--font-ui); font-weight: 650; }
.chapter-map a .d { font-size: 0.875rem; color: var(--ink-2); line-height: 1.4; }
.chapter-map a:hover .t { color: var(--accent); }

/* utility */
.mono { font-family: var(--font-mono); }
.ui { font-family: var(--font-ui); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.stack { display: grid; gap: var(--s-4); }
.stack > * { min-width: 0; }

/* print */
@media print {
  .sidebar, .toc, .topbar, .pager, .theme-switch, .scrim { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .main { padding: 0; }
  .fig, .table-wrap, .keypoints, .callout, .card { break-inside: avoid; }
  /* collapsed detail prints open (site.js also opens it on beforeprint); no +/− marker on paper */
  details.deep { break-inside: auto; }
  details.deep::details-content { content-visibility: visible; display: block; }
  details.deep > .deep-body { display: grid !important; }
  details.deep > summary::before, details.deep[open] > summary::before { content: none; }
  details.deep > summary { grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--rule); }
  details.deep > .deep-body { padding-left: var(--s-4); }
  a { color: inherit; }
}

/* ---------- product concept mockups (phone frame + card visual) ---------- */
.mockups { display: flex; flex-wrap: wrap; gap: var(--s-6); justify-content: center; align-items: flex-start; padding: var(--s-3) 0; }
.mockup { display: grid; gap: var(--s-2); justify-items: center; max-width: 100%; }
.mockup-caption { font-family: var(--font-ui); font-size: 0.8125rem; color: var(--ink-2); max-width: 17rem; text-align: center; line-height: 1.4; }
.phone {
  width: 16.5rem; max-width: 100%; border-radius: 2.2rem; border: 0.55rem solid var(--ink); background: var(--bg);
  padding: 0.9rem 0.8rem 1.1rem; display: grid; gap: 0.6rem; align-content: start;
  font-family: var(--font-ui); font-size: 0.78rem; line-height: 1.35; color: var(--ink);
  box-shadow: 0 18px 40px -18px rgba(5, 20, 24, 0.45);
}
.ph-status { display: flex; justify-content: space-between; font-size: 0.68rem; font-weight: 600; color: var(--ink-2); padding: 0 0.3rem; }
.ph-title { font-family: var(--font-display); font-weight: 750; font-size: 1.05rem; letter-spacing: -0.01em; padding: 0 0.15rem; }
.ph-sub { font-size: 0.72rem; color: var(--muted); margin-top: -0.4rem; padding: 0 0.15rem; }
.ph-section { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0.2rem 0.15rem 0; }
.ph-list { background: var(--surface); border-radius: 0.8rem; display: grid; overflow: hidden; border: 1px solid var(--rule); }
.ph-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0.55rem; align-items: center; padding: 0.55rem 0.65rem; }
.ph-row + .ph-row { border-top: 1px solid var(--rule); }
.ph-ico { width: 1.7rem; height: 1.7rem; border-radius: 0.5rem; background: var(--surface-2); display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; color: var(--ink-2); }
.ph-ico--accent { background: var(--accent-wash); color: var(--accent); }
.ph-ico--fjord { background: var(--fjord-wash); color: var(--fjord); }
.ph-main { min-width: 0; display: grid; }
.ph-main b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-main small { color: var(--muted); font-size: 0.68rem; }
.ph-amt { font-weight: 650; white-space: nowrap; }
.ph-amt--in { color: var(--good-text); }
.ph-toggle { width: 2rem; height: 1.15rem; border-radius: 1rem; background: var(--rule-strong); position: relative; flex: none; }
.ph-toggle::after { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--surface); }
.ph-toggle.on { background: var(--fjord); }
.ph-toggle.on::after { left: auto; right: 0.15rem; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ph-chip { font-size: 0.66rem; font-weight: 600; padding: 0.22rem 0.5rem; border-radius: 1rem; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-2); }
.ph-chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ph-btn { text-align: center; font-weight: 650; padding: 0.6rem; border-radius: 0.7rem; background: var(--ink); color: var(--bg); }
.ph-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule-strong); }
.ph-alert { border-radius: 0.8rem; padding: 0.6rem 0.7rem; background: var(--critical-wash); color: var(--ink); display: grid; gap: 0.2rem; }
.ph-alert b { color: var(--critical-text); }
.ph-note { border-radius: 0.8rem; padding: 0.6rem 0.7rem; background: var(--fjord-wash); display: grid; gap: 0.2rem; }
.ph-bar { height: 0.45rem; border-radius: 1rem; background: var(--surface-2); overflow: hidden; }
.ph-bar > span { display: block; height: 100%; border-radius: 1rem; background: var(--series-1); width: var(--w, 50%); }
.ph-bar > span.warn { background: var(--warning); }
.ph-bar > span.bad { background: var(--critical); }
.ph-big { font-family: var(--font-display); font-weight: 750; font-size: 1.5rem; letter-spacing: -0.02em; font-variant-numeric: normal; }

/* payment card visual (ISO/IEC 7810 ID-1 ratio) */
.vcard {
  aspect-ratio: 85.6 / 53.98; width: 100%; max-width: 100%; border-radius: 0.75rem; padding: 0.75rem 0.85rem;
  display: grid; grid-template-rows: auto 1fr auto; color: #f4f7f7; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0b5566 0%, #0f2e36 100%);
  font-family: var(--font-ui);
}
.vcard--accent { background: linear-gradient(135deg, #b0213f 0%, #5c0f22 100%); }
.vcard--ink { background: linear-gradient(135deg, #24363a 0%, #0b1315 100%); }
.vcard--ghost { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface) 8px 16px); color: var(--ink); border: 1px dashed var(--rule-strong); }
.vcard-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.66rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.92; }
.vcard-tag { font-size: 0.6rem; padding: 0.15rem 0.45rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.18); }
.vcard--ghost .vcard-tag { background: var(--surface-2); }
.vcard-pan { align-self: end; font-family: var(--font-mono); font-size: 0.86rem; letter-spacing: 0.08em; }
.vcard-bottom { display: flex; justify-content: space-between; align-items: end; font-size: 0.62rem; opacity: 0.9; margin-top: 0.25rem; }
.vcard-bottom b { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.02em; opacity: 1; }

/* ======================================================================
   Additions for the agentic engineering platform report
   ====================================================================== */

/* ---------- code blocks, file snippets, directory trees ---------- */
.code { margin: 0; display: grid; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; min-width: 0; }
.code-label { display: flex; justify-content: space-between; gap: var(--s-3); font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.04em; color: var(--muted); padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--rule); background: var(--surface-2); }
.code-label b { color: var(--ink-2); font-weight: 600; }
.code pre { margin: 0; padding: 0.75rem 0.9rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.55; color: var(--ink); tab-size: 2; }
.code pre code { background: none; padding: 0; font-size: inherit; }
.code .c { color: var(--muted); }          /* comment */
.code .k { color: var(--fjord); font-weight: 600; }  /* key / keyword */
.code .s { color: var(--good-text); }      /* string */
.code .a { color: var(--accent); }         /* emphasis / changed line */
.code .hl { background: var(--accent-wash); display: inline-block; width: 100%; }
.code-cap { font-family: var(--font-ui); font-size: 0.8125rem; color: var(--ink-2); padding: 0.5rem 0.75rem; border-top: 1px solid var(--rule); }

/* ---------- chat thread mockup (Slack-like, brand-neutral) ---------- */
.chat { width: 100%; max-width: 40rem; margin: 0 auto; border: 1px solid var(--rule); border-radius: 0.6rem; background: var(--surface); font-family: var(--font-ui); font-size: 0.875rem; line-height: 1.45; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--rule); background: var(--surface-2); font-weight: 650; }
.chat-head small { font-weight: 400; color: var(--muted); }
.chat-body { display: grid; gap: 0.9rem; padding: 0.9rem; }
.msg { display: grid; grid-template-columns: 2rem 1fr; gap: 0.6rem; align-items: start; }
.msg-av { width: 2rem; height: 2rem; border-radius: 0.45rem; display: grid; place-items: center; font-weight: 700; font-size: 0.75rem; background: var(--surface-2); color: var(--ink-2); }
.msg-av--bot { background: var(--fjord); color: var(--surface); }
.msg-av--bot2 { background: var(--accent); color: var(--accent-ink); }
.msg-main { min-width: 0; display: grid; gap: 0.3rem; }
.msg-meta { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.msg-meta b { font-weight: 700; }
.msg-meta .app { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.05rem 0.3rem; border-radius: 2px; background: var(--surface-2); color: var(--muted); }
.msg-meta time { font-size: 0.75rem; color: var(--muted); }
.msg-text p + p { margin-top: 0.35rem; }
.msg-text ul { padding-left: 1.1em; display: grid; gap: 0.15rem; }
.msg-text code { font-size: 0.8em; }
.msg-card { border: 1px solid var(--rule); border-left: 3px solid var(--fjord); border-radius: 0.35rem; padding: 0.55rem 0.7rem; display: grid; gap: 0.35rem; background: var(--bg); }
.msg-card--accent { border-left-color: var(--accent); }
.msg-card--good { border-left-color: var(--good); }
.msg-card-title { font-weight: 700; }
.msg-card dl { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.7rem; font-size: 0.8125rem; }
.msg-card dt { color: var(--muted); }
.msg-card dd { margin: 0; }
.msg-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.msg-btn { font-size: 0.75rem; font-weight: 650; padding: 0.3rem 0.65rem; border-radius: 0.3rem; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); }
.msg-btn--primary { background: var(--good-text); border-color: var(--good-text); color: var(--surface); }
.msg-thumbs { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.msg-thumb { width: 7.5rem; aspect-ratio: 16 / 10; border-radius: 0.3rem; border: 1px solid var(--rule); background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); display: grid; place-items: center; font-size: 0.6875rem; color: var(--ink-2); text-align: center; padding: 0.2rem; position: relative; }
.msg-thumb--video::before { content: "▶"; position: absolute; top: 0.25rem; left: 0.35rem; font-size: 0.7rem; color: var(--accent); }
.msg-reply { font-size: 0.75rem; color: var(--fjord); font-weight: 650; }
.chat-divider { display: flex; align-items: center; gap: 0.6rem; font-size: 0.6875rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); }
.chat-divider::before, .chat-divider::after { content: ""; height: 1px; background: var(--rule); flex: 1; }

/* ---------- PR proof-bundle mockup ---------- */
.proof { width: 100%; border: 1px solid var(--rule); border-radius: 0.5rem; background: var(--surface); font-family: var(--font-ui); font-size: 0.875rem; overflow: hidden; }
.proof-head { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--rule); display: grid; gap: 0.2rem; }
.proof-head b { font-size: 0.95rem; }
.proof-head small { color: var(--muted); }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1px; background: var(--rule); }
.proof-cell { padding: 0.7rem 0.9rem; background: var(--surface); display: grid; gap: 0.4rem; align-content: start; min-width: 0; }
.proof-cell h5 { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; font-size: 0.8125rem; }
.checks li { display: grid; grid-template-columns: 1.1rem 1fr auto; gap: 0.35rem; align-items: baseline; }
.checks li::before { content: "✓"; color: var(--good-text); font-weight: 700; }
.checks li.warn::before { content: "!"; color: var(--warning-text); }
.checks li.fail::before { content: "✕"; color: var(--critical-text); }
.checks li.wait::before { content: "○"; color: var(--muted); }
.checks li small { color: var(--muted); font-family: var(--font-mono); font-size: 0.6875rem; }

/* ---------- terminal mockup ---------- */
.term { border-radius: 0.45rem; background: #0f1e21; color: #dce6e6; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.55; overflow: hidden; border: 1px solid var(--rule-strong); }
.term-bar { padding: 0.35rem 0.7rem; background: #182629; color: #8a9da1; font-size: 0.6875rem; display: flex; gap: 0.4rem; align-items: center; }
.term-bar i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3a5054; display: inline-block; }
.term pre { margin: 0; padding: 0.7rem 0.9rem; overflow-x: auto; }
.term .p { color: #6cc4d4; }   /* prompt */
.term .ok { color: #3fc43f; }
.term .warn { color: #fab219; }
.term .err { color: #ff7b7b; }
.term .dim { color: #8a9da1; }

/* ---------- verdict pills (pstack table) ---------- */
.verdict { display: inline-block; font-family: var(--font-ui); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.12rem 0.45rem; border-radius: 2px; border: 1px solid transparent; white-space: nowrap; }
.verdict--adopt { background: var(--good-wash); color: var(--good-text); border-color: var(--good); }
.verdict--adapt { background: var(--fjord-wash); color: var(--fjord); border-color: var(--fjord); }
.verdict--inspire { background: var(--warning-wash); color: var(--warning-text); border-color: var(--warning); }
.verdict--skip { background: var(--surface-2); color: var(--muted); border-color: var(--rule-strong); }

/* ---------- priority tags ---------- */
.when-tag { display: inline-block; font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 2px; vertical-align: 0.1em; white-space: nowrap; }
.when-tag--d0 { background: var(--accent); color: var(--accent-ink); }
.when-tag--m3 { background: var(--fjord); color: var(--surface); }
.when-tag--later { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--rule-strong); }

/* ---------- quote block (talk quotes) ---------- */
.quote { margin: 0; padding: var(--s-4) var(--s-5); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; display: grid; gap: var(--s-2); }
.quote p { font-size: 1.05rem; font-style: italic; }
.quote footer { font-family: var(--font-ui); font-size: 0.8125rem; color: var(--muted); }
.quote footer a { color: inherit; }
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--s-4); }

/* ---------- checklist (setup steps) ---------- */
.checklist { list-style: none; padding: 0; display: grid; gap: var(--s-2); }
.checklist > li { display: grid; grid-template-columns: 1.4rem 1fr; gap: var(--s-2); align-items: baseline; padding: var(--s-2) var(--s-3); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.checklist > li::before { content: "☐"; font-size: 1rem; color: var(--fjord); }
.checklist > li > div { display: grid; gap: 0.2rem; min-width: 0; }
.checklist > li small { color: var(--muted); font-family: var(--font-ui); font-size: 0.8125rem; }
