/* Rider Watch. Modern, data-first: cool grey page, white cards, one navy header.
   Colours are tokens; dark mode is its own chosen set, not an inversion. The diverging pair
   (--up, --down) is from the dataviz method and validated in both modes. */
:root {
  --accent: #1f5f8b;
  --paper: #f3f5f8;        /* page plane */
  --surface: #ffffff;      /* cards, tables */
  --ink: #16202b;
  --ink-2: #3c4a59;
  --muted: #5b6b7c;
  --line: #e2e7ee;
  --line-strong: #c5cfdb;
  --stripe: #f7f9fb;
  --header: #0f2c46;
  --header-ink: #e9f0f7;
  --header-muted: #a9bdd1;
  --up: #2a78d6;           /* an increase */
  --down: #e34948;         /* a decrease */
  --zero: #b9b8b0;         /* the zero line and the diverging midpoint */
  --grid: #e8e7e1;
  --shadow: 0 1px 2px rgba(15, 44, 70, .07);
  --new: #1d6b3a;      --new-bg: #e3f3e8;
  --amended: #8a5300;  --amended-bg: #fbeed3;
  --deleted: #9d2b24;  --deleted-bg: #fbe5e2;
  --same: #4b5563;     --same-bg: #eceef1;
  --years: #2f5d8a;    --years-bg: #e3edf7;
  --possible: #6b3fa0; --possible-bg: #efe6fa;
  --ins-bg: #dbeafc;   --del-bg: #fbdcd8;
  /* one colour per article: I-VIII the dataviz method's eight categorical slots, in order;
     IX-XI (small or rarely printed) three greys */
  --art-I: #2a78d6; --art-II: #eb6834; --art-III: #1baf7a; --art-IV: #eda100; --art-V: #e87ba4; --art-VI: #008300; --art-VII: #6250d6; --art-VIII: #e34948; --art-IX: #8a8f98; --art-X: #5b6470; --art-XI: #b0a99a;
  color-scheme: light;
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: color-mix(in srgb, #1f5f8b 45%, white);
    --paper: #0f1318; --surface: #1a1d22; --ink: #e8ecf1; --ink-2: #c4ccd6; --muted: #9aa7b6;
    --line: #2a3038; --line-strong: #3d4550; --stripe: #1e2228; --header: #0a1d30; --header-ink: #e9f0f7;
    --header-muted: #8fa6bd; --up: #3987e5; --down: #e66767; --zero: #4a4f57; --grid: #262b31;
    --shadow: none;
    --new: #7fd39b; --new-bg: #17321f; --amended: #f0c36d; --amended-bg: #3a2c0c;
    --deleted: #f1948a; --deleted-bg: #3b1a17; --same: #b6bcc6; --same-bg: #2a2e34;
    --years: #9cc4ea; --years-bg: #1a2c3d; --possible: #c9a8f0; --possible-bg: #2c2040;
    --ins-bg: #173556; --del-bg: #45201c;
    --art-I: #3987e5; --art-II: #d95926; --art-III: #199e70; --art-IV: #c98500; --art-V: #d55181; --art-VI: #008300; --art-VII: #9085e9; --art-VIII: #e66767; --art-IX: #7b828c; --art-X: #a3aab4; --art-XI: #6f6a60;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: color-mix(in srgb, #1f5f8b 45%, white);
  --paper: #0f1318; --surface: #1a1d22; --ink: #e8ecf1; --ink-2: #c4ccd6; --muted: #9aa7b6;
  --line: #2a3038; --line-strong: #3d4550; --stripe: #1e2228; --header: #0a1d30; --header-ink: #e9f0f7;
  --header-muted: #8fa6bd; --up: #3987e5; --down: #e66767; --zero: #4a4f57; --grid: #262b31;
  --shadow: none;
  --new: #7fd39b; --new-bg: #17321f; --amended: #f0c36d; --amended-bg: #3a2c0c;
  --deleted: #f1948a; --deleted-bg: #3b1a17; --same: #b6bcc6; --same-bg: #2a2e34;
  --years: #9cc4ea; --years-bg: #1a2c3d; --possible: #c9a8f0; --possible-bg: #2c2040;
  --ins-bg: #173556; --del-bg: #45201c;
  --art-I: #3987e5; --art-II: #d95926; --art-III: #199e70; --art-IV: #c98500; --art-V: #d55181; --art-VI: #008300; --art-VII: #9085e9; --art-VIII: #e66767; --art-IX: #7b828c; --art-X: #a3aab4; --art-XI: #6f6a60;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); overflow-wrap: break-word;
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 78rem; margin: 0 auto; padding: 0 1rem; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
[tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.num, .stat .value, table { font-variant-numeric: tabular-nums lining-nums; }
code, .code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .875em; }
html:not(.js) .js-only { display: none; }

/* --- header ------------------------------------------------------------------ */
.site-header { background: var(--header); color: var(--header-ink); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding-block: .6rem; }
.brand { font-weight: 700; font-size: 1.05rem; color: #fff; text-decoration: none; letter-spacing: -.01em; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .1rem .9rem; flex: 1 1 auto; }
.site-header nav a { color: var(--header-muted); text-decoration: none; padding-block: .2rem; border-bottom: 2px solid transparent; font-size: .95rem; }
.site-header nav a:hover { color: #fff; }
.site-header nav a[aria-current] { color: #fff; border-color: #fff; font-weight: 600; }
.site-header a:focus-visible, .site-header button:focus-visible, .site-header input:focus-visible { outline-color: #fff; }
.site-search { position: relative; flex: 0 1 18rem; min-width: 12rem; }
.site-header .site-search input { width: 100%; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
  color: #fff; border-radius: 6px; padding: .4rem .65rem; font-size: .92rem; }
.site-header .site-search input::placeholder { color: var(--header-muted); }
.theme { background: transparent; color: var(--header-ink); border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px;
  padding: .35rem .45rem; line-height: 0; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); list-style: none;
  margin: 0; padding: .25rem 0; max-height: 70vh; overflow-y: auto; min-width: 18rem; }
.suggest li a { display: block; padding: .4rem .75rem; color: var(--ink); text-decoration: none; }
.suggest li a[aria-selected="true"], .suggest li a:hover { background: var(--stripe); }
.suggest .kind { display: block; font-size: .75rem; color: var(--muted); }
.suggest .group { padding: .35rem .75rem .1rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

main { padding-block: 1.5rem 3rem; }
h1 { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.1rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5rem; text-wrap: balance; font-weight: 680; }
h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 1.4rem 0 .35rem; }
p { margin: 0 0 .85rem; max-width: 46rem; }
.standfirst { font-size: 1.05rem; color: var(--ink-2); max-width: 46rem; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .4rem; }
.notice { background: var(--amended-bg); color: var(--amended); padding: .6rem .9rem; border-radius: 6px; display: inline-block; }
.kicker { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .2rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 1.25rem 2rem; font-size: .9rem; }
.site-footer p { max-width: 60rem; }

/* --- cards and headline figures ------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .75rem; margin: 1rem 0; }
.stat .label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat .value { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: .15rem 0; }
.stat .change { font-size: .92rem; color: var(--ink-2); }
.page-head { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: flex-start; justify-content: space-between; }
.page-head > div:first-child { flex: 1 1 28rem; }

/* --- buttons and form controls ------------------------------------------------- */
input[type=search], input[type=text], input:not([type]), textarea, select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: .5rem .65rem; max-width: 100%; }
button { font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 6px;
  padding: .55rem 1rem; cursor: pointer; }
button.quiet { color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); font-weight: 500; }
button.quiet[aria-pressed="true"] { background: var(--header); color: #fff; border-color: var(--header); }
button:disabled, fieldset:disabled button { opacity: .5; cursor: not-allowed; }
label.inline { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; }
.search-page { display: grid; gap: .5rem; max-width: 36rem; margin: 1rem 0; }
.search-page label:first-child { font-weight: 600; }
.az { columns: 18rem auto; padding-left: 1.1rem; }
.az li { break-inside: avoid; margin-bottom: .25rem; }

/* --- tables of figures ------------------------------------------------------ */
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 1rem; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .45rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; vertical-align: bottom;
  border-bottom: 1px solid var(--line-strong); background: var(--surface); }
thead th a { color: inherit; }
thead th button.sort { all: unset; cursor: pointer; }
thead th button.sort:focus-visible { outline: 3px solid var(--accent); }
thead th[aria-sort] button.sort::after { content: " ↕"; color: var(--line-strong); }
thead th[aria-sort="ascending"] button.sort::after { content: " ↑"; color: var(--ink); }
thead th[aria-sort="descending"] button.sort::after { content: " ↓"; color: var(--ink); }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 500; }
.num { text-align: right; white-space: nowrap; }
.sub { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); white-space: normal; }
table.grid { min-width: 100%; width: max-content; }
table.grid .first { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 15rem; max-width: 24rem;
  white-space: normal; box-shadow: 1px 0 0 var(--line); }
table.grid tbody tr:nth-child(even) > * { background: var(--stripe); }
table.grid td.num a, table.list td.num a { color: var(--ink); text-decoration: none; }
table.grid td.num a:hover, table.list td.num a:hover { color: var(--accent); text-decoration: underline; }
tr.total > * { font-weight: 700; border-top: 2px solid var(--line-strong); }
td.absent, .absent { color: var(--muted); }
td.withheld { color: var(--amended); font-style: italic; }
td.informational a { font-style: italic; }
abbr { text-decoration: none; font-size: .75rem; color: var(--muted); }
table.list { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 1rem; }

/* The year switch: radio buttons that choose which of three spans each cell shows. */
.switch { position: absolute; opacity: 0; }
.switch + label { display: inline-block; margin: 0 .25rem .6rem 0; padding: .3rem .75rem; border: 1px solid var(--line-strong);
  border-radius: 999px; font-size: .88rem; cursor: pointer; background: var(--surface); }
.switch:checked + label { background: var(--header); border-color: var(--header); color: #fff; }
.switch:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.v-fy1, .v-fy2 { display: none; }
.figures:has(#year-1:checked) .v-sum, .figures:has(#year-2:checked) .v-sum { display: none; }
.figures:has(#year-1:checked) .v-fy1, .figures:has(#year-2:checked) .v-fy2 { display: inline; }

/* --- change: the sign and the label say which way; colour is only on chart marks -- */
.up, .down { color: var(--ink); }
svg .up { fill: var(--up); } svg .down { fill: var(--down); }
.change-text { white-space: nowrap; font-weight: 600; }

/* --- tabs: anchors without scripts, tabs with them ------------------------------ */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line-strong); margin: 1.25rem 0 0; }
.tabs a { padding: .5rem .9rem; color: var(--ink-2); text-decoration: none; border: 1px solid transparent;
  border-bottom: 0; border-radius: 8px 8px 0 0; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); background: var(--surface); }
.tabs a[aria-current="true"] { background: var(--paper); color: var(--ink); border-color: var(--line-strong); font-weight: 650; }
.tab-panel:focus { outline: none; }
.tab-panel > h2:first-child { margin-top: 1.25rem; }
.js .tab-panel > h2:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.page-head .follow { margin-top: .4rem; }

/* --- a rider's path through the session ------------------------------------------ */
.path { list-style: none; padding: 0; margin: .5rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); gap: 4px; }
.path .step { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line-strong); border-radius: 6px;
  padding: .45rem .55rem; font-size: .85rem; line-height: 1.3; }
.path .step .when { display: block; font-weight: 650; color: var(--ink); }
.path .step .what { display: block; color: var(--ink-2); }
.path .step .no { font-size: .8rem; }
.path .status-new { border-top-color: var(--new); } .path .status-amended { border-top-color: var(--amended); }
.path .status-years_only { border-top-color: var(--years); } .path .status-moved { border-top-color: var(--possible); }
.path .status-deleted { border-top-color: var(--deleted); } .path .status-possible { border-top-color: var(--possible); }
.path .status-absent { background: transparent; border-style: dashed; color: var(--muted); }
.path .step.picked { box-shadow: 0 0 0 2px var(--header); }
.path .step.held { box-shadow: 0 0 0 2px var(--accent); }
.js .path .step[role="button"] { cursor: pointer; }
.summary { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--header); border-radius: 6px;
  padding: .55rem .8rem; max-width: 60rem; }

/* --- the briefing --------------------------------------------------------------- */
.stages { list-style: none; padding: 0; margin: 1rem 0 .4rem; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.stages .stage { background: var(--line); color: var(--muted); padding: .5rem .6rem; font-size: .85rem; min-height: 3.2rem; }
.stages .stage:first-child { border-radius: 8px 0 0 8px; } .stages .stage:last-child { border-radius: 0 8px 8px 0; }
.stages .stage .name { display: block; font-weight: 700; }
.stages .stage.reached { background: var(--header); color: #fff; }
.stages .stage.latest { background: var(--accent); color: #fff; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); }
.stages .stage .doc { display: block; color: inherit; font-size: .8rem; opacity: .92; }
.stages .stage .doc .sub { color: inherit; opacity: .8; }
.stat .unit { font-size: 1rem; font-weight: 500; color: var(--muted); }
.tally { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: 1.05rem; margin-bottom: .4rem; }
.tally strong { font-size: 1.5rem; }
.moves-list { list-style: none; padding: 0; margin: 0; }
.moves-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.moves-list li:last-child { border-bottom: 0; }
.button-link { display: inline-block; background: var(--header); color: #fff; text-decoration: none; padding: .5rem .9rem;
  border-radius: 6px; font-weight: 600; margin-top: .75rem; }
.cards a .sub { display: block; margin-top: .1rem; }
@media (max-width: 40rem) { .stages { grid-template-columns: 1fr; } .stages .stage { border-radius: 6px !important; min-height: 0; } }

/* --- compare ------------------------------------------------------------------- */
.compare-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .6rem 1rem; align-items: end; margin: 1rem 0; }
.compare-form label { display: block; font-size: .8rem; font-weight: 650; margin-bottom: .2rem; }
.compare-form select { width: 100%; }
.js .js-hide { display: none; }
.rider-list { list-style: none; padding: 0; margin: 0 0 1rem; columns: 26rem auto; column-gap: 2rem; }
.rider-list li { break-inside: avoid; padding: .25rem 0; border-bottom: 1px solid var(--line); }

/* --- following ------------------------------------------------------------------ */
.followed-list { list-style: none; padding: 0; margin: .5rem 0; }
.followed-list li { display: grid; grid-template-columns: 4.5rem 1fr auto auto; gap: .25rem .9rem; align-items: center;
  padding: .45rem .2rem; border-bottom: 1px solid var(--line); }
.followed-list .kind { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.followed-list li.changed .what { font-weight: 700; }
.follow-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.follow-tools textarea { flex: 1 1 100%; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
button.small { padding: .2rem .55rem; font-size: .8rem; }
@media (max-width: 40rem) { .followed-list li { grid-template-columns: 1fr auto; } .followed-list .kind { grid-column: 1 / -1; } }

/* --- charts --------------------------------------------------------------------- */
.chart { margin: .5rem 0 1rem; }
.chart figcaption { font-weight: 600; margin-bottom: .35rem; }
.chart .legend { font-size: .82rem; color: var(--muted); margin: .25rem 0 0; }
.chart-body { overflow-x: auto; }
svg.bars { display: block; max-width: 100%; height: auto; overflow: visible; font-size: 12px; }
@media (max-width: 40rem) { svg.bars { max-width: none; min-width: 34rem; } }
svg.bars .grid { stroke: var(--grid); stroke-width: 1; }
svg.bars .zero { stroke: var(--zero); stroke-width: 1.5; }
svg.bars .tick { fill: var(--muted); font-size: 11px; }
svg.bars .label { fill: var(--ink-2); }
svg.bars .label a { fill: var(--accent); }
svg.bars .amount { fill: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
svg.bars g.bar:focus { outline: none; }
svg.bars g.bar:focus rect, svg.bars g.bar:hover rect { stroke: var(--ink); stroke-width: 1.5; }
svg.spark { vertical-align: middle; overflow: visible; }
svg.bars.shares rect { fill: var(--up); }
svg.shares g.art-I rect, .swatch.art-I { fill: var(--art-I); background: var(--art-I); }
svg.shares g.art-II rect, .swatch.art-II { fill: var(--art-II); background: var(--art-II); }
svg.shares g.art-III rect, .swatch.art-III { fill: var(--art-III); background: var(--art-III); }
svg.shares g.art-IV rect, .swatch.art-IV { fill: var(--art-IV); background: var(--art-IV); }
svg.shares g.art-V rect, .swatch.art-V { fill: var(--art-V); background: var(--art-V); }
svg.shares g.art-VI rect, .swatch.art-VI { fill: var(--art-VI); background: var(--art-VI); }
svg.shares g.art-VII rect, .swatch.art-VII { fill: var(--art-VII); background: var(--art-VII); }
svg.shares g.art-VIII rect, .swatch.art-VIII { fill: var(--art-VIII); background: var(--art-VIII); }
svg.shares g.art-IX rect, .swatch.art-IX { fill: var(--art-IX); background: var(--art-IX); }
svg.shares g.art-X rect, .swatch.art-X { fill: var(--art-X); background: var(--art-X); }
svg.shares g.art-XI rect, .swatch.art-XI { fill: var(--art-XI); background: var(--art-XI); }
ul.key.articles { margin: .25rem 0 .75rem; }
svg.pathchart { display: block; max-width: 100%; height: auto; overflow: visible; font-size: 12px; }
@media (max-width: 40rem) { svg.pathchart { max-width: none; min-width: 34rem; } }
svg.pathchart .base { stroke: var(--zero); stroke-width: 1; }
svg.pathchart .line { fill: none; stroke: var(--up); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.pathchart circle { fill: var(--up); stroke: var(--surface); stroke-width: 2; }
svg.pathchart .latest circle { fill: var(--ink); }
svg.pathchart .value { fill: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
svg.pathchart .xlabel { fill: var(--ink-2); font-size: 11px; }
svg.pathchart .xlabel.missing { fill: var(--muted); font-style: italic; }
svg.pathchart g.point:focus { outline: none; }
svg.pathchart g.point:focus circle, svg.pathchart g.point:hover circle { r: 6px; }
svg.split { display: block; width: 100%; height: 1.1rem; margin: .6rem 0 .4rem; }
.seg.status-new, .swatch.status-new { fill: var(--new); background: var(--new); }
.seg.status-amended, .swatch.status-amended { fill: var(--amended); background: var(--amended); }
.seg.status-deleted, .swatch.status-deleted { fill: var(--deleted); background: var(--deleted); }
.seg.status-years_only, .swatch.status-years_only { fill: var(--years); background: var(--years); }
.seg.status-unchanged, .swatch.status-unchanged { fill: var(--zero); background: var(--zero); }
.seg.status-possible, .swatch.status-possible { fill: var(--possible); background: var(--possible); }
ul.key { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; color: var(--ink-2); }
ul.key .swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
#largest h3 { margin-top: 0; }
figure.chart + figure.chart { margin-top: 1rem; }
svg.spark .line { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
svg.spark circle { fill: var(--ink); }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--paper); font-size: .82rem;
  padding: .35rem .55rem; border-radius: 6px; max-width: 22rem; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.tip b { display: block; font-variant-numeric: tabular-nums; }

/* --- home and lists -------------------------------------------------------------- */
.lead { padding-block: .5rem 1rem; }
.search-box { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1.25rem 0 .75rem; }
.search-box label { width: 100%; font-weight: 600; font-size: .9rem; }
.search-box input { flex: 1 1 16rem; max-width: 34rem; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line-strong); }
.timeline li { display: grid; grid-template-columns: 9.5rem 1fr auto; gap: .25rem 1rem; padding: .45rem 0 .45rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 1rem; width: 10px; height: 10px; border-radius: 50%;
  background: var(--header); }
.timeline .when { color: var(--muted); }
.timeline .what { color: var(--ink); font-weight: 500; }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .5rem; }
.cards a { display: block; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  color: var(--ink); text-decoration: none; font-weight: 500; box-shadow: var(--shadow); }
.cards a:hover { border-color: var(--accent); color: var(--accent); }
.jump { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.jump a { padding: .2rem .65rem; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; font-size: .9rem; background: var(--surface); }
.notes { padding-left: 1.1rem; max-width: 50rem; }
.notes li { margin-bottom: .5rem; }

/* --- riders ------------------------------------------------------------------ */
.status { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.status-new { color: var(--new); background: var(--new-bg); }
.status-amended { color: var(--amended); background: var(--amended-bg); }
.status-deleted { color: var(--deleted); background: var(--deleted-bg); }
.status-unchanged, .status-first, .status-absent { color: var(--same); background: var(--same-bg); }
.status-years_only { color: var(--years); background: var(--years-bg); }
.status-possible { color: var(--possible); background: var(--possible-bg); }
.num-tag { color: var(--muted); font-size: .85rem; margin-right: .2rem; }
table.riders td { white-space: nowrap; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .6rem; margin: 1rem 0; }
.filters label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .2rem; }
.filters input, .filters select { width: 100%; }
.results { list-style: none; padding: 0; margin: 0; }
.results li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.results h3 { margin: 0 0 .15rem; font-size: 1.02rem; }
.results .where { font-size: .88rem; color: var(--muted); margin: 0 0 .3rem; }
.results .snippet { margin: 0; max-width: 60rem; font-size: .95rem; }
mark { background: var(--amended-bg); color: inherit; padding: 0 .1em; border-radius: 2px; }
.rider-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 60rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 1rem 1.1rem; font-size: .98rem; line-height: 1.6; }
.rider-text.table-like { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .82rem; overflow-x: auto; white-space: pre; }
ins { background: var(--ins-bg); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
del { background: var(--del-bg); text-decoration: line-through; }
.compare { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; margin: .75rem 0; }
.compare label { display: block; font-size: .82rem; font-weight: 600; }
.version-block { margin: 0 0 1.5rem; }
.version-block header { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: baseline; margin-bottom: .4rem; }
.version-block h3 { margin: 0; }
.moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.moves table td.num { font-weight: 600; }
.notice ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.notice p { margin: 0; }
details { margin: .4rem 0 1rem; }
summary { cursor: pointer; font-weight: 600; }

@media (max-width: 40rem) {
  table.grid .first { min-width: 9.5rem; max-width: 11rem; font-size: .9rem; }
  th, td { padding: .4rem .5rem; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .site-search { flex: 1 1 100%; order: 3; }
  .stat .value { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print {
  :root, :root[data-theme] { --paper: #fff !important; --surface: #fff !important; --ink: #000 !important;
    --ink-2: #222 !important; --muted: #444 !important; --line: #bbb !important; --line-strong: #888 !important;
    --stripe: #fff !important; --header: #000 !important; color-scheme: light; }
  .site-header nav, .site-search, .theme, .search-box, .switch + label, .filters, .js-only, .tabs, .follow,
  .compare, .compare-form, .follow-tools, .skip, button:not(.sort) { display: none !important; }
  .tab-panel[hidden] { display: block !important; }
  .js .tab-panel > h2:first-child { position: static; width: auto; height: auto; clip-path: none; }
  .scroll { overflow: visible; border: 0; box-shadow: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .site-header { background: none; color: #000; border-bottom: 2px solid #000; } .brand { color: #000; }
  .stages .stage { border: 1px solid #000; background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .stages .stage.latest { font-weight: 700; border-width: 3px; }
  svg .up { fill: #555; } svg .down { fill: #aaa; }
  a { color: #000; text-decoration: none; }
  figure, table, tr { break-inside: avoid; }
}
