/* 137AI - network skeleton (AustinIO, DatacentersX and SemiconductorX structure).
   Layout: sticky head with dropdown nav, hero with page-specific signature art, data strip,
   sticky contents sidebar with section highlighting, color-banded tables, Record section.
   Two color systems carry meaning:
   1. Agent class (data-a): physical, personal and ambient, software.
   2. Who found the failure first (data-f): developer, user or deployer, target or victim, third party.
      Drawn as a sequence of the brand violet, darkest when the developer caught its own failure.
   A third, small set (data-k) marks whether a reporting rule applied to an incident. */

:root {
  --bg: #F5F4F8;
  --bg-2: #EAE8F0;
  --panel: #FFFFFF;
  --line: #D0CDDA;
  --line-soft: #E2E0E9;
  --fg: #15131B;
  --fg-2: #3F3B4E;
  --fg-3: #6C6780;
  --head: #3B1C7A;
  --link: #5B21B6;
  --brand: #6D28D9;
  --hero: #ECEAF3;
  --grid: rgba(109,40,217,.06);
  /* agent classes */
  --a-phys: #C2410C;
  --a-pers: #0F766E;
  --a-soft: #1D4ED8;
  /* reporting rule status */
  --k-yes: #15803D;
  --k-later: #B45309;
  --k-no: #B91C1C;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --wrap: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100E15; --bg-2: #18151F; --panel: #1E1A27; --line: #383246; --line-soft: #272233;
    --fg: #ECEAF2; --fg-2: #BAB5C9; --fg-3: #8A849B; --head: #CDB8FF; --link: #B69CFF; --brand: #9F7AFA;
    --hero: #0D0B12; --grid: rgba(159,122,250,.05);
    --a-phys: #F08A4B; --a-pers: #3CC7B5; --a-soft: #6F9BF5;
    --k-yes: #4FCB7D; --k-later: #F0A54A; --k-no: #F07575;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #100E15; --bg-2: #18151F; --panel: #1E1A27; --line: #383246; --line-soft: #272233;
  --fg: #ECEAF2; --fg-2: #BAB5C9; --fg-3: #8A849B; --head: #CDB8FF; --link: #B69CFF; --brand: #9F7AFA;
  --hero: #0D0B12; --grid: rgba(159,122,250,.05);
  --a-phys: #F08A4B; --a-pers: #3CC7B5; --a-soft: #6F9BF5;
  --k-yes: #4FCB7D; --k-later: #F0A54A; --k-no: #F07575;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.62; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- agent class ---------- */
[data-a="phys"] { --cc: var(--a-phys); }
[data-a="pers"] { --cc: var(--a-pers); }
[data-a="soft"] { --cc: var(--a-soft); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--fg-3)); margin-right: 8px; vertical-align: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 20px; padding: 0; list-style: none; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); }

/* ---------- who found the failure first ---------- */
[data-f="dev"] { --ff: var(--brand); --fs: var(--brand); }
[data-f="user"] { --ff: color-mix(in srgb, var(--brand) 50%, var(--panel)); --fs: var(--brand); }
[data-f="target"] { --ff: color-mix(in srgb, var(--brand) 12%, var(--panel)); --fs: var(--brand); }
[data-f="third"] { --ff: var(--panel); --fs: var(--fg-3); }
.f-sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: -2px; background: var(--ff); border: 1.5px solid var(--fs); }
[data-f="third"] .f-sw, .f-sw[data-f="third"] { border-style: dashed; }
.f-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: var(--ff); border: 1px solid var(--fs); color: var(--fg); }
[data-f="dev"] .f-tag, .f-tag[data-f="dev"] { color: #fff; }
[data-f="third"] .f-tag, .f-tag[data-f="third"] { border-style: dashed; }
.dg-f { fill: var(--ff); stroke: var(--fs); stroke-width: 1.8; }
[data-f="third"] > .dg-f, .dg-f[data-f="third"] { stroke-dasharray: 3 2.5; }

/* ---------- reporting rule status ---------- */
[data-k="yes"] { --kk: var(--k-yes); }
[data-k="later"] { --kk: var(--k-later); }
[data-k="no"] { --kk: var(--k-no); }
[data-k="none"] { --kk: var(--fg-3); }
.tbl tr[data-k] td:first-child { border-left: 4px solid var(--kk); font-weight: 600; }
.k-tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: var(--kk); border: 1px solid var(--kk); background: color-mix(in srgb, var(--kk) 8%, var(--panel)); }
.dg-k { fill: color-mix(in srgb, var(--kk) 12%, var(--panel)); stroke: var(--kk); stroke-width: 1.4; }
.dg-k-t { fill: var(--kk); }

/* ---------- header and nav ---------- */
.head { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.head__in { display: flex; align-items: center; gap: 24px; height: 64px; position: relative; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); white-space: nowrap; }
.logo svg { width: 28px; height: 28px; flex: none; }
.lg-ring { fill: none; stroke: var(--fg-3); stroke-width: 1.6; stroke-linecap: round; }
.lg-ring--in { stroke: color-mix(in srgb, var(--brand) 70%, var(--fg-3)); }
.lg-on { fill: var(--brand); }
.logo__word { font-family: var(--display); font-variation-settings: "wdth" 112; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.logo__word span { color: var(--brand); }

.nv { display: flex; align-items: center; gap: 0; margin-left: auto; }
.nv-item { position: relative; }
.nv-top { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 20px 8px; box-shadow: inset 0 -2px 0 transparent; transition: color .15s, box-shadow .15s; white-space: nowrap; }
.nv-top::after { content: ""; width: 5px; height: 5px; border-right: 1.3px solid currentColor; border-bottom: 1.3px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); opacity: .5; }
.nv-top:hover, .nv-item:hover .nv-top, .nv-item:focus-within .nv-top, .nv-top[aria-current] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--brand); }
.nv-panel { position: absolute; top: 100%; left: -12px; min-width: 250px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--brand); border-radius: 0 0 6px 6px; padding: 12px 0; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s; box-shadow: 0 18px 36px -20px rgba(18,20,26,.35); }
.nv-item:hover .nv-panel, .nv-item:focus-within .nv-panel { opacity: 1; visibility: visible; transform: none; }
.nv-panel ul { list-style: none; margin: 0; padding: 0; }
.nv-panel a { display: block; padding: 5px 18px; font-size: 14.5px; color: var(--fg-2); text-decoration: none; white-space: nowrap; border-left: 2px solid transparent; }
.nv-panel a:hover, .nv-panel a:focus-visible { color: var(--fg); background: var(--bg-2); border-left-color: var(--brand); }
.nv-h { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); padding: 12px 18px 4px; }
.nv-item--mega { position: static; }
.nv-panel--mega { left: 16px; right: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; padding: 16px 8px 18px; }
.nv-panel--mega4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nv-panel--mega .nv-h { padding-top: 2px; }
.nv-panel--mega a { white-space: normal; }
.nv-item:not(.nv-item--mega):nth-last-child(-n+3) .nv-panel { left: auto; right: -12px; }
.burger { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); font: 500 14px var(--body); padding: 6px 12px; cursor: pointer; }

/* ---------- home hero ---------- */
.hero { position: relative; background: var(--hero); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before, .dp-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 32px 32px; }
.hero__in { position: relative; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 40px; align-items: center; padding-block: 52px 32px; }
.hero h1 { font-family: var(--display); font-variation-settings: "wdth" 118; font-weight: 750; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.02; letter-spacing: -.02em; margin: 14px 0 20px; max-width: 15ch; }
.hero__sub { font-size: clamp(17px, 1.5vw, 19px); color: var(--fg-2); max-width: 54ch; margin: 0; }
.hero__acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-block; padding: 11px 18px; border-radius: 6px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--fg); color: var(--bg); background: var(--fg); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.hero__map svg { display: block; width: 100%; height: auto; }

.meta { position: relative; border-top: 1px solid var(--line); }
.meta__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.meta__c { padding: 16px 20px; border-left: 1px solid var(--line); }
.meta__c:first-child { border-left: 0; padding-left: 0; }
.meta__v { font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; }
.meta__v em { font-style: normal; color: var(--fg-3); font-size: 13px; }

/* ---------- home sections ---------- */
.sec { padding-block: 72px; border-bottom: 1px solid var(--line-soft); }
.sec__k { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--head); display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.sec__k::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.sec h2 { font-family: var(--display); font-variation-settings: "wdth" 110; font-weight: 700; font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -.015em; color: var(--fg); margin: 0 0 12px; max-width: 30ch; }
.sec__lede { color: var(--fg-2); max-width: 66ch; margin: 0 0 36px; }

.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.pillar { background: var(--panel); padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; border-top: 3px solid var(--cc, var(--brand)); }
.pillar--wide { grid-column: span 2; }
.pillar h3 { font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 650; font-size: 21px; margin: 0; }
.pillar h3 a { color: var(--fg); text-decoration: none; }
.pillar h3 a:hover { color: var(--link); }
.pillar p { margin: 0; color: var(--fg-2); font-size: 15.5px; }
.pillar ul { list-style: none; margin: auto 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14.5px; }
.pillar svg { width: 40px; height: 40px; color: var(--cc, var(--head)); }

.starts, .sis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.start { display: block; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--cc, var(--line)); border-radius: 6px; padding: 20px 20px 22px; text-decoration: none; color: var(--fg); transition: border-color .15s, transform .15s; }
.start:hover, .start:focus-visible { border-color: var(--brand); transform: translateY(-2px); }
.start h3 { font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 650; font-size: 19px; margin: 8px 0 6px; }
.start p { margin: 0; color: var(--fg-2); font-size: 15px; }

.book { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 28px 32px; }
.book__img { display: block; width: 120px; height: auto; border-radius: 3px; box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.book h3 { font-family: var(--display); font-variation-settings: "wdth" 110; font-weight: 700; font-size: 24px; margin: 6px 0 8px; }
.book p { margin: 0 0 14px; color: var(--fg-2); max-width: 62ch; }

/* ---------- tables ---------- */
.tscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.tbl { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; }
.tbl caption { text-align: left; padding: 12px 16px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); border-bottom: 1px solid var(--line); }
.tbl th { text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--fg-3); padding: 10px 16px; background: var(--bg-2); }
.tbl td { padding: 12px 16px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.tbl td.num, .tbl th.num { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.tbl tr[data-c] td:first-child { border-left: 4px solid var(--cc); font-weight: 600; }
.tbl tr.ph td { color: var(--fg-3); font-style: italic; }
.tbl .sub { display: block; font-size: 13px; font-weight: 400; color: var(--fg-3); }
.tbl--dense { font-size: 14.5px; }
.tbl--dense td { padding: 9px 14px; }
.tbl th[data-sort] { cursor: pointer; white-space: nowrap; }
.tbl th[data-sort]::after { content: " \2195"; opacity: .4; }
.tbl th[aria-sort="ascending"]::after { content: " \2191"; opacity: 1; }
.tbl th[aria-sort="descending"]::after { content: " \2193"; opacity: 1; }

/* ---------- interior page ---------- */
.dp-hero { position: relative; background: var(--hero); border-bottom: 1px solid var(--line); overflow: hidden; }
.dp-hero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 40px 36px; }
.crumb { font-size: 14px; color: var(--fg-3); }
.crumb a { color: var(--fg-3); }
.dp-hero h1 { font-family: var(--display); font-variation-settings: "wdth" 118; font-weight: 750; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.02; letter-spacing: -.02em; margin: 14px 0 10px; }
.dp-hero__anchor { font-family: var(--mono); font-size: 13px; color: var(--fg-3); margin: 0 0 18px; }
.dp-hero__thesis { font-size: 18px; color: var(--fg-2); margin: 0; max-width: 58ch; }
.dp-hero__thesis strong { color: var(--fg); }
.dp-hero__art svg { display: block; width: 100%; max-width: 500px; height: auto; margin-left: auto; }

.strip { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.strip__grid { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
.strip__c { padding: 14px 18px; border-left: 1px solid var(--line); min-width: 0; }
.strip__c:first-child { border-left: 0; padding-left: 0; }
.strip__v { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }

.dp-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-block: 48px 80px; }
.dp-body > main { min-width: 0; }
.toc { position: sticky; top: 88px; align-self: start; font-size: 14.5px; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: var(--fg-3); margin: 0 0 10px; }
.toc ol, .toc ul { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 4px; }
.toc a { color: var(--fg-2); text-decoration: none; display: block; padding: 2px 0 2px 12px; border-left: 2px solid var(--line-soft); }
.toc a:hover { color: var(--fg); }
.toc a.is-active { color: var(--fg); border-left-color: var(--brand); }
.toc .here { display: block; padding: 2px 0 2px 12px; border-left: 2px solid var(--brand); font-weight: 600; }
.toc ul a { border-left-color: transparent; }

.dp-sec { padding-bottom: 52px; margin-bottom: 52px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 96px; }
.dp-sec:last-child { border-bottom: 0; }
.dp-sec h2 { font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 700; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; color: var(--head); margin: 0 0 10px; }
.dp-sec h3 { font-family: var(--display); font-variation-settings: "wdth" 108; font-weight: 650; font-size: 20px; margin: 32px 0 6px; }
.dp-sec__lede { font-size: 18.5px; color: var(--fg); margin: 0 0 18px; max-width: 62ch; }
.dp-sec p { max-width: 68ch; }
.dp-sec ul { max-width: 66ch; padding-left: 20px; }
.dp-sec li { margin-bottom: 6px; }
.dp-sec .tscroll { margin: 22px 0; }
.note { border-left: 4px solid var(--cc, var(--head)); background: var(--panel); padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 18px 0; max-width: 68ch; }
.note p { margin: 0; }
.related { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.record dl { display: grid; grid-template-columns: 160px 1fr; gap: 10px 20px; margin: 0; font-size: 15.5px; }
.record dt { color: var(--fg-3); }
.record dd { margin: 0; }

/* ---------- figures (in-page diagrams) ---------- */
.fig { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 18px 18px 12px; margin: 22px 0; }
.fig svg { display: block; width: 100%; height: auto; }
.fig--scroll { overflow-x: auto; }
.fig--scroll svg { min-width: 640px; }
.fig figcaption, .fig__cap { font-size: 14.5px; color: var(--fg-2); margin: 10px 0 0; }
.fig .legend { margin: 12px 0 0; }

/* ---------- shared diagram vocabulary (hero and in-page SVG) ---------- */
.dg-cap { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; fill: var(--fg-3); }
.dg-t { font-family: var(--body); font-size: 13px; fill: var(--fg); }
.dg-t--b { font-weight: 600; }
.dg-t--sm { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; fill: var(--fg-2); }
.dg-t--xs { font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em; fill: var(--fg-3); }
.dg-t--on { fill: #fff; }
.dg-name { font-family: var(--display); font-variation-settings: "wdth" 108; font-size: 15px; font-weight: 700; fill: var(--fg); }
.dg-num { font-family: var(--mono); font-size: 10px; font-weight: 600; fill: var(--fg-3); }
.dg-big { font-family: var(--display); font-variation-settings: "wdth" 115; font-size: 30px; font-weight: 800; fill: var(--fg); }
.dg-grid { stroke: var(--line-soft); stroke-width: 1; }
.dg-axis { stroke: var(--fg-3); stroke-width: 1; }
.dg-line { stroke: var(--fg-3); stroke-width: 1.5; fill: none; }
.dg-flow { stroke: var(--fg-3); stroke-width: 1.5; fill: none; marker-end: url(#dg-arr); }
.dg-arrhead { fill: var(--fg-3); }
.dg-box { fill: var(--panel); stroke: var(--line); stroke-width: 1.2; }
.dg-stage { fill: color-mix(in srgb, var(--cc) 14%, var(--panel)); stroke: var(--cc); stroke-width: 1.5; }
.dg-stage--solid { fill: var(--cc); }
.dg-bar { fill: var(--cc, var(--brand)); }
.dg-bar--soft { fill: color-mix(in srgb, var(--cc, var(--brand)) 35%, var(--panel)); stroke: var(--cc, var(--brand)); stroke-width: 1; }
.dg-ring { fill: none; stroke: var(--brand); stroke-width: 2; }
.dg-loop { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-dasharray: 2 6; stroke-linecap: round; }
a .dg-stage { transition: stroke-width .15s; }
a:hover .dg-stage, a:focus-visible .dg-stage { stroke-width: 3; }
a:hover .dg-t--b { text-decoration: underline; }

/* ---------- footer ---------- */
.foot { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: 48px 28px; font-size: 14.5px; }
.foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: var(--fg-3); margin: 0 0 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot a { color: var(--fg-2); text-decoration: none; }
.foot a:hover { color: var(--fg); }
.foot__note { color: var(--fg-3); margin: 12px 0 0; max-width: 34ch; }
.foot__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 13.5px; }

.totop { position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--fg-2); cursor: pointer; display: grid; place-items: center; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s, color .2s, border-color .2s; }
.totop[data-show] { opacity: 1; visibility: visible; transform: none; }
.totop:hover { color: var(--brand); border-color: var(--brand); }
.totop svg { width: 18px; height: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1220px) {
  .nv-top { padding: 20px 6px; font-size: 13.5px; }
  .head__in { gap: 16px; }
}
@media (max-width: 1060px) {
  .burger { display: block; }
  .nv { display: none; }
  .nv[data-open] { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); gap: 0; }
  .nv-item, .nv-item--mega { position: static; }
  .nv-top { display: block; padding: 10px 0; font-size: 16px; box-shadow: none !important; }
  .nv-top::after, .nv-panel, .nv-item:hover .nv-panel, .nv-item:focus-within .nv-panel { display: none; }
  .hero__in, .dp-hero__in { grid-template-columns: minmax(0, 1fr); }
  .hero__map svg { max-width: 600px; margin: 0 auto; }
  .dp-hero__art svg { max-width: 440px; margin: 0; }
  .dp-body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; display: none; }
  .strip__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip__c:nth-child(3n+1) { border-left: 0; padding-left: 0; }
  .strip__c:nth-child(n+4) { border-top: 1px solid var(--line); }
  .starts, .sis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .pillars, .starts, .sis { grid-template-columns: minmax(0, 1fr); }
  .pillar--wide { grid-column: auto; }
  .meta__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta__c:nth-child(3) { border-left: 0; padding-left: 0; }
  .meta__c:nth-child(n+3) { border-top: 1px solid var(--line); }
  .strip__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip__c:nth-child(3n+1) { border-left: 1px solid var(--line); padding-left: 18px; }
  .strip__c:nth-child(odd) { border-left: 0; padding-left: 0; }
  .strip__c:nth-child(n+3) { border-top: 1px solid var(--line); }
  .book { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .record dl { grid-template-columns: 1fr; gap: 2px; }
  .record dd { margin-bottom: 10px; }
  .sec { padding-block: 52px; }
  .foot__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition-duration: .001ms !important; } }
.dp-sec ul.legend { padding-left: 0; max-width: none; }
.dp-sec ul.legend li { margin-bottom: 0; }

/* utility pages (ut-) */
.ut-hero .dp-hero__in { grid-template-columns: minmax(0, 1fr); }
.ut-hero .dp-hero__thesis { max-width: 72ch; }
.ut-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; padding: 0; list-style: none; }
.ut-jump li { margin: 0; }
.ut-jump a { display: inline-block; min-width: 34px; text-align: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 14px; text-decoration: none; color: var(--fg); background: var(--panel); }
.ut-jump a:hover { border-color: var(--brand); color: var(--brand); }
.ut-gl { margin: 0; }
.ut-gl dt { font-family: var(--display); font-weight: 700; font-size: 17px; margin-top: 18px; color: var(--fg); }
.ut-gl dt:first-child { margin-top: 0; }
.ut-gl dd { margin: 4px 0 0; color: var(--fg-2); max-width: 74ch; }
.ut-gl dd a.ut-see { font-family: var(--mono); font-size: 12.5px; margin-left: 6px; white-space: nowrap; }
.ut-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 18px 20px; max-width: 74ch; }
.ut-card ul { margin: 0; padding-left: 18px; }
.ut-card li { margin: 6px 0; }

/* full-dataset section (ds_common) */
.ds { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); margin-top: 14px; }
.ds > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--link); list-style: none; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.ds > summary::-webkit-details-marker { display: none; }
.ds > summary::before { content: "+"; font-family: var(--mono, monospace); width: 1ch; }
.ds[open] > summary::before { content: "-"; }
.ds__t { font-family: var(--mono, monospace); font-size: 12px; font-weight: 400; color: var(--fg-3); }
.ds .tscroll { padding: 0 12px 12px; }

/* motion pilot: flows, loop marker, staged build-up; off for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .dg-flow.mv { stroke-dasharray: 6 5; animation: mv-dash 1.2s linear infinite; }
  .mv-spin { transform-box: view-box; animation: mv-rot 9s linear infinite; }
  .mv-step { opacity: 0; animation: mv-in 9s ease-in-out infinite; animation-delay: calc(var(--i) * 1.1s); }
}
.mv-dot { fill: var(--brand); stroke: var(--panel); stroke-width: 2; }
@keyframes mv-dash { to { stroke-dashoffset: -22; } }
@keyframes mv-rot { to { transform: rotate(360deg); } }
@keyframes mv-in { 0% { opacity: 0; } 8%, 82% { opacity: 1; } 95%, 100% { opacity: 0; } }

/* ---------- 137AI diagram parts ---------- */
.dg-band { fill: var(--cc); }
.dg-row { fill: transparent; }
a.dg-link:hover .dg-row, a.dg-link:focus-visible .dg-row { fill: color-mix(in srgb, var(--brand) 6%, transparent); }
a.dg-link:hover .dg-f, a.dg-link:focus-visible .dg-f { stroke-width: 3; }
.dg-clock { fill: color-mix(in srgb, var(--brand) 70%, var(--panel)); }
.dg-clock--later { fill: color-mix(in srgb, var(--brand) 8%, var(--panel)); stroke: var(--brand); stroke-width: 1.2; stroke-dasharray: 4 3; }
.dg-span { fill: color-mix(in srgb, var(--brand) 14%, transparent); }
.dg-tick { stroke: var(--fg-3); stroke-width: 1; }
.dg-mark { stroke: var(--brand); stroke-width: 2; }
.dg-node { fill: var(--panel); stroke: var(--brand); stroke-width: 2; }
.dg-node--on { fill: var(--brand); }
.schema { columns: 2 260px; column-gap: 32px; margin: 18px 0; padding: 0 !important; list-style: none; max-width: none !important; }
.schema li { break-inside: avoid; margin: 0 0 10px; font-size: 15px; }
.schema code { font-family: var(--mono); font-size: 13px; color: var(--head); }
.dp-sec ul.schema li { margin-bottom: 10px; }
.nv-panel--mega2 { grid-template-columns: repeat(2, minmax(0, 1fr)); left: auto; right: 16px; width: min(640px, calc(100% - 32px)); }
[data-f="nd"] { --ff: var(--panel); --fs: var(--line); }
[data-f="nd"] .f-sw, .f-sw[data-f="nd"], [data-f="nd"] .f-tag, .f-tag[data-f="nd"] { border-style: dotted; color: var(--fg-3); }
[data-f="nd"] > .dg-f, .dg-f[data-f="nd"] { stroke-dasharray: 1.5 2.5; }
[data-k="vol"] { --kk: var(--k-yes); }
/* Agent-class banding for table rows (agents hub, registry) */
.tbl tr[data-a] td:first-child { border-left: 4px solid var(--cc); font-weight: 600; }
.dg-hm-a { fill: var(--cc); }
/* Voluntary standards and frameworks get their own color, distinct from in-force rules */
[data-k="vol"] { --kk: #0E7490; }
/* glossary and site pages */
.gl-jump { display: flex; flex-wrap: wrap; gap: 6px; max-width: none; font-family: var(--mono); font-size: 14px; }
.gl-jump a { display: inline-block; min-width: 30px; padding: 4px 0; text-align: center; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.gl-jump a:hover { border-color: currentColor; }
.dp-sec.gl-sec { padding-top: 8px; scroll-margin-top: 80px; }
.gl-l { font-family: var(--display); font-size: 28px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.gl { margin: 0; max-width: 72ch; }
.gl dt { font-weight: 600; margin-top: 16px; scroll-margin-top: 90px; }
.gl dd { margin: 4px 0 0; color: var(--fg-2); }
.gl-see { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.gl-see::before { content: "\2192\00a0"; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 20px; margin: 0 0 14px; max-width: 68ch; }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }
