/* Corporate Disclosure Data: shared design system.
   One grid, one type scale, one component vocabulary for every page.
   Charts read --ink, --ink-2, --paper, --muted, --grid, --axis, --s1..--s8, --b1..--b10,
   --median, --median-halo, --f-body and --f-mono at draw time. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-2: #f1efea;
  --field: #ffffff;
  --ink: #1a1b1e;
  --ink-2: #383a3f;
  --muted: #5c5e64;
  --rule: #dedcd5;
  --rule-2: #85837c;
  --accent: #14305c;
  --accent-soft: #e7ecf4;
  --accent-ink: #ffffff;
  --signal: #bf5700;
  --band: var(--paper-2);
  --note-bg: var(--paper-2);
  --note-ink: var(--ink-2);
  --grid: #e7e5df;
  --axis: #8b8982;
  --edge: #8b8982;
  --edge-hi: #5c5e64;
  --median: #1a1b1e;
  --median-halo: #ffffff;
  /* categorical series */
  --s1: #1f4e79;
  --s2: #c2611f;
  --s3: #2b7f76;
  --s4: #a5801a;
  --s5: #7a5c8e;
  --s6: #4d7f3a;
  --s7: #b23a3a;
  --s8: #77726a;
  /* ordinal ramp, darkest first */
  --b1: #0e2440;
  --b2: #15304f;
  --b3: #24476e;
  --b4: #375f8a;
  --b5: #5076a0;
  --b6: #6c8fb6;
  --b7: #8aa6c6;
  --b8: #a7bdd5;
  --b9: #c9d6e4;
  --b10: #e3e9f0;

  --f-display: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 2px;
  --shadow: none;
  --measure: 70ch;
  --content: 1200px;
  --gutter: 32px;
  --wrap: calc(var(--content) + 2 * var(--gutter));
  --col-gap: 24px;
  --section: 96px;
  --main-span: 1 / span 7;
  --side-span: 8 / span 5;
  /* Width of the main column inside a full .wrap. */
  --main-w: calc((min(100vw, var(--wrap)) - 2 * var(--gutter) - 11 * var(--col-gap)) * 7 / 12 + 6 * var(--col-gap));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --paper: #121315;
    --paper-2: #1c1d20;
    --field: #17181b;
    --ink: #e9e9e6;
    --ink-2: #cacac6;
    --muted: #a1a29d;
    --rule: #2e3034;
    --rule-2: #6c6e71;
    --accent: #9dbcec;
    --accent-soft: #1b2638;
    --accent-ink: #121315;
    --signal: #ff9a4d;
    --grid: #25272b;
    --axis: #6c6e71;
    --edge: #6c6e71;
    --edge-hi: #a1a29d;
    --median: #0b0c0d;
    --median-halo: #d8d8d4;
    --s1: #7fb0e0;
    --s2: #f0965a;
    --s3: #5cc2b4;
    --s4: #ddbd5c;
    --s5: #c3a2d8;
    --s6: #8fc47a;
    --s7: #d0659f;
    --s8: #b0aa9e;
    --b1: #eef3f9;
    --b2: #d9e5f2;
    --b3: #bed1e6;
    --b4: #a0bbd8;
    --b5: #84a4c8;
    --b6: #6b8eb8;
    --b7: #5779a3;
    --b8: #48688f;
    --b9: #334c6b;
    --b10: #233750;
  }
}

:root[data-theme=dark] {
  color-scheme: dark;
  --paper: #121315;
  --paper-2: #1c1d20;
  --field: #17181b;
  --ink: #e9e9e6;
  --ink-2: #cacac6;
  --muted: #a1a29d;
  --rule: #2e3034;
  --rule-2: #6c6e71;
  --accent: #9dbcec;
  --accent-soft: #1b2638;
  --accent-ink: #121315;
  --signal: #ff9a4d;
  --grid: #25272b;
  --axis: #6c6e71;
  --edge: #6c6e71;
  --edge-hi: #a1a29d;
  --median: #0b0c0d;
  --median-halo: #d8d8d4;
  --s1: #7fb0e0;
  --s2: #f0965a;
  --s3: #5cc2b4;
  --s4: #ddbd5c;
  --s5: #c3a2d8;
  --s6: #8fc47a;
  --s7: #d0659f;
  --s8: #b0aa9e;
  --b1: #eef3f9;
  --b2: #d9e5f2;
  --b3: #bed1e6;
  --b4: #a0bbd8;
  --b5: #84a4c8;
  --b6: #6b8eb8;
  --b7: #5779a3;
  --b8: #48688f;
  --b9: #334c6b;
  --b10: #233750;
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

[hidden] { display: none !important; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
a:hover { text-decoration-color: currentColor; }

/* One visible focus ring for every interactive element. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}
/* Views and deep-link targets receive focus programmatically; they are not controls. */
[tabindex="-1"]:focus-visible, .view:focus-visible { outline: none; }

p, li { text-wrap: pretty; }
strong, b { font-weight: 600; }

code {
  font-family: var(--f-mono);
  font-size: 0.86em;
  padding: 0.05em 0.3em;
  border-radius: var(--radius);
  background: var(--paper-2);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1 {
  font-family: var(--f-display);
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  font-weight: 500;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.018em;
  line-height: 1.08;
  margin: 0 0 0.45em;
}
h2 {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 500;
  font-variation-settings: "opsz" 40;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 2em 0 0.6em;
}
h3 {
  font: 600 15px/1.4 var(--f-body);
  margin: 1.4em 0 0.5em;
}

/* Small letterspaced label, used sparingly: control labels only. */
.ctl .label {
  font: 600 12px/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- header and navigation ---------- */
header.site {
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}
header.site .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 28px;
  padding-top: 20px;
  padding-bottom: 16px;
}

.brand {
  font-family: var(--f-display);
  font-size: 21px;
  font-weight: 600;
  font-variation-settings: "opsz" 24;
  line-height: 1.15;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--signal);
}
.brand:hover { color: var(--accent); }

nav.main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 28px;
  font: 500 15px/1.3 var(--f-body);
}
nav.main a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
nav.main a:hover { color: var(--ink); border-bottom-color: var(--rule-2); }
nav.main a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 500 15px/1.2 var(--f-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn.ghost:hover { background: var(--paper-2); }
.btn:disabled, .btn:disabled:hover { opacity: 0.5; cursor: not-allowed; background: transparent; }
.btn.primary:disabled, .btn.primary:disabled:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* The citation's copy action has a long label, so it is set as an action link (like "Reproduce
   this figure"), not as a box that wraps. */
#team .copy {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font: 500 14.5px/1.45 var(--f-body);
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
#team .copy:hover { background: transparent; text-decoration-color: currentColor; }
/* Small outline buttons: chart-data tools, copy, CSV. */
.table-tools .btn, .copy, .copy-sql, .csv-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 500 14px/1.2 var(--f-body);
  text-decoration: none;
  white-space: normal;
  text-align: left;
  cursor: pointer;
}
.table-tools .btn:hover, .copy:hover, .copy-sql:hover, .csv-link:hover { background: var(--paper-2); border-color: var(--ink); }
.table-tools .btn:disabled:hover { border-color: var(--rule-2); }

/* ---------- segmented toggles ---------- */
.ctl {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 18px;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  padding: 0 1px 1px 0;
}
.seg button {
  min-height: 40px;
  margin: 0 -1px -1px 0;
  padding: 0 15px;
  border: 1px solid var(--rule-2);
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
  font: 500 14.5px/1.2 var(--f-body);
  cursor: pointer;
}
.seg button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.seg button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.seg button:hover { background: var(--paper-2); color: var(--ink); }
.seg button[aria-pressed=true], .seg button[aria-selected=true], .seg button.on {
  position: relative;
  z-index: 1;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.seg button:focus-visible { position: relative; z-index: 2; }

/* ---------- legends ---------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
.legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend > span > i { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: var(--radius); }
.legend button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: 400 13.5px/1.4 var(--f-body);
  text-decoration: none;
  text-underline-offset: 0.3em;
  cursor: pointer;
}
.legend button:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rule-2); }
.legend button[aria-pressed=true] { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: currentColor; }
.legend.dim button[aria-pressed=false] { color: var(--muted); }
.legend button i { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: var(--radius); }
.legend + .legend { margin-top: -4px; }

/* ---------- figures ---------- */
.viz, .chart[id] {
  position: relative;
  margin: 0 0 16px;
  padding: 14px 0 0;
  border-top: 1px solid var(--rule);
  background: transparent;
}
.chart[id] { padding-bottom: 4px; }
.viz svg, .chart[id] svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--f-body); font-variant-numeric: tabular-nums lining-nums; }
.viz canvas { display: block; width: 100%; touch-action: pan-y; }
.viz .grid line { stroke: var(--grid); }
.viz .axis path, .viz .axis line { stroke: var(--axis); }
.chart h3 { margin: 0 0 10px; font: 600 15px/1.4 var(--f-body); color: var(--ink); }
.chart:not([id]) { margin: 0; }
.chart:not([id]):has(> .legend[hidden]) { display: none; }
.chart:not([id]) > .legend { margin-bottom: 12px; }

/* Hover tips. */
.tip {
  position: absolute;
  z-index: 3;
  max-width: 280px;
  padding: 8px 11px;
  pointer-events: none;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.tip .t { font-weight: 600; }
.tip .s, .tip .yr { color: var(--muted); }
.tip .yr { font-family: var(--f-mono); font-size: 12px; }
.tip .row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tip .row i { width: 8px; height: 8px; border-radius: var(--radius); display: inline-block; }
.tip .row b { margin-left: auto; padding-left: 12px; font-weight: 600; }

/* ---------- notes and captions ---------- */
.source {
  margin: 0 0 0.9em;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.lede {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ---------- disclosures: one style everywhere ---------- */
details.chart-note, details.method-note, details.suggestions, details.disclosure, details.field-guide {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
details.chart-note > summary, details.method-note > summary, details.suggestions > summary, details.disclosure > summary, details.field-guide > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 0;
  list-style: none;
  cursor: pointer;
  font: 500 14.5px/1.35 var(--f-body);
  color: var(--ink);
}
details.chart-note > summary::-webkit-details-marker, details.method-note > summary::-webkit-details-marker,
details.suggestions > summary::-webkit-details-marker, details.disclosure > summary::-webkit-details-marker, details.field-guide > summary::-webkit-details-marker { display: none; }
details.chart-note > summary::before, details.method-note > summary::before, details.suggestions > summary::before, details.disclosure > summary::before, details.field-guide > summary::before {
  content: "+";
  flex: none;
  width: 0.8em;
  font: 500 15px/1 var(--f-mono);
  color: var(--accent);
}
details.chart-note[open] > summary::before, details.method-note[open] > summary::before,
details.suggestions[open] > summary::before, details.disclosure[open] > summary::before, details.field-guide[open] > summary::before { content: "\2212"; }
details.chart-note > summary:hover, details.method-note > summary:hover, details.suggestions > summary:hover, details.field-guide > summary:hover { color: var(--accent); }
details.chart-note[open] > summary { margin-bottom: 4px; }
details.chart-note > :last-child:not(summary) { margin-bottom: 14px; }
details.chart-note p { margin: 0 0 0.8em; }

/* Inside "View chart data": note, tools, status, table, pager share the main column edges. */
.chart-data { margin-bottom: 8px; }
.chart-data > p.source:first-of-type { font-size: 14.5px; color: var(--ink-2); }
.chart-data > p[role=status] { margin: 0 0 8px; font: 13.5px/1.5 var(--f-body); font-variant-numeric: tabular-nums lining-nums; color: var(--muted); }

.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 6px 0 12px; }
.table-tools label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
/* Toggle rows in a figure module fill the main column, so they end at the figure's edge. */
.module .ctl { align-items: stretch; }
.module .seg button { flex: 1 0 auto; }

/* ---------- form fields: one border colour for every input ---------- */
input[type=text], input[type=email], input[type=search], input:not([type]), select, textarea {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: 400 16px/1.3 var(--f-body);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
/* Selects share the inputs' box and padding; the chevron is drawn with two gradients. */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.table-tools input { min-height: 36px; width: 15em; max-width: 100%; padding: 6px 10px; font-size: 15px; }
input[type=checkbox] { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--ink); }

/* ---------- tables: one style everywhere ---------- */
.tablewrap {
  overflow-x: auto;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--rule);
  /* Scroll edges: a soft shade appears at whichever side has more columns to scroll to. */
  background:
    linear-gradient(to right, var(--paper) 40%, transparent) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--paper) 40%, transparent) right center / 32px 100% no-repeat local,
    linear-gradient(to right, color-mix(in srgb, var(--ink) 14%, transparent), transparent) left center / 12px 100% no-repeat scroll,
    linear-gradient(to left, color-mix(in srgb, var(--ink) 14%, transparent), transparent) right center / 12px 100% no-repeat scroll;
}
/* A long chart-data table scrolls inside its own frame, under a header that stays in view. */
.chart-data .tablewrap { max-height: min(72vh, 620px); overflow: auto; }
.chart-data .tablewrap thead th { position: sticky; top: 0; z-index: 1; background: var(--paper); }
/* The frame never slices a row: the rows that run on under its lower edge fade out, and at the
   end of the table the fade sits in the blank space below the last row. */
.chart-data .tablewrap::after {
  content: "";
  position: sticky;
  left: 0;
  bottom: 0;
  z-index: 1;
  display: block;
  height: 32px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--paper) 0%, transparent), var(--paper) 85%);
  pointer-events: none;
}
/* Short cells (tickers, bands, amounts) stay on one line; names wrap at a readable width. */
.chart-data table.tables td { white-space: nowrap; }
.chart-data table.tables tbody th { min-width: 10rem; }
#net-viz-data table.tables td:last-child { min-width: 18rem; white-space: normal; }
table.tables {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums lining-nums;
}
table.tables caption {
  caption-side: top;
  padding: 0 0 8px;
  text-align: left;
  font: 600 14px/1.4 var(--f-body);
  color: var(--ink);
}
table.tables th, table.tables td {
  padding: 7px 12px 7px 0;
  text-align: left;
  vertical-align: baseline;
  border-bottom: 1px solid var(--grid);
}
table.tables thead th {
  padding-top: 8px;
  /* The ink rule under the header is drawn inside the cell, so it stays with a sticky header. */
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--ink);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: bottom;
}
table.tables tbody th { font-weight: 400; color: var(--ink); }
table.tables tr:last-child > td, table.tables tr:last-child > th { border-bottom: 0; }
table.tables .num, table.tables td.num, table.tables th.num { text-align: right; }
table.tables td.num { font-family: var(--f-mono); font-size: 0.92em; white-space: nowrap; }
/* Text that follows a right-aligned number starts clear of it. */
table.tables .num + :not(.num) { padding-left: 32px; }
table.tables th:last-child, table.tables td:last-child { padding-right: 0; }
table.tables tbody tr:hover { background: var(--paper-2); }
th.sortable { cursor: pointer; }
th.sortable[aria-sort="ascending"]::after { content: " \2191"; }
th.sortable[aria-sort="descending"]::after { content: " \2193"; }

/* ---------- page grid ----------
   Twelve columns. Every section uses one main column (columns 1-7) and, only when it has
   notes, one side column (columns 8-12) that starts level with the first block after the
   heading (or after the lede in figure modules). The last explicit row is flexible, so
   notes longer than the figure add space below the figure, never between its parts. */
.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  padding-top: 84px;
}
/* The hero text takes eight columns, so the headline sets in two lines; the headline numbers
   take the other four. */
.hero > * { grid-column: 1 / span 8; min-width: 0; }
.hero h1 {
  grid-row: 1;
  margin: 0;
  font-size: clamp(38px, 4.1vw, 58px);
  line-height: 1.06;
}
.hero p { max-width: none; margin: 0; color: var(--ink-2); }
.hero p.sub { grid-row: 2; margin-top: 24px; font-size: 20px; line-height: 1.5; }
.hero .ctas { grid-row: 3; }

.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Headline numbers: a ruled 2 x 2 block of figures in the side column, beside the hero text,
   ending level with the buttons. Below 960px they follow the text. */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 28px;
  margin: 0;
}
.hero > .tiles { grid-column: 9 / span 4; grid-row: 1 / span 3; align-self: end; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0 0;
  border-top: 1px solid var(--ink);
  color: inherit;
  text-decoration: none;
}
a.tile:hover { background: var(--paper-2); }
.tile b {
  font-family: var(--f-display);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 400;
  font-variation-settings: "opsz" 48;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.012em;
  line-height: 1.05;
  color: var(--ink);
}
.tile span { max-width: 26ch; font-size: 14.5px; line-height: 1.45; color: var(--muted); }

.module, #how-made, .panel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(16, auto) 1fr;
  column-gap: var(--col-gap);
  align-content: start;
}
.module, #how-made { margin-top: var(--section); }
.module > *, #how-made > *, .panel > * { grid-column: var(--main-span); min-width: 0; }
.module > h2, #how-made > h2, .panel > h2 {
  grid-column: 1 / -1;
  margin: 0 0 24px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}
.module > .panel { grid-column: 1 / -1; grid-row: auto; }
.module:has(> .panel) { display: block; }
.module > .aside, .panel > .aside { grid-column: var(--side-span); grid-row: 2 / -1; align-self: start; }
/* "The Data": the intro across the whole grid, then the two versions side by side, each under a
   title underlined like the site name in the header. */
#how-made { grid-template-rows: none; }
#how-made > * { grid-column: 1 / -1; }
#how-made > p { margin: 0 0 1em; }
#how-made > .versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 8px;
  margin-top: 12px;
}
#how-made .versions p { margin: 0; font-size: 15.5px; line-height: 1.6; }
/* The two version titles, underlined like the site name in the header (.brand). */
.version-title {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 21px;
  font-weight: 600;
  font-variation-settings: "opsz" 24;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 14px;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--signal);
}
/* The heading over the example charts starts a new section, ruled like "The Data". */
#examples-title { grid-column: 1 / -1; margin: var(--section) 0 24px; padding-top: 16px; border-top: 1px solid var(--ink); }
/* Comparisons: a short status note, so it sits under the heading in the main column like any
   module's text, with no side column. */
#benchmarks > p { margin: 0; }
/* The notes stay beside a taller figure or the form while it scrolls, on any two-column window
   tall enough to hold them: the longest notes are about 380px tall at 1200px wide and about
   520px at 960px. */
@media (min-width: 1200px) and (min-height: 540px), (min-width: 960px) and (min-height: 640px) {
  .module > .aside, .panel > .aside { position: sticky; top: 24px; }
}
/* An open data table stays in the main column, under its figure; a wide table scrolls inside
   its own frame. Audit fees stacks both charts and both tables there, beside one note. */
.aside {
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
/* In a module the notes start level with the lede, under the heading's rule, so like the lede
   they carry no rule of their own. */
.module > .aside, .panel > .aside { padding-top: 3px; border-top: 0; }
.aside > :last-child { margin-bottom: 0; }
.aside h3 { margin: 18px 0 6px; font-size: 14.5px; }
.aside ul { margin: 0 0 0.9em; padding: 0; list-style: none; }
.aside li { margin: 0 0 0.55em; }
.aside p, .aside .source { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.aside details.chart-note { margin: 2px 0 14px; border-top: 1px solid var(--rule); }
.aside details.chart-note p { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.aside [data-colab] { margin: 14px 0 0; font-size: 14.5px; }
.aside details.chart-note + [data-colab] { margin-top: 0; }

/* The caption of the comparison chart opens its notes. */
#swarm-source { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); font-weight: 500; color: var(--ink); }

/* The network legend sits directly above its chart. */
#network > #net-viz, #network > #net-viz-data { order: 1; }
#network > .aside { order: 2; }
#net-legend { margin: 0 0 14px; }

/* Running prose in the main column. */
.prose { color: var(--ink-2); }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul { padding: 0; list-style: none; }
.prose li { position: relative; margin: 0 0 0.85em; padding-left: 1.15em; }
.prose li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 7px; height: 1px; background: var(--ink); }
.prose strong { color: var(--ink); }
.prose code { font-family: var(--f-mono); font-size: 0.86em; }
.module > p:not(.source):not(.lede) { color: var(--ink-2); }

/* A preface to the examples: one paragraph across the whole grid, at the size of the lede. */
#examples > .wrap:first-child { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
#examples-note {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ---------- download ---------- */
.panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.panel p.dl-intro { margin: 0 0 1em; font-size: 17px; color: var(--ink-2); }
.panel form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px var(--col-gap);
  margin-top: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.panel label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}
.panel label[for=dl-heard], .panel label.check, .panel .actions { grid-column: 1 / -1; }
.panel label .opt { color: var(--muted); font-weight: 400; }
.panel input, .panel select { display: block; width: 100%; margin-top: 6px; }
.panel .check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 400; line-height: 1.5; }
.panel .check input { width: 18px; margin: 2px 0 0; }
.panel .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 6px; }
.status { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.status .files { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-family: var(--f-mono); font-size: 13px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- team and citation ---------- */
.view { scroll-margin-top: 16px; }
.page-head { padding-top: 72px; }
.page-head h1 { margin: 0 0 0.4em; font-size: 44px; line-height: 1.1; letter-spacing: -0.015em; }
.page-head p, .beta-note { max-width: var(--measure); color: var(--ink-2); }
#team .page-head h1 { margin-bottom: 28px; }
.people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px var(--col-gap);
  margin: 0;
}
.person { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.person b { display: block; margin-bottom: 4px; font: 600 19px/1.3 var(--f-display); font-variation-settings: "opsz" 24; color: var(--ink); }
.person div + div { margin-top: 6px; }
/* Headshots: both cropped to 4:5 and shown at the same width. */
.headshot { display: block; width: 180px; max-width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; margin: 0 0 14px; border-radius: var(--radius); background: var(--paper-2); }
/* Team sections are short, so space alone separates them; no rules. */
#ack { margin-top: 48px; }
#ack > h2 { margin: 0 0 16px; }
#ack > p { color: var(--ink-2); margin: 0; }
#cite { margin-top: 48px; }
#cite > h2 { margin: 0 0 16px; }
#cite > p { color: var(--ink-2); }
p.cite-text {
  margin: 22px 0;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  font: 400 18px/1.55 var(--f-display);
  font-variation-settings: "opsz" 20;
  color: var(--ink);
}
pre.bib {
  margin: 0 0 14px;
  padding: 14px 0;
  overflow-x: auto;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 13.5px/1.6 var(--f-mono);
  white-space: pre;
}
/* Team fills the grid: the heading rule spans it, the people sit in the main column and the
   citation in the side column beside them, top-aligned. */
@media (min-width: 960px) {
  #team {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto 1fr;
    column-gap: var(--col-gap);
    align-content: start;
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
  }
  #team > .wrap { max-width: none; margin: 0; padding-left: 0; padding-right: 0; min-width: 0; }
  #team > .page-head { grid-column: 1 / -1; grid-row: 1; }
  #team > .page-head h1 { margin-bottom: 40px; }
  #team > section:not(#cite) { grid-column: 1 / -1; grid-row: 2; }
  #team .people { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  #team .person:first-child { grid-column: var(--main-span); }
  #team .person:last-child { grid-column: var(--side-span); }
  /* The citation: the heading rule spans the grid, the prose and the reference sit in the main
     column and the BibTeX record with its copy action in the side column, top-aligned. */
  #team { grid-template-rows: auto auto auto 1fr; }
  #team > section#ack { grid-column: 1 / -1; grid-row: 3; margin-top: 48px; }
  #team > #cite {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 48px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto auto 1fr;
    column-gap: var(--col-gap);
    align-content: start;
  }
  #cite > * { grid-column: var(--main-span); min-width: 0; }
  #cite > h2 { grid-column: 1 / -1; grid-row: 1; }
  #cite > p:not(.cite-text) { grid-row: 2; margin: 0; }
  #cite > p.cite-text { grid-row: 3 / -1; align-self: start; margin: 22px 0 0; }
  #cite > pre.bib { grid-column: var(--side-span); grid-row: 2 / span 2; align-self: start; margin: 0; padding-top: 4px; border-top: 0; font-size: 12.5px; }
  #cite > .copy { grid-column: var(--side-span); grid-row: 4; }
}
#team .copy { justify-self: start; }
/* On phones the BibTeX record wraps instead of running off the screen. */
@media (max-width: 1249px) { pre.bib { white-space: pre-wrap; overflow-wrap: anywhere; } }
/* The 404 page: the heading rule spans the grid, the line of text and the
   page's two links under it sit in the main column. */
@media (min-width: 960px) {
  main:not([class]) > .page-head {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
  }
  main:not([class]) > .page-head > * { grid-column: var(--main-span); min-width: 0; }
  main:not([class]) > .page-head > h1 { grid-column: 1 / -1; margin: 0 0 28px; }
  main:not([class]) > .page-head > p { grid-row: 2; margin: 0; font-size: 20px; line-height: 1.5; }
  main:not([class]) > .page-head > .ctas { grid-row: 3; }
}
main:not([class]) > .page-head > p { max-width: none; }

.beta {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 7px 2px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font: 600 11.5px/1.3 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---------- footer ---------- */
footer.site {
  display: block;
  margin-top: var(--section);
  border-top: 1px solid var(--ink);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding-top: 18px;
  padding-bottom: 32px;
}
footer.site .wrap > :first-child { font: 600 15px/1.4 var(--f-display); color: var(--ink); text-decoration: none; }
footer.site p { margin: 0; }
footer.site a { color: var(--ink-2); }

/* ---------- Ask: the chat panel, its messages and the answers (shared vocabulary) ----------
   The page lays the panel out in ask.html: messages in time order in a scrolling area, newest at
   the bottom, and the question box docked at the panel's foot. Each part of a turn is labelled
   with who wrote it: the visitor's question, right-aligned on the second paper tone; the AI
   assistant's prose, under a 2px navy rule and always in the body sans; the result of the
   database query, on the column with no rule. Nothing here is fixed to the window. */
.chart-note { margin: 8px 0 0; }
.jumps { margin: 0.4em 0 0; }
.jumps a { margin-right: 0.2em; }
body.ask-page header.site { position: static; }

/* The dock: the jump control and the opened suggestions above the question box; the box with the
   Ask button inside it; the hint line and the Suggestions toggle under it. */
.ask-dock { flex: none; padding: 10px 0 calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); background: var(--paper); }
.ask-form { display: flex; align-items: flex-end; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--field); }
.ask-form:has(#chat-ask:focus) { border-color: var(--accent); outline: 1px solid var(--accent); }
#chat-ask {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 54px;
  max-height: 200px;
  padding: 14px 16px 13px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 400 17px/1.5 var(--f-body);
  resize: none;
}
#chat-ask::placeholder { color: var(--muted); }
/* The form draws the focus ring; a browser without :has() keeps the field's own ring. */
@supports selector(:has(*)) { #chat-ask:focus, #chat-ask:focus-visible { outline: none; } }
#chat-ask:disabled { color: var(--muted); }
.ask-bar { flex: none; display: flex; align-items: center; padding: 5px; }
.ask-bar .btn { min-width: 84px; white-space: nowrap; }
.ask-hintrow { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 20px; margin-top: 8px; }
.composer .hint, .composer-wait { margin: 0; font: 400 13.5px/1.45 var(--f-body); color: var(--muted); }
.composer-wait { color: var(--ink-2); }
/* While a note on the box's state shows, it stands in the hint's place; the hidden hint keeps
   the row's height, so the box does not move. */
.ask-hintslot { display: grid; min-width: 0; }
.ask-hintslot > * { grid-area: 1 / 1; }
.ask-hintslot:has(.composer-wait) .hint { visibility: hidden; }
.sugg-toggle { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--accent); font: 500 13.5px/1.4 var(--f-body); cursor: pointer; }
.sugg-toggle::before { content: "+"; content: "+" / ""; font: 500 14px/1 var(--f-mono); }
.sugg-toggle[aria-expanded="true"]::before { content: "\2212"; content: "\2212" / ""; }
.sugg-toggle:hover { text-decoration: underline; text-underline-offset: 0.18em; }
/* Before the first question the toggle keeps its room, so the box does not move when it shows. */
.ask-panel:not(.has-turns) .sugg-toggle { visibility: hidden; }
/* The open list scrolls in its own frame, so the messages keep their room. */
.ask-tray { max-height: min(32vh, 300px); max-height: min(32dvh, 300px); overflow-y: auto; margin: -10px 0 12px; }
.ask-tray .examples { border-top: 0; }
.ask-notice:empty { display: none; }

/* Suggestions: a quiet ruled list in two columns; on phones the same buttons wrap as chips. */
.ask-sugg-label { margin: 0; padding: 10px 0 8px; border-top: 1px solid var(--rule-2); font: 600 14.5px/1.35 var(--f-body); color: var(--ink); }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); margin: 0; border-top: 1px solid var(--rule); }
.examples button {
  display: block;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 15px/1.4 var(--f-body);
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.examples button:hover { color: var(--accent); }
.examples button:disabled { color: var(--muted); cursor: not-allowed; }

/* Messages: in time order, newest last, directly above the question box. */
.chat-log:empty { display: none; }
.chat-turn { position: relative; }
.chat-turn + .chat-turn { margin-top: 48px; }
/* Part labels: who wrote each part of a turn. Small mono capitals, the same on every turn. */
.chat-tag { margin: 0 0 8px; font: 500 11.5px/1.4 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.chat-tag-gen { color: var(--accent); }
.chat-tag-res { margin-top: 28px; }

/* The visitor's question: a right-aligned block on the second paper tone, as quoted input. */
.chat-user { display: flex; flex-direction: column; align-items: flex-end; margin-bottom: 24px; }
.chat-user > .chat-tag { text-align: right; }
.chat-q { margin: 0; font: 400 16px/1.5 var(--f-body); color: var(--ink); }
.chat-user > .chat-q { max-width: 70%; padding: 10px 14px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--paper-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-q-toggle {
  display: block;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 500 14px/1.4 var(--f-body);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  cursor: pointer;
}

/* Generated prose: one block per reply, the full column wide, marked by a 2px navy rule that
   hangs just outside the column edge, so the prose keeps the column's left edge. The notes
   (filters) follow the prose in the same column. */
.chat-gen { position: relative; }
.chat-gen::before { content: ""; position: absolute; top: 2px; bottom: 2px; left: -18px; width: 2px; background: var(--accent); }
.chat-main, .chat-side { min-width: 0; }
.chat-side { margin-top: 14px; }
.chat-gen p, .chat-gen li { font: 400 15.5px/1.6 var(--f-body); }
.chat-gen > :last-child > :last-child { margin-bottom: 0; }
.chat-headline { margin: 0 0 10px; color: var(--ink); text-wrap: pretty; }
.chat-gen .chat-headline { font-weight: 600; }
.chat-headline:focus { outline: none; }
.chat-answer-line { margin: 0 0 12px; color: var(--ink); }
.chat-expl { margin: 0 0 10px; color: var(--ink-2); }
.chat-gen .hint { margin: 0 0 10px; color: var(--muted); }
.chat-gen .chat-filing { margin: 0 0 10px; font: 400 13px/1.5 var(--f-mono); color: var(--muted); }
.chat-side p.label, .chat-sql p.label { margin: 0 0 6px; color: var(--ink); }
.chat-side p.label { font: 500 11.5px/1.4 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.chat-sql p.label { font: 600 13px/1.4 var(--f-body); color: var(--muted); padding-top: 12px; }
.chat-filters { margin: 0 0 14px; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.chat-filters li { display: block; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
details.chat-sql .chat-filters li { font: 400 14px/1.45 var(--f-body); }
.chat-note { margin: 0; color: var(--muted); }
/* The site's own notes on the data close the turn, outside the navy rule. */
.chat-answer > .chat-note { max-width: 62em; margin-top: 12px; font-size: 14.5px; line-height: 1.55; }

/* Error, stop and rate limit: the site's own words, so no navy rule; the label says what happened. */
.chat-site { position: relative; }
.chat-error { margin: 0; padding: 0; border: 0; background: none; color: var(--ink); }
.chat-error:focus { outline: none; }
.chat-error p, .chat-error-text { margin: 0 0 6px; color: var(--ink); }
.chat-error > :last-child { margin-bottom: 0; }

/* Result from the database query: on the column, outside the navy rule. A table wider than the
   column may widen symmetrically to the full 1200px grid, and scrolls sideways in its own frame
   beyond that. */
.chat-table-bleed.is-wide,
.chat-answer:has(.chat-table-bleed.is-wide) > :is(.chat-tag-res, details.chat-sql),
.chat-result:has(> .chat-table-bleed.is-wide) > :is(.chat-result-bar, .chat-full-count) { width: calc(150% + var(--col-gap) / 2); margin-left: calc(-25% - var(--col-gap) / 4); }
.chat-result-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 10px; }
.chat-count { margin: 0; font: 400 13.5px/1.4 var(--f-mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.chat-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.chat-tools input[type=search] { height: 38px; min-height: 38px; width: 15em; max-width: 100%; padding: 6px 10px; font-size: 15px; background: var(--field); }
.chat-tools .csv-link, .chat-tools .show-all { height: 38px; min-height: 38px; background: var(--field); }
.chat-tools .show-all { padding: 0 14px; border-color: var(--rule-2); font-size: 14px; }
.chat-tools .show-all:hover { border-color: var(--ink); }
.chat-full-count { margin: 10px 0 0; font: 400 13.5px/1.5 var(--f-mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.chat-full-count:empty { display: none; }
.chat-result > .hint { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; }
.chat-result .tablewrap {
  margin: 0;
  border-bottom: 1px solid var(--ink);
  background:
    linear-gradient(to right, var(--paper) 40%, transparent) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--paper) 40%, transparent) right center / 32px 100% no-repeat local,
    linear-gradient(to right, color-mix(in srgb, var(--ink) 14%, transparent), transparent) left center / 12px 100% no-repeat scroll,
    linear-gradient(to left, color-mix(in srgb, var(--ink) 14%, transparent), transparent) right center / 12px 100% no-repeat scroll;
}
.chat-result table.tables { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums lining-nums; }
.chat-result table.tables th, .chat-result table.tables td { min-width: 3.5rem; padding: 9px 16px 9px 0; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: baseline; }
.chat-result table.tables th:last-child, .chat-result table.tables td:last-child { padding-right: 0; }
.chat-result table.tables td { white-space: normal; overflow-wrap: break-word; }
/* Dates, tickers and codes never break. Names and roles stay on one line too (is-oneline) when
   the table then fits its frame, or when it is too wide to fit even with them wrapped and so
   scrolls sideways; only long text keeps wrapping, in a column wide enough to read. */
.chat-result table.tables td.nowrap, .chat-result .tablewrap.is-oneline td.short-text { white-space: nowrap; }
.chat-result .tablewrap.is-oneline table.tables td:not(.num):not(.nowrap):not(.short-text) { min-width: 11rem; }
.chat-result table.tables thead th {
  padding-top: 4px;
  padding-bottom: 8px;
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--ink);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  vertical-align: bottom;
}
.chat-result table.tables thead th.sortable { padding-top: 0; padding-bottom: 0; }
/* Header labels wrap onto a second line rather than widen their column. */
.chat-result .table-sort { max-width: 9em; text-wrap: balance; }
/* After Show all, a long table scrolls inside its own frame under a header that stays in view. */
.chat-result .tablewrap.is-all { max-height: min(56vh, 56dvh, 640px); overflow: auto; }
.chat-result .tablewrap.is-all thead th { position: sticky; top: 0; z-index: 1; background: var(--paper); }
.chat-result .tablewrap.is-all::after {
  content: "";
  position: sticky;
  left: 0;
  bottom: 0;
  z-index: 1;
  display: block;
  height: 32px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--paper) 0%, transparent), var(--paper) 85%);
  pointer-events: none;
}
.chat-result .table-sort:hover { color: var(--ink); }
.chat-result table.tables .num { text-align: right; }
.chat-result table.tables .num + :not(.num) { padding-left: 24px; }
.chat-result table.tables td.num { font-family: var(--f-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chat-result table.tables tbody tr:hover { background: var(--paper-2); }
.company-cell, .chat-result td.company-cell { min-width: 9rem; white-space: normal; overflow-wrap: break-word; }
.share-chart-wrap { margin: 12px 0 14px; color: var(--s1); }
.share-chart { width: 100%; max-width: 560px; height: auto; }
.share-chart text { fill: var(--ink); font: 600 13px var(--f-body); font-variant-numeric: tabular-nums; }

/* Query and data version: a ruled row across the column; opened, the SQL first, then the
   version, Copy SQL and the assumptions. */
details.chat-sql { margin-top: 20px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.chat-result + details.chat-sql, .chat-tag-res + details.chat-sql { margin-top: 0; }
.chat-result:has(.tablewrap) + details.chat-sql { border-top: 0; }
details.chat-sql > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 0;
  list-style: none;
  cursor: pointer;
  font: 500 14.5px/1.35 var(--f-body);
  color: var(--ink);
}
details.chat-sql > summary::-webkit-details-marker { display: none; }
details.chat-sql > summary::before { content: "+"; flex: none; width: 0.8em; font: 500 15px/1 var(--f-mono); color: var(--accent); }
details.chat-sql[open] > summary::before { content: "\2212"; }
details.chat-sql > summary:hover { color: var(--accent); }
.chat-sql-body { display: block; padding: 4px 0 18px; }
.chat-sql-meta { margin-top: 14px; }
.chat-sql-code, .chat-sql-meta { min-width: 0; }
.chat-sql-code pre.bib { margin: 0; padding: 12px 0 0; border-bottom: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.chat-sql-code .hint { margin: 12px 0 0; color: var(--muted); font-size: 14.5px; }
.chat-version { margin: 0 0 10px; padding-top: 12px; border-top: 1px solid var(--rule); font: 400 13.5px/1.45 var(--f-mono); color: var(--ink-2); }
details.chat-sql .copy-sql { margin: 0 0 14px; background: var(--field); }

/* Waiting: the pending reply sits where the reply will appear, under the reply's own label; the
   status line counts the seconds. */
.chat-pending { position: relative; }
.chat-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0; }
.chat-status-text { font: 400 15.5px/1.5 var(--f-body); color: var(--muted); }
.btn.chat-stop { min-height: 36px; padding: 0 14px; border-color: var(--rule-2); font-size: 14px; }
.btn.chat-stop:hover { border-color: var(--ink); }

/* When a reply arrives while the reader has scrolled up the conversation, a button above the
   question box offers the way down to it. It takes its own row, so nothing is covered. */
.chat-new-reply { display: flex; justify-content: center; padding: 0 0 10px; }
.chat-new-reply .btn { min-height: 36px; padding: 0 16px; border-color: var(--ink); background: var(--paper); font-size: 14px; }
.chat-new-reply .btn:hover { background: var(--paper-2); }

/* Below 960px the column is the page's own column: tables keep its width and the navy rule
   moves inside it. */
@media (max-width: 959px) {
  .chat-table-bleed.is-wide,
  .chat-answer:has(.chat-table-bleed.is-wide) > :is(.chat-tag-res, details.chat-sql),
  .chat-result:has(> .chat-table-bleed.is-wide) > :is(.chat-result-bar, .chat-full-count) { width: auto; margin-left: 0; }
  .chat-gen { padding-left: 14px; }
  .chat-gen::before { left: 0; }
}
@media (max-width: 640px) {
  .examples { grid-template-columns: minmax(0, 1fr); }
  .examples button { min-height: 44px; padding: 10px 0; font-size: 15px; }
  .ask-tray { margin-top: -6px; }
  .chat-user > .chat-q { max-width: 88%; }
  #chat-ask { min-height: 52px; padding: 13px 4px 12px 12px; font-size: 16px; }
  .ask-bar { padding: 4px; }
  .ask-bar .btn { min-width: 60px; padding: 0 14px; }
  .ask-dock { padding-top: 8px; }
  .composer .hint, .composer-wait { font-size: 13px; }
  .ask-hintrow { align-items: flex-start; margin-top: 2px; }
  .ask-hintslot { padding-top: 6px; }
  .sugg-toggle { min-height: 44px; }
  .chat-tools { width: 100%; flex-wrap: nowrap; }
  .chat-tools input[type=search] { flex: 1 1 auto; width: auto; min-width: 0; }
  /* Touch targets on phones are at least 44px tall. */
  .examples button, .chat-tools input[type=search], .chat-tools .csv-link, .chat-tools .show-all,
  .btn.chat-stop, details.chat-sql .copy-sql, .chat-new-reply .btn, .ask-bar .btn { height: auto; min-height: 44px; }
  details.chat-sql > summary { min-height: 44px; align-items: center; }
}

/* ---------- medium screens: the side column follows the main column ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 28px; --section: 84px; }
}
@media (max-width: 959px) {
  :root { --gutter: 24px; --section: 76px; }
  /* One column of one width for every block in a view. */
  .view .wrap { max-width: calc(720px + 2 * var(--gutter)); margin-left: 0; }
  .hero > *, .hero > .tiles { grid-column: 1 / -1; grid-row: auto; }
  .hero > .tiles { margin-top: 56px; }
  .tile b { font-size: 36px; }
  .module, #how-made, .panel { display: flex; flex-direction: column; }
  .module:has(> .panel) { display: block; }
  .module > .aside, #how-made > .aside, .panel > .aside { margin-top: 8px; }
  .panel > .aside { margin: 4px 0 12px; }
  #examples > .wrap:first-child { display: block; }
  #examples-note { font-size: 15.5px; }
  .module > .aside { border-top: 0; padding-top: 4px; }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  :root { --gutter: 16px; --section: 64px; }
  body { font-size: 16px; }
  header.site .wrap { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 16px; padding-bottom: 0; }
  nav.main { gap: 0 22px; }
  nav.main a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
  .brand { font-size: 19px; }
  .hero { padding-top: 44px; }
  .hero p.sub { margin-top: 18px; font-size: 17.5px; }
  .ctas { margin-top: 24px; }
  .hero > .tiles { margin-top: 44px; }
  .tile b { font-size: 30px; }
  .tile span { font-size: 13.5px; }
  h2, .module > h2, #how-made > h2, .panel > h2, #cite > h2 { font-size: 26px; }
  .lede { font-size: 16.5px; margin-bottom: 22px; }
  .ctl { width: 100%; }
  .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .seg button { min-height: 44px; padding: 6px 10px; border-radius: 0 !important; }
  .seg button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Five options: three on the first row, two halves on the second. */
  .seg:has(> button:nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .seg:has(> button:nth-child(5):last-child) > button { grid-column: span 2; }
  .seg:has(> button:nth-child(5):last-child) > button:nth-child(n+4) { grid-column: span 3; }
  .btn, .seg button { min-height: 44px; }
  .legend button { min-height: 36px; }
  .table-tools label { width: 100%; }
  .table-tools input { width: 100%; }
  .panel form { grid-template-columns: 1fr; }
  .people { grid-template-columns: 1fr; }
  #how-made > .versions { grid-template-columns: 1fr; row-gap: 28px; }
  .page-head { padding-top: 44px; }
  .page-head h1 { font-size: 34px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  pre.bib { font-size: 12px; }
  .chart-data table.tables tbody th { min-width: 8rem; }
}
@media (max-width: 420px) {
  .page-head h1 { font-size: 30px; }
}

/* Scroll reveal on the home figures (the script follows the charts in index.html).
   A figure is armed only for a moment, while the reader's scrolling brings it toward the screen:
   its marks are hidden here and the script then draws them in. Print and reduced motion always
   show them, whatever the script did. */
.rv-armed svg polyline,
.rv-armed svg line[stroke-dasharray="2 3"],
.rv-armed svg circle:not([visibility]),
.rv-armed svg text[font-weight="500"],
#dumb-viz.rv-armed svg g > :is(line, text:not(.skill-row-label)),
.rv-armed > canvas { opacity: 0; }
@media print, (prefers-reduced-motion: reduce) {
  .rv-armed svg polyline,
  .rv-armed svg line[stroke-dasharray="2 3"],
  .rv-armed svg circle:not([visibility]),
  .rv-armed svg text[font-weight="500"],
  #dumb-viz.rv-armed svg g > :is(line, text:not(.skill-row-label)),
  .rv-armed > canvas { opacity: 1 !important; }
}

@media print {
  .ask-panel { height: auto !important; border-bottom: 0; }
  .ask-scroll { overflow: visible; }
  .ask-dock, .composer, .ask-sugg, .chat-tools, .chat-new-reply, nav.main, .ctas, .panel form, .table-tools, .chart-data { display: none !important; }
  body { background: #fff; }
  .module, #how-made { break-inside: avoid-page; }
  h1, h2, h3 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  .tablewrap, .fields-scroll { overflow: visible; }
  thead { display: table-header-group; }
  footer.site { margin-top: 32px; }
  .legend i, .seg button[aria-pressed=true], .seg button[aria-selected=true], .seg button.on { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .prow, .stage, .pout { break-inside: avoid; }
}
