/* MD4 Labs developer site.
   Brand: navy, teal and amber (as md4labs.com), DM Sans for text, Playfair Display for page titles, JetBrains
   Mono for code. Every font is served from this site (the page CSP allows no other), under the SIL Open Font
   License (assets/fonts/OFL-*.txt).
   Light and dark are two designed themes: the device setting picks one, the header button overrides it
   (js/theme.js sets data-theme on <html>). Colors live in the tokens below; components never use raw colors.

   Line breaking, the rule for the whole site: identifiers, scopes, codes, header names, method + path pairs
   and short code never break inside. Inline code is nowrap. Only elements marked .long (URLs, long values)
   may wrap, at <wbr> points first. Tables never crush a column: they scroll, or stack into cards when they
   don't fit (js/layout.js). */

/* ─── Fonts ─────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "DM Sans";
  src: url("assets/fonts/dm-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/playfair-display-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Tokens ────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* Brand */
  --navy: #0b1f3a;
  --navy-deep: #071428;
  --navy-mid: #132845;
  --navy-light: #1e3a5f;
  --teal: #2ec4b6;
  --teal-dark: #1a8a82;
  --teal-light: #7ee0d6;
  --amber: #e8a838;

  /* Surfaces and text */
  --bg: #ffffff;
  --bg-subtle: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #eaeff5;
  --border: #dde4ee;
  --border-strong: #c2cddb;
  --text: #0b1f3a;
  --text-2: #33496a;
  --text-3: #566b89;
  --link: #0b6e66;
  --link-hover: #08544e;
  --accent: #1a8a82;
  --accent-strong: #0b6e66;
  --accent-soft: #e5f6f4;
  --accent-border: #a7e0d9;
  --focus: #1e3a5f;
  --selection: #c7eee9;

  /* Status */
  --ok: #067647;
  --ok-soft: #e7f6ee;
  --ok-border: #a6dcbf;
  --warn: #8a5a00;
  --warn-soft: #fdf3e1;
  --warn-border: #efd093;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --danger-border: #f3bfb8;
  --info: #0b6e66;
  --info-soft: #e5f6f4;
  --info-border: #a7e0d9;

  /* HTTP methods */
  --get-text: #0b5e57;
  --get-bg: #e1f5f2;
  --get-border: #b3e4dd;
  --post-text: #7a4b00;
  --post-bg: #fdf0d8;
  --post-border: #f1d39b;
  --delete-text: #a3241a;
  --delete-bg: #fde7e5;
  --delete-border: #f5c1bb;

  /* Code: navy blocks in both themes */
  --code-bg: #0b1f3a;
  --code-head: #0f2747;
  --code-border: #0b1f3a;
  --code-text: #e6edf5;
  --code-muted: #8a9db5;
  --code-key: #7ee0d6;
  --code-string: #f6cf7e;
  --code-number: #ffab91;
  --code-literal: #c3b1ff;
  --code-keyword: #9ec3ff;
  --inline-code-bg: #eef2f7;
  --inline-code-border: #dbe3ee;
  --inline-code-text: #12325c;

  /* Charts (validated for color-vision deficiency against this theme's surface) */
  --chart-ok: #0f8f84;
  --chart-error: #c46f12;
  --chart-grid: #e3e8ef;
  --chart-axis: #c2cddb;
  --range-band: #cdeee9;
  --range-band-border: #7fcfc5;

  /* Type */
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Space (4px steps) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgb(11 31 58 / 0.06);
  --shadow: 0 1px 2px rgb(11 31 58 / 0.05), 0 6px 20px -6px rgb(11 31 58 / 0.12);
  --shadow-lg: 0 20px 50px -12px rgb(7 20 40 / 0.35);
  --wrap: 80rem;
  --wrap-wide: 100rem;
  --gutter: 1rem;
  --header-h: 3.75rem;
}

/* Dark: its own steps, not an inversion. Repeated below for an explicit choice in the header. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #06111f;
    --bg-subtle: #091629;
    --surface: #0d1d35;
    --surface-2: #112443;
    --surface-3: #16304f;
    --border: #223f66;
    --border-strong: #315580;
    --text: #e8eef6;
    --text-2: #b9c7da;
    --text-3: #93a5bd;
    --link: #5ed6cb;
    --link-hover: #8de6dd;
    --accent: #2ec4b6;
    --accent-strong: #5ed6cb;
    --accent-soft: #0f2e3a;
    --accent-border: #1f5a5c;
    --focus: #7ee0d6;
    --selection: #1f5a5c;
    --ok: #5fd39a;
    --ok-soft: #0f2c22;
    --ok-border: #1f5640;
    --warn: #f2c063;
    --warn-soft: #2e2410;
    --warn-border: #5c4415;
    --danger: #ff8b80;
    --danger-soft: #3a1a1d;
    --danger-border: #6b2a2a;
    --info: #5ed6cb;
    --info-soft: #0f2e3a;
    --info-border: #1f5a5c;
    --get-text: #6fe0d4;
    --get-bg: #0f3236;
    --get-border: #1d5a5c;
    --post-text: #f5c86a;
    --post-bg: #33270f;
    --post-border: #5e4718;
    --delete-text: #ff9a8f;
    --delete-bg: #3b1b1e;
    --delete-border: #6b2c2c;
    --code-bg: #08172b;
    --code-head: #0b1d36;
    --code-border: #1d3657;
    --inline-code-bg: #142a48;
    --inline-code-border: #213d63;
    --inline-code-text: #d8e4f2;
    --chart-ok: #20a194;
    --chart-error: #c9821f;
    --chart-grid: #1a3050;
    --chart-axis: #2b4b73;
    --range-band: #13423f;
    --range-band-border: #2e8f86;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 24px -8px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / 0.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #06111f;
  --bg-subtle: #091629;
  --surface: #0d1d35;
  --surface-2: #112443;
  --surface-3: #16304f;
  --border: #223f66;
  --border-strong: #315580;
  --text: #e8eef6;
  --text-2: #b9c7da;
  --text-3: #93a5bd;
  --link: #5ed6cb;
  --link-hover: #8de6dd;
  --accent: #2ec4b6;
  --accent-strong: #5ed6cb;
  --accent-soft: #0f2e3a;
  --accent-border: #1f5a5c;
  --focus: #7ee0d6;
  --selection: #1f5a5c;
  --ok: #5fd39a;
  --ok-soft: #0f2c22;
  --ok-border: #1f5640;
  --warn: #f2c063;
  --warn-soft: #2e2410;
  --warn-border: #5c4415;
  --danger: #ff8b80;
  --danger-soft: #3a1a1d;
  --danger-border: #6b2a2a;
  --info: #5ed6cb;
  --info-soft: #0f2e3a;
  --info-border: #1f5a5c;
  --get-text: #6fe0d4;
  --get-bg: #0f3236;
  --get-border: #1d5a5c;
  --post-text: #f5c86a;
  --post-bg: #33270f;
  --post-border: #5e4718;
  --delete-text: #ff9a8f;
  --delete-bg: #3b1b1e;
  --delete-border: #6b2c2c;
  --code-bg: #08172b;
  --code-head: #0b1d36;
  --code-border: #1d3657;
  --inline-code-bg: #142a48;
  --inline-code-border: #213d63;
  --inline-code-text: #d8e4f2;
  --chart-ok: #20a194;
  --chart-error: #c9821f;
  --chart-grid: #1a3050;
  --chart-axis: #2b4b73;
  --range-band: #13423f;
  --range-band-border: #2e8f86;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 24px -8px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / 0.7);
}

/* ─── Base ──────────────────────────────────────────────────────────────── */

/* hidden always hides, whatever display a component sets. */
[hidden] {
  display: none !important;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-6));
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--selection);
}

main {
  flex: 1;
  min-width: 0;
}
main:focus {
  outline: none;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: 1.25;
  margin: 0 0 var(--s-3);
  font-weight: 650;
  text-wrap: balance;
}
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1.4rem + 2.4vw, var(--text-5xl));
  letter-spacing: -0.01em;
  line-height: 1.1;
}
h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.015em;
}
h3 {
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}
h4 {
  font-size: var(--text-base);
}
p,
ul,
ol,
dl,
pre {
  margin: 0 0 var(--s-4);
}
p {
  text-wrap: pretty;
}
ul,
ol {
  padding-left: 1.35rem;
}
li + li {
  margin-top: var(--s-1);
}
li::marker {
  color: var(--text-3);
}
strong {
  font-weight: 650;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.2em;
}
a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-8) 0;
}

img,
svg {
  max-width: 100%;
}
img {
  height: auto;
}

/* ─── Code: inline ──────────────────────────────────────────────────────── */

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}
:not(pre) > code {
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--inline-code-bg);
  border: 1px solid var(--inline-code-border);
  color: var(--inline-code-text);
  white-space: nowrap;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* A genuinely long value (a URL, a long id): may wrap, at <wbr> points first. */
:not(pre) > code.long {
  white-space: normal;
  overflow-wrap: anywhere;
}
a > code {
  color: inherit;
}
h2 code,
h3 code,
h4 code {
  font-size: 0.82em;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  font-size: 0.78em;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* ─── Code: blocks ──────────────────────────────────────────────────────── */

pre {
  margin: 0;
  padding: var(--s-4) var(--s-5);
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.8125rem;
  line-height: 1.7;
  tab-size: 2;
  border-radius: var(--radius);
  scrollbar-color: #2b4b73 transparent;
}
pre code {
  font-size: inherit;
  white-space: pre;
}

.code-block {
  position: relative;
  margin: 0 0 var(--s-5);
  border-radius: var(--radius);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  overflow: hidden;
  min-width: 0;
}
.code-block > pre,
.code-block .code-panel > pre {
  border-radius: 0;
}
.code-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 2.5rem;
  padding: 0 var(--s-2) 0 var(--s-4);
  background: var(--code-head);
  border-bottom: 1px solid rgb(255 255 255 / 0.07);
  color: var(--code-muted);
  font-size: var(--text-xs);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--code-muted);
}
.code-title {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--code-text);
  white-space: nowrap;
}
/* The title repeats what's beside the block, so it gives way when the block is narrow, never truncated. */
.code-block {
  container-type: inline-size;
}
@container (max-width: 30rem) {
  .code-title {
    display: none;
  }
}
@container (max-width: 46rem) {
  .has-tabs .code-title {
    display: none;
  }
}
.code-head .spacer {
  flex: 1;
}
.code-tabs {
  flex: none;
  display: flex;
  align-items: stretch;
  gap: var(--s-1);
  margin-left: calc(var(--s-2) * -1);
  align-self: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.code-tab {
  appearance: none;
  border: 0;
  background: none;
  color: var(--code-muted);
  font: 600 var(--text-xs) / 1 var(--font-sans);
  padding: 0 var(--s-2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.code-tab:hover {
  color: var(--code-text);
}
.code-tab[aria-selected="true"] {
  color: #fff;
  border-bottom-color: var(--teal);
}
.code-tab:focus-visible {
  outline-color: var(--teal-light);
  outline-offset: -3px;
}
.code-panel[hidden] {
  display: none;
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  appearance: none;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(255 255 255 / 0.04);
  color: var(--code-text);
  font: 600 var(--text-xs) / 1 var(--font-sans);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.copy:hover {
  background: rgb(255 255 255 / 0.1);
}
.copy:focus-visible {
  outline-color: var(--teal-light);
}
.copy svg {
  width: 0.9rem;
  height: 0.9rem;
}
.copy.copied {
  color: var(--teal-light);
  border-color: rgb(126 224 214 / 0.45);
}

/* Syntax colors (js/highlight.js): spans, text only */
.tok-key {
  color: var(--code-key);
}
.tok-str {
  color: var(--code-string);
}
.tok-num {
  color: var(--code-number);
}
.tok-lit {
  color: var(--code-literal);
}
.tok-kw {
  color: var(--code-keyword);
}
.tok-com {
  color: var(--code-muted);
  font-style: italic;
}
.tok-flag {
  color: var(--code-keyword);
}
.tok-var {
  color: var(--code-literal);
}
.tok-punct {
  color: var(--code-muted);
}
.tok-method {
  color: var(--code-key);
  font-weight: 700;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.wrap-wide {
  width: 100%;
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
@media (min-width: 48rem) {
  :root {
    --gutter: 1.5rem;
  }
}
@media (min-width: 90rem) {
  :root {
    --gutter: 2rem;
  }
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -4rem;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--teal);
  color: var(--navy-deep);
  font-weight: 650;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  top: var(--s-3);
}

/* Header: navy in both themes */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy);
  color: #e6edf5;
  border-bottom: 1px solid #1e3a5f;
  --focus: var(--teal-light);
}
:root[data-theme-resolved="dark"] .site-header {
  background: rgb(7 20 40 / 0.94);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header {
    backdrop-filter: saturate(1.4) blur(10px);
  }
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}
.brand:hover {
  color: #fff;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
  flex: none;
}
.brand-mark img {
  width: 1.5rem;
  height: 1.5rem;
}
.brand-name {
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-weight: 500;
  color: var(--teal-light);
  font-size: 1.0625rem;
}
.env-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgb(232 168 56 / 0.5);
  background: rgb(232 168 56 / 0.12);
  color: #f2c063;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.env-badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}
.site-nav ul {
  display: flex;
  gap: var(--s-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li + li {
  margin: 0;
}
.site-nav a {
  display: block;
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 550;
  white-space: nowrap;
}
.site-nav a:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.06);
}
.site-nav a[aria-current="page"] {
  color: #fff;
  background: rgb(46 196 182 / 0.16);
  box-shadow: inset 0 -2px 0 var(--teal);
}
.header-tools {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
  flex: none;
}
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 2.25rem;
  padding: 0 0.45rem 0 0.7rem;
  border-radius: 8px;
  border: 1px solid #2b4b73;
  background: rgb(255 255 255 / 0.05);
  color: #cbd5e1;
  font: 500 var(--text-sm) / 1 var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
}
.search-trigger:hover {
  border-color: #3d6290;
  color: #fff;
}
.search-trigger svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.search-trigger .search-label {
  min-width: 5rem;
  text-align: left;
}
.search-trigger kbd {
  background: rgb(255 255 255 / 0.06);
  border-color: #2b4b73;
  color: #cbd5e1;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: 1px solid #2b4b73;
  background: rgb(255 255 255 / 0.05);
  color: #cbd5e1;
  cursor: pointer;
  flex: none;
}
.icon-btn:hover {
  color: #fff;
  border-color: #3d6290;
}
.icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}
.theme-toggle .icon-moon,
:root[data-theme-resolved="dark"] .theme-toggle .icon-sun {
  display: none;
}
:root[data-theme-resolved="dark"] .theme-toggle .icon-moon {
  display: block;
}
.auth-slot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  white-space: nowrap;
}
.auth-who {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  max-width: 16rem;
  color: #cbd5e1;
  font-size: var(--text-sm);
}
.auth-who .avatar {
  flex: none;
}
.auth-email {
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--navy-deep);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
}
.site-header .btn-secondary {
  background: transparent;
  color: #e6edf5;
  border-color: #2b4b73;
  box-shadow: none;
}
.site-header .btn-secondary:hover {
  background: rgb(255 255 255 / 0.06);
  border-color: #3d6290;
  color: #fff;
}

@media (max-width: 89.99rem) {
  .auth-email {
    display: none;
  }
}
@media (max-width: 74rem) {
  .search-trigger .search-label,
  .search-trigger kbd {
    display: none;
  }
  .search-trigger {
    width: 2.25rem;
    padding: 0;
    justify-content: center;
  }
}
/* Two rows: the brand and tools, then the main navigation (scrolls sideways if it must, never the page). */
@media (max-width: 64rem) {
  :root {
    --header-h: 6.25rem;
  }
  .header-inner {
    flex-wrap: wrap;
    row-gap: 0;
    min-height: 0;
    padding-top: var(--s-2);
  }
  .site-nav {
    order: 5;
    flex-basis: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1);
    padding: var(--s-2) var(--gutter) var(--s-2);
  }
  .site-nav::-webkit-scrollbar {
    display: none;
  }
  /* A hint that the row scrolls sideways. */
  .site-nav {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
  }
  .site-nav a {
    padding: 0.35rem 0.6rem;
    font-size: var(--text-sm);
  }
}
.nav-short {
  display: none;
}
@media (max-width: 30rem) {
  /* Phones: the mark stands for the name (the link is labelled), and the avatar gives way to Sign out. */
  .brand-name,
  .auth-who {
    display: none;
  }
  /* The menu fits a phone's width: the mark is the way home, and "API reference" is "Reference". */
  .site-nav li:has(> [data-nav="index"]) {
    display: none;
  }
  .nav-full {
    display: none;
  }
  .nav-short {
    display: inline;
  }
  .site-nav a {
    padding-inline: 0.5rem;
  }
  .brand-sub {
    display: none;
  }
  .header-inner {
    column-gap: var(--s-2);
  }
  .env-badge {
    font-size: 0.625rem;
    padding: 0.1rem 0.45rem;
  }
}

.config-banner {
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 1px solid var(--warn-border);
  font-size: var(--text-sm);
  padding: var(--s-2) 0;
}

/* Footer */
.site-footer {
  margin-top: var(--s-20);
  background: var(--navy-deep);
  color: #a9b8cc;
  font-size: var(--text-sm);
  --focus: var(--teal-light);
}
.footer-inner {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  padding-block: var(--s-12) var(--s-8);
}
.site-footer h2 {
  color: #fff;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  font-weight: 650;
  margin-bottom: var(--s-3);
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li + li {
  margin-top: var(--s-2);
}
.site-footer a {
  color: #cbd5e1;
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-brand p {
  max-width: 26rem;
}
.footer-brand .brand {
  margin-bottom: var(--s-4);
}
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-6);
  padding-block: var(--s-5);
  border-top: 1px solid #132845;
  color: #8a9db5;
  font-size: var(--text-xs);
}
.footer-base p {
  margin: 0;
}
@media (max-width: 48rem) {
  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Page head */
.page-head {
  padding: var(--s-12) 0 var(--s-10);
  background:
    radial-gradient(60rem 22rem at 85% -40%, rgb(46 196 182 / 0.13), transparent 70%),
    var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.page-head h1 {
  margin-bottom: var(--s-4);
}
.page-head .lead {
  margin: 0;
}
.page-head .btn-row {
  margin-top: var(--s-6);
}
.page-body {
  padding-top: var(--s-10);
}
.code-link {
  text-decoration: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 var(--s-3);
  color: var(--accent-strong);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lead {
  font-size: var(--text-lg);
  color: var(--text-2);
  max-width: 46rem;
  line-height: 1.6;
}

.section {
  padding-block: var(--s-12);
}
.section-head {
  max-width: 44rem;
  margin-bottom: var(--s-8);
}
.section-head h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
}
.section-head p {
  color: var(--text-2);
  margin: 0;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 2.5rem;
  padding: 0 var(--s-4);
  border-radius: 8px;
  border: 1px solid transparent;
  font: 650 0.9375rem / 1.2 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}
.btn svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--teal);
  color: var(--navy-deep);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.25) inset,
    0 2px 8px -2px rgb(46 196 182 / 0.45);
}
.btn-primary:hover:not(:disabled) {
  background: #45d3c5;
  color: var(--navy-deep);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-3);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger-solid {
  background: #b42318;
  color: #fff;
}
.btn-danger-solid:hover:not(:disabled) {
  background: #912018;
  color: #fff;
}
.btn-small {
  min-height: 2rem;
  padding: 0 var(--s-3);
  font-size: var(--text-sm);
  border-radius: 7px;
}
.btn-large {
  min-height: 3rem;
  padding: 0 var(--s-6);
  font-size: var(--text-base);
}
.btn-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--link);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.btn-link:hover {
  color: var(--link-hover);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.btn-row:first-child {
  margin-top: 0;
}

/* ─── Badges, methods, chips ────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok-border);
}
.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-border);
}
.badge-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}
.badge-info {
  background: var(--info-soft);
  color: var(--info);
  border-color: var(--info-border);
}
.badge-neutral {
  background: var(--surface-2);
  color: var(--text-2);
}
.badge code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 0.95em;
}
.mono {
  font-family: var(--font-mono);
}

.method {
  display: inline-block;
  min-width: 3.4rem;
  padding: 0.05rem 0.35rem;
  border-radius: 5px;
  border: 1px solid var(--get-border);
  background: var(--get-bg);
  color: var(--get-text);
  font: 700 0.6875rem / 1.6 var(--font-mono);
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}
.method-post {
  border-color: var(--post-border);
  background: var(--post-bg);
  color: var(--post-text);
}
.method-delete {
  border-color: var(--delete-border);
  background: var(--delete-bg);
  color: var(--delete-text);
}
/* A method and its path stay together; when the line is too narrow for both, the path moves under the
   method rather than breaking. */
.endpoint .muted {
  font-family: var(--font-sans);
}
.endpoint {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem var(--s-2);
  max-width: 100%;
  vertical-align: middle;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text);
}

.status-code {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 5px;
  font: 700 var(--text-xs) / 1.6 var(--font-mono);
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.status-2xx {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok-border);
}
.status-4xx {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-border);
}
.status-5xx {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s-1);
}
.chip {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font: 500 var(--text-xs) / 1.6 var(--font-mono);
  white-space: nowrap;
}

/* ─── Alerts and callouts ───────────────────────────────────────────────── */

.callout,
.alert {
  position: relative;
  margin: 0 0 var(--s-5);
  padding: var(--s-4) var(--s-5) var(--s-4) calc(var(--s-5) + 1.4rem);
  border-radius: var(--radius);
  border: 1px solid var(--info-border);
  background: var(--info-soft);
  color: var(--text);
}
.callout::before,
.alert::before {
  content: "";
  position: absolute;
  left: var(--s-4);
  top: calc(var(--s-4) + 0.22rem);
  width: 1.1rem;
  height: 1.1rem;
  background: var(--info);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
}
.callout > :last-child,
.alert > :last-child {
  margin-bottom: 0;
}
.callout p,
.alert p {
  margin-bottom: var(--s-2);
  color: var(--text-2);
}
.callout-title,
.alert-title {
  font-weight: 700;
  color: var(--text) !important;
  margin-bottom: var(--s-1) !important;
}
.callout-key {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.callout-key::before {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  background: var(--accent);
}
.callout-warn,
.alert-warn {
  border-color: var(--warn-border);
  background: var(--warn-soft);
}
.callout-warn::before,
.alert-warn::before {
  background: var(--warn);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
}
.alert-error {
  border-color: var(--danger-border);
  background: var(--danger-soft);
}
.alert-error::before {
  background: var(--danger);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6M9 9l6 6'/%3E%3C/svg%3E");
}
.alert-success {
  border-color: var(--ok-border);
  background: var(--ok-soft);
}
.alert-success::before {
  background: var(--ok);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}
.alert-error .alert-title {
  color: var(--danger) !important;
}
.alert-warn .alert-title {
  color: var(--warn) !important;
}
.alert-success .alert-title {
  color: var(--ok) !important;
}
.alert ul {
  margin: var(--s-2) 0;
}
.request-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* ─── Tables ────────────────────────────────────────────────────────────── */

.table-wrap {
  margin: 0 0 var(--s-5);
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
th,
td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  border-top: 1px solid var(--border);
  color: var(--text-2);
}
tbody tr:first-child td {
  border-top: 0;
}
th.desc {
  min-width: 15rem;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nowrap {
  white-space: nowrap;
}
tr:target td {
  background: var(--accent-soft);
}
tr:target td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* A table that doesn't fit stacks: each row a card, each cell labelled with its column. */
.table-wrap.stacked {
  overflow: visible;
  /* Same border width as the table view, so stacking never changes the width it was measured at. */
  border-color: transparent;
  background: none;
  border-radius: 0;
}
.stacked table,
.stacked tbody,
.stacked tr,
.stacked td {
  display: block;
  width: 100%;
}
.stacked thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.stacked tr {
  margin-bottom: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.stacked td {
  padding: var(--s-1) 0;
  border: 0;
  text-align: left;
}
.stacked td.num {
  text-align: left;
}
.stacked td[data-label]::before {
  content: attr(data-label);
  display: block;
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.stacked td:first-child {
  padding-bottom: var(--s-2);
  color: var(--text);
}
.stacked td:first-child::before {
  display: none;
}
.stacked td:empty {
  display: none;
}
/* Compact cards (the console's tables): short values side by side (two on a phone, more where there's room), long
   ones (.wide) twice as wide, the first across the top. */
.stacked table.compact tr {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  column-gap: var(--s-4);
}
.stacked td.nowrap {
  white-space: normal;
}
.stacked table.compact td:first-child {
  grid-column: 1 / -1;
}
.stacked table.compact td.wide {
  grid-column: span 2;
}
@media (max-width: 22rem) {
  .stacked table.compact td.wide {
    grid-column: 1 / -1;
  }
}
.stacked tr:target {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.stacked tr:target td {
  background: none;
  box-shadow: none;
}

/* ─── Forms ─────────────────────────────────────────────────────────────── */

.form {
  display: grid;
  gap: var(--s-4);
  align-content: start;
}
.field {
  display: grid;
  gap: var(--s-1);
  min-width: 0;
  align-content: start;
}
.field-row {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}
label,
legend {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
}
.optional {
  color: var(--text-3);
  font-weight: 450;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.5;
}
textarea.code,
input.code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--text-3);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}
[aria-invalid="true"] {
  border-color: var(--danger) !important;
}
::placeholder {
  color: var(--text-3);
  opacity: 0.85;
}
.hint {
  margin: 0;
  color: var(--text-3);
  font-size: var(--text-sm);
}
.hint:empty {
  display: none;
}
.input-row {
  display: flex;
  gap: var(--s-2);
  align-items: stretch;
}
.input-row > input,
.input-row > select {
  flex: 1;
  min-width: 0;
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend {
  padding: 0;
  margin-bottom: var(--s-1);
}
.checks {
  display: grid;
  gap: var(--s-2);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  margin-top: var(--s-2);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 450;
  cursor: pointer;
}
.check:hover {
  border-color: var(--border-strong);
}
.check:has(input:checked) {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.check input {
  margin-top: 0.3rem;
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  flex: none;
}
.check-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.check-text .muted {
  font-weight: 450;
}
.req {
  color: var(--danger);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.segmented button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--text-2);
  font: 600 var(--text-sm) / 1 var(--font-sans);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.segmented button:hover {
  color: var(--text);
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow:
    var(--shadow-sm),
    0 0 0 1px var(--border);
}

/* ─── Cards and grids ───────────────────────────────────────────────────── */

.card {
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.narrow-card {
  max-width: 36rem;
}
.narrow-card h1 {
  font-size: var(--text-3xl);
}
.card > :last-child {
  margin-bottom: 0;
}
.card h2,
.card h3 {
  margin-bottom: var(--s-2);
}
.card p {
  color: var(--text-2);
}
.grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.grid-2 {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
.subsection {
  margin-top: var(--s-8);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.panel-head h2,
.panel-head h3 {
  margin: 0;
}
.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-3) var(--s-6);
  margin: 0;
}
.facts dt {
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 600;
  padding-top: 0.1rem;
}
.facts dd {
  margin: 0;
  min-width: 0;
}
@media (max-width: 36rem) {
  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .facts dd {
    margin-bottom: var(--s-3);
  }
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--s-4);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent-border);
}
.feature-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.card-link:hover {
  color: inherit;
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
}
.card-link h3 {
  color: var(--text);
}
.more {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  margin-top: var(--s-3);
  color: var(--link);
  font-weight: 650;
  font-size: var(--text-sm);
}
.more svg {
  width: 1rem;
  height: 1rem;
}

/* ─── Utilities ─────────────────────────────────────────────────────────── */

.muted {
  color: var(--text-3);
}
.small {
  font-size: var(--text-sm);
}
.tnum {
  font-variant-numeric: tabular-nums;
}
.select-all {
  user-select: all;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.spacer {
  flex: 1;
}
.loading {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text-3);
}
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.empty {
  padding: var(--s-6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  background: var(--bg-subtle);
}
.empty > :last-child {
  margin-bottom: 0;
}
.empty pre {
  margin-top: var(--s-3);
}

/* ─── Home ──────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy-deep);
  color: #cbd5e1;
  --focus: var(--teal-light);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(46 196 182 / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgb(46 196 182 / 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70rem 32rem at 70% 0%, #000 30%, transparent 75%);
}
.hero::after {
  content: "";
  position: absolute;
  width: 48rem;
  height: 48rem;
  right: -16rem;
  top: -26rem;
  background: radial-gradient(circle, rgb(46 196 182 / 0.2), transparent 65%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--s-12);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  padding-block: var(--s-20) var(--s-20);
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
  margin-bottom: var(--s-5);
}
.hero h1 em {
  font-style: normal;
  color: var(--teal);
}
.hero .eyebrow {
  color: var(--teal-light);
}
.hero .lead {
  color: #cbd5e1;
}
.hero .lead code {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.14);
  color: #e6edf5;
}
.hero .btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgb(255 255 255 / 0.3);
  box-shadow: none;
}
.hero .btn-secondary:hover {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.5);
  color: #fff;
}
.hero .btn-row {
  margin-top: var(--s-8);
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  margin: var(--s-8) 0 0;
  padding: 0;
  list-style: none;
  color: #a9b8cc;
  font-size: var(--text-sm);
}
.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
}
.hero-facts svg {
  width: 1rem;
  height: 1rem;
  color: var(--teal);
}
.hero-demo {
  border-radius: var(--radius-lg);
  border: 1px solid #1e3a5f;
  background: #08172b;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-width: 0;
}
.hero-demo .code-block {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.hero-demo .code-head {
  background: #0b1d36;
}
.hero-track {
  padding: var(--s-4) var(--s-5) var(--s-5);
  border-top: 1px solid #1e3a5f;
  background: #0b1d36;
  color: #cbd5e1;
}
.hero-track-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
  margin-bottom: var(--s-4);
  font-size: var(--text-xs);
  color: #8a9db5;
}
.hero-track-head strong {
  color: #e6edf5;
  font-family: var(--font-mono);
  font-weight: 600;
}
@media (max-width: 36rem) {
  .hero-demo .code-block + .code-block {
    display: none;
  }
}
@media (max-width: 60rem) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    padding-block: var(--s-12);
    gap: var(--s-10);
  }
}

.access-card {
  display: grid;
  gap: var(--s-4) var(--s-8);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.access-card h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--s-1);
}
.access-card p {
  margin: 0;
}
.access-card .btn-row {
  margin: 0;
}
@media (max-width: 48rem) {
  .access-card {
    grid-template-columns: minmax(0, 1fr);
  }
}
.lift {
  margin-top: calc(var(--s-10) * -1);
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow);
}

.steps-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.steps-list > li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: var(--s-5);
  padding-top: calc(var(--s-5) + 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.steps-list > li::before {
  content: counter(step);
  position: absolute;
  top: var(--s-5);
  left: var(--s-5);
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-strong);
  font-weight: 700;
  font-size: var(--text-sm);
}
.steps-list h3 {
  font-size: var(--text-base);
  margin-bottom: var(--s-2);
}
.steps-list p {
  color: var(--text-2);
  font-size: 0.9375rem;
  margin: 0;
}

/* ─── Docs (guides) ─────────────────────────────────────────────────────── */

.docs-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: var(--s-12);
  padding-top: var(--s-10);
}
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
  align-self: start;
  max-height: calc(100vh - var(--header-h) - var(--s-10));
  overflow-y: auto;
  padding-bottom: var(--s-6);
  font-size: var(--text-sm);
  scrollbar-width: thin;
}
.sidebar summary {
  display: none;
}
.sidebar-title {
  margin: 0 0 var(--s-2);
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sidebar ol + .sidebar-title {
  margin-top: var(--s-5);
}
.sidebar ol,
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar li + li {
  margin-top: 1px;
}
.sidebar a {
  display: block;
  padding: 0.3rem 0.75rem;
  border-left: 2px solid var(--border);
  color: var(--text-2);
  text-decoration: none;
  line-height: 1.4;
}
.sidebar a:hover {
  color: var(--text);
  border-left-color: var(--border-strong);
}
.sidebar a[aria-current="true"] {
  color: var(--accent-strong);
  border-left-color: var(--accent);
  font-weight: 650;
}
.sidebar ul ul a {
  padding-left: 1.6rem;
  font-size: 0.8125rem;
}
@media (max-width: 60rem) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
    padding-top: var(--s-6);
  }
  .sidebar {
    position: static;
    max-height: none;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }
  .sidebar summary {
    display: flex;
  }
  .sidebar details > :not(summary) {
    padding: 0 var(--s-4) var(--s-4);
  }
  .sidebar .sidebar-title {
    display: none;
  }
}
.disclosure {
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.disclosure::-webkit-details-marker {
  display: none;
}
.disclosure::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  margin-top: -0.25rem;
}
details[open] > .disclosure::after {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}

.prose {
  max-width: 54rem;
  min-width: 0;
}
.prose > section {
  padding-bottom: var(--s-12);
  margin-bottom: var(--s-12);
  border-bottom: 1px solid var(--border);
}
.prose > section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.prose h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--s-4);
  letter-spacing: -0.02em;
}
.prose h3 {
  margin-top: var(--s-10);
  font-size: var(--text-xl);
}
.prose h4 {
  margin-top: var(--s-6);
}
.prose p,
.prose li {
  color: var(--text-2);
}
.prose strong {
  color: var(--text);
}
.anchor {
  margin-left: var(--s-2);
  color: var(--text-3);
  text-decoration: none;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s;
}
:is(h2, h3):hover > .anchor,
.anchor:focus-visible {
  opacity: 1;
}
.defs {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-3) var(--s-5);
  margin: 0 0 var(--s-6);
  padding: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.defs dt {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  padding-top: 0.1rem;
}
.defs dd {
  margin: 0;
  color: var(--text-2);
}
@media (max-width: 36rem) {
  .defs {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .defs dd {
    margin-bottom: var(--s-4);
  }
  .defs dd:last-child {
    margin-bottom: 0;
  }
}

.numbered {
  counter-reset: n;
  list-style: none;
  padding: 0;
}
.numbered > li {
  counter-increment: n;
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: var(--s-3);
}
.numbered > li::before {
  content: counter(n);
  position: absolute;
  left: 0;
  top: 0.1rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-strong);
  font-size: var(--text-xs);
  font-weight: 700;
}

.tool {
  margin: var(--s-6) 0 var(--s-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tool-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.tool-head h3,
.tool-head h4 {
  margin: 0 !important;
  font-size: var(--text-base);
}
.tool-head p {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.tool-body {
  padding: var(--s-5);
}
.tool-body > :last-child {
  margin-bottom: 0;
}
.tool-tag {
  margin-left: auto;
}

/* Signature checker */
.sig-result {
  margin-top: var(--s-4);
}
.sig-steps {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
  font-size: var(--text-sm);
}
.sig-steps li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: var(--s-2);
  margin: 0;
  color: var(--text-2);
}
.sig-steps svg {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
}
.sig-steps .pass svg {
  color: var(--ok);
}
.sig-steps .fail svg {
  color: var(--danger);
}
.sig-steps .note svg {
  color: var(--warn);
}
.sig-hex {
  display: block;
  margin-top: var(--s-1);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

/* ─── Lifecycle diagram ─────────────────────────────────────────────────── */

.lifecycle-figure {
  padding: var(--s-5) var(--s-4) var(--s-3);
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 18px 18px,
    var(--surface);
}
.lifecycle-figure svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}
.lc-edge {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.75;
}
.lc-edge-alt {
  stroke-dasharray: 6 4;
}
.lc-edge-cancel {
  stroke: var(--danger);
  stroke-opacity: 0.45;
  stroke-dasharray: 2 4;
}
.lc-arrow {
  fill: var(--border-strong);
}
.lc-arrow-cancel {
  fill: var(--danger);
  fill-opacity: 0.6;
}
.lc-edge-label {
  fill: var(--text-3);
  font: 500 11px var(--font-mono);
}
.lc-node {
  cursor: pointer;
}
.lc-node:focus {
  outline: none;
}
.lc-node rect {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.lc-node text {
  fill: var(--text);
  font: 600 12.5px var(--font-mono);
  pointer-events: none;
}
.lc-node .lc-sub {
  fill: var(--text-3);
  font: 500 10.5px var(--font-sans);
}
.lc-node:hover rect {
  stroke: var(--accent);
}
.lc-node[aria-pressed="true"] rect {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2.25;
}
.lc-node:focus-visible rect {
  stroke: var(--focus);
  stroke-width: 3;
}
.lc-node.lc-bad rect {
  stroke: var(--danger-border);
}
.lc-node.lc-good rect {
  stroke: var(--ok-border);
}
.lc-node.lc-bad[aria-pressed="true"] rect {
  fill: var(--danger-soft);
  stroke: var(--danger);
}
.lc-node.lc-good[aria-pressed="true"] rect {
  fill: var(--ok-soft);
  stroke: var(--ok);
}
.lifecycle-detail pre {
  max-height: 24rem;
}
.lifecycle-detail {
  padding: var(--s-5);
  border-top: 1px solid var(--border);
  min-width: 0;
}
.lifecycle-detail h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 var(--s-3);
  font-size: var(--text-lg);
}
.lc-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-2) var(--s-5);
  margin: 0 0 var(--s-4);
  font-size: 0.9375rem;
}
.lc-facts dt {
  color: var(--text-3);
  font-weight: 600;
  font-size: var(--text-sm);
  padding-top: 0.1rem;
}
.lc-facts dd {
  margin: 0;
  color: var(--text-2);
}
.lc-facts dd .chips {
  vertical-align: middle;
}
@media (max-width: 36rem) {
  .lc-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .lc-facts dd {
    margin-bottom: var(--s-3);
  }
}

/* ─── Tracking timeline (quickstart, home) ──────────────────────────────── */

.track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--track-steps, 6), minmax(0, 1fr));
}
.track li {
  position: relative;
  margin: 0;
  padding: 0 var(--s-2) 0 0;
  min-width: 0;
}
.track-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: transparent;
}
.track-dot svg {
  width: 0.85rem;
  height: 0.85rem;
}
.track li::after {
  content: "";
  position: absolute;
  top: 0.7rem;
  left: 1.5rem;
  right: 0;
  height: 2px;
  background: var(--border);
}
.track li:last-child::after {
  display: none;
}
.track-label {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.track-detail {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-2);
}
.track li.done .track-dot,
.track li.current .track-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.track li.done::after {
  background: var(--accent);
}
.track li.done .track-label {
  color: var(--text);
}
.track li.current .track-dot {
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.track li.current .track-label {
  color: var(--accent-strong);
}
.track li.bad .track-dot {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 0 5px var(--danger-soft);
}
.track li.bad .track-label {
  color: var(--danger);
}
.track li.fresh .track-dot {
  animation: pop 0.5s ease-out;
}
@keyframes pop {
  0% {
    transform: scale(0.6);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}
.hero-track .track li::after {
  background: #1e3a5f;
}
.hero-track .track-dot {
  background: #0b1d36;
  border-color: #2b4b73;
}
.hero-track .track li.done .track-dot,
.hero-track .track li.current .track-dot {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--navy-deep);
}
.hero-track .track li.done::after {
  background: var(--teal);
}
.hero-track .track li.current .track-dot {
  box-shadow: 0 0 0 5px rgb(46 196 182 / 0.18);
}
.hero-track .track-label {
  color: #8a9db5;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  white-space: normal;
  line-height: 1.3;
}
.hero-track .track li.done .track-label,
.hero-track .track li.current .track-label {
  color: #e6edf5;
}
.hero-track .track-time {
  color: #8a9db5;
}
/* Narrow: the timeline runs down instead of across (its box decides, wherever it sits) */
.track-box {
  container: track / inline-size;
}
@container track (max-width: 44rem) {
  .track:not(.track-compact) {
    grid-template-columns: minmax(0, 1fr);
  }
  .track:not(.track-compact) li {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    column-gap: var(--s-3);
    padding: 0 0 var(--s-4);
  }
  .track:not(.track-compact) li::after {
    top: 1.5rem;
    left: 0.7rem;
    right: auto;
    bottom: 0;
    width: 2px;
    height: auto;
  }
  .track:not(.track-compact) .track-dot {
    grid-row: span 3;
  }
  .track:not(.track-compact) .track-label {
    margin-top: 0.1rem;
  }
}
@media (max-width: 30rem) {
  .track-compact .track-label {
    display: none;
  }
}

/* ─── Results ───────────────────────────────────────────────────────────── */

.results {
  display: grid;
  gap: var(--s-3);
}
.result {
  display: grid;
  grid-template-columns: minmax(10rem, 1.1fr) minmax(7rem, 0.6fr) minmax(13rem, 1.5fr) minmax(9rem, 0.9fr);
  gap: var(--s-3) var(--s-5);
  align-items: center;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.result.changed {
  border-color: var(--warn-border);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.result-name strong {
  display: block;
  line-height: 1.3;
  color: var(--text);
}
.result-name code {
  font-size: 0.75rem;
}
.result-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}
.result-value small {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-3);
  margin-left: 0.2rem;
}
.result-label {
  display: block;
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.range-bar {
  position: relative;
  height: 0.5rem;
  margin: 0.6rem 0 0.45rem;
  border-radius: 999px;
  background: var(--surface-3);
}
.range-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--range-band);
  box-shadow: inset 0 0 0 1px var(--range-band-border);
}
.range-marker {
  position: absolute;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  margin: -0.45rem 0 0 -0.45rem;
  border-radius: 50%;
  background: var(--text-2);
  box-shadow: 0 0 0 2px var(--surface);
}
.range-marker.flag-high {
  background: var(--chart-error);
}
.range-marker.flag-normal {
  background: var(--chart-ok);
}
.range-text {
  display: flex;
  justify-content: space-between;
  gap: var(--s-2);
  font-size: var(--text-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.result-lab {
  font-size: var(--text-sm);
  color: var(--text-3);
}
.results {
  container-type: inline-size;
}
@container (max-width: 50rem) {
  .result {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .result-range,
  .result-lab {
    grid-column: 1 / -1;
  }
}

/* ─── Quickstart ────────────────────────────────────────────────────────── */

.qs-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: var(--s-10);
  padding-top: var(--s-10);
}
.qs-progress {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
  align-self: start;
}
.qs-progress ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.qs-progress li {
  position: relative;
  margin: 0;
  padding: 0 0 var(--s-5) 2.25rem;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.qs-progress li::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 1.6rem;
  bottom: 0.1rem;
  width: 2px;
  background: var(--border);
}
.qs-progress li:last-child::before {
  display: none;
}
.qs-num {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-3);
}
.qs-num svg {
  width: 0.8rem;
  height: 0.8rem;
}
.qs-progress a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.qs-progress a:hover {
  color: var(--text);
}
.qs-progress li.done .qs-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.qs-progress li.done::before {
  background: var(--accent);
}
.qs-progress li.current {
  color: var(--text);
}
.qs-progress li.current .qs-num {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.qs-steps {
  display: grid;
  gap: var(--s-6);
  min-width: 0;
}
.qs-step {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}
.qs-step.locked {
  background: var(--bg-subtle);
  box-shadow: none;
}
.qs-step.locked .qs-step-body {
  display: none;
}
.qs-step.current {
  border-color: var(--accent-border);
  box-shadow:
    var(--shadow),
    0 0 0 1px var(--accent-border);
}
.qs-step-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
}
.qs-step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-3);
  font-weight: 700;
  font-size: var(--text-sm);
}
.qs-step-num svg {
  width: 1rem;
  height: 1rem;
}
.qs-step.current .qs-step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.qs-step.done .qs-step-num {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-strong);
}
.qs-step-head h2 {
  margin: 0.1rem 0 var(--s-1);
  font-size: var(--text-xl);
}
.qs-step-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}
.qs-step-state {
  margin-left: auto;
  flex: none;
}
.qs-step-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--s-6);
  padding: 0 var(--s-6) var(--s-6);
}
.qs-step-body > * {
  min-width: 0;
}
.qs-step-body {
  align-items: start;
}
.qs-wide {
  grid-column: 1 / -1;
}
.qs-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-3);
  align-content: start;
}
.qs-code .code-block {
  margin: 0;
}
.response {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.response-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--text-sm);
}
.response-head .label {
  color: var(--text-3);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.response .code-block {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.response pre {
  max-height: 26rem;
}
.response-empty {
  padding: var(--s-5) var(--s-4);
  color: var(--text-3);
  font-size: var(--text-sm);
  margin: 0;
}
.response-message {
  padding: var(--s-3) var(--s-4) 0;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.headers-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.15rem var(--s-4);
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  font: 0.75rem / 1.6 var(--font-mono);
}
.headers-list dt {
  color: var(--text-3);
  white-space: nowrap;
}
.headers-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}
.lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-5) 0 var(--s-3);
}
.event-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-3) 0 0;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.order-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-5);
  font-size: var(--text-sm);
  color: var(--text-2);
}
.track-box {
  padding: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.track-next {
  margin: var(--s-4) 0 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.scope-list {
  display: grid;
  gap: var(--s-1);
  margin: var(--s-2) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}
.scope-list li {
  display: grid;
  grid-template-columns: 1rem max-content minmax(0, 1fr);
  align-items: baseline;
  gap: var(--s-2);
  margin: 0;
}
.scope-list li svg {
  align-self: center;
}
.scope-list svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.scope-list .has svg {
  color: var(--ok);
}
.scope-list .lacks svg {
  color: var(--danger);
}
@media (max-width: 75rem) {
  .qs-step-body {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 60rem) {
  .qs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-4);
  }
  .qs-progress {
    display: none;
  }
}
@media (max-width: 36rem) {
  .qs-step-head {
    padding: var(--s-4);
    gap: var(--s-3);
  }
  .qs-step-body {
    padding: 0 var(--s-4) var(--s-4);
  }
  .qs-step-state {
    display: none;
  }
}

/* ─── API reference ─────────────────────────────────────────────────────── */

.ref-shell {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
}
.ref-nav {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: var(--s-6) var(--s-4) var(--s-8) 0;
  border-right: 1px solid var(--border);
  font-size: var(--text-sm);
  scrollbar-width: thin;
}
.ref-nav > details > summary {
  display: none;
}
.ref-nav .field {
  margin-bottom: var(--s-2);
}
.ref-nav-group {
  margin: var(--s-5) 0 var(--s-1);
  padding: 0 var(--s-2);
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ref-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ref-nav li {
  margin: 0;
}
.ref-nav a {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  align-items: center;
  gap: var(--s-2);
  padding: 0.35rem var(--s-2);
  border-radius: 7px;
  color: var(--text-2);
  text-decoration: none;
  line-height: 1.35;
}
.ref-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.ref-nav a[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}
.ref-nav a.plain {
  display: block;
}
.ref-nav .downloads {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  display: grid;
  gap: var(--s-2);
}
.ref-nav .downloads .btn {
  justify-content: flex-start;
}
.ref-nav-empty {
  padding: var(--s-2);
  color: var(--text-3);
}
.ref-main {
  min-width: 0;
  padding-left: var(--s-10);
}
.ref-intro {
  padding: var(--s-10) 0 var(--s-8);
  border-bottom: 1px solid var(--border);
}
.ref-intro .facts {
  margin-top: var(--s-6);
}
.ref-keybar {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  max-width: 48rem;
}
.ref-tag {
  padding: var(--s-12) 0 0;
}
.ref-tag h2 {
  font-size: var(--text-3xl);
  margin: 0;
  letter-spacing: -0.02em;
}
.op {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-10);
  padding: var(--s-10) 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + var(--s-2));
}
.op-main,
.op-aside {
  min-width: 0;
}
.op-aside-inner {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
  display: grid;
  gap: var(--s-4);
}
.op-aside .code-block {
  margin: 0;
}
.op-aside pre {
  max-height: min(24rem, 40vh);
}
.op-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-3);
}
.op-head .method {
  font-size: 0.75rem;
  min-width: 3.75rem;
  padding: 0.1rem 0.4rem;
}
:not(pre) > code.op-path {
  padding: 0;
  border: 0;
  background: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.op-path .param {
  color: var(--accent-strong);
}
.op-title {
  font-size: var(--text-2xl);
  margin: 0 0 var(--s-3);
}
.op-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.op-main > p {
  color: var(--text-2);
}
.op h4 {
  margin: var(--s-8) 0 var(--s-3);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.fields {
  list-style: none;
  margin: 0 0 var(--s-4);
  padding: 0;
  border-top: 1px solid var(--border);
}
.fields > li {
  margin: 0;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + var(--s-8));
}
.fields > li:target {
  background: var(--accent-soft);
  box-shadow:
    -0.75rem 0 0 var(--accent-soft),
    0.75rem 0 0 var(--accent-soft);
}
.field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-1) var(--s-3);
}
.field-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
.field-name .parent {
  color: var(--text-3);
  font-weight: 500;
}
.field-type {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  white-space: nowrap;
}
.field-desc {
  margin: var(--s-1) 0 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}
.constraints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-2);
  margin-top: var(--s-1);
  font-size: var(--text-sm);
  color: var(--text-3);
}
.depth-1 {
  padding-left: var(--s-5) !important;
}
.depth-2 {
  padding-left: var(--s-10) !important;
}
.depth-3 {
  padding-left: var(--s-12) !important;
}
.errors-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}
.errors-list li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: var(--s-3);
  align-items: baseline;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-2);
}
details.try {
  margin-top: var(--s-8);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  background: var(--surface);
}
details.try > summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  font-weight: 650;
  cursor: pointer;
  color: var(--accent-strong);
  list-style: none;
}
details.try > summary::-webkit-details-marker {
  display: none;
}
details.try > summary svg {
  width: 1rem;
  height: 1rem;
}
details.try[open] > summary {
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  border-radius: var(--radius) var(--radius) 0 0;
}
.try-body {
  padding: var(--s-4);
}
.try-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-sm);
  color: var(--text-3);
}
.try-result {
  margin-top: var(--s-4);
}
@media (max-width: 82rem) {
  .op {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
  }
  .op-aside-inner {
    position: static;
  }
}
@media (max-width: 60rem) {
  .ref-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .ref-nav {
    position: static;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    margin-top: var(--s-6);
    background: var(--surface);
    order: -1;
  }
  .ref-nav > details > summary {
    display: flex;
  }
  .ref-nav > details > :not(summary) {
    padding: 0 var(--s-4) var(--s-4);
  }
  .ref-main {
    padding-left: 0;
  }
}

/* ─── Search ────────────────────────────────────────────────────────────── */

dialog.search {
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(36rem, calc(100vh - 6rem));
  margin: 4.5rem auto auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog.search[open] {
  display: flex;
  flex-direction: column;
}
dialog.search::backdrop {
  background: rgb(5 15 31 / 0.55);
}
.search-box {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  border-bottom: 1px solid var(--border);
}
.search-box svg {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--text-3);
  flex: none;
}
.search-box input {
  border: 0;
  min-height: 2.75rem;
  padding: 0;
  font-size: var(--text-lg);
  background: none;
}
.search-box input:focus-visible {
  outline: none;
}
.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.search-box kbd {
  flex: none;
}
.search-close {
  flex: none;
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 6px;
}
.search-close:hover kbd {
  color: var(--text);
  border-color: var(--text-3);
}
.search-results {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-2);
  margin: 0;
  list-style: none;
}
.search-results li {
  margin: 0;
}
.search-group {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  margin: var(--s-3) var(--s-3) var(--s-1);
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.search-hit {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr);
  gap: 0 var(--s-3);
  align-items: center;
  padding: var(--s-2) var(--s-3);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.search-hit[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}
.hit-kind {
  grid-row: span 2;
  display: flex;
  justify-content: center;
}
.hit-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.hit-icon svg {
  width: 1rem;
  height: 1rem;
}
.hit-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.hit-sub {
  font-size: var(--text-xs);
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
mark {
  background: rgb(232 168 56 / 0.32);
  color: inherit;
  border-radius: 2px;
}
.search-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  padding: var(--s-2) var(--s-4);
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-3);
  font-size: var(--text-xs);
}
.search-group-count {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.search-empty {
  padding: var(--s-6) var(--s-4) var(--s-3);
  color: var(--text-3);
  text-align: center;
}
.search-empty strong {
  display: block;
  color: var(--text);
}

/* ─── Console ───────────────────────────────────────────────────────────── */

/* The page head stays short on the console: the menu and the view are what matter. */
.page-head-compact {
  padding: var(--s-8) 0 var(--s-6);
}
.page-head-compact h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, var(--text-4xl));
  margin-bottom: var(--s-2);
}
.page-head-compact .lead {
  font-size: var(--text-base);
}
.console-wrap {
  padding-top: var(--s-8);
  padding-bottom: var(--s-12);
}
.console-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: var(--s-8);
  align-items: start;
}
.console-main {
  min-width: 0;
}

/* The menu: sticky beside the view on wide screens; a drawer above it on narrow ones. */
.console-nav {
  position: sticky;
  top: calc(var(--header-h) + var(--s-5));
  max-height: calc(100vh - var(--header-h) - var(--s-10));
  overflow-y: auto;
  scrollbar-width: thin;
  font-size: var(--text-sm);
}
.console-nav-toggle {
  display: none;
}
.console-nav .sidebar-title {
  margin: 0 0 var(--s-2);
  padding-left: var(--s-3);
  color: var(--text-3);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.console-nav ul {
  list-style: none;
  margin: 0 0 var(--s-6);
  padding: 0;
  display: grid;
  gap: 2px;
}
.console-nav li + li {
  margin: 0;
}
.console-nav a[data-view] {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 2.25rem;
  padding: 0.35rem var(--s-3);
  border-radius: 8px;
  color: var(--text-2);
  font-weight: 550;
  text-decoration: none;
  line-height: 1.3;
}
.console-nav a[data-view]:hover {
  background: var(--surface-2);
  color: var(--text);
}
.console-nav a[data-view][aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--accent);
}
.console-nav a[data-view]:focus-visible {
  outline-offset: 0;
}
.nav-badge {
  margin-left: auto;
  padding: 0 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nav-badge-error {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}
.nav-badge-warn {
  border-color: var(--warn-border);
  background: var(--warn-soft);
  color: var(--warn);
}
.nav-badge-info {
  border-color: var(--info-border);
  background: var(--info-soft);
  color: var(--info);
}
.console-nav-search {
  margin: 0;
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.console-nav-search button {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 2.25rem;
  padding: 0 var(--s-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-3);
  font: 550 var(--text-sm) / 1 var(--font-sans);
  cursor: pointer;
}
.console-nav-search button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.console-nav-search svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.console-nav-search kbd {
  margin-left: auto;
  font-size: 0.6875rem;
  padding: 0 0.3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
}
@media (max-width: 60rem) {
  .console-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
  }
  .console-nav {
    position: sticky;
    top: calc(var(--header-h) + var(--s-2));
    z-index: 20;
    max-height: calc(100vh - var(--header-h) - var(--s-4));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .console-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    min-height: 2.75rem;
    padding: var(--s-2) var(--s-4);
    font-weight: 650;
    color: var(--text);
    cursor: pointer;
    list-style: none;
  }
  .console-nav-toggle::-webkit-details-marker {
    display: none;
  }
  .console-nav-toggle::before {
    content: "Section";
    color: var(--text-3);
    font-weight: 600;
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  #console-nav-current {
    margin-right: auto;
  }
  .console-nav-toggle::after {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--text-3);
    border-bottom: 2px solid var(--text-3);
    transform: rotate(45deg);
    margin-top: -0.25rem;
  }
  .console-nav details[open] > .console-nav-toggle::after {
    transform: rotate(-135deg);
    margin-top: 0.25rem;
  }
  .console-nav details[open] > .console-nav-toggle {
    border-bottom: 1px solid var(--border);
  }
  .console-nav-body {
    padding: var(--s-3) var(--s-2) 0;
  }
  .console-nav ul {
    margin-bottom: var(--s-4);
  }
}

/* A view: its heading with its actions, then what it holds. */
.console-view {
  min-width: 0;
}
.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.view-head h2 {
  margin: 0;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
}
.view-head h2:focus {
  outline: none;
}
.view-head h2:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
.view-head .btn-row {
  margin: 0;
}
.view-intro {
  max-width: 52rem;
  margin-bottom: var(--s-6);
}
.console-view > h3 {
  margin-top: var(--s-6);
}
.console-view.no-org > :not(.org-cta):not(.view-head) {
  display: none !important;
}
.form-card {
  max-width: 46rem;
}
.create-card {
  margin-bottom: var(--s-6);
  padding: 0;
}
.create-card > summary {
  display: flex;
  min-height: 3rem;
  padding: var(--s-3) var(--s-5);
  font-weight: 650;
  border-radius: var(--radius-lg);
}
.create-card > summary:hover {
  background: var(--surface-2);
}
.create-card > summary span::before {
  content: "+";
  display: inline-block;
  width: 1.25rem;
  color: var(--accent-strong);
  font-weight: 700;
}
.create-card[open] > summary span::before {
  content: "\2212";
}
.create-card[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.create-card > form {
  padding: var(--s-5);
}
.counter {
  font-variant-numeric: tabular-nums;
}

/* Lists: a filter box, selects, a count, sortable headers, pages. */
.list {
  min-width: 0;
}
.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}
.list-tools .field {
  min-width: 9.5rem;
  flex: 0 1 auto;
}
.list-tools .field.grow {
  flex: 1 1 14rem;
}
.list-tools-extra {
  display: contents;
}
/* "Sort by" shows only when the table has stacked into cards (its headers, which sort, are hidden then). */
.list-sort {
  display: none;
}
.list:has(.table-wrap.stacked) .list-sort {
  display: grid;
}
.list-tools:not(:has(> :not(.list-sort))) {
  margin: 0;
}
.list-tools input[type="search"] {
  padding-left: 2.1rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566b89' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.7rem 50% / 1rem;
}
.list-count {
  margin: 0 0 var(--s-3);
  color: var(--text-3);
  font-size: var(--text-sm);
}
.list-count:empty {
  display: none;
}
.list-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin: 0 0 var(--s-5);
}
.list .table-wrap {
  margin-bottom: var(--s-3);
}
.sort-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: -0.25rem -0.4rem;
  padding: 0.25rem 0.4rem;
  border: 0;
  border-radius: 5px;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.sort-btn:hover {
  color: var(--text);
  background: var(--surface-3);
}
th.num .sort-btn {
  flex-direction: row-reverse;
}
.sort-icon {
  display: inline-flex;
  opacity: 0.35;
}
.sort-icon svg {
  width: 0.85rem;
  height: 0.85rem;
}
.sort-icon.asc,
.sort-icon.desc {
  opacity: 1;
  color: var(--accent-strong);
}
.sort-icon.asc svg {
  transform: rotate(180deg);
}
th[aria-sort="ascending"],
th[aria-sort="descending"] {
  color: var(--text);
}
.card-list {
  list-style: none;
  margin: 0 0 var(--s-3);
  padding: 0;
  display: grid;
  gap: var(--s-3);
}
.card-list > li {
  margin: 0;
}
.card-list .delivery,
.card-list .feedback-item {
  margin: 0;
}
.row-link {
  font-weight: 650;
  overflow-wrap: anywhere;
}
.log-request {
  display: grid;
  gap: 0.15rem;
  justify-items: start;
}
.log-line {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  white-space: nowrap;
}
.log-code {
  font-size: var(--text-sm);
}
table.compact td {
  padding: var(--s-3) var(--s-3);
}
table.compact th {
  padding-inline: var(--s-3);
}
.block {
  display: block;
}

/* Side panels (a record's details), modal: full height on the right, the whole screen on phones. */
dialog.sheet {
  margin: 0 0 0 auto;
  width: min(36rem, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.sheet-wide {
  width: min(48rem, 100vw);
}
dialog.sheet::backdrop {
  background: rgb(5 15 31 / 0.45);
}
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] {
    animation: sheet-in 0.18s ease-out;
  }
}
@keyframes sheet-in {
  from {
    transform: translateX(2rem);
    opacity: 0;
  }
}
.sheet-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.sheet-head h2 {
  flex: 1;
  margin: 0;
  font-size: var(--text-xl);
  overflow-wrap: anywhere;
}
.sheet-head h2:focus {
  outline: none;
}
.sheet-close {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.sheet-close:hover {
  color: var(--text);
  background: var(--surface-2);
}
.sheet-close svg {
  width: 1.1rem;
  height: 1.1rem;
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-6);
}
.sheet-body > * + h3 {
  margin-top: var(--s-6);
}
.sheet-body .facts {
  margin-bottom: var(--s-4);
}

/* A form in a dialog (new organization, change of password, a new authenticator). */
dialog:not(.search):not(.sheet).form-dialog {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}
dialog:not(.search):not(.sheet).form-dialog:has(.totp-setup) {
  width: min(44rem, calc(100vw - 2rem));
}
.form-dialog h2 {
  margin: 0;
}
.form-dialog form > p {
  margin: 0;
  color: var(--text-2);
}
@media (max-width: 30rem) {
  dialog:not(.search):not(.sheet) {
    padding: var(--s-5);
  }
}

.stats {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
  margin-bottom: var(--s-5);
}
.stat {
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.stat-label {
  margin: 0 0 var(--s-1);
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 600;
}
.stat-value {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat-value small {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
  margin-left: 0.15rem;
}
.stat-note {
  margin: var(--s-1) 0 0;
  font-size: var(--text-xs);
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-card {
  padding: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: var(--s-5);
  min-width: 0;
}
.chart-card.refreshing .chart {
  opacity: 0.5;
}
.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.chart-head h3 {
  margin: 0;
  font-size: var(--text-base);
}
.chart-head p {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-3);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
  color: var(--text-2);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
}
.swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  flex: none;
}
.swatch-ok {
  background: var(--chart-ok);
}
.swatch-err {
  background: var(--chart-error);
}
.chart {
  position: relative;
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .bar-ok {
  fill: var(--chart-ok);
}
.chart .bar-err {
  fill: var(--chart-error);
}
.chart .grid-line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}
.chart .axis-line {
  stroke: var(--chart-axis);
  stroke-width: 1;
}
.chart .tick {
  fill: var(--text-3);
  font: 500 11px var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.chart .hit {
  fill: transparent;
}
.chart .col.active .hit {
  fill: var(--surface-2);
}
.chart:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}
.tooltip {
  position: absolute;
  z-index: 5;
  min-width: 10.5rem;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: var(--text-xs);
  color: var(--text-3);
  pointer-events: none;
}
.tooltip[hidden] {
  display: none;
}
.tooltip-title {
  margin: 0 0 var(--s-1);
  font-weight: 650;
  color: var(--text-2);
}
.tooltip-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
}
.tooltip-row strong {
  margin-left: auto;
  padding-left: var(--s-3);
  color: var(--text);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.tooltip-key {
  width: 0.75rem;
  height: 2px;
  border-radius: 1px;
  flex: none;
}

.secret-reveal {
  margin-bottom: var(--s-6);
  padding: var(--s-5);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}
.secret-reveal:focus {
  outline: none;
}
.secret-reveal:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.secret-reveal p {
  color: var(--text-2);
}
:not(pre) > code.secret-value {
  display: block;
  margin: var(--s-3) 0;
  padding: var(--s-3) var(--s-4);
  font-size: 0.9375rem;
  border-radius: 8px;
  background: var(--surface);
  white-space: normal;
  overflow-wrap: anywhere;
  user-select: all;
}

.delivery {
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--s-3);
}
.delivery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}
.delivery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-5);
  margin: var(--s-2) 0;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.delivery details summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--link);
  margin-bottom: var(--s-2);
}
.feedback-item + .feedback-item {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}
.feedback-item p {
  white-space: pre-wrap;
  margin: var(--s-2) 0 0;
}

dialog:not(.search):not(.sheet) {
  width: min(30rem, calc(100vw - 2rem));
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog:not(.search):not(.sheet)::backdrop {
  background: rgb(5 15 31 / 0.55);
}
dialog h2 {
  font-size: var(--text-xl);
}

/* Profile, the sandbox's data, and the staff test-organization offer */
.empty .empty-title {
  margin: 0 0 var(--s-2);
  font-size: var(--text-xl);
  color: var(--text);
}
.subhead {
  margin: var(--s-6) 0 var(--s-2);
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text);
}
.subsection-sm {
  margin-top: var(--s-4);
}
.org-name {
  margin: 0 0 var(--s-4);
  font-size: var(--text-lg);
  color: var(--text) !important;
  overflow-wrap: anywhere;
}
.badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.status-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: 0 0 var(--s-4);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}
.status-counts li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.card .alert {
  margin: var(--s-4) 0;
}
.stack {
  display: grid;
  gap: var(--s-6);
  align-content: start;
  min-width: 0;
}
.profile-first {
  margin-bottom: var(--s-6);
}
.card-note {
  margin: var(--s-4) 0 0;
}
.stats.stats-compact {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
}
@media (min-width: 60rem) {
  .facts.facts-wide {
    grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr);
  }
}
.typed-confirm h2 {
  margin: 0;
}
.typed-confirm p {
  margin: 0;
}
.typed-confirm p + p {
  margin-top: var(--s-3);
}
.typed-confirm .phrase {
  overflow-wrap: anywhere;
}
.checks-stack {
  grid-template-columns: minmax(0, 1fr);
}
#console-status:not(:empty) {
  margin-bottom: var(--s-6);
}

/* ─── Sign-in ───────────────────────────────────────────────────────────── */

.signin-layout {
  display: grid;
  grid-template-columns: minmax(0, 32rem) minmax(0, 22rem);
  gap: var(--s-10);
  justify-content: center;
  align-items: start;
  padding-bottom: var(--s-12);
}
@media (max-width: 56rem) {
  .signin-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-8);
  }
}
.signin-card {
  padding: var(--s-8);
  box-shadow: var(--shadow);
}
@media (max-width: 30rem) {
  .signin-card {
    padding: var(--s-5);
  }
}
.signin-card h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--s-2);
}
.signin-card h1:focus {
  outline: none;
}
.signin-card h1:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
.signin-sub {
  margin: 0 0 var(--s-6);
  color: var(--text-2);
}
.signin-card .form {
  gap: var(--s-5);
}
.signin-aside {
  padding-top: var(--s-4);
  font-size: var(--text-sm);
  color: var(--text-2);
}
.signin-aside h2 {
  font-size: var(--text-lg);
}
.signin-aside h3 {
  margin: var(--s-5) 0 var(--s-1);
  font-size: var(--text-sm);
}
.signin-aside p {
  margin: 0;
}
.btn-wide {
  width: 100%;
  min-height: 2.75rem;
}
.form-foot {
  margin: 0;
  text-align: center;
}
.dot-sep::before {
  content: "\00b7";
  margin: 0 var(--s-3);
  color: var(--text-3);
}
.form-status:empty {
  display: none;
}
.form-status .alert {
  margin: 0;
}
.reveal {
  min-width: 4.25rem;
}
input.code-input {
  max-width: 12rem;
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  letter-spacing: 0.25em;
  text-align: center;
}
#reset-code.code-input {
  font-size: var(--text-lg);
  letter-spacing: 0.15em;
}

/* Steps of the first sign-in */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin: 0 0 var(--s-5);
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--text-3);
}
.stepper li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
}
.stepper li + li::before {
  content: "";
  width: 1.25rem;
  height: 1px;
  background: var(--border-strong);
}
.step-dot {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.step-dot svg {
  width: 0.8rem;
  height: 0.8rem;
}
.stepper .current {
  color: var(--text);
}
.stepper .current .step-dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.stepper .done {
  color: var(--ok);
}
.stepper .done .step-dot {
  border-color: var(--ok-border);
  background: var(--ok-soft);
  color: var(--ok);
}

/* The password rules, ticked as they're met */
.rules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: var(--s-1) var(--s-4);
  margin: calc(var(--s-2) * -1) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.rules li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
}
.rules li svg {
  width: 0.9rem;
  height: 0.9rem;
  flex: none;
  padding: 1px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: transparent;
}
.rules li.met {
  color: var(--ok);
}
.rules li.met svg {
  border-color: var(--ok);
  background: var(--ok);
  color: var(--surface);
}

/* Setting up an authenticator app */
.totp-setup {
  display: grid;
  gap: var(--s-5);
}
.totp-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-2);
  font-size: var(--text-sm);
}
.totp-steps strong {
  color: var(--text);
}
.totp-pair {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}
@media (max-width: 34rem) {
  .totp-pair {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
  .totp-key {
    justify-self: stretch;
  }
}
.qr-frame {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: var(--s-1);
}
.qr-frame .qr {
  display: block;
  width: 11rem;
  height: 11rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  /* White behind the code in both themes: phones read dark on light. */
  background: #fff;
}
.totp-key .label {
  margin: 0 0 var(--s-1);
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text);
}
:not(pre) > code.totp-secret {
  display: block;
  padding: var(--s-2) var(--s-3);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
  white-space: normal;
  word-spacing: 0.2em;
  overflow-wrap: anywhere;
}
.totp-key .btn-row {
  margin-top: var(--s-2);
}
.facts-tight {
  margin-top: var(--s-3);
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.facts-tight dt {
  font-size: var(--text-xs);
}
.facts-tight dd {
  margin-bottom: var(--s-2);
}
.facts-tight dd {
  overflow-wrap: anywhere;
}

/* ─── Motion, forced colors, print ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .method,
  .badge,
  .status-code,
  .chip,
  :not(pre) > code {
    border: 1px solid CanvasText;
  }
  .chart .bar-ok {
    fill: Highlight;
  }
  .chart .bar-err {
    fill: CanvasText;
  }
  .range-band {
    background: Highlight;
  }
}
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .ref-nav,
  .copy {
    display: none !important;
  }
  pre {
    white-space: pre-wrap;
  }
}

/* Quickstart details */
.address-form {
  margin-top: var(--s-3);
}
details > summary {
  cursor: pointer;
}

/* Error codes as a bar list (console overview) */
.bar-list {
  display: grid;
  grid-template-columns: max-content minmax(3rem, 1fr) max-content;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.bar-list li {
  display: contents;
}
.bar-track {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--chart-error);
}
.bar-value {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--text);
  text-align: right;
}
.event-line svg,
.request-id svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plain-list li + li {
  margin-top: var(--s-1);
}
