/* VOICE work: a reference people cite in reports and share with colleagues
   IDEA an engineering datasheet for cryptography: exact panels, fine rules, one baseline
   PICTURE home: one secure connection, station by station, marked broken or safe under quantum attack
   COLOUR white ground, near-black ink, cobalt #1240e0 strip and links, pale cobalt zones, one red for "broken"
   TYPE Space Grotesk (headings) + Inter (text); four sizes: 48 / 26 / 17 / 14
   LAYOUT laptop: cobalt strip, title and finding, full-width picture, then two-column sections (heading left, list right)
          phone: strip, title, picture as a vertical route, sections stacked */

:root {
  --bg: #ffffff;
  --ink: #0b0d12;
  --soft: #4a5060;
  --rule: #dfe3ee;
  --field: #8790a6;
  --zone: #eef2ff;
  --zone-2: #f6f7fb;
  --cobalt: #1240e0;
  --cobalt-ink: #ffffff;
  --strip: #1240e0;
  --hot: #c8203f;
  --hot-zone: #fdecef;
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px;
  --col: 720px;
  color-scheme: light;
}
/* Dark colours: used when the reader picks Dark, or picks Auto and their device is in dark mode. */
:root[data-theme="dark"] {
    --bg: #0a0d18;
    --ink: #e8ebf5;
    --soft: #a3abc2;
    --rule: #232a40;
    --field: #59627d;
    --zone: #121a33;
    --zone-2: #0f1426;
    --cobalt: #8aa3ff;
    --cobalt-ink: #0a0d18;
    --strip: #13204f;
    --hot: #ff7088;
    --hot-zone: #2a1220;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d18;
    --ink: #e8ebf5;
    --soft: #a3abc2;
    --rule: #232a40;
    --field: #59627d;
    --zone: #121a33;
    --zone-2: #0f1426;
    --cobalt: #8aa3ff;
    --cobalt-ink: #0a0d18;
    --strip: #13204f;
    --hot: #ff7088;
    --hot-zone: #2a1220;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--s3); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--text); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s2); top: -80px; background: var(--ink); color: var(--bg); padding: 10px 16px; z-index: 20; }
.skip:focus { top: var(--s2); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin: 0; }
h1 { font-size: clamp(34px, 4.6vw, 48px); line-height: 1.05; }
h2 { font-size: 26px; line-height: 1.15; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 max(4vw, 16px); }

/* ---------- strip ---------- */
.strip { background: var(--strip); color: #fff; }
.strip-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 600 18px var(--display); letter-spacing: -0.01em; white-space: nowrap; }
.mark { width: 22px; height: 22px; color: #fff; flex: none; }
.strip nav { display: flex; gap: 2px; }
.strip nav a { color: rgba(255,255,255,.82); text-decoration: none; font-size: 15px; font-weight: 500; padding: 17px 12px 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.strip nav a:hover { color: #fff; }
.strip nav a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }

/* ---------- page shell ---------- */
main.wrap { flex: 1; padding-bottom: var(--s5); }
.intro { padding: var(--s4) 0 var(--s3); }
.intro h1, .intro .toc, .intro .letters, .intro .lede { max-width: none; }
.intro h1 + .lede { margin-top: var(--s2); }
.lede { font-size: 19px; line-height: 1.55; color: var(--soft); max-width: var(--col); }
.toc { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; }
.toc a { color: var(--soft); text-decoration: none; }
.toc a:hover { color: var(--cobalt); text-decoration: underline; }
.intro .toc { margin-top: var(--s3); }

/* ---------- home picture: the anatomy of a connection ---------- */
.anatomy { margin: var(--s2) 0 0; background: var(--zone); padding: var(--s3); }
.flow-title a { color: inherit; text-decoration: none; }
.flow-title a:hover { text-decoration: underline; }
.anatomy figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s3); font-size: 15px; font-weight: 600; margin-bottom: var(--s2); }
.anatomy .key { font-weight: 500; color: var(--soft); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.anatomy .key i { display: inline-block; width: 14px; height: 4px; margin-right: 6px; vertical-align: middle; }
.k-broken { background: var(--hot); }
.k-safe { background: var(--cobalt); }
.stations { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.stations.has-ends { grid-template-columns: 110px repeat(var(--n, 4), minmax(0, 1fr)) 110px; }
.stations .ends { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14px; color: var(--soft); border: 1.5px dashed var(--field); padding: var(--s2) var(--s1); }
.stations .ends b { font-weight: 600; }
.station > div, .station a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; background: var(--bg); padding: var(--s2) var(--s2) 18px; text-decoration: none; color: var(--ink); border-top: 5px solid var(--cobalt); }
.station.is-broken > a, .station.is-broken > div { border-top-color: var(--hot); }
.station.is-step > a, .station.is-step > div { border-top-color: var(--ink); }
.is-step .st-fate { color: var(--soft); }
.k-step { background: var(--ink); }
.station a:hover .st-name { text-decoration: underline; text-underline-offset: 3px; }
.station:not(:last-child) > a::after, .station:not(:last-child) > div::after, .has-ends .station > a::after, .has-ends .station > div::after { content: ""; position: absolute; right: -10px; top: 50%; width: 10px; height: 2px; background: var(--field); }
.st-name { font: 600 18px/1.2 var(--display); letter-spacing: -0.01em; }
.st-what { font-size: 15px; line-height: 1.45; color: var(--soft); }
.st-today { font-size: 14px; font-weight: 600; margin-top: auto; padding-top: var(--s1); }
.st-fate { font-size: 14px; line-height: 1.4; color: var(--cobalt); }
.is-broken .st-fate { color: var(--hot); }

/* ---------- finder ---------- */
.finder { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: var(--s2) var(--s4); align-items: end; padding: var(--s4) 0 var(--s2); border-bottom: 2px solid var(--ink); }
.search label { display: block; font: 600 15px var(--text); margin-bottom: 6px; }
.search input { width: 100%; font: 16px var(--text); color: var(--ink); background: var(--bg); padding: 12px 14px; border: 1.5px solid var(--field); border-radius: 0; appearance: none; }
.search input::placeholder { color: var(--soft); }
.search input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 25%, transparent); }
.finder .toc { padding-bottom: 12px; }
.empty { grid-column: 1 / -1; color: var(--soft); }
body.searching .finder .toc { display: none; }

/* ---------- sections: heading left, list right ---------- */
.sec { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: var(--s2) var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--rule); scroll-margin-top: var(--s3); }
.sec-head h2 { font-size: 24px; }
.sec-head p { margin-top: var(--s1); font-size: 15px; color: var(--soft); max-width: 300px; }
.terms { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s4); }
.terms li { padding: 12px 0; border-top: 1px solid var(--rule); }
.terms li:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.terms a { font-weight: 600; text-decoration: none; color: var(--ink); }
.terms a:hover { color: var(--cobalt); text-decoration: underline; }
.terms span { display: block; font-size: 15px; line-height: 1.45; color: var(--soft); margin-top: 2px; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--s3); }
.letters a { display: inline-grid; place-items: center; width: 40px; height: 40px; text-decoration: none; font: 600 17px var(--display); color: var(--ink); background: var(--zone); }
.letters a:hover { background: var(--cobalt); color: var(--cobalt-ink); }
.sec.letter .sec-head h2 { font-size: 40px; color: var(--cobalt); line-height: 1; }

/* ---------- term page ---------- */
.doc { display: grid; grid-template-columns: minmax(0, var(--col)) 240px; justify-content: space-between; gap: var(--s5); padding-top: 12px; }
.crumb { font-size: 14px; line-height: 20px; height: 20px; color: var(--soft); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb a { color: var(--soft); text-decoration: none; }
.crumb a:hover { color: var(--cobalt); text-decoration: underline; }
.term .plain { font-size: 20px; line-height: 1.55; margin-top: var(--s2); }
.pair { display: grid; gap: var(--s2); margin-top: var(--s3); }
.picture, .myth { margin: 0; padding: var(--s2) 20px 18px; }
.picture { background: var(--zone); }
.picture figcaption, .myth-h { font-size: 14px; font-weight: 600; color: var(--soft); margin-bottom: 4px; }
.picture p { font: 500 19px/1.45 var(--display); letter-spacing: -0.005em; }
.myth { background: var(--hot-zone); border-left: 4px solid var(--hot); }
.myth .myth-h { color: var(--hot); }
.diagram { margin: var(--s3) 0 0; }
.diagram .scroll { overflow-x: auto; background: var(--zone-2); padding: var(--s2); }
.diagram svg { display: block; width: 100%; height: auto; min-width: 520px; }
.diagram figcaption { font-size: 14px; color: var(--soft); margin-top: var(--s1); }
.term h2 { font-size: 22px; margin: var(--s4) 0 var(--s1); }
.deeper { margin-top: var(--s4); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.deeper summary { cursor: pointer; list-style: none; padding: var(--s2) 0; font: 600 19px var(--display); display: flex; align-items: baseline; gap: 12px; }
.deeper summary::-webkit-details-marker { display: none; }
.deeper summary::after { content: "+"; margin-left: auto; font: 500 24px/1 var(--text); color: var(--cobalt); }
.deeper[open] summary::after { content: "\2212"; }
.deeper summary span { font: 400 15px var(--text); color: var(--soft); }
.deeper p { padding-bottom: var(--s3); }
.reads { list-style: none; padding: 0; margin: 0; }
.reads li { padding: 10px 0; border-top: 1px solid var(--rule); }
.reads li:first-child { border-top: 0; padding-top: 0; }
.reads a { font-weight: 600; }
.reads span { display: block; font-size: 14px; color: var(--soft); }
.terms.related li:nth-child(-n+2) { border-top: 1px solid var(--rule); padding-top: 12px; }
.tools { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); align-items: start; }
.copy { font: 600 15px var(--text); color: var(--cobalt-ink); background: var(--cobalt); border: 0; padding: 10px 16px; cursor: pointer; white-space: nowrap; }
.copy:hover { filter: brightness(1.1); }
.cite { font-size: 14px; color: var(--soft); }
.cite span { display: block; font-weight: 600; color: var(--ink); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s3); }
.prevnext a { text-decoration: none; color: var(--ink); font: 600 18px/1.3 var(--display); padding: var(--s2); background: var(--zone-2); }
.prevnext a:hover { background: var(--zone); }
.prevnext a span { display: block; font: 500 14px var(--text); color: var(--soft); margin-bottom: 2px; }
.prevnext .next { text-align: right; }
.side-in { position: sticky; top: var(--s3); padding-top: 28px; font-size: 15px; }
.side-h { font: 600 15px var(--text); padding-bottom: var(--s1); border-bottom: 2px solid var(--ink); margin-bottom: var(--s1); }
.side ul { list-style: none; padding: 0; margin: 0 0 var(--s2); }
.side li { padding: 6px 0; line-height: 1.35; border-bottom: 1px solid var(--rule); }
.side li a { color: var(--soft); text-decoration: none; }
.side li a:hover { color: var(--cobalt); }
.side li[aria-current] { font-weight: 600; color: var(--ink); box-shadow: inset 3px 0 0 var(--cobalt); padding-left: 10px; }
.side-more a { font-size: 14px; }

/* ---------- deadlines ---------- */
.schedule { border-top: 2px solid var(--ink); margin-top: var(--s2); }
.sch-head { display: grid; grid-template-columns: 110px 150px minmax(0, 1fr) 260px 150px; gap: var(--s3); font-size: 14px; font-weight: 600; color: var(--soft); padding: 10px 0; border-bottom: 1px solid var(--rule); }
.sch-head span:first-child { grid-column: 1 / 3; }
.sch-year { display: grid; grid-template-columns: 110px minmax(0, 1fr); column-gap: var(--s3); border-bottom: 1px solid var(--rule); }
.sch-year h2 { grid-row: 1 / span 20; font-size: 30px; color: var(--cobalt); padding: 14px 0; line-height: 1; }
.sch-row { grid-column: 2; display: grid; grid-template-columns: 150px minmax(0, 1fr) 260px 150px; gap: var(--s3); padding: 14px 0; border-top: 1px solid var(--rule); }
.sch-year h2 + .sch-row { border-top: 0; }
.sch-when { font-weight: 600; white-space: nowrap; }
.sch-who { font-size: 15px; color: var(--soft); }
.sch-who a { margin-left: 4px; }
.sch-status { font-size: 15px; font-weight: 600; color: var(--soft); }
.st-due-now .sch-status, .st-in-force .sch-status, .st-no-public-draft-yet .sch-status { color: var(--hot); }
.st-proposed .sch-status { color: var(--cobalt); }
.aside-note { margin-top: var(--s3); font-size: 15px; color: var(--soft); max-width: var(--col); }

/* ---------- reading list ---------- */
.res-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s4); }
.res-list li { padding: 14px 0; border-top: 1px solid var(--rule); }
.res-list li:nth-child(-n+2) { border-top: 0; padding-top: 0; }
.res-name { font-weight: 600; line-height: 1.35; }
.res-name a { color: var(--ink); text-decoration: none; }
.res-name a:hover { color: var(--cobalt); text-decoration: underline; }
.res-by { font-size: 14px; color: var(--soft); margin-top: 2px; }
.res-by span { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--field); }
.res-note { font-size: 15px; margin-top: 6px; }

/* ---------- prose ---------- */
.prose { max-width: var(--col); padding-top: var(--s4); }
.prose .lede { margin-top: var(--s2); }
.prose h2 { font-size: 22px; margin: var(--s4) 0 var(--s1); }

/* ---------- footer ---------- */
.foot { border-top: 2px solid var(--ink); padding: var(--s4) 0 var(--s5); font-size: 15px; color: var(--soft); }
.foot-in { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s2) var(--s4); }
.foot-brand { font: 600 18px var(--display); color: var(--ink); }
.foot-text { max-width: var(--col); }
.foot-links { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-links a { color: var(--soft); }

/* ---------- narrower screens ---------- */
@media (max-width: 1080px) {
  .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stations .ends { display: none; }
  .station a::after { display: none; }
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side-in { position: static; margin-top: var(--s4); padding-top: var(--s3); border-top: 2px solid var(--ink); }
  .side ul, .side-h { display: none; }
  .sch-head { display: none; }
  .sch-year { grid-template-columns: 80px minmax(0, 1fr); }
  .sch-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .sch-status { order: -1; font-size: 14px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .strip-in { flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; padding-top: 12px; }
  .strip nav { width: calc(100% + 2 * max(4vw, 16px)); margin: 4px calc(-1 * max(4vw, 16px)) 0; padding: 0 calc(max(4vw, 16px) - 10px); overflow-x: auto; scrollbar-width: none; }
  .strip nav::-webkit-scrollbar { display: none; }
  .strip nav a { padding: 10px 10px 9px; font-size: 14.5px; }
  .intro { padding-top: var(--s3); }
  .lede { font-size: 17px; }
  .anatomy { padding: var(--s2); }
  .finder, .sec, .foot-in { grid-template-columns: minmax(0, 1fr); }
  .finder { gap: var(--s2); }
  .sec { padding: var(--s3) 0; gap: var(--s2); }
  .sec-head p { max-width: none; }
  .foot-links { grid-column: 1; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .term .plain { font-size: 18px; }
  .prevnext a { font-size: 16px; }
  .sch-year { grid-template-columns: minmax(0, 1fr); }
  .sch-year h2 { grid-row: auto; padding-bottom: 0; }
  .sch-row { grid-column: 1; }
}

/* ---------- diagram marks ---------- */
.diagram .d-box { fill: var(--bg); stroke: var(--field); stroke-width: 1.3; }
.diagram .d-alt { fill: var(--zone-2); stroke-dasharray: 5 4; }
.diagram .d-acc { fill: var(--zone); stroke: var(--cobalt); stroke-width: 1.6; }
.diagram .d-t { font: 600 16px var(--text); fill: var(--ink); }
.diagram .d-box.mono + text { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.diagram .d-s { font: 400 14px var(--text); fill: var(--soft); }
.diagram .d-bt { font: 600 14px var(--text); fill: #fff; text-anchor: middle; }
.diagram .d-line { stroke: var(--soft); stroke-width: 1.6; fill: none; }
.diagram .d-head { fill: var(--soft); }
.diagram .d-axis { stroke: var(--rule); stroke-width: 3; }
.diagram .d-dot { fill: var(--cobalt); }
.diagram .d-q { fill: var(--hot); }
.diagram .d-band { fill: var(--zone); stroke: var(--cobalt); stroke-dasharray: 5 4; }
.diagram .d-brace { stroke: var(--soft); stroke-width: 1.5; fill: none; stroke-dasharray: 3 4; }
.diagram .d-bar { fill: var(--cobalt); }
.diagram .d-bar2 { fill: color-mix(in srgb, var(--cobalt) 65%, #0b0d12); }
.diagram .d-bar3 { fill: var(--hot); }
.diagram .d-mark { stroke: var(--hot); stroke-width: 2; stroke-dasharray: 4 4; }
:root[data-theme="dark"] .diagram .d-bt { fill: #0a0d18; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diagram .d-bt { fill: #0a0d18; } }

@media print {
  .strip nav, .side, .tools .copy, .prevnext, .skip, .finder, .foot-links { display: none !important; }
  .strip { background: none; color: #000; border-bottom: 2px solid #000; }
  .brand, .mark { color: #000; }
  .doc { display: block; }
  body { background: #fff; color: #000; }
}

/* ---------- latest ---------- */
.latest-band { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: var(--s2) var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.lb-head h2 { font-size: 24px; }
.lb-head a { display: inline-block; margin-top: var(--s1); font-size: 15px; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.lb-list a { display: block; text-decoration: none; color: var(--ink); border-top: 3px solid var(--hot); padding-top: 10px; }
.lb-list a:hover .lb-title { color: var(--cobalt); text-decoration: underline; }
.lb-when { display: block; font-size: 14px; color: var(--soft); }
.lb-title { display: block; font: 600 17px/1.3 var(--display); letter-spacing: -0.01em; margin-top: 4px; }
.news .sec-head { padding-top: 4px; }
.news-when { font: 600 20px var(--display); letter-spacing: -0.01em; }
.news-who { font-size: 15px; color: var(--soft); margin-top: 4px; }
.news-body { max-width: none; }
.news-body h2 { font-size: 24px; margin-bottom: var(--s1); }
.news-body p + p { margin-top: 12px; }
.news-means { background: var(--zone); padding: 12px 16px; }
.news-links { font-size: 15px; } .nl-label { font-weight: 600; color: var(--soft); }
.news-src { font-size: 14px; color: var(--soft); }
.sec-text { max-width: none; }
.innews { margin-top: var(--s3); border-left: 4px solid var(--hot); padding: 4px 0 4px 16px; }
.innews-h { font-size: 14px; font-weight: 600; color: var(--hot); margin-bottom: 4px; }
.innews p + p { margin-top: 6px; }
.innews a { font-weight: 600; }
.innews span { font-size: 14px; color: var(--soft); margin-left: 6px; white-space: nowrap; }
@media (max-width: 1080px) { .lb-list { grid-template-columns: minmax(0, 1fr); gap: var(--s2); } }
@media (max-width: 760px) { .latest-band { grid-template-columns: minmax(0, 1fr); } .news-when { font-size: 18px; } }

/* ---------- deadlines tracker ---------- */
.years { margin: var(--s2) 0 0; background: var(--zone); padding: var(--s3); }
.years figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s3); font-size: 15px; font-weight: 600; margin-bottom: var(--s2); }
.years .key { font-weight: 500; color: var(--soft); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.years .key i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.k-gov { background: var(--cobalt); }
.k-ind { background: color-mix(in srgb, var(--cobalt) 58%, var(--bg)); }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; height: 220px; }
.bar { display: grid; grid-template-rows: 22px 1fr 24px; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink); }
.bar-n { font: 600 15px var(--display); align-self: end; text-align: center; }
.bar-stack { align-self: end; display: flex; flex-direction: column; min-height: 2px; width: 100%; }
.bar-gov { background: var(--cobalt); }
.bar-ind { background: color-mix(in srgb, var(--cobalt) 58%, var(--bg)); }
.bar-y { font-size: 14px; color: var(--soft); text-align: center; align-self: end; border-top: 1px solid var(--field); padding-top: 4px; }
.bar:hover .bar-y, .bar.on .bar-y { color: var(--ink); font-weight: 600; }
.bar.on .bar-stack { outline: 3px solid var(--hot); outline-offset: 2px; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 180px)) minmax(0, 1fr); gap: var(--s2); align-items: end; padding: var(--s4) 0 var(--s2); border-bottom: 2px solid var(--ink); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.filters label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.filters select, .filters input { font: 16px var(--text); color: var(--ink); background: var(--bg); border: 1.5px solid var(--field); border-radius: 0; padding: 10px 12px; width: 100%; }
.filters select:focus, .filters input:focus { outline: none; border-color: var(--cobalt); }
.f-out { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 15px; color: var(--soft); }
.f-out button { font: 600 15px var(--text); color: var(--cobalt); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.f-out a { font-weight: 600; margin-left: auto; }
.dl-row { display: grid; grid-template-columns: 130px 190px minmax(0, 1fr) 110px 110px 70px; gap: var(--s3); padding: 14px 0; border-bottom: 1px solid var(--rule); }
.dl-row[hidden] { display: none; }
.dl-head { font-size: 14px; font-weight: 600; color: var(--soft); padding: 10px 0; }
.dl-when { font: 600 17px/1.3 var(--display); }
.dl-who p:first-child { font-weight: 600; }
.dl-region, .dl-scope, .dl-note { font-size: 14px; color: var(--soft); }
.dl-what p + p { margin-top: 4px; }
.dl-quote { font-size: 14px; color: var(--soft); font-style: italic; }
.dl-kind, .dl-status, .dl-src { font-size: 15px; }
.dl-status { font-weight: 600; color: var(--soft); }
.st-due-now .dl-status, .st-in-force .dl-status { color: var(--hot); }
.st-proposed .dl-status { color: var(--cobalt); }
.st-done .dl-status { color: var(--soft); font-weight: 500; }
.dl-notes { padding-top: 0; }
.dl-notes h2 { font-size: 22px; margin-bottom: var(--s1); }
@media (max-width: 1080px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); position: static; }
  .dl-head { display: none; }
  .dl-row { grid-template-columns: 110px minmax(0, 1fr); gap: 4px var(--s2); }
  .dl-row > * { grid-column: 2; }
  .dl-when { grid-column: 1; grid-row: 1 / span 5; }
  .dl-kind, .dl-status, .dl-src { display: inline; }
}
@media (max-width: 760px) {
  .years { padding: var(--s2); }
  .bars { gap: 3px; height: 180px; }
  .bar-y { font-size: 11px; writing-mode: vertical-rl; transform: rotate(180deg); border-top: 0; padding: 4px 0 0; justify-self: center; }
  .bar { grid-template-rows: 20px 1fr 44px; }
  .bar-n { font-size: 13px; }
  .filters { grid-template-columns: minmax(0, 1fr); }
  .dl-row { grid-template-columns: minmax(0, 1fr); }
  .dl-row > *, .dl-when { grid-column: 1; grid-row: auto; }
  .f-out a { margin-left: 0; }
}

@media (max-width: 600px) {
  .stations { grid-template-columns: minmax(0, 1fr); }
  .terms, .res-list { grid-template-columns: minmax(0, 1fr); }
  .terms li:nth-child(2), .res-list li:nth-child(2) { border-top: 1px solid var(--rule); padding-top: 12px; }
}

.foot-updated { margin-top: 10px; }
.foot-credit { grid-column: 1 / -1; margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--rule); font-size: 13.5px; }
.foot-credit a { color: var(--soft); font-weight: 600; }
.lb-list.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.coming .lb-list a { border-top-color: var(--cobalt); }
.lb-who { display: block; font-size: 14px; color: var(--soft); margin-top: 4px; }
.coming .lb-title { font: 500 16px/1.4 var(--text); letter-spacing: 0; }
.dl-link { margin-top: var(--s3); font-weight: 600; }
.dl-link a::after { content: " \2192"; }
@media (max-width: 1080px) { .lb-list.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .lb-list.four { grid-template-columns: minmax(0, 1fr); } }

/* ---------- diagrams page and flows in term pages ---------- */
.flow-stack { display: grid; gap: var(--s3); }
.flow-stack .anatomy { margin: 0; }
.term .anatomy { margin-top: var(--s3); padding: var(--s2); }
.term .stations, .term .stations.has-ends { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.term .station > a, .term .station > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); column-gap: var(--s3); row-gap: 4px; border-top: 0; border-left: 5px solid var(--cobalt); padding: 12px 16px; }
.term .station.is-broken > a, .term .station.is-broken > div { border-left-color: var(--hot); }
.term .station.is-step > a, .term .station.is-step > div { border-left-color: var(--ink); }
.term .station .st-name { grid-row: 1 / span 3; }
.term .station .st-what, .term .station .st-today, .term .station .st-fate { grid-column: 2; }
.term .station .st-today { margin-top: 0; padding-top: 0; }
.term .stations .ends { display: none; }
.term .station > a::after, .term .station > div::after { display: none; }
.term .st-name { font-size: 16px; }
.term .st-what { font-size: 14px; }
.deadlines-flow { margin-bottom: var(--s3); }
.drawings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.drawings a { text-decoration: none; color: var(--ink); }
.drawings .diagram { margin: 0; }
.drawings figcaption strong { display: block; color: var(--ink); font-size: 15px; }
@media (max-width: 1080px) { .stations.has-ends { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); } .station > a::after, .station > div::after { display: none; } .drawings { grid-template-columns: minmax(0, 1fr); } }
.key-item { display: inline-flex; align-items: center; }
@media (max-width: 600px) {
  .stations, .stations.has-ends, .term .stations, .term .stations.has-ends { grid-template-columns: minmax(0, 1fr); }
  .anatomy .key { flex-direction: column; align-items: flex-start; gap: 4px; }
}
.sec-flow { grid-column: 1 / -1; }
.sec-flow .anatomy { margin-top: var(--s2); }
body.searching .sec-flow { display: none; }

/* review fixes */
.strip nav a { flex: none; }
.filters select, .filters input { height: 44px; box-sizing: border-box; }
.f-asof { color: var(--soft); margin-left: auto; }
.f-out a { margin-left: 0; }
@media (max-width: 1080px) {
  .dl-row .dl-kind, .dl-row .dl-status, .dl-row .dl-src { grid-column: 2; display: inline-block; }
  .dl-row { grid-template-columns: 110px minmax(0, 1fr) auto auto auto; }
  .dl-row > .dl-who, .dl-row > .dl-what { grid-column: 2 / -1; }
  .dl-row > .dl-kind { grid-column: 2; } .dl-row > .dl-status { grid-column: 3; } .dl-row > .dl-src { grid-column: 4; }
  .dl-row > .dl-kind, .dl-row > .dl-status, .dl-row > .dl-src { margin-top: 6px; font-size: 14px; }
}
@media (max-width: 760px) {
  .dl-row { grid-template-columns: auto auto auto 1fr; column-gap: 14px; }
  .dl-row > .dl-when, .dl-row > .dl-who, .dl-row > .dl-what { grid-column: 1 / -1; }
  .dl-row > .dl-kind { grid-column: 1; } .dl-row > .dl-status { grid-column: 2; } .dl-row > .dl-src { grid-column: 3; }
  .f-asof { margin-left: 0; }
}
.toc .toc-az { color: var(--cobalt); font-weight: 600; }
@media (max-width: 760px) { .strip nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); } }
.flow-finding { flex-basis: 100%; order: 2; font: 500 17px/1.4 var(--display); letter-spacing: -0.005em; color: var(--ink); margin-top: 2px; max-width: 900px; }
.anatomy .key { order: 3; }
.flow-title { order: 1; font-size: 14px; color: var(--soft); font-weight: 600; }
@media (max-width: 600px) { .term .station > a, .term .station > div { grid-template-columns: minmax(0, 1fr); } .term .station .st-name { grid-row: auto; } .term .station .st-what, .term .station .st-today, .term .station .st-fate { grid-column: 1; } }

/* sweep 2: aligned cards, numbers, compare mode, one layout below 900px */
.stations { grid-template-rows: repeat(4, auto); }
.stations > li { grid-row: span 4; display: grid; grid-template-rows: subgrid; }
.stations > li > a, .stations > li > div { grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; height: auto; gap: 6px; }
.stations .st-today { margin-top: 0; padding-top: 4px; align-self: start; }
.station:not(:last-child) > a::after, .station:not(:last-child) > div::after, .has-ends .station > a::after, .has-ends .station > div::after { top: 30px; }
.is-compare .station > a::after, .is-compare .station > div::after { display: none; }
.st-n { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 600 12px var(--text); vertical-align: 2px; }
.is-broken .st-n { background: var(--hot); }
.is-safe .st-n { background: var(--cobalt); color: var(--cobalt-ink); }
.flow-finding { text-wrap: balance; max-width: none; }
@media (max-width: 900px) {
  .stations, .stations.has-ends { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 6px; }
  .stations > li { grid-row: auto; display: block; }
  .stations .ends { display: none; }
  .station > a, .station > div { display: grid; grid-template-rows: none; grid-template-columns: 170px minmax(0, 1fr); column-gap: var(--s3); row-gap: 4px; border-top: 0; border-left: 5px solid var(--cobalt); padding: 12px 16px; }
  .station.is-broken > a, .station.is-broken > div { border-left-color: var(--hot); }
  .station.is-step > a, .station.is-step > div { border-left-color: var(--ink); }
  .station .st-name { grid-row: 1 / span 3; }
  .station .st-what, .station .st-today, .station .st-fate { grid-column: 2; }
  .station > a::after, .station > div::after { display: none !important; }
}
@media (max-width: 600px) {
  .station > a, .station > div { grid-template-columns: minmax(0, 1fr); }
  .station .st-name { grid-row: auto; }
  .station .st-what, .station .st-today, .station .st-fate { grid-column: 1; }
}
.term .stations > li, .term .stations > li > a, .term .stations > li > div { grid-row: auto; grid-template-rows: none; }
.term .stations { grid-template-rows: none; }

/* ---------- compare jurisdictions ---------- */
.compare { margin: var(--s2) 0 var(--s3); }
.compare h2 { font-size: 24px; }
.compare-note { color: var(--soft); font-size: 15px; margin: 6px 0 var(--s2); }
.cmp { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.cmp th, .cmp td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cmp thead th { font-size: 14px; color: var(--soft); font-weight: 600; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.cmp tbody th { font-weight: 600; width: 26%; }
.cmp tbody th a { color: var(--ink); text-decoration: none; }
.cmp tbody th a:hover { color: var(--cobalt); text-decoration: underline; }
.cmp tbody th span { display: block; font-weight: 400; font-size: 14px; color: var(--soft); }
.cmp td:nth-child(4) { font-weight: 600; }
.cmp .none { color: var(--soft); }
.cmp tbody tr:hover { background: var(--zone-2); }
@media (max-width: 760px) {
  .cmp thead { display: none; }
  .cmp tr { display: grid; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .cmp th, .cmp td { border: 0; padding: 2px 0; width: auto; }
  .cmp td { display: flex; justify-content: space-between; gap: 12px; }
  .cmp td::before { content: attr(data-l); color: var(--soft); font-weight: 400; }
  .cmp td { text-align: right; }
}
@media (max-width: 760px) { .cmp tbody th { width: auto; } .cmp tr { grid-template-columns: minmax(0, 1fr); } }
.st-date-passed .dl-status { color: var(--soft); font-style: italic; }
.sort-date { font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; }
.sort-date:hover { color: var(--cobalt); }
.sort-date span { color: var(--cobalt); margin-left: 2px; }

/* ---------- interactive diagrams ---------- */
.flow-controls { order: 4; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 4px; }
.fc-group { display: inline-flex; align-items: stretch; border: 1.5px solid var(--field); background: var(--bg); }
.fc-group button { font: 600 14px var(--text); color: var(--soft); background: none; border: 0; padding: 7px 12px; cursor: pointer; min-height: 36px; }
.fc-group button + button { border-left: 1.5px solid var(--field); }
.fc-group button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.fc-group button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.fc-steps button { font-size: 18px; padding: 4px 14px; }
.fc-pos { display: inline-flex; align-items: center; padding: 0 12px; font: 500 14px var(--text); color: var(--soft); min-width: 92px; justify-content: center; border-left: 1.5px solid var(--field); border-right: 1.5px solid var(--field); }

/* both lines share one cell, so switching never changes the card's height */
.st-today { display: grid; }
.st-today > span { grid-area: 1 / 1; transition: opacity .25s ease; }
.st-today .t-up { opacity: 0; visibility: hidden; }
[data-state="up"] .st-today .t-up { opacity: 1; visibility: visible; }
[data-state="up"] .st-today .t-now { opacity: 0; visibility: hidden; }
[data-state="up"] .is-broken .t-up { color: var(--cobalt); font-weight: 600; }

.station > a, .station > div { position: relative; transition: background-color .25s ease, border-color .25s ease, opacity .25s ease, box-shadow .25s ease; }
.st-badge { position: absolute; top: 10px; right: 10px; display: grid; pointer-events: none; }
.st-badge > span { grid-area: 1 / 1; font: 600 12px var(--text); padding: 2px 8px; color: #fff; background: var(--hot); opacity: 0; transition: opacity .25s ease; white-space: nowrap; }
.st-badge .b-ok { background: var(--cobalt); color: var(--cobalt-ink); }
[data-state="qday"] .st-badge .b-q, [data-state="up"] .st-badge .b-up { opacity: 1; }
[data-state="up"] .is-broken .st-badge .b-up { background: var(--cobalt); color: var(--cobalt-ink); }
[data-state="qday"] .is-broken > a, [data-state="qday"] .is-broken > div { background: var(--hot-zone); }
[data-state="qday"] .is-broken .st-name { text-decoration: line-through; text-decoration-color: var(--hot); text-decoration-thickness: 2px; }
[data-state="up"] .is-broken > a, [data-state="up"] .is-broken > div { border-top-color: var(--cobalt); border-left-color: var(--cobalt); }
[data-state="up"] .is-broken .st-n { background: var(--cobalt); color: var(--cobalt-ink); }
.flow[data-state] .station > a, .flow[data-state] .station > div { padding-right: 84px; }
@media (min-width: 901px) { .flow[data-state] .station > a, .flow[data-state] .station > div { padding-right: var(--s2); padding-top: 38px; } }

/* step-through: dim the others, outline the current one */
.flow[data-step] .station > a, .flow[data-step] .station > div { opacity: .35; }
.flow[data-step] .station.is-current > a, .flow[data-step] .station.is-current > div { opacity: 1; box-shadow: 0 0 0 3px var(--ink); }
.flow.is-hovering:not([data-step]) .station > a, .flow.is-hovering:not([data-step]) .station > div { opacity: .55; }
.flow.is-hovering:not([data-step]) .station.is-hovered > a, .flow.is-hovering:not([data-step]) .station.is-hovered > div { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .station > a, .station > div, .st-today > span, .st-badge > span { transition: none; } }
@media print { .flow-controls { display: none; } }

/* theme switch */
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; font: 500 14px var(--text); color: rgba(255,255,255,.85); background: none; border: 1.5px solid rgba(255,255,255,.35); padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.theme-toggle:hover { color: #fff; border-color: #fff; }
.theme-toggle svg { width: 16px; height: 16px; }
.strip-right { display: flex; align-items: center; gap: var(--s3); }
[data-state="up"] .is-broken .st-fate { opacity: .45; }
@media (max-width: 760px) { .strip-right { width: 100%; justify-content: space-between; } .theme-toggle { position: absolute; top: 12px; right: max(4vw, 16px); } .strip-in { position: relative; } }

/* ---------- landing page ---------- */
.home-search { margin-top: var(--s3); max-width: 560px; }
.hs-row { display: flex; }
.hs-row input { flex: 1; }
.hs-row button { font: 600 15px var(--text); color: var(--cobalt-ink); background: var(--cobalt); border: 0; padding: 0 18px; cursor: pointer; }
.hs-row button:hover { filter: brightness(1.1); }
.explore { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: var(--s4); }
.tile { grid-column: span 2; display: flex; flex-direction: column; gap: 8px; padding: var(--s3); background: var(--zone); color: var(--ink); text-decoration: none; transition: background-color .2s ease; min-height: 250px; }
.tile.t-wide { grid-column: span 3; }
.tile:hover { background: color-mix(in srgb, var(--cobalt) 12%, var(--zone)); }
.tile:hover .tile-h { color: var(--cobalt); }
.tile-h { font: 600 26px/1.1 var(--display); letter-spacing: -0.02em; }
.tile-h::after { content: " \2192"; color: var(--cobalt); }
.tile-p { font-size: 15px; color: var(--soft); max-width: 520px; }
.tile-news { font: 600 16px/1.35 var(--display); letter-spacing: -0.005em; padding-top: 10px; border-top: 3px solid var(--hot); }
.tile-news .lb-when { display: block; font: 500 13px var(--text); color: var(--soft); margin-bottom: 2px; }
.lgrid { margin-top: auto; display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; }
.lgrid span { display: grid; place-items: center; aspect-ratio: 1; font: 600 14px var(--display); }
.lg-on { background: color-mix(in srgb, var(--lg) calc(var(--w) * 100%), var(--bg)); color: #fff; }
.lg-off { color: var(--field); background: var(--bg); }
.minibars { margin-top: auto; display: flex; align-items: flex-end; gap: 4px; height: 96px; border-bottom: 1.5px solid var(--field); }
.mb { flex: 1; height: var(--h); min-height: 2px; background: var(--cobalt); }
.mb-axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--soft); }
.segbar { margin-top: auto; display: flex; height: 14px; gap: 2px; }
.sg0 { background: var(--cobalt); } .sg1 { background: color-mix(in srgb, var(--cobalt) 70%, var(--bg)); } .sg2 { background: color-mix(in srgb, var(--cobalt) 45%, var(--bg)); } .sg3 { background: var(--ink); }
.seglabels { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--soft); }
.seglabels i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; }
.is-landing .coming { margin-top: var(--s4); border-top: 1px solid var(--rule); }
@media (max-width: 1080px) { .tile, .tile.t-wide { grid-column: span 3; } }
@media (max-width: 600px) { .explore { grid-template-columns: minmax(0, 1fr); } .tile, .tile.t-wide, .explore .tile:last-child { grid-column: 1; min-height: 0; } }
.tile-link { color: var(--ink); text-decoration: none; }
.tile-link:hover { color: var(--cobalt); }
div.tile:hover { background: var(--zone); }
.tile-p a { color: var(--cobalt); }
.lgrid a { text-decoration: none; }
.lgrid a:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.home-picture { margin-top: var(--s4); } .is-landing .explore { margin-top: var(--s3); }
.lg-on { color: var(--ink); } .lg-on.lg-dark { color: #fff; }
/* In dark colours the letters use a deeper blue, so light text reads on every shade. */
.lgrid { --lg: var(--cobalt); }
:root[data-theme="dark"] .lgrid { --lg: #3552d6; }
:root[data-theme="dark"] .lg-on, :root[data-theme="dark"] .lg-on.lg-dark { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lgrid { --lg: #3552d6; } :root:not([data-theme="light"]) .lg-on, :root:not([data-theme="light"]) .lg-on.lg-dark { color: var(--ink); } }

/* ---------- Mosca calculator ---------- */
.calc { margin-top: var(--s3); background: var(--zone); padding: var(--s3); }
.calc h2 { font-size: 20px; margin: 0; }
.calc-intro { font-size: 15px; color: var(--soft); margin-top: 4px; }
.calc-inputs { display: grid; gap: 14px; margin-top: var(--s2); }
.calc-inputs label { display: grid; gap: 6px; font-size: 15px; }
.calc-inputs label > span { display: flex; justify-content: space-between; gap: 12px; }
.calc-inputs output { font: 600 15px var(--display); white-space: nowrap; }
.calc-inputs input[type=range] { width: 100%; accent-color: var(--cobalt); height: 28px; }
.calc-bars { display: grid; gap: 8px; margin-top: var(--s3); }
.cb-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 12px; font-size: 14px; color: var(--soft); }
.cb-track { display: flex; height: 22px; background: var(--bg); }
.cb-x, .cb-y, .cb-z { height: 100%; transition: width .3s ease; }
.cb-x { background: var(--cobalt); } .cb-y { background: color-mix(in srgb, var(--cobalt) 55%, var(--bg)); } .cb-z { background: var(--hot); }
.calc-verdict { margin-top: var(--s2); font: 600 18px/1.4 var(--display); }
.calc-verdict.is-late { color: var(--hot); }
@media (max-width: 600px) { .cb-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
@media (prefers-reduced-motion: reduce) { .cb-x, .cb-y, .cb-z { transition: none; } }

/* ---------- Brute-force calculator ---------- */
.bf-note { font-size: 14px; color: var(--soft); min-height: 1.4em; margin: -6px 0 0; }
.bf-speed { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 15px; }
.bf-speed legend { padding: 0; margin-bottom: 6px; }
.bf-speed label { display: flex; align-items: center; gap: 8px; }
.bf-speed input { accent-color: var(--cobalt); width: 18px; height: 18px; margin: 0; }
.bf-scale { margin-top: var(--s3); }
.bf-track { height: 22px; background: var(--bg); position: relative; }
.bf-fill { display: block; height: 100%; width: 0; background: var(--cobalt); transition: width .3s ease; }
.bf-scale.is-off .bf-fill { background: repeating-linear-gradient(90deg, var(--cobalt) 0 12px, color-mix(in srgb, var(--cobalt) 55%, var(--bg)) 12px 16px); }
.bf-ticks { position: relative; height: 40px; font-size: 13px; color: var(--soft); }
.bf-ticks span { position: absolute; left: calc(var(--at) * 100%); top: 0; padding-top: 6px; border-left: 1.5px solid var(--field); padding-left: 5px; white-space: nowrap; line-height: 1.2; }
.bf-ticks span:last-child { max-width: 9em; white-space: normal; }
@media (prefers-reduced-motion: reduce) { .bf-fill { transition: none; } }
@media (max-width: 600px) { .bf-ticks { height: 58px; } .bf-ticks span:nth-child(2) { padding-top: 24px; } }

/* ---------- Navigation: header stays in reach; every link visible on phones ---------- */
@media (min-width: 901px) {
  .strip { position: sticky; top: 0; z-index: 10; }
  html { scroll-padding-top: 72px; }
  .filters { top: 56px; }
  .side-in { top: calc(56px + var(--s2)); max-height: calc(100vh - 56px - var(--s3)); overflow-y: auto; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .strip nav a { padding-left: 8px; padding-right: 8px; }
  .theme-toggle span { display: none; }
  .strip-right { gap: var(--s2); }
}
@media (max-width: 900px) {
  .strip-in { flex-direction: column; align-items: flex-start; gap: 0; min-height: 0; padding-top: 12px; position: relative; }
  .strip-right { width: 100%; }
  .theme-toggle { position: absolute; top: 12px; right: 0; }
  .strip nav { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; margin: 8px 0 0; padding: 0; overflow: visible; -webkit-mask-image: none; mask-image: none; border-top: 1px solid rgba(255,255,255,.18); }
  .strip nav a { text-align: center; padding: 11px 2px 10px; font-size: 15px; }
  .strip nav a[aria-current="page"] { background: rgba(255,255,255,.12); }
}
@media (max-width: 760px) {
  .strip nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; margin: 8px 0 0; padding: 0; overflow: visible; -webkit-mask-image: none; mask-image: none; border-top: 1px solid rgba(255,255,255,.18); }
  .strip nav a { text-align: center; padding: 11px 2px 10px; font-size: 15px; }
  .strip nav a[aria-current="page"] { background: rgba(255,255,255,.12); }
}

/* ---------- Start-here path ---------- */
.path { margin-top: var(--s4); }
.path-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.path-head h2 { font-size: 24px; margin: 0; }
.path-head p { color: var(--soft); font-size: 15px; margin: 0; }
.path-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 12px; }
.path-list li { position: relative; }
.path-list li:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: 40px; right: -12px; height: 2px; background: var(--cobalt); }
.path-list a { display: grid; gap: 4px; text-decoration: none; color: var(--ink); padding-bottom: 6px; }
.path-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--cobalt); color: var(--cobalt-ink, #fff); font: 600 17px var(--display); position: relative; z-index: 1; }
.path-t { font: 600 17px/1.3 var(--display); margin-top: 8px; }
.path-w { font-size: 14px; color: var(--soft); line-height: 1.4; }
.path-list a:hover .path-t { color: var(--cobalt); text-decoration: underline; }
@media (max-width: 1080px) { .path-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2) 12px; } .path-list li:nth-child(3)::after { display: none; } }
@media (max-width: 600px) {
  .path-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .path-list li:nth-child(3)::after { display: block; }
  .path-list li:not(:last-child)::after { top: 36px; bottom: 0; left: 17px; right: auto; width: 2px; height: auto; }
  .path-list a { grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; padding-bottom: 16px; }
  .path-n { grid-row: span 2; }
  .path-t { margin-top: 6px; }
}
.path-step { margin-top: var(--s3); background: var(--zone); border-left: 4px solid var(--cobalt); padding: var(--s2) var(--s3); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.path-step p { margin: 0; font-size: 15px; }
.path-step a { font: 600 17px var(--display); color: var(--cobalt); }
.results { list-style: none; padding: 0; margin: var(--s2) 0 0; max-width: var(--col); }

/* The hidden attribute always wins over a display rule. */
[hidden] { display: none !important; }
.results.terms { grid-template-columns: minmax(0, 1fr); }
.search-count { font-size: 14px; color: var(--soft); margin: var(--s1) 0 0; }
.search-count:empty { display: none; }
.gl { text-decoration-style: dotted; text-underline-offset: 3px; }
.jargon { font-size: 15px; color: var(--soft); margin-top: var(--s2); max-width: var(--col); }
.nf-links { margin-top: var(--s3); font-size: 17px; } .nf-links a { color: var(--cobalt); }
/* The step number is drawn by CSS, so copied text and reader views show the list's own numbering once. */
.path-list { counter-reset: step; }
.path-list li { counter-increment: step; }
.path-n::before { content: counter(step); }

/* ---------- Diagrams tile and page ---------- */
.mini-flow { margin-top: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; height: 64px; }
.mini-flow span { background: var(--bg); border-top: 4px solid var(--cobalt); position: relative; }
.mini-flow span:not(:last-child)::after { content: ""; position: absolute; right: -10px; top: 50%; width: 10px; height: 2px; background: var(--field); }
.mini-flow .mf-hot { border-top-color: var(--hot); }
.dg-sec { margin-top: var(--s5, 64px); }
.dg-sec h2 { font-size: 28px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.dg-item { margin-top: var(--s4); }
.dg-item > .anatomy, .dg-item > .diagram { margin-top: 0; }
.dg-terms { font-size: 15px; color: var(--soft); margin-top: 10px; }
.more-dg { font-size: 15px; color: var(--soft); margin-top: 12px; }
@media (min-width: 901px) { .anatomy[id], .diagram[id], .dg-sec, .sec[id] { scroll-margin-top: 76px; } }
.dg-index { margin-top: var(--s2); }
.dg-index summary { cursor: pointer; font-weight: 600; color: var(--cobalt); }
.dg-index ul { list-style: none; padding: 0; margin: var(--s2) 0 0; columns: 3 260px; column-gap: var(--s3); font-size: 15px; }
.dg-index li { break-inside: avoid; padding: 4px 0; }
/* Phones: two filters to a row, search across the full width, so the first deadline shows sooner. */
@media (max-width: 600px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: var(--s3); }
  .filters .f-q { grid-column: 1 / -1; }
  .f-out { gap: 6px 16px; font-size: 14px; }
}
/* Focus rings that show up on blue: white on the header, ink on the cobalt letter squares and buttons. */
.strip :focus-visible { outline-color: #fff; outline-offset: -3px; }
.lgrid a:focus-visible, .fc-group button:focus-visible, .path-list a:focus-visible .path-n { outline: 3px solid var(--ink); outline-offset: 2px; }
.search button:focus-visible, .copy:focus-visible { outline-color: var(--ink); }

/* ---------- Diagrams page: a heading and a line of explanation above each diagram ---------- */
.dg-item { margin-top: var(--s4); }
.dg-h { font: 600 22px/1.25 var(--display); letter-spacing: -0.01em; margin: 0; }
.dg-note { font-size: 16px; color: var(--soft); margin: 6px 0 0; max-width: var(--col); }
.dg-full { font-weight: 600; }
.dg-item > .anatomy, .dg-item > .diagram { margin-top: var(--s2); }

/* ---------- Alternative diagram layouts ---------- */
.alt .is-broken { --fate: var(--hot); } .alt .is-safe { --fate: var(--cobalt); } .alt .is-step { --fate: var(--ink); }

/* Timeline: dated points along a line */
.tl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0 14px; position: relative; }
.tl::before { content: ""; position: absolute; left: 0; right: 0; top: 41px; height: 2px; background: var(--field); }
.tl-item { display: grid; align-content: start; gap: 6px; position: relative; }
.tl-when { font: 600 15px var(--display); color: var(--fate); min-height: 22px; }
.tl-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--fate); border: 3px solid var(--zone); box-sizing: content-box; margin: 2px 0 6px -3px; position: relative; z-index: 1; }
.tl-name { font: 600 17px/1.3 var(--display); }
.tl-name a, .rung-name a, .check-name a, .db-name a, .dtable th a { color: var(--ink); }
.tl-what, .rung-what, .check-what, .db-what { font-size: 15px; line-height: 1.45; }
.tl-note, .rung-note, .check-note, .db-note { font-size: 14px; color: var(--soft); line-height: 1.45; }
@media (max-width: 900px) {
  .tl { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-left: 28px; }
  .tl::before { left: 8px; right: auto; top: 6px; bottom: 6px; width: 2px; height: auto; }
  .tl-dot { position: absolute; left: -28px; top: 2px; margin: 0; }
  .tl-when { min-height: 0; }
}

/* Ladder: bars that rise from weaker to stronger */
.ladder-axis { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--soft); border-bottom: 1.5px solid var(--field); padding-bottom: 4px; margin-bottom: 12px; }
.ladder-axis span:last-child::after { content: " →"; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 14px; align-items: start; }
.rung { display: grid; gap: 6px; grid-template-rows: 110px; grid-auto-rows: auto; align-content: start; }
.rung-bar { display: block; align-self: end; height: var(--h); min-height: 24px; background: var(--fate); }
.rung-name { font: 600 17px/1.3 var(--display); margin-top: 4px; }
.rung-today { font-size: 14px; }
@media (max-width: 900px) {
  .ladder-axis { display: none; }
  .ladder { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rung { grid-template-columns: 110px minmax(0, 1fr); grid-template-rows: none; column-gap: 14px; align-content: start; }
  .rung-bar { grid-row: 1 / span 4; height: 14px; width: var(--h); min-height: 0; align-self: start; margin-top: 6px; }
  .rung-name { margin-top: 0; }
}

/* Table: rows to compare across */
.dtable { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--bg); min-width: 640px; }
.dtable th, .dtable td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--rule); line-height: 1.45; }
.dtable thead th { font-size: 13px; font-weight: 600; color: var(--soft); border-bottom: 2px solid var(--ink); }
.dtable tbody th { font: 600 16px/1.3 var(--display); width: 18%; box-shadow: inset 4px 0 0 var(--fate); padding-left: 16px; }
.dt-status { white-space: nowrap; font-weight: 600; }
.dt-status i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dt-note { color: var(--soft); }
.dtable tbody tr:last-child th, .dtable tbody tr:last-child td { border-bottom: 0; }

/* Checklist: rules that must all hold */
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; background: var(--bg); padding: var(--s2); }
.check-box { display: grid; place-items: center; width: 32px; height: 32px; border: 2.5px solid var(--fate); color: var(--fate); font: 700 18px var(--display); }
.check-body { display: grid; gap: 4px; }
.check-name { font: 600 17px/1.3 var(--display); }
.check-if { font-size: 14px; }
.check.is-broken .check-if { color: var(--hot); }
@media (max-width: 700px) { .checks { grid-template-columns: minmax(0, 1fr); } }

/* Debate: two sides facing each other, then what follows */
.debate { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: stretch; }
.db-side { display: grid; gap: 6px; align-content: start; background: var(--bg); padding: var(--s2); }
.debate .db-side:first-child { border-top: 4px solid var(--hot); }
.debate .db-side:last-child { border-top: 4px solid var(--cobalt); }
.db-vs { align-self: center; font: 700 18px var(--display); color: var(--soft); }
.db-name { font: 600 18px/1.3 var(--display); }
.db-today { font-size: 14px; }
.db-rows { display: grid; gap: 12px; margin-top: 12px; }
.db-row .db-side { border-left: 4px solid var(--ink); }
@media (max-width: 700px) { .debate { grid-template-columns: minmax(0, 1fr); } .db-vs { justify-self: center; } }
@media (min-width: 901px) { .dg-item { scroll-margin-top: 76px; } }
/* Phones: each table row becomes a block, labels inline, so nothing scrolls sideways. */
@media (max-width: 700px) {
  .alt-table .scroll { overflow: visible; }
  .dtable { min-width: 0; }
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable th, .dtable td { display: block; width: auto; }
  .dtable tr { padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--rule); box-shadow: inset 4px 0 0 var(--fate); }
  .dtable tbody th { box-shadow: none; padding: 0 0 4px; width: auto; border: 0; }
  .dtable td { padding: 2px 0; border: 0; }
  .dtable td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink); }
  .dtable td:first-of-type::before { content: none; }
}

/* ---------- Diagrams page contents: every diagram listed under its topic ---------- */
.dg-contents { margin-top: var(--s3); columns: 3 280px; column-gap: var(--s4); }
.dgc-group { break-inside: avoid; margin-bottom: var(--s3); }
.dgc-h { font: 600 18px/1.3 var(--display); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.dgc-h a { color: var(--ink); text-decoration: none; }
.dgc-group ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.dgc-group li { padding: 4px 0; line-height: 1.35; }
.dg-top { margin-top: var(--s3); font-size: 15px; }
/* Diagram buttons in words */
.fc-label { font-size: 14px; font-weight: 600; color: var(--soft); align-self: center; margin-right: -4px; }
.fc-nav { display: inline-flex; align-items: center; gap: 2px; }
.fc-nav[hidden] { display: none !important; }
.fc-group button:disabled { opacity: .35; cursor: default; }
/* Say what the row of jump links under a page title is. */
.intro .toc::before, .finder .toc::before { content: "On this page:"; font-weight: 600; color: var(--ink); margin-right: 2px; }
.nf-links::before { content: none !important; }
.diagram .d-life { stroke: var(--field); stroke-width: 1.5; stroke-dasharray: 4 5; }
.diagram .d-warn { fill: var(--hot-zone, var(--bg)); stroke: var(--hot); stroke-width: 1.6; }
.diagram .d-dash { stroke-dasharray: 5 5; }

/* ---------- Reading and Learning: a drawn cover or icon beside each item ---------- */
.res-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 16px; align-content: start; }
.res-list li > p { grid-column: 2; }
.res-thumb { grid-column: 1; grid-row: 1 / span 3; align-self: start; display: block; width: 64px; }
.res-thumb svg { display: block; width: 100%; height: auto; }
.th-doc, .th-page { width: 48px; margin-left: 8px; }
.ic-bg { fill: var(--ink); } .ic-fg { fill: var(--bg); }
.ic-paper { fill: var(--bg); stroke: var(--field); stroke-width: 1.5; }
.ic-fold { fill: var(--zone); stroke: var(--field); stroke-width: 1.5; }
.ic-line { stroke: var(--field); stroke-width: 2; stroke-linecap: round; }
.ic-block { fill: var(--cobalt); }
.ic-dot { fill: var(--field); }
.ic-code { fill: none; stroke: var(--cobalt); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.th-video .ic-bg { fill: var(--hot); } .th-audio .ic-bg { fill: var(--cobalt); }
/* Book covers: title and author on a coloured cover with a darker spine */
.th-book { height: 90px; padding: 7px 6px 6px 9px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; box-shadow: inset 4px 0 0 rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .15); border-radius: 2px; }
.cv-t { overflow-wrap: anywhere; hyphens: auto; font: 600 10px/1.15 var(--display); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cv-a { font: 500 8px/1.2 var(--text); opacity: .85; }
.cv0 { background: #1240e0; } .cv1 { background: #1b2447; } .cv2 { background: #8c1d3a; } .cv3 { background: #0f5f63; } .cv4 { background: #7a4d00; }
.diagram .d-code { fill: var(--cobalt); }
.diagram .d-xmark { stroke: var(--hot); stroke-width: 3; stroke-linecap: round; fill: none; }
/* Phones: a hint and an edge fade on drawings that scroll sideways */
.swipe-hint { font-size: 14px; font-weight: 600; color: var(--cobalt); margin: 0 0 8px; }
.diagram { position: relative; }
.diagram.can-scroll .scroll { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.diagram.can-scroll.at-end .scroll { -webkit-mask-image: none; mask-image: none; }
.diagram.at-end .swipe-hint { visibility: hidden; }
