/* Brand: brick orange. --brand is a fill (white text on top, same in both schemes);
   --brand-text is the accent for text. */
:root {
  --brand: #c2410c;
  --brand-hover: #a8380a;
  --brand-text: #b03a0a;
  --brand-wash: #fff1ea;
  --on-brand: #ffffff;
  --paper: #ffffff;
  --ink: #14171a;
  --muted: #5b6470;
  --rule: #e2e5e9;
  --rule-strong: #b9c0c8;
  --tint: #f5f6f8;
  --bar: #cfd5db;
  --radius: 12px;
  --radius-s: 8px;
  color-scheme: light dark;
}
/* Dark tokens twice: by system preference unless the toggle chose light, and when it chose dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-hover: #d9531c;
    --brand-text: #ff8a5c;
    --brand-wash: #2a160e;
    --paper: #111417;
    --ink: #e6e9ec;
    --muted: #9aa4af;
    --rule: #262c33;
    --rule-strong: #47505a;
    --tint: #191d22;
    --bar: #3a424b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-hover: #d9531c;
  --brand-text: #ff8a5c;
  --brand-wash: #2a160e;
  --paper: #111417;
  --ink: #e6e9ec;
  --muted: #9aa4af;
  --rule: #262c33;
  --rule-strong: #47505a;
  --tint: #191d22;
  --bar: #3a424b;
}
:root[data-theme="light"] { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 70rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }
a { color: inherit; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--brand-text); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 0.5rem; z-index: 2000; background: var(--paper); padding: 0.25rem 0.5rem; }

header.site {
  position: sticky; top: 0; z-index: 1100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
header.site .wrap { display: flex; gap: 0.75rem; align-items: center; min-height: 3.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 750; font-size: 1.05rem; letter-spacing: -0.01em; text-decoration: none; line-height: 1.2; }
.brand .mark { background: var(--brand); color: var(--on-brand); padding: 0.1rem 0.45rem; border-radius: 6px; }
.brand:hover { color: inherit; }
.asof { margin-left: auto; color: var(--muted); font-size: 0.8125rem; text-align: right; line-height: 1.25; }
header.site .cta { flex: none; padding: 0.4rem 0.85rem; min-height: 2.25rem; font-size: 0.9rem; }
@media (max-width: 34rem) { header.site .cta + .asof, .asof:has(+ .cta) { display: none; } header.site .cta { margin-left: auto; } }
/* Theme toggle: hidden until its script runs; the choice lives in localStorage. */
header.site .theme {
  flex: none; width: 2.25rem; min-height: 2.25rem; padding: 0; background: transparent; color: var(--muted);
  border: 1px solid var(--rule-strong);
}
header.site .theme:hover { background: var(--tint); color: var(--ink); }

main { padding-block: 1rem 4rem; }
h1 { font-size: clamp(1.75rem, 1.25rem + 2.4vw, 2.75rem); line-height: 1.1; margin: 0.5rem 0 0.75rem; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem); line-height: 1.2; margin: 3.5rem 0 0.75rem; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: 1rem; margin: 1rem 0 0.5rem; }
p { max-width: 70ch; }
.lede { font-size: 1.075rem; color: var(--muted); margin: 0; text-wrap: pretty; }

.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; font-size: 0.875rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; padding: 0 0.4rem; color: var(--rule-strong); }
.crumbs a { text-decoration-color: transparent; }
.crumbs a:hover { text-decoration-color: var(--brand); }

/* Top of an area page: heading, figures and sign-up. The sign-up card sits beside the
   figures on wide screens and directly under them on narrow ones. */
.top { display: grid; gap: 1.25rem; margin-top: 0.75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) {
  .top {
    grid-template-columns: minmax(0, 1fr) 23rem; column-gap: 2.5rem;
    grid-template-areas: "head signup" "figures signup"; grid-template-rows: auto 1fr;
  }
  .top > .head { grid-area: head; }
  .top > .figures { grid-area: figures; }
  .top > .signup { grid-area: signup; align-self: start; position: sticky; top: 4.5rem; }
}

.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0; }
.fig { background: var(--tint); border-radius: var(--radius); padding: 0.85rem 1rem; }
.fig dt { font-size: 0.8125rem; color: var(--muted); line-height: 1.3; }
.fig dd { margin: 0.25rem 0 0; font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.15; }
.fig dd.note { font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.fig.main { grid-column: 1 / -1; background: var(--brand-wash); }
.fig.main dd { font-size: clamp(3rem, 2rem + 5vw, 4.75rem); letter-spacing: -0.03em; line-height: 1; }
.fig.main dd.note { font-size: 0.8125rem; letter-spacing: 0; line-height: 1.3; margin-top: 0.4rem; }
.figures > .fig:last-child:nth-child(even) { grid-column: 1 / -1; }
@media (min-width: 40rem) {
  .figures { grid-template-columns: repeat(3, 1fr); }
  .figures > .fig:last-child:nth-child(even) { grid-column: auto; }
}

.status-note { background: var(--tint); border-radius: var(--radius); padding: 0.85rem 1rem; margin: 1.5rem 0 0; max-width: none; font-size: 0.95rem; }

.split { display: grid; gap: 0 2.5rem; }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1fr; } }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.bars .n { font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.code { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }
.empty { color: var(--muted); }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); }
thead th { background: var(--tint); font-size: 0.8125rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.rank td:first-child, .rank th:first-child { width: 3rem; color: var(--muted); }
.latest .parcel { font-variant-numeric: tabular-nums; font-size: 0.8125rem; word-break: break-word; }
tr.current td { background: var(--brand-wash); font-weight: 600; }
tr.current td:first-child { box-shadow: inset 3px 0 0 var(--brand); color: inherit; }
@media (min-width: 52rem) { .latest { min-width: 60rem; } .latest .parcel { min-width: 11rem; } }
/* Narrow screens: each decision becomes a labelled card instead of a wide scrolling table. */
@media (max-width: 51.99rem) {
  .scroll.cards { border: 0; border-radius: 0; overflow: visible; }
  .latest, .latest tbody, .latest tr, .latest td { display: block; }
  .latest thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .latest tr { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.6rem 0.9rem; margin-bottom: 0.6rem; }
  .latest td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.2rem 0; border: 0; }
  .latest td::before { content: attr(data-label); color: var(--muted); font-size: 0.8125rem; padding-top: 0.1rem; }
  .latest td:empty { display: none; }
  .latest td:first-child { font-weight: 650; }
  .latest td.num { text-align: left; white-space: normal; }
}


/* Sign-up card */
.signup {
  background: var(--brand-wash); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: calc(var(--radius) + 4px); padding: 1.25rem; max-width: 34rem;
}
.top > .signup { max-width: none; }
.signup h2 { margin: 0 0 0.35rem; font-size: 1.25rem; }
.signup > p { margin: 0 0 1rem; font-size: 0.9rem; color: var(--muted); }
form { display: grid; gap: 0.9rem; }
.field label, .chips legend { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; padding: 0; }
.opt { font-weight: 400; color: var(--muted); }
input[type="email"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-height: 2.875rem; font: inherit; font-size: 1rem; padding: 0.6rem 0.8rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--radius-s);
}
input[type="email"]:focus-visible { outline-offset: 0; border-color: var(--brand); }
.chips { border: 0; margin: 0; padding: 0; min-width: 0; }
.chips .set { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0.3rem 0.8rem; font-size: 0.9rem;
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 999px;
}
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.check input { width: 1.25rem; height: 1.25rem; margin: 0.1rem 0 0; accent-color: var(--brand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button, .button {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.875rem;
  font: inherit; font-weight: 650; cursor: pointer; padding: 0.6rem 1.25rem; border: 0; border-radius: var(--radius-s);
  background: var(--brand); color: var(--on-brand); text-decoration: none;
}
button:hover, .button:hover { background: var(--brand-hover); color: var(--on-brand); }
button:active, .button:active { transform: translateY(1px); }
.signup button { width: 100%; }

footer.site { border-top: 1px solid var(--rule); background: var(--tint); color: var(--muted); font-size: 0.875rem; padding-block: 1.5rem 2.5rem; }
footer.site p { margin-top: 0; }
footer.site ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

.prose h2 { font-size: 1.2rem; margin-top: 2.25rem; }
.prose li { max-width: 70ch; }
