/* css/tokens.css */
/* HostingOS design tokens — "infrastructure grade, technical-editorial".
 *
 * Layer order is declared once here; every other stylesheet puts its rules
 * into one of these layers, so specificity never depends on file order.
 *
 * Colour model: a warm-neutral ink/paper scale carries the UI (primary
 * actions are ink, not brand). The tenant colour (`--brand`, set by
 * /brand.css) is an accent only: links, selected states, focus rings,
 * featured badges, charts. Every brand-derived colour is computed here, and
 * text-on-paper variants are clamped in OKLCH lightness so any tenant colour
 * (red, green, yellow, purple …) keeps AA contrast in both themes.
 *
 * `template` is the last layer: the active customer-side design template
 * (static/css/themes/<key>.css, loaded only while selected) puts its
 * component variants there and its token overrides into `tokens`. The
 * tenant theme stylesheet (/brand.css, crate::theme) is unlayered and wins.
 *
 * Fonts: Geist + Geist Mono (OFL, self-hosted in static/fonts, v1.9.2 from
 * the `geist` npm package) are the defaults; /brand.css swaps `--font-sans`
 * / `--font-heading` for the tenant's choice and declares only those faces.
 * The "… Fallback" faces are metric-matched local fonts (size-adjust +
 * ascent/descent overrides measured against Geist), so swapping in the web
 * font does not reflow text.
 */
@layer reset, tokens, base, layout, components, utilities, pages, template;

/* ---- web fonts (outside layers: @font-face is not cascaded) ----------- */
@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2?v=1.9.2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMono-Variable.woff2?v=1.9.2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Arial measured against Geist (canvas, TR + EN running text):
   400 → 1.0243, 500 → 1.0499, 600 (Arial Bold) → 0.9999.
   Geist: ascent 1.005, descent 0.295, line gap 0 (per em). */
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans");
  font-weight: 100 449;
  size-adjust: 101.3%;
  ascent-override: 99.21%;
  descent-override: 29.12%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans");
  font-weight: 450 549;
  size-adjust: 103.6%;
  ascent-override: 97.01%;
  descent-override: 28.47%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold");
  font-weight: 550 900;
  size-adjust: 99.7%;
  ascent-override: 100.8%;
  descent-override: 29.59%;
  line-gap-override: 0%;
}
/* Geist Mono advance = 0.600 em; Menlo 0.602, Courier New 0.600. */
@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Menlo"), local("Menlo-Regular"), local("Courier New"), local("CourierNewPSMT");
  size-adjust: 99.7%;
  ascent-override: 100.8%;
  descent-override: 29.59%;
  line-gap-override: 0%;
}

@layer tokens {
  :root {
    color-scheme: light;

    /* ---- brand (overridden by /brand.css) ---------------------------- */
    --brand: #2563eb;
    --accent: #f59e0b;
    /* Text on a brand fill: black or white, whichever the brand allows. */
    --brand-ink: #ffffff;
    /* Brand as text / icon colour on paper (links, selected labels). */
    --brand-strong: color-mix(in oklab, var(--brand) 68%, var(--ink));
    --brand-soft: color-mix(in oklab, var(--brand) 10%, var(--surface));
    --brand-softer: color-mix(in oklab, var(--brand) 5%, var(--surface));
    --brand-line: color-mix(in oklab, var(--brand) 42%, var(--line));
    --accent-soft: color-mix(in oklab, var(--accent) 14%, var(--surface));
    --focus: var(--brand-strong);

    /* ---- ink / paper -------------------------------------------------- */
    --bg: #f7f6f2;
    --bg-elev: #f0eee8;
    --surface: #fdfcfa;
    --surface-2: #f8f7f3;
    --surface-sunken: #eeece6;
    --ink: #171613;
    --ink-2: #3a3833;
    --muted: #67635b;
    --faint: #8b877d;
    --line: #e2dfd7;
    --line-strong: #cdc9bf;
    --overlay: rgb(23 22 19 / 0.42);

    /* ---- feedback (AA on --surface and on their -soft fill) ----------- */
    --success: #17704a;
    --success-soft: #e6f2eb;
    --warning: #875400;
    --warning-soft: #faefd8;
    --danger: #b0241a;
    --danger-soft: #fae8e5;
    --info: #24559f;
    --info-soft: #e7edf7;

    /* ---- code blocks (dark in both themes) ---------------------------- */
    --code-bg: #1a1916;
    --code-ink: #e9e7e1;
    --code-muted: #9a978f;
    --code-line: #2e2d29;

    /* ---- panel sidebar (follows the theme) ---------------------------- */
    --side-bg: #f1efea;
    --side-bg-2: #e8e5de;
    --side-ink: #2b2925;
    --side-muted: #6c685f;
    --side-line: var(--line);

    /* ---- typography --------------------------------------------------- */
    --font-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
      Roboto, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas,
      "Liberation Mono", monospace;
    /* h1–h3 and display text; /brand.css sets it when it differs. */
    --font-heading: var(--font-sans);
    /* fluid scale: 360px → 1440px viewport */
    --step--2: 0.6875rem;
    --step--1: 0.8125rem;
    --step-0: 1rem;
    --step-1: clamp(1.0625rem, 1.02rem + 0.19vw, 1.1875rem);
    --step-2: clamp(1.25rem, 1.17rem + 0.37vw, 1.5rem);
    --step-3: clamp(1.5rem, 1.33rem + 0.74vw, 2rem);
    --step-4: clamp(1.875rem, 1.58rem + 1.3vw, 2.75rem);
    --step-5: clamp(2.25rem, 1.65rem + 2.67vw, 4rem);
    --leading: 1.6;
    --leading-snug: 1.35;
    --leading-tight: 1.12;
    --tracking-tight: -0.02em;
    --tracking-display: -0.035em;
    --tracking-label: 0.07em;
    --weight-regular: 400;
    --weight-medium: 520;
    --weight-semibold: 600;

    /* ---- space (4px base) -------------------------------------------- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 1.75rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-14: 3.5rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --section: clamp(3.5rem, 2.4rem + 4.4vw, 6.5rem);
    --gutter: clamp(1rem, 0.55rem + 2vw, 2.5rem);
    --container: 1240px;
    --container-narrow: 760px;
    /* em, not ch: ch follows the "0" glyph, which differs between Geist
       and its fallback and would re-wrap text on font swap. */
    --measure: 45em;

    /* ---- shape -------------------------------------------------------- */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --radius-pill: 999px;
    --hairline: 1px solid var(--line);

    /* ---- elevation: lines, not shadows. Only floating layers (menus,
       dialogs, toasts) get one tight, functional shadow. ---------------- */
    --shadow-xs: none;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 16px 40px -20px rgb(23 22 19 / 0.28), 0 2px 6px -2px rgb(23 22 19 / 0.08);
    --ring: 0 0 0 3px color-mix(in oklab, var(--brand) 24%, transparent);
    --inset-hi: none;

    /* ---- motion ------------------------------------------------------- */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --fast: 120ms;
    --normal: 180ms;

    /* ---- chrome ------------------------------------------------------- */
    --header-h: 64px;
    --topbar-h: 56px;
    --sidebar-w: 248px;
    --control-h: 2.5rem;
    --control-h-sm: 2rem;
    --control-h-lg: 3rem;
    --control-font: 0.9375rem;
    --input-font: 1rem;
    --row-h: 2.75rem;
    --card-pad: var(--space-5);
    --sticky-top: var(--header-h);
  }

  /* Dark theme: a true neutral dark (not navy). Explicit choice, or the
     system preference when no choice was made — same values twice. */
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f0f0f;
    --bg-elev: #141414;
    --surface: #161616;
    --surface-2: #1a1a1a;
    --surface-sunken: #0b0b0b;
    --ink: #edece8;
    --ink-2: #c9c7c1;
    --muted: #9d9b95;
    --faint: #75736e;
    --line: #272727;
    --line-strong: #3a3a3a;
    --overlay: rgb(0 0 0 / 0.62);
    --brand-soft: color-mix(in oklab, var(--brand) 16%, var(--surface));
    --brand-softer: color-mix(in oklab, var(--brand) 8%, var(--surface));
    --brand-line: color-mix(in oklab, var(--brand) 48%, var(--line));
    --success: #4cc38e;
    --success-soft: #10241a;
    --warning: #e2ad3e;
    --warning-soft: #272010;
    --danger: #f3786e;
    --danger-soft: #2b1513;
    --info: #7cabf3;
    --info-soft: #131f33;
    --side-bg: #121212;
    --side-bg-2: #1e1e1e;
    --side-ink: #d9d8d3;
    --side-muted: #8f8d88;
    --code-bg: #0a0a0a;
    --code-line: #242424;
    --shadow-lg: 0 18px 44px -18px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(255 255 255 / 0.02);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #0f0f0f;
      --bg-elev: #141414;
      --surface: #161616;
      --surface-2: #1a1a1a;
      --surface-sunken: #0b0b0b;
      --ink: #edece8;
      --ink-2: #c9c7c1;
      --muted: #9d9b95;
      --faint: #75736e;
      --line: #272727;
      --line-strong: #3a3a3a;
      --overlay: rgb(0 0 0 / 0.62);
      --brand-soft: color-mix(in oklab, var(--brand) 16%, var(--surface));
      --brand-softer: color-mix(in oklab, var(--brand) 8%, var(--surface));
      --brand-line: color-mix(in oklab, var(--brand) 48%, var(--line));
      --success: #4cc38e;
      --success-soft: #10241a;
      --warning: #e2ad3e;
      --warning-soft: #272010;
      --danger: #f3786e;
      --danger-soft: #2b1513;
      --info: #7cabf3;
      --info-soft: #131f33;
      --side-bg: #121212;
      --side-bg-2: #1e1e1e;
      --side-ink: #d9d8d3;
      --side-muted: #8f8d88;
    --code-bg: #0a0a0a;
    --code-line: #242424;
      --shadow-lg: 0 18px 44px -18px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(255 255 255 / 0.02);
    }
  }

  /* Brand contrast guard (relative colour syntax): link/label colour is the
     brand hue with lightness capped (light) or floored (dark); the ink on a
     brand fill flips between black and white at OKLCH L = 0.66. */
  @supports (color: oklch(from red l c h)) {
    :root {
      --brand-strong: oklch(from var(--brand) min(l, 0.5) c h);
      --brand-ink: oklch(from var(--brand) clamp(0, (0.66 - l) * 1000, 1) 0 0);
    }
    :root[data-theme="dark"] {
      --brand-strong: oklch(from var(--brand) max(l, 0.76) min(c, 0.17) h);
    }
    @media (prefers-color-scheme: dark) {
      :root:not([data-theme="light"]) {
        --brand-strong: oklch(from var(--brand) max(l, 0.76) min(c, 0.17) h);
      }
    }
  }
}

/* css/base.css */
/* Reset + base element styles. */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  * {
    margin: 0;
  }
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    hanging-punctuation: first last;
    /* The scrollbar never changes the content width (no sideways jump when a
       page becomes scrollable, a dialog opens or a list grows). */
    scrollbar-gutter: stable;
  }
  body {
    min-height: 100svh;
    line-height: var(--leading);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  img,
  picture,
  svg,
  video,
  canvas,
  iframe {
    display: block;
    max-width: 100%;
  }
  img,
  video {
    height: auto;
  }
  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
  }
  fieldset {
    border: 0;
    padding: 0;
    min-width: 0;
  }
  p,
  h1,
  h2,
  h3,
  h4,
  li,
  dd,
  dt,
  td,
  th {
    overflow-wrap: break-word;
  }
  h1,
  h2,
  h3,
  h4 {
    text-wrap: balance;
  }
  p {
    text-wrap: pretty;
  }
  ul[role="list"],
  ol[role="list"] {
    list-style: none;
    padding: 0;
  }
  table {
    border-collapse: collapse;
  }
  [hidden] {
    display: none !important;
  }
}

@layer base {
  html {
    background: var(--bg);
    scroll-padding-top: calc(var(--sticky-top) + 1rem);
  }
  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }
  body {
    font-family: var(--font-sans);
    font-size: var(--step-0);
    font-weight: var(--weight-regular);
    font-optical-sizing: auto;
    font-synthesis-weight: none;
    color: var(--ink);
    background: var(--bg);
    display: flex;
    flex-direction: column;
  }
  main {
    flex: 1 0 auto;
  }
  h1,
  h2,
  h3 {
    font-family: var(--font-heading);
  }
  h1,
  h2,
  h3,
  h4 {
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    font-weight: var(--weight-semibold);
    color: var(--ink);
  }
  h1 {
    font-size: var(--step-4);
    letter-spacing: var(--tracking-display);
  }
  h2 {
    font-size: var(--step-3);
  }
  h3 {
    font-size: var(--step-1);
    line-height: var(--leading-snug);
    letter-spacing: -0.01em;
  }
  h4 {
    font-size: var(--step-0);
    line-height: var(--leading-snug);
    letter-spacing: -0.005em;
  }
  a {
    color: var(--brand-strong);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
    text-underline-offset: 0.2em;
    transition:
      color var(--fast) var(--ease),
      text-decoration-color var(--fast) var(--ease);
  }
  a:hover {
    color: var(--ink);
    text-decoration-color: currentColor;
  }
  strong,
  b {
    font-weight: var(--weight-semibold);
  }
  small {
    font-size: var(--step--1);
  }
  code,
  kbd,
  samp,
  pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-variant-ligatures: none;
  }
  :not(pre) > code {
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.05em 0.35em;
    overflow-wrap: anywhere;
  }
  hr {
    border: 0;
    border-top: 1px solid var(--line);
  }
  address {
    font-style: normal;
  }
  ::selection {
    background: color-mix(in oklab, var(--brand) 26%, transparent);
    color: var(--ink);
  }
  /* --muted, not --faint: placeholder text still needs 4.5:1. */
  ::placeholder {
    color: var(--muted);
    opacity: 1;
  }

  /* One visible focus style for keyboard users: brand ring, never a layout
     change (outline does not take space). */
  :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }
  :focus:not(:focus-visible) {
    outline: none;
  }

  /* htmx: indicator styles are ours (htmx config disables its inline <style>). */
  .htmx-indicator {
    opacity: 0;
    transition: opacity var(--normal) var(--ease);
  }
  .htmx-request .htmx-indicator,
  .htmx-request.htmx-indicator {
    opacity: 1;
  }
  .htmx-swapping {
    opacity: 0.5;
    transition: opacity var(--fast) var(--ease);
  }
  .htmx-settling {
    transition: opacity var(--fast) var(--ease);
  }

  .skip-link {
    position: fixed;
    left: var(--space-4);
    top: var(--space-3);
    z-index: 100;
    transform: translateY(-200%);
    background: var(--ink);
    color: var(--bg);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: var(--weight-medium);
  }
  .skip-link:focus {
    transform: none;
    color: var(--bg);
  }

  /* Standalone notice pages (suspended tenant). */
  .center-screen {
    display: grid;
    place-items: center;
    padding: var(--space-6);
  }
  .notice-card {
    max-width: 32rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
  }
  .notice-card h1 {
    font-size: var(--step-3);
    margin-bottom: var(--space-3);
  }
  .notice-card p {
    color: var(--muted);
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer base {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* css/layout.css */
/* Page shells: containers, the 12-column grid, sections, storefront
   header/footer, panel shell, auth shell. Content is left-aligned. */
@layer layout {
  /* ---------------------------------------------------------------- frame */
  .container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
  }
  .container--narrow {
    width: min(100% - 2 * var(--gutter), var(--container-narrow));
    margin-inline: auto;
  }
  /* Narrow columns keep the page's left edge (content is left-aligned). */
  .container.container--narrow {
    width: min(100% - 2 * var(--gutter), var(--container-narrow));
    margin-left: max(var(--gutter), (100% - var(--container)) / 2);
    margin-right: auto;
  }
  .container .container--narrow {
    width: min(100%, var(--container-narrow));
    margin-inline: 0;
  }
  .grid-12 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--space-6);
  }

  /* ---------------------------------------------------------------- sections
     Every section opens with a hairline and a mono label; the label carries
     an automatic two-digit index (01, 02 …) so the page reads like a spec. */
  .site-main {
    counter-reset: section;
  }
  .section {
    padding-block: var(--section);
  }
  .section--tight {
    padding-block: calc(var(--section) * 0.55) var(--section);
  }
  .section--alt {
    background: var(--surface);
    border-block: 1px solid var(--line);
  }
  .section--alt + .section--alt {
    border-top: 0;
  }
  .section__head {
    display: grid;
    gap: var(--space-3);
    align-content: start;
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
    margin-bottom: var(--space-10);
  }
  .section__head h2 {
    max-width: 16.5em;
  }
  .section__head p:not(.eyebrow) {
    color: var(--muted);
    font-size: var(--step-1);
    max-width: 46rem;
  }
  .section__head--center {
    text-align: left;
  }
  .section__head .cycle-switch {
    justify-self: start;
  }
  @media (min-width: 64rem) {
    .section__head {
      grid-template-columns: repeat(12, minmax(0, 1fr));
      column-gap: var(--space-6);
      row-gap: var(--space-3);
    }
    .section__head > * {
      grid-column: 4 / -1;
    }
    .section__head > .eyebrow {
      grid-column: 1 / 4;
      grid-row: 1 / span 3;
      padding-top: 0.45em;
    }
    .section__head > .section__aside {
      grid-column: 10 / -1;
      grid-row: 1 / span 2;
      justify-self: end;
      align-self: end;
    }
    .section__head:has(> .section__aside) > h2,
    .section__head:has(> .section__aside) > p:not(.eyebrow) {
      grid-column: 4 / 10;
    }
  }
  .eyebrow {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
  }
  .eyebrow a {
    color: inherit;
    text-decoration: none;
  }
  .eyebrow a:hover {
    color: var(--ink);
  }
  .section__head > .eyebrow::before {
    counter-increment: section;
    content: counter(section, decimal-leading-zero);
    color: var(--brand-strong);
    font-variant-numeric: tabular-nums;
  }

  .grid {
    display: grid;
    gap: var(--space-6);
  }
  .grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  }
  .grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  }
  .grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  }

  /* ---------------------------------------------------------------- header
     Fixed height, solid paper, one hairline: nothing in it can change its
     height (long labels truncate, the mobile menu overlays). */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .site-header__bar {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: var(--space-6);
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    flex: 0 1 auto;
    font-weight: var(--weight-semibold);
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
  }
  .brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    padding-block: 0.15em;
  }
  .brand:hover {
    color: var(--ink);
  }
  .brand__mark {
    flex: none;
    inline-size: 1.75rem;
    block-size: 1.75rem;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    color: var(--brand-ink);
    background: var(--brand);
  }
  .brand img {
    display: block;
    width: 10rem;
    height: 2rem;
    object-fit: contain;
    object-position: left center;
  }
  .site-nav {
    display: none;
    align-items: center;
    gap: var(--space-1);
    flex: 1 1 auto;
    min-width: 0;
  }
  .site-nav__link,
  .site-nav summary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    height: var(--control-h);
    padding-inline: var(--space-3);
    border-radius: var(--radius);
    color: var(--ink-2);
    text-decoration: none;
    font-weight: var(--weight-medium);
    font-size: 0.9375rem;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
  }
  .site-nav summary::-webkit-details-marker {
    display: none;
  }
  .site-nav__link:hover,
  .site-nav summary:hover,
  .site-nav details[open] > summary {
    color: var(--ink);
    background: var(--surface-sunken);
  }
  .site-nav__link[aria-current="page"] {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--brand);
    border-radius: 0;
  }
  .site-nav details {
    position: relative;
  }
  .mega {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    width: min(40rem, calc(100vw - 2 * var(--gutter)));
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
  }
  .mega--wide {
    width: min(56rem, calc(100vw - 2 * var(--gutter)));
  }
  .mega__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-1);
  }
  .mega--wide .mega__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mega__foot {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-4);
    margin: var(--space-2) calc(-1 * var(--space-2)) calc(-1 * var(--space-2));
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    font-size: var(--step--1);
  }
  .mega__foot a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 2rem;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: var(--weight-medium);
  }
  .mega__foot a:hover { color: var(--brand-strong); }
  .mega__foot .icon { inline-size: 1rem; block-size: 1rem; }
  .mega__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-3);
    align-items: start;
    padding: var(--space-3);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
  }
  .mega__item:hover {
    background: var(--surface-sunken);
    color: var(--ink);
  }
  .mega__item strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: var(--weight-semibold);
    line-height: 1.35;
  }
  .mega__item span span {
    display: block;
    color: var(--muted);
    font-size: var(--step--1);
    line-height: 1.45;
    margin-top: 0.15rem;
  }
  .mega__icon {
    inline-size: 2rem;
    block-size: 2rem;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
  }
  .site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
    flex: none;
  }
  .nav-mobile > summary {
    list-style: none;
    cursor: pointer;
  }
  .nav-mobile > summary::-webkit-details-marker {
    display: none;
  }
  .nav-mobile__panel {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 39;
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding: var(--space-4) var(--gutter) var(--space-12);
    display: grid;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav-mobile__panel a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-inline: var(--space-1);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    font-size: 1.0625rem;
    font-weight: var(--weight-medium);
  }
  .nav-mobile__panel a:hover {
    color: var(--brand-strong);
  }
  .nav-mobile__label {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    color: var(--muted);
    padding: var(--space-6) var(--space-1) var(--space-2);
  }
  .nav-mobile__label:first-child {
    padding-top: var(--space-2);
  }
  .nav-mobile__panel .nav-mobile__product {
    gap: var(--space-3);
  }
  .nav-mobile__product .mega__icon {
    inline-size: 1.75rem;
    block-size: 1.75rem;
  }
  .nav-mobile__panel .btn {
    margin-top: var(--space-3);
    border-bottom: 0;
    justify-content: center;
  }
  .nav-mobile__langs {
    display: flex;
    gap: var(--space-6);
  }
  .nav-mobile__langs a {
    border-bottom: 0;
  }
  .nav-mobile__langs button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }
  .nav-mobile__langs a[aria-current],
  .nav-mobile__langs button[aria-current] {
    color: var(--brand-strong);
    text-decoration: underline;
    text-underline-offset: 0.3em;
  }

  @media (min-width: 64rem) {
    .site-nav {
      display: flex;
    }
    .nav-mobile {
      display: none;
    }
  }
  /* Narrow desktops: an icon-only cart and tighter gaps leave room for the
     menu next to the language / currency switches and account buttons. */
  @media (min-width: 64rem) and (max-width: 90rem) {
    .site-header__bar {
      gap: var(--space-4);
    }
    .site-header__actions {
      gap: var(--space-1);
    }
    .site-nav__link,
    .site-nav summary {
      padding-inline: var(--space-2);
    }
    .site-header__cart > span:not(.badge),
    .site-header__actions > .lang-switch .icon {
      display: none;
    }
  }
  /* The inline menu still does not fit (long page list, narrow window):
     app.js marks the header and the mobile menu takes over. */
  .site-header[data-cramped] .site-nav {
    display: none;
  }
  .site-header[data-cramped] .nav-mobile {
    display: block;
  }
  @media (max-width: 40rem) {
    .site-header__bar {
      gap: var(--space-3);
    }
    .site-header__actions {
      gap: var(--space-1);
    }
  }

  /* ---------------------------------------------------------------- footer */
  .site-footer {
    margin-top: auto;
    background: var(--surface);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
  }
  .site-footer__grid {
    display: grid;
    gap: var(--space-10) var(--space-6);
    padding-block: var(--space-16) var(--space-12);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  }
  .site-footer__about {
    grid-column: 1 / -1;
    max-width: 24rem;
    display: grid;
    gap: var(--space-4);
    align-content: start;
  }
  .site-footer__about p {
    color: var(--ink-2);
  }
  @media (min-width: 64rem) {
    .site-footer__grid {
      grid-template-columns: repeat(12, minmax(0, 1fr));
    }
    .site-footer__about {
      grid-column: 1 / 5;
    }
    .site-footer__grid > nav {
      grid-column: span 2;
    }
  }
  .site-footer h2 {
    font-size: var(--step--2);
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
  }
  .site-footer ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--space-1);
  }
  .site-footer li a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
  }
  .site-footer a {
    color: var(--ink-2);
    text-decoration: none;
  }
  .site-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
  }
  .site-footer__legal {
    border-top: 1px solid var(--line);
    padding-block: var(--space-5);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-6);
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.02em;
  }
  .site-footer__legal a[aria-current="true"] {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--brand);
    text-decoration-thickness: 2px;
  }
  .site-footer address {
    font-style: normal;
    line-height: 1.7;
  }
  .site-footer__contact {
    display: grid;
    gap: var(--space-1);
    font-family: var(--font-mono);
    font-size: var(--step--1);
  }

  /* ---------------------------------------------------------------- panel
     Sidebar + topbar share one horizontal hairline (both are --topbar-h
     tall), the sidebar follows the theme, the content column is capped. */
  .panel-shell {
    --sticky-top: var(--topbar-h);
    --step--1: 0.75rem;
    --step-0: 0.875rem;
    --step-1: 1rem;
    --step-2: 1.125rem;
    --step-3: 1.375rem;
    --step-4: 1.625rem;
    --row-h: 2.5rem;
    --control-font: 0.875rem;
    --input-font: 0.875rem;
    --card-pad: var(--space-5);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100svh;
    background: var(--bg);
    font-size: var(--step-0);
  }
  .sidebar {
    background: var(--side-bg);
    color: var(--side-ink);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--side-line);
    min-width: 0;
  }
  .sidebar > .brand {
    flex: none;
    height: var(--topbar-h);
    padding-inline: var(--space-4);
    border-bottom: 1px solid var(--side-line);
    color: var(--ink);
    font-size: 0.9375rem;
  }
  .sidebar > .brand .brand__mark {
    inline-size: 1.5rem;
    block-size: 1.5rem;
  }
  .sidebar__area {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--side-muted);
    padding: var(--space-4) var(--space-4) 0;
  }
  .side-nav {
    display: grid;
    align-content: start;
    gap: var(--space-4);
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    padding: var(--space-3) var(--space-2) var(--space-4);
    scrollbar-width: thin;
  }
  .side-nav__title {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--side-muted);
    padding: 0 var(--space-2) var(--space-1);
  }
  .side-nav ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1px;
  }
  .side-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 2.25rem;
    padding-inline: var(--space-2);
    border-radius: var(--radius);
    color: var(--side-ink);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: var(--weight-medium);
    white-space: nowrap;
    min-width: 0;
  }
  .side-nav a > span:not(.side-nav__badge) {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .side-nav a:hover {
    background: var(--side-bg-2);
    color: var(--ink);
  }
  .side-nav a[aria-current="page"] {
    background: var(--surface);
    color: var(--ink);
    box-shadow:
      inset 0 0 0 1px var(--line),
      inset 2px 0 0 var(--brand);
  }
  .side-nav__badge {
    margin-left: auto;
    flex: none;
    min-width: 1.375rem;
    height: 1.25rem;
    display: inline-grid;
    place-items: center;
    padding-inline: 0.375rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: var(--brand);
    color: var(--brand-ink);
    border-radius: var(--radius-pill);
  }
  .sidebar__foot {
    flex: none;
    border-top: 1px solid var(--side-line);
    padding: var(--space-3) var(--space-2);
    display: grid;
    gap: var(--space-2);
  }
  .user-chip {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-1) var(--space-2);
    color: var(--side-ink);
    min-width: 0;
  }
  .user-chip__text {
    display: grid;
    min-width: 0;
    line-height: 1.35;
  }
  .user-chip__text strong,
  .user-chip__text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
  }
  .user-chip__text strong {
    color: var(--ink);
    font-weight: var(--weight-semibold);
  }
  .user-chip__text span {
    color: var(--side-muted);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
  }
  .avatar {
    flex: none;
    inline-size: 2rem;
    block-size: 2rem;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bg);
    background: var(--ink);
  }
  .panel-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: var(--topbar-h);
    padding-inline: var(--gutter);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    min-width: 0;
  }
  /* Topbar crumbs (single line, current crumb only on phones) live in
     components.css next to .breadcrumbs, which they override. */
  .topbar > .breadcrumbs {
    min-width: 0;
    overflow: hidden;
  }
  /* Grows into the free space and hugs the right edge; a flexible child
     (the admin search) can shrink on phones instead of overflowing. */
  .topbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-1);
    flex: 1 1 auto;
    min-width: 0;
  }
  .topbar__actions > form[action$="/logout"] {
    display: contents;
  }
  .panel-content {
    padding: var(--space-8) var(--gutter) var(--space-16);
    width: 100%;
    max-width: 88rem;
    min-width: 0;
  }
  .page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: var(--space-4) var(--space-6);
    padding-bottom: var(--space-5);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--line);
  }
  @media (min-width: 48rem) {
    .page-head {
      grid-template-columns: minmax(0, 1fr) auto;
    }
  }
  .page-head h1 {
    font-size: var(--step-3);
    letter-spacing: -0.025em;
    line-height: 1.2;
  }
  .page-head > div:first-child {
    display: grid;
    gap: var(--space-1);
    min-width: 0;
  }
  .page-head p {
    color: var(--muted);
    max-width: 60rem;
  }
  .page-head .btn-row {
    justify-content: flex-start;
  }
  @media (min-width: 48rem) {
    .page-head .btn-row {
      justify-content: flex-end;
    }
  }
  .sidebar-toggle {
    display: inline-flex;
  }
  @media (max-width: 63.99rem) {
    .js .sidebar {
      position: fixed;
      inset: 0 auto 0 0;
      width: min(86vw, var(--sidebar-w));
      z-index: 60;
      transform: translateX(-102%);
      visibility: hidden;
      transition:
        transform var(--normal) var(--ease),
        visibility 0s linear var(--normal);
    }
    .js body.sidebar-open .sidebar {
      transform: none;
      visibility: visible;
      transition: transform var(--normal) var(--ease);
      box-shadow: var(--shadow-lg);
    }
    .sidebar-backdrop {
      position: fixed;
      inset: 0;
      z-index: 55;
      background: var(--overlay);
    }
    .topbar {
      padding-inline: var(--space-3) var(--gutter);
    }
  }
  @media (min-width: 64rem) {
    .panel-shell {
      grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
      /* The sidebar column keeps its colour and rule below the sticky
         sidebar (long pages, overscroll, full-page captures). */
      background: linear-gradient(
        to right,
        var(--side-bg) calc(var(--sidebar-w) - 1px),
        var(--side-line) calc(var(--sidebar-w) - 1px) var(--sidebar-w),
        var(--bg) var(--sidebar-w)
      );
    }
    .sidebar {
      position: sticky;
      top: 0;
      height: 100svh;
    }
    .sidebar-toggle,
    .sidebar-backdrop {
      display: none !important;
    }
  }

  /* ---------------------------------------------------------------- auth
     Form column on the left (primary), an editorial aside on the right. */
  .auth-shell {
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-aside {
    display: none;
    position: relative;
    padding: var(--space-10) var(--space-12);
    background: var(--surface);
    border-left: 1px solid var(--line);
    color: var(--ink);
  }
  .auth-aside .brand {
    color: var(--ink);
  }
  .auth-aside__body {
    margin-block: auto;
    display: grid;
    gap: var(--space-5);
    max-width: 30rem;
  }
  .auth-aside__body h2 {
    font-size: var(--step-4);
    letter-spacing: var(--tracking-display);
    max-width: 11em;
  }
  .auth-aside__body p {
    color: var(--muted);
    font-size: var(--step-1);
  }
  .auth-aside ul {
    list-style: none;
    padding: 0;
    display: grid;
    border-top: 1px solid var(--line);
    margin-top: var(--space-4);
    counter-reset: point;
  }
  .auth-aside li {
    display: grid;
    grid-template-columns: 2.5rem 1.25rem 1fr;
    gap: var(--space-3);
    align-items: center;
    min-height: 3.25rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
    counter-increment: point;
  }
  .auth-aside li::before {
    content: counter(point, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    color: var(--muted);
  }
  .auth-aside li .icon {
    color: var(--brand-strong);
  }
  .auth-main {
    position: relative;
    display: grid;
    align-content: center;
    padding: calc(var(--header-h) + var(--space-4)) var(--gutter) var(--space-12);
  }
  .auth-card {
    width: min(100%, 26rem);
    margin-inline: auto;
    display: grid;
    gap: var(--space-6);
  }
  .auth-card > .brand {
    justify-self: start;
  }
  .auth-card__head {
    display: grid;
    gap: var(--space-2);
    justify-items: start;
  }
  .auth-card__head h1 {
    font-size: var(--step-3);
    letter-spacing: -0.03em;
  }
  .auth-card__head p {
    color: var(--muted);
  }
  .auth-top {
    position: absolute;
    top: var(--space-3);
    right: var(--gutter);
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }
  .auth-main--wide .auth-card {
    width: min(100%, 33rem);
  }
  @media (min-width: 64rem) {
    .auth-shell {
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }
    .auth-main {
      order: 1;
    }
    .auth-aside {
      order: 2;
      display: flex;
      flex-direction: column;
      position: sticky;
      top: 0;
      height: 100svh;
    }
  }
}

/* css/components.css */
/* Component library. Every component is documented on /admin/_styleguide.
 *
 * Rules that keep layouts still:
 *  - state changes (hover, selected, featured, open, busy) never change a
 *    box size: colours, inset box-shadows and outlines only, no border-width
 *    or transform on in-flow elements;
 *  - controls have fixed heights (--control-h*), table rows a fixed minimum
 *    (--row-h), icons a fixed box;
 *  - card grids align their inner rows across cards with subgrid.
 */
@layer components {
  /* ---------------------------------------------------------------- icon */
  .icon {
    inline-size: 1.125em;
    block-size: 1.125em;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.2em;
  }
  .icon--lg {
    inline-size: 1.5rem;
    block-size: 1.5rem;
  }

  /* ---------------------------------------------------------------- labels */
  .label {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.5;
  }

  /* ---------------------------------------------------------------- buttons
     Primary = ink (black on paper, white in dark). Brand is reserved for
     accents, so any tenant colour works. */
  .btn {
    --btn-bg: var(--surface);
    --btn-ink: var(--ink);
    --btn-line: var(--line-strong);
    --btn-hover: color-mix(in oklab, var(--btn-bg) 93%, var(--ink));
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--control-h);
    max-width: 100%;
    padding: 0 var(--space-4);
    border-radius: var(--radius);
    border: 1px solid var(--btn-line);
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-family: var(--font-sans);
    font-weight: var(--weight-medium);
    font-size: var(--control-font);
    line-height: 1.2;
    letter-spacing: -0.005em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition:
      background-color var(--fast) var(--ease),
      border-color var(--fast) var(--ease),
      color var(--fast) var(--ease);
  }
  .btn .icon {
    inline-size: 1rem;
    block-size: 1rem;
    vertical-align: 0;
  }
  .btn:hover {
    color: var(--btn-ink);
    background: var(--btn-hover);
    border-color: color-mix(in oklab, var(--btn-line) 70%, var(--ink));
  }
  .btn:active {
    background: color-mix(in oklab, var(--btn-hover) 92%, var(--ink));
  }
  .btn:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }
  .btn[disabled],
  .btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }
  /* Busy: the label hides (keeps its width) and a spinner takes its place. */
  .btn[aria-busy="true"] {
    color: transparent;
    cursor: progress;
  }
  .btn[aria-busy="true"]::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    inline-size: 1rem;
    block-size: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border-radius: 50%;
    border: 2px solid var(--btn-ink);
    border-right-color: transparent;
    animation: spin 0.7s linear infinite;
  }
  .btn--primary {
    --btn-bg: var(--ink);
    --btn-ink: var(--bg);
    --btn-line: var(--ink);
    --btn-hover: color-mix(in oklab, var(--ink) 84%, var(--bg));
  }
  .btn--primary:hover {
    border-color: var(--btn-hover);
  }
  .btn--accent {
    --btn-bg: var(--brand);
    --btn-ink: var(--brand-ink);
    --btn-line: var(--brand);
    --btn-hover: color-mix(in oklab, var(--brand) 86%, var(--ink));
  }
  .btn--soft {
    --btn-bg: var(--surface-sunken);
    --btn-line: var(--line);
    --btn-hover: color-mix(in oklab, var(--surface-sunken) 90%, var(--ink));
  }
  .btn--ghost {
    --btn-bg: transparent;
    --btn-line: transparent;
    --btn-hover: var(--surface-sunken);
  }
  .btn--ghost:hover {
    border-color: transparent;
  }
  .btn--danger {
    --btn-bg: var(--danger);
    --btn-ink: var(--surface);
    --btn-line: var(--danger);
    --btn-hover: color-mix(in oklab, var(--danger) 86%, var(--ink));
  }
  .btn--sm {
    min-height: var(--control-h-sm);
    padding: 0 var(--space-3);
    font-size: 0.8125rem;
    gap: 0.375rem;
  }
  .btn--sm .icon {
    inline-size: 0.875rem;
    block-size: 0.875rem;
  }
  .btn--lg {
    min-height: var(--control-h-lg);
    padding: 0 var(--space-6);
    font-size: 1rem;
  }
  .btn--block {
    width: 100%;
  }
  .btn--icon {
    padding: 0;
    inline-size: var(--control-h);
  }
  .btn--icon.btn--sm {
    inline-size: var(--control-h-sm);
  }
  .btn--link {
    --btn-bg: transparent;
    --btn-line: transparent;
    --btn-ink: var(--brand-strong);
    --btn-hover: transparent;
    min-height: 0;
    padding-inline: 0;
    border: 0;
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
    text-underline-offset: 0.2em;
  }
  .btn--link:hover {
    --btn-ink: var(--ink);
    text-decoration-color: currentColor;
  }
  @media (pointer: coarse) {
    .btn--sm {
      min-height: 2.5rem;
    }
    .btn--icon.btn--sm {
      inline-size: 2.5rem;
    }
    .btn--link {
      min-height: 0;
    }
  }
  .btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
  }
  .btn-row > form {
    display: contents;
  }
  .spinner {
    display: inline-block;
    flex: none;
    inline-size: 1em;
    block-size: 1em;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin 0.7s linear infinite;
  }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  /* ---------------------------------------------------------------- forms
     One column rhythm: label → control → hint/error, 8px apart, fields 20px
     apart. Errors replace the hint in the same slot. */
  .form {
    display: grid;
    gap: var(--space-5);
  }
  .form-row {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    align-items: start;
  }
  .field {
    display: grid;
    gap: var(--space-2);
    align-content: start;
    min-width: 0;
  }
  .field__label {
    font-weight: var(--weight-medium);
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ink-2);
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
  }
  .field__label > a {
    margin-left: auto;
  }
  legend.field__label {
    margin-bottom: var(--space-2);
  }
  .field__label a {
    font-weight: var(--weight-regular);
  }
  .field__req {
    color: var(--danger);
    margin-left: 2px;
  }
  .input,
  .select,
  .textarea {
    display: block;
    width: 100%;
    min-height: var(--control-h);
    padding: 0 var(--space-3);
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: var(--input-font);
    line-height: 1.4;
    transition:
      border-color var(--fast) var(--ease),
      box-shadow var(--fast) var(--ease);
  }
  @media (pointer: coarse) {
    .input,
    .select,
    .textarea {
      font-size: max(1rem, var(--input-font));
    }
  }
  .input:hover,
  .select:hover,
  .textarea:hover {
    border-color: color-mix(in oklab, var(--line-strong) 60%, var(--ink));
  }
  .input:focus,
  .select:focus,
  .textarea:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: var(--ring);
  }
  .input[readonly] {
    background: var(--surface-2);
    color: var(--ink-2);
  }
  .input[type="file"] {
    padding: 0.25rem;
    line-height: calc(var(--control-h) - 0.5rem - 2px);
    color: var(--muted);
    font-size: var(--step--1);
    cursor: pointer;
  }
  .input::file-selector-button {
    height: calc(var(--control-h) - 0.5rem - 2px);
    margin-right: var(--space-3);
    padding: 0 var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    color: var(--ink);
    font: inherit;
    font-weight: var(--weight-medium);
    cursor: pointer;
  }
  .input[type="number"],
  .input.mono,
  .textarea.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }
  .textarea {
    min-height: 7.5rem;
    padding: var(--space-2) var(--space-3);
    resize: vertical;
    line-height: 1.55;
  }
  .select {
    appearance: none;
    padding-right: 2.25rem;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--muted) 50%),
      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
      calc(100% - 1.05rem) 52%,
      calc(100% - 0.75rem) 52%;
    background-size: 0.3rem 0.3rem;
    background-repeat: no-repeat;
    text-overflow: ellipsis;
  }
  .field__hint {
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.45;
  }
  .field__error {
    color: var(--danger);
    font-size: 0.8125rem;
    line-height: 1.45;
    font-weight: var(--weight-medium);
    display: flex;
    gap: var(--space-1);
    align-items: flex-start;
  }
  .field__error .icon {
    inline-size: 0.875rem;
    block-size: 0.875rem;
    margin-top: 0.15em;
    vertical-align: 0;
  }
  .field--error .input,
  .field--error .select,
  .field--error .textarea,
  .input[aria-invalid="true"] {
    border-color: var(--danger);
  }
  .field--error .input:focus,
  .field--error .textarea:focus,
  .input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 22%, transparent);
  }
  .check {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    font-size: var(--control-font);
    line-height: 1.5;
  }
  .check input {
    inline-size: 1rem;
    block-size: 1rem;
    margin: 0.2em 0 0;
    accent-color: var(--brand);
    flex: none;
  }
  .input-group {
    display: flex;
    align-items: stretch;
    min-height: var(--control-h);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
  }
  .input-group:focus-within {
    border-color: var(--focus);
    box-shadow: var(--ring);
  }
  .input-group .input {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    min-height: 0;
    flex: 1 1 auto;
    min-width: 0;
  }
  .input-group .btn {
    border-radius: 0;
    border-width: 0 0 0 1px;
    border-color: var(--line);
    min-height: 0;
  }
  .input-group__addon {
    display: grid;
    place-items: center;
    padding-inline: var(--space-3);
    color: var(--muted);
    background: var(--surface-sunken);
    border-right: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: var(--step--1);
  }
  .divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
  }
  .divider::before,
  .divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
  }
  .hp-field {
    position: absolute !important;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  /* ---------------------------------------------------------------- card */
  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 3.25rem;
    padding: var(--space-3) var(--card-pad);
    border-bottom: 1px solid var(--line);
  }
  .card__head > div {
    min-width: 0;
  }
  .card__head h2,
  .card__head h3 {
    font-size: var(--step-1);
    letter-spacing: -0.01em;
    line-height: 1.3;
  }
  .card__head p {
    margin-top: 2px;
  }
  .card__body {
    padding: var(--card-pad);
    display: grid;
    gap: var(--space-4);
    align-content: start;
    min-width: 0;
  }
  .card__foot {
    padding: var(--space-3) var(--card-pad);
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: auto;
  }
  .card--hover {
    transition:
      border-color var(--fast) var(--ease),
      background-color var(--fast) var(--ease);
  }
  .card--hover:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
  }
  .card--link {
    text-decoration: none;
    color: inherit;
  }
  .card--link:hover {
    color: inherit;
  }
  .card--flat {
    background: transparent;
  }
  /* A table that is the whole body of a card runs edge to edge. */
  .card > .table-wrap,
  .card__body > .table-wrap:only-child {
    border: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: transparent;
  }
  .card__body > .table-wrap:only-child {
    margin: calc(-1 * var(--card-pad));
    width: auto;
  }
  .card > .table-wrap:not(:last-child) {
    border-radius: 0;
  }
  .card > .table-wrap:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .feature-card {
    padding: var(--space-6);
    display: grid;
    gap: var(--space-3);
    align-content: start;
  }
  .feature-card p {
    color: var(--muted);
  }
  .icon-tile {
    inline-size: 2.25rem;
    block-size: 2.25rem;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line);
    flex: none;
  }
  .icon-tile .icon {
    inline-size: 1.125rem;
    block-size: 1.125rem;
  }

  /* ---------------------------------------------------------------- cell grid
     Hairline "spec sheet" grid: cells are separated by single 1px lines,
     drawn as overlapping rings in a 1px gap, so an incomplete last row has
     no empty boxes. Children with .cell-grid--rows-N align their inner rows
     across a row of cells (subgrid). */
  /* Explicit column counts per breakpoint (1 → 2 → N), so rows divide
     evenly instead of leaving a stray empty track. */
  .cell-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    padding: 1px;
  }
  @media (min-width: 40rem) {
    .cell-grid,
    .cell-grid--2,
    .cell-grid--3,
    .cell-grid--4 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (min-width: 64rem) {
    .cell-grid--3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .cell-grid--4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
  .cell-grid > * {
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    min-width: 0;
  }
  .cell-grid--rows-3 > * {
    grid-row: span 3;
    display: grid;
    grid-template-rows: subgrid;
  }
  .cell-grid--rows-4 > * {
    grid-row: span 4;
    display: grid;
    grid-template-rows: subgrid;
  }
  .cell-grid > a:hover {
    background: var(--surface-2);
  }
  .cell-grid > a:focus-visible {
    outline-offset: -2px;
    position: relative;
    z-index: 1;
  }

  /* ---------------------------------------------------------------- spec panel
     Technical data panel (hero TLD prices, catalog index): mono header,
     ruled rows, numbers right-aligned and tabular. */
  .spec-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    min-width: 0;
  }
  .spec-panel__head,
  .spec-panel__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 2.75rem;
    padding-inline: var(--space-5);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
  }
  .spec-panel__head {
    border-bottom: 1px solid var(--line);
  }
  .spec-panel__foot {
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .spec-panel__foot a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--ink);
    text-decoration: none;
  }
  .spec-panel__foot a:hover {
    color: var(--brand-strong);
  }
  .spec-panel__table {
    width: 100%;
    font-size: 0.9375rem;
  }
  .spec-panel__table th,
  .spec-panel__table td {
    height: 3rem;
    padding: 0 var(--space-5);
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-weight: var(--weight-regular);
    vertical-align: middle;
  }
  .spec-panel__table tr:last-child > * {
    border-bottom: 0;
  }
  .spec-panel__table th {
    font-family: var(--font-mono);
    color: var(--ink);
    font-weight: 500;
  }
  .spec-panel__table td {
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--ink);
  }
  .spec-panel__table td small {
    color: var(--muted);
    font-size: var(--step--1);
    margin-left: 2px;
  }
  .spec-panel__table a {
    color: inherit;
    text-decoration: none;
  }
  .spec-panel__table a:hover {
    color: var(--brand-strong);
  }
  .spec-panel__row-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
  }

  /* ---------------------------------------------------------------- badges */
  .badge {
    --b-bg: var(--surface-sunken);
    --b-ink: var(--ink-2);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 1.375rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--b-bg);
    color: var(--b-ink);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: var(--weight-medium);
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    vertical-align: middle;
    text-decoration: none;
    text-transform: none;
    font-variant-numeric: tabular-nums;
    border: 1px solid color-mix(in oklab, var(--b-ink) 18%, transparent);
  }
  .badge--dot::before {
    content: "";
    flex: none;
    inline-size: 0.375rem;
    block-size: 0.375rem;
    border-radius: 50%;
    background: currentColor;
  }
  .badge--brand {
    --b-bg: var(--brand-soft);
    --b-ink: var(--brand-strong);
  }
  .badge--success {
    --b-bg: var(--success-soft);
    --b-ink: var(--success);
  }
  .badge--warning {
    --b-bg: var(--warning-soft);
    --b-ink: var(--warning);
  }
  .badge--danger {
    --b-bg: var(--danger-soft);
    --b-ink: var(--danger);
  }
  .badge--info {
    --b-bg: var(--info-soft);
    --b-ink: var(--info);
  }
  .badge--accent {
    --b-bg: var(--accent-soft);
    --b-ink: color-mix(in oklab, var(--accent) 45%, var(--ink));
  }
  a.badge:hover {
    border-color: currentColor;
  }
  .tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.625rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-decoration: none;
  }
  a.tag:hover {
    border-color: var(--line-strong);
    color: var(--ink);
  }

  /* ---------------------------------------------------------------- alerts */
  .alert {
    --a-bg: var(--info-soft);
    --a-ink: var(--info);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    background: var(--a-bg);
    color: var(--ink);
    border: 1px solid color-mix(in oklab, var(--a-ink) 28%, transparent);
    font-size: var(--control-font);
    line-height: 1.5;
  }
  .alert > .icon,
  .alert > .spinner {
    color: var(--a-ink);
    margin-top: 0.2em;
    inline-size: 1rem;
    block-size: 1rem;
  }
  .alert--success {
    --a-bg: var(--success-soft);
    --a-ink: var(--success);
  }
  .alert--warning {
    --a-bg: var(--warning-soft);
    --a-ink: var(--warning);
  }
  .alert--error {
    --a-bg: var(--danger-soft);
    --a-ink: var(--danger);
  }

  /* ---------------------------------------------------------------- table
     Fixed row height, numbers right-aligned, mono and tabular. The header
     sticks under the page chrome when the table fits its column (app.js
     marks such wraps with data-fits; a scrolling wrap cannot do it). */
  .table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    scrollbar-width: thin;
  }
  .table-wrap[data-fits] {
    overflow: clip;
  }
  .table {
    width: 100%;
    font-size: var(--control-font);
    font-variant-numeric: tabular-nums;
  }
  .table th,
  .table td {
    height: var(--row-h);
    padding: var(--space-2) var(--space-4);
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
  }
  .table thead th {
    height: 2.25rem;
    padding-block: 0;
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    color: var(--muted);
    background: var(--surface-2);
    white-space: nowrap;
  }
  .table-wrap[data-fits] thead th {
    position: sticky;
    top: var(--sticky-top);
    z-index: 2;
    box-shadow: inset 0 -1px 0 var(--line);
  }
  .table tbody th {
    font-weight: var(--weight-medium);
  }
  .table tbody tr:last-child > * {
    border-bottom: 0;
  }
  .table tbody tr:hover > * {
    background: color-mix(in oklab, var(--surface-2) 60%, var(--surface-sunken));
  }
  .table .num {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.92em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .table thead .num {
    font-size: var(--step--2);
  }
  .table th a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
  }
  .table th[aria-sort] a {
    color: var(--ink);
  }
  .table td > a:not(.btn):not(.badge) {
    color: var(--ink);
    text-decoration-color: color-mix(in oklab, currentColor 30%, transparent);
  }
  .table td > a:not(.btn):not(.badge):hover {
    color: var(--brand-strong);
  }
  /* Stacked rows on small screens: <td data-label="…">. */
  @media (max-width: 40rem) {
    .table--stack thead {
      display: none;
    }
    .table--stack,
    .table--stack tbody {
      display: block;
    }
    .table--stack tr {
      display: grid;
      padding: var(--space-2) 0;
      border-bottom: 1px solid var(--line);
    }
    .table--stack tbody tr:last-child {
      border-bottom: 0;
    }
    .table--stack td,
    .table--stack tbody th {
      display: grid;
      grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
      gap: 0 var(--space-3);
      justify-items: start;
      height: auto;
      min-height: 2rem;
      align-items: center;
      border: 0;
      padding: 0.25rem var(--space-4);
    }
    .table--stack td::before,
    .table--stack tbody th[data-label]::before {
      content: attr(data-label);
      font-family: var(--font-mono);
      font-size: var(--step--2);
      font-weight: 500;
      letter-spacing: var(--tracking-label);
      text-transform: uppercase;
      color: var(--muted);
    }
    /* Every child of a labelled cell (period lines, badges …) stays in the
       value column instead of wrapping under the label. */
    .table--stack td[data-label] > *,
    .table--stack tbody th[data-label] > * {
      grid-column: 2;
    }
    .table--stack td:not([data-label])::before {
      content: none;
    }
    /* An empty cell (e.g. no mass-payment checkbox on a paid invoice)
       would only leave a gap in the stacked card. */
    .table--stack td:empty {
      display: none;
    }
    .table--stack td:not([data-label]) {
      grid-template-columns: minmax(0, 1fr);
    }
    .table--stack .num {
      text-align: left;
    }
    .table--stack tbody tr:hover > * {
      background: transparent;
    }
  }

  /* ---------------------------------------------------------------- tabs */
  .tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs a,
  .tabs button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: var(--control-h);
    padding: 0 var(--space-3);
    border: 0;
    background: none;
    color: var(--muted);
    font-size: var(--control-font);
    font-weight: var(--weight-medium);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
  }
  .tabs .icon {
    inline-size: 1rem;
    block-size: 1rem;
  }
  .tabs a:hover,
  .tabs button:hover {
    color: var(--ink);
  }
  .tabs [aria-current="page"],
  .tabs [aria-selected="true"] {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--brand);
  }

  /* ---------------------------------------------------------------- dialog */
  .dialog {
    width: min(100% - 2rem, 32rem);
    max-height: min(100svh - 2rem, 48rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 0;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    overscroll-behavior: contain;
  }
  .dialog::backdrop {
    background: var(--overlay);
  }
  .dialog[open] {
    animation: dialog-in var(--normal) var(--ease);
  }
  .dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 3.25rem;
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
    border-bottom: 1px solid var(--line);
  }
  .dialog__head h2 {
    font-size: var(--step-1);
    letter-spacing: -0.01em;
  }
  .dialog__body {
    padding: var(--space-5);
    display: grid;
    gap: var(--space-4);
  }
  .dialog__foot {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
  }
  .dialog--drawer {
    margin: 0 0 0 auto;
    height: 100svh;
    max-height: 100svh;
    width: min(100%, 28rem);
    border-radius: 0;
    border-width: 0 0 0 1px;
  }
  .dialog--drawer[open] {
    animation: drawer-in var(--normal) var(--ease);
  }
  @keyframes dialog-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
  }
  @keyframes drawer-in {
    from {
      transform: translateX(2rem);
      opacity: 0;
    }
  }

  /* ---------------------------------------------------------------- toasts
     A fixed layer: toasts never push content. */
  .toasts {
    position: fixed;
    z-index: 90;
    right: var(--space-4);
    bottom: var(--space-4);
    display: grid;
    gap: var(--space-2);
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
    font-size: 0.875rem;
  }
  .toast {
    --t-ink: var(--info);
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: start;
    padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow:
      inset 3px 0 0 var(--t-ink),
      var(--shadow-lg);
    animation: toast-in var(--normal) var(--ease);
    transition:
      opacity var(--normal) var(--ease),
      transform var(--normal) var(--ease);
  }
  .toast > .icon {
    color: var(--t-ink);
    margin-top: 0.15rem;
    inline-size: 1rem;
    block-size: 1rem;
  }
  .toast__text {
    font-size: 0.875rem;
    line-height: 1.5;
    padding-top: 0.0625rem;
  }
  .toast .btn {
    margin-top: -0.375rem;
  }
  .toast--success {
    --t-ink: var(--success);
  }
  .toast--warning {
    --t-ink: var(--warning);
  }
  .toast--error {
    --t-ink: var(--danger);
  }
  .toast[data-leaving] {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(0.5rem);
    }
  }

  /* ---------------------------------------------------------------- empty
     Left-aligned: a framed icon, then title, text and the caller's actions. */
  .empty {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--space-4);
    align-items: start;
    align-content: start;
    padding: var(--space-6);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
  }
  .empty > :not(.empty__icon) {
    grid-column: 2;
  }
  .empty > h1,
  .empty > h2,
  .empty > h3 {
    font-size: var(--step-1);
    letter-spacing: -0.01em;
    padding-top: 0.35rem;
  }
  .empty > h1 {
    font-size: var(--step-3);
    padding-top: 0.15rem;
  }
  .empty > p {
    color: var(--muted);
    max-width: 34rem;
    margin-top: var(--space-1);
  }
  .empty > :is(div, a, form, .btn-row, .btn) {
    margin-top: var(--space-4);
    justify-self: start;
  }
  .empty__icon {
    grid-column: 1;
    grid-row: 1 / span 3;
    inline-size: 2.5rem;
    block-size: 2.5rem;
    border-radius: var(--radius);
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-2);
  }
  .empty__icon .icon {
    inline-size: 1.25rem;
    block-size: 1.25rem;
  }
  .card__body > .empty:only-child {
    border: 0;
    background: transparent;
    padding: var(--space-2) 0;
  }

  /* ---------------------------------------------------------------- pagination */
  .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-6);
  }
  .pagination a,
  .pagination span {
    min-width: 2.25rem;
    height: 2.25rem;
    display: inline-grid;
    place-items: center;
    padding-inline: var(--space-2);
    border-radius: var(--radius);
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
  }
  .pagination a:hover {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--ink);
  }
  .pagination [aria-current="page"] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
  }
  .pagination .icon {
    inline-size: 1rem;
    block-size: 1rem;
  }

  /* ---------------------------------------------------------------- breadcrumbs */
  .breadcrumbs ol {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--muted);
  }
  .breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }
  .breadcrumbs li + li::before {
    content: "/";
    color: var(--line-strong);
    font-family: var(--font-mono);
  }
  .breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
  }
  .breadcrumbs a:hover {
    color: var(--ink);
    text-decoration: underline;
  }
  .breadcrumbs [aria-current="page"] {
    color: var(--ink);
    font-weight: var(--weight-medium);
  }
  /* In the panel topbar: one line, never wraps the 56px bar; on phones only
     the current crumb (the page head repeats it) and icon-only sign-out. */
  .topbar > .breadcrumbs ol {
    flex-wrap: nowrap;
  }
  .topbar > .breadcrumbs li {
    min-width: 0;
    white-space: nowrap;
  }
  .topbar > .breadcrumbs li > * {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  @media (max-width: 40rem) {
    .topbar > .breadcrumbs li:not(:last-child) {
      display: none;
    }
    .topbar > .breadcrumbs li + li::before {
      content: none;
    }
    .topbar__actions > form[action$="/logout"] .btn > span {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
    .topbar__actions > form[action$="/logout"] .btn {
      width: var(--control-h);
      padding-inline: 0;
    }
  }

  /* ---------------------------------------------------------------- pricing */
  .cycle-switch {
    display: inline-grid;
    grid-auto-flow: column;
    align-items: center;
    padding: 3px;
    gap: 3px;
    border-radius: var(--radius-lg);
    background: var(--surface-sunken);
    border: 1px solid var(--line);
  }
  .cycle-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .cycle-switch label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 2.125rem;
    padding: 0 var(--space-4);
    border-radius: var(--radius);
    font-weight: var(--weight-medium);
    font-size: 0.875rem;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition:
      background-color var(--fast) var(--ease),
      color var(--fast) var(--ease);
  }
  .cycle-switch label:hover {
    color: var(--ink);
  }
  .cycle-switch input:checked + label {
    background: var(--surface);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-strong);
  }
  .cycle-switch input:focus-visible + label {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
  }
  .cycle-switch .badge {
    height: 1.25rem;
    font-size: 0.6875rem;
  }

  /* Price cards: five rows (name, tagline, prices, features, action) shared
     with the other cards of the row via subgrid — a two-line tagline or a
     longer feature list never pushes one card's price below its neighbour's.
     The "popular" ribbon sits on the top edge, out of flow; the featured
     state is an inset ring, so its box is identical to the others. */
  .price-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr));
    align-items: stretch;
  }
  .price-card {
    position: relative;
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
    padding: var(--space-6);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    min-width: 0;
  }
  @supports not (grid-template-rows: subgrid) {
    .price-card {
      grid-row: auto;
      grid-template-rows: auto auto auto 1fr auto;
    }
  }
  .price-card--featured {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand);
  }
  .price-card__ribbon {
    position: absolute;
    top: 0;
    left: calc(var(--space-6) - 1px);
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    height: 1.375rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--brand);
    color: var(--brand-ink);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    white-space: nowrap;
  }
  .price-card__name {
    font-size: var(--step-2);
    letter-spacing: -0.02em;
    line-height: 1.2;
    padding-bottom: var(--space-2);
    align-self: end;
  }
  .price-card__tagline {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    padding-bottom: var(--space-5);
  }
  .price-card__prices {
    display: grid;
    align-content: start;
    padding-block: var(--space-5);
    border-top: 1px solid var(--line);
  }
  .price-card__prices > * {
    grid-area: 1 / 1;
  }
  .price-card .feature-list {
    padding-block: var(--space-5) var(--space-6);
    border-top: 1px solid var(--line);
    align-content: start;
  }
  .price-card > .btn {
    align-self: end;
  }
  .price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 0.375rem;
    row-gap: var(--space-1);
    align-content: start;
  }
  .price__amount {
    font-family: var(--font-mono);
    font-size: var(--step-3);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .price__per {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--step--1);
  }
  .price__note {
    width: 100%;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.45;
  }
  /* Only the price of the selected cycle is visible (pure CSS switch). All
     variants share one grid cell and toggle visibility, so the cell is as
     tall/wide as the largest one: switching cycles moves nothing. */
  .js-cycle-scope .price[data-cycle] {
    visibility: hidden;
  }
  .js-cycle-scope:has(.cycle-switch input[value="monthly"]:checked) .price[data-cycle="monthly"],
  .js-cycle-scope:has(.cycle-switch input[value="annual"]:checked) .price[data-cycle="annual"],
  .js-cycle-scope .price[data-cycle="fallback"] {
    visibility: visible;
  }
  @supports not selector(:has(*)) {
    .js-cycle-scope .price[data-cycle="monthly"] {
      visibility: visible;
    }
  }
  .feature-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--space-2);
    font-size: 0.9375rem;
    line-height: 1.45;
  }
  .feature-list li {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    gap: 0.625rem;
    align-items: start;
  }
  .feature-list .icon {
    inline-size: 1rem;
    block-size: 1rem;
    margin-top: 0.12em;
    color: var(--brand-strong);
    stroke-width: 2;
  }

  /* ---------------------------------------------------------------- steps
     Segmented progress: every step has the same 2px rule (colour only). */
  .steps {
    list-style: none;
    padding: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--space-2);
    counter-reset: step;
  }
  .steps li {
    display: grid;
    gap: var(--space-1);
    align-content: start;
    padding-top: var(--space-3);
    border-top: 2px solid var(--line-strong);
    font-size: 0.8125rem;
    line-height: 1.35;
    font-weight: var(--weight-medium);
    color: var(--muted);
    counter-increment: step;
    min-width: 0;
  }
  .steps li::before {
    content: counter(step, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: 0.04em;
    color: var(--muted);
  }
  .steps [data-state="done"] {
    border-top-color: var(--ink);
    color: var(--ink-2);
  }
  .steps [aria-current="step"] {
    border-top-color: var(--brand);
    color: var(--ink);
  }
  .steps [aria-current="step"]::before {
    color: var(--brand-strong);
  }

  /* ---------------------------------------------------------------- stats
     One instrument panel: hairline cells, mono values. */
  .stats {
    display: grid;
    gap: 1px;
    padding: 1px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  }
  /* Six tiles: 3 × 2 (or one row on wide screens), never 4 + 2. */
  @media (min-width: 40rem) {
    .stats:has(> :nth-child(6):last-child) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
  @media (min-width: 110rem) {
    .stats:has(> :nth-child(6):last-child) {
      grid-template-columns: repeat(6, minmax(0, 1fr));
    }
  }
  /* label / value / hint rows are shared across a row of tiles (subgrid):
     a label that wraps to two lines does not drop its value below the
     neighbours'. */
  .stat {
    position: relative;
    padding: var(--space-4) var(--space-5) var(--space-5);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: var(--space-2);
    min-width: 0;
  }
  @supports not (grid-template-rows: subgrid) {
    .stat {
      grid-row: auto;
      grid-template-rows: auto auto 1fr;
    }
  }
  .stat__label {
    align-self: end;
  }
  .stat__label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.4;
  }
  .stat__label .icon {
    inline-size: 0.875rem;
    block-size: 0.875rem;
  }
  .stat__value {
    font-family: var(--font-mono);
    font-size: var(--step-3);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    overflow-wrap: anywhere;
  }
  .stat__hint {
    font-size: 0.8125rem;
    color: var(--muted);
    align-self: end;
  }
  .stat__hint--up {
    color: var(--success);
  }
  .stat__hint--down {
    color: var(--danger);
  }

  /* ---------------------------------------------------------------- code */
  .code-block {
    position: relative;
    background: var(--code-bg);
    color: var(--code-ink);
    border-radius: var(--radius-lg);
    border: 1px solid var(--code-line);
    overflow: hidden;
    min-width: 0;
  }
  .code-block pre {
    margin: 0;
    padding: var(--space-4) var(--space-5);
    overflow-x: auto;
    line-height: 1.65;
    font-size: 0.8125rem;
  }
  .code-block__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5rem;
    padding: 0 var(--space-2) 0 var(--space-5);
    border-bottom: 1px solid var(--code-line);
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--code-muted);
  }
  .code-block__bar .btn {
    --btn-bg: transparent;
    --btn-ink: var(--code-ink);
    --btn-line: transparent;
    --btn-hover: color-mix(in oklab, var(--code-bg) 80%, var(--code-ink));
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-sans);
  }

  /* ---------------------------------------------------------------- skeleton */
  .skeleton {
    display: block;
    border-radius: var(--radius-sm);
    background: linear-gradient(
      90deg,
      var(--surface-sunken) 25%,
      color-mix(in oklab, var(--surface-sunken) 55%, var(--line)) 37%,
      var(--surface-sunken) 63%
    );
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    min-height: 0.875em;
  }
  .skeleton--line {
    height: 0.875rem;
  }
  .skeleton--title {
    height: 1.375rem;
    width: 55%;
  }
  .skeleton--pill {
    height: 1.375rem;
    width: 5rem;
    border-radius: var(--radius-pill);
  }
  @keyframes shimmer {
    0% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0 50%;
    }
  }

  /* ---------------------------------------------------------------- menus */
  .menu {
    position: relative;
  }
  .menu > summary {
    list-style: none;
    cursor: pointer;
  }
  .menu > summary::-webkit-details-marker {
    display: none;
  }
  .menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 13rem;
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-1);
    display: grid;
    gap: 1px;
  }
  .menu__panel a,
  .menu__panel button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 2.25rem;
    padding: 0 var(--space-3);
    border-radius: var(--radius);
    border: 0;
    background: none;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
  }
  .menu__panel a:hover,
  .menu__panel button:hover {
    background: var(--surface-sunken);
  }
  .menu__panel form {
    display: contents;
  }

  /* ---------------------------------------------------------------- accordion
     A ruled list of <details>; the marker turns from + to × (no reflow). */
  .accordion {
    display: grid;
    border-top: 1px solid var(--line);
  }
  .accordion details {
    border-bottom: 1px solid var(--line);
  }
  .accordion summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.5rem;
    gap: var(--space-4);
    align-items: center;
    min-height: 3.5rem;
    padding: var(--space-3) 0;
    font-weight: var(--weight-medium);
    font-size: var(--control-font);
    line-height: 1.45;
    color: var(--ink);
  }
  .accordion summary > h3,
  .accordion summary > h2 {
    font: inherit;
    margin: 0;
    letter-spacing: inherit;
    text-wrap: pretty;
  }
  .accordion summary::-webkit-details-marker {
    display: none;
  }
  .accordion summary::after {
    content: "";
    justify-self: end;
    inline-size: 0.75rem;
    block-size: 0.75rem;
    background:
      linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
      linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
    color: var(--muted);
    transition: transform var(--normal) var(--ease);
  }
  .accordion summary:hover::after {
    color: var(--ink);
  }
  .accordion details[open] > summary::after {
    transform: rotate(45deg);
    color: var(--brand-strong);
  }
  .accordion summary:focus-visible {
    outline-offset: -2px;
  }
  .accordion .prose {
    padding: 0 2.5rem var(--space-5) 0;
    color: var(--ink-2);
    font-size: var(--control-font);
  }

  /* ---------------------------------------------------------------- oauth */
  .oauth {
    display: grid;
    gap: var(--space-2);
  }
  .btn--oauth {
    --btn-bg: var(--surface);
    justify-content: center;
  }
  .btn--oauth svg {
    inline-size: 1.125rem;
    block-size: 1.125rem;
  }

  /* ---------------------------------------------------------------- misc */
  .kbd,
  kbd {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 0 0.375rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    box-shadow: inset 0 -1px 0 var(--line-strong);
    background: var(--surface);
    color: var(--ink-2);
  }
  .progress {
    height: 0.375rem;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    overflow: hidden;
  }
  .progress > span {
    display: block;
    height: 100%;
    background: var(--brand);
    border-radius: inherit;
  }
  /* Key/value list: works with bare dt/dd pairs and with <div> wrappers. */
  .dl {
    display: grid;
    grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr);
    column-gap: 0;
  }
  .dl dt {
    padding-right: var(--space-6);
  }
  .dl > div {
    display: contents;
  }
  .dl dt,
  .dl dd {
    padding-block: var(--space-2);
    border-top: 1px solid var(--line);
    min-width: 0;
  }
  .dl > dt:first-child,
  .dl > dt:first-child + dd,
  .dl > div:first-child > dt,
  .dl > div:first-child > dd {
    border-top: 0;
    padding-top: 0;
  }
  .dl dt {
    color: var(--muted);
  }
  .dl dd {
    margin: 0;
    font-weight: var(--weight-medium);
    overflow-wrap: anywhere;
  }
  @media (max-width: 30rem) {
    .dl {
      grid-template-columns: minmax(0, 1fr);
    }
    .dl dd {
      border-top: 0;
      padding-top: 0;
    }
  }
  .qr {
    background: #ffffff;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    inline-size: 12rem;
    block-size: 12rem;
  }
  .qr svg {
    inline-size: 100%;
    block-size: 100%;
  }
  .codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-4);
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    padding: var(--space-4) var(--space-5);
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--line-strong);
    list-style: none;
    font-variant-numeric: tabular-nums;
  }
  .theme-toggle .icon-moon,
  .theme-toggle .icon-sun {
    display: contents;
  }
  .theme-toggle .icon-moon {
    display: none;
  }
  :root[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
  }
  :root[data-theme="dark"] .theme-toggle .icon-moon {
    display: contents;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun {
      display: none;
    }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon {
      display: contents;
    }
  }
  progress.bar {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    inline-size: 100%;
    min-inline-size: 6rem;
    block-size: 0.375rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    color: var(--brand);
    overflow: hidden;
  }
  progress.bar::-webkit-progress-bar {
    background: var(--surface-sunken);
    border-radius: var(--radius-pill);
  }
  progress.bar::-webkit-progress-value {
    background: var(--brand);
    border-radius: var(--radius-pill);
  }
  progress.bar::-moz-progress-bar {
    background: var(--brand);
    border-radius: var(--radius-pill);
  }

  /* ---------------------------------------------------------------- prose */
  .prose {
    font-size: var(--step-0);
    line-height: 1.75;
    color: var(--ink-2);
    max-width: var(--measure);
    min-width: 0;
  }
  .prose > * + * {
    margin-top: 1.1em;
  }
  .prose h2 {
    font-size: var(--step-2);
    margin-top: 2.2em;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.25;
  }
  .prose h3 {
    font-size: var(--step-1);
    margin-top: 1.8em;
    color: var(--ink);
  }
  .prose h2 + *,
  .prose h3 + * {
    margin-top: 0.6em;
  }
  .prose > :first-child {
    margin-top: 0;
  }
  .prose ul,
  .prose ol {
    padding-left: 1.35em;
  }
  .prose li + li {
    margin-top: 0.35em;
  }
  .prose li::marker {
    color: var(--muted);
  }
  .prose ol li::marker {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--brand-strong);
  }
  .prose strong {
    color: var(--ink);
  }
  .prose blockquote {
    border-left: 2px solid var(--brand);
    padding: var(--space-1) 0 var(--space-1) var(--space-5);
    color: var(--ink);
  }
  .prose pre {
    background: var(--code-bg);
    color: var(--code-ink);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    line-height: 1.6;
    font-size: 0.8125rem;
  }
  .prose img {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
  }
  .prose a {
    font-weight: var(--weight-medium);
  }
  .prose hr {
    margin-block: 2em;
  }
  .prose table {
    width: 100%;
    font-size: 0.9375rem;
  }
  .prose th,
  .prose td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--line);
    text-align: left;
  }
  .prose .table-wrap {
    margin-block: 1.5em;
  }

  /* Contextual overrides of components used by layout.css regions (they must
     live in this layer: the components layer wins over layout). */
  .brand__mark .icon {
    inline-size: 1rem;
    block-size: 1rem;
    stroke-width: 2;
    vertical-align: 0;
  }
  .site-nav summary .icon {
    inline-size: 0.875rem;
    block-size: 0.875rem;
    color: var(--muted);
    transition: transform var(--fast) var(--ease);
  }
  .site-nav details[open] summary .icon {
    transform: rotate(180deg);
  }
  .side-nav .icon {
    inline-size: 1rem;
    block-size: 1rem;
    color: var(--side-muted);
  }
  .side-nav a:hover .icon,
  .side-nav a[aria-current="page"] .icon {
    color: var(--ink);
  }
  .side-nav a[aria-current="page"] .side-nav__badge {
    color: var(--brand-ink);
  }
  .site-header__actions .badge {
    height: 1.125rem;
    min-width: 1.125rem;
    padding: 0 0.3125rem;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    background: var(--brand);
    color: var(--brand-ink);
    border-color: transparent;
  }
  .site-header__login {
    display: none;
  }
  @media (min-width: 64rem) {
    .site-header__login {
      display: inline-flex;
    }
  }
  @media (max-width: 40rem) {
    .site-header__cta {
      display: none;
    }
    .lang-switch .icon {
      display: none;
    }
  }
  /* Phones: the language switch moves into the menu sheet. */
  @media (max-width: 30rem) {
    .site-header__actions > .lang-switch {
      display: none;
    }
  }
  .nav-mobile__panel a[aria-current="true"] {
    box-shadow: inset 2px 0 0 var(--brand);
    padding-left: var(--space-3);
  }
  .lang-switch {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    min-width: var(--control-h-sm);
  }
  .site-header__actions > .btn,
  .site-header__actions > details > summary.btn {
    min-height: var(--control-h);
  }
  .site-header__actions > .btn--icon,
  .site-header__actions > details > summary.btn--icon {
    inline-size: var(--control-h);
  }
  /* Guest currency switcher (header); on phones it lives in the menu sheet. */
  .currency-switch {
    position: relative;
  }
  .currency-switch > summary {
    list-style: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
  }
  .currency-switch > summary::-webkit-details-marker {
    display: none;
  }
  .currency-switch__panel {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + var(--space-1));
    z-index: 60;
    display: grid;
    min-inline-size: 6rem;
    padding: var(--space-1);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .currency-switch__panel form {
    display: contents;
  }
  .currency-switch__panel button {
    padding: var(--space-1) var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    text-align: start;
    cursor: pointer;
  }
  .currency-switch__panel button:hover,
  .currency-switch__panel button[aria-current="true"] {
    background: var(--surface-2);
  }
  @media (max-width: 30rem) {
    .site-header__actions > .currency-switch {
      display: none;
    }
  }

  /* ---------------------------------------------------------- public demo */
  /* crate::demo (docs/DEMO.md): the banner on every page and the demo
     logins on the login pages. */
  .demo-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-2) var(--space-3);
    padding: var(--space-2) var(--gutter);
    background: var(--warning-soft);
    color: var(--warning);
    border-block-end: 1px solid color-mix(in oklab, var(--warning) 30%, var(--line));
    font-size: var(--step--1);
    line-height: var(--leading-snug);
    text-align: center;
  }
  .demo-banner__badge {
    padding: 0.05rem 0.5rem;
    border: 1px solid currentColor;
    border-radius: var(--radius-pill);
    font-size: var(--step--2);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .demo-banner__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: inherit;
    font-weight: var(--weight-medium);
    text-decoration: underline;
  }
  .demo-banner__link svg {
    inline-size: 1em;
    block-size: 1em;
  }
  .demo-logins {
    margin-block-start: var(--space-6);
    padding: var(--space-4);
    border: 1px dashed color-mix(in oklab, var(--warning) 55%, var(--line));
    border-radius: var(--radius-lg);
    background: var(--warning-soft);
  }
  .demo-logins h2 {
    margin: 0;
    font-size: var(--step-0);
  }
  .demo-logins__list {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-3) 0 0;
    padding: 0;
    list-style: none;
  }
  .demo-logins__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }
  .demo-logins__who {
    display: grid;
    gap: 0.15rem;
    min-inline-size: 0;
  }
  .demo-logins__who code {
    overflow-wrap: anywhere;
  }
  .demo-mail__body {
    max-block-size: 60vh;
    overflow: auto;
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--surface-sunken);
    font-size: var(--step--1);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

/* css/pages.css */
/* Storefront sections and page-specific layouts. */
@layer pages {
  /* ---------------------------------------------------------------- hero
     Left-aligned: headline, one-sentence definition, the domain search
     (the page's main action) and, beside it, a panel of real catalog data. */
  .hero {
    padding-block: clamp(3rem, 1.9rem + 4.9vw, 6.5rem) clamp(3rem, 2.2rem + 3.6vw, 5.5rem);
    border-bottom: 1px solid var(--line);
  }
  .hero__inner {
    display: grid;
    gap: var(--space-12);
    align-items: start;
  }
  .hero__main {
    display: grid;
    /* minmax(0, 1fr): the one-line pill link ellipsises instead of
       widening the column past the viewport on narrow phones. */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
    justify-items: start;
    align-content: start;
    min-width: 0;
  }
  .hero__panel {
    min-width: 0;
  }
  @media (min-width: 64rem) {
    .hero__inner {
      grid-template-columns: repeat(12, minmax(0, 1fr));
      column-gap: var(--space-6);
    }
    .hero__main {
      grid-column: 1 / 8;
    }
    .hero__panel {
      grid-column: 9 / -1;
      margin-top: var(--space-2);
    }
    .hero__main:only-child {
      grid-column: 1 / 10;
    }
  }
  .hero h1 {
    font-size: var(--step-5);
    font-weight: 620;
    letter-spacing: -0.045em;
    line-height: 1.02;
    max-width: 11em;
  }
  .hero h1 em {
    font-style: normal;
    color: var(--brand-strong);
  }
  .hero__lead {
    font-size: var(--step-1);
    line-height: 1.55;
    color: var(--muted);
    max-width: 38rem;
  }
  .hero__search {
    display: grid;
    gap: var(--space-3);
    width: 100%;
    max-width: 40rem;
    margin-top: var(--space-2);
  }
  .hero--compact {
    padding-block: clamp(2.5rem, 1.9rem + 2.7vw, 4.5rem) clamp(2rem, 1.7rem + 1.3vw, 3rem);
  }
  .hero--compact h1 {
    font-size: var(--step-4);
    max-width: 13.75em;
  }
  .cover {
    display: block;
    inline-size: 100%;
    block-size: auto;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    margin-block: var(--space-8) 0;
    background: var(--surface-sunken);
  }
  .pill-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 100%;
    min-height: 2rem;
    padding: 0 var(--space-3) 0 var(--space-1);
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: var(--weight-medium);
  }
  .pill-link > span:not(.badge) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .pill-link .badge {
    height: 1.375rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .pill-link .icon {
    inline-size: 0.875rem;
    block-size: 0.875rem;
    color: var(--muted);
  }
  .pill-link:hover {
    border-color: var(--line-strong);
    color: var(--ink);
  }

  /* ---------------------------------------------------------------- domain search */
  .domain-search {
    width: min(100%, 40rem);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 3.5rem;
    padding: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    transition:
      border-color var(--fast) var(--ease),
      box-shadow var(--fast) var(--ease);
  }
  .domain-search:hover {
    border-color: color-mix(in oklab, var(--line-strong) 60%, var(--ink));
  }
  .domain-search:focus-within {
    border-color: var(--focus);
    box-shadow: var(--ring);
  }
  .domain-search__field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-left: var(--space-3);
    color: var(--muted);
    cursor: text;
  }
  .domain-search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 3rem;
    border: 0;
    background: transparent;
    font-size: 1.0625rem;
    color: var(--ink);
  }
  .domain-search input:focus {
    outline: none;
  }
  .domain-search input::-webkit-search-decoration,
  .domain-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
  }
  .domain-search--mono input {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: -0.01em;
  }
  .domain-search .btn {
    flex: none;
    min-height: 3rem;
  }
  @media (max-width: 30rem) {
    .domain-search .btn {
      padding-inline: var(--space-4);
    }
    .domain-search__field {
      padding-left: var(--space-2);
      gap: var(--space-2);
    }
  }
  /* TLD price strip (mono, ruled). */
  .tld-chips {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-5);
    font-family: var(--font-mono);
    font-size: var(--step--1);
    color: var(--muted);
  }
  .tld-chip {
    display: inline-flex;
    gap: var(--space-2);
    align-items: baseline;
    font-variant-numeric: tabular-nums;
  }
  .tld-chip strong {
    color: var(--ink);
    font-weight: 500;
  }

  /* Results: one ruled list; every row has a fixed minimum height and fixed
     meta/action columns, so a "checking…" row swapped for its result (htmx,
     outerHTML) occupies exactly the same box. */
  .domain-results {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }
  .domain-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    /* Meta row tall enough for badge + price line, so pending → result
       swaps keep the row height. */
    grid-template-rows: minmax(2.5rem, auto) minmax(1.75rem, auto);
    grid-template-areas:
      "name action"
      "meta meta";
    gap: var(--space-1) var(--space-4);
    align-items: center;
    padding: var(--space-3) var(--space-5);
  }
  .domain-row + .domain-row {
    border-top: 1px solid var(--line);
  }
  .domain-row:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .domain-row:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .domain-row--available {
    box-shadow: inset 2px 0 0 var(--success);
  }
  .domain-row--exact {
    background: var(--surface-2);
  }
  .domain-row--exact .domain-row__name {
    font-size: 1.1875rem;
  }
  .domain-row__name {
    grid-area: name;
    font-family: var(--font-mono);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .domain-row__name span {
    color: var(--brand-strong);
  }
  .domain-row__meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
  }
  .domain-row > :nth-child(3) {
    grid-area: action;
    justify-self: end;
  }
  .domain-row__price {
    font-family: var(--font-mono);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .domain-row__price .small {
    margin-left: 2px;
  }
  @media (min-width: 40rem) {
    .domain-row {
      grid-template-columns: minmax(0, 1fr) 17rem 9rem;
      grid-template-rows: minmax(2.5rem, auto);
      grid-template-areas: "name meta action";
      min-height: 4rem;
    }
    .domain-row__meta {
      justify-content: flex-end;
    }
  }

  /* ---------------------------------------------------------------- catalog */
  .group-card {
    position: relative;
    padding: var(--space-6);
    color: inherit;
    text-decoration: none;
    align-content: start;
  }
  .group-card .icon-tile {
    margin-bottom: var(--space-8);
  }
  .group-card h2,
  .group-card h3 {
    font-size: var(--step-1);
    letter-spacing: -0.015em;
    padding-bottom: var(--space-2);
    align-self: end;
  }
  .group-card p {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    padding-bottom: var(--space-6);
  }
  .group-card .group-card__from {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--space-2);
    align-self: end;
    padding: var(--space-3) 0 0;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: var(--step--1);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .group-card__from strong {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 500;
  }
  .group-card__arrow {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    color: var(--faint);
    transition:
      color var(--fast) var(--ease),
      transform var(--fast) var(--ease);
  }
  .group-card:hover .group-card__arrow {
    color: var(--brand-strong);
    transform: translate(2px, -2px);
  }
  .group-card:hover h2,
  .group-card:hover h3 {
    color: var(--ink);
  }

  .page-hero {
    padding-block: clamp(2.5rem, 1.9rem + 2.7vw, 4.5rem) clamp(2rem, 1.6rem + 1.8vw, 3.25rem);
    border-bottom: 1px solid var(--line);
  }
  .page-hero__inner {
    display: grid;
    gap: var(--space-4);
    justify-items: start;
    min-width: 0;
  }
  .page-hero__inner > .breadcrumbs {
    margin-bottom: var(--space-2);
  }
  .page-hero h1 {
    font-size: var(--step-4);
    max-width: 16.5em;
  }
  .page-hero p {
    color: var(--muted);
    font-size: var(--step-1);
    max-width: 44rem;
  }
  .page-hero .eyebrow {
    font-size: var(--step--2);
  }
  .page-hero .domain-search {
    margin-top: var(--space-2);
  }
  .page-hero .article-meta {
    font-size: var(--step--1);
  }
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: end;
    justify-content: space-between;
    margin-bottom: var(--space-6);
  }
  .toolbar h2 {
    font-size: var(--step-2);
  }
  .compare .table th[scope="row"] {
    font-weight: var(--weight-regular);
    color: var(--muted);
    white-space: normal;
    min-width: 10rem;
  }
  .compare .table td {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--ink);
  }
  .compare .table thead th a {
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.01em;
    text-transform: none;
  }
  .compare .table thead th a:hover {
    color: var(--brand-strong);
  }
  .compare .icon {
    margin-inline: auto;
  }
  .compare .yes {
    color: var(--success);
  }
  .compare .no {
    color: var(--faint);
  }

  .product-layout {
    display: grid;
    gap: var(--space-8);
    align-items: start;
  }
  @media (min-width: 64rem) {
    .product-layout {
      grid-template-columns: minmax(0, 1fr) 23rem;
      column-gap: var(--space-12);
    }
    .sticky {
      position: sticky;
      top: calc(var(--sticky-top) + var(--space-6));
    }
  }
  .order-card {
    padding: var(--space-6);
    display: grid;
    gap: var(--space-5);
  }
  .radio-cards {
    display: grid;
    gap: var(--space-2);
  }
  .radio-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: center;
    min-height: 3.25rem;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--surface);
    font-size: var(--control-font);
    transition:
      border-color var(--fast) var(--ease),
      background-color var(--fast) var(--ease);
  }
  .radio-card:hover {
    border-color: var(--line-strong);
  }
  .radio-card:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-softer);
    box-shadow: inset 0 0 0 1px var(--brand);
  }
  .radio-card:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
  }
  .radio-card input {
    accent-color: var(--brand);
    inline-size: 1rem;
    block-size: 1rem;
    margin: 0;
  }
  .radio-card input:focus-visible {
    outline: none;
  }
  .radio-card__price {
    font-family: var(--font-mono);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--ink);
  }
  .radio-card small {
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
  }
  .spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    gap: 1px;
    padding: 1px;
  }
  .spec {
    display: grid;
    gap: var(--space-1);
    align-content: start;
    padding: var(--space-4);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
  }
  .spec dt {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
  }
  .spec dd {
    margin: 0;
    font-weight: var(--weight-medium);
    overflow-wrap: anywhere;
  }
  .spec .icon {
    color: var(--brand-strong);
  }

  /* ---------------------------------------------------------------- why / facts */
  .feature-card {
    padding: var(--space-6);
    gap: 0;
  }
  .feature-card .icon-tile {
    margin-bottom: var(--space-6);
  }
  .feature-card h3 {
    font-size: var(--step-1);
    padding-bottom: var(--space-2);
  }
  .feature-card p {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.55;
  }
  .facts {
    display: grid;
    gap: 1px;
    padding: 1px;
    grid-template-columns: minmax(0, 1fr);
  }
  @media (min-width: 40rem) {
    .facts {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (min-width: 64rem) {
    .facts {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
  .fact {
    display: grid;
    gap: var(--space-3);
    align-content: start;
    min-height: 6.5rem;
    padding: var(--space-5) var(--space-6);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    min-width: 0;
  }
  .fact dt {
    font-family: var(--font-mono);
    font-size: var(--step--2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    color: var(--muted);
  }
  .fact dd {
    margin: 0;
    font-size: var(--step-1);
    font-weight: var(--weight-medium);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }
  .fact dd.mono {
    font-size: 1rem;
    letter-spacing: 0;
  }
  .fact dd a {
    color: var(--ink);
  }

  /* FAQ: heading column + ruled answers. */
  .faq-layout {
    display: grid;
    gap: var(--space-8);
  }
  .faq-layout > .section__head {
    margin-bottom: 0;
  }
  @media (min-width: 64rem) {
    .faq-layout {
      grid-template-columns: repeat(12, minmax(0, 1fr));
      column-gap: var(--space-6);
      align-items: start;
    }
    .faq-layout > .section__head {
      grid-column: 1 / 5;
      grid-template-columns: minmax(0, 1fr);
      position: sticky;
      top: calc(var(--sticky-top) + var(--space-6));
    }
    .faq-layout > .section__head > * {
      grid-column: 1;
    }
    .faq-layout > .section__head > .eyebrow {
      grid-row: auto;
      padding-top: 0;
    }
    .faq-layout > .faq-layout__body {
      grid-column: 5 / -1;
      padding-top: var(--space-5);
    }
  }
  .faq-layout__body {
    display: grid;
    gap: var(--space-6);
    justify-items: start;
    min-width: 0;
  }
  .faq-layout__body > .accordion {
    width: 100%;
  }
  .accordion .faq__q {
    font-size: var(--step-1);
    font-weight: var(--weight-medium);
    letter-spacing: -0.01em;
  }

  /* Closing call to action: a dark slab in both themes. */
  .cta-band {
    display: grid;
    gap: var(--space-6);
    padding: clamp(2rem, 1.3rem + 3vw, 3.5rem);
    border-radius: var(--radius-lg);
    border: 1px solid var(--code-line);
    background: var(--code-bg);
    color: var(--code-ink);
  }
  .cta-band h2 {
    color: var(--code-ink);
    max-width: 13.75em;
  }
  .cta-band p {
    color: var(--code-muted);
    font-size: var(--step-1);
    max-width: 38rem;
    margin-top: var(--space-3);
  }
  .cta-band .btn {
    --btn-bg: transparent;
    --btn-ink: var(--code-ink);
    --btn-line: color-mix(in oklab, var(--code-ink) 30%, transparent);
    --btn-hover: color-mix(in oklab, var(--code-bg) 85%, var(--code-ink));
  }
  .cta-band .btn--primary {
    --btn-bg: var(--code-ink);
    --btn-ink: var(--code-bg);
    --btn-line: var(--code-ink);
    --btn-hover: color-mix(in oklab, var(--code-ink) 88%, var(--code-bg));
  }
  @media (min-width: 64rem) {
    .cta-band {
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      column-gap: var(--space-12);
    }
  }

  /* ---------------------------------------------------------------- content */
  .content-layout {
    display: grid;
    gap: var(--space-10);
    align-items: start;
  }
  .content-layout > :not(.toc) {
    max-width: 46rem;
    min-width: 0;
  }
  @media (min-width: 64rem) {
    .content-layout:has(> .toc) {
      grid-template-columns: 14rem minmax(0, 1fr);
      column-gap: var(--space-12);
    }
    .content-layout > .toc {
      position: sticky;
      top: calc(var(--sticky-top) + var(--space-6));
      max-height: calc(100svh - var(--sticky-top) - var(--space-12));
      overflow-y: auto;
    }
  }
  .toc {
    display: grid;
    gap: var(--space-3);
    align-content: start;
    font-size: 0.875rem;
    padding-left: var(--space-4);
    border-left: 1px solid var(--line);
  }
  .toc h2 {
    font-size: var(--step--2);
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
  }
  .toc ol {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--space-2);
  }
  .toc a {
    color: var(--ink-2);
    text-decoration: none;
    line-height: 1.4;
  }
  .toc a:hover {
    color: var(--brand-strong);
  }
  .toc .lvl-3 {
    padding-left: var(--space-3);
    font-size: 0.8125rem;
  }
  .article-head {
    display: grid;
    gap: var(--space-4);
  }
  .article-head h1 {
    font-size: var(--step-4);
  }
  .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--step--1);
    align-items: center;
    font-variant-numeric: tabular-nums;
  }
  .article-meta > * + *::before {
    content: "·";
    display: inline-block;
    margin-right: var(--space-4);
    color: var(--faint);
    text-decoration: none;
  }
  .article-meta span {
    display: inline-flex;
    gap: var(--space-1);
    align-items: center;
  }
  .article-meta .badge {
    font-family: var(--font-sans);
  }
  .article-meta .badge::before,
  .article-meta > .badge + *::before {
    content: none;
  }
  .article-meta .badge.badge--dot::before {
    content: "";
  }
  .article-meta a {
    color: var(--muted);
  }
  .article-meta a:hover {
    color: var(--ink);
  }
  .lead {
    font-size: var(--step-1);
    color: var(--muted);
    line-height: 1.55;
  }
  .post-card {
    padding: var(--space-6);
    color: inherit;
    align-content: start;
  }
  .post-card .article-meta {
    font-size: var(--step--2);
    letter-spacing: 0.02em;
    padding-bottom: var(--space-5);
  }
  .post-card h2,
  .post-card h3 {
    font-size: var(--step-1);
    letter-spacing: -0.015em;
    line-height: 1.35;
    padding-bottom: var(--space-3);
  }
  .post-card h2 a,
  .post-card h3 a {
    color: var(--ink);
    text-decoration: none;
  }
  .post-card h2 a::after,
  .post-card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
  }
  .post-card {
    position: relative;
  }
  .post-card:hover {
    background: var(--surface-2);
  }
  .post-card:hover h2 a,
  .post-card:hover h3 a {
    color: var(--brand-strong);
  }
  .post-card:focus-within {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
  }
  .post-card h2 a:focus-visible,
  .post-card h3 a:focus-visible {
    outline: none;
  }
  .post-card p {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.55;
  }
  .post-card .cluster {
    position: relative;
    z-index: 1;
    padding-top: var(--space-4);
    align-self: end;
  }
  .list-links {
    list-style: none;
    padding: 0;
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
  }
  .list-links li + li {
    border-top: 1px solid var(--line);
  }
  .list-links > li > a,
  .list-links > li > span.cluster {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
    min-height: 3.25rem;
    padding: var(--space-3) var(--space-5);
    text-decoration: none;
    color: var(--ink);
    line-height: 1.45;
  }
  .list-links > li:not(:has(> a, > span.cluster)) {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-3) var(--space-5);
  }
  .list-links > li > a:hover {
    background: var(--surface-2);
  }
  .list-links > li > a:hover > span {
    color: var(--brand-strong);
  }
  .list-links > li > a:hover small {
    color: var(--muted);
  }
  .list-links .icon {
    inline-size: 1rem;
    block-size: 1rem;
    color: var(--muted);
    margin-top: 0.15em;
  }
  .list-links small {
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
    margin-top: 2px;
    overflow-wrap: anywhere;
  }
  .list-links .nowrap {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
  }
  /* KB vote: the form and the "thanks" line that replaces it (htmx) share
     one fixed-height box. */
  .helpful {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    min-height: 4.5rem;
    padding: var(--space-3) var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    font-weight: var(--weight-medium);
  }
  .helpful > span:first-of-type {
    margin-right: auto;
  }
  .contact-layout {
    display: grid;
    gap: var(--space-8);
    align-items: start;
  }
  @media (min-width: 64rem) {
    .contact-layout {
      grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
      column-gap: var(--space-12);
    }
  }
  .contact-aside {
    display: grid;
    gap: var(--space-4);
  }
  .contact-aside h2 {
    font-size: var(--step--2);
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted);
  }

  /* ---------------------------------------------------------------- styleguide */
  .sg-swatch {
    display: grid;
    gap: var(--space-2);
    align-content: start;
    padding: var(--space-4);
  }
  .sg-swatch__chip {
    display: block;
    height: 3rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
  }
  .sg-chip--ink {
    background: var(--ink);
  }
  .sg-chip--bg {
    background: linear-gradient(90deg, var(--bg) 50%, var(--surface) 50%);
  }
  .sg-chip--line {
    background: var(--line-strong);
  }
  .sg-chip--brand {
    background: var(--brand);
  }

  /* ---------------------------------------------------------------- error page */
  .error-hero {
    padding-block: var(--section);
  }
  .error-hero__inner {
    display: grid;
    gap: var(--space-5);
    justify-items: start;
    max-width: 40rem;
  }
  .error-hero__code {
    font-family: var(--font-mono);
    font-size: clamp(4.5rem, 2.6rem + 8vw, 8.5rem);
    font-weight: 500;
    letter-spacing: -0.06em;
    line-height: 0.9;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .error-hero__code::after {
    content: "";
    display: block;
    width: 3rem;
    height: 2px;
    margin-top: var(--space-6);
    background: var(--brand);
  }
  .error-hero p {
    color: var(--muted);
    max-width: 34rem;
  }
  .error-hero .lead {
    color: var(--ink-2);
  }
  .error-hero__links {
    display: grid;
    gap: var(--space-3);
    width: 100%;
    margin-top: var(--space-4);
    padding-top: var(--space-6);
    border-top: 1px solid var(--line);
  }
  .error-hero__links h2 {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: var(--weight-medium);
  }
  .error-hero__links ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .error-hero__links a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill, 999px);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.9375rem;
    text-decoration: none;
  }
  .error-hero__links a:hover {
    border-color: var(--brand-line, var(--line-strong));
  }
  .error-hero__links .icon {
    inline-size: 1rem;
    block-size: 1rem;
    color: var(--brand-strong, var(--brand));
  }

  /* ================================================================ v2
     Shared storefront pieces: hero art, trust strip, content blocks
     (routes::storefront::blocks), category landing, product page, legal.
     Templates restyle them in their own sheet; nothing here changes box
     sizes on interaction (README: no layout shift). */

  /* ---------------------------------------------------------------- hero art
     Decorative inline SVG: every colour is a token, so any brand and both
     colour modes work; explicit width/height + aspect-ratio keep CLS at 0. */
  .hero-art {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
  }
  .hero-art .art-dot { fill: var(--line-strong); }
  .hero-art .art-frame { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
  .hero-art .art-unit { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.25; }
  .hero-art .art-led { fill: var(--brand); }
  .hero-art .art-led--accent { fill: var(--accent); }
  .hero-art .art-vents path { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; fill: none; }
  .hero-art .art-wire { fill: none; stroke: var(--brand-line); stroke-width: 1.5; stroke-dasharray: 4 5; }
  .hero-art .art-node { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
  .hero-art .art-node--accent { stroke: var(--accent); }
  .hero-art .art-fill-brand { fill: var(--brand); }
  .hero-art .art-fill-accent { fill: var(--accent); }
  .hero__actions { margin-top: var(--space-2); }
  .hero__visual {
    position: relative;
    min-width: 0;
    display: none;
  }
  @media (min-width: 64rem) {
    .hero--classic .hero__visual {
      display: block;
      grid-column: 8 / -1;
    }
    .hero--classic .hero__visual .hero-art {
      position: absolute;
      inset: -1.5rem -2rem auto auto;
      width: 78%;
      opacity: 0.9;
    }
    .hero--classic .hero__visual .hero__panel {
      position: relative;
      margin: 9rem 0 0 0;
      width: 82%;
      box-shadow: var(--shadow-lg);
    }
  }
  @media (max-width: 63.99rem) {
    .hero--classic .hero__visual {
      display: block;
    }
    .hero--classic .hero__visual .hero-art {
      display: none;
    }
  }
  .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--weight-medium);
  }
  .link-arrow .icon {
    inline-size: 1rem;
    block-size: 1rem;
  }

  /* ---------------------------------------------------------------- trust strip */
  .trust-strip {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .trust-strip__list {
    list-style: none;
    margin: 0;
    padding: var(--space-4) 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-8);
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.9375rem;
  }
  .trust-strip__list li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }
  .trust-strip__list .icon {
    inline-size: 1.125rem;
    block-size: 1.125rem;
    color: var(--brand-strong);
  }
  .trust-strip__list strong {
    color: var(--ink);
    font-family: var(--font-mono);
    font-weight: 600;
  }

  /* ---------------------------------------------------------------- blocks */
  .section__head:not(:has(> .eyebrow)) > h2,
  .section__head:not(:has(> .eyebrow)) > p,
  .section__head:not(:has(> .eyebrow)) > .section__lead {
    grid-column: 1 / 10;
  }
  .section__lead {
    color: var(--muted);
    font-size: var(--step-1);
    max-width: 46rem;
  }
  .section__lead > * + * { margin-top: var(--space-3); }
  .block--prose { padding-block: var(--space-10) 0; }
  .block--prose + .block--prose { padding-top: var(--space-6); }
  .prose--wide { max-width: 46rem; }
  .cms-page__body > :last-child { padding-bottom: var(--section); }
  .cms-page__body > .block--prose:first-child { padding-top: var(--space-12); }
  .feature-card__text { color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
  .feature-card__text > * + * { margin-top: var(--space-2); }
  .feature-grid .feature-card h3 { text-wrap: balance; }

  .step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-6);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    counter-reset: none;
  }
  .step-list__item {
    display: grid;
    gap: var(--space-3);
    align-content: start;
    padding-top: var(--space-5);
    border-top: 2px solid var(--line-strong);
    min-width: 0;
  }
  .step-list__item:first-child { border-top-color: var(--brand); }
  .step-list__n {
    font-family: var(--font-mono);
    font-size: var(--step--1);
    color: var(--brand-strong);
    font-variant-numeric: tabular-nums;
  }
  .step-list__n::before { content: "0"; }
  .step-list__item h3 { font-size: var(--step-1); }
  .step-list__text { color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }

  /* relative: the visually hidden "yes / no" labels of ✓ / ✗ cells are
     absolutely positioned and must stay inside the scrolling wrap (else
     they widen the page on phones). */
  .block__table .table-wrap { margin: 0; position: relative; }
  .table td.cell-yes { color: var(--success); font-weight: 600; }
  .table td.cell-no { color: var(--faint); }
  .table--spec thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .table--spec td:first-child,
  .table--spec th[scope="row"] {
    color: var(--muted);
    width: 40%;
  }
  .table--compare th.is-featured { box-shadow: inset 0 -2px 0 var(--brand); }
  .table--compare tbody th { white-space: nowrap; }

  .callout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
    padding: var(--space-5) var(--space-6);
    margin-block: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    max-width: 52rem;
  }
  .callout > .icon { inline-size: 1.25rem; block-size: 1.25rem; margin-top: 0.15rem; color: var(--info); }
  .callout--warning > .icon { color: var(--warning); }
  .callout--success > .icon { color: var(--success); }
  .callout--info { background: var(--info-soft); border-color: color-mix(in oklab, var(--info) 30%, var(--line)); }
  .callout--warning { background: var(--warning-soft); border-color: color-mix(in oklab, var(--warning) 30%, var(--line)); }
  .callout--success { background: var(--success-soft); border-color: color-mix(in oklab, var(--success) 30%, var(--line)); }
  .callout--todo {
    background: repeating-linear-gradient(-45deg, var(--warning-soft) 0 12px, var(--surface) 12px 24px);
    border: 1px dashed var(--warning);
  }
  .callout--todo > .icon { color: var(--warning); }
  .callout__title { font-weight: var(--weight-semibold); color: var(--ink); }
  .block--note .callout, .block--todo .callout { margin-block: var(--space-8) 0; }

  .empty--inline {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }
  .empty--inline > :not(.empty__icon) { grid-column: auto; }
  .empty__title { font-weight: var(--weight-semibold); color: var(--ink); }
  .empty--inline p:not(.empty__title) { color: var(--muted); }
  @media (max-width: 40rem) {
    .empty--inline { grid-template-columns: auto minmax(0, 1fr); }
    .empty--inline > .btn { grid-column: 1 / -1; justify-self: start; }
  }
  .price-grid__note { margin-top: var(--space-4); }
  .price-card__name a { color: inherit; text-decoration: none; }
  .price-card__name a:hover { color: var(--brand-strong); }
  .price-card__name a::after { content: none; }
  .price-card__ribbon .icon { inline-size: 0.75rem; block-size: 0.75rem; margin-inline-end: 0.25rem; }
  .price-card__ribbon--quiet {
    background: var(--surface);
    color: var(--ink-2);
    box-shadow: inset 0 0 0 1px var(--line-strong);
  }

  /* ---------------------------------------------------------------- landing / product hero */
  .page-hero__title {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-width: 0;
  }
  .icon-tile--lg { inline-size: 3rem; block-size: 3rem; border-radius: var(--radius-lg); }
  .icon-tile--lg .icon { inline-size: 1.5rem; block-size: 1.5rem; color: var(--brand-strong); }
  .page-hero .lead { max-width: 48rem; color: var(--ink-2); }
  .page-hero__facts {
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-6);
    color: var(--muted);
    font-size: var(--step--1);
  }
  .page-hero__facts li,
  .page-hero__facts a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }
  .page-hero__facts .icon { inline-size: 1rem; block-size: 1rem; }
  .page-hero__facts strong { color: var(--ink); font-weight: 600; }

  .product-main { min-width: 0; }
  .product-section { display: grid; gap: var(--space-4); }
  .product-section > h2 { font-size: var(--step-3); }
  .feature-list--grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); column-gap: var(--space-6); }
  .order-card__assure {
    list-style: none;
    padding: var(--space-4) 0 0;
    margin: 0;
    border-top: 1px solid var(--line);
    display: grid;
    gap: var(--space-2);
    font-size: var(--step--1);
    color: var(--muted);
  }
  .order-card__assure li { display: flex; gap: var(--space-2); align-items: center; }
  .order-card__assure .icon { inline-size: 1rem; block-size: 1rem; color: var(--brand-strong); }
  .radio-card small { display: block; color: var(--muted); font-size: var(--step--1); }

  /* ---------------------------------------------------------------- about band */
  .about-band {
    display: grid;
    gap: var(--space-8);
    align-items: start;
  }
  .about-band__text { display: grid; gap: var(--space-4); max-width: 38rem; }
  .about-band__text p { color: var(--muted); font-size: var(--step-1); }
  @media (min-width: 64rem) {
    .about-band { grid-template-columns: 5fr 7fr; column-gap: var(--space-12); }
    .about-band .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  /* ---------------------------------------------------------------- legal */
  .legal-body .block--prose,
  .legal-body .block--note,
  .legal-body .block--todo { padding: 0; }
  .legal-body .container { padding: 0; max-width: none; }
  .legal-body .callout { margin-block: 0 var(--space-8); }

  /* Editorial TLD index (also usable by other templates). */
  .tld-index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 var(--space-6);
    margin: 0;
  }
  .tld-index > div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-2);
    border-bottom: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
  }
  .tld-index dt { font-family: var(--font-mono); font-weight: 600; }
  .tld-index dd { margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: var(--step--1); }

  /* ---------------------------------------------------------------- motion */
  @media (prefers-reduced-motion: no-preference) {
    .group-card, .price-card, .feature-card { transition: border-color var(--fast) var(--ease), box-shadow var(--normal) var(--ease); }
  }
}

/* css/utilities.css */
/* Small single-purpose helpers. Prefer components; use these for spacing glue. */
@layer utilities {
  .visually-hidden,
  .sr-only {
    position: absolute !important;
    inline-size: 1px !important;
    block-size: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  .stack {
    display: grid;
    gap: var(--space-4);
    align-content: start;
  }
  .stack-sm {
    display: grid;
    gap: var(--space-2);
    align-content: start;
  }
  .stack-lg {
    display: grid;
    gap: var(--space-8);
    align-content: start;
  }
  .cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
  }
  .between {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    justify-content: space-between;
  }
  .center {
    text-align: center;
  }
  .muted {
    color: var(--muted);
  }
  .small {
    font-size: var(--step--1);
  }
  .mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }
  .nowrap {
    white-space: nowrap;
  }
  .tabular {
    font-variant-numeric: tabular-nums;
  }
  .strong {
    font-weight: var(--weight-semibold);
  }
  .mt-2 {
    margin-top: var(--space-2);
  }
  .mt-4 {
    margin-top: var(--space-4);
  }
  .mt-6 {
    margin-top: var(--space-6);
  }
  .mt-8 {
    margin-top: var(--space-8);
  }
  .mt-12 {
    margin-top: var(--space-12);
  }
  .mb-4 {
    margin-bottom: var(--space-4);
  }
  .mb-8 {
    margin-bottom: var(--space-8);
  }
  .w-full {
    width: 100%;
  }
  .h4 {
    font-size: var(--step-1);
    line-height: 1.3;
    letter-spacing: -0.01em;
  }
  .ml-auto {
    margin-left: auto;
  }
  .text-success {
    color: var(--success);
  }
  .text-danger {
    color: var(--danger);
  }
  .text-brand {
    color: var(--brand-strong);
  }
  .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  @media (max-width: 40rem) {
    .hide-sm {
      display: none !important;
    }
  }
  @media (min-width: 40.01rem) {
    .show-sm {
      display: none !important;
    }
  }
}

