/* Global Burden of Suffering — shared styles.
   Colour roles follow the validated reference palette (see docs/design.md). */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --axis-ink: #737169;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --link: #1c5cab;
  --focus: #2a78d6;

  /* Group identity (categorical slots 1–3; "other" is de-emphasis gray) */
  --g-farmed: #2a78d6;
  --g-caught: #eb6834;
  --g-wild: #1baf7a;
  --g-other: #a3a199;

  /* Pain intensity (ordinal, validated --ordinal) */
  --pain-1: #ec9a5e;
  --pain-2: #e0703f;
  --pain-3: #c2402a;
  --pain-4: #7f1d1d;

  /* Pipeline stage ordinal ramp (blue, steps 250→650) */
  --stage-1: #86b6ef;
  --stage-2: #5598e7;
  --stage-3: #2a78d6;
  --stage-4: #1c5cab;
  --stage-5: #104281;

  --good: #006300;
  --warn-bg: #fdf3dc;
  --warn-ink: #6b4a00;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;

  --radius: 8px;
  --gutter: 16px;
  --max: 1160px;
  --prose: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #a3a199;
    --axis-ink: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --link: #86b6ef;
    --focus: #6da7ec;
    --g-farmed: #3987e5;
    --g-caught: #d95926;
    --g-wild: #199e70;
    --g-other: #6f6e69;
    --pain-1: #94321f;
    --pain-2: #b8402a;
    --pain-3: #e0703f;
    --pain-4: #f4b07a;
    --stage-1: #184f95;
    --stage-2: #1c5cab;
    --stage-3: #2a78d6;
    --stage-4: #5598e7;
    --stage-5: #9ec5f4;
    --good: #0ca30c;
    --warn-bg: #3a2f12;
    --warn-ink: #f3d58a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #a3a199;
  --axis-ink: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --link: #86b6ef;
  --focus: #6da7ec;
  --g-farmed: #3987e5;
  --g-caught: #d95926;
  --g-wild: #199e70;
  --g-other: #6f6e69;
  --pain-1: #94321f;
  --pain-2: #b8402a;
  --pain-3: #e0703f;
  --pain-4: #f4b07a;
  --stage-1: #184f95;
  --stage-2: #1c5cab;
  --stage-3: #2a78d6;
  --stage-4: #5598e7;
  --stage-5: #9ec5f4;
  --good: #0ca30c;
  --warn-bg: #3a2f12;
  --warn-ink: #f3d58a;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 var(--font-sans);
  overflow-x: hidden;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1, h2 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
small, .small { font-size: 0.875rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--prose); }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--font-serif); font-weight: 650; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-tag { font-size: 0.8rem; color: var(--muted); }
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.site-nav a {
  text-decoration: none; color: var(--ink-2); padding: 6px 10px; border-radius: 6px; font-size: 0.95rem;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.theme-toggle {
  border: 1px solid var(--border-strong); background: transparent; color: var(--ink-2);
  border-radius: 6px; padding: 5px 9px; cursor: pointer; font: inherit; font-size: 0.85rem;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface-2); }
@media (max-width: 760px) {
  .site-header { position: static; }
  .site-header .wrap { gap: 6px; padding-top: 10px; padding-bottom: 8px; }
  .brand-tag { display: none; }
  .site-nav { margin-left: 0; width: 100%; gap: 0; }
  .site-nav a { padding: 6px 8px; font-size: 0.9rem; }
}

/* ---------- Page sections ---------- */
main { padding-bottom: 64px; }
.hero { padding: 48px 0 28px; }
.hero .eyebrow { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.hero h1 { max-width: 22ch; }
.hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; margin-top: 14px; }
.section { padding: 36px 0 8px; }
.section > .wrap > h2, .section-head h2 { margin-bottom: 8px; }
.section-head { margin-bottom: 18px; }
.section-head p { color: var(--ink-2); max-width: var(--prose); margin: 0; }
.page-head { padding: 40px 0 20px; }
.page-head p { color: var(--ink-2); max-width: var(--prose); margin-top: 12px; font-size: 1.05rem; }

/* ---------- Stat tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0 8px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 16px; min-width: 0;
}
.kpi-label { font-size: 0.85rem; color: var(--ink-2); }
.kpi-value { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 650; margin: 2px 0 2px; letter-spacing: -0.01em; }
.kpi-note { font-size: 0.8rem; color: var(--muted); }
.hero-figure { font-size: clamp(3rem, 8vw, 4.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.hero-figure-row { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.hero-figure-caption { color: var(--ink-2); max-width: 64ch; }

/* ---------- Figure card ---------- */
.figure {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin: 0 0 24px; min-width: 0;
}
.figure-head { padding: 18px 20px 6px; }
.figure-title { font-size: 1.15rem; font-weight: 650; margin: 0; }
.figure-subtitle { color: var(--ink-2); font-size: 0.95rem; margin: 4px 0 0; max-width: 80ch; }
.figure-body { padding: 4px 20px 12px; min-width: 0; }
.figure-foot {
  border-top: 1px solid var(--border); padding: 10px 20px 12px; font-size: 0.82rem; color: var(--muted);
  display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap;
}
@media (max-width: 600px) {
  .figure-head { padding: 14px 14px 4px; }
  .figure-body { padding: 4px 12px 10px; }
  .figure-foot { padding: 10px 14px 12px; }
}

/* Tabs (Chart | Table | Sources | Download) */
.tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 0.9rem;
  padding: 9px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabpanel[hidden] { display: none; }
@media (max-width: 600px) { .tabs { padding: 0 8px; } }

/* ---------- Controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; padding: 10px 0 6px; }
.control { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.control-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 0.88rem;
  padding: 6px 11px; cursor: pointer; border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
select, input[type="search"], input[type="number"] {
  font: inherit; font-size: 0.9rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 9px; max-width: 100%;
}
input[type="number"] { width: 6.5em; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 0.9rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--ink-2); border-radius: 999px; padding: 4px 11px 4px 9px;
  font: inherit; font-size: 0.86rem; cursor: pointer;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip[aria-pressed="false"] { color: var(--muted); border-style: dashed; }
.chip[aria-pressed="false"] .swatch { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--axis-ink); }
.chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink-2); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.btn {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); border-radius: 7px;
  padding: 6px 12px; font: inherit; font-size: 0.88rem; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-2); }
.btn-link { border: 0; background: none; color: var(--link); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-sans); }
.axis text, .tick text { fill: var(--axis-ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.axis .domain { stroke: var(--axis); }
.axis .tick line { stroke: var(--grid); }
.gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.bar-label { fill: var(--ink); font-size: 12.5px; }
.bar-value { fill: var(--ink-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.whisker { stroke: var(--ink-2); stroke-width: 1.25; opacity: 0.7; }
.mark-hit { fill: transparent; cursor: pointer; }
.mark-hit:hover + .mark, .mark.is-hover { filter: brightness(1.12); }
.row-hit:focus-visible { outline: none; }
.row-hit:focus-visible rect.row-bg { stroke: var(--focus); stroke-width: 2px; }
.row-bg { fill: transparent; }
.row:hover .row-bg { fill: var(--surface-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--ink-2); margin: 4px 0 8px; }
.legend-item { display: inline-flex; gap: 6px; align-items: center; }
.chart-note { font-size: 0.85rem; color: var(--ink-2); margin: 6px 0 4px; }
.callout {
  background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; color: var(--ink-2);
  font-size: 0.93rem; margin: 10px 0;
}
.callout strong { color: var(--ink); }
.callout.warn { background: var(--warn-bg); color: var(--warn-ink); }
.callout.warn strong { color: inherit; }

.tooltip {
  position: fixed; pointer-events: none; z-index: 50; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 11px; font-size: 0.85rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14); max-width: 300px; opacity: 0; transition: opacity 80ms;
}
.tooltip.show { opacity: 1; }
.tt-title { font-weight: 650; margin-bottom: 4px; }
.tt-value { font-size: 1.05rem; font-weight: 700; }
.tt-row { display: flex; gap: 8px; justify-content: space-between; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tt-row span:last-child { color: var(--ink); }
.tt-key { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; }
.tt-sub { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

/* Treemap */
.tm-cell rect { stroke: var(--surface); stroke-width: 2px; }
.tm-cell text { pointer-events: none; font-size: 12px; }
.tm-cell .tm-name { font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; max-width: 100%; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { font-weight: 600; color: var(--ink-2); font-size: 0.8rem; white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
table.data th button { all: unset; cursor: pointer; }
table.data th button:hover { color: var(--ink); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tbody tr:hover { background: var(--surface-2); }
.cell-bar { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.cell-bar .log-track { flex: 0 0 120px; position: relative; height: 12px; }
.cell-bar .log-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--grid); }
.cell-bar .log-dot { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Tier badges ---------- */
.tier {
  display: inline-block; font-size: 0.72rem; font-weight: 650; border-radius: 4px; padding: 1px 6px;
  border: 1px solid var(--border-strong); color: var(--ink-2); white-space: nowrap; vertical-align: 1px;
}
.tier-1 { color: var(--ink); border-color: var(--ink-2); }
.tier-3 { opacity: 0.75; }
.src-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.src-list li { font-size: 0.88rem; color: var(--ink-2); }
.src-list a { word-break: break-word; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 12px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0;
}
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover, button.card:hover { border-color: var(--ink-2); }
.card h3 { margin-bottom: 4px; }
.card .meta { font-size: 0.83rem; color: var(--muted); }
.badge {
  display: inline-flex; gap: 5px; align-items: center; font-size: 0.75rem; color: var(--ink-2);
  background: var(--surface-2); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.lane { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-width: 0; }
.lane-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin: 2px 2px 10px; }
.lane-head h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 7px; }
.lane-head .count { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lane-desc { font-size: 0.78rem; color: var(--muted); margin: -6px 2px 10px; }
.lane-cards { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.lane-more { margin: 8px 2px 0; }
.icard {
  display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 10px 11px; cursor: pointer; font: inherit; color: var(--ink);
}
.icard:hover { border-color: var(--ink-2); }
.icard-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.icard-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; min-width: 0; }
.icard-meta .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.icard { min-width: 0; overflow-wrap: anywhere; }
.icard-ce { font-size: 0.78rem; color: var(--ink-2); margin-top: 6px; }
.icard-sads { font-size: 0.8rem; color: var(--ink-2); margin-top: 7px; font-variant-numeric: tabular-nums; }
.icard-sads strong { color: var(--ink); font-weight: 650; }
.sads-list { margin: 0; padding-left: 18px; }
.sads-list li { margin-bottom: 6px; }
.lane-empty { font-size: 0.82rem; color: var(--muted); padding: 6px 2px; }
@media (max-width: 1000px) {
  .board { grid-template-columns: 1fr; }
  .lane-cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
.stage-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* Dialog */
dialog.detail {
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 0; max-width: min(720px, calc(100vw - 24px));
  width: 100%; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog.detail::backdrop { background: rgba(0, 0, 0, 0.45); }
.detail-head { padding: 18px 20px 10px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.detail-body { padding: 14px 20px 20px; max-height: 70vh; overflow-y: auto; }
.detail-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0; font-size: 0.9rem; }
.detail-body dt { color: var(--muted); }
.detail-body dd { margin: 0; }
@media (max-width: 560px) { .detail-body dl { grid-template-columns: 1fr; gap: 2px; } .detail-body dd { margin-bottom: 8px; } }
.close-btn { border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 2px 6px; }

/* Drawer for assumptions */
details.assumptions { margin: 6px 0 4px; }
details.assumptions > summary { cursor: pointer; color: var(--link); font-size: 0.9rem; width: max-content; max-width: 100%; }
details.assumptions[open] > summary { margin-bottom: 10px; }

/* Species detail */
.sp-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .sp-grid { grid-template-columns: 1fr; } }
.back-link { display: inline-block; margin-bottom: 12px; font-size: 0.9rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 26px 0 36px; font-size: 0.86rem; color: var(--muted); }
.site-footer .wrap { display: flex; gap: 18px 36px; flex-wrap: wrap; justify-content: space-between; }
.site-footer p { margin: 0 0 6px; max-width: 70ch; }

/* Formula block */
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; background: var(--surface-2);
  border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; color: var(--ink); white-space: pre;
}

@media (forced-colors: active) {
  .chip[aria-pressed="true"], .seg button[aria-pressed="true"], .tab[aria-selected="true"] { outline: 2px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .site-header, .site-footer, .controls, .tabs, .theme-toggle { display: none !important; }
  body { background: #fff; }
}

@media (max-width: 600px) {
  #ctl-metric.seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  #ctl-metric.seg button { border-bottom: 1px solid var(--border); text-align: center; }
  #ctl-metric.seg button:nth-child(2n) { border-right: 0; }
  #ctl-metric.seg button:nth-last-child(-n + 2) { border-bottom: 0; }
}
.toc { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 22px; font-size: 0.9rem; }
.toc a { white-space: nowrap; }
