/* RIR Transfer Monitor UI.
 *
 * Read: the public register of internet address space, set like an
 * engineering datasheet. Paper and ink, hairline rules, a heavier rule over
 * every section, square corners everywhere. IBM Plex Sans (condensed for
 * headings) and IBM Plex Mono for every resource, date and figure.
 *
 * The one device: the register map (.regmap), a prefix or AS number drawn as
 * its bits, network bits filled. It leads the overview and heads every
 * resource page, and nowhere else.
 *
 * Color rule: the interface is ink on paper; selection and emphasis invert
 * (ink fill, paper text). Colour belongs to the five registries (charts, the
 * swatch in a registry tag) and to two status inks (warn, danger), nothing else.
 * Motion: color and transform only, under 200ms; the register map steps its
 * bits in once on the overview; nothing moves on keyboard-driven actions.
 */

@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/PlexSans-Latin.woff2") format("woff2");
  font-weight: 100 700;
  font-stretch: 85% 100%;
  font-display: swap;
  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: "Plex Sans";
  src: url("/assets/fonts/PlexSans-LatinExt.woff2") format("woff2");
  font-weight: 100 700;
  font-stretch: 85% 100%;
  font-display: swap;
  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: "Plex Mono"; src: url("/assets/fonts/PlexMono-400-Latin.woff2") format("woff2"); font-weight: 400; font-display: swap; 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: "Plex Mono"; src: url("/assets/fonts/PlexMono-500-Latin.woff2") format("woff2"); font-weight: 500; font-display: swap; 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: "Plex Mono"; src: url("/assets/fonts/PlexMono-600-Latin.woff2") format("woff2"); font-weight: 600; font-display: swap; 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: "Plex Mono"; src: url("/assets/fonts/PlexMono-400-LatinExt.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/PlexMono-500-LatinExt.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/PlexMono-600-LatinExt.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }

/* Paper (default). Text tokens measured: ink-3 is 5.3:1 on paper and 4.8:1 on
   wash; rule-strong, the control boundary, 3.1:1 on paper. Registry colours
   are the dataviz reference steps in a validated order (adjacent CVD dE 8.4). */
:root {
  color-scheme: light;
  --paper: #f4f4f1;
  --sheet: #fcfcfa;
  --wash: #e9e9e4;
  --rule: #d5d4cc;
  --rule-strong: #8c8b83;
  --ink: #121211;
  --ink-2: #45443e;
  --ink-3: #66655e;
  --warn: #8a5300;
  --danger: #b42318;

  --afrinic: #6250d6;
  --apnic: #eb6834;
  --arin: #1baf7a;
  --lacnic: #eda100;
  --ripencc: #2a78d6;

  --sans: "Plex Sans", "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --page: 1240px;
  --gutter: 24px;
  --header: 56px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Night: chosen in the header ([data-theme=dark]) or, with no choice stored,
   from the system setting. [data-theme=light] keeps paper either way. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121211;
  --sheet: #1b1b19;
  --wash: #262623;
  --rule: #30302c;
  --rule-strong: #6b6a63;
  --ink: #ecebe6;
  --ink-2: #bdbcb4;
  --ink-3: #97968e;
  --warn: #e5a43c;
  --danger: #f2706a;

  --afrinic: #9085e9;
  --apnic: #d95926;
  --arin: #199e70;
  --lacnic: #c98500;
  --ripencc: #3987e5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #121211;
    --sheet: #1b1b19;
    --wash: #262623;
    --rule: #30302c;
    --rule-strong: #6b6a63;
    --ink: #ecebe6;
    --ink-2: #bdbcb4;
    --ink-3: #97968e;
    --warn: #e5a43c;
    --danger: #f2706a;

    --afrinic: #9085e9;
    --apnic: #d95926;
    --arin: #199e70;
    --lacnic: #c98500;
    --ripencc: #3987e5;
  }
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }
a.link, .prose a, .foot a, .rm-note a, .deal a, .custody .step a, .row .res a, .pools .figure .delta a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  a.link:hover, .prose a:hover, .foot a:hover, .rm-note a:hover, .deal a:hover, .custody .step a:hover,
  .row .res a:hover, .pools .figure .delta a:hover { text-decoration-color: var(--ink); }
  .party a:hover, .ranks .who a:hover, .tl .who a:hover, .holder a:hover { text-decoration: underline; text-underline-offset: 3px; }
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 30;
  padding: 10px 14px; background: var(--ink); color: var(--paper); font-weight: 500;
}
.skip:focus { top: 12px; }

.mono, .num, time, code, kbd { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
p.small, p.faint, p.muted { margin: 10px 0 0; max-width: 92ch; text-wrap: pretty; }

/* The datasheet label: real column and parameter names, never decoration. */
.row.head-row, .kpi .label, .facts dt, .hero-meta dt, .filter-label, .rm-field,
.hero-search .search > label, .feed-label {
  font: 500 12px/1.35 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ header */

.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.top-inner {
  max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--header);
  display: flex; align-items: stretch; gap: 24px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  font-weight: 600; font-size: 15px; font-stretch: 85%; letter-spacing: 0; white-space: nowrap;
}
.mark { width: 24px; height: 14px; fill: currentColor; }
.mark .frame, .mark .host { fill: none; stroke: currentColor; stroke-width: 1.5; }

.nav { display: flex; }
.nav a {
  position: relative; display: inline-flex; align-items: center; flex: none;
  padding: 0 12px; white-space: nowrap;
  color: var(--ink-2); font-weight: 500;
  transition: color 150ms ease;
}
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; background: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--ink); }
}

.top .search { margin-left: auto; width: min(340px, 100%); align-self: center; }
.theme { align-self: center; flex: none; }
body.search-docked .theme { margin-left: auto; }

/* ------------------------------------------------------------------ search */

.search { position: relative; }
.search input {
  width: 100%; height: 36px; padding: 0 36px 0 12px;
  border: 1px solid var(--rule-strong); border-radius: 0;
  background: var(--sheet); color: var(--ink);
  font: 400 14px/1 var(--sans);
  -webkit-appearance: none; appearance: none;
  transition: border-color 150ms ease;
}
.search input::placeholder { color: var(--ink-3); opacity: 1; }
.search input:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
.search input::-webkit-search-cancel-button { display: none; }
.kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--rule-strong); color: var(--ink-3);
  font: 500 12px/18px var(--mono); text-align: center; pointer-events: none;
}
.search input:focus + .kbd { visibility: hidden; }

.results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 25;
  margin: 0; padding: 4px 0; list-style: none;
  background: var(--sheet); border: 1px solid var(--ink);
  max-height: min(420px, 70dvh); overflow: auto;
}
.results li {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  padding: 8px 12px; cursor: pointer;
}
.results li[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.results .r-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .r-main small { display: block; color: var(--ink-3); font-size: 12px; }
.results .r-meta { color: var(--ink-3); font: 400 12px var(--mono); white-space: nowrap; }
.results li[aria-selected="true"] :is(.r-meta, small) { color: inherit; opacity: 0.78; }
.results .r-empty { color: var(--ink-2); cursor: default; display: block; }
.results .r-head { color: var(--ink-3); font: 500 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 12px 2px; cursor: default; display: block; }

/* ------------------------------------------------------------------ layout */

main { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 40px var(--gutter) 80px; }
main:focus { outline: none; }

.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
@media (prefers-reduced-motion: no-preference) {
  .view { animation: enter 200ms var(--ease-out); }
  @keyframes enter { from { opacity: 0; transform: translateY(4px); } }
}

/* Every operational unit opens under a rule of ink. */
.view > section { border-top: 1px solid var(--ink); padding-top: 14px; }

.page-head { display: grid; gap: 10px; min-width: 0; }
.page-head h1 {
  margin: 0; font-size: 36px; line-height: 1.08; font-weight: 600; font-stretch: 85%; letter-spacing: -0.015em;
  text-wrap: balance;
}
.page-head h1.mono { font-family: var(--mono); font-stretch: normal; font-weight: 600; font-size: 32px; letter-spacing: -0.03em; word-break: break-all; }
.page-head p { margin: 0; color: var(--ink-2); max-width: 72ch; text-wrap: pretty; }
.page-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--ink-2); font-size: 13px; }
.page-head .regmap { margin-top: 14px; max-width: 900px; }

section > h2, .section-head h2 {
  margin: 0; font-size: 20px; line-height: 1.25; font-weight: 600; font-stretch: 85%; letter-spacing: -0.005em;
}
section > h2 { margin-bottom: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.section-head .aside { color: var(--ink-3); font-size: 13px; min-width: 0; max-width: 100%; }
h3.sub { margin: 24px 0 8px; font-size: 14px; font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; }
.grid-2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1023px) { .grid-2, .grid-2.even { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ overview hero */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 32px 56px; align-items: end;
}
.hero-copy { display: grid; gap: 16px; }
.hero h1 {
  margin: 0; max-width: 22ch;
  font-size: clamp(38px, 5.4vw, 66px); line-height: 0.98; font-weight: 600; font-stretch: 85%; letter-spacing: -0.025em;
  text-wrap: balance;
}
.lede { margin: 0; max-width: 58ch; color: var(--ink-2); font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.hero-meta {
  margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; align-items: baseline;
  padding-top: 10px; border-top: 1px solid var(--ink);
}
.hero-meta dd { margin: 0; font: 400 13px/1.4 var(--mono); }
.hero-meta dd .faint { display: block; }
.hero .regmap, .hero-search { grid-column: 1 / -1; }
.hero-search .search > label {
  position: static; width: auto; height: auto; margin: 0 0 8px; padding: 0;
  overflow: visible; clip: auto; white-space: normal; display: block;
}
.hero-search .search input { height: 56px; padding: 0 56px 0 16px; border-color: var(--ink); font-size: 18px; }
.hero-search .kbd { top: auto; bottom: 18px; right: 16px; transform: none; }

/* ------------------------------------------------------------------ register map */

.regmap { --n: 32; margin: 0; display: grid; gap: 6px; min-width: 0; }
.rm-idx, .rm-bits, .rm-fields { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.rm-idx span { grid-row: 1; font: 400 12px/1 var(--mono); color: var(--ink-3); white-space: nowrap; padding: 0 5px; }
.rm-idx .lo { text-align: right; direction: rtl; }
.rm-bits { border: 1px solid var(--ink); background: var(--sheet); }
.rm-bits i {
  height: 48px; display: grid; place-items: center;
  border-left: 1px solid var(--rule);
  font: 500 14px/1 var(--mono); font-style: normal; color: var(--ink-3);
}
.rm-bits i:first-child { border-left: 0; }
.regmap[data-type="ipv6"] .rm-bits i { font-size: 12px; }
.page-head .regmap[data-type="ipv6"] { max-width: none; }
.regmap:not([data-type="ipv6"]) .rm-bits i:nth-child(8n + 1):not(:first-child),
.regmap[data-type="ipv6"] .rm-bits i:nth-child(16n + 1):not(:first-child) { border-left-color: var(--ink); }
.rm-bits i:is(.net, .on) { background: var(--ink); color: var(--paper); border-left-color: color-mix(in srgb, var(--paper) 18%, var(--ink)); }
.regmap:not([data-type="ipv6"]) .rm-bits i:is(.net, .on):nth-child(8n + 1):not(:first-child),
.regmap[data-type="ipv6"] .rm-bits i:is(.net, .on):nth-child(16n + 1):not(:first-child) { border-left-color: var(--paper); }
.rm-field {
  grid-row: 1; position: relative; margin: 0 1px; padding-top: 7px;
  border-top: 1px solid var(--ink); color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rm-field::before, .rm-field::after { content: ""; position: absolute; top: -1px; width: 1px; height: 6px; background: var(--ink); }
.rm-field::before { left: 0; }
.rm-field::after { right: 0; }
.rm-field span { padding-left: 6px; }
.rm-field.narrow span { visibility: hidden; }
.regmap figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-top: 8px; }
.rm-label { font: 600 24px/1.2 var(--mono); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.rm-facts { font: 400 13px/1.4 var(--mono); color: var(--ink-2); }
.rm-note { flex-basis: 100%; color: var(--ink-2); font-size: 14px; text-wrap: pretty; }
@media (prefers-reduced-motion: no-preference) {
  .regmap.fill .rm-bits i { animation: rm-in 40ms steps(1, end) backwards; }
  @keyframes rm-in { from { background: var(--sheet); color: transparent; } }
}

/* ------------------------------------------------------------------ figures */

.kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule);
}
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { min-width: 0; padding: 4px 20px 18px 0; display: grid; gap: 6px; align-content: start; }
.kpi + .kpi { padding-left: 20px; border-left: 1px solid var(--rule); }
.kpi .label { order: -1; }
.kpi .value { font: 500 34px/1.05 var(--mono); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpis.amounts .value { font-size: 26px; }
.kpi .note { color: var(--ink-3); font: 400 12px/1.45 var(--mono); overflow-wrap: anywhere; }
.market .kpis { margin-top: 4px; }

/* Kind cards: cells of one ruled table (1px gaps over the rule colour). */
.kind-cards {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule);
}
.kind-cards.rest { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kind-card {
  display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 6px; min-width: 0;
  padding: 14px 16px 16px; background: var(--paper); color: var(--ink);
  transition: background-color 150ms ease;
}
.kind-card:first-child { grid-column: span 2; }
.kind-cards.rest .kind-card:first-child { grid-column: auto; }
.kind-card:active { background: var(--wash); }
.kc-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.kc-go { margin-left: auto; color: var(--ink-3); transition: transform 160ms var(--ease-out), color 150ms ease; }
.kc-value { font: 500 30px/1.05 var(--mono); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.kind-card:first-child .kc-value { font-size: 36px; }
.kind-cards.rest .kind-card:first-child .kc-value { font-size: 30px; }
.kc-unit { margin-left: 2px; white-space: pre; font: 400 13px var(--sans); color: var(--ink-3); letter-spacing: 0; }
.kc-trend { color: var(--ink-2); font: 400 12px/1.4 var(--mono); }
.kc-spark { height: 32px; margin: 8px 0 2px; align-self: end; }
.kc-spark polyline { stroke: var(--ink-3); stroke-width: 1.25; }
.kc-facts { color: var(--ink-3); font-size: 12px; line-height: 1.45; }
@media (hover: hover) and (pointer: fine) {
  .kind-card:hover { background: var(--sheet); }
  .kind-card:hover .kc-go { transform: translateX(3px); color: var(--ink); }
  .kind-card:hover .kc-spark polyline { stroke: var(--ink); }
}

/* ------------------------------------------------------------------ controls */

.toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; margin-bottom: 16px; }
.filter { display: grid; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px; padding: 0 12px;
  border: 1px solid var(--rule-strong); border-radius: 0; background: transparent; color: var(--ink-2);
  font: 500 13px/1 var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .chip:hover:not([aria-pressed="true"]) { color: var(--ink); border-color: var(--ink); }
}
.chip .dot { margin: 0; }

.field { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.field input {
  height: 32px; padding: 0 8px; border-radius: 0;
  border: 1px solid var(--rule-strong); background: var(--sheet); color: var(--ink);
  font: 400 13px/1 var(--mono);
}
.field input:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }

.button {
  height: 36px; padding: 0 16px; border-radius: 0;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font: 500 14px/1 var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease;
}
.button:active { transform: scale(0.97); }
.button[disabled] { opacity: 0.55; cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .button:hover:not([disabled]) { background: var(--ink); color: var(--paper); }
}
.more { display: flex; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 20px; }

.segmented { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--rule-strong); }
.segmented button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 0;
  background: transparent; color: var(--ink-2); font: 500 13px/1 var(--sans); cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.segmented button + button { box-shadow: inset 1px 0 var(--rule-strong); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .segmented button:hover:not([aria-pressed="true"]) { color: var(--ink); }
}

/* Tabs: the active one is an index tab of ink sitting on the rule. */
.tabs, .kind-nav {
  display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  box-shadow: inset 0 -1px var(--ink);
}
.tabs::-webkit-scrollbar, .kind-nav::-webkit-scrollbar { display: none; }
.tabs { margin-bottom: 8px; }
.kind-nav { margin-bottom: -16px; }
.tabs button, .kind-nav a {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 14px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  color: var(--ink-2); font: 500 14px/1.2 var(--sans);
  transition: color 150ms ease, background-color 150ms ease;
}
.tabs button[aria-selected="true"], .kind-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.tabs .count, .kind-nav a .count { color: inherit; opacity: 0.7; font: 400 12px var(--mono); }
.kind-nav a .count:empty { display: none; }
.kind-nav a .glyph { color: inherit; }
@media (hover: hover) and (pointer: fine) {
  .tabs button:hover:not([aria-selected="true"]), .kind-nav a:hover:not([aria-current="page"]) { color: var(--ink); background: var(--wash); }
}

/* ------------------------------------------------------------------ tags and colour keys */

.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px;
  border: 1px solid var(--rule-strong); color: var(--ink-2);
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.tag.rir { color: var(--ink); }
.tag.rir::before { content: ""; width: 8px; height: 8px; background: var(--c, var(--ink-3)); }
.tag.accent { color: var(--ink); border-color: var(--ink); }
.tag.warn { color: var(--warn); border-color: currentColor; }
.tag.danger { color: var(--danger); border-color: currentColor; }
.tag.inferred { border-style: dashed; }
/* National-registry members: own name plus the NIR as a badge. */
.tag.nir { height: 18px; padding: 0 5px; font: 500 12px/1 var(--mono); letter-spacing: 0.02em; vertical-align: 1px; }
/* Both parties of a move are one corporate group: solid when curated or the
   same name, dashed when inferred from a shared name stem. */
.tag.group { height: 18px; padding: 0 6px; font-size: 12px; color: var(--ink); border-color: var(--ink); }
.tag.group.soft { color: var(--ink-2); border-style: dashed; border-color: var(--rule-strong); }
a.tag.group:hover, a.tag.group:focus-visible { background: var(--ink); color: var(--paper); }

.rir-afrinic { --c: var(--afrinic); }
.rir-apnic { --c: var(--apnic); }
.rir-arin { --c: var(--arin); }
.rir-lacnic { --c: var(--lacnic); }
.rir-ripencc { --c: var(--ripencc); }
/* IPv4 block sizes: one ink ramp, light for small blocks to solid for large,
   so the order reads without colour. The lightest step stays above 2:1. */
.size-24 { --c: color-mix(in oklab, var(--ink) 36%, var(--paper)); }
.size-22 { --c: color-mix(in oklab, var(--ink) 50%, var(--paper)); }
.size-20 { --c: color-mix(in oklab, var(--ink) 63%, var(--paper)); }
.size-17 { --c: color-mix(in oklab, var(--ink) 76%, var(--paper)); }
.size-16 { --c: color-mix(in oklab, var(--ink) 88%, var(--paper)); }
.size-big { --c: var(--ink); }
/* Transfer direction on an organization page. */
.flow-in { --c: var(--ink); }
.flow-out { --c: color-mix(in oklab, var(--ink) 40%, var(--paper)); }

.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: var(--c, var(--ink-3)); vertical-align: 1px; }

/* One glyph per event kind (a holder is a dot, a registry pool a box, the
   stroke the direction of the move), in currentColor. */
.glyph {
  width: 14px; height: 14px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter;
}
.tag .glyph { width: 13px; height: 13px; margin-left: -2px; color: var(--ink-3); }
.tag.warn .glyph { color: currentColor; }
.page-head h1.with-glyph { display: flex; align-items: center; gap: 14px; }
.page-head h1 .glyph {
  width: 22px; height: 22px; padding: 8px; box-sizing: content-box;
  border: 1px solid var(--ink); color: var(--ink); stroke-width: 1.35;
}

/* ------------------------------------------------------------------ ledger rows */

.rows { border-top: 1px solid var(--rule); }
.rows:has(> .head-row) { border-top: 0; }
.row {
  display: grid; gap: 4px 16px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--rule);
}
.row.head-row { padding: 0 0 8px; border-bottom: 1px solid var(--ink); }
/* Size columns fit "634.6K addresses" (118 px) without running into the party column. */
.row.event { grid-template-columns: 96px 112px minmax(150px, 1.1fr) minmax(0, 2.2fr) 124px 150px; }
.row.event.with-source { grid-template-columns: 96px 112px minmax(150px, 1.1fr) minmax(0, 2fr) 124px 170px; }
.row.change { grid-template-columns: 96px 128px minmax(150px, 1.1fr) minmax(0, 2fr) 124px 96px; }
.row.holding { grid-template-columns: minmax(150px, 1.2fr) 56px 92px 96px 96px 96px minmax(0, 1.3fr); }
.row.otransfer { grid-template-columns: 96px 112px minmax(150px, 1fr) minmax(0, 2fr) 124px; }
.row.pool { grid-template-columns: minmax(150px, 1.2fr) 124px 96px 110px minmax(0, 1.4fr) minmax(0, 1.4fr); }
/* Time columns fit "2026-11-10 08:01 UTC" on one line; a fixed state column keeps the rows aligned. */
.row.feedstat { grid-template-columns: 120px minmax(0, 1fr) 180px 180px 90px 110px; align-items: center; }
.row.runstat { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 110px; align-items: center; }
.row.runstat > :nth-child(4) { justify-self: end; }
/* Rows without a state (queue counts) give its column to the text. */
.row.runstat > :empty { display: none; }
.row.runstat:has(> :last-child:empty) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); }
.row.linked { grid-template-columns: minmax(0, 1.5fr) 140px minmax(0, 1fr) minmax(0, 1.2fr); }
.row.endpoint { grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.6fr) minmax(0, 1fr); }
.row.endpoint code { overflow-wrap: anywhere; }
.row .cell-date { color: var(--ink-2); font: 400 13px/1.5 var(--mono); }
.row .res { font: 500 13px/1.5 var(--mono); overflow-wrap: anywhere; }
.party { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.party .who { min-width: 0; overflow-wrap: anywhere; }
.party .arrow { color: var(--ink-3); }
.party .none { color: var(--ink-3); }
.row .src { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row .detail { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.row .cc { color: var(--ink-3); font: 400 12px var(--mono); }
.row .kind { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.size { color: var(--ink-2); font: 400 13px/1.5 var(--mono); white-space: nowrap; justify-self: end; }
.size small { color: var(--ink-3); font-size: 12px; }
.basis { color: var(--ink-2); font-size: 12px; }
.basis.inferred { color: var(--ink-3); }
.blocks { display: block; color: var(--ink-3); font-size: 12px; }
.holder { display: block; color: var(--ink-2); }
.holder a { color: var(--ink); }
.dir { color: var(--ink-3); font-size: 12px; }
.org-name { display: inline; }

/* Phone rows. The header row is hidden under 768px, so a row is a few short
   lines: facts share a line where they fit, and a cell whose meaning came from
   its column header shows that header (data-label) in front of the value. */
@media (max-width: 767px) {
  .row.head-row { display: none; }
  .rows:has(> .head-row) { border-top: 1px solid var(--ink); }
  .row:is(.pool, .holding, .linked) > :empty { display: none; }
  .row [data-label]::before { color: var(--ink-3); font: 400 12px/1.5 var(--sans); margin-right: 6px; }

  /* Feeds: date, kind and registry; then resource and size; then the parties. */
  .row:is(.event, .change, .otransfer), .row.event.with-source { grid-template-columns: auto auto minmax(0, 1fr); column-gap: 12px; }
  .row:is(.event, .change, .otransfer) > * { grid-column: 1 / -1; }
  .row:is(.event, .change, .otransfer) > :nth-child(1) { grid-area: 1 / 1; }
  .row:is(.event, .change, .otransfer) > :nth-child(2) { grid-area: 1 / 2; }
  .row:is(.event, .change, .otransfer) > :nth-child(3) { grid-area: 2 / 1 / auto / span 2; }
  .row:is(.event, .change, .otransfer) > :nth-child(4) { grid-area: 3 / 1 / auto / -1; }
  .row:is(.event, .change, .otransfer) > :nth-child(5) { grid-area: 2 / 3; justify-self: end; }
  .row:is(.event, .change) > :nth-child(6) { grid-area: 1 / 3; }
  .row.event.with-source > :nth-child(6) { grid-area: 4 / 1 / auto / -1; justify-content: flex-start; }

  /* Pool ranges and holdings: resource and size; two dated facts; then the names. */
  .row:is(.pool, .holding, .linked) { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .row:is(.pool, .holding, .linked) > :first-child { flex: 1 1 auto; }
  .row.pool > :nth-child(n + 3)[data-label]::before,
  .row.holding > :nth-child(n + 4):nth-child(-n + 6)[data-label]:not(:has(.tag))::before { content: attr(data-label); }
  .row.pool > :nth-child(n + 5), .row.holding > :nth-child(7) { flex-basis: 100%; }
  /* The type repeats what the resource shows. */
  .row.holding > :nth-child(2) { display: none; }

  /* Status: name and state on the first line, each time on a labelled line of its own. */
  .row.feedstat { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; }
  .row.runstat, .row.runstat:has(> :last-child:empty) { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .row.feedstat > :nth-child(n + 3):nth-child(-n + 5), .row.runstat > :nth-child(n + 2):nth-child(-n + 3) { grid-column: 1 / -1; }
  .row.feedstat > :nth-child(6) { grid-area: 1 / 3; }
  .row.runstat > :nth-child(4) { grid-area: 1 / 2; }
  .row.feedstat > [data-label]::before { content: attr(data-label); display: inline-block; width: 84px; margin-right: 0; }
  .row:is(.feedstat, .runstat) .when { display: inline-flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
  .row.endpoint { grid-template-columns: minmax(0, 1fr); }
}

/* Copy, expand and raw-record controls inside rows. */
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.res-link { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.copy {
  height: 20px; padding: 0 6px; border-radius: 0; border: 1px solid var(--rule-strong);
  background: transparent; color: var(--ink-3); font: 500 12px/18px var(--sans); cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
.row .copy { opacity: 0; }
.row:hover .copy, .row:focus-within .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .row .copy { opacity: 1; } }
.copy[data-state="done"] { color: var(--paper); background: var(--ink); border-color: var(--ink); opacity: 1; }
.copy[data-state="failed"] { color: var(--danger); border-color: var(--danger); opacity: 1; }
@media (hover: hover) and (pointer: fine) { .copy:hover { color: var(--ink); border-color: var(--ink); } }
.title-row .copy { height: 26px; padding: 0 8px; font-size: 12px; }

.expand {
  margin-left: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--ink); font: 500 12px var(--sans); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-strong);
}
.expand[aria-expanded="true"] { color: var(--ink-2); }
.row-panel { grid-column: 1 / -1; padding: 6px 0 2px; }
.deal { display: grid; gap: 6px; font-size: 13px; }
.deal ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); }

pre.raw {
  margin: 0; padding: 12px 14px; max-height: 320px; overflow: auto;
  background: var(--sheet); border: 1px solid var(--rule); color: var(--ink);
  font: 400 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.raw-details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.raw-details[open] summary { margin-bottom: 8px; }

/* Definition grids for delegation and profile facts. */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 24px; margin: 0; }
.facts div { display: grid; gap: 4px; min-width: 0; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.block { padding: 18px 0; border-top: 1px solid var(--rule); display: grid; gap: 16px; }
.block:last-child { border-bottom: 1px solid var(--rule); }
.block-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.block-head .res { font: 600 16px/1.3 var(--mono); }

/* Chain of custody and waiting-period rules. */
.custody, .rules { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--rule); }
.rules { margin: 0; }
.custody li {
  display: grid; grid-template-columns: 96px 150px minmax(0, 1fr); gap: 4px 16px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--rule);
}
.custody li > :first-child { font-family: var(--mono); color: var(--ink-2); }
.custody .tag, .rules .tag { justify-self: start; }
.custody .step { overflow-wrap: anywhere; }
.custody .prov, .rules .prov { display: block; color: var(--ink-3); font-size: 12px; }
.custody .prov a.link, .rules .prov a.link { color: var(--ink-2); }
.rules li {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 4px 16px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--rule);
}
.rules .rule { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.rules .rule strong { font-weight: 600; }
.rules .prov a.link { white-space: nowrap; }
.rules .nowrap { white-space: nowrap; }
@media (max-width: 767px) {
  .custody li { grid-template-columns: 88px minmax(0, 1fr); }
  .custody .step { grid-column: 1 / -1; }
  .rules li { grid-template-columns: minmax(0, 1fr); }
}

/* About and API. */
.terms { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px 24px; margin: 0; }
.terms dt { font-weight: 600; }
.terms dd { margin: 0; color: var(--ink-2); }
.terms.fields { grid-template-columns: 220px minmax(0, 1fr); gap: 6px 24px; }
.terms.fields dt { font: 500 13px/1.5 var(--mono); }
.api-docs h3 { margin: 20px 0 8px; font-size: 15px; font-weight: 600; }
.api-docs h3:first-of-type { margin-top: 4px; }
.api-docs p, .prose p { max-width: 72ch; color: var(--ink-2); }
@media (max-width: 767px) {
  .terms, .terms.fields { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .terms dd { margin-bottom: 10px; }
}

/* ------------------------------------------------------------------ timeline */

.tl-wrap { margin-top: 12px; }
.tl { display: grid; gap: 2px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: minmax(140px, 260px) minmax(0, 1fr); gap: 16px; align-items: center; }
.tl-row { min-height: 32px; }
.tl .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl .who small { display: block; color: var(--ink-3); font: 400 12px/1.4 var(--mono); white-space: normal; }
.tl svg { width: 100%; height: 14px; display: block; overflow: visible; }
.tl .bar { fill: var(--ink-3); }
.tl .bar.current { fill: var(--ink); }
.tl .bar.inferred { fill: transparent; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 2; }
.tl-axis svg { height: 18px; }
.tl-axis text { fill: var(--ink-3); font: 400 12px var(--mono); }
.tl-axis line { stroke: var(--ink); }
.tl-group + .tl-group { margin-top: 22px; }
.tl-group h3 { margin: 0 0 8px; font: 500 13px/1.4 var(--mono); color: var(--ink-2); }
@media (max-width: 767px) {
  .tl-axis, .tl-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tl-axis > :first-child { display: none; }
  .tl-row { padding: 6px 0; }
}

/* ------------------------------------------------------------------ charts */

.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--rule); }
.chart .grid line:first-of-type { stroke: var(--ink); }
.chart .grid text, .chart .xaxis text { fill: var(--ink-3); font: 400 12px var(--mono); }
.chart .cursor { fill: var(--wash); }
.chart .seg { fill: var(--c, var(--ink-3)); }
.chart:focus-visible { outline-offset: 6px; }
/* The month (or year) still filling: full colour under a hatch of paper. */
.chart .hatch { stroke: var(--paper); stroke-width: 2; }

/* Every stacked-bar chart carries its figures as text: a hidden summary and a table on request. */
.chart-tools { display: flex; justify-content: flex-end; margin-top: 6px; }
.chart-toggle {
  border: 0; background: none; padding: 4px 0; color: var(--ink-2); font: 500 12px var(--mono); cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.04em;
  text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px;
}
.chart-toggle:hover, .chart-toggle:focus-visible { color: var(--ink); text-decoration-color: var(--ink); }
.chart-table { margin-top: 8px; }
.chart-table .table-wrap, .matrix-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
table.data thead th { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); border-bottom-color: var(--ink); }
table.data tbody th { font: 400 12px var(--mono); color: var(--ink-2); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); font-size: 12px; }
table.data tfoot th, table.data tfoot td { border-bottom: 0; border-top: 1px solid var(--ink); font-weight: 600; color: var(--ink); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; background: var(--c); }

.tooltip {
  position: absolute; top: 0; left: 0; z-index: 10; pointer-events: none;
  min-width: 184px; padding: 10px 12px;
  background: var(--sheet); border: 1px solid var(--ink); font-size: 12px;
}
.tooltip[hidden] { display: none; }
.tooltip .t-title { font: 600 12px var(--mono); margin-bottom: 6px; }
.tooltip .t-note { color: var(--ink-2); font-size: 12px; margin: -2px 0 6px; }
.tooltip .t-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; color: var(--ink-2); }
.tooltip .t-row i { width: 8px; height: 8px; background: var(--c); }
.tooltip .t-row b { font: 500 12px var(--mono); color: var(--ink); }
.tooltip .t-total { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--ink); display: flex; justify-content: space-between; font-weight: 600; }

/* Registry flows: one grey ramp under ink text. */
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.matrix td { font-family: var(--mono); background: color-mix(in srgb, var(--ink) calc(var(--w, 0) * 60%), transparent); }
.matrix th { color: var(--ink-2); font-weight: 500; }
.matrix thead th { font: 500 12px var(--mono); border-bottom-color: var(--ink); }
.matrix th:first-child { text-align: left; }
.matrix td.same { font-style: italic; }
.net-flows { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.net-flows > .faint { flex-basis: 100%; }
.net-flows .net { display: inline-flex; align-items: center; gap: 6px; }
.net-flows .num { font: 500 13px var(--mono); }

/* Share bars by registry and by resource type. */
.dist { border-top: 1px solid var(--ink); }
.dist-row {
  display: grid; grid-template-columns: 104px minmax(0, 1fr) 64px 40px; gap: 14px; align-items: center;
  min-height: 42px; padding: 6px 0; border-bottom: 1px solid var(--rule);
}
.dist.types .dist-row { grid-template-columns: 52px minmax(0, 1fr) 64px 40px 96px; }
.dist-label { min-width: 0; color: var(--ink-2); font-size: 13px; }
.dist-bar { height: 8px; background: var(--wash); overflow: hidden; }
.dist-bar i { display: block; height: 100%; width: calc(var(--share, 0) * 100%); min-width: 2px; background: var(--c, var(--ink)); }
.dist-row.zero .dist-bar i { min-width: 0; }
.dist-row > .num { text-align: right; }
.dist-row .share { color: var(--ink-3); font-size: 12px; }
.dist-row .extra { color: var(--ink-2); font: 400 12px var(--mono); text-align: right; white-space: nowrap; }
@media (max-width: 767px) {
  .dist-row { grid-template-columns: 96px minmax(0, 1fr) 56px 36px; gap: 10px; }
  .dist.types .dist-row { grid-template-columns: 44px minmax(0, 1fr) 52px 36px; }
  .dist.types .extra { grid-column: 2 / -1; text-align: left; margin-top: -4px; }
}

/* Sparklines: a break where a day has no file. */
.spark { width: 100%; height: 28px; display: block; overflow: visible; }
.spark polyline { fill: none; stroke: var(--ink-2); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.spark polyline.dot { stroke-linecap: square; stroke-width: 3; }
.spark:is(.rir-afrinic, .rir-apnic, .rir-arin, .rir-lacnic, .rir-ripencc) polyline { stroke: var(--c); stroke-width: 1.75; }
.spark-wide { margin-top: 16px; display: grid; gap: 4px; }
.spark-wide .spark { height: 48px; }

/* Free pools on the overview. */
.pools .row { grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 24px; }
.pools .who { display: grid; gap: 4px; justify-items: start; }
.pools .who time { font-size: 12px; }
.pools .figure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, max-content); column-gap: 16px; align-items: center; }
.pools .figure .num { font-size: 14px; font-weight: 500; }
.pools .figure a.num { color: var(--ink); }
.pools .delta { grid-column: 1; font: 400 12px/1.5 var(--mono); color: var(--ink-3); }
.spark-box { grid-column: 2; grid-row: 1 / span 3; display: grid; gap: 2px; min-width: 0; }
.spark-box .span { font: 400 12px var(--mono); white-space: nowrap; text-align: right; }
.pool-summary:not(:empty) { margin-bottom: 24px; }
@media (max-width: 767px) {
  .pools .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pools .row > .who { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; align-items: center; gap: 8px; }
  .pools .figure { grid-template-columns: minmax(0, 1fr); }
  .spark-box { grid-column: 1; grid-row: auto; }
  .spark-box .span { text-align: left; }
}

/* Rankings: rank, name with counterparty and deal lines, two figures. */
.ranks .row { grid-template-columns: 28px minmax(0, 1fr) 76px 76px; }
.ranks .row > .num { text-align: right; }
.ranks .head-row > span:nth-child(n+3) { text-align: right; }
.ranks .rank { color: var(--ink-3); font: 400 12px var(--mono); }
.ranks .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranks .who .pair, .ranks .who .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranks .who .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.ranks .who .sub a { color: var(--ink-2); }
.ranks .who .sub .tag.nir, .ranks .who .sub .tag.group { height: 16px; vertical-align: 1px; }
.ranks .who .badge-line { margin-top: 4px; line-height: 1; }
.ranks .who .arrow { color: var(--ink-3); }
.ranks .window { margin: -8px 0 12px; }
@media (max-width: 359px) { .ranks .who .sub.badge-line { display: none; } }  /* the column is 76px here: no room for the badge */
/* Ranked lists that take a full row: two balanced columns on wide screens, one list on narrow ones. */
.rank-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; align-items: start; }
p + .rank-cols { margin-top: 10px; }
@media (max-width: 1023px) {
  .rank-cols { grid-template-columns: minmax(0, 1fr); }
  .rank-cols > .rows + .rows { border-top: 0; }
  .rank-cols > .rows + .rows > .head-row { display: none; }
}

/* Status: times with their age, tags side by side. */
.when { display: grid; gap: 1px; }
.row.feedstat .source { display: grid; gap: 1px; }
.tally { display: block; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.feed-links { display: inline-flex; gap: 14px; }

/* ------------------------------------------------------------------ states */

.skeleton { display: grid; gap: 14px; }
.sk { height: 14px; background: var(--wash); }
.sk.h1 { height: 30px; width: min(420px, 70%); }
.sk.line { width: 100%; }
.sk.short { width: 40%; }
.sk.block { height: 220px; }
@media (prefers-reduced-motion: no-preference) {
  .sk { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.5; } }
}

.empty, .error {
  padding: 28px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  color: var(--ink-2); display: grid; gap: 10px; justify-items: start;
}
.empty strong, .error strong { color: var(--ink); font-weight: 600; }
.error strong { color: var(--danger); }

.notice {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 14px; border: 1px solid var(--rule-strong); border-left: 4px solid var(--warn);
  background: var(--sheet); color: var(--ink); font-size: 13px;
}

/* ------------------------------------------------------------------ footer */

.foot { border-top: 1px solid var(--ink); }
.foot-inner {
  max-width: var(--page); margin: 0 auto; padding: 18px var(--gutter) 32px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  color: var(--ink-3); font-size: 13px;
}
.foot-inner p { margin: 0; }
.foot-links { display: inline-flex; flex-wrap: wrap; gap: 4px 18px; }

/* ------------------------------------------------------------------ theme control */

.theme { display: inline-flex; border: 1px solid var(--rule-strong); }
.theme button {
  width: 32px; height: 30px; border: 0; border-radius: 0; background: transparent; color: var(--ink-3);
  display: inline-grid; place-items: center; cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.theme button + button { box-shadow: inset 1px 0 var(--rule-strong); }
.theme button[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; }
.theme button[data-theme-choice="dark"] svg { fill: currentColor; stroke: none; }
@media (hover: hover) and (pointer: fine) { .theme button:hover:not([aria-pressed="true"]) { color: var(--ink); } }

/* ------------------------------------------------------------------ narrow screens */

@media (max-width: 1023px) {
  .top-inner { gap: 16px; }
  .nav a { padding: 0 8px; }
  .nav a[aria-current="page"]::after { left: 8px; right: 8px; }
  .kind-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kind-cards.rest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  /* One column: the search comes before the data facts. */
  .hero-meta { order: 1; max-width: 480px; }
}

@media (max-width: 767px) {
  :root { --gutter: 16px; }
  /* Three header rows would hold a sixth of a phone screen: the header scrolls away. */
  .top { position: static; }
  .top-inner { height: auto; flex-wrap: wrap; gap: 10px 12px; padding: 10px var(--gutter) 0; align-items: center; }
  .brand { height: 34px; }
  .theme { order: 1; margin-left: auto; }
  .top .search { order: 2; width: 100%; margin-left: 0; }
  /* All five sections fit a 360px screen; narrower ones scroll. */
  .nav {
    order: 3; width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter));
    padding: 0 6px; overflow-x: auto; scrollbar-width: none; justify-content: space-between;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 12px 8px; font-size: 14px; }
  .kbd { display: none; }

  main { padding: 28px var(--gutter) 56px; }
  .view { gap: 44px; }
  .page-head h1 { font-size: 28px; }
  .page-head h1.mono { font-size: 24px; }
  .page-head h1 .glyph { width: 18px; height: 18px; padding: 6px; }
  .hero h1 { font-size: 38px; }
  .lede { font-size: 15px; }
  .hero-search .search input { height: 52px; font-size: 17px; padding-right: 16px; }

  .rm-bits i { height: 40px; font-size: 12px; }
  .regmap[data-type="ipv6"] .rm-bits i { font-size: 0; }
  .rm-label { font-size: 20px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { padding-left: 0; border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--rule); padding-top: 12px; }
  .kpi .value { font-size: 28px; }
  /* A prefix as a figure ("137.76.0.0/16") fits half a phone screen. */
  .kpi .value a { font-size: 18px; }
  .kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.three .kpi:nth-child(3) { padding-left: 12px; border-left: 1px solid var(--rule); }
  .kpis.three .kpi:nth-child(n + 3) { border-top: 0; padding-top: 4px; }
  .kpis.three .kpi + .kpi { padding-left: 12px; }

  .kind-cards, .kind-cards.rest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kind-card { padding: 12px; }
  .kc-value, .kind-cards.rest .kind-card:first-child .kc-value { font-size: 26px; }
  .kind-card:first-child .kc-value { font-size: 30px; }
  .kind-nav { margin: 0 calc(-1 * var(--gutter)) -12px; padding: 0 var(--gutter); }

  .tags { justify-content: flex-start; }
  .foot-inner { padding: 16px var(--gutter) 28px; }
}

@media (max-width: 400px) {
  /* The pool date span ("2026-07-27 to 2026-10-02") wraps instead of widening the page. */
  .spark-box .span { white-space: normal; }
  /* Three six-digit figures side by side (status: ownership coverage) fit a 320 px screen. */
  .kpis.three .kpi .value { font-size: 19px; }
  .hero h1 { font-size: 34px; }
}

/* Touch: controls grow to a thumb. */
@media (pointer: coarse) {
  .chip, .segmented button, .field input { min-height: 40px; }
  .theme button { width: 40px; height: 36px; }
  .copy { height: 28px; padding: 0 8px; }
  .chart-toggle { padding: 10px 0; }
}
