:root {
  /* ── Framework tokens (dark default) ─────────────────────────── */
  --color-bg-page: #0b0d12;
  --color-bg-card: rgba(23, 22, 24, 0.68);
  --color-bg-card-hover: rgba(31, 30, 33, 0.82);
  --color-border: rgba(255, 255, 255, 0.14);
  /* Row separators inside panels — a touch stronger than card edges so
   * list/table rows read as distinct without a heavy rule. */
  --color-divider: rgba(255, 255, 255, 0.22);
  /* Opaque twin of --color-divider (translucent composited over the card
   * surface). Use where a divider must read identically regardless of the
   * blurred backdrop behind a glass panel. */
  --color-divider-solid: #48494b;

  --color-text-primary: #ffffff;
  --color-text-muted: #b6b9c0;
  --color-text-faint: #84878f;
  /* Text/icons on a saturated colored fill (avatar initials, badges).
   * Theme-independent — it rides the fill, not the surface, so it stays
   * white in light mode too (unlike --color-text-primary). */
  --color-on-fill: #ffffff;

  /* Neutral filled chip/badge background (e.g. the Viewer role pill). */
  --color-fill-neutral: #333333;

  /* Interactive accent = brand sage-green (focus, hover, links, active
   * states, CTAs).  Distinct from ``--brand-accent`` (blue), which
   * stays a data-viz palette hue so charts keep their series colours. */
  --color-accent: #30d158;
  --color-success: #63d42e;
  --color-warn: #ffce1f;
  --color-danger: #ff5f5f;

  --color-action-primary: #ffffff;
  --color-action-on-primary: #0a0a0a;

  --color-bg-hover-ghost: color-mix(in srgb, var(--color-text-primary) 8%, transparent);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.85rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.25rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Single dial for card corners — every ``.surface--glass`` card reads
     this, so card radius changes in one place without disturbing the
     other ``--radius-md`` uses (topbar band, tabs, chips, …). */
  --radius-card: var(--radius-lg);

  /* Max content width for page shells + topbar (centred via margin auto
   * on wider viewports). */
  --content-max-width: 1600px;

  /* Stacking order — reference these instead of raw z-index so the
   * layering stays legible: cover < in-card overlay < popover < modal. */
  --z-cover: 2;
  --z-overlay: 4;
  --z-popover: 50;
  --z-modal: 100;

  /* Floating-surface shadow (popovers / menus); softer in light theme. */
  --shadow-popover: 0 10px 28px -16px rgba(0, 0, 0, 0.6);

  /* Avatar disc rim + lift — the rim flips polarity per theme so the
   * disc reads on both dark and light surfaces. */
  --shadow-avatar: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 2px 8px -2px rgba(0, 0, 0, 0.45);

  /* ── Card surface tier ─────────────────────────────────────────
   * Frost, layer 2: translucent fill + blur, now with saturate so the
   * colors behind bloom instead of going gray, and a touch of brightness
   * so the frost glows rather than muddies. Still no sheen / inset
   * highlight / drop shadow — those come next. */
  --surface-glass-bg: rgba(26, 25, 27, 0.58);
  --surface-glass-border: rgba(255, 255, 255, 0.08);
  --surface-glass-blur: blur(20px) saturate(160%) brightness(1.05);
  --surface-glass-shadow: none;

  /* A button's shape, for a site to set: the kit draws the structure and the states, these say
     how big it is and how round. --button-height stays auto where the padding sets the height. */
  --button-height: auto;
  --button-padding: 8px 16px;
  --button-gap: var(--space-xs);
  --button-radius: var(--radius-full);
  --button-font-size: var(--font-size-sm);
  --button-weight: 600;
  --button-small-padding: 7px 12px;
  --button-small-font-size: var(--font-size-xs);
  --button-glyph-size: 32px;
  /* A chip: the button that sits in a row of them, beside text. */
  /* A toast: where it sits, how wide it runs and how it is drawn. A site sets these in its own
     words — its card rounding, its surface — and the toast follows the rest of its look. */
  --toast-inset: auto var(--space-lg) var(--space-lg) auto;
  --toast-align: end;
  --toast-width: min(360px, calc(100vw - 2 * var(--space-lg)));
  --toast-padding: var(--space-md);
  --toast-radius: var(--radius-card);
  --toast-bg: var(--surface-raised-bg);
  --toast-ink: var(--color-text-primary);
  --toast-border: var(--color-border);
  --toast-shadow: 0 12px 40px color-mix(in srgb, #000 35%, transparent);
  --toast-font-size: var(--font-size-sm);
  --toast-weight: 400;

  --button-chip-height: auto;
  --button-chip-padding: 6px 12px;
  --button-chip-font-size: var(--font-size-sm);

  /* Shared height for every topbar control (search, notifications, CTA)
     so they line up to the pixel. */
  --topbar-ctrl-h: 40px;

  --surface-raised-bg: #16181f;

  /* Floating menus / popovers / dropdowns: frosted glass surface,
     independent of the card frost. Tune --surface-popover-opacity in this
     one place to dial transparency for every popover at once. */
  --surface-popover-tint: 26, 25, 27;
  --surface-popover-opacity: 0.58;
  --surface-popover-bg: rgba(var(--surface-popover-tint), var(--surface-popover-opacity));
  --surface-popover-blur: var(--surface-glass-blur);

  /* Modals / command palette: same frost as popovers but more opaque —
     large surfaces need legible text, so they're less see-through. */
  --surface-modal-bg: rgba(var(--surface-popover-tint), 0.85);

  /* Dialogs: the width each size opens at, how tall one grows before its body scrolls, and the
     measures of its head, body and footer. */
  --dialog-width: 520px;
  --dialog-width-wide: 580px;
  --dialog-width-wider: 760px;
  --dialog-width-viewer: 1100px;
  --dialog-width-side: 420px;
  --dialog-max-height: min(86vh, 760px);
  --dialog-title-font: 600 1.125rem/normal var(--font-family);
  --dialog-border: var(--surface-glass-border);
  --dialog-shadow: var(--surface-glass-shadow), 0 40px 90px -45px rgba(0, 0, 0, 0.75);
  --dialog-scrim: var(--scrim-bg);
  --dialog-head-padding: var(--space-lg) var(--space-lg) var(--space-md);
  --dialog-head-border: 1px solid var(--color-border);
  --dialog-body-padding: var(--space-lg);
  --dialog-footer-padding: var(--space-md) var(--space-lg);

  /* Underlined tabs: the gap between them, their measures, ink and type, the line under the chosen
     one and the rule under the row. */
  --tabs-gap: var(--space-xs);
  --tabs-padding: 8px 12px;
  --tabs-ink: var(--color-text-muted);
  --tabs-font: 600 var(--font-size-sm)/normal var(--font-family);
  --tabs-underline: var(--color-accent);
  --tabs-rule: 1px solid var(--color-border);
  /* Segmented tabs: the track they sit in, how tall each is, and the weight of the chosen one. */
  --tabs-track: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
  --tabs-track-border: 0 solid transparent;
  --tabs-track-blur: none;
  --tabs-track-padding: 3px;
  --tabs-track-radius: var(--radius-md);
  --tabs-segment-height: auto;
  --tabs-segment-padding: 8px 14px;
  --tabs-segment-radius: calc(var(--radius-md) - 2px);
  --tabs-segment-ink: var(--tabs-ink);
  --tabs-segment-font: 500 var(--font-size-sm)/normal var(--font-family);
  --tabs-chosen-bg: var(--color-bg-card);
  --tabs-chosen-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  --tabs-chosen-weight: 500;

  /* Page headers: how the row lays out, the title's type, and the bar a sticky one turns into once
     content passes under it. */
  --page-header-gap: var(--space-md);
  --page-header-align: center;
  --page-header-wrap: nowrap;
  --page-header-min-height: auto;
  --page-header-margin: 0;
  --page-header-padding: 0;
  --page-header-radius: 0;
  --page-header-top: 0;
  --page-title-font: 700 var(--font-size-2xl)/1.2 var(--font-family);
  --page-title-tracking: normal;
  --page-header-stuck-bg: var(--color-bg-page);
  --page-header-stuck-border: var(--color-border);
  --page-header-stuck-shadow: none;
  --page-header-stuck-blur: none;

  /* Charts: the series colours a chart takes in order, its grid, ticks, hover ring and tip. */
  --chart-1: #3987e5;
  --chart-2: #d95926;
  --chart-3: #1baf7a;
  --chart-4: #9f7bff;
  --chart-grid: var(--color-divider);
  --chart-tick-size: 12px;
  --chart-ring: var(--surface-modal-bg);
  --chart-tip-bg: var(--surface-modal-bg);
  --chart-column-radius: 4px;

  /* Search boxes: their measures, their fill and border, and how they look once focused. */
  --search-height: var(--filter-height, 34px);
  --search-padding: 0 var(--space-md);
  --search-radius: var(--radius-sm);
  --search-border: var(--color-border);
  --search-bg: color-mix(in srgb, var(--color-bg-card-hover) 76%, transparent);
  --search-blur: none;
  --search-font-size: inherit;
  --search-focus-border: var(--color-accent);
  --search-focus-bg: var(--search-bg);
  --search-focus-ring: none;

  /* Locked content: how unreadable it is, the mark above the note and the note's type. */
  --locked-gap: var(--space-md);
  --locked-dim: 0.6;
  --locked-blur: 6px;
  --locked-mark-size: 32px;
  --locked-mark-bg: var(--color-accent);
  --locked-mark-fg: var(--color-action-on-primary);
  --locked-note-font: 500 var(--font-size-sm)/1.4 var(--font-family);

  /* Avatars: their size, how much of the person's tint fills, rims and inks them, and their type. */
  --avatar-size: 32px;
  --avatar-fill-from: 100%;
  --avatar-fill-to: 100%;
  --avatar-ground: transparent;
  --avatar-ink: var(--color-on-fill);
  --avatar-ink-mix: 0%;
  --avatar-border-width: 0px;
  --avatar-border-mix: 0%;
  --avatar-shadow: var(--shadow-avatar);
  --avatar-weight: 700;
  --avatar-type-scale: 0.375;
  --avatar-face: var(--font-family);
  --avatar-tracking: normal;

  /* Scrim behind modal / command-palette surfaces — one set of values so
     every full-screen overlay dims and blurs the page the same way. */
  --scrim-bg: color-mix(in srgb, #000 34%, transparent);
  --scrim-blur: blur(8px) saturate(125%);

  /* ── Soft tints ──────────────────────────────────────────────── */
  --color-accent-soft: color-mix(in srgb, var(--color-accent) 18%, transparent);
  --color-success-soft: color-mix(in srgb, var(--color-success) 16%, transparent);
  --color-warn-soft: color-mix(in srgb, var(--color-warn) 18%, transparent);
  --color-danger-soft: color-mix(in srgb, var(--color-danger) 18%, transparent);

  /* ── Brand accents — the Sonar hues; the console and the docs sites draw on them. ── */
  --brand-accent: #4d8dff;
  --brand-purple: #9f7bff;
  --brand-amber: #ffc42e;
  --brand-orange: #ff8a3c;
  --brand-green: #2ee07b;
  /* Green usage rule — interactive accent and semantic success now share
   * one vivid green; keep the *roles* separate at call sites so the hue
   * can diverge again with a one-token change, not a sweep:
   *   • --color-accent (= --brand-green) → interactive / brand
   *     (buttons, focus, links, active states, selection).
   *   • --color-success                  → SEMANTIC status only
   *     (active / positive). */
}

/* ── Light-theme overrides ───────────────────────────────────────── */
:root[data-theme="light"] {
  --color-bg-page: #f8fafc;
  --color-bg-card: rgba(255, 255, 255, 0.92);
  --color-bg-card-hover: rgba(255, 255, 255, 0.98);
  --color-border: rgba(15, 23, 42, 0.1);
  --color-divider: rgba(15, 23, 42, 0.16);
  --color-divider-solid: #d8dadd;

  --color-text-primary: #0f172a;
  --color-text-muted: #475569;
  --color-text-faint: #94a3b8;

  --color-accent: var(--brand-green);
  --color-success: #16a34a;
  --color-warn: #ca8a04;
  --color-danger: #dc2626;

  --color-action-primary: #0f172a;
  --color-action-on-primary: #ffffff;

  --color-fill-neutral: #e2e8f0;

  --surface-glass-bg:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.4) 0%,
      rgba(255, 255, 255, 0.14) 50%,
      rgba(255, 255, 255, 0) 100%
    ),
    color-mix(in srgb, var(--color-bg-card) 68%, transparent);
  --surface-glass-border: var(--color-border);
  --surface-glass-blur: blur(26px) saturate(140%);
  --surface-glass-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 20px 44px -30px rgba(15, 23, 42, 0.22);

  --surface-raised-bg: #ffffff;
  --surface-popover-tint: 255, 255, 255;
  /* Over the dark scrim a see-through white turns grey, and grey controls on it lose their edge. */
  --surface-modal-bg: rgba(255, 255, 255, 0.97);
  --shadow-popover: 0 10px 28px -16px rgba(15, 23, 42, 0.22);
  --shadow-avatar: inset 0 0 0 1px rgba(15, 23, 42, 0.08), 0 2px 8px -2px rgba(15, 23, 42, 0.2);

  --brand-accent: #2563eb;
  --brand-purple: #7c3aed;
  --brand-amber: #d97706;
  --brand-orange: #ea580c;
  --brand-green: #16a34a;
}

/* A lifted graphite dark palette: still dark, but with enough blue-slate in the base and
 * surfaces to avoid a stark black canvas. Import after tokens.css; the light theme is untouched.
 * Docs, help and the admin console read on it. */
:root:not([data-theme="light"]) {
  --color-bg-page: #151a22;
  --color-bg-card: rgba(31, 38, 50, 0.82);
  --color-bg-card-hover: rgba(40, 49, 63, 0.9);
  --color-border: rgba(203, 213, 225, 0.12);
  --color-divider: rgba(203, 213, 225, 0.18);
  --color-divider-solid: #3a4350;
  --color-text-primary: #edf1f7;
  --color-text-muted: #b5becb;
  --color-text-faint: #838e9d;
  --color-action-primary: #edf1f7;
  --surface-glass-bg: rgba(22, 28, 37, 0.86);
  --surface-glass-border: rgba(203, 213, 225, 0.1);
  --surface-raised-bg: #1d2430;
  --surface-popover-tint: 29, 36, 48;
  --surface-modal-bg: rgba(29, 36, 48, 0.92);
}
/* The framework's own stylesheet: the page under the components. Only the body's wash reads a
 * palette, through --color-bg-page, so a site that swaps the palette swaps the wash with it. */

/* Dark-theme body wash — warm amber sunrise. */
:root body {
  background:
    radial-gradient(
      ellipse 1800px 800px at 50% -10%,
      rgba(251, 146, 60, 0.3) 0%,
      rgba(251, 146, 60, 0.15) 25%,
      rgba(251, 146, 60, 0.05) 50%,
      rgba(0, 0, 0, 0) 75%
    ),
    var(--color-bg-page);
  background-attachment: fixed;
}

:root[data-theme="light"] body {
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.35) 0%, rgba(0, 0, 0, 0) 40%),
    var(--color-bg-page);
  background-attachment: fixed;
}

/* ── Page reset ──────────────────────────────────────────────────── */
html,
body {
  margin: 0;
  padding: 0;
  color: var(--color-text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  min-height: 100vh;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Thin overlay scrollbars app-wide — the page and every nested scroll
 * container share one look instead of the browser's two native defaults.
 * Transparent track + a rounded thumb that floats clear of the edge via a
 * border that the background-clip paints over; brightens on hover. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--color-border);
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: var(--radius-full);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
  background-clip: content-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* The page's own wash, under whatever a palette sets on `:root body`. */
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(77, 141, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(48, 209, 88, 0.08), transparent 60%),
    var(--color-bg-page);
}

/* ── What the page does while it waits ────────────────────────────
 * swap.js marks the page and what it will replace. This is the page's own doing, not a
 * component's, so a site that draws its own page draws this too. */
[aria-busy="true"] {
  cursor: progress;
}
button[aria-busy="true"] {
  opacity: 0.7;
  pointer-events: none;
}

/* What a request will replace fades while it is out, and a bar runs along the top of the page.
   Both wait 150ms first, so a quick answer swaps in without a flicker. */
[data-swap-loading] {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s 0.15s;
}
html::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: calc(var(--z-modal) + 1);
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent) 0 0 / 40% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
html[data-swap-busy]::before {
  opacity: 1;
  transition-delay: 0.15s;
  animation: ui-progress 1.1s ease-in-out infinite;
}
@keyframes ui-progress {
  from {
    background-position: -40% 0;
  }
  to {
    background-position: 140% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  html[data-swap-busy]::before {
    animation: none;
    background-size: 100% 100%;
  }
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Native pickers and calendars follow the page's scheme. */
:root {
  color-scheme: dark;
}
:root[data-theme="light"] {
  color-scheme: light;
}
/* A page's own tick boxes and radios, drawn the design system's way. These are bare element
 * rules: they reach every one on the page, so a site whose controls are its own leaves them out.
 */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid color-mix(in srgb, var(--color-text-primary) 35%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
input[type="radio"] {
  border-radius: 50%;
}
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--color-accent);
}
input[type="checkbox"]::before,
input[type="radio"]::before {
  content: "";
  transform: scale(0);
  transition: transform 0.12s ease-out;
  background: var(--color-action-on-primary);
}
input[type="checkbox"]::before {
  width: 10px;
  height: 10px;
  clip-path: polygon(14% 44%, 0 62%, 40% 100%, 100% 22%, 84% 8%, 38% 68%);
}
input[type="radio"]::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--color-accent);
  background: var(--color-accent);
}
input[type="checkbox"]:checked::before,
input[type="radio"]:checked::before {
  transform: scale(1);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.text-display {
  color: var(--color-text-primary);
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* Large metric anchor — matches overview MetricCard value tier. */
.metric-hero-value {
  color: var(--color-text-primary);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.text-heading {
  color: var(--color-text-primary);
  font-size: var(--font-size-md);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

.text-body {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

.text-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 1.4;
}

.text-meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: 400;
  line-height: 1.4;
}

/* Glass / settings section cards — title + subtitle (no header icons). */
.card-section-title {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.card-section-sub {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.text-caption {
  color: var(--color-text-faint);
  font-size: var(--font-size-xs);
  font-weight: 400;
  line-height: 1.4;
}

/* ── Modifiers ───────────────────────────────────────────────────── */
.text-numeric {
  font-variant-numeric: tabular-nums;
}
.text-strong {
  font-weight: 600;
}

/* ── Atomic size / weight ────────────────────────────────────────── */
.text-xs {
  font-size: var(--font-size-xs);
}
.text-sm {
  font-size: var(--font-size-sm);
}
.text-md {
  font-size: var(--font-size-md);
}
.text-lg {
  font-size: var(--font-size-lg);
}
.text-xl {
  font-size: var(--font-size-xl);
}

.font-normal {
  font-weight: 400;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}

/* ── Atomic color ────────────────────────────────────────────────── */
.text-primary {
  color: var(--color-text-primary);
}
.text-muted {
  color: var(--color-text-muted);
}
.text-faint {
  color: var(--color-text-faint);
}
.text-success {
  color: var(--color-success);
}
.text-danger {
  color: var(--color-danger);
}
.text-warn {
  color: var(--color-warn);
}
.text-accent {
  color: var(--color-accent);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}
.uppercase {
  text-transform: uppercase;
}
.stack {
  display: flex;
  flex-direction: column;
}
.cluster {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}
.inline {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.gap-xs {
  gap: var(--space-xs);
}
.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}
.gap-xl {
  gap: var(--space-xl);
}

.p-xs {
  padding: var(--space-xs);
}
.p-sm {
  padding: var(--space-sm);
}
.p-md {
  padding: var(--space-md);
}
.p-lg {
  padding: var(--space-lg);
}
.p-xl {
  padding: var(--space-xl);
}

.px-md {
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}
.px-lg {
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.py-sm {
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}
.py-md {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.center-x {
  justify-content: center;
}
.center-y {
  align-items: center;
}
.center-xy {
  justify-content: center;
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}
.justify-end {
  justify-content: flex-end;
}
.justify-start {
  justify-content: flex-start;
}

.align-start {
  align-items: flex-start;
}
.align-end {
  align-items: flex-end;
}
.align-baseline {
  align-items: baseline;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.grid-cols-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.grid-cols-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}

.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}
.inline-flex {
  display: inline-flex;
}
.block {
  display: block;
}
.flex-wrap {
  flex-wrap: wrap;
}
.place-center {
  place-items: center;
}
.shrink-0 {
  flex-shrink: 0;
}
.min-w-0 {
  min-width: 0;
}
.min-h-0 {
  min-height: 0;
}
.m-0 {
  margin: 0;
}
.p-0 {
  padding: 0;
}
.relative {
  position: relative;
}
.list-none {
  list-style: none;
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}
.text-inherit {
  color: inherit;
}
.bare-button {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.w-full {
  width: 100%;
}
.flex-1 {
  flex: 1 1 0%;
  min-width: 0;
}

.sticky-md {
  position: sticky;
  top: var(--space-md);
}
.sticky-lg {
  position: sticky;
  top: var(--space-lg);
}

.hidden {
  display: none;
}

/* ── Surfaces ────────────────────────────────────────────────────── */
.surface--glass {
  background: var(--surface-glass-bg);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-card);
  /* No hand-written -webkit-backdrop-filter anywhere: the build generates
     prefixes from targets, and a manual prefixed duplicate makes the
     minifier's property merge DROP the standard declaration — Safari-only
     blur in production. */
  backdrop-filter: var(--surface-glass-blur);
  box-shadow: var(--surface-glass-shadow);
}

/* ── Hover bleed ─────────────────────────────────────────────────── */
/* For rows that sit flush with their container's content edge: the box
   grows ``--hover-bleed`` outward on both sides and pads it back, so the
   hover tint clears the row's first and last elements without moving
   them. Add ``.hover-bleed-well`` to a scrolling or clipping ancestor so
   the extra width has somewhere to go. */
.hover-bleed {
  --hover-bleed: var(--space-sm);
  width: calc(100% + var(--hover-bleed) * 2);
  margin-inline: calc(var(--hover-bleed) * -1);
  padding-inline: var(--hover-bleed);
  border-radius: var(--radius-sm);
}

.hover-bleed-well {
  --hover-bleed: var(--space-sm);
  margin-inline: calc(var(--hover-bleed) * -1);
  padding-inline: var(--hover-bleed);
}

/* ── Skeleton primitives ─────────────────────────────────────────── */
.skeleton-line,
.skeleton-block,
.skeleton-circle {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-text-primary) 6%, transparent) 0%,
    color-mix(in srgb, var(--color-text-primary) 14%, transparent) 50%,
    color-mix(in srgb, var(--color-text-primary) 6%, transparent) 100%
  );
  background-size: 200% 100%;
  animation: sonar-skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 14px;
  width: 100%;
}
.skeleton-block {
  height: 80px;
  width: 100%;
}
.skeleton-block--flex {
  flex: 1;
  min-height: 0;
  height: auto;
  width: 100%;
}
.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.skeleton-circle--fill {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

@keyframes sonar-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line,
  .skeleton-block,
  .skeleton-circle {
    animation: none;
  }
}
.ui-facts {
  display: grid;
  margin: 0;
}
.ui-facts__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 55%, transparent);
  font-size: var(--font-size-sm);
}
.ui-facts__row:last-child {
  border-bottom: 0;
}
.ui-facts dt {
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.ui-facts dd {
  min-width: 0;
  margin: 0;
  color: var(--color-text-primary);
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}
.ui-facts__code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.95em;
  font-weight: 400;
}
.ui-facts__none {
  color: var(--color-text-faint);
}

/* Docs shell + article typography. Everything reads the theme's tokens (ui/theme, with graphite.css
 * bundled before this file), so a site restyles itself by remapping semantic tokens, never by
 * overriding these classes. */

svg.ui-icon {
  flex-shrink: 0;
  display: block;
}

:root {
  --docs-topbar-h: 58px;
  --docs-measure: 720px;
  --docs-max-width: 1360px;
  --docs-type-2xs: 0.625rem;
  --docs-type-xs: 0.6875rem;
  --docs-type-sm: 0.75rem;
  --docs-type-ui: 0.8125rem;
  --docs-type-body-sm: 0.875rem;
  --docs-type-card-title: 0.9375rem;
  --docs-type-body: 1rem;
  --docs-type-lede: 1.125rem;
  --docs-type-h3: 1.125rem;
  --docs-type-h2: 1.375rem;
  --docs-type-h1: 2.125rem;
  --docs-table-header-radius: 4px;
  --docs-leading-heading: 1.35;
  --docs-leading-compact: 1.5;
  --docs-leading-body: 1.7;
  /* Long-form body text sits slightly below full contrast — pure white
   * on near-black fatigues over article-length reading. Headings and
   * strong runs keep full contrast. */
  --docs-fg: color-mix(in srgb, var(--color-text-primary) 88%, var(--color-bg-page));
}

html {
  scroll-behavior: smooth;
}

/* :root matches the `:root body` sunrise wash in tokens.css — docs pages
 * flatten it and keep only the whisper in body::before below, so both
 * themes read as docs chrome rather than Atlas product ambience. */
:root body {
  background: var(--color-bg-page);
}

/* Quiet echo of the Atlas "ambient cover": warm sunrise radials pinned
 * to the top of the viewport, far below reading contrast — tuned to the
 * same near-subliminal level as the light theme's wash. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 80% 44% at 28% -4%,
      color-mix(in srgb, var(--brand-amber) 5%, transparent) 0%,
      color-mix(in srgb, var(--brand-amber) 2%, transparent) 42%,
      transparent 68%
    ),
    radial-gradient(
      ellipse 60% 38% at 76% 0%,
      color-mix(in srgb, var(--brand-orange) 4%, transparent) 0%,
      transparent 58%
    );
}

:root:not([data-theme="light"]) body::before {
  background:
    radial-gradient(ellipse 72% 40% at 26% -5%, rgba(48, 209, 88, 0.055) 0%, transparent 58%),
    radial-gradient(ellipse 58% 34% at 78% -2%, rgba(77, 141, 255, 0.04) 0%, transparent 56%);
}

:root[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 70% 38% at 30% -4%, rgba(217, 119, 6, 0.05) 0%, transparent 58%),
    radial-gradient(ellipse 60% 34% at 74% 0%, rgba(16, 185, 129, 0.04) 0%, transparent 56%);
}

::selection {
  background: color-mix(in srgb, var(--color-accent) 28%, transparent);
}

:where(a, button, summary, select, input, textarea):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Topbar (sticky glass band) ──────────────────────────────── */

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-popover);
  border-bottom: 1px solid var(--color-border);
  background: var(--surface-glass-bg);
  backdrop-filter: var(--surface-glass-blur);
  -webkit-backdrop-filter: var(--surface-glass-blur);
}

.docs-topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  height: var(--docs-topbar-h);
  max-width: var(--docs-max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  font-family: var(--font-family);
}

.docs-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: var(--docs-type-body);
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
  text-decoration: none;
  white-space: nowrap;
}

.docs-topbar__logo {
  width: 18px;
  height: auto;
  display: block;
}

/* Source art is white — recolour to dark ink in the light theme. */
:root[data-theme="light"] .docs-topbar__logo {
  filter: brightness(0) saturate(100%);
}

.docs-topbar__brand-sub {
  font-weight: 500;
  color: var(--color-text-muted);
}

.docs-topbar__links {
  display: flex;
  gap: var(--space-lg);
  margin-left: auto;
}

.docs-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-topbar__menu {
  display: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  place-items: center;
  cursor: pointer;
}

.docs-topbar__menu:hover {
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-primary);
}

.docs-topbar__link {
  font-size: var(--docs-type-body-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.docs-topbar__link:hover {
  color: var(--color-text-primary);
}

.docs-topbar__link--active {
  color: var(--color-text-primary);
  position: relative;
}

.docs-topbar__link--active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

/* ── Shell grid ──────────────────────────────────────────────── */

.docs-shell {
  --docs-sticky-top: var(--space-md);
  --docs-rail-top: 0px;
  --docs-shell-pad-b: 96px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 216px;
  gap: clamp(28px, 3.5vw, 64px);
  max-width: var(--docs-max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) var(--docs-shell-pad-b);
  min-height: calc(100vh - var(--docs-topbar-h));
  color: var(--color-text-primary);
  font-family: var(--font-family);
}

.docs-topbar + .docs-shell {
  --docs-sticky-top: calc(var(--docs-topbar-h) + var(--space-md));
  --docs-rail-top: var(--docs-topbar-h);
}

.docs-shell--no-toc {
  grid-template-columns: 236px minmax(0, 1fr);
}

.docs-shell__toc {
  position: sticky;
  top: var(--docs-sticky-top);
  align-self: start;
  max-height: calc(100vh - var(--docs-sticky-top) - var(--space-md));
  overflow-y: auto;
}

/* Conventional docs rail — flush under the topbar, divided from the
 * article by a full-height hairline. Negative margins bleed the aside
 * through the shell's vertical padding so the divider spans the page;
 * the inner wrapper carries the sticky scroll. */
.docs-shell__sidebar {
  margin: calc(-1 * var(--space-lg)) 0 calc(-1 * var(--docs-shell-pad-b));
  border-right: 1px solid var(--color-border);
}

.docs-shell__sidebar-inner {
  position: sticky;
  top: var(--docs-rail-top);
  max-height: calc(100vh - var(--docs-rail-top));
  overflow-y: auto;
  padding: var(--space-lg) var(--space-md) var(--space-lg) 0;
}

.docs-shell__main {
  min-width: 0;
}

/* Wide screens: the rail anchors to the viewport's left edge and the
 * article + TOC group centers in the remaining space — flexible gutter
 * tracks on both sides keep the TOC adjacent to the article instead of
 * stranded at the far right. */
@media (min-width: 1440px) {
  .docs-topbar__inner {
    max-width: none;
  }

  .docs-shell {
    max-width: none;
    grid-template-columns: 250px 1fr minmax(0, var(--docs-measure)) 216px 1fr;
  }

  .docs-shell--no-toc {
    grid-template-columns: 250px 1fr minmax(0, var(--docs-measure)) 1fr;
  }

  .docs-shell__sidebar {
    grid-column: 1;
    grid-row: 1;
  }

  .docs-shell__main {
    grid-column: 3;
    grid-row: 1;
  }

  .docs-shell__toc {
    grid-column: 4;
    grid-row: 1;
  }
}

@media (min-width: 1600px) {
  .docs-shell {
    --docs-measure: 800px;
  }
}

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }
  .docs-shell__toc {
    display: none;
  }
}

@media (max-width: 960px) {
  .docs-shell,
  .docs-shell--no-toc {
    grid-template-columns: 1fr;
  }
  .docs-shell__sidebar {
    display: none;
  }
  .docs-topbar__menu {
    display: grid;
  }
  .docs-topbar__links {
    display: none;
  }
  .docs-topbar__actions {
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .docs-shell {
    --docs-shell-pad-b: 32px;
  }

  .docs-topbar__inner,
  .docs-shell {
    padding-right: var(--space-md);
    padding-left: var(--space-md);
  }
}

/* ── Mobile nav drawer (owned by DocsShell) ──────────────────── */

.docs-drawer__backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: docs-fade-in 0.15s ease;
  cursor: default;
}

.docs-drawer__panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: calc(var(--z-modal) + 1);
  width: min(300px, 85vw);
  display: flex;
  flex-direction: column;
  /* Card tone layered over the opaque page color — bg-card carries alpha. */
  background: linear-gradient(var(--color-bg-card), var(--color-bg-card)), var(--color-bg-page);
  border-right: 1px solid var(--color-border);
  animation: docs-drawer-in 0.18s ease;
  font-family: var(--font-family);
}

.docs-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--docs-topbar-h);
  padding: 0 var(--space-md);
}

.docs-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}

.docs-drawer__close:hover {
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-primary);
}

.docs-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-sm) var(--space-lg);
}

@keyframes docs-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes docs-drawer-in {
  from {
    transform: translateX(-100%);
  }
}

/* ── Sidebar nav ─────────────────────────────────────────────── */

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.docs-nav__filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-bottom: var(--space-md);
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-bg-card) 45%, transparent);
  color: var(--color-text-faint);
}

.docs-nav__filter:focus-within {
  border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-border));
  color: var(--color-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 9%, transparent);
}

.docs-nav__filter input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--docs-type-ui);
}

.docs-nav__filter input::placeholder {
  color: var(--color-text-faint);
}

.docs-nav__filter input::-webkit-search-cancel-button {
  opacity: 0.5;
}

.docs-nav__section {
  border-radius: var(--radius-sm);
}

.docs-nav__section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 5px var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--color-text-faint);
  list-style: none;
  transition:
    color 0.12s ease,
    background 0.12s ease;
}

summary.docs-nav__section-title {
  cursor: pointer;
  user-select: none;
}

.docs-nav__section-title::-webkit-details-marker {
  display: none;
}

.docs-nav__section-title > span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: var(--docs-type-sm);
  font-weight: 600;
  letter-spacing: 0.025em;
}

.docs-nav__section-title > svg {
  flex: 0 0 auto;
  transition: transform 0.16s ease;
}

summary.docs-nav__section-title:hover {
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-primary);
}

.docs-nav__section[open] > .docs-nav__section-title {
  color: var(--color-text-muted);
}

.docs-nav__section[open] > .docs-nav__section-title > span svg {
  color: color-mix(in srgb, var(--color-accent) 80%, var(--color-text-muted));
}

.docs-nav__section[open] > .docs-nav__section-title > svg {
  transform: rotate(90deg);
}

.docs-nav__links {
  list-style: none;
  margin: 1px 0 7px 21px;
  padding: 0;
  border-left: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.docs-nav__link {
  display: block;
  position: relative;
  padding: 5px 9px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--docs-type-ui);
  line-height: var(--docs-leading-compact);
  color: var(--color-text-muted);
  text-decoration: none;
  transition:
    color 0.12s ease,
    background 0.12s ease;
}

.docs-nav__link:hover {
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-primary);
}

.docs-nav__link--active {
  background: transparent;
  color: var(--color-text-primary);
  font-weight: 600;
}

.docs-nav__link--active::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

.docs-nav__empty {
  margin: 2px 0 0;
  padding: 0 var(--space-sm);
  color: var(--color-text-faint);
  font-size: var(--docs-type-ui);
}

.docs-nav__link--stub {
  color: var(--color-text-faint);
  cursor: default;
}

/* ── On-this-page TOC (scroll-spied) ─────────────────────────── */

.docs-toc__title {
  margin: var(--space-xs) 0 var(--space-sm);
  font-size: var(--docs-type-xs);
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.docs-toc__links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

.docs-toc__link {
  display: block;
  padding: 4px 0 4px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: var(--docs-type-ui);
  line-height: var(--docs-leading-compact);
  color: var(--color-text-muted);
  text-decoration: none;
}

.docs-toc__link--sub {
  padding-left: 26px;
}

.docs-toc__link:hover {
  color: var(--color-text-primary);
}

.docs-toc__link--active {
  border-left-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 500;
}

/* ── Article ─────────────────────────────────────────────────── */

.docs-article {
  max-width: var(--docs-measure);
  margin: 0 auto;
  width: 100%;
  font-size: var(--docs-type-body);
  line-height: var(--docs-leading-body);
  color: var(--docs-fg);
}

.docs-article :is(h1, h2, h3, h4) {
  scroll-margin-top: calc(var(--docs-topbar-h) + var(--space-lg));
  color: var(--color-text-primary);
}

.docs-article h1 {
  margin: 0 0 var(--space-sm);
  font-size: var(--docs-type-h1);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
  text-wrap: balance;
}

.docs-article h2 {
  margin: 32px 0 var(--space-md);
  font-size: var(--docs-type-h2);
  font-weight: 650;
  letter-spacing: -0.014em;
  line-height: var(--docs-leading-heading);
}

.docs-article h3 {
  margin: 32px 0 var(--space-sm);
  font-size: var(--docs-type-h3);
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: var(--docs-leading-heading);
}

.docs-article h4 {
  margin: var(--space-lg) 0 var(--space-sm);
  font-size: var(--docs-type-body);
  font-weight: 600;
}

.docs-article p,
.docs-article ul,
.docs-article ol {
  margin: 0 0 var(--space-md);
}

.docs-article strong {
  color: var(--color-text-primary);
}

.docs-article :is(ul, ol) {
  padding-left: 1.4em;
}

.docs-article li + li {
  margin-top: 6px;
}

.docs-article li > :is(ul, ol) {
  margin: 6px 0 0;
}

.docs-article ul li::marker {
  color: var(--color-text-faint);
}

.docs-article hr {
  margin: var(--space-xl) 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

/* Prose links only — component links (cards, page-nav, anchors) carry a
 * class and style themselves. */
.docs-article a:not([class]) {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  text-underline-offset: 3px;
}

.docs-article a:not([class]):hover {
  text-decoration-color: var(--color-accent);
}

.docs-article code {
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-hover-ghost);
  font-size: 0.85em;
  color: var(--color-text-primary);
}

/* Hover ¶-anchors injected by rehype-heading-ids. */
.docs-heading-anchor {
  margin-left: 0.35em;
  opacity: 0;
  text-decoration: none;
  color: var(--color-text-faint);
  transition: opacity 0.12s ease;
}

.docs-heading-anchor::before {
  content: "#";
}

.docs-article :is(h2, h3, h4):hover .docs-heading-anchor {
  opacity: 1;
}

.docs-heading-anchor:hover {
  color: var(--color-accent);
}

.docs-article__lede {
  margin: 0 0 var(--space-md);
  font-size: var(--docs-type-lede);
  color: var(--color-text-muted);
  line-height: 1.6;
  text-wrap: pretty;
}

/* ── Page meta (read time / updated) ─────────────────────────── */

.docs-page-meta {
  display: flex;
  gap: var(--space-lg);
  margin: var(--space-md) 0 var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--docs-type-ui);
  color: var(--color-text-faint);
}

.docs-page-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Callouts ────────────────────────────────────────────────── */

.docs-callout {
  margin: 20px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid
    color-mix(in srgb, var(--docs-callout-accent, var(--color-accent)) 18%, transparent);
  border-left: 2px solid var(--docs-callout-accent, var(--color-accent));
  background: color-mix(in srgb, var(--docs-callout-accent, var(--color-accent)) 5%, transparent);
}

.docs-callout--tip {
  --docs-callout-accent: var(--color-success);
}

.docs-callout--warn {
  --docs-callout-accent: var(--color-warn);
}

.docs-callout--danger {
  --docs-callout-accent: var(--color-danger);
}

.docs-callout .docs-callout__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 2px;
  font-size: var(--docs-type-ui);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--docs-callout-accent, var(--color-accent));
}

.docs-callout__body {
  font-size: var(--docs-type-body-sm);
  line-height: 1.6;
}

.docs-callout__body :last-child {
  margin-bottom: 0;
}

/* ── Code blocks (shiki + chrome) ────────────────────────────── */

.code-block {
  margin: var(--space-md) 0 var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px var(--space-md) 5px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-hover-ghost);
}

.code-block-lang {
  font-size: var(--docs-type-xs);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.copy-btn {
  border: none;
  background: none;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--docs-type-xs);
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-primary);
}

.copy-btn__idle,
.copy-btn__done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.copy-btn__done {
  display: none;
  color: var(--color-success);
}

.copy-btn--copied .copy-btn__idle {
  display: none;
}

.copy-btn--copied .copy-btn__done {
  display: inline-flex;
}

.code-block pre {
  margin: 0;
  padding: var(--space-md);
  border: none;
  border-radius: 0;
  overflow-x: auto;
  background: var(--surface-raised-bg) !important; /* beats shiki's inline theme bg */
  font-size: var(--docs-type-ui);
  line-height: var(--docs-leading-body);
  tab-size: 2;
}

/* Shiki dual-theme flip: inline colors are the dark palette; the light
 * palette rides along as --shiki-light custom properties. !important is
 * required to beat the inline style attribute. */
:root[data-theme="light"] .code-block .shiki,
:root[data-theme="light"] .code-block .shiki span {
  color: var(--shiki-light) !important;
}

.docs-article pre code {
  padding: 0;
  border: none;
  background: none;
  font-size: 1em;
}

/* ── Code tabs ───────────────────────────────────────────────── */

.docs-code-tabs {
  position: relative;
  min-width: 0;
  max-width: 100%;
  margin: var(--space-md) 0 var(--space-lg);
}

.docs-code-tabs .code-block {
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.docs-code-tabs__header {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.docs-code-tabs__select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.docs-code-tabs__select select {
  height: 32px;
  appearance: none;
  padding: 0 28px 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised-bg);
  font-family: var(--font-family);
  font-size: var(--docs-type-ui);
  color: var(--color-text-muted);
  cursor: pointer;
}

.docs-code-tabs__select select:hover {
  border-color: color-mix(in srgb, var(--color-text-muted) 42%, var(--color-border));
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-primary);
}

.docs-code-tabs__select > svg {
  position: absolute;
  right: 9px;
  color: var(--color-text-faint);
  pointer-events: none;
}

.docs-code-tabs__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.docs-code-tabs--tabbed .code-block-header {
  display: none;
}

.docs-code-tabs__copy {
  flex: 0 0 auto;
}

/* ── FAQ accordion ───────────────────────────────────────────── */

.docs-faq {
  margin: var(--space-md) 0 var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.docs-faq__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
}

.docs-faq__item[open] {
  border-color: var(--color-divider);
}

.docs-faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  font-size: var(--docs-type-card-title);
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text-primary);
  cursor: pointer;
  list-style: none;
}

.docs-faq__question::-webkit-details-marker {
  display: none;
}

.docs-faq__question:hover {
  color: var(--color-accent);
}

.docs-faq__chevron {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-text-faint);
  transition: transform 0.16s ease;
}

.docs-faq__item[open] .docs-faq__chevron {
  transform: rotate(180deg);
}

.docs-faq__answer {
  padding: 2px var(--space-md) var(--space-md);
  font-size: var(--docs-type-body-sm);
  color: var(--docs-fg);
}

.docs-faq__answer :last-child {
  margin-bottom: 0;
}

/* ── Steps ───────────────────────────────────────────────────── */

.docs-steps {
  counter-reset: docs-step;
  margin: var(--space-lg) 0;
  position: relative;
  padding-left: 46px;
}

.docs-steps::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--color-border);
}

.docs-steps > h3 {
  position: relative;
  margin-top: 44px;
}

.docs-steps > h3:first-child {
  margin-top: 0;
}

.docs-steps > h3::before {
  counter-increment: docs-step;
  content: counter(docs-step);
  position: absolute;
  left: -46px;
  top: -2px;
  width: 29px;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-action-on-primary);
  font-size: var(--docs-type-ui);
  font-weight: 700;
  box-shadow: 0 0 0 4px var(--color-bg-page);
}

@media (max-width: 600px) {
  .docs-steps {
    padding-left: 0;
  }

  .docs-steps::before {
    display: none;
  }

  .docs-steps > h3 {
    display: flex;
    align-items: center;
    min-height: 29px;
    padding-left: 40px;
  }

  .docs-steps > h3::before {
    left: 0;
    top: 0;
  }

  .docs-steps .code-block pre {
    width: 100%;
    max-width: 100%;
    overscroll-behavior-inline: contain;
  }
}

/* ── Endpoint ────────────────────────────────────────────────── */

.docs-endpoint {
  margin: var(--space-lg) 0;
}

.docs-endpoint__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-bg-card) 72%, transparent);
}

.docs-endpoint__method {
  --docs-method-color: var(--color-text-muted);
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--docs-method-color) 28%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--docs-method-color) 10%, transparent);
  color: var(--docs-method-color);
  font-size: var(--docs-type-xs);
  font-weight: 650;
  letter-spacing: 0.045em;
  line-height: 1.2;
}

.docs-endpoint__method--get {
  --docs-method-color: var(--color-success);
}

.docs-endpoint__method--post {
  --docs-method-color: var(--brand-accent);
}

.docs-endpoint__method--patch {
  --docs-method-color: var(--brand-amber);
}

.docs-endpoint__method--put {
  --docs-method-color: var(--brand-purple);
}

.docs-endpoint__method--delete {
  --docs-method-color: var(--color-danger);
}

.docs-endpoint .docs-endpoint__path {
  border: none;
  background: none;
  padding: 0;
  color: var(--color-text-primary);
  font-size: var(--docs-type-body-sm);
}

.docs-endpoint__body {
  padding: 10px 2px 0;
  font-size: var(--docs-type-body-sm);
}

.docs-endpoint__body :last-child {
  margin-bottom: 0;
}

/* ── Diagram system (Flow / Sequence / DecisionTree / Branches) ─ */

.docs-diagram {
  --docs-edge: color-mix(in srgb, var(--color-text-primary) 30%, transparent);
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background:
    radial-gradient(
        color-mix(in srgb, var(--color-text-primary) 7%, transparent) 1px,
        transparent 1px
      )
      0 0 / 18px 18px,
    color-mix(in srgb, var(--color-bg-card) 40%, transparent);
  overflow-x: auto;
}

.docs-diagram__caption {
  margin-top: var(--space-md);
  font-size: var(--docs-type-sm);
  text-align: center;
  color: var(--color-text-faint);
}

.docs-diagram__node {
  min-width: 120px;
  max-width: 250px;
  padding: 10px 14px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--surface-raised-bg);
  text-align: center;
  flex-shrink: 0;
}

.docs-diagram__node--accent {
  border-color: color-mix(in srgb, var(--color-accent) 50%, var(--color-border));
  background: color-mix(in srgb, var(--color-accent) 10%, var(--surface-raised-bg));
}

.docs-diagram__node-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 7px;
  border-radius: var(--radius-full);
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, var(--color-border));
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
}

.docs-diagram__node-title {
  margin: 0;
  font-size: var(--docs-type-ui);
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-primary);
}

.docs-diagram__node-note {
  margin: 3px 0 0;
  font-size: var(--docs-type-xs);
  line-height: 1.4;
  color: var(--color-text-muted);
}

.docs-diagram__node-items {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.docs-diagram__node-items li {
  position: relative;
  padding: 3px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-hover-ghost);
  font-size: var(--docs-type-xs);
  color: var(--color-text-muted);
}

.docs-diagram__node-items li + li {
  margin-top: 15px;
}

.docs-diagram__node-items li + li::before {
  content: "↓";
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-text-faint);
}

/* Edges — horizontal by default; vertical inside vertical flows and
 * branch columns. */
.docs-diagram__edge {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 44px;
  min-width: 52px;
  align-self: center;
}

.docs-diagram__edge-line {
  flex: 1;
  height: 1px;
  background: var(--docs-edge);
}

.docs-diagram__edge-head {
  width: 0;
  height: 0;
  border-left: 5px solid var(--docs-edge);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.docs-diagram__edge-label {
  position: absolute;
  bottom: calc(50% + 7px);
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--surface-raised-bg);
  font-size: var(--docs-type-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

:is(.docs-flow--vertical, .docs-branches__column) .docs-diagram__edge {
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 40px;
  width: auto;
}

:is(.docs-flow--vertical, .docs-branches__column) .docs-diagram__edge-line {
  flex: 1;
  width: 1px;
  height: auto;
}

:is(.docs-flow--vertical, .docs-branches__column) .docs-diagram__edge-head {
  border-top: 5px solid var(--docs-edge);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: none;
}

:is(.docs-flow--vertical, .docs-branches__column) .docs-diagram__edge-label {
  bottom: auto;
  top: 50%;
  left: calc(50% + 10px);
  transform: translateY(-50%);
}

/* Flow */

.docs-flow__track {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Horizontal flows share the track width — nodes compress and wrap
 * their text rather than forcing the canvas to scroll. Stretched to
 * equal height so mixed content doesn't produce a ragged row. */
.docs-flow--horizontal .docs-flow__track {
  align-items: stretch;
}

.docs-flow--horizontal .docs-diagram__node {
  flex: 1 1 0;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.docs-flow--horizontal .docs-diagram__edge {
  flex: 0 1 44px;
  min-width: 34px;
}

.docs-flow--vertical .docs-flow__track {
  flex-direction: column;
}

@media (max-width: 760px) {
  .docs-flow--horizontal .docs-flow__track {
    flex-direction: column;
  }
  .docs-flow--horizontal .docs-diagram__edge {
    flex-direction: column;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 40px;
    width: auto;
  }
  .docs-flow--horizontal .docs-diagram__edge-line {
    width: 1px;
    height: auto;
  }
  .docs-flow--horizontal .docs-diagram__edge-head {
    border-top: 5px solid var(--color-divider);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: none;
  }
  .docs-flow--horizontal .docs-diagram__edge-label {
    bottom: auto;
    top: 50%;
    left: calc(50% + 10px);
    transform: translateY(-50%);
  }
}

/* Sequence */

.docs-sequence__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.docs-sequence__step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-sequence__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
  font-size: var(--docs-type-xs);
  font-weight: 700;
}

.docs-sequence__actor {
  flex-shrink: 0;
  padding: 5px 11px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  background: var(--surface-raised-bg);
  font-size: var(--docs-type-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.docs-sequence__arrow {
  position: relative;
  flex: 1;
  min-width: 80px;
  height: 1px;
  background: var(--docs-edge);
  margin-top: 14px;
}

.docs-sequence__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  border-left: 5px solid var(--docs-edge);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.docs-sequence__label {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 300px;
  text-align: center;
  font-size: var(--docs-type-xs);
  line-height: 1.35;
  color: var(--color-text-muted);
}

@media (max-width: 700px) {
  .docs-sequence__step {
    flex-wrap: wrap;
  }
  .docs-sequence__arrow {
    order: 3;
    flex-basis: 100%;
    margin-top: 26px;
  }
}

.docs-sequence__result {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: var(--space-md);
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--color-success) 30%, var(--color-border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-success) 8%, transparent);
}

.docs-sequence__result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-success);
  color: var(--color-action-on-primary);
}

.docs-sequence__result-text {
  font-size: var(--docs-type-ui);
  font-weight: 600;
  color: var(--color-text-primary);
}

.docs-sequence__result-detail {
  font-size: var(--docs-type-sm);
  color: var(--color-text-faint);
}

/* Platform switch */

.docs-platform__bar {
  position: sticky;
  top: calc(var(--docs-topbar-h) + 10px);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: var(--space-md) 0 var(--space-lg);
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--surface-raised-bg);
  box-shadow: 0 6px 20px -12px rgba(0, 0, 0, 0.45);
}

.docs-platform__prompt {
  padding: 0 8px 0 10px;
  font-size: var(--docs-type-xs);
  color: var(--color-text-faint);
}

.docs-platform__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  font: inherit;
  font-size: var(--docs-type-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}

.docs-platform__option:hover {
  color: var(--color-text-primary);
}

.docs-platform__option--active {
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  color: var(--color-accent);
}

/* Lanes (swimlane sequence) */

.docs-lanes {
  --lane-gutter: 32px;
  container-type: inline-size;
}

.docs-lanes__actors {
  display: grid;
  grid-template-columns: repeat(var(--lane-count), minmax(0, 1fr));
  padding-left: var(--lane-gutter);
}

.docs-lanes__actor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 4px;
  padding: 12px 8px 10px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--surface-raised-bg);
  text-align: center;
}

.docs-lanes__actor-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-text-primary) 7%, transparent);
  color: var(--color-text-muted);
}

.docs-lanes__actor--sonar {
  border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-divider));
  background: color-mix(in srgb, var(--color-accent) 7%, var(--surface-raised-bg));
}

.docs-lanes__actor--sonar .docs-lanes__actor-icon {
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  color: var(--color-accent);
}

.docs-lanes__actor-label {
  font-size: var(--docs-type-sm);
  font-weight: 600;
  color: var(--color-text-primary);
}

.docs-lanes__actor-note {
  font-size: var(--docs-type-xs);
  color: var(--color-text-faint);
}

/* Doubled class: article list styles must not indent the lanes. */
.docs-lanes .docs-lanes__steps {
  position: relative;
  list-style: none;
  margin: 0;
  padding: var(--space-sm) 0 0;
}

.docs-lanes .docs-lanes__step {
  padding: 0;
}

.docs-lanes__lifeline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--lane-gutter) + (100% - var(--lane-gutter)) * var(--lane-center));
  border-left: 1px dashed color-mix(in srgb, var(--color-text-primary) 16%, transparent);
}

.docs-lanes__step {
  position: relative;
  height: 50px;
  margin-left: var(--lane-gutter);
  border-radius: var(--radius-sm);
  transition: opacity 0.3s ease;
}

.docs-lanes--playing .docs-lanes__step:not(.docs-lanes__step--active) {
  opacity: 0.6;
}

.docs-lanes__num {
  position: absolute;
  top: 50%;
  left: calc(4px - var(--lane-gutter));
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
  border-radius: var(--radius-full);
  background: var(--surface-raised-bg);
  color: var(--color-accent);
  font-size: var(--docs-type-xs);
  font-weight: 700;
}

.docs-lanes__route {
  display: none;
}

.docs-lanes__arrow {
  --lane-edge: color-mix(in srgb, var(--color-text-primary) 40%, transparent);
  position: absolute;
  top: 33px;
  left: calc(var(--lane-left) * 100%);
  width: calc(var(--lane-width) * 100%);
  height: 0;
  border-top: 1.5px solid var(--lane-edge);
}

.docs-lanes__arrow::after {
  content: "";
  position: absolute;
  top: -5.5px;
  right: 0;
  border-left: 7px solid var(--lane-edge);
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}

.docs-lanes__arrow--reverse::after {
  right: auto;
  left: 0;
  border-left: 0;
  border-right: 7px solid var(--lane-edge);
}

.docs-lanes__step--reply .docs-lanes__arrow {
  border-top-style: dashed;
}

.docs-lanes__step--data .docs-lanes__arrow {
  --lane-edge: var(--color-accent);
  border-top-width: 2px;
}

.docs-lanes__step--active .docs-lanes__num {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-action-on-primary);
}

.docs-lanes__step--active .docs-lanes__arrow {
  --lane-edge: var(--color-accent);
}

.docs-lanes__step--active .docs-lanes__label {
  color: var(--color-text-primary);
}

.docs-lanes__step--active .docs-lanes__arrow::before {
  content: "";
  position: absolute;
  top: -4.5px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 25%, transparent);
  animation: docs-lanes-packet calc(var(--lane-step-ms) * 0.85) cubic-bezier(0.45, 0, 0.55, 1) both;
}

.docs-lanes__step--active .docs-lanes__arrow--reverse::before {
  animation-direction: reverse;
}

.docs-lanes__step--active .docs-lanes__note {
  border-color: var(--color-accent);
  color: var(--color-text-primary);
}

@media (prefers-reduced-motion: reduce) {
  .docs-lanes__step--active .docs-lanes__arrow::before {
    display: none;
  }
}

@keyframes docs-lanes-packet {
  from {
    left: 0;
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  to {
    left: calc(100% - 7px);
    opacity: 0;
  }
}

.docs-lanes__label {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: max-content;
  max-width: max(100%, 240px);
  transform: translateX(-50%);
  padding: 0 6px;
  font-size: var(--docs-type-xs);
  line-height: 1.35;
  text-align: center;
  color: var(--color-text-muted);
}

.docs-lanes__step--data .docs-lanes__label {
  color: var(--color-text-primary);
  font-weight: 600;
}

.docs-lanes__note {
  position: absolute;
  top: 50%;
  left: calc(var(--lane-center) * 100%);
  max-width: 34%;
  transform: translate(-50%, -50%);
  padding: 5px 10px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  background: var(--surface-raised-bg);
  font-size: var(--docs-type-xs);
  line-height: 1.35;
  text-align: center;
  color: var(--color-text-muted);
}

@container (max-width: 560px) {
  .docs-lanes__actors,
  .docs-lanes__steps {
    --lane-gutter: 0px;
  }

  .docs-lanes__actor {
    padding: 10px 4px 8px;
  }

  .docs-lanes__actor-note {
    display: none;
  }

  .docs-lanes__lifeline {
    display: none;
  }

  .docs-lanes__step {
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 10px;
    height: auto;
    padding: 8px 0;
  }

  .docs-lanes__num {
    position: static;
    transform: none;
    grid-row: span 2;
  }

  .docs-lanes__route {
    display: block;
    font-size: var(--docs-type-xs);
    font-weight: 600;
    color: var(--color-text-primary);
  }

  .docs-lanes__arrow,
  .docs-lanes__note {
    position: static;
    width: auto;
    height: auto;
    max-width: none;
    transform: none;
    border: 0;
    padding: 0;
    background: none;
    text-align: left;
  }

  .docs-lanes__arrow::before,
  .docs-lanes__arrow::after {
    display: none;
  }

  .docs-lanes__label {
    position: static;
    transform: none;
    padding: 0;
    text-align: left;
  }
}

/* Comparison cards */

.docs-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0 var(--space-lg);
}

.docs-compare__card {
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-bg-card);
}

.docs-compare__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-sm);
}

.docs-compare__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
}

.docs-compare__title {
  margin: 0;
  font-size: var(--docs-type-card-title);
  font-weight: 650;
  color: var(--color-text-primary);
}

.docs-compare__desc {
  margin: 0 0 var(--space-md);
  font-size: var(--docs-type-ui);
  line-height: var(--docs-leading-compact);
  color: var(--color-text-muted);
}

/* Decision tree — the canvas hugs the tree and centers itself instead
 * of stranding it on the left of a full-width card. */

.docs-tree {
  width: fit-content;
  min-width: min(480px, 100%);
  max-width: 100%;
  margin-inline: auto;
}

.docs-tree__question {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--surface-raised-bg);
  font-size: var(--docs-type-ui);
  font-weight: 600;
  color: var(--color-text-primary);
}

.docs-tree__branches {
  list-style: none;
  margin: 12px 0 0 14px;
  padding: 0 0 0 24px;
  border-left: 1px solid var(--docs-edge);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.docs-tree__branch {
  position: relative;
}

.docs-tree__branch::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 12px;
  width: 18px;
  height: 1px;
  background: var(--docs-edge);
}

.docs-tree__branch-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-hover-ghost);
  font-size: var(--docs-type-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}

.docs-tree .docs-diagram__node {
  display: inline-block;
  text-align: left;
}

/* Branches (fan-out) */

.docs-branches__root {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.docs-branches__split {
  width: calc(100% / var(--branch-count, 2));
  height: 18px;
  margin: 0 auto;
  border-top: 1px solid transparent;
  border-left: 1px solid var(--docs-edge);
  border-right: 1px solid var(--docs-edge);
  position: relative;
}

.docs-branches__split::before {
  content: "";
  position: absolute;
  top: 0;
  left: -1px;
  right: -1px;
  border-top: 1px solid var(--docs-edge);
}

.docs-branches__split--merge {
  transform: scaleY(-1);
}

.docs-branches__columns {
  display: grid;
  grid-template-columns: repeat(var(--branch-count, 2), minmax(0, 1fr));
  gap: var(--space-lg);
}

.docs-branches__column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.docs-branches__label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-hover-ghost);
  font-size: var(--docs-type-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}

@media (max-width: 700px) {
  .docs-branches__columns {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .docs-branches__split {
    display: none;
  }
}

/* ── Prev / next page nav ────────────────────────────────────── */

.docs-page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  max-width: var(--docs-measure);
  margin: 56px auto 0;
}

.docs-page-nav__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  text-decoration: none;
}

.docs-page-nav__link--next {
  align-items: flex-end;
  text-align: right;
  grid-column: 2;
}

.docs-page-nav__dir {
  font-size: var(--docs-type-2xs);
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.docs-page-nav__label {
  font-size: var(--docs-type-body-sm);
  font-weight: 520;
  color: var(--color-text-primary);
}

.docs-page-nav__link:hover .docs-page-nav__label {
  color: var(--color-accent);
}

/* ── Markdown-list card grids (card-grid / feature-grid) ─────── */

.docs-md-card-grid > ul {
  list-style: none;
  margin: var(--space-md) 0 var(--space-lg);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
}

.docs-md-card-grid > ul > li {
  position: relative;
  margin: 0;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  font-size: var(--docs-type-body-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
  cursor: pointer;
}

.docs-md-card-grid > ul > li + li {
  margin-top: 0;
}

.docs-md-card-grid > ul > li:hover {
  border-color: color-mix(in srgb, var(--color-accent) 35%, var(--color-border));
}

/* Loose lists wrap item content in <p>; treat both shapes the same. */
.docs-md-card-grid > ul > li > p {
  margin: 0;
}

.docs-md-card-grid > ul > li > strong,
.docs-md-card-grid > ul > li > p > strong {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-text-primary);
  font-size: var(--docs-type-card-title);
}

.docs-md-card-grid > ul > li strong a {
  text-decoration: none;
}

.docs-md-card-grid > ul > li strong a::before {
  content: "";
  position: absolute;
  inset: 0;
}

.docs-md-card-grid > ul > li:has(strong a:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--color-accent) 55%, transparent);
  outline-offset: 2px;
}

.docs-md-card-grid > ul > li strong a::after {
  content: "→";
  display: inline-block;
  margin-left: 6px;
  opacity: 0.6;
  transition: transform 0.15s ease;
}

.docs-md-card-grid > ul > li:hover strong a::after {
  transform: translateX(3px);
}

/* ── Screenshots (Shot / ShotGrid) ───────────────────────────── */

.docs-shot {
  margin: var(--space-lg) auto;
}

.docs-shot__img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
}

.docs-shot__caption {
  margin-top: var(--space-sm);
  font-size: var(--docs-type-sm);
  text-align: center;
  color: var(--color-text-faint);
}

/* Portrait phone captures are tall; cap them so a screenshot never pushes
 * the surrounding prose off the screen. */
.docs-shot--phone {
  max-width: 300px;
  margin-inline: auto;
}

.docs-shot-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
  margin: var(--space-lg) 0;
}

.docs-shot-grid .docs-shot {
  margin: 0;
  max-width: none;
}

/* ── Tables ──────────────────────────────────────────────────── */
.docs-table {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  margin: var(--space-md) 0 var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-bg-card) 55%, transparent);
}

.docs-table__scroller {
  overflow-x: auto;
}

/* Overflow affordances (driven by initTableScroll): fade the clipped
 * edge and pin the first column so rows keep their identity. */
.docs-table__fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 3;
}

.docs-table__fade--left {
  left: 0;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--color-bg-page) 85%, transparent),
    transparent
  );
}

.docs-table__fade--right {
  right: 0;
  background: linear-gradient(
    to left,
    color-mix(in srgb, var(--color-bg-page) 85%, transparent),
    transparent
  );
}

.docs-table[data-scrollable]:not(.docs-table--at-start) .docs-table__fade--left,
.docs-table[data-scrollable]:not(.docs-table--at-end) .docs-table__fade--right {
  opacity: 1;
}

/* Sticky cells must be opaque — tokens like --color-bg-card carry alpha,
 * so the card tone is layered over the opaque page color. */
.docs-table {
  --docs-sticky-cell-bg:
    linear-gradient(var(--color-bg-card), var(--color-bg-card)), var(--color-bg-page);
}

.docs-table[data-scrollable] :is(th, td):first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid var(--color-border);
  background: var(--docs-sticky-cell-bg);
}

.docs-table[data-scrollable] thead th:first-child {
  background:
    linear-gradient(
      color-mix(in srgb, var(--color-bg-card) 72%, transparent),
      color-mix(in srgb, var(--color-bg-card) 72%, transparent)
    ),
    var(--docs-sticky-cell-bg);
}

.docs-table[data-scrollable] tbody tr:hover td:first-child {
  background:
    linear-gradient(
      color-mix(in srgb, var(--color-text-primary) 1.75%, transparent),
      color-mix(in srgb, var(--color-text-primary) 1.75%, transparent)
    ),
    var(--docs-sticky-cell-bg);
}

.docs-article table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--docs-type-body-sm);
  line-height: var(--docs-leading-compact);
}

.docs-article th,
.docs-article td {
  padding: 10px 16px;
  text-align: left;
  vertical-align: top;
}

.docs-article thead th {
  background: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--docs-type-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-wrap: balance;
  white-space: normal;
}

.docs-article tbody th {
  color: var(--color-text-primary);
  font-size: var(--docs-type-body-sm);
  font-weight: 520;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
}

.docs-article tbody tr + tr > * {
  border-top: 1px solid var(--color-border);
}

.docs-article tbody tr:hover > * {
  background: color-mix(in srgb, var(--color-text-primary) 3%, transparent);
}

.docs-article .docs-table {
  border: 0;
  border-radius: 0;
  background: none;
}

.docs-article .docs-table__scroller {
  padding: 1px;
}

.docs-article thead th {
  padding-block: 12px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-bg-card) 72%, transparent);
  color: var(--color-text-muted);
  font-size: var(--docs-type-ui);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.docs-article thead th:first-child {
  border-left: 1px solid var(--color-border);
  border-radius: var(--docs-table-header-radius) 0 0 var(--docs-table-header-radius);
}

.docs-article thead th:last-child {
  border-right: 1px solid var(--color-border);
  border-radius: 0 var(--docs-table-header-radius) var(--docs-table-header-radius) 0;
}

.docs-article tbody td {
  padding-block: 14px;
}

.docs-article tbody tr + tr > * {
  border-top-color: color-mix(in srgb, var(--color-border) 72%, transparent);
}

.docs-article tbody tr:hover > * {
  background: color-mix(in srgb, var(--color-text-primary) 1.75%, transparent);
}

.docs-article .code-block {
  position: relative;
  border-color: color-mix(in srgb, var(--color-border) 88%, transparent);
  border-radius: calc(var(--radius-md) + 2px);
  background: var(--surface-raised-bg);
}

.docs-article .code-block-header {
  position: absolute;
  z-index: 1;
  inset: 10px 10px auto 16px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: none;
}

.docs-article .code-block-lang {
  align-self: center;
  color: var(--color-text-faint);
  font-size: var(--docs-type-2xs);
  font-weight: 600;
}

.docs-article .copy-btn {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised-bg);
  place-items: center;
  pointer-events: auto;
}

.docs-article .copy-btn:hover {
  border-color: color-mix(in srgb, var(--color-text-muted) 42%, var(--color-border));
  background: var(--color-bg-hover-ghost);
}

.docs-article .copy-btn :is(.copy-btn__idle, .copy-btn__done) > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.docs-article .code-block pre {
  padding: 48px 20px 20px;
  background: transparent !important;
  font-size: var(--docs-type-body-sm);
  line-height: var(--docs-leading-body);
}

/* Inside an already-framed surface, drop the card chrome so tables
 * don't double-border. */
.docs-endpoint__body .docs-table,
.docs-callout__body .docs-table {
  border: none;
  border-radius: 0;
  background: none;
  margin: var(--space-sm) 0 0;
}

/* ── Reading progress ────────────────────────────────────────── */

.docs-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  transform-origin: 0 50%;
  z-index: calc(var(--z-modal) + 1);
  pointer-events: none;
}

/* ── Home hero + topic cards ─────────────────────────────────── */

.docs-hero {
  margin: var(--space-xl) 0;
}

.docs-hero h1 {
  margin: 0 0 var(--space-sm);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}

.docs-hero__tagline {
  margin: 0 0 var(--space-lg);
  font-size: var(--docs-type-lede);
  color: var(--color-text-muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.docs-hero__search {
  width: 100%;
  max-width: 680px;
  padding: 13px var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-faint);
  font-family: var(--font-family);
  font-size: var(--docs-type-card-title);
  text-align: left;
  cursor: text;
}

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.docs-card {
  display: block;
  padding: var(--space-md);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  text-decoration: none;
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
}

.docs-card:hover {
  background: var(--color-bg-card-hover);
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-border));
}

.docs-card:hover .docs-card__title {
  color: var(--color-accent);
}

.docs-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
}

.docs-card__title {
  margin: 0 0 var(--space-xs);
  font-size: var(--docs-type-card-title);
  font-weight: 650;
  transition: color 0.12s ease;
}

.docs-card__blurb {
  margin: 0;
  font-size: var(--docs-type-body-sm);
  color: var(--color-text-muted);
  line-height: var(--docs-leading-compact);
}

/* Plain-text trail — pills read as buttons, and the whole card is
 * already the link. */
.docs-card__trail {
  margin: var(--space-sm) 0 0;
  font-size: var(--docs-type-sm);
  line-height: 1.7;
  color: var(--color-text-faint);
  text-wrap: pretty;
}

.docs-card__meta {
  display: flex;
  gap: var(--space-md);
  margin: var(--space-sm) 0 0;
  font-size: var(--docs-type-sm);
  color: var(--color-text-faint);
}

.docs-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.docs-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 var(--space-sm);
  font-size: var(--docs-type-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ── Landing (sidebar-less home) ─────────────────────────────── */

.docs-landing {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) 96px;
  color: var(--color-text-primary);
  font-family: var(--font-family);
}

.docs-landing .docs-hero {
  margin: calc(var(--space-xl) * 1.6) auto var(--space-xl);
  max-width: 720px;
  text-align: center;
}

.docs-landing .docs-hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.25rem);
}

.docs-landing .docs-hero__tagline {
  margin-bottom: 0;
  font-size: var(--docs-type-body);
}

.docs-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.docs-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: var(--docs-type-body-sm);
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    filter 0.12s ease;
}

.docs-btn--primary {
  background: var(--color-accent);
  color: var(--color-action-on-primary);
}

.docs-btn--primary:hover {
  filter: brightness(1.08);
}

.docs-btn--ghost {
  border: 1px solid var(--color-border);
  background: var(--surface-raised-bg);
  color: var(--color-text-primary);
}

.docs-btn--ghost:hover {
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-border));
}

.docs-landing__heading {
  margin: var(--space-xl) 0 var(--space-md);
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* Two wide columns — four narrow cards cramp the blurbs and trails. */
.docs-landing .docs-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
}

/* Browse cards: the card IS the link (icon tile + blurb + chevron),
 * mirroring how best-in-class docs do section directories. */
.docs-browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.docs-browse-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-bg-card);
  text-decoration: none;
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
}

.docs-browse-card:hover {
  background: var(--color-bg-card-hover);
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-border));
}

.docs-browse-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
}

.docs-browse-card__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.docs-browse-card__title {
  font-size: var(--docs-type-card-title);
  font-weight: 650;
  color: var(--color-text-primary);
  transition: color 0.12s ease;
}

.docs-browse-card:hover .docs-browse-card__title {
  color: var(--color-accent);
}

.docs-browse-card__desc {
  font-size: var(--docs-type-body-sm);
  line-height: var(--docs-leading-compact);
  color: var(--color-text-muted);
}

.docs-browse-card__meta {
  margin-top: 3px;
  font-size: var(--docs-type-sm);
  color: var(--color-text-faint);
}

.docs-browse-card__chevron {
  display: inline-flex;
  align-self: center;
  margin-left: auto;
  color: var(--color-text-faint);
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    color 0.15s ease;
}

.docs-browse-card:hover .docs-browse-card__chevron {
  opacity: 1;
  transform: translateX(0);
  color: var(--color-accent);
}

/* ── Developer docs home ────────────────────────────────────── */

.docs-home {
  padding-top: 8px;
}

.docs-home__hero {
  display: grid;
  gap: 28px;
  padding: 28px 0 28px;
}

.docs-home__kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: var(--docs-type-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.docs-article .docs-home__intro h1 {
  max-width: 13ch;
  margin-bottom: 14px;
  font-size: clamp(2.25rem, 5vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.docs-article .docs-home__lead {
  max-width: 56ch;
  margin: 0;
  font-size: var(--docs-type-body);
  line-height: 1.6;
  color: var(--color-text-muted);
}

.docs-home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.docs-home__actions .docs-btn {
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-size: var(--docs-type-body-sm);
}

.docs-home__request {
  align-self: end;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--color-bg-card) 70%, transparent);
}

.docs-home__request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 10px 12px;
  font-size: var(--docs-type-xs);
  color: var(--color-text-faint);
}

.docs-home__request-head {
  border-bottom: 1px solid var(--color-divider);
}

.docs-home__request-title {
  color: var(--color-text-primary);
  font-size: var(--docs-type-ui);
  font-weight: 600;
  text-decoration: none;
}

.docs-home__request-title:hover {
  color: var(--color-accent);
}

.docs-home__method {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-accent) 11%, transparent);
  color: var(--color-accent);
  font-size: var(--docs-type-2xs);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.docs-article .docs-home__request pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 20px 16px;
  background: transparent;
  font-size: var(--docs-type-sm);
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.docs-home__code-command {
  color: var(--color-accent);
  font-weight: 650;
}

.docs-home__code-string {
  color: var(--docs-fg);
}

.docs-home__code-flag {
  color: var(--color-text-muted);
}

.docs-home__code-variable {
  color: var(--brand-purple);
}

.docs-home__section {
  padding: 44px 0 0;
}

.docs-home__section--flow {
  padding-top: 16px;
}

.docs-article .docs-home__section h2 {
  margin: 0 0 20px;
  font-size: var(--docs-type-h2);
}

.docs-home__section-lead {
  margin: 12px 0 18px;
  color: var(--color-text-muted);
  font-size: var(--docs-type-body-sm);
  line-height: var(--docs-leading-body);
}

.docs-home__paths {
  display: grid;
}

.docs-home__path {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon label arrow"
    "icon title arrow"
    ". description arrow";
  gap: 2px 12px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  text-decoration: none;
}

.docs-home__path:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-accent) 6%, transparent),
    transparent 70%
  );
}

.docs-home__path-icon {
  grid-area: icon;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border: 1px solid color-mix(in srgb, var(--color-accent) 24%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
  color: var(--color-accent);
}

.docs-home__path-label {
  grid-area: label;
  font-size: var(--docs-type-xs);
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.docs-home__path-title {
  grid-area: title;
  font-size: var(--docs-type-card-title);
  font-weight: 650;
}

.docs-home__path-description {
  grid-area: description;
  margin-top: 4px;
  font-size: var(--docs-type-ui);
  line-height: var(--docs-leading-compact);
  color: var(--color-text-muted);
}

.docs-home__path-arrow {
  grid-area: arrow;
  align-self: center;
  display: inline-flex;
  color: var(--color-text-faint);
  transition: transform 0.14s ease;
}

.docs-home__path:hover .docs-home__path-arrow {
  transform: translateX(3px);
  color: var(--color-accent);
}

.docs-home__destination {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 4px;
  color: var(--color-text-primary);
  text-decoration: none;
}

.docs-home__destination > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.docs-home__destination :is(.docs-home__path-icon, .docs-home__path-label, .docs-home__path-arrow) {
  grid-area: auto;
}

.docs-home__destination strong {
  font-size: var(--docs-type-card-title);
  font-weight: 650;
}

.docs-home__destination small {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: var(--docs-type-ui);
  line-height: var(--docs-leading-compact);
}

.docs-home__destination:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-accent) 6%, transparent),
    transparent 70%
  );
}

.docs-home__destination:hover .docs-home__path-arrow {
  transform: translateX(3px);
  color: var(--color-accent);
}

.docs-home__section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 4px;
}

.docs-home__section-head .docs-home__kicker {
  margin-bottom: 8px;
}

.docs-article .docs-home__section-head h2 {
  margin-bottom: 0;
}

.docs-home__spec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 3px;
  color: var(--color-text-muted);
  font-size: var(--docs-type-ui);
  text-decoration: none;
}

.docs-home__spec:hover {
  color: var(--color-accent);
}

.docs-home__resources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  margin-top: 16px;
}

.docs-home__resources > a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 2px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  text-decoration: none;
}

.docs-home__resources > a:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.docs-home__resource-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.docs-home__resource-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
}

.docs-home__resources strong {
  font-size: var(--docs-type-card-title);
  font-weight: 600;
}

.docs-home__resources small {
  overflow: hidden;
  color: var(--color-text-faint);
  font-size: var(--docs-type-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-home__resources > a > svg {
  flex: 0 0 auto;
  color: var(--color-text-faint);
}

.docs-home__resources > a:hover :is(strong, svg, .docs-home__resource-icon) {
  color: var(--color-accent);
}

@media (max-width: 560px) {
  .docs-home__hero {
    padding-top: 18px;
  }

  .docs-article .docs-home__intro h1 {
    font-size: 2.25rem;
  }

  .docs-home__section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-home__resources {
    grid-template-columns: 1fr;
  }

  .docs-home__resources > a:nth-last-child(2) {
    border-bottom: 1px solid var(--color-border);
  }
}

/* ── Breadcrumb ──────────────────────────────────────────────── */

.docs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: 0 0 var(--space-md);
  font-size: var(--docs-type-ui);
  color: var(--color-text-faint);
}

.docs-breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  color: var(--color-accent);
}

/* ── Footer ──────────────────────────────────────────────────── */

.docs-footer {
  border-top: 1px solid var(--color-border);
  font-family: var(--font-family);
}

.docs-footer__inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px 48px;
  margin: 0 auto;
  padding: 28px var(--space-lg) 22px;
}

.docs-footer__wordmark {
  margin: 0 0 3px;
  font-size: var(--docs-type-body);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

.docs-footer__wordmark span {
  font-weight: 500;
  color: var(--color-text-muted);
}

.docs-footer__tagline {
  margin: 0;
  font-size: var(--docs-type-ui);
  line-height: var(--docs-leading-compact);
  color: var(--color-text-faint);
}

.docs-footer__links {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.docs-footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  font-size: var(--docs-type-ui);
  color: var(--color-text-muted);
  text-decoration: none;
}

.docs-footer__links a:hover {
  color: var(--color-accent);
}

.docs-footer__links .docs-footer__link--spec {
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-primary);
}

.docs-footer__inner--groups {
  grid-template-columns: minmax(220px, 300px) 1fr;
  max-width: var(--docs-max-width);
  align-items: start;
  padding-top: 36px;
  padding-bottom: 32px;
}

.docs-footer__groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 24px 40px;
}

.docs-footer__title {
  margin: 0 0 10px;
  font-size: var(--docs-type-sm);
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--color-text-primary);
}

.docs-footer__group-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-footer__group-links a {
  display: inline-block;
  padding: 3px 0;
  font-size: var(--docs-type-ui);
  color: var(--color-text-muted);
  text-decoration: none;
}

.docs-footer__group-links a:hover {
  color: var(--color-accent);
}

@media (max-width: 1100px) {
  .docs-footer__groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .docs-footer__inner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 24px;
  }

  .docs-footer__links {
    justify-content: flex-start;
    gap: 6px 18px;
  }

  .docs-footer__groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 20px;
  }
}

/* ── Theme toggle ────────────────────────────────────────────── */

.docs-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
}

.docs-theme-toggle:hover {
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-primary);
}

:root[data-theme="light"] .docs-theme-toggle__sun,
:root:not([data-theme="light"]) .docs-theme-toggle__moon {
  display: none;
}

/* ── Sidebar search button ───────────────────────────────────── */

.docs-nav__search {
  width: 100%;
  justify-content: flex-start;
  font: inherit;
  cursor: pointer;
}

.docs-nav__search:hover {
  border-color: color-mix(in srgb, var(--color-text-muted) 36%, var(--color-border));
  background: var(--color-bg-hover-ghost);
  color: var(--color-accent);
}

.docs-nav__search-label {
  flex: 1;
  color: var(--color-text-faint);
  font-size: var(--docs-type-ui);
  text-align: left;
}

.docs-nav__search kbd {
  padding: 1px 5px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: color-mix(in srgb, var(--color-bg-card) 68%, transparent);
  color: var(--color-text-faint);
  font-family: var(--font-family);
  font-size: 10px;
  line-height: 1.5;
}

/* ── Platform blocks ─────────────────────────────────────────── */

.docs-platform__block {
  display: contents;
}

.docs-platform__block[hidden] {
  display: none;
}

/* ── Endpoint parameters and shapes (from the API's contracts) ─ */

.docs-endpoint__shape {
  margin-top: 10px;
  font-size: var(--docs-type-ui);
}

.docs-endpoint__shape > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-faint);
  font-size: var(--docs-type-sm);
  list-style: none;
  cursor: pointer;
}

.docs-endpoint__shape > summary::-webkit-details-marker {
  display: none;
}

.docs-endpoint__shape > summary::before {
  content: "";
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  margin: 0 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.docs-endpoint__shape[open] > summary::before {
  transform: rotate(45deg);
}

.docs-endpoint__shape > summary:hover {
  color: var(--color-text-primary);
}

.docs-endpoint .docs-endpoint__shape-title {
  margin: 16px 0 4px;
  color: var(--color-text-muted);
  font-size: var(--docs-type-sm);
  font-weight: 600;
}

.docs-endpoint__field {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 10px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.docs-endpoint__required {
  color: var(--color-accent);
  font-size: var(--docs-type-xs);
}

.docs-endpoint__rules {
  color: var(--color-text-faint);
}

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

.search-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(15vh, 132px) var(--space-md) var(--space-md);
  background: color-mix(in srgb, #05070b 56%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: search-fade-in 0.12s ease-out;
}

.search-backdrop[hidden],
.search-empty[hidden] {
  display: none;
}

.search-dialog {
  width: min(680px, 100%);
  max-height: min(680px, calc(100vh - 112px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-border) 82%, var(--color-text-faint));
  border-radius: 14px;
  background: linear-gradient(var(--color-bg-card), var(--color-bg-card)), var(--color-bg-page);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.3);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  animation: search-dialog-in 0.14s ease-out;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 var(--space-md);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-accent);
}

.search-input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: var(--docs-type-body);
}

.search-input-row input::placeholder {
  color: var(--color-text-faint);
}

.search-close {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.search-dialog kbd {
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: color-mix(in srgb, var(--color-bg-card) 72%, transparent);
  color: var(--color-text-faint);
  font-family: var(--font-family);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--color-text-primary) 9%, transparent);
}

.search-results {
  min-height: 180px;
  overflow-y: auto;
  padding: 10px;
}

.search-label {
  margin: 3px 8px 7px;
  color: var(--color-text-faint);
  font-size: var(--docs-type-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-results ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-results li + li {
  margin-top: 2px;
}

.search-results li a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.search-results li a.active {
  background: color-mix(in srgb, var(--color-accent) 10%, var(--color-bg-card));
}

.search-result-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--color-accent) 22%, var(--color-border));
  border-radius: 7px;
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
  color: var(--color-accent);
}

.search-result-copy {
  min-width: 0;
}

.search-result-title,
.search-result-excerpt {
  display: block;
}

.search-result-title {
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: var(--docs-type-body-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-title > span {
  margin: 0 6px;
  color: var(--color-text-faint);
  font-weight: 400;
}

.search-result-excerpt {
  margin-top: 2px;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--docs-type-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-section {
  color: var(--color-text-faint);
  font-size: 11px;
  white-space: nowrap;
}

.search-empty {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--color-text-faint);
  text-align: center;
}

.search-empty strong {
  margin-top: 5px;
  color: var(--color-text-primary);
  font-size: var(--docs-type-body-sm);
}

.search-empty span {
  font-size: var(--docs-type-sm);
}

.search-footer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 38px;
  padding: 0 var(--space-md);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-faint);
  font-size: 11px;
}

.search-footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes search-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes search-dialog-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
}

@media (max-width: 600px) {
  .search-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .search-dialog {
    width: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .search-input-row {
    min-height: var(--docs-topbar-h);
    padding-inline: var(--space-md);
  }

  .search-escape {
    display: none;
  }

  .search-close {
    display: grid;
  }

  .search-results {
    flex: 1;
  }

  .search-results li a {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .search-result-section {
    display: none;
  }

  .search-footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
.code-block .docs-code { color: #e6edf3; }
:root[data-theme="light"] .code-block .docs-code { color: #1f2328; }
.code-block .tk { color: #ff7b72; }
:root[data-theme="light"] .code-block .tk { color: #cf222e; }
.code-block .tc { color: #79c0ff; }
:root[data-theme="light"] .code-block .tc { color: #0550ae; }
.code-block .ts { color: #a5d6ff; }
:root[data-theme="light"] .code-block .ts { color: #0a3069; }
.code-block .tt { color: #7ee787; }
:root[data-theme="light"] .code-block .tt { color: #116329; }
.code-block .tf { color: #d2a8ff; }
:root[data-theme="light"] .code-block .tf { color: #8250df; }
.code-block .tv { color: #ffa657; }
:root[data-theme="light"] .code-block .tv { color: #953800; }
.code-block .tm { color: #8b949e; }
:root[data-theme="light"] .code-block .tm { color: #6e7781; }
/* The api-docs site's own components. Each selector carries one class more than written
 * (.docs-article, or the component's root), as Svelte's scoping did. */

/* ── Mobile SDK support matrix ── */

.docs-article .support-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-bg-card) 55%, transparent);
}

.docs-article .support-legend__intro {
  display: grid;
  gap: 1px;
  flex: 0 0 auto;
}

.docs-article .support-legend__eyebrow {
  color: var(--color-text-primary);
  font-size: var(--docs-type-ui);
  font-weight: 650;
  letter-spacing: 0.02em;
}

.docs-article .support-legend__hint {
  color: var(--color-text-faint);
  font-size: var(--docs-type-xs);
}

.docs-article .support-legend__items {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.docs-article .support-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text-muted);
  font-size: var(--docs-type-ui);
  white-space: nowrap;
}

.docs-article .support-matrix {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  margin: var(--space-md) 0 var(--space-lg);
}

.docs-article .support-matrix__scroller {
  overflow-x: auto;
  padding: 1px;
}

.docs-article .support-matrix__scroller:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}

.support-matrix table {
  width: 100%;
  min-width: 660px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--docs-type-body-sm);
  line-height: var(--docs-leading-compact);
  table-layout: fixed;
}

.support-matrix th,
.support-matrix td {
  padding: 12px 14px;
  vertical-align: middle;
}

.docs-article .support-matrix thead th {
  background: color-mix(in srgb, var(--color-bg-card) 72%, transparent);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--docs-type-ui);
  font-weight: 500;
  letter-spacing: 0;
  text-align: center;
  vertical-align: middle;
  line-height: 1.25;
  text-wrap: balance;
  white-space: normal;
}

.support-matrix thead th:first-child,
.support-matrix tbody th {
  width: 36%;
  text-align: left;
}

.support-matrix thead th:first-child {
  border-left: 1px solid var(--color-border);
  border-radius: var(--docs-table-header-radius) 0 0 var(--docs-table-header-radius);
}

.support-matrix thead th:nth-child(2),
.support-matrix thead th:nth-child(3) {
  width: 18%;
}

.support-matrix thead th:last-child {
  width: 28%;
  text-align: left;
  border-right: 1px solid var(--color-border);
  border-radius: 0 var(--docs-table-header-radius) var(--docs-table-header-radius) 0;
}

.support-matrix tbody th {
  background: transparent;
  color: var(--color-text-primary);
  font-size: var(--docs-type-body-sm);
  font-weight: 520;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
}

.support-matrix tbody td:not(:last-child) {
  text-align: center;
}

.support-matrix tbody tr + tr :is(th, td) {
  border-top: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
}

.support-matrix tbody tr:hover :is(th, td) {
  background: color-mix(in srgb, var(--color-text-primary) 1.75%, transparent);
}

.docs-article .support-mark {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: var(--radius-full);
  font-size: 1rem;
  line-height: 1;
}

.docs-article .support-mark svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.docs-article .support-mark--supported {
  background: color-mix(in srgb, var(--color-success) 16%, transparent);
  color: var(--color-success);
}

.docs-article .support-mark--derived {
  border: 1px solid color-mix(in srgb, var(--color-accent) 42%, transparent);
  color: var(--color-accent);
}

.docs-article .support-mark--derived circle {
  fill: currentColor;
  stroke: none;
}

.docs-article .support-mark--unsupported {
  color: var(--color-text-faint);
}

.docs-article .support-access {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.docs-article .support-access > span {
  display: inline-flex;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--color-accent) 22%, var(--color-border));
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
  color: var(--color-text-muted);
  font-size: var(--docs-type-xs);
  font-weight: 500;
  white-space: nowrap;
}

.docs-article .support-status {
  display: block;
  width: fit-content;
  margin: 6px auto 0;
  padding: 1px 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-faint);
  font-size: var(--docs-type-xs);
  font-weight: 500;
  white-space: nowrap;
}

.docs-article .support-status--available {
  border-color: color-mix(in srgb, var(--color-success) 40%, transparent);
  background: color-mix(in srgb, var(--color-success) 10%, transparent);
  color: var(--color-success);
}

.docs-article .support-matrix__upcoming .support-mark {
  opacity: 0.6;
}

.docs-article .support-ids {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.docs-article .support-ids code {
  color: var(--color-text-faint);
  font-size: var(--docs-type-xs);
  font-weight: 400;
}

.docs-article .support-access > .support-access__not-served {
  border-color: var(--color-border);
  background: var(--color-bg-hover-ghost);
  color: var(--color-text-faint);
}

.docs-article .support-matrix__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .docs-article .support-legend {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-article .support-legend__items {
    justify-content: flex-start;
  }

  .support-matrix thead th:first-child,
  .support-matrix tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 1px solid var(--color-border);
    background:
    linear-gradient(var(--color-bg-card), var(--color-bg-card)), var(--color-bg-page);
  }

  .support-matrix thead th:first-child {
    z-index: 2;
    background:
    linear-gradient(
    color-mix(in srgb, var(--color-bg-card) 72%, transparent),
    color-mix(in srgb, var(--color-bg-card) 72%, transparent)
    ),
    linear-gradient(var(--color-bg-card), var(--color-bg-card)), var(--color-bg-page);
  }

  .support-matrix tbody tr:hover th {
    background:
    linear-gradient(
    color-mix(in srgb, var(--color-text-primary) 1.75%, transparent),
    color-mix(in srgb, var(--color-text-primary) 1.75%, transparent)
    ),
    linear-gradient(var(--color-bg-card), var(--color-bg-card)), var(--color-bg-page);
  }
}

/* ── Metric tables in sections ── */

.docs-article .sectioned-table table {
  min-width: 420px;
  table-layout: fixed;
}

.docs-article .sectioned-table__primary-column {
  width: 64%;
}

.docs-article .sectioned-table tbody + tbody .sectioned-table__section > th {
  border-top: 1px solid var(--color-border);
}

.docs-article .sectioned-table .sectioned-table__section > th {
  padding: 10px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
  background: color-mix(in srgb, var(--color-accent) 6%, var(--color-bg-card));
}

.docs-article .sectioned-table tbody:first-of-type .sectioned-table__section > th {
  border-top: 0;
}

.docs-article .sectioned-table .sectioned-table__section + tr > * {
  border-top: 0;
}

.docs-article .sectioned-table .sectioned-table__section h3 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--docs-type-ui);
  font-weight: 600;
  line-height: var(--docs-leading-compact);
}

.docs-article .sectioned-table tbody th[scope="row"] {
  font-weight: 400;
}

@media (max-width: 600px) {
  .docs-article .sectioned-table table {
    min-width: 0;
    width: 100%;
  }

  .docs-article .sectioned-table__primary-column {
    width: 50%;
  }

  .docs-article .sectioned-table :is(th, td),
  .docs-article .sectioned-table .sectioned-table__section > th {
    padding-right: 10px;
    padding-left: 10px;
  }

  .docs-article .sectioned-table tr:not(.sectioned-table__section) > :last-child {
    text-align: right;
  }

  .docs-article .sectioned-table tbody th[scope="row"] code {
    overflow-wrap: anywhere;
  }
}

/* ── Resource cards ── */

.docs-article .resource-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0 var(--space-lg);
}

.docs-article .resource-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  text-decoration: none;
}

.docs-article .resource-card:hover {
  border-color: color-mix(in srgb, var(--color-accent) 35%, var(--color-border));
}

.docs-article .resource-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--color-text-faint);
}

.docs-article .resource-card__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: var(--space-xs);
}

.docs-article .resource-card__copy strong {
  font-size: var(--docs-type-card-title);
  font-weight: 600;
  line-height: var(--docs-leading-compact);
}

.docs-article .resource-card__copy small {
  color: var(--color-text-muted);
  font-size: var(--docs-type-body-sm);
  line-height: 1.55;
}

.docs-article .resource-card__arrow {
  display: inline-flex;
  margin-top: 3px;
  color: color-mix(in srgb, var(--color-accent) 60%, var(--color-text-faint));
  transition: transform 0.15s ease;
}

.docs-article .resource-card:hover :is(.resource-card__icon, .resource-card__arrow, strong) {
  color: var(--color-accent);
}

.docs-article .resource-card:hover .resource-card__arrow {
  transform: translateX(3px);
}

@media (max-width: 560px) {
  .docs-article .resource-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile SDK data flow ── */

.docs-article .sdk-flow {
  --flow-native: var(--color-accent);
  --flow-product: var(--color-text-muted);
  --flow-edge: color-mix(in srgb, var(--color-text-primary) 22%, transparent);
  container-type: inline-size;
  margin: 1.75rem 0;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg-card);
  overflow: hidden;
}

.sdk-flow .figure-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.5rem;
}

.sdk-flow .figure-heading h3 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: var(--docs-type-card-title);
  font-weight: 600;
  line-height: 1.5;
}

.sdk-flow .figure-heading > span {
  color: var(--color-text-muted);
  font-size: var(--docs-type-sm);
  white-space: nowrap;
}

.sdk-flow .drawing-wrap {
  padding: 0 0.5rem;
}

.sdk-flow .drawing {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font-family);
}

.sdk-flow .drawing--compact {
  display: none;
  max-width: 360px;
  margin: 0 auto;
}

.sdk-flow .drawing--compact .native-path {
  marker-end: url(#sdk-compact-native-arrow);
}

.sdk-flow .drawing--compact .product-path {
  marker-end: url(#sdk-compact-product-arrow);
}

.sdk-flow .boundary {
  fill: none;
  stroke: var(--flow-edge);
  stroke-dasharray: 4 5;
}

.sdk-flow .app-boundary,
.sdk-flow .backend-boundary {
  fill: color-mix(in srgb, var(--color-text-primary) 2%, var(--color-bg-card));
  stroke: var(--flow-edge);
}

.sdk-flow .node {
  fill: var(--color-bg-card);
  stroke: var(--flow-edge);
}

.sdk-flow .system-label {
  fill: var(--color-text-primary);
  font-size: var(--docs-type-body);
  font-weight: 600;
}

.sdk-flow .app-label {
  fill: var(--color-text-muted);
  font-size: var(--docs-type-body-sm);
  font-weight: 500;
}

.sdk-flow .node-label,
.sdk-flow .backend-label {
  fill: var(--color-text-primary);
  font-size: var(--docs-type-card-title);
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
}

.sdk-flow .backend-label {
  font-weight: 600;
}

.sdk-flow .credential {
  fill: var(--color-text-muted);
  font-size: var(--docs-type-ui);
}

.sdk-flow .credential path {
  fill: none;
  stroke: var(--color-text-muted);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sdk-flow .native-path,
.sdk-flow .product-path,
.sdk-flow .native-arrowhead,
.sdk-flow .product-arrowhead {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sdk-flow .native-path,
.sdk-flow .native-arrowhead {
  stroke: var(--flow-native);
}

.sdk-flow .native-path {
  marker-end: url(#sdk-native-arrow);
}

.sdk-flow .product-path,
.sdk-flow .product-arrowhead {
  stroke: var(--flow-product);
}

.sdk-flow .product-path {
  marker-end: url(#sdk-product-arrow);
}

.sdk-flow figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--color-border);
}

.sdk-flow figcaption span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: var(--docs-type-sm);
  line-height: 1.5;
}

.sdk-flow .legend-line {
  position: relative;
  width: 1.375rem;
  height: 1.5px;
  background: var(--flow-product);
  color: var(--flow-product);
}

.sdk-flow .legend-line::after {
  position: absolute;
  top: -2px;
  right: 0;
  width: 5px;
  height: 5px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  content: "";
}

.sdk-flow .legend-line--native {
  background: var(--flow-native);
  color: var(--flow-native);
}

@container (max-width: 540px) {
  .sdk-flow .drawing--wide,
  .sdk-flow .figure-heading > span {
    display: none;
  }

  .sdk-flow .drawing--compact {
    display: block;
  }
}

/* ── Metric catalog ── */

@media (max-width: 600px) {
  #timeseries-metrics + p + .docs-table tr > :last-child {
    text-align: right;
  }
}
