:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1d2330;
  --muted: #595f6b;
  --accent: #713f12;
  --accent-dark: #4a2909;
  --accent-soft: #f0e6d8;
  --line: #e4e0d8;
  --maxw: 920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #fff;
  padding: 3rem 0 2.25rem;
}
.site-header h1 { margin: 0 0 .25rem; font-size: 2.1rem; letter-spacing: -.5px; }
.site-header .subtitle { margin: 0 0 1rem; font-size: 1.1rem; opacity: .92; }
.site-header .lead { margin: 0 0 1rem; max-width: 64ch; opacity: .95; }
.site-header .updated { margin: 0; font-size: .85rem; opacity: .8; }
.viz-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 0; }
.viz-chips a { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); color: #fff; text-decoration: none; font-size: .82rem; font-weight: 600; padding: .3rem .75rem; border-radius: 999px; white-space: nowrap; }
.viz-chips a:hover { background: rgba(255,255,255,.28); }

/* Nav */
.site-nav { position: sticky; top: 0; z-index: 10; background: #2a2f3a; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.site-nav .wrap { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .5rem 1.25rem; }
.site-nav a { color: #e8e6e1; text-decoration: none; font-size: .85rem; font-weight: 600; padding: .15rem 0; white-space: nowrap; }
.site-nav a:hover { color: #fff; border-bottom: 2px solid var(--accent); }

/* Sections */
main { padding: 2rem 1.25rem 3rem; }
section { margin: 2.5rem 0; }
h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: .4rem;
  margin-bottom: 1rem;
}
h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.section-intro { color: var(--muted); max-width: 70ch; }

/* Notice */
.notice {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: .85rem 1rem;
  border-radius: 4px;
  font-size: .92rem;
}
.notice-attribution { background: #fff7e6; border-left-color: #c47f17; margin-bottom: 1rem; }

/* Facts list */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.facts dt { font-weight: 600; color: var(--accent); }
.facts dd { margin: 0; }

/* Chronology table */
.table-scroll { position: relative; overflow-x: auto; }
table.meetings { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
table.meetings th, table.meetings td { text-align: left; padding: .55rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.meetings thead th { background: #2a2f3a; color: #fff; position: sticky; top: 0; }
table.meetings tbody tr:nth-child(even) { background: #fbfaf8; }
tr.decade-row th { background: var(--accent-soft); color: var(--accent-dark); font-variant: small-caps; letter-spacing: .06em; }
td.year { font-weight: 700; white-space: nowrap; }
.muted { color: var(--muted); }
.flag { color: var(--accent); font-weight: 700; cursor: help; }

/* Card grids (figures, organizations, disambiguation) */
.party-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.party-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; }
.party-card h3 { margin: 0 0 .35rem; font-size: 1.02rem; }
.party-card .country { margin: 0 0 .5rem; font-size: .9rem; color: var(--muted); }
.party-card .figures, .party-card .party-notes { margin: .35rem 0 0; font-size: .85rem; color: var(--muted); }

.related-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 1rem; }
.related-card h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.related-card p { margin: .4rem 0; font-size: .9rem; }
.related-meta { color: var(--muted); font-size: .82rem !important; }
.related-link a { color: var(--accent); font-size: .82rem; word-break: break-all; }

.cp-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #c47f17; border-radius: 6px; padding: 1rem; }
.cp-card h3 { margin: 0 0 .25rem; font-size: 1.02rem; }
.cp-card p { margin: .4rem 0; font-size: .9rem; }

/* Citations */
/* Inline glossary cross-links (from [[term-id]] markers in prose fields). */
.glossary-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.glossary-link:hover { border-bottom-style: solid; }

sup.cite { font-size: .68rem; line-height: 0; margin-left: .12rem; }
sup.cite a { color: var(--accent); text-decoration: none; font-weight: 700; }
sup.cite a:hover { text-decoration: underline; }
ol.references li:target { background: var(--accent-soft); border-radius: 4px; padding: .2rem .35rem; }

/* References */
ol.references { padding-left: 1.25rem; }
.ref-note { display: block; margin-top: .2rem; font-size: .84rem; opacity: .82; font-style: italic; }
ol.references li { margin-bottom: .6rem; }
ol.references a { color: var(--accent); text-decoration: none; font-weight: 600; }
ol.references a:hover { text-decoration: underline; }
.ref-meta { display: block; color: var(--muted); font-size: .8rem; }
.archive-link { color: var(--muted); font-weight: 600; text-decoration: none; }
.archive-link:hover { color: var(--accent); text-decoration: underline; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .85rem; }
.site-footer code { background: #efece6; padding: .1rem .35rem; border-radius: 3px; }

/* Genealogy / lineage trees (fsspx pattern; rendered only when the data
   declares `lineage`/`episcopalLineage`) */
.lineage-branch { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 1rem 1.25rem; margin: 1rem 0; }
.lineage-branch h3 { margin: 0 0 .25rem; }
.lineage-branch.lineage-separate { border-left-color: #c47f17; background: #fffdf7; }
ul.tree, ul.tree ul { list-style: none; margin: 0; padding-left: 1.4rem; }
ul.tree { padding-left: 0; margin-top: .6rem; }
ul.tree ul { position: relative; }
ul.tree ul::before { content: ""; position: absolute; top: 0; bottom: .75em; left: .35rem; border-left: 2px solid var(--line); }
ul.tree li { position: relative; padding: .25rem 0 .25rem .5rem; }
ul.tree ul li::before { content: ""; position: absolute; top: 1em; left: -1.05rem; width: 1.3rem; border-top: 2px solid var(--line); }
.tree-node strong { color: var(--ink); }
.tree-detail { color: var(--muted); font-size: .85rem; }
.tree-status { font-size: .78rem; color: var(--accent-dark); background: var(--accent-soft); display: inline-block; border-radius: 999px; padding: .05rem .6rem; margin: .15rem 0 0; }
.lineage-separate .tree-status { color: #7a5410; background: #f7ecd4; }

/* Typed edges: solid connector = direct consecration/initiation (default);
   dashed connector = indirect reference/association, NOT lineage */
ul.tree ul li.tree-edge-indirect::before { border-top-style: dashed; }
.tree-edge-label { font-size: .72rem; font-style: italic; color: var(--muted); background: #f3f1ec; border: 1px dashed var(--line); border-radius: 999px; padding: 0 .5rem; white-space: nowrap; }
.lineage-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: .75rem 0 .25rem; font-size: .82rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: .45rem; }
.legend-swatch { display: inline-block; width: 2rem; height: 0; border-top: 2px solid var(--muted); }
.legend-swatch.legend-indirect { border-top-style: dashed; }

/* Branch timeline ("subway diagram"; rendered only when the data declares
   `branchTimeline`). The SVG keeps its natural size inside a horizontal
   scroll container on small screens; print scales it to the page. */
.viz-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
figure.branch-timeline { margin: 1rem 0 0; }
.branch-timeline-svg { display: block; }
.branch-timeline-svg text { font-family: inherit; }
.branch-timeline-svg .bt-tick line { stroke: var(--line); stroke-width: 1; }
.branch-timeline-svg .bt-tick text { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.branch-timeline-svg .bt-line line, .branch-timeline-svg .bt-line path { stroke-width: 4; fill: none; stroke-linecap: round; }
.branch-timeline-svg .bt-label { font-size: 13px; font-weight: 600; fill: var(--ink); }
.branch-timeline-svg .bt-trunk line { stroke: var(--accent); }
.branch-timeline-svg .bt-trunk circle { fill: var(--accent); }
.branch-timeline-svg .bt-c0 path { stroke: #c2571f; } .branch-timeline-svg .bt-c0 circle { fill: #c2571f; }
.branch-timeline-svg .bt-c1 path { stroke: #2f7d4f; } .branch-timeline-svg .bt-c1 circle { fill: #2f7d4f; }
.branch-timeline-svg .bt-c2 path { stroke: #7b4fa6; } .branch-timeline-svg .bt-c2 circle { fill: #7b4fa6; }
.branch-timeline-svg .bt-c3 path { stroke: #b02a37; } .branch-timeline-svg .bt-c3 circle { fill: #b02a37; }
.branch-timeline-svg .bt-c4 path { stroke: #0f7f8b; } .branch-timeline-svg .bt-c4 circle { fill: #0f7f8b; }
.branch-timeline-svg .bt-c5 path { stroke: #946200; } .branch-timeline-svg .bt-c5 circle { fill: #946200; }
figure.branch-timeline figcaption { margin-top: .75rem; }
ol.branch-notes { margin: 0; padding-left: 1.25rem; font-size: .88rem; }
ol.branch-notes li { margin-bottom: .35rem; }

/* Contested-numbers chart (rendered only when the data declares
   `numbersChart`). Each series is a self-contained panel on its OWN axis and
   unit — the series are deliberately never merged onto one scale. */
figure.numbers-chart { margin: 1rem 0 0; }
.nc-series { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .85rem 1rem; margin: 0 0 1rem; }
.nc-series-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .35rem .75rem; }
.nc-series-label { font-weight: 700; }
.nc-source-badge { font-size: .74rem; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; padding: .1rem .6rem; white-space: nowrap; }
.nc-axis-note { font-size: .76rem; color: var(--muted); margin: .1rem 0 .55rem; }
.nc-row { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .6rem; margin: .35rem 0; }
.nc-year { flex: 0 0 2.4rem; font-weight: 700; font-size: .8rem; color: var(--muted); }
.nc-track { flex: 1 1 140px; min-width: 120px; height: 1.05rem; background: #f0ece5; border-radius: 3px; overflow: hidden; }
.nc-bar { display: block; height: 100%; border-radius: 3px; }
.nc-value { flex: 1 1 100%; margin-left: 3rem; font-size: .82rem; color: var(--ink); }
.nc-axis { display: flex; align-items: center; gap: .6rem; margin-top: .15rem; }
.nc-ticks { flex: 1 1 140px; min-width: 120px; display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); }
.nc-c0 { background: #c2571f; } .nc-c1 { background: #2f7d4f; } .nc-c2 { background: #7b4fa6; }
.nc-c3 { background: #b02a37; } .nc-c4 { background: #0f7f8b; } .nc-c5 { background: #946200; }
figure.numbers-chart figcaption { margin-top: .25rem; }

/* Mobile baseline: compact header + nav as a single horizontal scroll strip */
@media (max-width: 560px) {
  .site-header { padding: 1.4rem 0 1.1rem; }
  .site-header h1 { font-size: 1.5rem; }
  .site-header .subtitle { font-size: .95rem; margin-bottom: .5rem; }
  .site-header .lead { display: none; }
  .site-header .updated { font-size: .78rem; }
  .site-nav .wrap { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 1rem; padding: .55rem 1rem; }
  .site-nav .wrap::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: .82rem; }
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dt { margin-top: .5rem; }
  .nc-value { margin-left: 0; }
}

/* Print baseline (book series): every visualization is a static figure that
   fits a book page — no scroll containers, no navigation chrome */
@media print {
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  body { background: #fff; }
  .site-header { background: none; color: var(--ink); padding: 1rem 0; }
  .site-nav, .viz-chips { display: none; }
  a { color: inherit; }
  section { margin: 1.25rem 0; }
  table.meetings thead th { position: static; }
  /* Figures must not split across pages */
  .lineage-branch, figure.branch-timeline, figure.numbers-chart, figure.chrono-spine, .nc-series, .party-card, .related-card, .cp-card { break-inside: avoid; page-break-inside: avoid; }
  /* Trees are static HTML/CSS and print as-is; the subway SVG scales to the
     page width via its viewBox instead of scrolling */
  .viz-scroll { overflow: visible; }
  .branch-timeline-svg { width: 100% !important; height: auto !important; }
}

/* ---------------------------------------------------------------------------
   Chronology spine — the density figure at the top of the page.

   Every quantity is encoded twice: bar height AND the printed count. Nothing
   is carried by colour alone, so the figure survives greyscale, print and
   colour-vision deficiency. The unverified segment is distinguished by a
   repeating-gradient hatch, not a hue.
   ------------------------------------------------------------------------ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

figure.chrono-spine { margin: 0 0 .5rem; }
ol.cs-track-list {
  display: flex; align-items: flex-end; gap: .3rem;
  margin: 0; padding: 0; list-style: none; min-height: 132px;
}
.cs-col { flex: 1 1 0; min-width: 38px; text-align: center; }
.cs-col a {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%; text-decoration: none; color: inherit; border-radius: 4px; padding: .15rem 0;
}
.cs-col a:hover, .cs-col a:focus-visible { background: var(--accent-soft); outline: none; }
.cs-col a:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.cs-count { font-size: .78rem; font-weight: 700; color: var(--muted); line-height: 1.4; }
.cs-col a:hover .cs-count, .cs-col a:focus-visible .cs-count { color: var(--accent-dark); }
.cs-track { display: block; width: 100%; height: 84px; display: flex; align-items: flex-end; }
.cs-bar {
  display: block; width: 100%; background: var(--accent); border-radius: 2px 2px 0 0;
  min-height: 3px; position: relative; overflow: hidden;
}
/* Unverified dates: a hatch sitting at the TOP of the bar, so the verified
   portion stays readable as a solid block underneath it. */
.cs-unverified {
  display: block; width: 100%; position: absolute; top: 0; left: 0;
  background: repeating-linear-gradient(
    45deg, var(--surface) 0 3px, transparent 3px 6px
  );
  border-bottom: 1px solid var(--surface);
}
.cs-label { font-size: .72rem; color: var(--muted); margin-top: .25rem; white-space: nowrap; }
.cs-empty .cs-track { border-bottom: 1px dotted var(--line); }

/* An explicit, labelled break — never a silent rescale. */
.cs-break {
  flex: 0 0 auto; align-self: stretch; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding: 0 .4rem;
  border-left: 1px dashed var(--line); border-right: 1px dashed var(--line);
  max-width: 130px;
}
.cs-break-mark { color: var(--muted); font-size: 1.1rem; line-height: 1; }
.cs-break-label {
  font-size: .68rem; color: var(--muted); text-align: center;
  margin-top: .3rem; line-height: 1.25;
}
figure.chrono-spine figcaption {
  font-size: .78rem; color: var(--muted); margin-top: .5rem; line-height: 1.45;
}

@media (max-width: 640px) {
  .cs-col { min-width: 30px; }
  .cs-label { font-size: .62rem; }
  .cs-break-label { font-size: .6rem; }
}

/* Language switcher (i18n) */
.lang-switch { float: right; display: flex; gap: .35rem; align-items: center; font-size: .8rem; font-weight: 700; }
.lang-switch a { color: var(--muted); text-decoration: none; padding: .1rem .3rem; border-radius: 3px; }
.lang-switch a:hover { color: var(--accent); background: var(--accent-soft); }
.lang-switch .lang-current { color: var(--accent-dark); background: var(--accent-soft); padding: .1rem .3rem; border-radius: 3px; }

/* Machine-translation disclaimer (non-English pages) */
.i18n-disclaimer {
  background: #fff8e6; border-bottom: 1px solid #f0e2b8; color: #6b5a17;
  font-size: .82rem; text-align: center; padding: .45rem 1rem;
}

/* ---------------------------------------------------------------------------
   Places map — event places as sized markers on a world basemap.

   Encoding is never colour-only or pointer-only: marker AREA carries the
   count, hollow-vs-filled carries precision, dashed carries an unverified
   first date — and the full text list of mapped places renders under the
   figure as the baseline. The year control is progressive enhancement: it is
   hidden until the inline script enables it, so the no-JS and print state is
   the complete map.
   ------------------------------------------------------------------------ */
figure.places-map { margin: 0 0 .5rem; }
figure.places-map svg { display: block; width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.pm-land { fill: var(--accent-soft); stroke: var(--line); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.pm-pin circle {
  fill: var(--accent); fill-opacity: .78; stroke: var(--accent-dark);
  stroke-width: 1.2px; vector-effect: non-scaling-stroke;
}
.pm-pin:hover circle, .pm-pin:focus-visible circle { fill-opacity: 1; }
.pm-pin:focus-visible { outline: none; }
.pm-pin:focus-visible circle { stroke-width: 3px; }
/* Country-level locations: hollow — a centroid is not a site. */
.pm-approx circle { fill: none; stroke: var(--accent-dark); stroke-width: 1.6px; }
/* Unverified first date: dashed, mirroring the table's `?` flag. */
.pm-unverified circle { stroke-dasharray: 3 2; }
/* Year control (enabled by the inline script) hides later places. */
.pm-future { display: none; }
.pm-controls { display: flex; align-items: center; gap: .6rem; margin: 0 0 .5rem; }
.pm-controls .pm-slider { flex: 1 1 auto; min-width: 120px; }
.pm-controls .pm-play {
  font: inherit; font-size: .8rem; padding: .25rem .6rem; border: 1px solid var(--line);
  border-radius: 4px; background: var(--surface); color: inherit; cursor: pointer;
}
.pm-controls .pm-play:hover { background: var(--accent-soft); }
.pm-year { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; min-width: 3ch; }
.pm-legend { font-size: .75rem; color: var(--muted); margin: .5rem 0 0; line-height: 1.45; }
figure.places-map figcaption { font-size: .78rem; color: var(--muted); margin-top: .35rem; line-height: 1.45; }
.pm-list { margin: .35rem 0 0; }
.pm-list summary { font-size: .8rem; color: var(--muted); cursor: pointer; }
.pm-list ol { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; padding-left: 1.4rem; line-height: 1.5; }
.pm-approx-badge {
  font-size: .68rem; border: 1px solid var(--line); border-radius: 3px;
  padding: 0 .3rem; color: var(--muted); white-space: nowrap;
}

@media print {
  figure.places-map { break-inside: avoid; page-break-inside: avoid; }
  .pm-controls { display: none; }
  .pm-future { display: initial; } /* the print form is the complete map */
}

/* Country tier map (`map` key) — the tl presence-map pattern, core#3 item 2.
   Tier fills follow listing order (strongest first), derived from the site's
   accent so every adopter gets a coherent scale for free; max four tiers
   (validator-enforced) keeps it readable on screen and paper. */
.latam-svg { width: 100%; height: auto; display: block; }
.latam-bg { fill: #e6eaef; stroke: #fff; stroke-width: .5; }
.map-cols { display: grid; grid-template-columns: minmax(260px, 440px) 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 760px) { .map-cols { grid-template-columns: 1fr; } }
.atlas-map { max-width: 440px; }
.atlas-map svg { width: 100%; height: auto; display: block; }
.latam-c { fill: #dfe3ea; stroke: #fff; stroke-width: .6; transition: fill .12s ease; }
.latam-c:hover, .latam-c:focus-visible { outline: none; stroke: var(--ink); stroke-width: 1.2; }
.latam-c.map-t0 { fill: var(--accent); cursor: pointer; }
.latam-c.map-t1 { fill: color-mix(in srgb, var(--accent) 55%, #eef0ee); cursor: pointer; }
.latam-c.map-t2 { fill: color-mix(in srgb, var(--accent) 32%, #eef0ee); cursor: pointer; }
.latam-c.map-t3 { fill: color-mix(in srgb, var(--accent) 16%, #eef0ee); cursor: pointer; }
.ptl-caption { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: .35rem .6rem; font-size: .82rem; margin: .5rem 0; min-height: 1.5em; }
.ptl-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .5rem; font-size: .8rem; color: var(--muted); }
.ptl-key { display: inline-flex; align-items: center; gap: .35rem; }
.atlas-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: #dfe3ea; }
.atlas-swatch.map-t0 { background: var(--accent); }
.atlas-swatch.map-t1 { background: color-mix(in srgb, var(--accent) 55%, #eef0ee); }
.atlas-swatch.map-t2 { background: color-mix(in srgb, var(--accent) 32%, #eef0ee); }
.atlas-swatch.map-t3 { background: color-mix(in srgb, var(--accent) 16%, #eef0ee); }
.atlas-credit { color: var(--muted); font-size: .72rem; margin: .3rem 0 0; }
.map-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.map-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: .7rem .9rem; }
.map-card h3 { margin: 0 0 .25rem; font-size: .98rem; }
.map-card p { margin: 0; font-size: .88rem; }
@media print {
  #map .atlas-map { break-inside: avoid; page-break-inside: avoid; }
  .latam-c, .atlas-swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------------------------------------------------------------------
   Swimlanes — the thread-lane figure (core#23).

   Rendered as a real table because the data IS tabular: lanes × decades. The
   printed count is the encoding; the background step is a redundant cue, so
   the figure survives greyscale, print and colour-vision deficiency. Cells
   holding an unverified date carry the same hatch the spine uses.
   ------------------------------------------------------------------------ */
figure.swimlanes { margin: 0 0 .5rem; }
table.sw-grid { border-collapse: collapse; font-size: .82rem; width: 100%; }
table.sw-grid th, table.sw-grid td {
  border: 1px solid var(--line); padding: .25rem .4rem; text-align: center; vertical-align: middle;
}
table.sw-grid thead th { background: var(--surface); font-size: .74rem; white-space: nowrap; position: static; }
table.sw-grid tbody th[scope="row"] {
  text-align: left; font-weight: 700; white-space: normal; min-width: 12rem;
  background: var(--surface); font-size: .78rem;
}
.sw-cell { padding: 0; }
.sw-cell a {
  display: block; padding: .3rem .4rem; text-decoration: none; color: inherit;
  font-variant-numeric: tabular-nums; font-weight: 700;
}
.sw-cell a:hover, .sw-cell a:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
/* Four steps of intensity — always alongside the printed number, never instead. */
.sw-i1 { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sw-i2 { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.sw-i3 { background: var(--accent); }
.sw-i4 { background: var(--accent-dark); }
.sw-i3 a, .sw-i4 a { color: #fff; }
.sw-zero { background: transparent; }
.sw-zero::after { content: '·'; color: var(--muted); }
/* An unverified date in the cell: hatched, plus the visible ? marker. */
.sw-has-unverified {
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.65) 0 3px, transparent 3px 6px);
}
.sw-flag { font-size: .7em; vertical-align: super; margin-left: .1em; }
.sw-break { background: repeating-linear-gradient(0deg, var(--line) 0 2px, transparent 2px 6px); width: 1.2rem; color: var(--muted); }
.sw-total { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
figure.swimlanes figcaption { font-size: .78rem; color: var(--muted); margin-top: .5rem; line-height: 1.45; }
.sw-bases { margin: .35rem 0 0; }
.sw-bases summary { font-size: .8rem; color: var(--muted); cursor: pointer; }
.sw-bases ol { font-size: .8rem; line-height: 1.5; }

@media (max-width: 640px) {
  table.sw-grid { font-size: .74rem; }
  table.sw-grid tbody th[scope="row"] { min-width: 8rem; font-size: .7rem; }
}

@media print {
  figure.swimlanes { break-inside: avoid; page-break-inside: avoid; }
  table.sw-grid { font-size: .7rem; }
  /* The bases are the figure's argument on paper — never collapsed. */
  .sw-bases { display: block; }
  .sw-bases summary { display: none; }
}

/* ---------------------------------------------------------------------------
   Time river (core#108): the chronology as lane tracks, opt-in with
   meta.layout "river". A single-track river takes the site accent. With a
   lane taxonomy (.rv-lanes) every lane takes a fixed hue from one palette,
   chosen to stay apart from each other and readable on the light ground; a
   site accent could otherwise land next to one of them (rcc: rose on rose).
   --------------------------------------------------------------------------- */
.river { --rv-tw: 20px; --rv-yw: 5.6rem; --rv-top: 2.6rem; }
.rv-l0 { --c: var(--accent); }
.rv-lanes .rv-l0 { --c: #4338a0; }
.rv-l1 { --c: #13776d; }
.rv-l2 { --c: #9d5c0e; }
.rv-l3 { --c: #b0306a; }
.rv-l4 { --c: #2a72a2; }
.rv-l5 { --c: #5e7a1a; }
.rv-l6 { --c: #8a5a44; }
.rv-l7 { --c: #555f6d; }
.rv-bar { background: var(--bg); padding: .6rem 0 .4rem; border-bottom: 1px solid var(--line); display: grid; gap: .5rem; z-index: 5; }
@media (min-width: 700px) and (min-height: 640px) { .rv-bar { position: sticky; top: var(--rv-top); } }
.rv-controls { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; }
.rv-controls[hidden] { display: none; }
.rv-chip { position: relative; display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; line-height: 1.2; padding: .32rem .65rem .32rem .5rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.rv-chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rv-sw { flex: none; width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid var(--c, var(--ink)); background: var(--c, var(--ink)); }
.rv-firm .rv-sw { background: transparent; }
.rv-firm:has(input:checked) .rv-sw { background: var(--ink); border-color: var(--ink); }
.rv-chip:has(input:not(:checked)):not(.rv-firm) { color: var(--muted); background: transparent; }
.rv-chip:has(input:not(:checked)):not(.rv-firm) .rv-sw { background: transparent; }
.rv-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rv-find { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: auto; }
.rv-find input { font: inherit; font-weight: 400; color: var(--ink); padding: .3rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); width: 13rem; max-width: 60vw; }
.rv-status { flex-basis: 100%; margin: 0; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
svg.rv-ribbon { display: block; width: 100%; height: auto; max-height: 7rem; cursor: pointer; }
.rv-row { fill: var(--surface); }
.rv-brk { fill: var(--line); }
.rv-tick { stroke: var(--c); stroke-width: 2.4; stroke-linecap: round; }
.rv-tick.rv-u { stroke-dasharray: 1.6 1.6; }
.rv-tick.rv-off { opacity: .12; }
.rv-axis { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.rv-win { fill: var(--accent); fill-opacity: .1; stroke: var(--accent); stroke-width: 1.2; }

.rv-list { list-style: none; margin: 0; padding: .4rem 0 1rem; position: relative; container-type: inline-size; container-name: river; }
/* One faint vertical track per lane, behind the nodes. */
.rv-list::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--rv-yw) + 10px); width: calc(var(--rv-tw) * var(--lanes, 1));
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--rv-tw) / 2 - 1px), var(--line) calc(var(--rv-tw) / 2 - 1px) calc(var(--rv-tw) / 2 + 1px), transparent calc(var(--rv-tw) / 2 + 1px) var(--rv-tw)); }
.rv-e { display: grid; grid-template-columns: var(--rv-yw) calc(var(--rv-tw) * var(--lanes, 1) + 22px) minmax(0, 1fr); align-items: start; scroll-margin-top: var(--rv-clear, 1rem); }
.rv-e[hidden] { display: none; }
.rv-year { padding: .95rem .2rem 0 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.rv-year small { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); }
.rv-node { position: relative; align-self: stretch; }
.rv-node i { position: absolute; top: 1.1rem; left: calc(10px + var(--rv-tw) * var(--k, 0) + var(--rv-tw) / 2 - 7px); width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 3px solid var(--bg); box-shadow: 0 0 0 1.5px var(--c); }
.rv-u .rv-node i { background: var(--bg); border: 2px dashed var(--c); box-shadow: none; }
.rv-node i.rv-none { --c: var(--muted); }
.rv-card { padding: .7rem 0 1rem; border-bottom: 1px solid var(--line); min-width: 0; }
.rv-card h3 { margin: .1rem 0 .3rem; font-size: 1.02rem; line-height: 1.35; }
.rv-kick { margin: 0; display: flex; flex-wrap: wrap; gap: .15rem .8rem; font-size: .78rem; color: var(--muted); }
.rv-lane { color: var(--c); font-weight: 600; }
.rv-text { margin: 0; max-width: 70ch; }
.rv-hit h3 { background: linear-gradient(transparent 60%, var(--accent-soft) 60%); }
.rv-gap span { display: block; margin: .2rem 0 .2rem calc(var(--rv-yw) + 10px); padding: .2rem .7rem; font-size: .76rem; color: var(--muted); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--line) 70%, transparent) 0 4px, transparent 4px 9px); border-radius: 3px; }
.rv-gap[hidden] { display: none; }
.rv-empty { color: var(--muted); text-align: center; padding: 1.5rem 0; }
.rv-empty[hidden] { display: none; }
/* Narrow: one track; the lane is named in the card. */
@container river (max-width: 560px) {
  .rv-e { grid-template-columns: 3.9rem 26px minmax(0, 1fr); }
  .rv-list::before { left: calc(3.9rem + 12px); width: 2px; background: var(--line); }
  .rv-node i { left: 6px; }
  .rv-gap span { margin-left: 0; }
  .rv-year { font-size: .9rem; }
}
@container river (max-width: 560px) { .rv-e .rv-node i + i { display: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rv-card { animation: rv-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 50%; }
  }
}
@keyframes rv-rise { from { opacity: .6; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@media print {
  .rv-bar { position: static; }
  .rv-controls { display: none; }
  .rv-e { break-inside: avoid; }
  .rv-e[hidden] { display: grid; }
  .rv-card { animation: none; }
}

.rv-ribbon .rv-hl { font-size: 9.5px; font-weight: 700; fill: var(--ink); }
.rv-ribbon .rv-hl-tick { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 2; opacity: .55; }
.rv-claims { margin: .55rem 0 0; font-size: .86rem; }
.rv-claims-h { margin: 0 0 .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rv-claims-h span { font-weight: 600; letter-spacing: 0; text-transform: none; margin-left: .3rem; }
.rv-span { position: relative; height: 12px; margin: 0 .4rem .35rem; border-bottom: 1px solid var(--line); max-width: 22rem; }
.rv-span i, .rv-span b { position: absolute; bottom: -1px; }
.rv-span .rv-ct { width: 2px; height: 9px; margin-left: -1px; background: var(--accent); }
.rv-span .rv-cr { height: 5px; min-width: 2px; background: color-mix(in srgb, var(--accent) 45%, transparent); border: 1px solid var(--accent); border-radius: 2px; }
.rv-span b { width: 9px; height: 9px; margin-left: -4.5px; bottom: -5px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.rv-claims ul { margin: 0; padding-left: 1.1rem; }
.rv-claims li { margin: .1rem 0; }
.rv-cyr { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
   Citation previews (core#119): a click or tap on [n] shows the reference
   beside the claim (src/cite.js). Colours come from the page tokens, so the
   dark scheme needs nothing of its own. Never printed.
   --------------------------------------------------------------------------- */
.cite-pop {
  position: fixed; inset: auto; margin: 0; max-width: min(26rem, calc(100vw - 16px));
  padding: .7rem .85rem .6rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; font-size: .88rem; line-height: 1.45;
  box-shadow: 0 8px 28px rgb(0 0 0 / .18);
}
.cite-pop-head { margin: 0 0 .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cite-pop-body > a:first-child { font-weight: 600; }
.cite-pop-body .ref-meta { margin-top: .15rem; }
.cite-pop-foot { margin: .5rem 0 0; font-size: .8rem; }
sup.cite a[aria-expanded] { text-decoration: underline; }
@media print { .cite-pop { display: none !important; } }

/* ---------------------------------------------------------------------------
   Look and feel (core#118): a text face for the prose, and a palette derived
   from one colour. Source Serif 4 (SIL OFL, src/fonts/OFL.txt) is self-hosted
   - no font CDN, nothing that tracks readers - in two subsets: Latin (en, es,
   pt) and Latin Extended, which a page downloads only if it uses one of its
   characters. Navigation, labels, tables and figures stay in the system
   face; only running prose takes the serif, with old-style figures.
   Each site declares --accent; the dark shade and the soft tint derive from
   it in OKLCH, calibrated against the 23 hand-tuned pairs (mean deltaE 0.02
   and 0.009). A browser without relative colour syntax keeps the site's own
   declared values.
   --------------------------------------------------------------------------- */
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/source-serif-4-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('fonts/source-serif-4-latin-400-italic.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/source-serif-4-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/source-serif-4-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('fonts/source-serif-4-latin-ext-400-italic.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/source-serif-4-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
:root { --font-text: 'Source Serif 4', Georgia, 'Times New Roman', serif; }
@supports (color: oklch(from red l c h)) {
  :root {
    --accent-dark: oklch(from var(--accent) calc(l * .76) c h);
    --accent-soft: oklch(from var(--accent) .94 calc(c * .15) h);
  }
}
.rv-text, .date-note, .section-intro, .rv-claims li, .notice, blockquote,
#about p, #about li, #about dd,
.cat-item p:not([class]), .related-card p:not([class]), .party-card p:not([class]) {
  font-family: var(--font-text); font-variant-numeric: oldstyle-nums proportional-nums;
}
.rv-text { font-size: 1.04rem; line-height: 1.55; }

/* ---------------------------------------------------------------------------
   Print (core#3): the page on paper. On screen a reference is a link; on paper
   it is only useful with its address, and with the archived copy's address
   when the live one may be gone. Headings never end a page.
   --------------------------------------------------------------------------- */
@page { margin: 16mm 14mm; }
@media print {
  ol.references a[href^="http"]:not(.archive-link)::after,
  ol.references a.archive-link::after {
    content: " <" attr(href) ">"; font-size: .72rem; font-weight: 400; color: #444; word-break: break-all;
  }
  h2, h3 { break-after: avoid; page-break-after: avoid; }
  .notice, ol.references li, .rv-claims { break-inside: avoid; page-break-inside: avoid; }
  .rv-empty, .rv-status { display: none; }
}

/* ---------------------------------------------------------------------------
   Dark mode (core#113): follows the reader's system setting; the light page
   is untouched. A self-contained block, appended last, so it layers over any
   site's copy of the stylesheet: it redefines the base tokens and restates
   only the rules that hard-code a light colour. The site accent is a dark
   hue, so wherever it is TEXT it is lifted to --accent-hi; where it is a fill
   it stays the accent. Screen only: print keeps the light page.
   --------------------------------------------------------------------------- */
@media screen and (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121418; --surface: #1a1d23; --ink: #e4e6ea; --muted: #9ba2ae; --line: #2d313a;
    --accent-hi: color-mix(in srgb, var(--accent) 45%, #ffffff);
    --accent-soft: color-mix(in srgb, var(--accent) 26%, #1a1d23);
    --accent-dark: var(--accent-hi);
    --card: var(--surface);
  }
  .site-header { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 45%, #000000), var(--accent)); }
  .site-nav { background: #0d0f13; box-shadow: 0 1px 0 var(--line); }
  a { color: var(--accent-hi); }
  .site-nav a { color: #e8e6e1; }
  .facts dt, .flag, .related-link a, sup.cite a, ol.references a, .archive-link:hover,
  .lang-switch a:hover, .lang-switch .lang-current, .party-link a { color: var(--accent-hi); }
  .glossary-link { color: var(--accent-hi); border-bottom-color: var(--accent-hi); }
  .notice-attribution { background: #2a2416; }
  .i18n-disclaimer { background: #2a2416; border-bottom-color: #4a3d1f; color: #e3cf8f; }
  table.meetings thead th { background: #0d0f13; }
  table.meetings tbody tr:nth-child(even) { background: #16191e; }
  .site-footer code { background: #262a31; }
  .lineage-branch.lineage-separate { background: #211d14; }
  .lineage-separate .tree-status { color: #e7c58a; background: #3a2f18; }
  .tree-edge-label { background: #23262d; }
  .nc-track { background: #262a31; }
  .latam-bg { fill: #2a2e36; stroke: #121418; }
  .latam-c { fill: #353a44; stroke: #121418; }
  .latam-c.map-t1, .atlas-swatch.map-t1 { fill: color-mix(in srgb, var(--accent) 70%, #2a2e36); background: color-mix(in srgb, var(--accent) 70%, #2a2e36); }
  .latam-c.map-t2, .atlas-swatch.map-t2 { fill: color-mix(in srgb, var(--accent) 45%, #2a2e36); background: color-mix(in srgb, var(--accent) 45%, #2a2e36); }
  .latam-c.map-t3, .atlas-swatch.map-t3 { fill: color-mix(in srgb, var(--accent) 25%, #2a2e36); background: color-mix(in srgb, var(--accent) 25%, #2a2e36); }
  .atlas-swatch { background: #353a44; }
  .sw-has-unverified { background-image: repeating-linear-gradient(45deg, rgba(18,20,24,.55) 0 3px, transparent 3px 6px); }
  .al-tab[aria-selected="true"] { color: #121418; }
  .al-favourable .al-node-status, .al-favourable .al-status { color: #7fd1a0; }
  .al-negative .al-node-status, .al-negative .al-status { color: #f0a0ab; }
  .al-inconclusive .al-node-status, .al-inconclusive .al-status,
  .al-reported-undocumented .al-node-status, .al-reported-undocumented .al-status { color: #e3c77a; }
  .al-pending .al-node-status, .al-pending .al-status { color: #8cc8e6; }
  .al-adjacent .al-node-status, .al-adjacent .al-status { color: #c3a9e8; }
  .rv-l0 { --c: var(--accent-hi); }
  .rv-lanes .rv-l0 { --c: #9d93ff; }
  /* The light scheme's solid heat steps would sink into the dark page; the
     translucent steps keep the scale reading dark-to-bright. */
  .sw-i3 { background: color-mix(in srgb, var(--accent) 46%, transparent); }
  .sw-i4 { background: color-mix(in srgb, var(--accent) 64%, transparent); }
  .rv-span .rv-ct { background: var(--accent-hi); }
  .rv-span .rv-cr { border-color: var(--accent-hi); background: color-mix(in srgb, var(--accent-hi) 35%, transparent); }
  .rv-span b { border-color: var(--accent-hi); }
  .rv-l1 { --c: #4fc4b5; } .rv-l2 { --c: #e3a24f; } .rv-l3 { --c: #f07aa8; }
  .rv-l4 { --c: #6fb4e8; } .rv-l5 { --c: #a8c25a; } .rv-l6 { --c: #d49a7e; } .rv-l7 { --c: #a3adbb; }
  .rv-win { fill: var(--accent-hi); stroke: var(--accent-hi); }
}
