/* Precise docs: Measured & Said.
   Ink is what was measured, and the controls. Indigo is what Precise says, and the one action.
   One white sheet on one lilac-grey ground, hairlines, 4px sheets, 3px controls, no shadows. */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-style: normal; font-display: swap; src: url("fonts/bricolage.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("fonts/hanken.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 100 800; font-style: normal; font-display: swap; src: url("fonts/jetbrains.woff2") format("woff2"); }

:root {
  --ground: #f6f5fb; --sheet: #ffffff; --ink: #14121f; --ink-hover: #2b2842;
  --said: #5535c9; --said-hover: #3f27a3; --said-pale: #c9c2ee; --said-range: rgba(85, 53, 201, 0.12); --said-tint: #f2effc; --on-said: #ffffff;
  --muted: #5f5c72; --muted-deep: #3d3b4d; --rule: #d9d6e6; --hair: #e6e4ee; --hair-faint: #f0eff5; --ghost: #8f8ba6;
  --good: #0d7a56; --warn: #9a5b08; --bad: #9e2a2b; --veil: rgba(20, 18, 31, 0.36);
  --font-framing: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  --font-prose: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-figure: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sheet: 4px; --r-control: 3px; --r-chip: 2px;
  --top: 101px; --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --ground: #0e0c17; --sheet: #161324; --ink: #f4f3fa; --ink-hover: #dcd9ec;
  --said: #a38cf8; --said-hover: #bcaafb; --said-pale: #473c82; --said-range: rgba(163, 140, 248, 0.18); --said-tint: #1e1936; --on-said: #100d1c;
  --muted: #9c97b3; --muted-deep: #c5c1d8; --rule: #2a2540; --hair: #231f37; --hair-faint: #1b182d; --ghost: #736e8f;
  --good: #34d399; --warn: #fbbf24; --bad: #f87171; --veil: rgba(4, 3, 9, 0.62);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 18px); scrollbar-color: var(--rule) transparent; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.62 var(--font-prose); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--said-range); color: var(--ink); }
a { color: var(--said); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--said-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--said); outline-offset: 2px; border-radius: var(--r-chip); }
[hidden] { display: none !important; }
kbd { font: 500 11.5px/1 var(--font-figure); color: var(--muted); border: 1px solid var(--rule); border-radius: var(--r-chip); padding: 3px 5px; background: var(--sheet); }
.i { flex: none; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 60; background: var(--ink); color: var(--sheet); padding: 8px 12px; border-radius: var(--r-control); }
.skip:focus, .skip:hover { top: 8px; color: var(--sheet); }

/* Header: one line of tools, one line of workspaces. */
.top { position: sticky; top: 0; z-index: 30; background: var(--sheet); border-bottom: 1px solid var(--rule); }
.top-row { display: flex; align-items: center; gap: 16px; height: 56px; max-width: 1480px; margin: 0 auto; padding: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; flex: none; }
.brand:hover { color: var(--ink); }
.mark-said { stroke: var(--said); }
.brand-name { font: 600 19px/1 var(--font-framing); letter-spacing: -0.02em; }
.brand-label { font: 500 12px/1 var(--font-figure); color: var(--muted); border: 1px solid var(--rule); border-radius: var(--r-chip); padding: 4px 6px; }
.search-open { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; max-width: 460px; margin: 0 auto; height: 36px; padding: 0 8px 0 12px; background: var(--ground); border: 1px solid var(--rule); border-radius: var(--r-control); color: var(--muted); font-size: 14.5px; text-align: left; transition: border-color 0.15s, color 0.15s; }
.search-open:hover { border-color: var(--ghost); color: var(--ink); }
.search-open-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not([data-mac]) .mod { font-size: 0; }
html:not([data-mac]) .mod::before { content: "Ctrl "; font-size: 11.5px; }
.top-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.tool { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: transparent; border: 1px solid var(--rule); border-radius: var(--r-control); color: var(--ink); font-weight: 500; font-size: 14px; transition: border-color 0.15s, background-color 0.15s; }
.tool:hover { border-color: var(--ghost); background: var(--ground); }
.icon-only { width: 36px; padding: 0; justify-content: center; }
[data-theme="light"] [data-theme-toggle] .i:last-child, [data-theme="dark"] [data-theme-toggle] .i:first-child { display: none; }
.menu-open { display: none; }
.pills { display: flex; gap: 2px; max-width: 1480px; margin: 0 auto; padding: 0 20px 8px; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; padding: 6px 11px; border: 1px solid transparent; border-radius: var(--r-control); color: var(--muted); font-weight: 500; font-size: 14.5px; line-height: 1.35; text-decoration: none; white-space: nowrap; transition: color 0.15s, background-color 0.15s; }
.pill:hover { color: var(--ink); background: var(--ground); }
.pill[aria-current] { color: var(--said); background: var(--said-tint); border-color: var(--said-pale); }

/* Three columns: pages, the sheet, on this page. */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr) 216px; gap: 0 36px; max-width: 1480px; margin: 0 auto; padding: 0 24px; align-items: start; }
.shell.no-toc { grid-template-columns: 264px minmax(0, 1fr); }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); overflow-y: auto; padding: 26px 10px 48px 0; scrollbar-width: thin; }
.nav-group { margin-bottom: 4px; }
.nav-group summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--r-control); list-style: none; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--ghost); border-bottom: 1.5px solid var(--ghost); transform: rotate(-45deg); transition: transform 0.18s var(--ease); flex: none; margin-right: 3px; }
.nav-group[open] summary::after { transform: rotate(45deg); }
.nav-group summary:hover { background: var(--hair-faint); }
.nav-group ul { list-style: none; margin: 2px 0 12px; padding: 0 0 0 10px; border-left: 1px solid var(--rule); margin-left: 10px; }
.nav-group a { display: block; padding: 5px 10px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); font-size: 14.5px; line-height: 1.4; text-decoration: none; }
.nav-group a:hover { color: var(--ink); }
.nav-group a[aria-current] { color: var(--said); border-left-color: var(--said); font-weight: 600; }
.nav-group.persona > summary { color: var(--said); }
.main { min-width: 0; padding: 28px 0 64px; }
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sheet); padding: 46px 52px 52px; max-width: 852px; margin: 0 auto; }
.shell.wide .sheet { max-width: none; }
.toc { position: sticky; top: var(--top); max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 34px 0 48px; scrollbar-width: thin; }
.toc-title { margin: 0 0 10px; font: 600 11.5px/1.35 var(--font-figure); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; margin-left: -1px; padding: 4px 0 4px 14px; border-left: 1px solid transparent; color: var(--muted); font-size: 13.5px; line-height: 1.4; text-decoration: none; }
.toc .d3 a { padding-left: 26px; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current] { color: var(--ink); border-left-color: var(--ink); font-weight: 600; }
.toc-inline { display: none; }

/* Prose. Text holds a readable measure; tables, code and live panels use the whole sheet. */
.prose > :is(p, ul, ol, blockquote, h1, h2, h3, h4) { max-width: 43rem; }
.prose h1 { margin: 0 0 14px; font: 600 2.125rem/1.12 var(--font-framing); letter-spacing: -0.02em; text-wrap: balance; }
.prose .lede { margin: 0 0 30px; max-width: 39rem; font-size: 1.175rem; line-height: 1.5; color: var(--muted-deep); }
.prose h2 { margin: 46px 0 12px; padding-top: 26px; border-top: 1px solid var(--hair); max-width: none; font: 600 1.45rem/1.2 var(--font-framing); letter-spacing: -0.015em; text-wrap: balance; }
.prose h3 { margin: 32px 0 8px; font: 600 1.125rem/1.3 var(--font-framing); letter-spacing: -0.01em; }
.prose h4 { margin: 24px 0 6px; font: 600 1rem/1.4 var(--font-prose); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.35rem; }
.prose li { margin: 5px 0; padding-left: 2px; }
.prose li > ul, .prose li > ol { margin: 6px 0 6px; }
.prose li > p { margin: 0 0 8px; }
.prose ol > li::marker { font: 500 0.9em var(--font-figure); color: var(--muted); }
.prose ul > li::marker { color: var(--ghost); }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--hair); margin: 36px 0; }
.prose :not(pre) > code { font: 500 0.845em var(--font-figure); background: var(--hair-faint); border: 1px solid var(--hair); border-radius: var(--r-chip); padding: 1px 5px; overflow-wrap: anywhere; }
.prose a > code { color: inherit; }
.prose blockquote { margin: 0 0 18px; padding: 2px 0 2px 18px; border-left: 1px solid var(--ghost); color: var(--muted-deep); }
.anchor { margin-left: 8px; opacity: 0; text-decoration: none; font: 500 0.8em var(--font-figure); color: var(--ghost); transition: opacity 0.15s; }
.anchor::before { content: "#"; }
:is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; }
.callout { margin: 22px 0; padding: 14px 18px 2px; border: 1px solid var(--rule); border-radius: var(--r-sheet); background: var(--ground); }
.callout-label { margin: 0 0 6px !important; font: 600 11.5px/1.35 var(--font-figure); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.callout-warning .callout-label, .callout-caution .callout-label { color: var(--warn); }
.callout-tip .callout-label { color: var(--said); }

.example-availability { display: flex; flex-wrap: wrap; gap: 4px; }
.availability-badge { display: inline-block; padding: 1px 7px; white-space: nowrap; font: 600 0.8rem/1.5 var(--font-prose); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r-chip); }
.availability-live { border-color: var(--ink); }
.availability-preview { color: var(--said); border-color: var(--said-pale); background: var(--said-tint); }
.table-wrap { margin: 20px 0 24px; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-sheet); scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
th, td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hair); }
th { font-weight: 600; font-size: 13px; color: var(--muted-deep); background: var(--ground); border-bottom-color: var(--rule); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--font-figure); font-variant-numeric: tabular-nums; font-size: 13.5px; white-space: nowrap; }
.align-center { text-align: center; }
th:not(.num), td:not(.num) { min-width: 7rem; }
/* In a table a code token stays whole: it wraps at its own spaces, and never inside a name. */
.prose td code { overflow-wrap: normal; word-break: normal; }
td:first-child code { white-space: nowrap; }

/* Code. Two inks: ink for structure, indigo for what is said (strings), grey for the rest. */
pre { margin: 0; padding: 14px 16px; overflow: auto; font: 400 13px/1.62 var(--font-figure); tab-size: 2; color: var(--ink); scrollbar-width: thin; }
pre code { font: inherit; }
.tk-s, .tk-v { color: var(--said); }
.tk-c { color: var(--muted); font-style: italic; }
.tk-k { font-weight: 600; }
.tk-p, .tk-f { color: var(--muted-deep); }
.code { margin: 18px 0 22px; border: 1px solid var(--rule); border-radius: var(--r-sheet); background: var(--ground); }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 0 16px; min-height: 30px; }
.code-lang { font: 500 11.5px/1 var(--font-figure); color: var(--muted); }
.code pre { padding-top: 6px; max-height: 520px; }
.copy { flex: none; background: transparent; border: 1px solid transparent; border-radius: var(--r-control); padding: 4px 8px; font: 500 12px/1.2 var(--font-prose); color: var(--muted); transition: color 0.15s, border-color 0.15s; }
.copy:hover { color: var(--ink); border-color: var(--rule); }
.copy[data-done] { color: var(--good); }

/* Live panels. The glyph is the mark's own idea: an open indigo ring while it is only said,
   a solid ink point once the sandbox has answered. */
.try { margin: 22px 0 26px; border: 1px solid var(--rule); border-radius: var(--r-sheet); background: var(--sheet); overflow: clip; }
.try-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 8px 8px 8px 14px; background: var(--ground); border-bottom: 1px solid var(--rule); min-height: 46px; }
.try-state { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1.2 var(--font-figure); letter-spacing: 0.02em; color: var(--muted-deep); }
.glyph { width: 11px; height: 11px; border-radius: 50%; border: 1.8px solid var(--said); transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease); }
.try[data-panel="preview"] .glyph { border-style: dashed; border-color: var(--ghost); }
[data-state="busy"] .glyph { animation: ring 0.9s ease-in-out infinite alternate; }
[data-state="ok"] .glyph { background: var(--ink); border-color: var(--ink); transform: scale(0.82); }
[data-state="turned"] .glyph { border-color: var(--warn); }
[data-state="error"] .glyph { border-color: var(--bad); }
@keyframes ring { from { transform: scale(0.72); opacity: 0.55; } to { transform: scale(1.08); opacity: 1; } }
.try-what { margin-right: auto; font: 500 12.5px/1.4 var(--font-figure); color: var(--ink); overflow-wrap: anywhere; }
.run { flex: none; background: var(--said); color: var(--on-said); border: 0; border-radius: var(--r-control); padding: 8px 15px; font: 600 13.5px/1.2 var(--font-prose); transition: background-color 0.15s; }
.run:hover { background: var(--said-hover); }
.run:disabled { opacity: 0.6; cursor: progress; }
.tab-bar { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 6px; border-bottom: 1px solid var(--hair); }
[role="tablist"] { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
[role="tablist"]::-webkit-scrollbar { display: none; }
[role="tab"] { flex: none; appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 10px 8px; font: 500 13px/1.2 var(--font-prose); color: var(--muted); white-space: nowrap; }
[role="tab"]:hover { color: var(--ink); }
[role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.try [role="tabpanel"] pre { max-height: 380px; }
.edit { background: transparent; border: 1px solid var(--rule); border-radius: var(--r-control); padding: 4px 9px; font: 500 12px/1.2 var(--font-prose); color: var(--muted-deep); }
.edit:hover { border-color: var(--ghost); color: var(--ink); }
.editor { display: block; width: 100%; min-height: 96px; resize: vertical; border: 0; border-radius: 0; background: var(--sheet); padding: 14px 16px; font: 400 13px/1.62 var(--font-figure); color: var(--ink); caret-color: var(--said); tab-size: 2; }
.editor:focus-visible { outline: 2px solid var(--said); outline-offset: -2px; }
.editor[aria-invalid="true"] { outline: 2px solid var(--bad); outline-offset: -2px; }
.try-example { border-top: 1px solid var(--rule); }
.try-example-label { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 9px 16px 0; font: 600 12px/1.3 var(--font-figure); color: var(--muted-deep); }
.sample { font-weight: 500; color: var(--muted); }
.try-example pre { max-height: 340px; padding-top: 8px; }

/* An answer. */
.try-out { border-top: 1px solid var(--rule); padding: 14px 16px 16px; animation: arrive 0.32s var(--ease); }
@keyframes arrive { from { opacity: 0; transform: translateY(4px); } }
.out-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 12px; font: 500 12px/1.3 var(--font-figure); color: var(--muted); }
.out-status { padding: 3px 7px; border: 1px solid var(--rule); border-radius: var(--r-chip); color: var(--ink); font-weight: 600; }
.out-status.turned { color: var(--warn); border-color: currentColor; }
.out-status.bad { color: var(--bad); border-color: currentColor; }
.out-wait { margin: 0; color: var(--muted); font-size: 14.5px; }
.say { display: grid; grid-template-columns: 78px 1fr; gap: 0 12px; margin: 0 0 8px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.say-kind { font: 600 11.5px/1.95 var(--font-figure); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.say-said { color: var(--said); }
.say-said .say-kind { color: var(--said); }
.out-problem { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.out-problem code { font: 600 12.5px var(--font-figure); color: var(--warn); }
.out-ids { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 12px 0 0; padding: 10px 12px; background: var(--ground); border: 1px solid var(--hair); border-radius: var(--r-control); }
.out-ids dt { font: 500 12px/1.9 var(--font-figure); color: var(--muted); }
.out-ids dd { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0; font: 500 12.5px/1.75 var(--font-figure); overflow-wrap: anywhere; min-width: 0; }
.out-ids dd span { min-width: 0; }
.out-table { margin: 14px 0 0; }
.out-table th, .out-table td { white-space: nowrap; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; }
.out-table caption { caption-side: bottom; padding: 7px 14px; text-align: left; font: 500 12px var(--font-figure); color: var(--muted); border-top: 1px solid var(--hair); }
.out-raw { margin-top: 12px; border: 1px solid var(--hair); border-radius: var(--r-control); }
.out-raw summary { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 12px; cursor: pointer; font: 500 12.5px/1.4 var(--font-prose); color: var(--muted-deep); list-style: none; }
.out-raw summary::-webkit-details-marker { display: none; }
.out-raw summary::before { content: "+"; font: 500 13px var(--font-figure); margin-right: 8px; color: var(--ghost); }
.out-raw[open] summary::before { content: "−"; }
.out-raw summary span { flex: 1; }
.out-raw pre { max-height: 360px; border-top: 1px solid var(--hair); }

/* The playground. */
.playground-fallback { color: var(--muted); }
.pg { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; margin: 26px 0 34px; align-items: start; }
.pg-pane { border: 1px solid var(--rule); border-radius: var(--r-sheet); background: var(--sheet); min-width: 0; overflow: clip; }
.pg-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 14px; background: var(--ground); border-bottom: 1px solid var(--rule); font: 600 12px/1.3 var(--font-figure); letter-spacing: 0.02em; color: var(--muted-deep); }
.pg-title .try-state { font-weight: 500; color: var(--muted); }
.pg-body { padding: 14px; display: grid; gap: 14px; }
.seg { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--rule); border-radius: var(--r-control); padding: 2px; background: var(--ground); justify-self: start; }
.seg button { background: transparent; border: 0; border-radius: var(--r-chip); padding: 6px 12px; font: 500 13.5px/1.2 var(--font-prose); color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); outline: 1px solid var(--rule); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field > label { font: 600 12.5px/1.3 var(--font-prose); color: var(--muted-deep); }
.field select, .field input { width: 100%; height: 36px; padding: 0 10px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-control); font: 500 13.5px var(--font-figure); }
.field .editor { border: 1px solid var(--rule); border-radius: var(--r-control); min-height: 150px; }
.pg-desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted-deep); }
.pg-desc code { font: 500 0.86em var(--font-figure); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-control); padding: 4px 9px; font: 500 12.5px/1.3 var(--font-prose); color: var(--muted-deep); text-align: left; }
.chip:hover { border-color: var(--said-pale); color: var(--said); }
.pg-actions { display: flex; align-items: center; gap: 12px; }
.pg-hint { font: 500 12px var(--font-figure); color: var(--muted); }
.pg-more { border-top: 1px solid var(--hair); }
.pg-more > summary { padding: 9px 14px; cursor: pointer; font: 600 12.5px/1.3 var(--font-prose); color: var(--muted-deep); }
.pg-more > .pg-body { padding-top: 2px; }
.pg-code { border-top: 1px solid var(--hair); }
.pg-code [role="tabpanel"] pre { max-height: 300px; }
.pg-answer .try-out { border-top: 0; }
.pg-empty { margin: 0; padding: 26px 18px 30px; color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 34rem; }
.pg-empty strong { display: block; margin-bottom: 6px; color: var(--ink); font: 600 1.05rem/1.3 var(--font-framing); }
.pg-tables { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13.5px; }
.pg-tables code { font: 500 12.5px var(--font-figure); }
.pg-tables span { color: var(--muted); font: 400 12px/1.5 var(--font-figure); overflow-wrap: anywhere; }

/* Diagrams, drawn at build time. */
.diagram { margin: 26px 0 28px; overflow-x: auto; text-align: center; scrollbar-width: thin; }
.diagram.fit svg { max-width: 100%; height: auto; }
.diagram-source { margin: -12px 0 24px; }
.diagram-source summary { cursor: pointer; color: var(--muted); }
.seq-life { stroke: var(--ghost); stroke-dasharray: 4 4; }
.seq-note rect { fill: var(--said-tint); stroke: var(--said); }
.seq-label rect { fill: var(--sheet); }
tr[id] { scroll-margin-top: 8rem; }
tr[id]:target > td { background: var(--said-tint); }
.dg-narrow { display: none; }
.dg text { font: 500 13px var(--font-prose); fill: var(--ink); }
.dg-node rect { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.1; }
.dg-node.said rect { fill: var(--said-tint); stroke: var(--said); }
.dg-node.ghost rect { fill: none; stroke: var(--ghost); stroke-dasharray: 4 3; }
.dg-node.ghost text { fill: var(--muted); }
.dg-edge { fill: none; stroke: var(--muted-deep); stroke-width: 1.15; }
.dg-edge.dashed { stroke: var(--ghost); stroke-dasharray: 4 3; }
.dg-edge.thick { stroke-width: 2; }
.dg-arrow path { fill: var(--muted-deep); }
.dg-label rect { fill: var(--sheet); }
.dg-label text { font-size: 11.5px; fill: var(--muted); }
.dg-group rect { fill: var(--ground); stroke: var(--rule); }
.dg-group text { font: 600 11px var(--font-figure); letter-spacing: 0.05em; fill: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 14px; max-width: 852px; margin: 18px auto 0; }
.shell.wide .pager, .shell.wide .foot { max-width: none; }
.pager a { display: inline-flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 16px; border: 1px solid var(--rule); border-radius: var(--r-sheet); background: var(--sheet); color: var(--ink); font-weight: 500; font-size: 15px; text-decoration: none; transition: border-color 0.15s; }
.pager a:hover { border-color: var(--said-pale); color: var(--said); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; max-width: 852px; margin: 22px auto 0; padding: 0 2px; font-size: 13.5px; color: var(--muted); }
.foot a { color: var(--muted); }

/* Search. */
dialog.search { width: min(660px, calc(100vw - 24px)); max-height: min(76vh, 640px); margin: 11vh auto 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-sheet); background: var(--sheet); color: var(--ink); overflow: hidden; }
dialog.search[open] { display: flex; flex-direction: column; animation: arrive 0.2s var(--ease); }
dialog.search::backdrop { background: var(--veil); }
.search-box { display: flex; align-items: center; gap: 12px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--rule); color: var(--muted); }
.search-box input { flex: 1; min-width: 0; height: 54px; border: 0; background: transparent; font-size: 17px; color: var(--ink); outline: none; }
.search-box input::placeholder { color: var(--ghost); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-results { overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.search-group { margin: 8px 10px 4px; font: 600 11.5px/1.35 var(--font-figure); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hit { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 10px; border-radius: var(--r-control); color: var(--ink); text-decoration: none; }
.hit[aria-selected="true"] { background: var(--said-tint); color: var(--ink); }
.hit-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.hit[data-kind="endpoint"] .hit-title, .hit[data-kind="tool"] .hit-title { font: 500 13.5px/1.6 var(--font-figure); }
.hit-kind { align-self: start; font: 500 11px/1.9 var(--font-figure); color: var(--muted); }
.hit-sub { grid-column: 1 / -1; font-size: 13.5px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hit mark { background: var(--said-range); color: inherit; border-radius: var(--r-chip); }
.search-empty { margin: 0; padding: 22px 16px 26px; color: var(--muted); font-size: 15px; }
.search-foot { display: flex; gap: 18px; margin: 0; padding: 9px 16px; border-top: 1px solid var(--hair); font-size: 12.5px; color: var(--muted); }
.search-foot kbd { margin-right: 4px; }

/* Connect an agent. */
.connect { position: fixed; inset: 62px 24px auto auto; width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 80px); margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--r-sheet); background: var(--sheet); color: var(--ink); overflow-y: auto; }
.connect:popover-open { animation: arrive 0.2s var(--ease); }
.connect::backdrop { background: transparent; }
.connect-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--hair); }
.connect-title { margin: 0 0 4px; font: 600 1.125rem/1.3 var(--font-framing); letter-spacing: -0.01em; }
.connect-sub { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted-deep); }
.endpoint { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 5px 5px 12px; background: var(--ground); border: 1px solid var(--rule); border-radius: var(--r-control); }
.endpoint code { font: 500 12.5px/1.5 var(--font-figure); overflow-wrap: anywhere; }
.connect-note { margin: 0; padding: 12px 18px 0; font-size: 13.5px; line-height: 1.45; color: var(--muted-deep); }
.connect [role="tabpanel"] pre { padding: 10px 18px 14px; max-height: 220px; }
.connect-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 12px 18px 14px; border-top: 1px solid var(--hair); font-size: 13.5px; color: var(--muted); }
.connect-links a { font: 500 12.5px/1.6 var(--font-figure); }

@media (max-width: 1220px) {
  .shell, .shell.no-toc { grid-template-columns: 248px minmax(0, 1fr); gap: 0 28px; }
  .toc { display: none; }
  .toc-inline { display: block; margin: 0 0 26px; border: 1px solid var(--rule); border-radius: var(--r-sheet); background: var(--ground); max-width: 43rem; }
  .toc-inline summary { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
  .toc-inline summary::-webkit-details-marker { display: none; }
  .toc-inline summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--ghost); border-bottom: 1.5px solid var(--ghost); transform: rotate(-45deg); transition: transform 0.18s var(--ease); margin-right: 3px; }
  .toc-inline[open] summary::after { transform: rotate(45deg); }
  .toc-inline ul { list-style: none; margin: 0; padding: 2px 14px 12px; }
  .toc-inline li { margin: 0; }
  .toc-inline a { display: block; padding: 4px 0; color: var(--muted-deep); font-size: 14.5px; text-decoration: none; }
  .toc-inline .d3 a { padding-left: 14px; }
  .pg { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --top: 97px; }
  .top-row { height: 52px; padding: 0 14px; gap: 10px; }
  .search-open { flex: 0 0 36px; width: 36px; max-width: none; margin: 0 0 0 auto; padding: 0; justify-content: center; background: transparent; }
  .search-open-text, .search-open kbd, .connect-open span { display: none; }
  .connect-open { width: 36px; padding: 0; justify-content: center; }
  .menu-open { display: inline-flex; }
  .pills { padding: 0 10px 8px; }
  .shell, .shell.no-toc { display: block; padding: 0; }
  .side { position: fixed; inset: var(--top) 0 0 0; z-index: 25; height: auto; padding: 16px 16px 40px; background: var(--ground); visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0s 0.18s; }
  [data-nav-open] .side { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  [data-nav-open] { overflow: hidden; }
  .nav-group summary { padding: 10px; font-size: 15.5px; }
  .nav-group a { padding: 8px 10px; font-size: 15.5px; }
  .main { padding: 0 0 48px; }
  .sheet { border-left: 0; border-right: 0; border-top: 0; border-radius: 0; padding: 30px 18px 36px; }
  .prose h1 { font-size: 1.8rem; }
  .prose .lede { font-size: 1.09rem; }
  .pager, .foot { padding: 0 14px; }
  .pager { flex-direction: column; }
  .pager .next { justify-content: space-between; }
  .connect { inset: 58px 12px auto 12px; width: auto; }
  dialog.search { margin-top: 8px; max-height: calc(100dvh - 16px); }
  .has-narrow .dg:not(.dg-narrow) { display: none; }
  .has-narrow .dg-narrow { display: inline; }
  .say { grid-template-columns: 1fr; }
  .say-kind { line-height: 1.4; }
  .out-ids { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .out-ids dt { line-height: 1.5; margin-top: 6px; }
  .search-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
@media print {
  .top, .side, .toc, .pager, .run, .copy, .edit { display: none !important; }
  .shell { display: block; }
  .sheet { border: 0; padding: 0; }
}
