/* IG Pilot docs (site/docs/): the docs shell on top of the main site's tokens.
   Loaded after assets/styles.css, which supplies the colors, fonts, radii,
   buttons, the Light / Dark / Auto switch and dark mode. This file only adds
   the docs layout (top bar, sidebar, article, "On this page"), the prose
   styles, code blocks and the AI menu. Pages are generated by
   scripts/build-docs.mjs. */

/* ── Docs-only tokens ───────────────────────────────────────────────────── */
:root {
  --top-h: 60px;
  --side-w: 268px;
  --toc-w: 220px;

  --code-bg: #f7f6f2;
  --code-head: #f0eee7;
  --code-text: #2b2a27;
  --tok-key: #2850b8;
  --tok-str: #1a6a43;
  --tok-num: #9a4c08;
  --tok-lit: #a82626;
  --tok-com: #6b685f;
  --tok-cmd: #6b3fc0;
  --tok-flag: #2f5bd0;
  --tok-tag: #2850b8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --code-bg: #20201e;
    --code-head: #2a2a27;
    --code-text: #ebe8df;
    --tok-key: #8ab0ff;
    --tok-str: #7fdcaa;
    --tok-num: #f5b25c;
    --tok-lit: #ff9c9c;
    --tok-com: #a5a298;
    --tok-cmd: #c9a7ff;
    --tok-flag: #8ab0ff;
    --tok-tag: #8ab0ff;
  }
}
:root[data-theme="dark"] {
  --code-bg: #20201e;
  --code-head: #2a2a27;
  --code-text: #ebe8df;
  --tok-key: #8ab0ff;
  --tok-str: #7fdcaa;
  --tok-num: #f5b25c;
  --tok-lit: #ff9c9c;
  --tok-com: #a5a298;
  --tok-cmd: #c9a7ff;
  --tok-flag: #8ab0ff;
  --tok-tag: #8ab0ff;
}

body.docs { background: var(--bg); }
.docs [hidden] { display: none !important; }
/* Land on a deep link (#tool) instantly; docs.js turns smooth scrolling back on
   for in-page jumps once the page has loaded. */
html:has(body.docs) { scroll-padding-top: calc(var(--top-h) + 20px); scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) {
  html.docs-ready:has(body.docs) { scroll-behavior: smooth; }
}

/* ── Logos (client marks; see docs/img/CREDITS.md) ──────────────────────── */
.logo { display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; }
.logo.logo-claude { background: url("../docs/img/claude.svg") center / contain no-repeat; }
.logo.logo-openai {
  background-color: currentColor;
  -webkit-mask: url("../docs/img/openai.svg") center / contain no-repeat;
  mask: url("../docs/img/openai.svg") center / contain no-repeat;
}
.logo.logo-grok {
  background-color: currentColor;
  -webkit-mask: url("../docs/img/grok.svg") center / contain no-repeat;
  mask: url("../docs/img/grok.svg") center / contain no-repeat;
}

/* ── Top bar ────────────────────────────────────────────────────────────── */
.docs-top {
  position: sticky; top: 0; z-index: 50;
  height: var(--top-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
.docs-top-inner {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 20px;
}
.docs-menu-btn, .docs-search-btn { display: none; }
.docs-badge {
  padding: 2px 9px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none;
}
.docs-badge:hover { color: var(--text); background: var(--surface-2); }

.docs-search { position: relative; display: flex; align-items: center; flex: 0 1 400px; margin-left: 18px; }
.docs-search > .i { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.docs-search input {
  width: 100%; height: 36px; padding: 0 36px 0 34px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14px;
  -webkit-appearance: none; appearance: none;
}
.docs-search input::placeholder { color: var(--text-3); }
.docs-search input::-webkit-search-cancel-button { display: none; }
.docs-search input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.docs-kbd {
  position: absolute; right: 8px;
  min-width: 20px; padding: 0 5px;
  border: 1px solid var(--border-strong); border-radius: 5px;
  color: var(--text-3); font: 600 11.5px/18px var(--font-mono); text-align: center;
  pointer-events: none;
}
.docs-search input:focus ~ .docs-kbd { display: none; }

.docs-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  width: max(100%, 380px); max-height: min(70vh, 520px); overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.sr-item {
  display: block; padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none;
}
.sr-item:hover, .sr-item[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.sr-path { display: block; color: var(--text-3); font-size: 12px; }
.sr-title { display: block; font-size: 14px; font-weight: 600; }
.sr-title code { font-size: 13px; }
.sr-snippet { display: block; margin-top: 2px; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.sr-item mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 2px; }
.sr-empty { padding: 12px 10px; color: var(--text-3); font-size: 14px; }

.docs-top-links { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.docs-top-link { color: var(--text-2); font-size: 14.5px; font-weight: 500; text-decoration: none; padding: 6px 8px; border-radius: var(--radius-sm); }
.docs-top-link:hover { color: var(--text); background: var(--surface-2); }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.docs-shell {
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr);
  max-width: 1480px; margin: 0 auto;
}

.docs-sidebar {
  position: sticky; top: var(--top-h); align-self: start;
  height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 24px 14px 40px 20px;
  border-right: 1px solid var(--border);
}
.nav-group + .nav-group { margin-top: 22px; }
.nav-group-title { margin: 0 0 6px 10px; color: var(--text); font-size: 13px; font-weight: 650; }
.docs-nav ul { list-style: none; }
.docs-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14.5px; text-decoration: none;
}
.docs-nav a .i { width: 16px; height: 16px; color: var(--text-3); }
.docs-nav a:hover { background: var(--surface-2); color: var(--text); }
.docs-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 600; }
.docs-nav a[aria-current="page"] .i { color: var(--accent); }
.docs-sidebar-foot { display: none; }

.docs-main {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--toc-w); gap: 56px;
  min-width: 0; padding: 40px 48px 72px;
}
.docs-article { min-width: 0; width: 100%; max-width: 800px; }

/* ── Page head and the AI menu ──────────────────────────────────────────── */
.docs-eyebrow { color: var(--accent); font-size: 13.5px; font-weight: 600; }
.docs-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 20px; margin-top: 6px; }
.docs-title-row h1 { font-size: clamp(30px, 3.4vw, 38px); line-height: 1.12; min-width: 0; overflow-wrap: anywhere; }
.docs-lede { margin-top: 12px; color: var(--text-2); font-size: 17.5px; line-height: 1.6; }

.ai-menu { position: relative; display: inline-flex; flex: 0 0 auto; margin-top: 4px; }
.ai-main, .ai-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 550; line-height: 1;
}
.ai-main { padding: 0 12px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.ai-toggle { justify-content: center; width: 34px; padding: 0; border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.ai-main .i, .ai-toggle .i { width: 16px; height: 16px; }
.ai-main:hover, .ai-toggle:hover, .ai-toggle[aria-expanded="true"] { background: var(--surface-2); }
.ai-toggle[aria-expanded="true"] .i { transform: rotate(180deg); }
.ai-list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  width: 300px; max-width: calc(100vw - 32px);
  padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.ai-list [role="menuitem"] {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; padding: 8px 10px;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text);
  font: inherit; text-align: left; text-decoration: none;
}
.ai-list [role="menuitem"]:hover, .ai-list [role="menuitem"]:focus-visible { background: var(--surface-2); outline: none; }
.ai-list [role="menuitem"] > .i, .ai-list [role="menuitem"] > .logo { width: 18px; height: 18px; margin-top: 2px; color: var(--text-2); }
.ai-list b { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.ai-list small { display: block; color: var(--text-3); font-size: 12.5px; line-height: 1.4; }
.ai-list small code { font-size: 12px; }

/* ── Prose ──────────────────────────────────────────────────────────────── */
.prose { margin-top: 28px; color: var(--text-2); font-size: 16px; line-height: 1.7; }
.prose > * + * { margin-top: 16px; }
.prose h2, .prose h3, .prose h4 { position: relative; color: var(--text); font-family: var(--font); }
.prose h2 { margin-top: 52px; font-size: 24px; font-weight: 650; line-height: 1.3; letter-spacing: -0.012em; }
.prose h3 { margin-top: 36px; font-size: 18px; font-weight: 650; line-height: 1.35; }
.prose h4 { margin-top: 28px; font-size: 16px; font-weight: 650; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 8px; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 10px; }
.h-anchor { margin-left: 8px; color: var(--text-3); font-weight: 400; text-decoration: none; opacity: 0; transition: opacity 0.15s ease; }
.prose :is(h2, h3, h4):hover .h-anchor, .h-anchor:focus-visible { opacity: 1; }
.prose h3:has(> code:first-child) { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--border); }
.prose h3 > code:first-child { padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); font-size: 0.92em; }

.prose strong { color: var(--text); }
.prose a { font-weight: 500; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li > ul, .prose li > ol, .prose li > p + * { margin-top: 6px; }
.prose li::marker { color: var(--text-3); }
.prose ol > li::marker { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.prose img { border-radius: var(--radius); }
.prose blockquote { padding-left: 16px; border-left: 3px solid var(--border-strong); }

.prose :not(pre) > code, .docs-lede code, .callout code, .card-link code {
  padding: 1px 5px;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--surface-2); color: var(--text);
  font-size: 0.86em; overflow-wrap: anywhere;
}
.prose h3 > code:first-child, .prose a > code { overflow-wrap: normal; }

/* Tables scroll inside their own box, never the page. */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.prose th { padding: 9px 12px; background: var(--surface-2); color: var(--text); font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.prose td { padding: 9px 12px; vertical-align: top; color: var(--text-2); border-top: 1px solid var(--border); }
.prose tbody tr:first-child td { border-top: 0; }
.prose td:first-child code { white-space: nowrap; overflow-wrap: normal; }
.prose table.numbers th { white-space: normal; }
/* In a table, code breaks only at its own slashes and dots, never letter by
   letter; a table that ends up wider than the screen scrolls in .table-wrap. */
.prose td code { font-size: 0.88em; overflow-wrap: normal; }

/* ── Code blocks ────────────────────────────────────────────────────────── */
.code-block { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 38px; padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--border); background: var(--code-head);
  color: var(--text-3); font-size: 12.5px; font-weight: 600;
}
.code-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-copy {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  height: 28px; padding: 0 9px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--text-3); font-size: 12.5px; font-weight: 550;
}
.code-copy .i { width: 15px; height: 15px; }
.code-copy:hover { background: var(--surface-3); color: var(--text); }
.code-copy.copied { color: var(--ok-text); }
.code-block pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  color: var(--code-text); font: 13.5px/1.65 var(--font-mono);
  tab-size: 2;
}
.code-block pre:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.code-block code { font-size: inherit; }
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-lit { color: var(--tok-lit); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-cmd { color: var(--tok-cmd); font-weight: 600; }
.tok-flag { color: var(--tok-flag); }
.tok-tag { color: var(--tok-tag); }

/* ── Callouts ───────────────────────────────────────────────────────────── */
.callout {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--accent-border); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text);
}
.callout > .i { width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.callout > div { min-width: 0; flex: 1; }
.callout > div > * + * { margin-top: 10px; }
.callout p { color: var(--text); }
.callout-title { font-size: 14px; font-weight: 650; }
.callout-title + * { margin-top: 2px !important; }
.callout .code-block { background: var(--surface); }
.callout-tip { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.callout-tip > .i { color: var(--ok); }
.callout-important { background: var(--live-soft); border-color: var(--live-border); }
.callout-important > .i { color: var(--live); }
.callout-warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn-text) 35%, transparent); }
.callout-warning > .i { color: var(--warn-text); }
.callout-caution { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.callout-caution > .i { color: var(--danger); }

/* ── Badges (tool labels) ───────────────────────────────────────────────── */
.prose .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.75; }
.badge-ro { background: var(--ok-soft); color: var(--ok-text); }
.badge-write { background: var(--live-soft); color: var(--live-text); }
.badge-long { background: var(--accent-soft); color: var(--accent-soft-text); }
.badge-offline, .badge-plain { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.card-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.25s var(--ease-out);
}
.card-link:hover { border-color: var(--accent-border); box-shadow: var(--shadow); color: var(--text); transform: translateY(-1px); }
.card-link > .i, .card-link > .logo { width: 20px; height: 20px; color: var(--accent); }
.card-link > .logo.logo-openai, .card-link > .logo.logo-grok { color: var(--text); }
.card-link strong { font-size: 15px; font-weight: 650; }
.card-link > span:not(.logo) { color: var(--text-3); font-size: 14px; line-height: 1.5; }

/* Client headings on Connect get their mark. */
.prose h2.logo-claude::before, .prose h2.logo-openai::before, .prose h2.logo-grok::before {
  content: ""; display: inline-block; width: 22px; height: 22px; margin-right: 10px; vertical-align: -3px;
}
.prose h2.logo-claude::before { background: url("../docs/img/claude.svg") center / contain no-repeat; }
.prose h2.logo-openai::before {
  background-color: currentColor;
  -webkit-mask: url("../docs/img/openai.svg") center / contain no-repeat;
  mask: url("../docs/img/openai.svg") center / contain no-repeat;
}
.prose h2.logo-grok::before {
  background-color: currentColor;
  -webkit-mask: url("../docs/img/grok.svg") center / contain no-repeat;
  mask: url("../docs/img/grok.svg") center / contain no-repeat;
}

/* ── Flow diagram (Overview) ────────────────────────────────────────────── */
.flow { display: flex; flex-direction: column; max-width: 560px; margin-left: 0; margin-right: 0; }
.flow-node {
  display: flex; flex-direction: column; gap: 1px;
  padding: 11px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.flow-node strong { color: var(--text); font-size: 15px; font-weight: 650; }
.flow-node span { color: var(--text-3); font-size: 13.5px; line-height: 1.45; }
.flow-node:first-child { border-color: var(--accent-border); background: var(--accent-soft); }
.flow-node:last-child { border-style: dashed; box-shadow: none; }
.flow-edge {
  position: relative; display: flex; align-items: center;
  min-height: 40px; padding: 6px 0 10px 40px;
  color: var(--text-3); font-size: 12.5px; line-height: 1.4;
}
.flow-edge code { font-size: 12px; }
.flow-edge::before { content: ""; position: absolute; left: 23px; top: 0; bottom: 7px; width: 2px; background: var(--border-strong); }
.flow-edge::after {
  content: ""; position: absolute; left: 19px; bottom: 1px;
  border: 5px solid transparent; border-top: 6px solid var(--border-strong); border-bottom: 0;
}

/* ── On this page ───────────────────────────────────────────────────────── */
.docs-toc {
  position: sticky; top: calc(var(--top-h) + 32px); align-self: start;
  max-height: calc(100vh - var(--top-h) - 64px); overflow-y: auto; overscroll-behavior: contain;
  font-size: 13.5px;
}
.toc-title { margin-bottom: 10px; color: var(--text); font-size: 13px; font-weight: 650; }
.docs-toc ul, .toc-mobile ul { list-style: none; border-left: 1px solid var(--border); }
.docs-toc a, .toc-mobile a {
  display: block; margin-left: -1px; padding: 4px 0 4px 12px;
  border-left: 2px solid transparent;
  color: var(--text-3); line-height: 1.4; text-decoration: none; overflow-wrap: anywhere;
}
.docs-toc .toc-l3 a, .toc-mobile .toc-l3 a { padding-left: 24px; font-size: 13px; }
.docs-toc a:hover, .toc-mobile a:hover { color: var(--text); }
.docs-toc a.active { border-left-color: var(--accent); color: var(--accent); font-weight: 550; }
.docs-toc code, .toc-mobile code { font-size: 12px; }

.toc-mobile { display: none; margin-top: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.toc-mobile summary { padding: 10px 14px; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.toc-mobile ul { max-height: 50vh; overflow-y: auto; margin: 0 14px 12px; font-size: 14px; }

/* ── Pager and footer ───────────────────────────────────────────────────── */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px; }
.docs-pager a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none;
}
.docs-pager a:hover { border-color: var(--accent-border); background: var(--surface); }
.docs-pager small { color: var(--text-3); font-size: 12.5px; }
.docs-pager span { font-weight: 600; }
.docs-pager .pager-prev span::before { content: "\2190\00a0"; }
.docs-pager .pager-next { grid-column: 2; text-align: right; }
.docs-pager .pager-next span::after { content: "\00a0\2192"; }

.docs-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; line-height: 1.55; }
.docs-foot p + p { margin-top: 8px; }
.docs-foot code { font-size: 12px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .docs-main { grid-template-columns: minmax(0, 1fr); padding: 36px 40px 64px; }
  .docs-toc { display: none; }
  .toc-mobile { display: block; }
}

@media (max-width: 960px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-menu-btn { display: inline-grid; margin-left: -6px; }
  .docs-sidebar {
    position: fixed; top: var(--top-h); bottom: 0; left: 0; z-index: 45;
    width: min(300px, 86vw); height: auto;
    border-right: 1px solid var(--border);
    background: var(--bg);
    transform: translateX(-100%); visibility: hidden;
    transition: transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
  }
  .nav-open .docs-sidebar { transform: none; visibility: visible; transition: transform 0.25s var(--ease-out); box-shadow: var(--shadow-lg); }
  .docs-scrim { position: fixed; inset: var(--top-h) 0 0 0; z-index: 44; background: var(--backdrop); }
  .docs-sidebar-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 24px; padding: 18px 10px 0; border-top: 1px solid var(--border); }
  .docs-sidebar-foot > a:not(.btn) { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14.5px; text-decoration: none; }
  .docs-sidebar-foot > a:not(.btn) .i { width: 16px; height: 16px; color: var(--text-3); }
  .docs-sidebar-foot .btn { margin-top: 4px; }
  .docs-search { margin-left: auto; }
  .docs-top-links { margin-left: 0; }
  .docs-top-link { display: none; }
}

@media (max-width: 760px) {
  .docs-top-inner { gap: 8px; padding: 0 12px; }
  .docs-top-links { display: none; }
  .docs-search { display: none; }
  .docs-search-btn { display: inline-grid; margin-left: auto; }
  .docs-top.search-open .docs-search {
    display: flex; position: absolute; left: 12px; right: 56px; top: 12px; margin: 0;
  }
  .docs-top.search-open .docs-search-results { width: calc(100vw - 24px); }
  .docs-kbd { display: none; }
  .docs-main { padding: 24px 16px 56px; }
  .docs-title-row { flex-direction: column; gap: 14px; }
  .docs-title-row h1 { font-size: 30px; }
  .ai-list { left: 0; right: auto; }
  .docs-lede { font-size: 16.5px; }
  .prose h2 { font-size: 21px; margin-top: 44px; }
  .code-block pre { font-size: 12.5px; padding: 12px 14px; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager .pager-next { grid-column: 1; }
}

/* Phones: tables become one block per row, labelled from the header
   (data-label, written by build-docs); two-column tables skip the label.
   Parameter tables put name, type and "Required" on one line and the
   description under it. Number grids (.numbers) keep scrolling sideways. */
@media (max-width: 760px) {
  .table-wrap:has(> table.stack) { overflow-x: visible; }
  .prose table.stack, .prose table.stack tbody, .prose table.stack tr, .prose table.stack td { display: block; }
  .prose table.stack thead { display: none; }
  .prose table.stack tr { padding: 12px 14px; border-top: 1px solid var(--border); }
  .prose table.stack tbody tr:first-child { border-top: 0; }
  .prose table.stack td { min-width: 0; padding: 0; border: 0; }
  .prose table.stack td + td { margin-top: 4px; }
  .prose table.stack td:first-child { color: var(--text); font-weight: 600; }
  .prose table.stack td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--text-3); font-weight: 600; }
  .prose table.stack td:empty { display: none; }
  .prose table.stack td code, .prose table.stack td:first-child code { white-space: normal; overflow-wrap: anywhere; }

  .prose table.pairs td:not(:first-child)::before { content: none; }

  .prose table.params tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .prose table.params td + td { margin-top: 0; }
  .prose table.params td:nth-child(2) { color: var(--text-3); font-size: 13px; }
  .prose table.params td:nth-child(2)::before, .prose table.params td:nth-child(3)::before { content: none; }
  .prose table.params td.req-no { display: none; }
  .prose table.params td.req-yes { font-size: 0; }
  .prose table.params td.req-yes::after { content: "Required"; color: var(--live-text); font-size: 12px; font-weight: 600; }
  .prose table.params td:nth-child(4) { flex-basis: 100%; }
  .prose table.params td:nth-child(4)::before { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar, .card-link, .h-anchor { transition: none !important; }
}
