/* Experiment Router — design system
   Dense data, one accent, monospace for anything machine-readable.
   Structure follows openrouter.ai: tight tables, 1px rules, quiet chrome,
   and generous whitespace around dense numbers rather than inside them. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f5f5f3;
  --surface-3: #efefec;
  --ink: #14161a;
  --ink-2: #4a4f57;
  --ink-3: #676d75;
  --line: #e6e6e1;
  --line-strong: #d3d3cc;
  --accent: #14664b;
  --accent-ink: #ffffff;
  --accent-soft: #e7f2ec;
  --warn: #7d5300;
  --warn-soft: #fdf4e3;
  --danger: #9c2828;
  --danger-soft: #fbecea;
  --radius: 8px;
  --radius-sm: 5px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --max: 1180px;
  /* Vertical rhythm. One number drives table density so a change here moves
     every list on the site together instead of one page at a time. */
  --row: 6px;
  --rail: 184px;
  --header: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d0f;
    --surface: #12151a;
    --surface-2: #171b21;
    --surface-3: #1d222a;
    --ink: #eff1f3;
    --ink-2: #a6adb6;
    --ink-3: #838b95;
    --line: #23282f;
    --line-strong: #333a43;
    --accent: #58d3a2;
    --accent-ink: #04160f;
    --accent-soft: #10241c;
    --warn: #dfae62;
    --warn-soft: #241c0f;
    --danger: #e88d88;
    --danger-soft: #281515;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

code, pre, .mono, .num { font-family: var(--mono); }
code { font-size: 0.86em; background: var(--surface-2); border-radius: 4px; padding: 0.1em 0.35em; }

pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.5;
  margin: 0 0 1rem;
  max-width: 100%;
  font-size: 12.5px;
}
pre code { background: none; padding: 0; white-space: pre; font-size: 1em; }
/* An inline code token has no spaces to break at, so a long identifier or a
   dotted URN pushes the page sideways on a phone. Breaking inside the token is
   the only option that keeps the page width, and it stays readable because the
   background marks where the token starts and ends. */
code { overflow-wrap: anywhere; }

/* --- Layout ------------------------------------------------------------ */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

header.site {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  z-index: 30;
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--header);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 14.5px;
  white-space: nowrap;
  padding: 6px 0;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand .mark { width: 22px; height: 22px; display: block; flex: none; }

nav.main { display: flex; gap: 2px; font-size: 13.5px; color: var(--ink-2); }
nav.main a { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 9px; border-radius: var(--radius-sm); }
nav.main a:hover { color: var(--ink); background: var(--surface-2); }
nav.main a.active { color: var(--ink); font-weight: 500; background: var(--surface-2); }

.spacer { flex: 1; }

nav.actions { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

main { padding: 30px 0 80px; min-height: 62vh; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 36px 0 48px;
  font-size: 12.5px;
  color: var(--ink-3);
}
footer.site .cols { display: flex; flex-wrap: wrap; gap: 48px; }
footer.site .foot-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 0 0 8px;
  font-weight: 500;
  font-family: var(--mono);
}
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
footer.site li a { display: inline-flex; align-items: center; min-height: 28px; padding: 0; }

/* Standalone links need a real hit area: 28px is the smallest reliable touch
   target. Inline padding buys the height without changing the line box, so a
   link inside a dense table row gets 28px and the row keeps its 37px. */
.section-head > a { display: inline-flex; align-items: center; min-height: 28px; }
.data td > a,
.compare-row .unit-name > a,
.row > a.small {
  padding: 7px 0;
}
footer.site a:hover { color: var(--ink); }

/* Wide tables scroll inside their own box instead of pushing the page. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* A table that compresses its first column is worse than a table that scrolls.
   The vendor name is the row's identity; it never shrinks to a ribbon. */
.data td.name, .data th:first-child { min-width: 132px; }

/* When a wide table does scroll, the right edge fades so it is visible that
   there is more, instead of the last column ending flush and looking cut. */
.table-scroll { position: relative; }
.table-scroll.more::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--bg));
}

/* The operation-by-vendor matrix. One column per thing a buyer compares, so
   its width follows how many of those there are, not how many steps. It hugs
   its content rather than stretching to the panel: six columns of content do
   not become more readable by spreading them across 1,100px. */
.data.matrix { width: auto; min-width: 0; }
/* A price that wraps is not a price. These cells never break a number across
   two lines; the table scrolls instead. */
.data.matrix th, .data.matrix td { white-space: nowrap; }
/* A header word that breaks between letters is not a header. The floor is on
   the price columns, so a service column is wide enough to name itself once. */
.data.matrix th.num { min-width: 84px; }
.data.matrix th.keep { min-width: 0; }
/* This table's headers are names of things (a service, a step, a column of
   money), not field labels, so the matrix drops the site-wide uppercase. Four
   shouted step names over four narrow columns was the loudest thing on the
   page; one quiet name per column is what a buyer reads. */
.data.matrix th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11.5px;
  color: var(--ink-2);
}
.data.matrix th.service-col { border-bottom-color: var(--line-strong); color: var(--ink); }
.data.matrix th.service-col .sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
  white-space: nowrap;
}
/* A cell holding more than one purchase names each one. Without the label,
   two amounts in one cell read as one confused price. */
.data.matrix td .cell-label { font-size: 10px; color: var(--ink-3); font-family: var(--mono); line-height: 1.2; }
/* Each step name in the matrix header is a link to that step's page. Padding
   grows the hit area to 28px while the negative margin keeps the header row the
   same height; an inline-flex box would push the whole header down. */
.data.matrix th a {
  display: inline-block;
  padding: 7px 0;
  margin: -7px 0;
}

/* The matrix scrolls at any width it does not fit, and a Mac scrollbar is
   invisible until you already know to scroll. The inset shadow marks the cut
   edge so the missing columns read as off to the right rather than truncated. */
.table-scroll:has(.data.matrix) {
  box-shadow: inset -16px 0 16px -16px var(--ink-2);
}

/* --- Fact strip --------------------------------------------------------- */

/* Four numbers above a table, in the shape a reader already knows from a model
   page: a quiet key, a large value, and one line saying what the value means.
   The third line is what stops a bare number from being read as a promise. */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 30px;
  overflow: hidden;
}
.facts > div { padding: 12px 16px; }
.facts > div + div { border-left: 1px solid var(--line); }
.facts .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.facts .v {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.facts .n { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

@media (max-width: 760px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts > div + div { border-left: none; }
  .facts > div:nth-child(even) { border-left: 1px solid var(--line); }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* --- Type helpers ------------------------------------------------------ */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}

/* A link inside the eyebrow is a filter shortcut, not body copy. It keeps the
   eyebrow's type but carries a full-height hit area, because a 13px tall link
   fails the target size rule and is awkward to hit on a phone. */
.eyebrow a.eyebrow-link {
  display: inline-block;
  padding: 7px 0;
  margin: -7px 0;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.eyebrow a.eyebrow-link:hover { color: var(--accent); }

.lede { font-size: 1.02rem; color: var(--ink-2); max-width: 68ch; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono-label { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* --- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--bg); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { filter: brightness(1.07); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 40px; padding: 0 20px; font-size: 14.5px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* --- Surfaces ---------------------------------------------------------- */

/* Cards are for genuinely separate objects (a form, a quote panel). A table
   inside a card is a card in a card; `.card.flush` exists for the one case
   where a rule-separated block really does live inside a bordered box. */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card.pad-lg { padding: 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card.quiet { background: transparent; border-color: var(--line); }

/* A collapsed-per-route arithmetic block: the header is the open target, and
   the work folds under it instead of stacking N full math tables on one page. */
details.card.flush > summary.route-math-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  font-weight: 500;
}
details.card.flush > summary.route-math-head::-webkit-details-marker { display: none; }
details.card.flush > summary.route-math-head:hover { background: var(--surface-2); }

/* A table sitting inside a bordered panel. The table supplies its own rules,
   so the inset only keeps the outer edge from touching the border. */
.table-inset { padding: 0 16px; }
.card.flush .table-inset { padding: 0 16px; }

.grid { display: grid; gap: 12px; }
/* A grid item's default minimum is its content, so one wide table in one
   column widens the whole page. Let the column shrink and the table scroll. */
.grid > *, .stack > * { min-width: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* --- Data tables (the core of the product) ----------------------------- */

.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.32;
  font-variant-numeric: tabular-nums;
}
.data th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  font-family: var(--mono);
  padding: 0 14px 7px 0;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  vertical-align: bottom;
}
.data td {
  padding: var(--row) 14px var(--row) 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.data tbody tr:last-child td { border-bottom: none; }
.data th:last-child, .data td:last-child { padding-right: 0; }

/* A row with a sub-line needs less pad, not more: the sub-line already adds
   14px. The link carries the 28px hit area, the cell carries 2px, so a
   single-line row lands at 32px and a two-line row at 45px. */
.data td.name {
  padding-top: 2px;
  padding-bottom: 2px;
  font-weight: 500;
  color: var(--ink);
}
.data td.name > a { min-height: 0; margin: 0; line-height: 1.28; }

/* Numbers: right aligned, mono, tabular. Nothing else sets column width, so
   the digits line up down the page without a table-layout hack. */
.data .num,
.data th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data .num {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
}
.data .num .dim, .data .num .muted { color: var(--ink-3); }
.data .sub {
  font-size: 11px;
  line-height: 1.25;
  color: var(--ink-3);
  font-family: var(--mono);
  font-weight: 400;
  margin-top: 1px;
}
/* A sub-line that runs long is truncated rather than allowed to wrap: a
   wrapped sub-line is what turns a 38px row into a 52px one. */
.data .sub.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }

/* A provenance label inside a sub-line is metadata, so it shrinks to the
   sub-line's own size instead of adding 4px of row height. */
.data .sub .label { height: 14px; padding: 0 4px; font-size: 9px; border-radius: 2px; vertical-align: 1px; }

table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain td { padding: 7px 14px 7px 0; border-bottom: 1px solid var(--line); }
table.plain tr:last-child td { border-bottom: none; }

/* --- Badges ------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--mono);
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.live { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Price provenance. Three labels, three weights, no ambiguity. */
.label {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
  background: transparent;
  white-space: nowrap;
}
.label.published { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.label.estimate { color: var(--ink-2); border-color: var(--line-strong); background: var(--surface-2); }
.label.demo { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

/* --- Forms ------------------------------------------------------------- */

label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
select, textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
}
textarea { height: auto; min-height: 88px; padding: 8px 10px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field-row .field { margin-bottom: 0; }
.help { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.errorlist { list-style: none; padding: 0; margin: 5px 0 0; color: var(--danger); font-size: 12.5px; }

/* --- Messages ---------------------------------------------------------- */

.messages { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 7px; }
.messages li {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.messages li.success { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.messages li.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.messages li.info { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* --- Hero -------------------------------------------------------------- */

.hero { padding: 4px 0 26px; }
.hero h1 { max-width: 25ch; margin-bottom: 12px; font-size: 2.25rem; letter-spacing: -0.032em; }
.hero .lede { margin-bottom: 18px; font-size: 14.5px; line-height: 1.55; max-width: 74ch; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* The one action on the front page: type a brief, get a proposed sequence.
   The input is a text field, not a textarea, because the ask is one sentence. */
.hero-plan { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; max-width: 760px; }
.hero-plan input[type="text"] { flex: 1; min-width: 220px; height: 40px; font-size: 13.5px; }
.hero-limit { margin: 10px 0 0; max-width: 62ch; }
.hero-limit .label { vertical-align: baseline; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* One search box above the catalog. It sits outside the filter rail so it
   stays put when the rail scrolls. */
.catalog-search { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.catalog-search input[type="text"] { flex: 1; min-width: 200px; max-width: 420px; height: 34px; }

/* A step's quotes as a comparison, one row per step, one `<details>` per row.

   Four columns, and the column heads are the same grid as the rows, so an
   amount sits under the word "Amount" at every width above mobile. That was
   the original bug on this page: the header and the values were two different
   layouts, so the price group did not line up with the word above it.

   No JavaScript: the disclosure is `<details>`, and the alternatives are in
   the markup whether it is open or shut. */
.cmp { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cmp-head,
.cmp-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.6fr) minmax(150px, 1.4fr) minmax(84px, auto) minmax(96px, auto);
  gap: 12px;
  align-items: baseline;
}
.cmp-head {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}
.cmp-head .num { text-align: right; }
/* The row's own column headings are the visible ones. The head repeats them
   for sighted readers; screen readers get the real cells below. */
.cmp-head-alt { text-align: right; }

.pick { border-bottom: 1px solid var(--line); }
.pick:last-child { border-bottom: none; }
details.pick > summary.cmp-row {
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}
details.pick > summary.cmp-row::-webkit-details-marker { display: none; }
details.pick > summary.cmp-row:hover { background: var(--surface-2); }
details.pick[open] > summary.cmp-row { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.pick-name { font-size: 13px; font-weight: 500; min-width: 0; }
.cmp-supplier { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pick-vendor { font-size: 12px; color: var(--ink-2); }
.pick-amount { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; text-align: right; }
/* The disclosure cue is a word, not a glyph alone, so it is readable when the
   browser strips generated content. */
.cmp-disclosure {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
}
.cmp-cue::after { content: " ▸"; }
details.pick[open] .cmp-cue::after { content: " ▾"; }
.pick-none { font-size: 12px; color: var(--ink-3); }
.cmp-empty { padding: 10px 14px; }
.cmp-empty .pick-name { grid-column: 1; }
.cmp-empty .pick-none { grid-column: 2 / -1; }

.cmp-body { padding: 4px 14px 12px; background: var(--surface); }
.cmp-alts { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp-alts th {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  font-weight: 600;
  text-align: left;
  padding: 6px 8px 4px 0;
  border-bottom: 1px solid var(--line);
}
.cmp-alts th.num { text-align: right; }
.cmp-alts td { padding: 6px 8px 6px 0; border-bottom: 1px dotted var(--line); vertical-align: baseline; }
.cmp-alts td.num { text-align: right; }
.cmp-alts tr:last-child td { border-bottom: none; }
.cmp-alts .cmp-lowest td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.cmp-lowest td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.cmp-mark {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-left: 4px;
}
.cmp-vs { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cmp-days { font-size: 11.5px; color: var(--ink-2); }
.cmp-note { font-size: 12px; color: var(--ink-2); line-height: 1.55; margin: 8px 0 0; max-width: 66ch; }
.cmp-lede { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin: 0 0 12px; max-width: 70ch; }

@media (max-width: 760px) {
  /* A 390px row cannot hold a step name, a supplier, an amount, and a count on
     one line. The name takes the first line, the amount and supplier the
     second, and the cue last, so the row never overflows. */
  .cmp-head { display: none; }
  .cmp-head,
  .cmp-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  details.pick > summary.cmp-row { padding: 10px 14px; }
  .pick-name { grid-column: 1 / -1; }
  .cmp-supplier { grid-column: 1; }
  .pick-amount { grid-column: 2; }
  .cmp-disclosure { grid-column: 1 / -1; text-align: left; }
  .cmp-empty .pick-name, .cmp-empty .pick-none { grid-column: 1 / -1; }
  .cmp-body { padding: 4px 14px 12px; }
  /* The clickable summary wraps these cells; the table inside does not, so
     the cheap fix is to let it scroll rather than widen the page. */
  .cmp-alts { display: block; overflow-x: auto; }
}

/* Three lines, numbered, because the order is the arithmetic's order. */
.ledger { list-style: decimal; margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.ledger li { line-height: 1.55; }
.ledger strong { color: var(--ink); font-weight: 500; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 30px 0;
}
/* A stat strip sized to its contents. Three figures should not leave a quarter
   of the rule empty, and a fifth should widen rather than wrap onto a second
   row where it would lose its column rules. `:has` costs nothing here. */
.stats:has(> div:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.stats:has(> div:nth-child(5)) { grid-template-columns: repeat(5, 1fr); }
.stats > div { padding: 13px 0; }
.stats > div + div { border-left: 1px solid var(--line); padding-left: 22px; }
.stats .n { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.03em; font-family: var(--mono); font-variant-numeric: tabular-nums; line-height: 1.25; }
.stats .n .thin { font-weight: 400; color: var(--ink-3); font-size: 0.9rem; }
.stats .l { font-size: 10px; color: var(--ink-3); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

/* --- Section headers --------------------------------------------------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
}
.section-head h2 { font-size: 1rem; letter-spacing: -0.01em; }
.section-head > a { padding: 4px 0; }

/* --- Page head --------------------------------------------------------- */

/* List pages: title block on top, thin rule, then the content. No card, no
   background, no shadow. The rule is the only separator. */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 1.55rem; letter-spacing: -0.028em; margin-bottom: 6px; }
.page-head .lede { font-size: 13.5px; line-height: 1.5; max-width: 82ch; margin: 0; }
.page-head .eyebrow { margin-bottom: 6px; }

/* --- List layout with a sticky filter rail ----------------------------- */

/* Below 1000px this is a plain block: the filter row sits above the table.
   At 1000px and up the rail becomes a sticky column with no card chrome —
   the same pattern as openrouter.ai/models. */
.list-layout { display: block; }

.filters { margin-bottom: 16px; }

/* The collapsed form: a wrapped row of small chips. */
.filter-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.filter-row a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.filter-row a:hover { background: var(--surface-2); color: var(--ink); }
.filter-row a[aria-current="true"] {
  color: var(--ink);
  font-weight: 500;
  background: var(--surface-2);
  border-color: var(--line);
}

/* The sticky form: a vertical list, uppercase mono group label, no borders. */
.filter-rail { display: none; }
.filter-rail .rail-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.filter-rail ul { list-style: none; margin: 0 0 18px; padding: 0; }
.filter-rail li { margin: 0; }
.filter-rail a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  margin-left: -8px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-2);
}
.filter-rail a:hover { background: var(--surface-2); color: var(--ink); }
.filter-rail a[aria-current="true"] {
  color: var(--ink);
  font-weight: 500;
  background: var(--surface-2);
}

@media (min-width: 1000px) {
  .list-layout {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
  }
  .list-layout > .filters { margin-bottom: 0; }
  /* Only the list layout has a rail to take over; /ops/ keeps its filter row. */
  .list-layout > .filter-row { display: none; }
  .filter-rail {
    display: block;
    position: sticky;
    top: calc(var(--header) + 22px);
    align-self: start;
  }
  .list-layout > .list-body { min-width: 0; }
}

/* --- Price comparison -------------------------------------------------- */

.compare {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  /* The panel is the size of the comparison, not the size of the page. A
     three-column table inside a full-width box reads as a table that lost its
     last three columns. `max-width` keeps a wide one inside the page. */
  width: fit-content;
  max-width: 100%;
}
.compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.compare-head .t { font-size: 12.5px; font-weight: 500; }
.compare-head .t .mono { color: var(--ink-3); font-weight: 400; }
.compare-rows { display: grid; }
.compare-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) repeat(3, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  align-items: stretch;
}
.compare-row:last-child { border-bottom: none; }
.compare-row > div { padding: 8px 14px; }
.compare-row > div + div { border-left: 1px solid var(--line); }
.compare-row.head { background: var(--surface-2); }
.compare-row.head > div {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  padding-top: 6px;
  padding-bottom: 6px;
}
.compare-row.head > div.num { text-align: right; }
.compare-row .unit-name { font-size: 13px; font-weight: 500; }
.compare-row .unit-name .sub { display: block; font-size: 10.5px; line-height: 1.3; color: var(--ink-3); font-family: var(--mono); font-weight: 400; }
.price-cell { text-align: right; }
.price-cell .amount { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.35; }
.price-cell .meta { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-cell .meta .who { color: var(--ink-2); }
.price-cell.cheapest { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.price-cell.cheapest .amount { color: var(--accent); }
.price-cell.empty { color: var(--ink-3); font-size: 12px; }

/* --- Per-step price panel (when no lab quotes the whole chain) ---------- */

/* Not a table: there are no labs to compare, so there is no column to rate.
   A bordered list keeps the step name beside its price and stops the section
   from reading as a table that lost its header. */
.step-prices {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.step-prices li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.step-prices li:last-child { border-bottom: none; }
.step-prices .step-name { font-size: 13px; font-weight: 500; min-width: 0; }
.step-prices .price {
  text-align: right;
  font-family: var(--mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.step-prices .price .who {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0;
}

/* --- Route / offer rows ------------------------------------------------ */

.route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.route:hover { border-color: var(--line-strong); }
.route.best { border-color: var(--accent); }
.route .price { text-align: right; }
.route .price .amount { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; font-family: var(--mono); line-height: 1.3; }
.route .price .sub { font-size: 11px; color: var(--ink-3); font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --- Timeline ---------------------------------------------------------- */

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding: 0 0 20px 24px;
  border-left: 1px solid var(--line);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}
.timeline li.done::before { background: var(--accent); }
.timeline .t { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

/* --- Definition list --------------------------------------------------- */

dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 9px 18px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--ink-3); font-size: 12.5px; }
dl.kv dd { margin: 0; }

/* --- Specification list ------------------------------------------------ */

/* A requirement is read before its citation, and the citation has to stay
   legible enough to be checked. The marker sits outside the text so a wrapped
   criterion keeps its number with its first line. */
.spec-list { margin: 0; padding-left: 20px; display: grid; gap: 12px; font-size: 13.5px; line-height: 1.55; list-style: none; }
.spec-list li { padding-left: 0; position: relative; }
.spec-list li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line);
}

/* --- Tabs -------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tabs button:hover { color: var(--ink); }

/* --- Editor ------------------------------------------------------------ */

.editor { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.steps { display: grid; gap: 8px; }
.step {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
}
.step.dragging { opacity: 0.5; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-index {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  width: 18px;
  flex: none;
}
.step-title { font-weight: 500; font-size: 13.5px; flex: 1; }
.step-title .sub { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 400; }
.step-actions { display: flex; gap: 2px; }
.icon-btn {
  appearance: none;
  border: 1px solid transparent;
  background: none;
  color: var(--ink-3);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
  font-family: var(--mono);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.step-params { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.step-params .field { margin: 0; min-width: 110px; flex: 1; }
.step-params label { font-size: 11px; color: var(--ink-3); }
.step-params input { height: 28px; font-size: 12.5px; font-family: var(--mono); }

.branch {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-2);
}
.branch-label { font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.branch-arm { border-left: 2px solid var(--line-strong); padding-left: 10px; margin-bottom: 8px; }
.branch-arm:last-child { margin-bottom: 0; }
.branch-arm .arm-label { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }

.palette { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.palette button {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  font-size: 13px;
}
.palette button:hover { border-color: var(--accent); background: var(--accent-soft); }
.palette button .sub { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }

.editor-price { position: sticky; top: 72px; }
.price-total { font-family: var(--mono); font-size: 1.9rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.price-total .currency { font-size: 0.95rem; color: var(--ink-3); margin-right: 4px; }

/* --- Misc -------------------------------------------------------------- */

.rule { height: 1px; background: var(--line); border: 0; margin: 32px 0; }
.stack { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.notice strong { color: var(--ink); }
.notice.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.prose { max-width: 70ch; }
.prose h2 { margin: 32px 0 10px; }
.prose h3 { margin: 22px 0 6px; }
.prose ul { padding-left: 18px; }
.prose li { margin-bottom: 5px; }
.prose p { color: var(--ink-2); }
.prose a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.prose a:hover { text-decoration-color: currentColor; }
.copy { display: flex; gap: 6px; align-items: center; }
.copy input { font-family: var(--mono); font-size: 12px; }
.hidden { display: none !important; }
.hr-tight { margin: 18px 0; }

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

/* An empty state names the next action instead of apologising for the gap.
   One sentence, one control, no illustration. */
.empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
}
.empty p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-2);
  max-width: 62ch;
}
.empty p:last-child { margin-bottom: 0; }

/* --- Sparkline ---------------------------------------------------------- */

/* Server-rendered SVG. The line is the accent, the fill is the same colour at
   low alpha, and the box never grows past its own width on a phone. */
.spark { display: block; width: 100%; max-width: 100%; height: auto; }
.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.spark-area { fill: var(--accent); opacity: 0.1; stroke: none; }

/* Interactive sparkline. The points are the hit targets: a 2.4px dot is too
   small to click, so each one carries a transparent 5px neighbour that does
   the catching. The visible dot only grows when its point is active. */
.spark-wrap { position: relative; }
.spark-point {
  fill: var(--accent);
  fill-opacity: 0;
  stroke: var(--bg);
  stroke-width: 1;
  transition: fill-opacity 0.1s, r 0.1s;
}
.spark-point:hover,
.spark-point.active { fill-opacity: 1; r: 4; }
.spark:focus { outline: none; }
.spark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* The readout follows the active point. It is pure text with the design
   system's own surface, and it never covers the point it describes. */
.spark-tip {
  position: absolute;
  transform: translate(-50%, -140%);
  pointer-events: none;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 5;
  font-variant-numeric: tabular-nums;
}

/* --- Range switcher ----------------------------------------------------- */

.range-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.range-bar .mono-label { margin-right: 4px; }
.range-link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.range-link:hover { background: var(--surface-2); color: var(--ink); }
.range-link[aria-current="true"] {
  color: var(--ink);
  font-weight: 500;
  background: var(--surface-2);
  border-color: var(--line);
}
.range-note { margin-left: 6px; }

/* --- Sortable table headers --------------------------------------------- */

/* The whole `th` is the control, so the hit area is the header box rather than
   the three words inside it. The button is a reset that carries that box. */
.data th.sortable-th { padding: 0 14px 7px 0; }
.data th.sortable-th:last-child { padding-right: 0; }
.sort-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 7px 0 0;
  margin: 0;
  width: 100%;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}
.data th.num .sort-btn { justify-content: flex-end; }
.sort-btn:hover { color: var(--ink); }
.sort-btn .sort-caret {
  opacity: 0;
  font-size: 8px;
  line-height: 1;
  transition: opacity 0.1s;
}
.sort-btn .sort-caret::before { content: "▲"; }
.data th[aria-sort="descending"] .sort-btn .sort-caret::before { content: "▼"; }
.data th[aria-sort="ascending"] .sort-btn .sort-caret,
.data th[aria-sort="descending"] .sort-btn .sort-caret { opacity: 0.75; }
.sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: 3px;
}

/* --- Seller coverage ---------------------------------------------------- */

/* A coverage row is a `<details>` so the expansion works without JS. The
   summary carries the operation, the state badge, and the arithmetic; the
   body carries the rule's terms and the QC sample. */
.coverage { border-bottom: 1px solid var(--line); }
.coverage:last-child { border-bottom: none; }
.coverage > summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 6px 0;
  cursor: pointer;
  list-style: none;
}
.coverage > summary::-webkit-details-marker { display: none; }
.coverage > summary:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.coverage > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.coverage .coverage-name { font-weight: 500; font-size: 13px; min-width: 0; }
.coverage .coverage-name .sub {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coverage .coverage-math {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coverage .coverage-math .op { color: var(--ink-3); }
.coverage .coverage-math .dim { color: var(--ink-3); }
.coverage[data-state="unpriced"] .coverage-math,
.coverage[data-state="excluded"] .coverage-math { color: var(--ink-3); }
.coverage .coverage-chevron {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  transition: transform 0.12s;
  justify-self: end;
  width: 16px;
  text-align: right;
}
.coverage[open] .coverage-chevron { transform: rotate(90deg); }
.coverage[open] > summary { background: var(--surface-2); }
.coverage .coverage-body {
  padding: 4px 0 14px;
  display: grid;
  gap: 12px;
}
.coverage .coverage-terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 18px;
  margin: 0;
  font-size: 12.5px;
}
.coverage .coverage-terms div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--line); padding-bottom: 3px; }
.coverage .coverage-terms dt { color: var(--ink-3); font-size: 11.5px; }
.coverage .coverage-terms dd { margin: 0; font-family: var(--mono); font-size: 12px; }

.coverage-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.coverage-legend .badge[data-state="priced"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.coverage-legend .badge[data-state="unpriced"] { background: var(--surface-2); color: var(--ink-2); }
.coverage-legend .badge[data-state="excluded"] { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.coverage-rule { font-size: 12px; color: var(--ink-2); max-width: 68ch; }

@media (max-width: 760px) {
  .coverage > summary {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 2px;
  }
  .coverage .coverage-math { grid-column: 1 / -1; padding-bottom: 4px; }
  .coverage .coverage-chevron { grid-row: 1; grid-column: 2; }
}

/* --- Provenance filter -------------------------------------------------- */

.filter-row a[data-label="published"] { color: var(--accent); }
.filter-row a[data-label="estimate"] { color: var(--ink-2); }
.filter-row a[data-label="demo"] { color: var(--warn); }
.filter-row a[aria-current="true"][data-label="published"] { background: var(--accent-soft); border-color: transparent; }
.filter-row a[aria-current="true"][data-label="demo"] { background: var(--warn-soft); border-color: transparent; }

/* --- Weekly chart ------------------------------------------------------- */

.week-chart { position: relative; }
.week-bars { display: block; width: 100%; height: auto; }
.week-bar { fill: var(--accent); opacity: 0.75; }
.week-bar:hover, .week-bar.active { opacity: 1; }
.week-axis { display: flex; justify-content: space-between; margin-top: 6px; }

/* --- Coverage gap links ------------------------------------------------- */

.gap-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 12px;
}
/* Each experiment is its own control, so it needs a real hit area even when it
   is the only link in the row. */
.gap-blocks a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 2px;
}
.gap-blocks a:hover { color: var(--accent); }

@media (max-width: 1300px) {
  .editor { grid-template-columns: 1fr; }
  .editor-price { position: static; }
  /* The header carries eight controls for a signed-in operator: the main nav,
     two staff-only links, and the account buttons. That does not fit until
     about 1300px, and it pushes the page sideways rather than wrapping.
     Tighten the gaps and padding before the 760px breakpoint hides the nav
     outright and drops the wordmark. */
  header.site .wrap { gap: 10px; }
  nav.main { gap: 0; font-size: 12.5px; }
  nav.main a { padding: 6px 6px; }
  nav.actions { gap: 2px; font-size: 12.5px; }
  nav.actions .btn { padding: 0 8px; }
}

@media (max-width: 800px) {
  /* The wordmark is what tips the header over between 800px and the 760px
     breakpoint, so it goes first. The mark stays as the home link. */
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 1100px) {
  /* Below this the header's controls no longer fit on one row: an operator
     sees the main nav, two staff links, and the account buttons. Wrapping
     them is honest, where shrinking the text to fit is not. */
  header.site .wrap {
    height: auto;
    min-height: var(--header);
    flex-wrap: wrap;
    align-content: center;
    row-gap: 4px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .spacer { display: none; }
}

@media (max-width: 760px) {
  .grid.two, .grid.three, .grid.auto { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 1.6rem; }
  .hero h1 { font-size: 1.8rem; }
  .page-head h1 { font-size: 1.35rem; }
  nav.main { display: none; }
  .wrap { padding: 0 16px; }
  header.site .wrap { gap: 10px; height: 52px; }
  /* Brand + four controls does not fit a 390px header with the wordmark. The
     mark stays as the home link; the words are the part that can go. */
  nav.actions { gap: 2px; flex: 1; justify-content: flex-end; min-width: 0; }
  nav.actions .btn { padding: 0 9px; white-space: nowrap; }
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .brand { font-size: 13.5px; }
  main { padding: 22px 0 64px; }
  dl.kv { grid-template-columns: 1fr; gap: 3px 0; }
  dl.kv dt { margin-top: 9px; }
  .route { grid-template-columns: 1fr; gap: 10px; }
  .route .price { text-align: left; }
  .stats, .stats:has(> div:nth-child(3):last-child), .stats:has(> div:nth-child(5)) { grid-template-columns: repeat(1, 1fr); }
  .stats > div:nth-child(3) { border-left: none; padding-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .data { font-size: 12.5px; }
  .data th, .data td { padding-right: 10px; }
  .compare-row { grid-template-columns: 1fr; }
  .compare-row > div + div { border-left: none; border-top: 1px solid var(--line); }
  .compare-row.head { display: none; }
  .compare-row > div { padding: 8px 12px; }
  .price-cell::before {
    content: attr(data-vendor);
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
    margin-bottom: 2px;
  }
  pre { font-size: 11.5px; }
}

/* --- Vendor portal --- */

/* The vendor portal is a form and a set of dense tables. It reuses the design
   system's field, card, and data-table classes and adds only what those do
   not cover: fieldsets that read as sections, a checkbox label that sits in a
   table cell, and the arithmetic column. */

.vp-fieldset {
  /* A fieldset's default minimum is its content's min-content width, which
     stops the table inside it from scrolling and pushes the page sideways. */
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px 8px;
  margin: 0 0 22px;
}
.vp-fieldset > legend {
  padding: 0 6px;
  margin-left: -6px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.vp-fieldset > .field:last-child,
.vp-fieldset > .grid:last-child { margin-bottom: 0; }
.vp-fieldset .field { margin-bottom: 14px; }

/* A checkbox with its own words. The whole label is the hit area, so the
   control is reachable with a thumb and the text is the target. Used on the
   vendor portal and on the signup form, so it lives outside that section. */
.vp-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-weight: 400;
  margin-bottom: 0;
  cursor: pointer;
}
.vp-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
  accent-color: var(--accent);
}
.vp-check span { line-height: 1.35; }

/* Signup goals: two columns of one-line checkboxes, one on a phone. */
.intent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
}
@media (max-width: 560px) {
  .intent-grid { grid-template-columns: 1fr; }
}

/* Form labels that only a screen reader needs: the table header already names
   the column, so a visible duplicate would be noise. */
.vp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The operation list on the application: a category label above each table,
   so a reader can scan one kind of work at a time. */
.vp-op-group { margin-bottom: 10px; border-top: 1px solid var(--line); }
.vp-op-cat {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  padding: 9px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  min-height: 34px;
}
.vp-op-cat::-webkit-details-marker { display: none; }
.vp-op-cat:hover { color: var(--ink); }
.vp-op-cat::after {
  content: "+";
  font-size: 13px;
  color: var(--ink-3);
  order: 3;
}
details[open] > .vp-op-cat::after { content: "−"; }
.vp-op-count {
  order: 2;
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  font-size: 10.5px;
}
.vp-op-group > .table-scroll { padding-bottom: 6px; }
.vp-op-table td { padding-top: 4px; padding-bottom: 4px; }
.vp-op-table input[type="text"] {
  height: 30px;
  min-width: 72px;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 0 7px;
}
.vp-op-table td:first-child { min-width: 168px; }

/* A row the server rejected. The rule is left in place and the reason is
   printed under it, so the correction happens where the mistake is. */
.vp-row-error > td { background: var(--danger-soft); }
.vp-row-error .errorlist { color: var(--danger); }

/* Status strip: the one thing a seller needs first. Two columns, no card
   chrome inside a card. */
.vp-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.vp-status-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.vp-status-side { text-align: right; }
.vp-big {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

/* The blocking list. A numbered list because the order is the order the
   seller should work through it. */
.vp-blockers { margin: 0; padding-left: 18px; display: grid; gap: 12px; }
.vp-blockers li { font-size: 13px; }
.vp-blocker-title { font-weight: 500; }
.vp-blockers a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.vp-blockers a:hover { color: var(--accent); }

.vp-cov-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* The arithmetic column carries the whole rule. It wraps rather than
   truncates: a clipped rule is a rule a seller cannot check. */
.vp-table .vp-math {
  white-space: normal;
  line-height: 1.5;
  min-width: 220px;
}
.vp-table .vp-math .op { color: var(--ink-3); }
.vp-math-error {
  color: var(--danger);
  font-family: var(--sans);
  font-size: 12px;
  margin-top: 3px;
}
.vp-table td { padding-top: 7px; padding-bottom: 7px; }

/* The current-rule header on the price page: label and version on the left,
   the total at the check sample count on the right. */
.vp-rule-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.vp-rule-total { text-align: right; }

/* The arithmetic table on the price page. Its numbers line up with the
   buyer-facing total because it is the same evaluator. */
.vp-calc { font-size: 13px; }
.vp-calc td { padding: 6px 0; }
.vp-calc td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; width: 90px; }
.vp-calc caption { text-align: left; }

@media (max-width: 760px) {
  .vp-status { grid-template-columns: 1fr; gap: 12px; }
  .vp-status-side { text-align: left; }
  .vp-rule-head { align-items: flex-start; }
  .vp-rule-total { text-align: left; }
  .vp-fieldset { padding: 14px 14px 6px; }
}

/* --- Compose ------------------------------------------------------------ */
/* The operation tick-list. Each operation is a bordered row whose checkbox,
   name, step input, and vendor state sit on one line; parameters open under
   it. A ticked row gets a left rule so the composition is visible at a
   glance without reading every checkbox. */
.compose-ops { display: grid; gap: 8px; }
.compose-group { display: grid; gap: 6px; }
.compose-group > .mono-label { margin-top: 6px; }
.compose-group:first-child > .mono-label { margin-top: 0; }
/* A field's steps are folded by field, so the page opens as nine headings
   rather than seventeen rows. A `<details>` is the fold; nothing else. */
.compose-group > summary {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
.compose-group > summary::-webkit-details-marker { display: none; }
.compose-group > summary::before { content: "▸ "; }
.compose-group[open] > summary::before { content: "▾ "; }

/* The three ways in. One is open at a time; they are alternatives, not steps
   of a wizard. The open one is the one that produced the current sequence. */
.compose-entry { display: grid; gap: 8px; margin-bottom: 16px; }
.compose-way {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.compose-way > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  min-height: 40px;
}
.compose-way > summary::-webkit-details-marker { display: none; }
.compose-way > summary::before { content: "+ "; font-family: var(--mono); color: var(--ink-3); }
.compose-way[open] > summary::before { content: "− "; }
.compose-way[open] > summary { border-bottom: 1px solid var(--line); }
.compose-way-name { font-size: 14px; font-weight: 500; flex: 1; }
.compose-way-body { padding: 12px 14px 14px; }

/* The chosen sequence, one step per row, with four controls that post. The
   row is the unit of reordering, so nobody types `3,7` to move a step. */
.sequence { list-style: none; padding: 0; margin: 0; }
.sequence > li {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.sequence > li:last-child { border-bottom: none; }
.sequence-name { font-size: 13.5px; font-weight: 500; flex: 1; min-width: 140px; }
.sequence-name .sub { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); }
.sequence-params { color: var(--ink-3); flex-basis: 100%; order: 3; }
.sequence-controls { display: inline-flex; gap: 4px; flex: none; flex-wrap: wrap; }
.sequence-controls .btn[disabled] { visibility: hidden; }

.compose-op {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 10px;
}
.compose-op.on { border-left-color: var(--accent); background: var(--accent-soft); }

.compose-op-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.compose-op-head input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: none;
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}
/* The label is the click target for the checkbox, so it takes the slack and
   keeps a 28px hit area. */
.compose-op-name {
  flex: 1;
  min-width: 120px;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
}
.compose-op-name .sub { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

.compose-op-order { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.compose-op-order label { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.compose-op-order input {
  width: 62px;
  height: 28px;
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: center;
  padding: 0 4px;
}

.compose-op-vendors { flex: none; white-space: nowrap; }

/* Parameters sit under the row and only for a ticked operation's own declared
   fields. The definition decides how many and what kind. */
.compose-op .step-params { margin-top: 8px; }
.compose-op:not(.on) .step-params { opacity: 0.75; }

/* The arithmetic table. Numbers align on the right and use tabular figures so
   a column of amounts can be read down, not across. */
.compose-math { width: 100%; }
.compose-math th { font-size: 11px; }
.compose-math td { vertical-align: top; }
.compose-math td.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.compose-math .sub { font-size: 11px; color: var(--ink-3); }
.compose-math .tiny { margin-top: 2px; }

/* The example buttons are shortcuts, not navigation. They sit in a stack and
   keep full-width left-aligned text so the operation count stays readable. */
.editor-price [data-example] { text-align: left; justify-content: flex-start; }

@media (max-width: 900px) {
  /* The sticky price column would cover the form once the grid collapses. */
  .editor-price { position: static; }
}

@media (max-width: 760px) {
  .compose-op-head { gap: 8px; }
  .compose-op-order { margin-left: auto; }
  .compose-op-vendors { order: 3; width: 100%; }
  .compose-math { min-width: 560px; }
}

/* --- Price arithmetic -------------------------------------------------- */

/* A breakdown is a stack of blocks, not a table. The prose is the point, and a
   four-column table forces it into a 186px slot that then overflows sideways on
   a phone. One operation per block keeps the sentence readable at every width. */
.math-list { display: block; }
.math-block {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.math-block:last-of-type { border-bottom: none; }
.math-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.math-op {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
}
.math-op .sub {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
}
.math-vendor { color: var(--ink-2); }
.math-line-total {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.math-body { padding: 5px 0 0; }

/* One pricing term per row: what was charged, in words, and the amount it
   produced. The prose wraps; the amount never breaks a number across lines. */
.math-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}
.math-row + .math-row { margin-top: 3px; }
.math-says { min-width: 0; }
.math-amount {
  flex: none;
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.math-sum {
  padding: 11px 0 13px;
  border-top: 1px solid var(--line-strong);
  margin-top: 2px;
}
.math-sum .math-row { color: var(--ink-2); }

@media (max-width: 760px) {
  /* Below 760px there is no room for a sentence and an amount side by side, so
     the amount sits under the sentence it belongs to. */
  .math-row { display: block; }
  .math-amount { display: block; margin-top: 1px; }
}

/* --- Simulated marker --------------------------------------------------- */

/* A text badge, not a colour. The word has to be readable on a page that has
   no colour vision applied to it, and it has to survive a printout. It uses the
   warn palette so it sits apart from a live/accepted badge without shouting. */
.badge.simulated {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}


/* --- Keyboard and reduced motion ---------------------------------------- */

/* The first tab stop on every page. A keyboard user should be able to jump the
   nav once, not tab through it on every page. Hidden until focused, and fixed
   to the corner so it does not reflow the header it sits over. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}
.skip-link:focus { transform: none; }

/* A visible ring on everything that can take focus, not only the inputs that
   already had one. `:focus-visible` keeps it off a mouse click and on for a
   keyboard tab, which is the distinction the ring is for. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Motion is decoration here: one button transition and a few hover shifts.
   Removing it changes nothing a reader needs. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* On a narrow phone the action buttons could sit off the right edge of the
   header. They wrap now, and the 28px small button grows to the 34px thumb
   target the rest of the design already uses. */
@media (max-width: 560px) {
  nav.actions { flex-wrap: wrap; }
  .btn.sm { height: 34px; padding: 0 12px; }
}

/* --- Questions ----------------------------------------------------------- */

/* A definition list, not a card per answer. The question is the term; it takes
   the mono face the rest of the metadata uses so a reader can scan for it
   without reading the whole answer. */
.faq { margin: 6px 0 0; }
.faq dt {
  font-weight: 600;
  font-size: 14px;
  margin-top: 22px;
  color: var(--ink);
}
.faq dt:first-child { margin-top: 0; }
.faq dd {
  margin: 5px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 72ch;
}
