/* ETHUX console — one stylesheet, no build step.
 *
 * Design language: the ETHUX comic system (approved 2026-10-08; the ethux-brand skill and
 * ethux-company/design). Ink lines, hard offset shadows, flat print colours with the
 * console in cobalt, Unbounded headings, Manrope text, Martian Mono for anything copied.
 *
 * CSP style-src 'self': nothing here may be expressed as an inline style in a template,
 * which is why per-row geometry arrives as classes (.share-N) and colours as custom
 * properties set by utility classes (.chip-N, .seg-N).
 */

/* ---------- faces ------------------------------------------------------- */

/* Self-hosted (docs/frontend.md §5), latin subset, woff2, swap so text never waits for a
   face. All three are OFL-1.1. The server rewrites these plain /static/ paths to the
   content-addressed ones when it builds the asset table. The system: the ethux-brand skill
   and ethux-company/design (approved 2026-10-08). */
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
  src: url(/static/unbounded-latin.d7f07f8a.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(/static/manrope-latin.e310b55a.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 87.5%;
  font-display: swap;
  src: url(/static/martian-mono-latin.68af56c3.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ------------------------------------------------------ */

/* The ETHUX comic system: ink lines, hard offset shadows, flat print colours, one colour per
   product (the console is cobalt). Light first; dark and soft keep the same shapes with
   other inks. Readability still rules (docs/readable-ui.md): text 4.5:1, box edges 3:1, and
   every colour carries a word. Ink is the primary action; links are ink, underlined; green
   is "running". Light for everyone unless they pick dark or soft (owner, 2026-10-24): the theme
   cookie stamps data-theme on <html>, and the OS setting is not followed. */
:root {
  color-scheme: light;
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --text: #111111;
  --text-2: #4f4c46;
  --border: #111111;
  --border-strong: #111111;
  --divider: #111111;

  --link: #111111;
  --accent: #111111;
  --accent-ground: #111111;
  --accent-ink: #ffffff;
  --accent-soft: #f4f2ec;

  --good: #0e7a46; --good-bg: #dff3e8;
  --warn: #a3480b; --warn-bg: #ffe2d6;
  --bad:  #b42318; --bad-bg:  #fde4e1;

  --focus: #2f4bff;
  --series: #4f4c46;
  --current-bg: #ffffff;
  --current-ink: #111111;
  --lift: none;
  --ring-good: rgb(14 122 70 / 0.18);

  --seg-0: #111111; --seg-1: #ff4d1a; --seg-2: #2f4bff; --seg-3: #c8f135;

  --band-bg: #ff4d1a;
  --band-ink: #111111;
  --band-muted: #111111;
  --band-line: #111111;
  --rail-line: #111111;      /* lines on the cobalt rail, ink in every theme */

  /* the product colours and the kit */
  --field: #2f4bff;          /* the console's colour */
  --field-ink: #ffffff;
  --orange: #ff4d1a;
  --lime: #c8f135;
  --door-field: #ff4d1a;     /* the sign-in page's claim panel */
  --shadow: #111111;
  --rule: 3px;
  --pop: 6px 6px 0 var(--shadow);
  --pop-sm: 4px 4px 0 var(--shadow);

  --radius: 0;
  --radius-lg: 0;
  --radius-sm: 0;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.75rem;
  --space-6: 2.5rem;
  --space-7: 3.5rem;

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Unbounded", "Arial Black", ui-sans-serif, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1130; --surface: #171b45; --surface-2: #21265e;
  --text: #f4f2ec; --text-2: #b9bcd9;
  --border: #6c75d6; --border-strong: #6c75d6; --divider: #3a4090;
  --link: #f4f2ec; --accent: #c8f135; --accent-ground: #c8f135; --accent-ink: #111111; --accent-soft: #21265e;
  --good: #5fd39a; --good-bg: #13291e; --warn: #ffa057; --warn-bg: #2e1d10; --bad: #ff8a80; --bad-bg: #2d1615;
  --focus: #c8f135; --series: #b9bcd9; --current-bg: #f4f2ec; --current-ink: #111111; --ring-good: rgb(95 211 154 / 0.18);
  --seg-0: #f4f2ec; --seg-1: #ff4d1a; --seg-2: #8fa0ff; --seg-3: #c8f135;
  /* Cobalt night: the rail's own blue deepened into the page; shadows print in the rail's cobalt. */
  --field: #2f4bff; --field-ink: #ffffff; --shadow: #2f4bff; --door-field: #c8f135;
}

/* Soft: the same shapes in quieter ink and a calmer rail, for people who find bright
   pages or sharp contrast tiring. Text still clears 4.5:1 and box edges 3:1. */
:root[data-theme="soft"] {
  color-scheme: light;
  --bg: #e9e7e1; --surface: #f4f2ec; --surface-2: #e9e7e1;
  --text: #34322e; --text-2: #5a5750;
  --border: #5a5750; --border-strong: #5a5750; --divider: #5a5750;
  --link: #34322e; --accent: #34322e; --accent-ground: #34322e; --accent-ink: #f4f2ec; --accent-soft: #e9e7e1;
  --good: #2c6b4f; --good-bg: #d9e8de; --warn: #97511c; --warn-bg: #f0e0cf; --bad: #9b3a2f; --bad-bg: #f2dcd7;
  --focus: #4a5bb8; --series: #5a5750; --current-bg: #f4f2ec; --current-ink: #34322e;
  --seg-0: #34322e; --seg-1: #c9734f; --seg-2: #6d7cc4; --seg-3: #b9c98a;
  --field: #6d7cc4; --field-ink: #ffffff; --shadow: #5a5750;
  --pop: 4px 4px 0 var(--shadow); --pop-sm: 3px 3px 0 var(--shadow);
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-block-size: 100dvh;
}

h1, h2, h3, p, dl, dd { margin: 0; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--mono); font-size: 0.875rem; }

.num { font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: var(--space-2) var(--space-4);
  z-index: 10;
}
.skip:focus { left: 0; }

/* ---------- shell ------------------------------------------------------- */

/* Two shells, chosen by base.html from one fact: is there an acting organisation. With
   one, a floating sidebar card and a content column — the console. Without, a top bar and
   a centred reading column for the door, the notices and signup. */

.plain { display: flex; flex-direction: column; }
/* inline-size and min-inline-size are load-bearing: <main> carries .wrap, and a flex item
   with auto inline margins shrink-wraps unless told its width; min-width:auto would let a
   nowrap table push the page sideways instead of scrolling inside .table-wrap. */
.plain .main { flex: 1 0 auto; inline-size: 100%; min-inline-size: 0; }

.wrap {
  max-width: 42rem;
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.wrap--wide { max-width: 72rem; }

/* rail | document | meta. The rail width is a token so the folded state is one override.
   The meta column exists only on pages that filled Page.Meta (base.html adds .shell--meta). */
:root { --rail-w: 17rem; --meta-w: 15rem; }

body.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-block-size: 100dvh;
}
body.shell--meta { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--meta-w); }

/* The sidebar is docked: full height, flush to the left edge, one line between it and the
   page. Sticky, so navigation stays where the hand left it however long the page gets. */
.side {
  position: sticky;
  top: 0;
  align-self: start;
  block-size: 100dvh;
  margin: 0;
  padding: 1.25rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
  min-inline-size: 0;
  background: var(--surface);
  border: 0;
  border-inline-end: 1px solid var(--border);
  overflow-y: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding-inline: 0.625rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand__word { font-weight: 800; font-size: 1.125rem; letter-spacing: -0.02em; white-space: nowrap; }
/* The mark: a gold rounded square. Not a letter and not the old red dot. */
.brand__mark {
  inline-size: 1.625rem;
  block-size: 1.625rem;
  flex: none;
  border-radius: 9px;
  background: var(--accent-ground);
}

/* The brand row. The collapse control sits beside the mark, where a sidebar toggle is
   looked for. */
.side__top {
  display: flex; align-items: center; gap: var(--space-2);
}
.side__top .brand { flex: 1 1 auto; min-inline-size: 0; }

/* The acting organisation: the same URL shows different numbers for different orgs, so the
   org is read before the content. */
.org {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.6875rem 0.75rem;
  border-radius: 14px;
  background: var(--surface-2);
  min-inline-size: 0;
}
.org__text { display: flex; flex-direction: column; line-height: 1.3; min-inline-size: 0; }
.org__name { font-weight: 700; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org__domain { color: var(--text-2); font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org__switch { margin-inline-start: auto; font-size: 0.875rem; color: var(--text-2); white-space: nowrap; }
.org--switch { text-decoration: none; color: inherit; }
.org--switch:hover { text-decoration: none; background: var(--surface-2); }
.org--switch:hover .org__switch { color: var(--text); }

.chip {
  inline-size: 0.625rem;
  block-size: 0.625rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: oklch(0.74 0.12 var(--chip-h, 160));
}
.chip-0  { --chip-h: 8; }   .chip-1  { --chip-h: 32; }
.chip-2  { --chip-h: 52; }  .chip-3  { --chip-h: 96; }
.chip-4  { --chip-h: 140; } .chip-5  { --chip-h: 168; }
.chip-6  { --chip-h: 190; } .chip-7  { --chip-h: 212; }
.chip-8  { --chip-h: 246; } .chip-9  { --chip-h: 280; }
.chip-10 { --chip-h: 312; } .chip-11 { --chip-h: 340; }

/* Navigation in labelled groups: Compute, Models, Account. */
.nav { display: flex; flex-direction: column; gap: 1rem; flex: 1 1 auto; }
.nav__group { display: flex; flex-direction: column; gap: 2px; }
.nav__heading { padding: 0 0.75rem 0.375rem; font-size: 0.875rem; font-weight: 600; color: var(--text-2); }

.nav__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}
.nav__item svg { inline-size: 1.1875rem; block-size: 1.1875rem; color: var(--text-2); flex-shrink: 0; }
.nav__item:hover { background: var(--surface-2); text-decoration: none; }
.nav__item.is-current { background: var(--current-bg); color: var(--current-ink); }
.nav__item.is-current svg { color: var(--current-ink); }

.side__foot {
  margin-block-start: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-inline: 0.75rem;
  color: var(--text-2);
  font-size: 0.875rem;
}
.side__foot a { color: var(--text-2); }
.side__foot a:hover { color: var(--text); }
.side__foot .btn { align-self: flex-start; }

/* Who is signed in, next to the control that ends being them. Truncated rather than
   wrapped: a two-line identifier pushes the controls below it around. */
.side__who {
  display: flex; align-items: center; gap: var(--space-2);
  min-inline-size: 0;
  color: var(--text-2); font-size: 0.875rem;
}
.side__who-icon { inline-size: 1.125rem; block-size: 1.125rem; flex: none; color: var(--text-2); }
.side__who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The folded rail: icons only. The checkbox lives in base.html; no cookie, no script. */
body:has(.railstate:checked) { --rail-w: 5rem; }
body:has(.railstate:checked) .brand__word,
body:has(.railstate:checked) .nav__heading,
body:has(.railstate:checked) .org__text,
body:has(.railstate:checked) .org__switch,
body:has(.railstate:checked) .side__foot .inline-form,
body:has(.railstate:checked) .side__foot > a,
body:has(.railstate:checked) .side__foot .help,
body:has(.railstate:checked) .side__who-name,
body:has(.railstate:checked) .build { display: none; }
/* Version strings have no spaces; let them wrap instead of widening the rail. */
.build { overflow-wrap: anywhere; min-width: 0; }
body:has(.railstate:checked) .side { padding-inline: 0.5rem; overflow: hidden; }
body:has(.railstate:checked) .brand,
body:has(.railstate:checked) .nav__item,
body:has(.railstate:checked) .org,
body:has(.railstate:checked) .side__who { justify-content: center; padding-inline: 0; }
body:has(.railstate:checked) .side__top { flex-direction: column; gap: var(--space-1); }
body:has(.railstate:checked) .side__top .brand { flex: none; }
/* Three buttons are wider than the folded rail; stacked they fit. Hiding them would leave
   a control you cannot find again. */
body:has(.railstate:checked) .theme { flex-direction: column; align-self: center; }
body:has(.railstate:checked) .side__foot .theme { align-self: center; }

/* Between phone and laptop the full rail takes a third of the screen: fold it to icons
   there, whatever the toggle says, and hide the toggle that would do nothing. */
@media (min-width: 48.0625rem) and (max-width: 72rem) {
  body.shell { --rail-w: 5rem; }
  body.shell .brand__word,
  body.shell .nav__heading,
  body.shell .org__text,
  body.shell .org__switch,
  body.shell .side__foot .inline-form,
  body.shell .side__foot > a,
  body.shell .side__foot .help,
  body.shell .side__who-name,
  body.shell .build { display: none; }
  body.shell .side { padding-inline: 0.5rem; overflow: hidden; }
  body.shell .brand,
  body.shell .nav__item,
  body.shell .org,
  body.shell .side__who { justify-content: center; padding-inline: 0; }
  body.shell .side__top { flex-direction: column; gap: var(--space-1); }
  body.shell .side__top .brand { flex: none; }
  body.shell .theme { flex-direction: column; align-self: center; }
  body.shell .side__foot .theme { align-self: center; }
  body.shell .rail-toggle { display: none; }
}

/* Folded, the link text stays for screen readers: hidden from sight, not from the tree. */
body:has(.railstate:checked) .nav__label {
  position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
@media (min-width: 48.0625rem) and (max-width: 72rem) {
  body.shell .nav__label {
    position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

/* ORDER MATTERS: the base rule sets display, so it comes first; declared after the
   modifiers it won on source order and both icons showed at once. */
.railstate { position: absolute; opacity: 0; pointer-events: none; }
.rail-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  inline-size: 1.875rem; block-size: 1.875rem; flex: none;
  border-radius: 10px;
  color: var(--text-2); cursor: pointer;
}
.rail-toggle:hover { color: var(--text); background: var(--surface-2); }
.rail-toggle__icon { inline-size: 1rem; block-size: 1rem; flex: none; }
.rail-toggle__icon--unfold { display: none; }
body:has(.railstate:checked) .rail-toggle__icon--fold { display: none; }
body:has(.railstate:checked) .rail-toggle__icon--unfold { display: inline-block; }
.railstate:focus-visible ~ .side .rail-toggle { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Content column. Capped so a 27-inch display does not stretch a table across the room. */
.shell .main {
  padding: 2.125rem 2.25rem var(--space-7);
  max-inline-size: 84rem;
  inline-size: 100%;
  min-inline-size: 0;
  margin-inline: auto;   /* centred in its track, so a wide screen is not empty on one side */
}
.plain .main { padding-block: var(--space-5) var(--space-7); }

/* ---------- the meta rail ---------------------------------------------- */
/* Docked on the right like the nav on the left: full height, one line between it and the
   page, and it folds to a strip with only its toggle. */
.meta {
  margin: 0;
  align-self: start;
  position: sticky;
  top: 0;
  block-size: 100dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 0;
  border-inline-start: 1px solid var(--border);
  padding: 1.25rem;
  font-size: 0.875rem;
}
.meta-toggle { display: flex; margin-block-end: var(--space-3); margin-inline-start: auto; }
.meta-toggle__unfold { display: none; }
.metastate { position: absolute; opacity: 0; pointer-events: none; }
body:has(.metastate:checked) { --meta-w: 3.5rem; }
body:has(.metastate:checked) .meta { padding-inline: 0.75rem; }
body:has(.metastate:checked) .meta__block { display: none; }
body:has(.metastate:checked) .meta-toggle__fold { display: none; }
body:has(.metastate:checked) .meta-toggle__unfold { display: inline-block; }
.meta__block + .meta__block { margin-block-start: var(--space-5); }
.meta__h { font-size: 0.875rem; font-weight: 700; margin: 0 0 var(--space-2); }
.meta__list { margin: 0; }
.meta__row { display: flex; justify-content: space-between; gap: var(--space-2); padding-block: 0.1875rem; }
.meta__row dt { color: var(--text-2); }
.meta__row dd { margin: 0; font-variant-numeric: tabular-nums; }
.meta__note { margin: var(--space-2) 0 0; color: var(--text-2); }

@media (max-width: 64rem) {
  body.shell, body.shell--meta { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .meta { display: none; }
}

/* ---------- page head --------------------------------------------------- */

/* Title and its sentence on the left, the one action that matters on the right. */
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  margin-block-end: 1.625rem;
}
.head > .head__text { min-inline-size: 0; display: flex; flex-direction: column; gap: var(--space-1); }
/* The trail above a title, set in mono: production / GPU machines / new. */
.crumb { color: var(--text-2); font-family: var(--mono); font-size: 0.875rem; }
.crumb b { font-weight: 400; color: var(--text); }
.crumb a { color: var(--text-2); }
.head .page-h1 { margin-block-end: 0; }
.head .lede { margin: 0; }
.head__actions { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; padding-block-start: var(--space-1); }

.page-h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-block-end: var(--space-4);
}

.h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}

.lede { color: var(--text-2); margin-block-end: var(--space-4); max-inline-size: 70ch; }
.period { color: var(--text-2); margin-block-end: var(--space-4); }

/* A number the page is about, in mono with tabular figures so a column of them aligns. */
.stat { display: inline-flex; align-items: baseline; gap: var(--space-2); color: var(--text-2); }
.stat b { font-family: var(--mono); font-size: 1.125rem; font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }

/* KPI strip: tiles separated by a 1px gap that shows the border through. */
.kpis {
  display: flex;
  gap: 1px;
  background: var(--divider);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-block-end: var(--space-5);
  box-shadow: var(--lift);
}
.kpi { flex: 1 1 0; min-inline-size: 0; background: var(--surface); padding: 0.875rem 1.125rem; }
.kpi__label { display: block; color: var(--text-2); font-size: 0.875rem; font-weight: 600; }
.kpi__value { display: block; margin-block-start: var(--space-1); font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__note { display: block; color: var(--text-2); font-size: 0.875rem; }

.rule { border: 0; border-block-start: 1px solid var(--divider); margin-block: var(--space-6); }

.fine { color: var(--text-2); font-size: 0.875rem; margin-block-start: var(--space-3); max-inline-size: 70ch; }
/* A hint under a control: a <span>, because .field is a <p> and cannot nest one. */
.field .fine { display: block; margin-block-start: var(--space-1); }

.note { color: var(--text-2); font-size: 0.875rem; margin-block-start: var(--space-3); max-inline-size: 70ch; }
.note--policy { color: var(--text-2); }
.ref { color: var(--text-2); font-size: 0.875rem; margin-block-start: var(--space-3); }

.prose { max-width: 38rem; }
.prose p { margin-block-end: var(--space-4); }
.prose h2 + p { margin-block-start: var(--space-2); }

/* Fact lists: a hairline between statements rather than a column of bullets. */
.facts { list-style: none; margin: 0 0 var(--space-5); padding: 0; }
.facts li { padding-block: var(--space-2); border-block-start: 1px solid var(--divider); }
.facts li:last-child { border-block-end: 1px solid var(--divider); }
.facts b { font-weight: 700; }

/* ---------- surfaces ---------------------------------------------------- */

/* The box. Every group of content on a page is one: a visible 3:1 edge, a heading at the
   top, room inside, and more room between boxes than within them (docs/readable-ui.md). A
   .sub section is a box too, so no content floats loose on the page. */
.panel, .sub {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-block-end: 1.5rem;
}
.panel > .h2:first-child, .sub > .h2:first-child { margin-block-end: var(--space-3); }
.sub > .h2 + .lede, .panel > .h2 + .lede { margin-block-start: calc(var(--space-2) * -1); }
.panel > :last-child, .sub > :last-child { margin-block-end: 0; }
/* Inside a box, a table or a list is part of the box: no second edge. */
.panel .table-wrap, .sub .table-wrap { border: 0; border-radius: 0; background: transparent; margin: var(--space-2) 0 0; }
.panel .rows, .sub .rows { gap: 0; }
/* A table inside a box lines up with the box's heading. */
.panel .tbl th:first-child, .panel .tbl td:first-child,
.sub .tbl th:first-child, .sub .tbl td:first-child { padding-inline-start: 0; }
.panel .tbl th:last-child, .panel .tbl td:last-child,
.sub .tbl th:last-child, .sub .tbl td:last-child { padding-inline-end: 0; }
.panel .rowcard, .sub .rowcard { border: 0; border-block-end: 1px solid var(--divider); border-radius: 0; background: transparent; padding-inline: 0; }
.panel .rows > :last-child .rowcard, .panel .rows > .rowcard:last-child,
.sub .rows > :last-child .rowcard, .sub .rows > .rowcard:last-child { border-block-end: 0; }

.panel--alert { border-color: var(--bad); }
.panel--notice { max-width: 38rem; }
/* A form card takes the form's own width: a 72rem card around a 26rem column of fields is
   mostly empty space. */
.panel--form { max-inline-size: 34rem; }

/* The create-key form as a popover (keys.html): a modal without a line of script. A browser
   without [popover] shows it as an ordinary card in the flow. */
[popover].popover { inset: 0; margin: auto; inline-size: min(34rem, calc(100vw - 2rem)); max-block-size: calc(100dvh - 2rem); overflow: auto; padding: var(--space-5) var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: 0 32px 80px -32px rgb(0 0 0 / 0.5), 0 2px 8px rgb(0 0 0 / 0.12); }
[popover].popover::backdrop { background: rgb(8 9 11 / 0.55); backdrop-filter: blur(3px); }
.popover__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-block-end: var(--space-2); }
.popover__head .h2 { margin: 0; }
.popover__close { padding: 0; inline-size: 2.25rem; min-block-size: 2.25rem; flex-shrink: 0; }
.popover__close svg { inline-size: 1.125rem; block-size: 1.125rem; }
.btn__icon { inline-size: 1rem; block-size: 1rem; }

.charge { margin-block-start: var(--space-5); }
.sub > .charge:first-child, .sub > .h2 + .charge, .sub > .period + .charge { margin-block-start: var(--space-2); }
/* Bullets rather than paragraphs: one fact per line (docs/readable-ui.md). */
.bullets { margin: 0; padding-inline-start: 1.25rem; max-inline-size: 70ch; }
.bullets li + li { margin-block-start: var(--space-2); }
.bullets li::marker { color: var(--text-2); }
.hero__h { margin-block-end: var(--space-3); }
.actions { display: flex; gap: var(--space-3); align-items: center; margin-block-start: var(--space-4); flex-wrap: wrap; }
.footactions { display: flex; gap: var(--space-3); margin-block-start: var(--space-5); }

/* ---------- buttons ----------------------------------------------------- */

/* Quiet is the default voice; primary (gold) is the one action per screen. No third weight. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: 2.375rem;
  padding: 0 1.125rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, filter 120ms ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }

.btn--primary {
  background: var(--accent-ground);
  border-color: var(--accent-ground);
  color: var(--accent-ink);
  font-weight: 700;
}
.btn--primary:hover { background: var(--accent-ground); filter: brightness(1.06); }

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
  min-block-size: 2rem;
}
.btn--quiet:hover { color: var(--text); background: var(--surface-2); }

.btn--wide { inline-size: 100%; }
.btn--sm { min-block-size: 1.875rem; padding-inline: var(--space-3); font-size: 0.875rem; }
.btn svg { inline-size: 1.0625rem; block-size: 1.0625rem; flex: none; }

/* ---------- forms ------------------------------------------------------- */

.field { margin: 0 0 var(--space-4); border: 0; padding: 0; }
.field__label { display: block; margin-block-end: var(--space-1); font-weight: 600; }
.check { display: flex; gap: var(--space-2); align-items: center; font-weight: 600; }
/* A legal statement, not a short option: read like the fine print beside it, box on the first line. */
.check--consent { align-items: flex-start; font-weight: 400; font-size: 0.875rem; max-inline-size: 70ch; margin-block: var(--space-3); }
.check--consent input { margin-block-start: 0.2em; flex: none; }
.consent__more { margin-block-end: var(--space-3); max-inline-size: 70ch; }
.consent__more summary { cursor: pointer; font-size: 0.875rem; font-weight: 600; inline-size: fit-content; }

/* Form fields side by side: six tracks, a field takes half, .field--s a third. One column on a phone. */
.fieldgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-4); margin-block-end: var(--space-4); }
.fieldgrid > .field { grid-column: span 3; margin: 0; }
.fieldgrid > .field--s { grid-column: span 2; }
.fieldgrid .input { inline-size: 100%; max-inline-size: none; }
.input[readonly] { color: var(--text-2); }
@media (max-width: 40rem) { .fieldgrid > .field, .fieldgrid > .field--s { grid-column: 1 / -1; } }

.input {
  inline-size: 100%;
  max-inline-size: 26rem;
  min-block-size: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
textarea.input { min-block-size: 5.5rem; padding-block: 0.625rem; font-family: var(--mono); font-size: 0.875rem; max-inline-size: none; resize: vertical; }
select.input { max-inline-size: none; }

.choice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) 0; cursor: pointer; }
.choice__text { display: flex; flex-direction: column; }
.choice__label { font-weight: 600; }
.choice__note { color: var(--text-2); font-size: 0.875rem; }

.inline-form { display: inline-flex; }

/* Orange means "something needs attention" and nothing else; a plain status is neutral. Both
   are boxed like everything else. */
.inline-alert {
  background: var(--warn-bg);
  color: var(--text);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-block-end: var(--space-5);
  max-inline-size: 70ch;
}
.inline-alert[role="status"] { background: var(--surface-2); border-color: var(--border); }

/* The one thing on a screen that needs attention (an overdue invoice, a failed action). */
.callout {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  background: var(--bad-bg);
  border: 1px solid var(--bad);
  border-inline-start-width: 3px;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-block: var(--space-4);
  color: var(--text);
}
.callout__mark { color: var(--bad); font-weight: 700; flex-shrink: 0; }

.idlist { display: flex; flex-direction: column; gap: var(--space-1); }

.keyvalue {
  font-family: var(--mono);
  font-size: 0.875rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  overflow-wrap: anywhere;
  user-select: all;
  margin-block: var(--space-3);
}

.link-out { font-weight: 600; }

/* ---------- tables ------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  /* The containing block for the .visually-hidden spans in header cells. Without it they
     sit at their static position in a sideways-scrolled table and stretch the DOCUMENT's
     scroll width: a whole page that scrolls sideways on a phone for no visible reason. */
  position: relative;
  margin-block: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--lift);
}

.tbl { inline-size: 100%; border-collapse: collapse; }
.tbl th, .tbl td {
  padding: 0.8125rem 1.125rem;
  border-block-end: 1px solid var(--divider);
  text-align: left;
  vertical-align: top;
}
/* After the rule above, which would otherwise win over the generic .num (docs/ux.md §12). */
.tbl .num { text-align: right; }
.tbl thead th {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 600;
  border-block-end-color: var(--border-strong);
}
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-block-end: 0; }
.tbl tbody tr { transition: background-color 100ms ease; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.is-voided:hover { background: transparent; }
.tbl tfoot th, .tbl tfoot td { font-weight: 700; border-block-end: 0; }
.tbl th[scope="row"] { font-weight: 600; }
tr.is-voided { color: var(--text-2); }
tr.is-voided .num { text-decoration: line-through; }

.cell-action { text-align: right; }
.tbl .cell-action { white-space: nowrap; }
.tbl .cell-action .fine { margin: 0; }
/* A timestamp is one atom; wrapped it triples the row's height. */
.cell-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Key ids have no natural break point; the table scrolls sideways instead. */
.tbl th[scope="row"].mono { white-space: nowrap; }
.rate { color: var(--text-2); }
.pdf { white-space: nowrap; }

/* Code the reader copies (the API docs): a quiet block that scrolls sideways, never wraps. */
.codeblock {
  margin: var(--space-2) 0 var(--space-3);
  padding: 0.875rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre;
}
.codeblock code { font: inherit; }

/* One-line tables (invoices): centre each row on its tallest cell. */
.tbl--rows th, .tbl--rows td { vertical-align: middle; }
.tbl--rows .cell-action { text-align: right; }
.cell-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-4); }

/* Status: a dot and a word. The word carries the meaning (WCAG 1.4.1); the dot is the glance. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.status::before { content: ""; inline-size: 0.4375rem; block-size: 0.4375rem; border-radius: 50%; background: var(--text-2); flex-shrink: 0; }
.status--paid, .status--running { color: var(--text); }
.status--paid::before, .status--running::before { background: var(--good); }
.status--overdue, .status--failed { color: var(--bad); }
.status--overdue::before, .status--failed::before { background: var(--bad); }
.status--awaiting, .status--pending { color: var(--warn); }
.status--awaiting::before, .status--pending::before { background: var(--warn); }
.status--voided, .status--stopped { color: var(--text-2); }

.is-off { color: var(--text-2); }

/* A person in a table: name, then login in mono, and a small tag for "You". */
.person { display: flex; flex-direction: column; line-height: 1.3; min-inline-size: 0; }
.person__name { font-weight: 600; display: inline-flex; align-items: center; gap: var(--space-2); }
.person__login { color: var(--text-2); font-size: 0.875rem; }
.tag { display: inline-block; padding: 0.0625rem 0.5rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); font-size: 0.875rem; font-weight: 700; line-height: 1.4; }

/* ---------- usage ------------------------------------------------------- */

.hero {
  margin-block: var(--space-4) var(--space-5);
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift);
}
.hero__amount {
  font-size: clamp(2rem, 4vw, 2.875rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero__note { color: var(--text-2); }
.hero__lines { margin-block-start: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.hero__line { display: flex; justify-content: space-between; max-inline-size: 22rem; }
.hero__line dt { color: var(--text-2); }
.hero__line dd { font-family: var(--mono); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.hero__line--total { font-weight: 700; border-block-start: 1px solid var(--divider); padding-block-start: var(--space-1); }

/* The spend chart: its own plot area, scale and units, so it gets a ground and an edge.
   Geometry arrives as SVG attributes from the view model, never as a style attribute. */
.chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift);
  padding: var(--space-4) 1.25rem 1.25rem;
  margin-block-end: var(--space-5);
  max-inline-size: 46rem;
}
.chart__head { display: flex; align-items: baseline; gap: var(--space-3); margin-block-end: var(--space-3); }
.chart__head h2 { font-size: 0.875rem; font-weight: 700; margin: 0; }
.chart__peak { font-size: 0.875rem; color: var(--text-2); margin: 0 0 0 auto; }
.chart__peak b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.plot { overflow-x: auto; }
.plot svg { display: block; inline-size: 100%; min-inline-size: 28rem; block-size: auto; }
.chart__bar { fill: var(--series); }
.chart__bar--peak { fill: var(--text); }
.chart__grid { stroke: var(--divider); stroke-width: 1; }
.chart__ylab, .chart__xlab { fill: var(--text-2); font-family: var(--font); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart__ylab { text-anchor: end; }
.chart__xlab { text-anchor: middle; }
.chart__xlab--dim { opacity: 0.55; }

/* Input/output share bar. */
.bar {
  display: flex;
  block-size: 0.625rem;
  gap: 4px;
  margin-block: var(--space-5) var(--space-2);
  max-inline-size: 28rem;
}
.bar > * { border-radius: 999px; }
.bar__seg--in { background: var(--seg-0); }
.bar__seg--out { background: var(--seg-1); }
.bar__legend { display: flex; gap: var(--space-4); color: var(--text-2); font-size: 0.875rem; }
.key { display: inline-block; inline-size: 0.625rem; block-size: 0.625rem; border-radius: 50%; margin-inline-end: var(--space-1); }
.key--in { background: var(--seg-0); }
.key--out { background: var(--seg-1); }

.share-0   { inline-size: 0%; }    .share-5   { inline-size: 5%; }
.share-10  { inline-size: 10%; }   .share-15  { inline-size: 15%; }
.share-20  { inline-size: 20%; }   .share-25  { inline-size: 25%; }
.share-30  { inline-size: 30%; }   .share-35  { inline-size: 35%; }
.share-40  { inline-size: 40%; }   .share-45  { inline-size: 45%; }
.share-50  { inline-size: 50%; }   .share-55  { inline-size: 55%; }
.share-60  { inline-size: 60%; }   .share-65  { inline-size: 65%; }
.share-70  { inline-size: 70%; }   .share-75  { inline-size: 75%; }
.share-80  { inline-size: 80%; }   .share-85  { inline-size: 85%; }
.share-90  { inline-size: 90%; }   .share-95  { inline-size: 95%; }
.share-100 { inline-size: 100%; }

/* ---------- console: overview and compute --------------------------------- */

/* Document plus a 22.5rem aside (spend, summary). Stacks below 72rem. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22.5rem;
  gap: 1.625rem;
  align-items: start;
}
.split__main, .split__aside { display: flex; flex-direction: column; gap: var(--space-5); min-inline-size: 0; }
.split__aside { position: sticky; top: var(--space-4); }
@media (max-width: 72rem) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split__aside { position: static; }
}

/* A big rounded surface: the spend card, the summary, the add list. */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--lift);
}
.card__label { color: var(--text-2); font-weight: 600; }
.card__total { font-size: 2.875rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.card__fine { color: var(--text-2); font-size: 0.875rem; }
.card .h2 { margin: 0; }

/* Resources as rows of cards: state, icon, name and kind, spec, rate, age. */
.rows { display: flex; flex-direction: column; gap: 1rem; list-style: none; margin: 0 0 1.5rem; padding: 0; }
.rowcard {
  display: grid;
  grid-template-columns: 0.625rem 1.375rem minmax(0, 1.2fr) minmax(0, 1.4fr) 8rem 7.5rem;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  color: var(--text);
}
a.rowcard:hover { text-decoration: none; border-color: var(--border-strong); }
.rowcard.is-stopped { color: var(--text-2); }
.rowcard__icon { inline-size: 1.25rem; block-size: 1.25rem; color: currentColor; }
.rowcard__name { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.rowcard__name b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowcard__name span, .rowcard__age { color: var(--text-2); font-size: 0.875rem; }
.rowcard__spec { display: flex; flex-direction: column; gap: 2px; }
.rowcard__spec span { color: var(--text-2); font-size: 0.875rem; }
.rowcard__rate { font-family: var(--mono); font-size: 0.875rem; }
.rowcard__age { text-align: right; }
.rowcard__actions { grid-column: 3 / -1; display: flex; gap: var(--space-2); justify-content: flex-end; }
@media (max-width: 56rem) {
  .rowcard { grid-template-columns: 0.625rem 1.375rem minmax(0, 1fr); }
  .rowcard__spec, .rowcard__rate, .rowcard__age { grid-column: 3; text-align: left; }
}

/* Things you act on (keys, people, clients, customers): one row each, the action at the end. */
.rowcard--entity { grid-template-columns: 0.625rem 1.375rem minmax(0, 1.3fr) minmax(0, 1fr) 13rem minmax(6rem, auto); }
.rowcard--entity .rowcard__actions { grid-column: auto; }
.rowcard__name .mono { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowcard__status { display: flex; flex-direction: column; gap: 2px; font-size: 0.875rem; }
.rowcard__status span { color: var(--text-2); }
.rowcard__actions .fine { margin: 0; text-align: right; }
@media (max-width: 56rem) {
  .rowcard--entity { grid-template-columns: 0.625rem 1.375rem minmax(0, 1fr); }
  .rowcard--entity > :nth-child(n+4) { grid-column: 3; }
  .rowcard--entity .rowcard__actions { justify-content: flex-start; }
  .rowcard__actions .fine { text-align: left; }
}

/* The state dot: mint with a soft ring when running, hollow when stopped. */
.dot { inline-size: 0.625rem; block-size: 0.625rem; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--border-strong); }
.dot--running { background: var(--good); border: 0; box-shadow: 0 0 0 3px var(--ring-good); }
.dot--pending { background: var(--warn); border: 0; }
.dot--failed { background: var(--bad); border: 0; }

/* Empty state for a list with nothing in it yet. */
.empty {
  display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start;
  padding: 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-2);
}
.empty b { color: var(--text); font-weight: 700; }

/* Spend: a segmented bar and its legend. */
.spendbar { display: flex; gap: 4px; block-size: 0.625rem; }
.spendbar__seg { min-inline-size: 6px; border-radius: 999px; }
.seg-0 { background: var(--seg-0); } .seg-1 { background: var(--seg-1); }
.seg-2 { background: var(--seg-2); } .seg-3 { background: var(--seg-3); }
.legend { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; }
.legend__row { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 0.875rem; }
.legend__row dt { display: flex; align-items: center; gap: var(--space-2); color: var(--text-2); }
.legend__row dt::before { content: ""; inline-size: 0.625rem; block-size: 0.625rem; border-radius: 50%; background: var(--swatch, var(--text-2)); }
.swatch-0 { --swatch: var(--seg-0); } .swatch-1 { --swatch: var(--seg-1); }
.swatch-2 { --swatch: var(--seg-2); } .swatch-3 { --swatch: var(--seg-3); }
.legend__row dd { font-family: var(--mono); font-size: 0.875rem; }

/* "Add to <project>": one link per thing you can create. */
.addlist { display: flex; flex-direction: column; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.additem {
  display: grid;
  grid-template-columns: 1.375rem minmax(0, 1fr) 1.125rem;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
}
.additem:hover { text-decoration: none; background: var(--surface-2); }
.additem svg { inline-size: 1.25rem; block-size: 1.25rem; }
.additem__arrow { color: var(--text-2); }
.additem__text { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.additem__text b { font-weight: 700; }
.additem__text span { color: var(--text-2); font-size: 0.875rem; }

/* Radio cards. The input is visually hidden and the card is its label, so the whole card is
   the target and :has(:checked) draws the selection — no script. */
.picks { display: grid; gap: 0.625rem; border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.picks--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.picks--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 48rem) { .picks--2, .picks--3 { grid-template-columns: minmax(0, 1fr); } }
.pick {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.pick:hover { border-color: var(--border-strong); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick__ring { inline-size: 1.25rem; block-size: 1.25rem; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; }
.pick__text { display: flex; flex-direction: column; gap: 3px; min-inline-size: 0; }
.pick__text b { font-weight: 700; }
.pick__text span { color: var(--text-2); font-size: 0.875rem; }
.pick__aside { display: flex; align-items: center; gap: var(--space-2); font-family: var(--mono); font-size: 0.875rem; color: var(--text-2); white-space: nowrap; }
.pick:has(input:checked) { border: 1.5px solid var(--link); background: var(--accent-soft); }
.pick:has(input:checked) .pick__ring { border: 2px solid var(--link); }
.pick:has(input:checked) .pick__ring::after { content: ""; inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%; background: var(--link); }
.pick:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.avail { inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%; background: var(--good); }
.avail--low { background: var(--warn); }
.avail--none { background: var(--text-2); }

/* Count chips (1, 2, 4, 8): radio buttons styled as pills. */
.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); border: 0; margin: 0; padding: 0; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-block;
  min-inline-size: 3.25rem;
  text-align: center;
  padding: 0.5625rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}
.pill:has(input:checked) span { background: var(--link); border-color: var(--link); color: var(--surface); font-weight: 700; }
.pill:has(input:focus-visible) span { outline: 2px solid var(--focus); outline-offset: 2px; }

.formsec { display: flex; flex-direction: column; gap: 0.625rem; margin: 0 0 1.25rem; border: 0; padding: 0; min-inline-size: 0; }
.formsec > legend, .formsec > .h2 { padding: 0; margin-block-end: 0.625rem; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; }

/* Summary key/value rows in the aside. */
.kv { display: flex; flex-direction: column; gap: 0.625rem; margin: 0; }
.kv__row { display: flex; justify-content: space-between; gap: var(--space-3); }
.kv__row dt { color: var(--text-2); }
.kv__row dd { font-family: var(--mono); font-size: 0.875rem; text-align: right; }
.card__rule { block-size: 1px; background: var(--divider); border: 0; margin: 0; }
.card__price { display: flex; align-items: baseline; justify-content: space-between; }
.card__price span { color: var(--text-2); }
.card__price b { font-size: 2.125rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- org picker, pager, portal ------------------------------------ */

.orglist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.orgrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: var(--space-4) var(--space-5);
}
.orgrow__text { display: flex; flex-direction: column; min-width: 0; }
.orgrow__name { font-weight: 700; }
.orgrow__domain { color: var(--text-2); font-size: 0.875rem; }
.orgrow__state { margin-inline-start: auto; }

.pager { display: flex; gap: var(--space-3); margin-block-start: var(--space-4); }
.pager__link {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.25rem;
  padding: 0 var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
}
.pager__link:hover { background: var(--surface-2); text-decoration: none; }

.portal { margin-block-start: var(--space-4); }

/* ---------- theme toggle -------------------------------------------------- */

/* Three buttons in one form; which is pressed comes from the attribute render() stamps on
   <html>, so neither template nor view model needs to know the theme. */
.theme { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); }
.theme__btn { display: inline-flex; align-items: center; justify-content: center; inline-size: 1.75rem; block-size: 1.5rem; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; }
.theme__btn svg { inline-size: 0.875rem; block-size: 0.875rem; }
.theme__btn:hover { color: var(--text); }
:root:not([data-theme]) .theme__btn[value="light"],
:root[data-theme="light"] .theme__btn[value="light"],
:root[data-theme="dark"] .theme__btn[value="dark"] { background: var(--surface-2); color: var(--text); }
.side__foot .theme { align-self: flex-start; }

/* ---------- plain-shell chrome (door, notices, signup) ------------------- */

.site { border-block-end: 1px solid var(--divider); }
.site__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-block-size: 3.75rem;
  padding-block: var(--space-2);
}
.ident { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.ident--bare { justify-content: flex-end; width: 100%; }
.ident__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

.site-foot { border-block-start: 1px solid var(--divider); padding-block: var(--space-5); color: var(--text-2); font-size: 0.875rem; }
.site-foot__line { display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; }
.site-foot a { color: var(--text-2); }
.site-foot a:hover { color: var(--text); }
.sep { color: var(--border-strong); }

.flash {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-4);
  margin-block-end: var(--space-5);
}
.flash__mark { color: var(--good); margin-inline-end: var(--space-1); }

/* ---------- onboarding --------------------------------------------------- */

/* The one SETUP flow, inverted from the dense console: space, one large question, one
   obvious action. No motion beyond focus, and no script (the CSP has no script-src). */
.onboard {
  max-inline-size: 30rem;
  margin-inline: auto;
  /* Optically centred: a form at exact centre reads as slightly low. */
  padding-block: clamp(var(--space-6), 12vh, 7rem) var(--space-7);
  text-align: center;
}
.stepper { list-style: none; display: flex; justify-content: center; gap: var(--space-2); margin: 0 0 var(--space-6); padding: 0; }
.stepper__step { display: block; }
.stepper__dot {
  display: block;
  inline-size: 0.4375rem;
  block-size: 0.4375rem;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background-color 160ms ease, transform 160ms ease;
}
.stepper__step.is-current .stepper__dot { background: var(--link); transform: scale(1.35); }
.stepper__step.is-done .stepper__dot { background: var(--text-2); }
.onboard__q {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.875rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.onboard__sub { margin: 0 auto var(--space-6); max-inline-size: 26rem; color: var(--text-2); font-size: 0.9375rem; line-height: 1.55; text-wrap: pretty; }
.onboard__field { margin: 0 0 var(--space-4); border: 0; padding: 0; }
.onboard .input {
  max-inline-size: none;
  min-block-size: 3.125rem;
  padding: 0 var(--space-4);
  border-radius: 14px;
  font-size: 1.0625rem;
  text-align: center;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.onboard .input::placeholder { color: var(--text-2); opacity: 0.65; }
/* A ring rather than an outline so the 14px radius is followed exactly. */
.onboard .input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.onboard .btn--primary { inline-size: 100%; min-block-size: 3.125rem; font-size: 1rem; }
.onboard__foot { margin-block-start: var(--space-6); padding-block-start: var(--space-4); border-block-start: 1px solid var(--divider); color: var(--text-2); font-size: 0.875rem; }
.onboard__foot .btn--quiet { font-size: inherit; min-block-size: auto; padding: 0 var(--space-1); }
/* The done mark: two borders and a rotation, no asset. */
.onboard__mark { inline-size: 3.25rem; block-size: 3.25rem; margin: 0 auto var(--space-5); border-radius: 50%; background: var(--good-bg); position: relative; }
.onboard__mark::after {
  content: "";
  position: absolute;
  inset-block-start: 1.0625rem;
  inset-inline-start: 1.1875rem;
  inline-size: 0.6875rem;
  block-size: 1.1875rem;
  border-inline-end: 2.5px solid var(--good);
  border-block-end: 2.5px solid var(--good);
  transform: rotate(45deg);
}
.onboard .inline-alert { text-align: start; }

/* ---------- responsive -------------------------------------------------- */

/* Narrow: the sidebar becomes a top card with the navigation as a horizontally scrolling
   row. No script, so no drawer. */
@media (max-width: 48rem) {
  body.shell, body.shell--meta { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: static;
    block-size: auto;
    margin: 0;
    border-inline-end: 0;
    border-block-end: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    overflow: visible;
  }
  .org { flex: 1 1 12rem; }
  .nav { flex-direction: row; flex: 1 0 100%; overflow-x: auto; gap: var(--space-1); order: 3; }
  .nav__group { flex-direction: row; }
  .nav__heading { display: none; }
  .nav__item { padding: var(--space-2) var(--space-3); }
  .side__foot { display: none; }
  .shell .main { padding: var(--space-4) var(--space-4) var(--space-6); }
  .head { flex-direction: column; }
  .kpis { flex-direction: column; }
}

@media (max-width: 480px) {
  .wrap { padding-inline: var(--space-4); }
  .site__bar { flex-wrap: wrap; }
  .ident { flex-wrap: wrap; }
  .hero__amount { font-size: 2.125rem; }
  .actions, .footactions { flex-direction: column; align-items: stretch; }
  .btn--wide { inline-size: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- the comic kit ------------------------------------------------ */

/* The ETHUX layer over the components above: 3px ink edges, hard offset shadows, square
   corners, Unbounded headings, buttons that press down, the console's cobalt rail. Kept as
   one block at the end so the system reads in one place (ethux-brand skill). */

.page-h1, .h2, .hero__h, .card__total, .kpi__value, .hero__amount, .brand__word {
  font-family: var(--display);
  letter-spacing: -0.045em;
  font-weight: 900;
}
.page-h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.02; }
.h2 { font-size: 1.25rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.03em; }
.h3 { font-weight: 800; }
.mono, code, .crumb, .nav__heading, .meta__h, .tbl thead th, .kpi__label, .card__label, .tag {
  font-family: var(--mono);
  font-stretch: 87.5%;
}
.nav__heading, .meta__h, .tbl thead th, .kpi__label, .card__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
.nav__item, .brand, .org, .additem, .btn, .rowcard, .orgrow { text-decoration: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 0; }

/* Surfaces: every box is an ink-edged panel with a hard shadow. */
.panel, .sub, .card, .kpis, .chart, .hero, .callout, .empty, .table-wrap, .rows {
  border: var(--rule) solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: var(--pop-sm);
  background: var(--surface);
}
.panel .table-wrap, .sub .table-wrap, .panel .rows, .sub .rows { border: 0 !important; box-shadow: none; }

/* Buttons: ink primary, paper secondary, both press down. */
.btn {
  border: var(--rule) solid var(--border);
  border-radius: 0;
  box-shadow: var(--pop-sm);
  font-weight: 800;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); text-decoration: none; }
.btn:active { transform: translate(4px, 4px); box-shadow: none; }
.btn--primary { background: var(--accent-ground); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-ground); }
.btn--quiet { background: var(--surface); color: var(--text); }
.btn--sm { box-shadow: 2px 2px 0 var(--shadow); }

.input { border: var(--rule) solid var(--border); border-radius: 0; }

/* Tables: ink rules between rows, a stone header band. */
.tbl thead th { background: var(--surface-2); border-bottom: var(--rule) solid var(--border); }
.tbl th, .tbl td { border-bottom: 2px solid var(--divider); }
.tbl tbody tr:hover { background: var(--surface-2); }

/* Rows you act on: one list, ink rules between rows, no rounded cards. */
.rows { gap: 0 !important; }
.rowcard { border: 0 !important; border-bottom: 2px solid var(--divider) !important; border-radius: 0 !important; box-shadow: none !important; background: transparent; }
.rows > :last-child .rowcard, .rows > .rowcard:last-child { border-bottom: 0 !important; }

/* KPI tiles and the spend card: the money that matters gets the orange field. */
.kpis { gap: 0; }
.card--spend, .split__aside .card:first-child { background: var(--orange); color: #111111; }
.card--spend .card__label, .card--spend .card__fine,
.split__aside .card:first-child .card__label, .split__aside .card:first-child .card__fine { color: #111111; }

/* Status: the word carries it; running is green with the word. */
.status--paid, .status--running { color: var(--good); font-weight: 700; }
.dot--running { background: var(--good); box-shadow: none; }

/* ---------- the cobalt rail ---------- */
.side {
  background: var(--field);
  color: var(--field-ink);
  border-right: var(--rule) solid var(--border);
}
.side a, .side .nav__item, .side .brand, .side .org, .side__foot, .side__foot a, .side .build, .side__who { color: var(--field-ink); }
.side .nav__heading { color: var(--field-ink); opacity: .82; }
.brand__mark { display: none; }   /* the wordmark stands alone */
.brand__word { font-size: 1.375rem; text-transform: uppercase; }
.side .org { background: transparent; border: var(--rule) solid var(--field-ink); border-radius: 0; }
.side .chip { display: none; }
.nav__item { border: var(--rule) solid transparent; border-radius: 0; font-weight: 700; }
.nav__item:hover { background: rgb(255 255 255 / 0.12); text-decoration: none; }
.nav__item.is-current, .nav__item.is-current:hover {
  background: var(--current-bg);
  color: var(--current-ink);
  border-color: var(--rail-line);
  box-shadow: 3px 3px 0 var(--rail-line);
}
.nav__item.is-current svg { color: var(--current-ink); }
.side__foot { border-top: var(--rule) solid var(--rail-line); }
.side .btn--quiet { background: var(--surface); color: var(--text); }
.rail-toggle { color: var(--field-ink); }

/* The meta rail on the right stays paper. */
.meta { background: var(--surface); border-left: var(--rule) solid var(--border); }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- the account menu ---------- */
.topline { display: flex; justify-content: flex-end; margin-block-end: var(--space-5); }
.acct { position: relative; }
.acct__btn {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 6px 14px 6px 6px; background: var(--surface); color: var(--text);
  border: var(--rule) solid var(--border); box-shadow: var(--pop-sm);
}
.acct__btn::-webkit-details-marker { display: none; }
.acct[open] > .acct__btn { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.acct__sq { inline-size: 38px; block-size: 38px; display: grid; place-items: center; background: var(--orange); color: #111111; border: var(--rule) solid var(--border); }
.acct__sq svg { inline-size: 20px; block-size: 20px; }
.acct__txt { display: grid; line-height: 1.25; text-align: left; }
.acct__txt b { font-weight: 800; }
.acct__txt span { font-family: var(--mono); font-stretch: 87.5%; font-size: 0.8125rem; color: var(--text-2); }
.acct__caret { inline-size: 16px; block-size: 16px; }
.acct__menu {
  position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 14px); z-index: 20;
  inline-size: min(22rem, 90vw); background: var(--surface);
  border: var(--rule) solid var(--border); box-shadow: var(--pop);
}
.acct__sec { padding: 8px 0; border-bottom: var(--rule) solid var(--border); display: grid; }
.acct__sec:last-child { border-bottom: 0; padding: 0; }
.acct__h { padding: 10px 18px 6px; font: 700 0.75rem/1 var(--mono); font-stretch: 87.5%; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.acct__item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; inline-size: 100%;
  padding: 11px 18px; background: none; border: 0; font: inherit; font-weight: 700; color: var(--text);
  text-align: left; text-decoration: none; cursor: pointer;
}
.acct__item small { font: 500 0.75rem/1.2 var(--mono); font-stretch: 87.5%; color: var(--text-2); }
.acct__item:hover { background: var(--surface-2); text-decoration: none; }
.acct__item[aria-current="true"] { background: var(--surface-2); }
.acct__item--static { cursor: default; }
.acct__item--static:hover { background: none; }
.acct__out { background: var(--accent-ground); color: var(--accent-ink); padding-block: 14px; }
.acct__out:hover { background: var(--accent-ground); }
.acct form { margin: 0; }

/* Rail icons follow the label's colour; on cobalt they are white, on the current item ink. */
.side .nav__item svg { color: currentColor; }

/* "Add to …": ink-edged rows that press down, like buttons. */
.addlist { gap: 12px; }
.additem {
  border-radius: 0; background: var(--surface); border: var(--rule) solid var(--border);
  box-shadow: var(--pop-sm); transition: transform .08s, box-shadow .08s;
}
.additem:hover { background: var(--surface); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.additem__arrow { color: var(--text); }
/* Done steps stay links at full contrast; the struck title carries the state. */
.additem.is-done b { text-decoration: line-through; }
.setup { margin-block-end: 1.625rem; }
@media (prefers-reduced-motion: reduce) { .additem { transition: none; } }

/* ---------- the door, in the comic system ---------- */
/* The door page draws its own wordmark; the plain top bar would repeat it. */
.plain:has(.door) .site, .plain:has(.door) .site-foot { display: none; }
.plain:has(.door) .main { padding: 0; max-inline-size: none; display: block; }
.door {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-block-size: 100dvh;
  align-items: stretch; margin: 0; max-inline-size: none; color: var(--text);
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; max-inline-size: none; gap: 0;
}
.door__side { background: var(--surface); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; gap: 40px; border-right: var(--rule) solid var(--border); }
.door__word { font: 900 1.5rem/1 var(--display); letter-spacing: -0.045em; }
.door__text { margin-block: auto; display: grid; gap: 20px; max-inline-size: 28rem; }
.door .page-h1 { color: var(--text); font-size: clamp(2.4rem, 4vw, 3.2rem); margin: 0; }
.door .lede { color: var(--text-2); font-size: 1.0625rem; margin: 0; }
.door__form { margin: 0; }
.door .btn { min-block-size: 3.25rem; padding-inline: 24px; font-size: 1.0625rem; }
.door__alt { color: var(--text-2); font-size: 0.9375rem; margin: 0; }
.door__foot { color: var(--text-2); font-size: 0.9375rem; margin: 0; }
.door__field {
  background: var(--door-field); color: #111111; padding: clamp(28px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: center; gap: 40px; position: relative; isolation: isolate;
}
.door__field::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgb(17 17 17 / 0.2) 1.4px, transparent 1.6px); background-size: 9px 9px;
  mask-image: linear-gradient(115deg, transparent 35%, #000 100%);
}
.door__claim { font: 900 clamp(2.4rem, 5vw, 4.4rem)/0.92 var(--display); letter-spacing: -0.055em; margin: 0; max-inline-size: 12ch; }
.door__promises { list-style: none; margin: 0; padding: 0; background: #ffffff; border: 3px solid #111111; box-shadow: 4px 4px 0 #111111; max-inline-size: 30rem; }
.door__promises li { display: flex; align-items: center; gap: 18px; padding: 18px 22px; font-weight: 700; border-bottom: 2px solid #111111; }
.door__promises li:last-child { border-bottom: 0; }
.door__ic { inline-size: 44px; block-size: 44px; flex: none; display: grid; place-items: center; border: 3px solid #111111; background: #ffffff; box-shadow: 3px 3px 0 #111111; }
.door__ic svg { inline-size: 22px; block-size: 22px; }
.door__fine { margin: 0; font-weight: 600; font-size: 0.9375rem; }
@media (max-width: 52rem) {
  .door { grid-template-columns: minmax(0, 1fr); }
  .door__side { border-right: 0; border-bottom: var(--rule) solid var(--border); }
}

/* On an orange money card everything is ink: grey text fails contrast on orange. */
.split__aside .card:first-child, .split__aside .card:first-child * { color: #111111; }
.split__aside .card:first-child .btn--primary, .split__aside .card:first-child .btn--primary * { color: #ffffff; }
.split__aside .card:first-child .btn--quiet { background: #ffffff; }
.split__aside .card:first-child .rule, .split__aside .card:first-child hr { border-color: #111111; }

/* Option cards and count chips: ink-edged and square; the chosen one presses forward. */
.pick { border: var(--rule) solid var(--border); border-radius: 0; background: var(--surface); }
.pick:has(input:checked) { border: var(--rule) solid var(--border); background: var(--surface); box-shadow: var(--pop-sm); }
.pick:has(input:checked) .pick__ring { border-color: var(--text); }
.pick:has(input:checked) .pick__ring::after { background: var(--text); }
.pill span { border: var(--rule) solid var(--border); border-radius: 0; }
.pill:has(input:checked) span { background: var(--accent-ground); border-color: var(--border); color: var(--accent-ink); box-shadow: var(--pop-sm); }

/* ---------- models: a row per model, like a model hub ---------- */
.endpoint { display: flex; flex-wrap: wrap; margin: 0 0 var(--space-6); border: var(--rule) solid var(--border); box-shadow: var(--pop-sm); background: var(--surface); }
.endpoint__k { background: var(--accent-ground); color: var(--accent-ink); padding: 14px 20px; font: 700 0.8125rem/1.2 var(--mono); font-stretch: 87.5%; letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: center; }
.endpoint__v { padding: 14px 20px; font: 700 1rem/1.2 var(--mono); font-stretch: 87.5%; overflow-wrap: anywhere; min-width: 0; flex: 1 1 14rem; align-self: center; }
.mlist { border: var(--rule) solid var(--border); box-shadow: var(--pop); background: var(--surface); margin-block-end: var(--space-6); }
.mlist__rows { list-style: none; margin: 0; padding: 0; }
.mrow {
  display: grid; grid-template-columns: 48px minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: center;
  gap: 24px; padding: 24px 28px; border-bottom: 2px solid var(--divider);
}
.mrow__ic { inline-size: 48px; block-size: 48px; display: grid; place-items: center; border: var(--rule) solid var(--border); background: var(--surface); box-shadow: 3px 3px 0 var(--shadow); color: var(--text); }
.mrow__ic svg { inline-size: 24px; block-size: 24px; }
.mrow__ic--none { visibility: hidden; }
.mrow__id { font: 700 1.0625rem/1.3 var(--mono); font-stretch: 87.5%; overflow-wrap: anywhere; }
.mrow__about { margin: 4px 0 0; color: var(--text-2); }
.mrow__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.mrow__tags .tag { border: 2px solid var(--border); border-radius: 0; color: var(--text); background: var(--surface); padding: 3px 10px; font: 700 0.8125rem/1.3 var(--mono); font-stretch: 87.5%; }
.mrow__try { font-weight: 800; text-decoration: none; white-space: nowrap; padding: 8px 4px; }
.mrow__try:hover { text-decoration: underline; }
/* A model's own prices, opened from its row; spans the whole row under the name. */
.mrow__prices { grid-column: 2 / -1; }
.mrow__prices summary { cursor: pointer; font-weight: 800; inline-size: fit-content; }
.mrow__prices dl { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 12px 0 4px; }
.mrow__prices dl div { display: flex; gap: 10px; align-items: baseline; }
.mrow__prices dt { color: var(--text-2); }
.mrow__prices dd { margin: 0; font: 700 0.9375rem/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.mlist__fine { font-weight: 500; }
@media (max-width: 48rem) {
  .mrow { grid-template-columns: 48px minmax(0, 1fr); gap: 14px 18px; padding: 20px; }
  .mrow__tags, .mrow__try { grid-column: 2; }
  .mrow__try { justify-self: start; padding-inline: 0; }
}

/* ---------- getting started and the phone menu ---------- */
.setup .addlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 48rem) { .setup .addlist { grid-template-columns: minmax(0, 1fr); } }
/* Rate and age are short; fixed widths for them squeezed the name and spec into slivers. */
@media (min-width: 56.0625rem) {
  .rowcard:not(.rowcard--entity) { grid-template-columns: 0.625rem 1.375rem minmax(8rem, 1fr) minmax(0, 1.4fr) auto auto; }
}
/* The phone menu: a label driving a checkbox in base.html, like the rail. Hidden on wider
   screens, where the rail shows the whole navigation. */
/* display:none off phones takes it out of the Tab order and the accessibility tree. */
.navstate { display: none; }
.menu-toggle { display: none; }
@media (max-width: 48rem) {
  .navstate { display: block; position: absolute; opacity: 0; pointer-events: none; }
  .rail-toggle { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; padding: var(--space-2) var(--space-3); cursor: pointer;
    font-weight: 800; color: var(--text); background: var(--surface); border: var(--rule) solid var(--border); box-shadow: var(--pop-sm);
  }
  .navstate:focus-visible ~ .side .menu-toggle { outline: 2px solid var(--focus); outline-offset: 2px; }
  .nav { display: none; }
  body:has(.navstate:checked) .nav { display: flex; flex-direction: column; overflow: visible; }
  body:has(.navstate:checked) .nav__group { flex-direction: column; }
  .topline { justify-content: stretch; margin-block-end: var(--space-3); }
  .card, .sub { padding: var(--space-4); }
  /* Steps as one-line rows with dividers: four boxed cards filled the whole first screen. */
  .setup .addlist { gap: 0; }
  .setup .additem { border: 0; border-block-end: 2px solid var(--divider); box-shadow: none; padding: var(--space-3) 0; }
  .setup li:last-child .additem { border-block-end: 0; }
  .setup .additem__text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Usage grouped per model: the model heads its own rows. */
.tbl .grp th, .tbl .grp td { font-weight: 800; padding-block-start: var(--space-4); }
/* Usage on phones: four columns do not fit 390px. The rate column goes and each rate sits
   under its token count instead; amounts never wrap. */
.rate-inline { display: none; }
@media (max-width: 48rem) {
  .charge .tbl .rate { display: none; }
  .charge .tbl .rate-inline { display: block; font-size: 0.8125rem; color: var(--text-2); font-weight: 500; }
  .charge .tbl .num { white-space: nowrap; }
}
/* Usage per model on desktop: a tinted band names the model, its token rows sit indented
   and light under it, and the total is set off by a full rule. */
.charge .tbl .grp th, .charge .tbl .grp td { background: var(--surface-2); border-block-start: var(--rule) solid var(--border); padding-block: var(--space-3); }
.charge .tbl thead + tbody .grp th, .charge .tbl thead + tbody .grp td { border-block-start: 0; }
.charge .tbl .grp th { font: 700 0.9375rem/1.3 var(--mono); font-stretch: 87.5%; }
.charge .tbl .grp ~ tr th[scope="row"] { font-weight: 500; padding-inline-start: 2rem; }
.charge .tbl .grp ~ tr th, .charge .tbl .grp ~ tr td { border-bottom-width: 1px; }
.charge .tbl td.rate { color: var(--text-2); }
.charge .tbl tfoot th, .charge .tbl tfoot td { border-block-start: var(--rule) solid var(--border); }
@media (max-width: 48rem) { .charge .tbl .grp ~ tr th[scope="row"] { padding-inline-start: 1rem; } }
