/* Generated by tools/techno-docs/build.mjs: the shared chunk of /assets/site.css,
   then tools/techno-docs/docs.css. Edit those, not this file. */

/* shared:start ------------------------------------------------------------
   Everything from here to shared:end is prepended to the docs stylesheet by
   tools/techno-docs/build.mjs: fonts, tokens, base, layout, header, footer,
   type, links and buttons. Page-specific rules go after shared:end. */

/* Fonts ----------------------------------------------------------------------
   Self-hosted, Latin subset, WOFF2 (tools/build-fonts.mjs from src/fonts/;
   OFL.txt beside them). Absolute URLs, because the docs build copies this
   chunk into docs.css. Only the regular cut is preloaded (src/chrome.mjs and
   tools/techno-docs/page.html); a file whose glyphs change needs a new name,
   because /assets/fonts/* is cached as immutable. */
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/assets/fonts/geist-mono-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* tokens:start --------------------------------------------------------------
   Everything between tokens:start and tokens:end is shared with the docs
   (tools/techno-docs/build.mjs prepends it to docs.css). */
:root {
  color-scheme: light dark;

  /* Colour — light (default). Contrast figures: design-spec §2.1 */
  --bg: #fbfbf9;            /* paper */
  --surface: #f2f1ed;       /* cards, stages, code blocks */
  --surface-2: #e8e7e2;     /* hover fill on surface */
  --text: #141413;          /* headings, primary text, buttons */
  --text-2: #43423e;        /* body copy */
  --text-3: #65645e;        /* metadata, captions, hints */
  --line: #e2e0da;          /* decorative hairlines (no contrast requirement) */
  --line-strong: #cfcdc6;   /* rules that separate rows; link underlines */
  --control: #7b7972;       /* input/radio/select borders: >= 3:1 */
  --accent: #e60012;        /* brand red: mark, focus ring, current-page bar. Non-text only */
  --accent-text: #c20010;   /* red when it must be text (required marker, error title) */
  --error: #b3000f;         /* error text + invalid field border */
  --button-bg: #141413;
  --button-text: #fbfbf9;
  --button-bg-hover: #3a3936;
  --selection: #e6001226;
  --focus: var(--accent);

  /* Type */
  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: 0.8125rem;                                   /* 13  mono meta, labels */
  --step-0: 0.9375rem;                                    /* 15  UI, nav, captions, hints */
  --step-1: 1.0625rem;                                    /* 17  body */
  --step-2: 1.25rem;                                      /* 20  lead, h3 */
  --step-3: clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem);     /* 24 → 30  h2 (small), legal h2 */
  --step-4: clamp(1.875rem, 1.35rem + 1.9vw, 2.75rem);    /* 30 → 44  section h2 */
  --step-5: clamp(2.375rem, 1.5rem + 3.6vw, 4.5rem);      /* 38 → 72  page h1 */
  --step-6: clamp(3.5rem, 1.6rem + 7.2vw, 8.5rem);        /* 56 → 136 product name */

  --lh-tight: 1.04;
  --lh-heading: 1.12;
  --lh-snug: 1.35;
  --lh-body: 1.65;

  /* Space (4px base) */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 3rem;     /* 48 */
  --space-8: 4rem;     /* 64 */
  --space-9: 6rem;     /* 96 */
  --space-10: 8rem;    /* 128 */
  --section: clamp(4rem, 2.5rem + 6vw, 8.5rem);          /* 64 → 136 between sections */

  /* Layout */
  --wrap: 80rem;                                          /* 1280 content */
  --margin: clamp(1rem, 5.5vw - 0.1rem, 5rem);            /* 16 @320 · 20 @390 · 41 @768 · 55 @1024 · 78 @1440 */
  --gutter: clamp(1rem, 0.6rem + 1.2vw, 1.5rem);          /* 16 → 24 */
  --measure: 40rem;                                       /* 640, ~68ch prose */
  --header-h: 4.5rem;                                     /* 72 */

  /* Shape & motion */
  --radius: 0;
  --hairline: 1px;
  --dur-fast: 120ms;
  --dur: 200ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0e;
    --surface: #181817;
    --surface-2: #222220;
    --text: #ededea;
    --text-2: #c3c2bc;
    --text-3: #9c9b95;
    --line: #2a2927;
    --line-strong: #3b3a37;
    --control: #7c7b75;
    --accent: #e60012;       /* brand red unchanged: 3.99:1 on --bg, 3.70:1 on --surface (non-text, needs 3:1) */
    --accent-text: #ff6259;
    --error: #ff7a70;
    --button-bg: #ededea;
    --button-text: #0f0f0e;
    --button-bg-hover: #cfcec8;
    --selection: #e6001252;
  }
}
/* tokens:end */

/* Base ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: var(--step-1);
  line-height: var(--lh-body);
  font-kerning: normal;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; }
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { color: var(--text); font-weight: 400; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
strong, b { font-weight: 700; color: var(--text); }
::selection { background: var(--selection); color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--margin); top: var(--space-3); z-index: 100;
  padding: var(--space-2) var(--space-4); background: var(--button-bg); color: var(--button-text);
  font-size: var(--step-0); text-decoration: none; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Layout -------------------------------------------------------------------- */
.wrap { width: min(100% - 2 * var(--margin), var(--wrap)); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }

/* Header -------------------------------------------------------------------- */
.site-header { border-bottom: var(--hairline) solid var(--line); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--space-5); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 0.625rem; color: var(--text); text-decoration: none; }
.brand__mark { width: calc(28px * 40 / 42); height: 28px; flex: none; } /* viewBox 40 × 42 */
.brand__mark .b { fill: currentColor; }
.brand__mark .h { fill: var(--accent); }
.brand__name { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1; }
.nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; column-gap: var(--space-6); list-style: none; padding: 0; }
/* Both rows may wrap only when text is enlarged or spaced out (WCAG 1.4.10,
   1.4.12); at normal settings everything fits on one row down to 320px. */
.nav li { display: flex; align-items: center; }
.nav a {
  position: relative; display: flex; align-items: center; min-height: var(--header-h);
  color: var(--text-2); text-decoration: none; font-size: var(--step-0);
  transition: color var(--dur-fast) var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a[aria-current] { color: var(--text); }
.nav a[aria-current]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
}
@media (max-width: 599px) {
  .site-header__inner, .nav a { min-height: 3.75rem; }
  .brand__name { font-size: 1.0625rem; }
  .nav ul { column-gap: var(--space-5); }
  .nav a { font-size: var(--step-1); }
}
@media (max-width: 359px) {
  .site-header__inner { column-gap: var(--space-3); }
  .brand { gap: 0.5rem; }
  .brand__mark { width: 20px; height: 21px; }
  .nav ul { column-gap: var(--space-4); }
  .nav a { font-size: var(--step-0); }
}

/* Footer -------------------------------------------------------------------- */
.site-footer { border-top: var(--hairline) solid var(--line); margin-top: var(--section); padding-block: var(--space-8) var(--space-6); font-size: var(--step-0); line-height: 1.55; }
.site-footer__top { row-gap: var(--space-7); }
.site-footer__brand { grid-column: 1 / span 3; display: grid; gap: var(--space-3); align-content: start; }
.site-footer__brand .brand { color: var(--text); margin-bottom: var(--space-2); }
.site-footer__brand p { max-width: 17rem; color: var(--text-3); }
.site-footer__nav { grid-column: 4 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--space-7); }
.site-footer h2 { font: 400 var(--step--1)/1.4 var(--font-mono); color: var(--text-3); margin-bottom: var(--space-4); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--accent); }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-6); margin-top: var(--space-8); padding-top: var(--space-5); border-top: var(--hairline) solid var(--line); color: var(--text-3); font-family: var(--font-mono); font-size: var(--step--1); }
@media (max-width: 1023px) {
  .site-footer__brand, .site-footer__nav { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
  .site-footer__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Type ---------------------------------------------------------------------- */
.meta { font-family: var(--font-mono); font-size: var(--step--1); line-height: 1.5; color: var(--text-3); letter-spacing: 0; }
.display { font-size: var(--step-5); line-height: var(--lh-tight); letter-spacing: -0.032em; }
.display .quiet { color: var(--text-3); }
.product-name { font-size: var(--step-6); line-height: 0.95; letter-spacing: -0.05em; margin-left: -0.04em; }
.h2 { font-size: var(--step-4); line-height: var(--lh-heading); letter-spacing: -0.022em; }
.h3 { font-size: var(--step-2); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.lead { font-size: var(--step-2); line-height: 1.55; color: var(--text-2); letter-spacing: -0.005em; }
.small { font-size: var(--step-0); line-height: 1.55; }

/* Links & buttons ----------------------------------------------------------- */
a { color: var(--text); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--line-strong); transition: text-decoration-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
a:hover { text-decoration-color: var(--accent); }
.link-arrow { color: var(--text); text-decoration: none; }
/* A no-break space keeps the arrow on the line with the last word, while a
   long label can still wrap on a narrow screen. */
.link-arrow::after { content: "\a0\2192"; }
.link-arrow:hover { text-decoration: underline; text-decoration-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 3rem; padding: 0 1.375rem; border: 1px solid var(--button-bg); border-radius: var(--radius);
  background: var(--button-bg); color: var(--button-text);
  font-size: 1rem; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.button:hover { background: var(--button-bg-hover); border-color: var(--button-bg-hover); }
.button--secondary { background: transparent; color: var(--text); border-color: var(--text); }
.button--secondary:hover { background: var(--surface); border-color: var(--text); }
.status {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-2);
}
.status::before { content: ""; width: 7px; height: 7px; background: var(--accent); flex: none; }

/* shared:end */

/* ==========================================================================
   Techno docs — docs-specific rules (tools/techno-docs/docs.css).
   build.mjs prepends the shared chunk of /assets/site.css (between
   `shared:start` and `shared:end`: fonts, tokens, base, .wrap, header, footer,
   .meta, links, buttons), so the docs use the studio's fonts, colors, header
   and footer, and follow prefers-color-scheme like the rest of the site.
   ========================================================================== */

:root {
  --docs-sidebar-w: 16rem;     /* 256 */
  --docs-toc-w: 13.5rem;       /* 216 */
  --docs-gap: 3rem;            /* 48 */
  --docs-toolbar-h: 3.5rem;    /* 56, phone toolbar */
  --info: #1d5bb8;
  --success: #2f6f3a;
  --warning: #8a5300;
  --danger: #b3000f;
  --hover: color-mix(in srgb, var(--text) 6%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root { --info: #6ea8ff; --success: #6fcf85; --warning: #f0b44c; --danger: #ff7a70; }
}

html { scroll-padding-top: calc(var(--header-h) + 1.5rem); }
/* Controls that need docs.js carry [hidden] until it runs; keep that winning
   over their own display values. */
[hidden] { display: none !important; }
button { background: none; border: 0; cursor: pointer; }
kbd { font-family: var(--font-sans); }
.icon { width: 1em; height: 1em; flex-shrink: 0; }

/* Header: the studio header, sticky, with docs search in the middle ---------- */
.docs .site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 94%, transparent); }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .docs .site-header { background: var(--bg); } }
@media (min-width: 900px) { .docs .site-header__inner { gap: var(--space-6); } }
.docs-search-slot { flex: 1; display: flex; justify-content: center; max-width: 26rem; }
.nav .button--small { min-height: 2.25rem; padding: 0 0.875rem; font-size: var(--step-0); align-self: center; }
.nav a.button--small { min-height: 2.25rem; color: var(--text); }
.nav a.button--small::after { display: none; }
.label-narrow { display: none; }

.search-trigger {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; height: 2.5rem; padding: 0 var(--space-3);
  border: 1px solid var(--control); background: var(--bg); color: var(--text-3); font-size: var(--step-0);
  transition: border-color var(--dur-fast) var(--ease);
}
.search-trigger:hover { border-color: var(--text-2); color: var(--text-2); }
.search-trigger .icon { font-size: 1rem; }
.search-placeholder { flex: 1; text-align: left; }
.search-kbd { display: flex; gap: 4px; }
.search-kbd span { display: inline-flex; align-items: center; justify-content: center; min-width: 1.375rem; height: 1.375rem; padding: 0 4px; border: 1px solid var(--line-strong); font: 400 var(--step--1)/1 var(--font-mono); color: var(--text-3); }

/* Phone toolbar (Contents · Search · On this page) — sticky under the header on < 900px */
.docs-toolbar { display: none; }

/* Layout -------------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr) var(--docs-toc-w); gap: var(--docs-gap); }

/* Sidebar */
.sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; padding: var(--space-4) 0 var(--space-4); }
/* docs.js scrolls the list so the current page's group title sits at the top;
   the first 16px fade, so anything scrolled past slides out of view softly. */
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-3) 0 0; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--space-4));
  mask-image: linear-gradient(to bottom, transparent, #000 var(--space-4));
}
.sidebar-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sidebar-close, .toc-close { display: none; }
.toc-close { align-items: center; min-height: 2.75rem; margin-bottom: var(--space-2); color: var(--text-2); font-size: var(--step-0); }
.nav-group + .nav-group { margin-top: var(--space-5); }
.nav-group-title { font: 400 var(--step--1)/1.4 var(--font-mono); color: var(--text-3); padding: 0 var(--space-3); margin-bottom: var(--space-2); }
.nav-group ul { list-style: none; padding: 0; }
.nav-group li a {
  display: flex; align-items: center; gap: var(--space-3); min-height: 2.25rem; padding: 0.4rem var(--space-3);
  border-left: 2px solid transparent; font-size: var(--step-0); line-height: 1.35; color: var(--text-2); text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-group li a:hover { background: var(--hover); color: var(--text); }
.nav-group li a.active { background: var(--surface); color: var(--text); border-left-color: var(--accent); }
.nav-group li a .icon { display: none; }            /* text-only navigation */
.sidebar-footer { padding: var(--space-4) var(--space-3) 0; border-top: 1px solid var(--line); margin-top: var(--space-4); display: grid; gap: var(--space-2); font-size: var(--step-0); }
.sidebar-footer a { color: var(--text-2); text-decoration: none; }
.sidebar-footer a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); }
.nav-backdrop { display: none; }

/* Content */
.content { min-width: 0; padding: var(--space-7) 0 var(--space-8); }
.page { max-width: 44rem; }

.page-header { margin-bottom: var(--space-7); }
.page-header-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 2rem; margin-bottom: var(--space-4); }
.docs-crumbs { font-size: var(--step-0); color: var(--text-3); }
.docs-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; }
.docs-crumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--line-strong); }
.docs-crumbs a { color: var(--text-3); text-decoration: none; }
.docs-crumbs a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); }
.page-actions { display: flex; align-items: center; gap: var(--space-2); }
.action-button {
  display: inline-flex; align-items: center; gap: var(--space-2); height: 2rem; padding: 0 0.625rem;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); font-size: var(--step--1); text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.action-button:hover { background: var(--hover); color: var(--text); }
.action-button .icon { font-size: 0.95rem; }
.action-icon { width: 2rem; padding: 0; justify-content: center; }
.toc-toggle { display: none; }

.page-title { font-size: var(--step-5); line-height: var(--lh-tight); letter-spacing: -0.032em; }
.page-title .page-icon { display: none; }
.page-description { margin-top: var(--space-4); font-size: var(--step-2); line-height: 1.55; color: var(--text-2); }

/* Prose */
.prose { font-size: var(--step-1); color: var(--text-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { color: var(--text); font-weight: 400; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.prose h2 { font-size: var(--step-3); line-height: 1.25; letter-spacing: -0.015em; margin-top: 2.4em; padding-top: 1em; border-top: 1px solid var(--line); }
.prose h3 { font-size: var(--step-2); line-height: 1.35; margin-top: 1.8em; }
.prose h4 { font-size: var(--step-1); font-weight: 700; margin-top: 1.5em; }
.prose h2 a.anchor, .prose h3 a.anchor, .prose h4 a.anchor { color: inherit; text-decoration: none; position: relative; }
.prose h2 a.anchor:hover::before, .prose h3 a.anchor:hover::before, .prose h4 a.anchor:hover::before { content: "#"; position: absolute; left: -1em; color: var(--text-3); }
.prose p, .prose li { line-height: 1.7; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-top: 0.4em; }
.prose li::marker { color: var(--text-3); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--line); }
.prose blockquote { padding-left: 1em; border-left: 2px solid var(--line-strong); color: var(--text-2); }
.prose code { font-family: var(--font-mono); font-size: max(0.86em, var(--step--1)); background: var(--surface); padding: 0.12em 0.35em; color: var(--text); }
/* A long selector or path in running text wraps rather than widening the page at 320px. */
.prose :not(pre) > code { overflow-wrap: anywhere; }
.code-block { position: relative; }
.code-block pre { background: var(--surface); border: 1px solid var(--line); padding: var(--space-4) var(--space-5); overflow-x: auto; font-size: 0.875rem; line-height: 1.6; }
.code-block pre:focus-visible, .table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.code-block pre code { background: none; padding: 0; font-size: inherit; }
.code-copy { position: absolute; top: var(--space-2); right: var(--space-2); display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; background: var(--bg); border: 1px solid var(--line-strong); color: var(--text-3); opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.code-block:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--text); }
.code-copy.copied { color: var(--success); opacity: 1; }
@media (hover: none) { .code-copy { opacity: 1; } }

.table-wrap {
  overflow-x: auto; border: 1px solid var(--line);
  /* Scroll shadows: a soft edge appears on whichever side has more to see. */
  background:
    linear-gradient(to right, var(--bg) 30%, transparent) left / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, transparent) right / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--text) 16%, transparent), transparent) left / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--text) 16%, transparent), transparent) right / 0.75rem 100% no-repeat scroll;
}
.prose table:is([data-cols="4"], [data-cols="5"], [data-cols="6"]) { min-width: 38rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.prose th, .prose td { padding: 0.625rem 0.875rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.5; }
.prose th { font: 400 var(--step--1)/1.4 var(--font-mono); color: var(--text-3); background: var(--surface); }
.prose td { color: var(--text-2); }
.prose tr:last-child td { border-bottom: 0; }
.prose td + td, .prose th + th { border-left: 1px solid var(--line); }

.callout { display: flex; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-left: 3px solid var(--callout-color, var(--line-strong)); background: var(--surface); }
.callout-info { --callout-color: var(--info); }
.callout-success { --callout-color: var(--success); }
.callout-warning { --callout-color: var(--warning); }
.callout-danger { --callout-color: var(--danger); }
.callout-icon { color: var(--callout-color); font-size: 1.1rem; padding-top: 3px; }
.callout-body { flex: 1; min-width: 0; font-size: var(--step-0); }
.callout-body > * + * { margin-top: 0.6em; }
.callout-title { font: 400 var(--step--1)/1.4 var(--font-mono); color: var(--callout-color); margin-bottom: 2px; }

/* Docs home quick links (overview page only) */
.docs-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-7); }
.docs-quick a { display: grid; gap: var(--space-1); padding: var(--space-4); background: var(--surface); color: var(--text); text-decoration: none; transition: background-color var(--dur-fast) var(--ease); }
.docs-quick a:hover { background: var(--surface-2); }
.docs-quick .meta { color: var(--text-3); }
@media (max-width: 599px) { .docs-quick { grid-template-columns: 1fr; } }

/* Pager + page footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-top: var(--space-8); }
.pager-link { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.pager-link:hover { border-color: var(--line-strong); background: var(--hover); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-label { font: 400 var(--step--1)/1.4 var(--font-mono); color: var(--text-3); }
.pager-title { font-size: var(--step-1); }
.pager-prev .pager-title::before { content: "\2190  "; color: var(--text-3); }
.pager-next .pager-title::after { content: "  \2192"; color: var(--text-3); }
.page-footer { margin-top: var(--space-7); padding-top: var(--space-5); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-6); font-size: var(--step-0); color: var(--text-3); }
.page-footer a { color: var(--text-2); }
.page-footer .meta a { color: var(--text-3); }

/* TOC */
.toc { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); padding: var(--space-7) 0 var(--space-5); }
.toc-inner { overflow-y: auto; max-height: 100%; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.toc-title { font: 400 var(--step--1)/1.4 var(--font-mono); color: var(--text-3); margin-bottom: var(--space-3); }
.toc ul { list-style: none; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 0.3rem 0 0.3rem var(--space-4); margin-left: -1px; border-left: 2px solid transparent; font-size: var(--step-0); line-height: 1.4; color: var(--text-3); text-decoration: none; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.toc li.toc-h3 a { padding-left: var(--space-6); }
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--text); border-left-color: var(--accent); }

/* Search modal */
.search-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 10vh var(--space-4) 0; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.search-panel { position: relative; width: 100%; max-width: 40rem; max-height: 70vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line-strong); box-shadow: 0 24px 64px rgb(0 0 0 / 0.18); overflow: hidden; }
.search-input-row { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); height: 3.5rem; border-bottom: 1px solid var(--line); color: var(--text-3); }
.search-input-row:focus-within { box-shadow: inset 0 -2px 0 var(--focus); }
.search-input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: var(--step-1); color: var(--text); }
.search-input::placeholder { color: var(--text-3); opacity: 1; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-esc { font: 400 var(--step--1)/1 var(--font-mono); padding: 3px 6px; border: 1px solid var(--line-strong); color: var(--text-3); }
.search-close { flex: none; min-height: 2.25rem; padding: 0 var(--space-3); border: 1px solid var(--text); color: var(--text); font-size: var(--step-0); }
.search-close:hover { background: var(--surface); }
@media (hover: none) { .search-esc { display: none; } }
.search-results { overflow-y: auto; padding: var(--space-2); }
.search-results:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.search-empty { padding: var(--space-5) var(--space-4); text-align: center; color: var(--text-3); font-size: var(--step-0); }
.search-result { display: block; padding: var(--space-3); color: var(--text); text-decoration: none; }
.search-result > span { display: block; }
.search-result:hover, .search-result.selected { background: var(--surface); }
.search-result-group { font: 400 var(--step--1)/1.4 var(--font-mono); color: var(--text-3); }
.search-result-title { font-size: var(--step-1); }
.search-result-title .sub { color: var(--text-3); }
/* Two lines: a match from the page text sits a few words in, and one
   ellipsized line hid it on phones. */
.search-result > .search-result-snippet { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: var(--step-0); color: var(--text-2); margin-top: 2px; overflow: hidden; overflow-wrap: anywhere; }
.search-result mark { background: none; color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); }

/* Studio footer below the docs: a little tighter */
.docs .site-footer { margin-top: 0; }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1199px) {
  .layout { grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
  .toc.open, html:not(.js) .toc:target { display: block; position: fixed; top: calc(var(--header-h) + var(--space-2)); right: var(--margin); z-index: 30; width: 17rem; height: auto; max-height: 60vh; padding: var(--space-4); background: var(--bg); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgb(0 0 0 / 0.16); }
  /* Without JavaScript the list can't measure its button, so it opens below
     where the button sits at the top of the page, with a Close link. */
  html:not(.js) .toc:target { top: calc(var(--header-h) + 6rem); }
  html:not(.js) .toc:target .toc-close { display: inline-flex; }
  .toc-toggle { display: inline-flex; }
}
@media (max-width: 899px) {
  .docs .site-header { position: static; }
  .docs-search-slot { display: none; }
  .docs .nav a.button--small { min-height: 0; padding: 0; border: 0; background: none; color: var(--text-2); font-size: inherit; }
  .label-wide { display: none; }
  .label-narrow { display: inline; }
  .docs-toolbar { display: flex; align-items: center; gap: var(--space-2); position: sticky; top: 0; z-index: 40; height: var(--docs-toolbar-h); padding-inline: var(--margin); background: var(--bg); border-bottom: 1px solid var(--line); }
  .docs-toolbar .icon-button { display: inline-flex; align-items: center; gap: var(--space-2); height: 2.5rem; padding: 0 var(--space-3); border: 1px solid var(--control); color: var(--text); font-size: var(--step-0); }
  .docs-toolbar .search-trigger { flex: 1; }
  .docs-toolbar .search-kbd { display: none; }
  html { scroll-padding-top: calc(var(--docs-toolbar-h) + 1rem); }
  .layout { display: block; }
  .sidebar {
    position: fixed; top: var(--docs-toolbar-h); left: 0; bottom: 0; z-index: 35; width: min(20rem, 85vw); height: auto;
    padding: var(--space-3) var(--space-4) var(--space-4); background: var(--bg); border-right: 1px solid var(--line);
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
  }
  body.nav-open .sidebar, html:not(.js) .sidebar:target { transform: none; visibility: visible; transition-delay: 0s; }
  /* Without JavaScript the drawer can't measure the toolbar, so it covers the
     full height, above the header and toolbar, with its Close link on top. */
  html:not(.js) .sidebar:target { top: 0; z-index: 50; }
  .sidebar-close { display: inline-flex; align-self: flex-start; align-items: center; min-height: 2.75rem; color: var(--text-2); font-size: var(--step-0); }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--docs-toolbar-h) 0 0 0; z-index: 34; background: color-mix(in srgb, var(--bg) 60%, transparent); }
  body.nav-open { overflow: hidden; }
  .content { padding: var(--space-6) 0 var(--space-7); }
  .page-header-top { flex-wrap: wrap; }
  .toc.open { top: calc(var(--docs-toolbar-h) + var(--space-2)); }
  html:not(.js) .toc:target { top: 0; right: 0; z-index: 50; max-height: 100vh; }
  .prose h2 { scroll-margin-top: calc(var(--docs-toolbar-h) + 1rem); }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; align-items: flex-start; }
  .search-modal { padding-top: 6vh; }
}

/* Tables on phones ---------------------------------------------------------- */
/* Tables of three or more columns ([data-stack]) turn each row into
   "column name / value" lines; two-column tables still fit and stay tables. */
@media (max-width: 599px) {
  .table-wrap:has(> table[data-stack]) { border-inline: 0; background: none; }
  .prose table[data-stack], .prose table[data-stack] :is(thead, tbody, tr, th, td) { display: block; }
  .prose table[data-stack]:is([data-cols="4"], [data-cols="5"], [data-cols="6"]) { min-width: 0; }
  .prose table[data-stack] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .prose table[data-stack] tr { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
  .prose table[data-stack] tr:last-child { border-bottom: 0; }
  /* Each cell is a line: the column name in a left gutter, the value in normal
     inline flow beside it (so text, code and links wrap together). */
  .prose table[data-stack] td {
    --label-w: min(34%, 7.5rem);
    position: relative; min-height: 2em; padding: var(--space-1) var(--space-3) var(--space-1) calc(var(--label-w) + 2 * var(--space-3)); border: 0;
  }
  .prose table[data-stack] td:first-child { color: var(--text); }
  /* The column name; its alternative text is empty because the cell's column
     header already names it for screen readers. */
  .prose table[data-stack] td[data-label]::before {
    content: attr(data-label); content: attr(data-label) / "";
    position: absolute; left: var(--space-3); top: var(--space-1); width: var(--label-w);
    font: 400 var(--step--1)/1.9 var(--font-mono); color: var(--text-3); overflow-wrap: anywhere;
  }
  .prose table[data-stack] td:not([data-label]) { padding-left: var(--space-3); }
  /* An empty cell prints no line, but stays in the table for screen readers so
     the cells after it keep their column headers. */
  .prose table[data-stack] td.is-empty { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
}
