/*
 * LogicBoostKit Media: one stylesheet for the public site and the console.
 *
 * The same visual language as logicboostkit.com: Archivo, one red accent,
 * 2px rules, square corners. The page's Content-Security-Policy allows no
 * inline styles on public pages, so everything a page needs is a class here.
 *
 * Rules:
 * - Every colour is defined on :root first, then overridden for dark. Never
 *   define a colour only inside the dark block.
 * - Red marks the action, the current item and what is live. It never means "bad".
 * - Radius is 0 everywhere. Rules between major blocks are 2px; 1px between
 *   table rows, on inputs and on the secondary button.
 * - No shadows, except the dialog.
 *
 * Sections:
 *    1. Fonts            7. Forms              13. Home
 *    2. Tokens           8. Tables             14. Pricing
 *    3. Base             9. Cells and rows     15. Docs
 *    4. Type            10. Code, status       16. Sign in and sign up
 *    5. Public shell    11. Dialog             17. Legal and errors
 *    6. Buttons         12. Small parts        18. Console shell
 */

/* ── 1. Fonts ──────────────────────────────────────────────────────────────
   Archivo 400, 600 and 800, served from this origin. Copied from
   @fontsource/archivo by scripts/copy-fonts.mjs. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext-800-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── 2. Tokens ───────────────────────────────────────────────────────────── */

:root {
  color-scheme: light dark;

  --color-bg: #f3f2f2;
  --color-surface: #eae9e9; /* inputs, code */
  --color-text: #201e1d;
  --color-accent: #ec3013;
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);

  /* Accent states. Red on the ground is about 3.4:1: fine for marks, buttons
     and large type, not for small text, which takes --color-accent-small. */
  --color-accent-hover: #dd2b0f;
  --color-accent-pressed: #ae1800;
  --color-accent-small: #ae1800;

  /* Tonal ramps, as in the design system. */
  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #fff2ef;
  --color-accent-200: #ffe0d9;
  --color-accent-300: #ffc4b8;
  --color-accent-400: #ff9783;
  --color-accent-500: #ff563c;
  --color-accent-600: #dd2b0f;
  --color-accent-700: #ae1800;
  --color-accent-800: #7c1405;
  --color-accent-900: #4d170e;

  /* The dialog's backdrop and its elevation, the one shadow in the system. */
  --color-backdrop: color-mix(in srgb, #2d2b2b 50%, transparent);
  --shadow-dialog: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

  /* Ink tints, the same recipe in both themes. */
  --ink-body: color-mix(in srgb, var(--color-text) 78%, transparent);
  --ink-meta: color-mix(in srgb, var(--color-text) 70%, transparent);
  --ink-hover: color-mix(in srgb, var(--color-text) 7%, transparent);
  --ink-row: color-mix(in srgb, var(--color-text) 4%, transparent);
  --ink-pressed: color-mix(in srgb, var(--color-text) 14%, transparent);

  --font-heading: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  /* Code, field names and ids. Nothing is downloaded for it. */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

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

  /* 72px at 1280, as the screens are drawn, and fluid below that. */
  --page-edge: clamp(20px, 5.625vw, 72px);
  /* The gap under a page section: 88px at 1280. */
  --section-gap: clamp(56px, 7vw, 88px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #201e1d;
    --color-surface: #2d2b2b;
    --color-text: #f3f2f2;
    --color-divider: color-mix(in srgb, #f3f2f2 40%, transparent);

    --color-accent-hover: #ff9783;
    --color-accent-pressed: #ff9783;
    --color-accent-small: #ff9783;
    --color-accent-600: #ff9783;
    --color-accent-700: #ff9783;

    --shadow-dialog: 0 0 0 1px color-mix(in srgb, #f3f2f2 40%, transparent), 0 12px 32px color-mix(in srgb, #000000 50%, transparent);
  }
}

/* ── 3. Base ─────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
p,
dl,
dd,
figure {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
}
img,
svg {
  display: block;
  max-width: 100%;
}
/* Body-size links take the small-text accent step, which holds contrast. */
a {
  color: var(--color-accent-small);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--color-accent);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
::selection {
  background: color-mix(in srgb, var(--color-accent) 30%, transparent);
}
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--page-edge);
  top: -100px;
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-2);
  color: var(--color-bg);
}

/* ── 4. Type ─────────────────────────────────────────────────────────────── */

/* Display headline: Home and Pricing. */
.display {
  margin-left: -0.04em; /* optical alignment of the first letter with the page edge */
  font-size: clamp(48px, 9vw, 84px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
/* A page's standing, stated once under its title. Full ink. */
.status-line {
  max-width: 640px;
  font-size: 17px;
  font-weight: 600;
  line-height: 28px;
}
.lead {
  max-width: 640px;
  color: var(--ink-body);
  font-size: 17px;
  line-height: 28px;
}
.body {
  color: var(--ink-body);
  font-size: 16px;
  line-height: 26px;
}
.body-small {
  color: var(--ink-body);
  font-size: 15px;
  line-height: 24px;
}
/* A content section opens with a heading block: 2px rule, then the heading. */
.heading-block {
  padding-top: var(--space-6);
  border-top: 2px solid var(--color-divider);
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.1;
}
.page-title {
  font-size: 32px;
  line-height: 1.1;
}
/* A smaller heading under a 2px rule: docs sections, console panels. */
.subheading {
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-divider);
  font-size: 20px;
  line-height: 1.2;
}
.label {
  font-size: 13px;
  font-weight: 800;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.label-muted {
  color: var(--ink-meta);
}
.meta {
  color: var(--ink-meta);
  font-size: 13px;
  line-height: 20px;
}
.mono,
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}
code {
  font-size: 0.9em;
}
.num {
  font-feature-settings: "tnum" 1;
}
.strong {
  font-weight: 800;
}
strong,
b {
  font-weight: 600;
}
.measure {
  max-width: 760px;
}
.stack-top {
  margin-top: var(--space-4);
}
.stack-2 > * + * {
  margin-top: var(--space-2);
}
.stack-3 > * + * {
  margin-top: var(--space-3);
}
.stack-4 > * + * {
  margin-top: var(--space-4);
}
.stack-6 > * + * {
  margin-top: var(--space-6);
}
.stack-8 > * + * {
  margin-top: var(--space-8);
}

/* ── 5. Public shell: header, sections, footer ───────────────────────────── */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-4) var(--page-edge);
  border-bottom: 2px solid var(--color-divider);
}
/* Lockup: "LogicBoostKit / Media". */
.lockup {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-right: auto;
  color: var(--color-text);
  font-size: 18px;
  line-height: 24px;
  text-decoration: none;
}
.lockup:hover {
  color: var(--color-text);
}
.lockup-brand {
  color: var(--ink-meta);
  font-weight: 600;
}
.lockup-sep {
  color: var(--ink-meta);
}
.lockup-product {
  font-weight: 800;
}
.lockup:hover .lockup-product {
  color: var(--color-accent);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
}
.site-nav a:not(.btn) {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-size: 15px;
  line-height: 20px;
  text-decoration: none;
}
.site-nav a:not(.btn):hover {
  color: var(--color-accent);
}
/* The current page: weight 800 and a 10px red square before it. */
.site-nav a[aria-current="page"] {
  font-weight: 800;
}
.site-nav a[aria-current="page"]:hover {
  color: var(--color-text);
}
.site-nav a[aria-current="page"]::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
}

.site-main {
  flex: 1;
}
/* A main whose content fills it: the docs, whose sidebar rule runs to the footer. */
.site-main-fill {
  display: flex;
  flex-direction: column;
}
.section {
  padding: 0 var(--page-edge) var(--section-gap);
}
.section-body {
  margin-top: var(--space-6);
}
.hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: clamp(56px, 8.125vw, 104px) var(--page-edge) var(--section-gap);
}
.hero-compact {
  padding-bottom: clamp(40px, 5vw, 64px);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6) var(--page-edge);
  border-top: 2px solid var(--color-divider);
  color: var(--ink-meta);
  font-size: 13px;
  line-height: 20px;
}
/* Home: the credit sits above the rule, which moves down to the copyright row. */
.site-footer-credited {
  border-top: 0;
}
.site-footer-credit {
  max-width: 760px;
}
.site-footer-credit a {
  color: inherit;
}
.site-footer-credit a:hover {
  color: var(--color-accent);
}
.site-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
}
.site-footer-credited .site-footer-row {
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-divider);
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
}
.site-footer-links a {
  color: inherit;
  text-decoration: none;
}
.site-footer-links a:hover {
  color: var(--color-accent);
}

/* ── 6. Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start; /* labels sit flush left, even in a wide button */
  gap: 6px;
  width: fit-content;
  padding: var(--space-2) 14.4px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.btn svg {
  flex: none;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-bg);
}
.btn-primary:active {
  background: var(--color-accent-pressed);
}
.btn-primary:disabled:hover,
.btn-primary[aria-disabled="true"]:hover {
  background: var(--color-accent);
}
.btn-secondary {
  border-color: var(--color-divider);
}
.btn-secondary:hover {
  background: var(--ink-hover);
  color: var(--color-text);
}
.btn-secondary:active {
  background: var(--ink-pressed);
}
/* Ghost: a quiet action in a row, such as Revoke. Small-text accent. */
.btn-ghost {
  padding-inline: var(--space-1);
  color: var(--color-accent-small);
  font-size: 13px;
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent-small);
}
.btn-ghost:active {
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
}
/* On the red band: ink, with background-coloured text. */
.btn-ink {
  background: var(--color-text);
  color: var(--color-bg);
}
.btn-ink:hover {
  background: color-mix(in srgb, var(--color-text) 82%, var(--color-accent));
  color: var(--color-bg);
}
/* On the ink status bar: the secondary button, inverted. */
.btn-on-ink {
  border-color: color-mix(in srgb, var(--color-bg) 50%, transparent);
  color: var(--color-bg);
}
.btn-on-ink:hover {
  background: color-mix(in srgb, var(--color-bg) 14%, transparent);
  color: var(--color-bg);
}
.btn-block {
  width: 100%;
}
.btn-icon {
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
}

/* A text link with an arrow: "Pricing, with worked examples". */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: fit-content;
  color: var(--color-accent-small);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
}
.arrow-link:hover {
  color: var(--color-accent);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: fit-content;
  color: var(--ink-meta);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}
.back-link:hover {
  color: var(--color-accent);
}

/* ── 7. Forms ────────────────────────────────────────────────────────────── */

.field > label,
.field > .field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-meta);
  font-size: 12px;
}
.field-hint {
  margin-top: 5px;
  color: var(--ink-meta);
  font-size: 13px;
  line-height: 20px;
}
.input {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--color-divider);
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-text);
  caret-color: var(--color-accent);
  font-size: 14px;
}
.input:hover {
  border-color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.input:focus-visible {
  border-color: var(--color-accent);
  outline-offset: 0;
}
.input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.input::placeholder {
  color: var(--ink-meta);
}
.input-mono {
  font-family: var(--font-mono);
  font-size: 13px;
}
textarea.input {
  min-height: 90px;
  resize: vertical;
}
/* A select: the native control, with the chevron drawn beside it. */
.select {
  position: relative;
  display: block;
}
.select-inline {
  display: inline-block;
}
.select select {
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
}
.select svg {
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -8px;
  pointer-events: none;
}
/* An input with a button beside it: the one-time key and its Copy button. */
.input-row {
  display: flex;
  gap: var(--space-2);
}
.input-row .input {
  min-width: 0;
}
.input-row .btn {
  flex: none;
}

/* Segmented control: links (the current one has aria-current) or radios. */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  width: fit-content;
  border: 1px solid var(--color-divider);
}
.seg-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.55;
  text-decoration: none;
  cursor: pointer;
}
.seg-opt + .seg-opt {
  border-left: 1px solid var(--color-divider);
}
.seg-opt input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.seg-opt:hover {
  background: var(--ink-hover);
  color: var(--color-text);
}
.seg-opt[aria-current],
.seg-opt[aria-current]:hover,
.seg-opt:has(input:checked),
.seg-opt:has(input:checked):hover {
  background: var(--color-accent);
  color: var(--color-bg);
}
.seg-opt:has(input:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── 8. Tables ───────────────────────────────────────────────────────────── */

/* The ruled block a table sits in. On narrow screens the table scrolls
   sideways inside it rather than losing columns. */
.table-block {
  overflow-x: auto;
  border-bottom: 2px solid var(--color-divider);
}
.ruled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 22px;
  font-feature-settings: "tnum" 1;
}
.ruled-table th,
.ruled-table td {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  text-align: left;
  vertical-align: baseline;
}
.ruled-table th:last-child,
.ruled-table td:last-child {
  padding-right: 0;
}
/* Rules are drawn on rows, not cells: the rule colour is translucent, and
   cell borders would show a seam at every column. */
.ruled-table thead tr {
  border-bottom: 2px solid var(--color-divider);
}
.ruled-table thead th {
  font-size: 13px;
  font-weight: 800;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ruled-table tbody tr {
  border-top: 1px solid var(--color-divider);
}
.ruled-table thead + tbody tr:first-child {
  border-top: 0;
}
.ruled-table tbody tr:hover {
  background: var(--ink-row);
}
/* Totals open with a 2px rule and are 800. */
.ruled-table tbody tr.is-total {
  border-top: 2px solid var(--color-divider);
  font-weight: 800;
}
.ruled-table .is-right {
  text-align: right;
}
.ruled-table .is-nowrap {
  white-space: nowrap;
}
.ruled-table .is-grow {
  width: 100%;
}
/* Columns with widths given: the table holds them, and the rest share what is left. */
.ruled-table-fixed {
  table-layout: fixed;
}
.ruled-table-fixed .is-grow {
  width: auto;
}
.ruled-table-fixed td {
  overflow-wrap: anywhere;
}
.ruled-table .is-middle {
  vertical-align: middle;
}
.ruled-table-roomy tbody td {
  padding-block: var(--space-4);
}
.ruled-table-small {
  font-size: 14px;
  line-height: 20px;
}
/* The row's name, and the smaller line under it. */
.cell-name {
  font-weight: 600;
}
.cell-sub {
  display: block;
  color: var(--ink-meta);
  font-size: 13px;
  line-height: 18px;
}
.cell-mono {
  color: var(--ink-meta);
  font-family: var(--font-mono);
  font-size: 13px;
}
.cell-muted {
  color: var(--ink-meta);
}

/* A specification table: name, type, description (docs), or code, meaning. */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  border-bottom: 2px solid var(--color-divider);
  font-size: 14px;
  line-height: 20px;
}
.spec-table tr {
  border-top: 1px solid var(--color-divider);
}
.spec-table td,
.spec-table th {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  text-align: left;
  vertical-align: baseline;
  font-weight: 400;
}
.spec-table td:last-child {
  padding-right: 0;
  color: var(--ink-body);
}
.spec-table .spec-name {
  width: 216px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.spec-table .spec-type {
  width: 104px;
  color: var(--ink-meta);
}
.spec-table .spec-code {
  width: 104px;
  font-weight: 800;
  font-feature-settings: "tnum" 1;
}
.spec-table .spec-term {
  width: 176px;
  font-weight: 800;
}
.spec-table code {
  font-size: 13px;
}

/* ── 9. Cells and rows ───────────────────────────────────────────────────── */

/* Cell grid: equal cells separated by 2px rules, 2px rules above and below.
   The rules are borders rather than a gap over a coloured ground: the rule
   colour is translucent, and a ground would show through as hairlines wherever
   a cell lands on a fraction of a pixel. */
.cell-grid {
  display: grid;
  border-top: 2px solid var(--color-divider);
  border-bottom: 2px solid var(--color-divider);
  font-feature-settings: "tnum" 1;
}
.cells-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cells-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cells-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cells-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.cell {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-6) var(--space-8);
  border-left: 2px solid var(--color-divider);
}
/* The first cell of a row is flush with the page edge, with no rule before it. */
.cells-2 > .cell:nth-child(2n + 1),
.cells-3 > .cell:nth-child(3n + 1),
.cells-4 > .cell:nth-child(4n + 1),
.cells-6 > .cell:nth-child(6n + 1) {
  padding-left: 0;
  border-left: 0;
}
/* A further row of cells opens with a rule. */
.cells-2 > .cell:nth-child(n + 3),
.cells-3 > .cell:nth-child(n + 4),
.cells-4 > .cell:nth-child(n + 5),
.cells-6 > .cell:nth-child(n + 7) {
  border-top: 2px solid var(--color-divider);
}
.cell-figure {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.cell-meta {
  color: var(--ink-body);
  font-size: 15px;
  line-height: 24px;
}
/* Console cells: a label above a 32px figure, a 13px meta line below. */
.cell-grid-console .cell {
  padding-bottom: var(--space-6);
}
.cell-grid-console .cell-figure {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.cell-grid-console .cell-meta,
.cell-grid-report .cell-meta {
  color: var(--ink-meta);
  font-size: 13px;
  line-height: 20px;
}
/* Report cells: six across, 26px figures. */
.cell-grid-report .cell {
  padding: var(--space-4) var(--space-4) var(--space-6);
}
.cell-grid-report .cell-figure {
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
/* A 4px bar under a figure: unbilled usage against the threshold. */
.meter {
  display: block;
  width: 100%;
  height: 4px;
}
.meter-track {
  fill: var(--color-divider);
}
.meter-fill {
  fill: var(--color-text);
}

/* Ruled rows: a term and what it means, 5fr / 7fr, under 2px rules. */
.ruled-rows {
  border-bottom: 2px solid var(--color-divider);
}
.ruled-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: var(--space-8);
  padding: var(--space-6) 0;
  border-top: 2px solid var(--color-divider);
}
.ruled-row-term {
  font-size: 20px;
  font-weight: 800;
  line-height: 26px;
}
/* A question on Pricing: a heading that reads as the row's term. */
.faq-question {
  font: inherit;
  letter-spacing: inherit;
}
/* A fixed label column: "Base URL", "API key", the console's Account rows. */
.ruled-row-labelled {
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: baseline;
}
.ruled-row-labelled .ruled-row-term {
  font-size: 17px;
  line-height: 24px;
}
.ruled-row-wide-label {
  grid-template-columns: 200px minmax(0, 1fr);
}
.ruled-row-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  line-height: 24px;
  overflow-wrap: anywhere;
}

/* Numbered steps: 01, 02 and what to do, under 2px rules. */
.steps {
  border-bottom: 2px solid var(--color-divider);
  list-style: none;
}
.step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  padding: var(--space-6) 0;
  border-top: 2px solid var(--color-divider);
}
.step-number {
  font-size: 15px;
  font-weight: 800;
  line-height: 24px;
  font-feature-settings: "tnum" 1;
}
.step-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 24px;
  letter-spacing: 0;
}
.step-body > * + * {
  margin-top: var(--space-3);
}
.steps-compact .step {
  grid-template-columns: 48px minmax(0, 1fr);
  padding: var(--space-4) 0;
  font-size: 15px;
  line-height: 22px;
}
.steps-compact .step-number {
  line-height: 22px;
}

/* A key and value list: the console's account details. */
.kv {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  font-size: 14px;
  line-height: 20px;
}
.kv dt {
  color: var(--ink-meta);
}
.kv dd {
  overflow-wrap: anywhere;
}

/* ── 10. Code, status ────────────────────────────────────────────────────── */

/* Code block: surface fill, no border. Every line in ink; nothing is highlighted. */
.code {
  margin: 0;
  padding: var(--space-4) var(--space-6);
  overflow-x: auto;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 22px;
  white-space: pre;
  tab-size: 2;
}
.code code {
  font-size: inherit;
}
.code-small {
  font-size: 12px;
  line-height: 20px;
}
.code-compact {
  padding: var(--space-3) var(--space-4);
}
.code-wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.code .is-dim {
  color: var(--ink-meta);
}
.code .is-strong {
  font-weight: 600;
}
.code-label {
  margin-bottom: var(--space-3);
}

/* Status squares. Red filled: active. Hollow: something the customer can fix
   (needs card, paused, expired key). Ink filled: stopped (suspended, closed,
   revoked key). Red never means bad. */
.square {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
}
.square-hollow {
  border: 2px solid var(--color-text);
  background: transparent;
}
.square-ink {
  background: var(--color-text);
}
.square-large {
  width: 12px;
  height: 12px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}
.status-large {
  gap: var(--space-3);
}

/* Status bar: ink, with its action on the right. Top of every console page
   for any status other than active. */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}
.status-bar-message {
  flex: 1 1 240px;
}
.status-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.status-bar a:not(.btn) {
  color: inherit;
}

/* DRAFT bar: on a legal page until it is approved. */
.draft-bar {
  padding: var(--space-2) var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

/* Hatched: a decision still open. Never invent what belongs in it. */
.hatched {
  display: inline-block;
  padding: 0 6px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--color-text) 10%, transparent) 0 1px, transparent 1px 8px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-text) 28%, transparent);
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  max-width: 100%;
  vertical-align: baseline;
}
.hatched-block {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: var(--space-2) var(--space-3);
  line-height: 16px;
}

/* ── 11. Dialog ──────────────────────────────────────────────────────────── */

.dialog {
  width: min(560px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  padding: var(--space-8);
  overflow-y: auto;
  border: 0;
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-dialog);
}
.dialog::backdrop {
  background: var(--color-backdrop, rgb(45 43 43 / 50%));
}
.dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.dialog-kicker {
  color: var(--color-accent-small);
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dialog-title {
  font-size: 24px;
  line-height: 1.15;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-2);
}
/* What will happen, and when: the closing dialog's list. */
.consequences {
  border-bottom: 2px solid var(--color-divider);
  list-style: none;
  font-size: 15px;
  line-height: 22px;
}
.consequences li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-divider);
}
.consequences li:first-child {
  border-top-width: 2px;
}
.consequences li > :last-child {
  color: var(--ink-meta);
  font-size: 13px;
}

/* ── 12. Small parts ─────────────────────────────────────────────────────── */

/* A panel's title row: a heading or label on the left, its action on the right. */
.row-between {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
}
.row-center {
  align-items: center;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}
.push-right {
  margin-left: auto;
}

/* ── 13. Home ────────────────────────────────────────────────────────────── */

.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}
/* The red band: the site's one poster moment. Display type only, because
   body text on red cannot reach 4.5:1. */
.band {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-8);
  padding: var(--section-gap) var(--page-edge);
  background: var(--color-accent);
}
.band-title {
  max-width: 900px;
  margin-left: -0.03em;
  color: var(--color-bg);
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
/* On red the accent ring would vanish. */
.band :focus-visible {
  outline-color: var(--color-bg);
}

/* ── 14. Pricing ─────────────────────────────────────────────────────────── */

/* The rate and its conditions are one unit: side by side when there is room,
   stacked inside the same block when there is not. */
.rate-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  border-top: 2px solid var(--color-divider);
  border-bottom: 2px solid var(--color-divider);
}
.rate-cell {
  padding: var(--space-8) var(--space-8) var(--space-8) 0;
  border-right: 2px solid var(--color-divider);
}
.rate-figure {
  margin: var(--space-4) 0 0 -0.05em;
  font-size: clamp(64px, 12vw, 104px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum" 1;
}
.rate-terms {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: var(--space-4) var(--space-6);
  align-content: start;
  padding: var(--space-8) 0 var(--space-8) var(--space-8);
  font-size: 16px;
  line-height: 26px;
}
.rate-terms dt {
  font-weight: 800;
}
.rate-terms dd {
  color: var(--ink-body);
}
.formula {
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

/* ── 15. Docs ────────────────────────────────────────────────────────────── */

.docs {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  flex: 1;
}
.docs-sidebar {
  padding: var(--space-8) var(--space-6) var(--space-8) var(--page-edge);
  border-right: 2px solid var(--color-divider);
}
.docs-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.docs-nav-list {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-2);
  list-style: none;
}
.docs-nav a {
  position: relative;
  display: block;
  padding: 6px 0 6px 18px;
  color: var(--color-text);
  font-size: 15px;
  line-height: 20px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.docs-nav a:hover {
  color: var(--color-accent);
}
.docs-nav a[aria-current="page"] {
  font-weight: 800;
}
.docs-nav a[aria-current="page"]:hover {
  color: var(--color-text);
}
.docs-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
}
/* An endpoint in the sidebar: its method and path, in the code face. */
.docs-nav .is-endpoint {
  font-family: var(--font-mono);
  font-size: 13px;
}
.docs-nav .is-endpoint[aria-current="page"] {
  font-weight: 600;
}
/* Below 720px the sidebar becomes a disclosure above the content. */
.docs-disclosure {
  display: none;
  border-bottom: 2px solid var(--color-divider);
}
.docs-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--page-edge);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}
.docs-disclosure > summary::-webkit-details-marker {
  display: none;
}
.docs-disclosure[open] > summary svg {
  transform: rotate(180deg);
}
.docs-disclosure .docs-nav {
  padding: var(--space-2) var(--page-edge) var(--space-6);
}
.docs-main {
  min-width: 0;
  padding: var(--space-8) var(--page-edge) var(--section-gap) 56px;
}
.docs-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  max-width: 780px;
}
.doc-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
/* The method, in an ink block. */
.method {
  flex: none;
  padding: 4px 8px;
  background: var(--color-text);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  line-height: 16px;
  letter-spacing: 0.08em;
}
.doc-lead {
  margin-top: var(--space-4);
  color: var(--ink-body);
  font-size: 17px;
  line-height: 28px;
}
.doc-section > * + * {
  margin-top: var(--space-4);
}
.doc-section > .subheading + * {
  margin-top: var(--space-3);
}
.doc-section > .code-block + .code-block {
  margin-top: var(--space-6);
}
.doc-section > .subheading + .code-block {
  margin-top: var(--space-4);
}
.doc-section p,
.doc-section :is(ul, ol):not([class]) > li {
  color: var(--ink-body);
  font-size: 16px;
  line-height: 26px;
}
.doc-section p.meta {
  color: var(--ink-meta);
  font-size: 13px;
  line-height: 20px;
}
.doc-section :is(ul, ol):not([class]) {
  padding-left: 1.25rem;
}
.doc-section ul:not([class]) {
  list-style: square;
}
.doc-section :is(ul, ol):not([class]) > li + li {
  margin-top: var(--space-2);
}
.doc-section strong {
  color: var(--color-text);
}
.doc-section > h3 {
  margin-top: var(--space-6);
  font-size: 17px;
  line-height: 24px;
  letter-spacing: 0;
}
.docs-content a:not([class]) {
  text-decoration: underline;
}
/* Refused options and filters: a run of code words. */
.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
}
.token-list li {
  padding: 2px 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 22px;
}
/* Previous and next page, under a 2px rule. */
.doc-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-divider);
}
.doc-pager .is-next {
  margin-left: auto;
}

/* ── 16. Sign in and sign up ─────────────────────────────────────────────── */

.sign {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-8) 72px;
  align-items: start;
  padding: var(--section-gap) var(--page-edge);
}
.sign-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.sign-title {
  margin-left: -0.03em;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
/* The sign-in component mounts here and brings its own card. */
.auth-box {
  max-width: 440px;
  min-height: 120px;
}
/* What the box shows before the component loads, or when it cannot. */
.auth-notice {
  padding: var(--space-8);
  border: 2px solid var(--color-divider);
  color: var(--ink-body);
  font-size: 15px;
  line-height: 24px;
}

/* ── 17. Legal and errors ────────────────────────────────────────────────── */

.legal {
  width: 100%;
  max-width: 840px;
  padding: 64px var(--page-edge) var(--section-gap);
}
.legal .draft-bar {
  margin-top: var(--space-8);
}
.legal-title {
  margin-top: var(--space-6);
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.legal-date {
  margin-top: var(--space-4);
}
.legal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: 40px;
  color: var(--ink-body);
  font-size: 16px;
  line-height: 26px;
}
.legal-body section > * + * {
  margin-top: var(--space-3);
}
.legal-body h2 {
  margin: var(--space-2) 0 var(--space-3);
  padding-top: var(--space-6);
  border-top: 2px solid var(--color-divider);
  color: var(--color-text);
  font-size: 20px;
  line-height: 1.2;
}
.legal-body ul {
  padding-left: 1.25rem;
  list-style: square;
}
.legal-body li + li {
  margin-top: var(--space-2);
}
.legal-body strong {
  color: var(--color-text);
  font-weight: 600;
}

.notice-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-6);
  padding: clamp(56px, 8.125vw, 104px) var(--page-edge) var(--section-gap);
}
.notice-title {
  margin-left: -0.03em;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* ── 18. Console shell ───────────────────────────────────────────────────── */

.console {
  display: flex;
  flex: 1;
  min-height: 100vh;
}
.console-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: none;
  flex-direction: column;
  width: 232px;
  height: 100vh;
  overflow-y: auto;
  border-right: 2px solid var(--color-divider);
}
.console-brand {
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: center;
  height: 72px;
  padding: 0 var(--space-6);
  border-bottom: 2px solid var(--color-divider);
  color: var(--color-text);
  text-decoration: none;
}
.console-brand:hover {
  color: var(--color-text);
}
.console-brand-over {
  color: var(--ink-meta);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}
.console-brand-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  line-height: 24px;
}
.console-nav {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) 0;
}
.console-nav-label {
  padding: var(--space-6) var(--space-6) 0;
  color: var(--ink-meta);
}
.console-nav-label + .console-nav {
  padding-top: var(--space-2);
}
.console-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-6);
  color: var(--color-text);
  font-size: 15px;
  line-height: 20px;
  text-decoration: none;
}
.console-nav a:hover {
  background: var(--ink-hover);
  color: var(--color-text);
}
.console-nav a svg {
  color: var(--ink-meta);
}
/* The current item: weight 800, with the red square at left 7px, top 15px. */
.console-nav a[aria-current="page"] {
  font-weight: 800;
}
.console-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 15px;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
}
.console-sidebar-foot {
  margin-top: auto;
  padding: var(--space-4) 0;
  border-top: 2px solid var(--color-divider);
}
.console-sidebar-foot .console-nav {
  padding: 0;
}
.console-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.console-topbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  height: 72px;
  padding: 0 var(--space-8);
  border-bottom: 2px solid var(--color-divider);
}
.console-topbar .console-brand {
  display: none;
  height: auto;
  margin-right: auto;
  padding: 0;
  border: 0;
}
.console-account {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}
/* The user button's slot: a 36px square with a 2px rule. */
.user-slot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--color-divider);
}
/* Below 768px the sidebar hides and its items move into the top bar. */
.console-mobile-nav {
  display: none;
  border-bottom: 2px solid var(--color-divider);
  overflow-x: auto;
}
.console-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-8) 56px 56px;
}
.console-content-compact {
  gap: var(--space-6);
}
.console-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}
.console-split-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
  padding-right: var(--space-8);
}
.console-split-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-left: var(--space-8);
  border-left: 2px solid var(--color-divider);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .sign {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-main {
    padding-left: var(--space-8);
  }
  .docs {
    grid-template-columns: 264px minmax(0, 1fr);
  }
  .console-split {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-8);
  }
  .console-split-main {
    padding-right: 0;
  }
  .console-split-side {
    padding: var(--space-6) 0 0;
    border-top: 2px solid var(--color-divider);
    border-left: 0;
  }
  /* Six cells go to two rows of three. :nth-child(n) matches every cell, at the
     weight of the rules it has to undo. */
  .cells-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cells-6 > .cell:nth-child(n) {
    padding-left: var(--space-4);
    border-top: 0;
    border-left: 2px solid var(--color-divider);
  }
  .cells-6 > .cell:nth-child(3n + 1) {
    padding-left: 0;
    border-left: 0;
  }
  .cells-6 > .cell:nth-child(n + 4) {
    border-top: 2px solid var(--color-divider);
  }
}

@media (max-width: 767px) {
  .console {
    flex-direction: column;
  }
  .console-sidebar {
    display: none;
  }
  .console-topbar {
    height: 64px;
    padding: 0 var(--page-edge);
  }
  .console-topbar .console-brand {
    display: flex;
  }
  .console-mobile-nav {
    display: block;
  }
  .console-mobile-nav .console-nav {
    flex-direction: row;
    width: max-content;
    padding: 0 calc(var(--page-edge) - var(--space-3));
  }
  .console-mobile-nav .console-nav a {
    padding: var(--space-3);
    white-space: nowrap;
  }
  .console-mobile-nav .console-nav a[aria-current="page"]::before {
    position: static;
  }
  .console-content {
    padding: var(--space-6) var(--page-edge) 40px;
  }
  /* Tables keep their columns and scroll sideways inside their ruled block. */
  .console-content .ruled-table {
    min-width: 640px;
  }
}

@media (max-width: 720px) {
  /* Cell grids go to two columns, then one. */
  .cells-3,
  .cells-4,
  .cells-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cells-3 > .cell:nth-child(n),
  .cells-4 > .cell:nth-child(n),
  .cells-6 > .cell:nth-child(n) {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    border-top: 0;
    border-left: 2px solid var(--color-divider);
  }
  .cells-3 > .cell:nth-child(2n + 1),
  .cells-4 > .cell:nth-child(2n + 1),
  .cells-6 > .cell:nth-child(2n + 1) {
    padding-left: 0;
    border-left: 0;
  }
  .cells-3 > .cell:nth-child(n + 3),
  .cells-4 > .cell:nth-child(n + 3),
  .cells-6 > .cell:nth-child(n + 3) {
    border-top: 2px solid var(--color-divider);
  }
  /* An odd last cell takes the whole row. */
  .cell-grid > .cell:last-child:nth-child(2n + 1) {
    grid-column: 1 / -1;
  }

  /* Ruled 5fr / 7fr rows stack inside the same block. */
  .ruled-row,
  .ruled-row-labelled,
  .rate-row,
  .pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .ruled-row {
    row-gap: var(--space-2);
  }
  .rate-cell {
    padding: var(--space-6) 0;
    border-right: 0;
  }
  .rate-terms {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 0 var(--space-6);
  }
  .rate-terms dd + dt {
    margin-top: var(--space-4);
  }
  .step {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  /* Worked examples: one block per job, its figures as a two-column list. */
  .examples thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .examples,
  .examples tbody,
  .examples tr,
  .examples td {
    display: block;
  }
  .examples tbody tr {
    padding: var(--space-4) 0;
    border-top: 1px solid var(--color-divider);
  }
  .examples tbody tr:first-child {
    border-top: 0;
  }
  .examples tbody td {
    padding: 0;
    text-align: left;
  }
  .examples tbody td[data-label] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-4);
    margin-top: var(--space-1);
  }
  .examples tbody td[data-label]::before {
    content: attr(data-label);
    color: var(--ink-meta);
    font-weight: 400;
    text-align: left;
  }

  /* Specification tables: the name and type on one line, the description below. */
  .spec-table,
  .spec-table tbody {
    display: block;
  }
  .spec-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-4);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--color-divider);
  }
  .spec-table td,
  .spec-table th,
  .spec-table .spec-name,
  .spec-table .spec-type,
  .spec-table .spec-code,
  .spec-table .spec-term {
    width: auto;
    padding: 0;
  }
  .spec-table td:last-child {
    grid-column: 1 / -1;
    margin-top: var(--space-1);
  }

  /* The docs sidebar becomes a disclosure above the content. */
  .docs {
    display: block;
  }
  .docs-sidebar {
    display: none;
  }
  .docs-disclosure {
    display: block;
  }
  .docs-main {
    padding: var(--space-6) var(--page-edge) var(--section-gap);
  }

  .legal {
    padding-top: 40px;
  }
  .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .kv dd + dt {
    margin-top: var(--space-2);
  }
}

@media (max-width: 480px) {
  .cells-2,
  .cells-3,
  .cells-4,
  .cells-6 {
    grid-template-columns: minmax(0, 1fr);
  }
  .cell-grid > .cell:nth-child(n) {
    padding-left: 0;
    padding-right: 0;
    border-top: 0;
    border-left: 0;
  }
  .cell-grid > .cell:nth-child(n + 2) {
    border-top: 2px solid var(--color-divider);
  }
  .code {
    padding-inline: var(--space-4);
  }
  .dialog {
    padding: var(--space-6);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
