/* Generated from packages/ui/tokens.json by apps/docs/lib/tokens.mjs. Do not edit. */
:root { color-scheme: light; --tq-accent: #0d0d0d; --tq-on-accent: #ffffff; --tq-accent-soft: #ececec; --tq-accent-text: #0d0d0d; --tq-link: #0d0d0d; --tq-focus-ring: #0d0d0d; --tq-wash: #fcfcfc; --tq-surface: #ffffff; --tq-card: #fcfcfc; --tq-surface-flat: #f9f9f9; --tq-surface-popover: rgba(255, 255, 255, 0.9); --tq-fill-secondary: #f3f3f3; --tq-fill-soft: #f3f3f3; --tq-fill-selected: #ececec; --tq-fill-disabled: #f0f0f0; --tq-hover-overlay: #0000000d; --tq-press-overlay: #0000001a; --tq-fill-action: #0000000d; --tq-fill-action-hover: #00000017; --tq-fill-action-press: #00000021; --tq-scrim: #00000040; --tq-scrim-dark: #00000066; --tq-tooltip-bg: #0d0d0d; --tq-tooltip-text: #ffffff; --tq-input-bg: #ffffff; --tq-input-bg-disabled: #f3f3f3; --tq-toast-bg: #ffffff; --tq-toast-text: #0d0d0d; --tq-text-primary: #0d0d0d; --tq-text-secondary: #5d5d5d; --tq-text-tertiary: #8f8f8f; --tq-text-disabled: #ababab; --tq-text-on-disabled: #ababab; --tq-text-on-media: #ffffff; --tq-icon-primary: #0d0d0d; --tq-icon-secondary: #5d5d5d; --tq-chevron: #8f8f8f; --tq-divider: #0000001a; --tq-divider-soft: #00000014; --tq-stroke-hairline: #0000001a; --tq-border-input: #0000002e; --tq-border-input-hover: #0000004d; --tq-scroll-thumb: #c4c4c4; --tq-switch-off: #8f8f8f; --tq-positive: #24832c; --tq-positive-bg: #deefe1; --tq-positive-text: #1a441b; --tq-negative: #dd2334; --tq-negative-bg: #ffe3de; --tq-negative-text: #76161b; --tq-warning: #af8f00; --tq-warning-bg: #fff6a1; --tq-warning-text: #483b0c; --tq-info-bg: #f3f3f3; --tq-info-text: #0d0d0d; --tq-link-accent: #3468ab; --tq-chart-1: #2b2b2b; --tq-chart-2: #c2571a; --tq-chart-3: #2c5a3c; --tq-chart-4: #6a2a9c; --tq-chart-5: #9a6a08; --tq-chart-6: #a3324f; --tq-chart-7: #5d5d5d; --tq-notification-badge: #dd2334; --tq-on-notification-badge: #ffffff; --tq-fill-secondary-hover: #e7e7e7; --tq-fill-secondary-press: #dbdbdb; --tq-accent-hover: color-mix(in srgb, var(--tq-accent) 86%, var(--tq-on-accent)); --tq-accent-press: color-mix(in srgb, var(--tq-accent) 76%, var(--tq-on-accent)); --tq-space-2: 2px; --tq-space-4: 4px; --tq-space-6: 6px; --tq-space-8: 8px; --tq-space-10: 10px; --tq-space-12: 12px; --tq-space-16: 16px; --tq-space-20: 20px; --tq-space-24: 24px; --tq-radius-xs: 4px; --tq-radius-sm: 6px; --tq-radius-md: 8px; --tq-radius-lg: 12px; --tq-radius-xl: 16px; --tq-radius-2xl: 20px; --tq-radius-3xl: 24px; --tq-radius-full: 999px; --tq-size-topbar: 56px; --tq-size-tab: 60px; --tq-size-nav: 360px; --tq-size-rail: 56px; --tq-size-control-sm: 32px; --tq-size-control-md: 36px; --tq-size-control-lg: 40px; --tq-size-control-xl: 48px; --tq-size-control-toolbar: var(--tq-size-control-md); --tq-size-row: 44px; --tq-size-row-lg: 52px; --tq-size-icon-sm: 16px; --tq-size-icon: 20px; --tq-size-icon-lg: 24px; --tq-size-tile: 36px; --tq-size-avatar: 40px; --tq-size-checkbox: 16px; --tq-size-radio: 20px; --tq-size-switch-w: 52px; --tq-size-switch-h: 28px; --tq-size-knob: 24px; --tq-size-underline: 2px; --tq-size-dialog-sm: 548px; --tq-size-dialog-md: 700px; --tq-size-sheet: 604px; --tq-size-menu: 360px; --tq-size-tooltip-max: 334px; --tq-size-toast-min: 288px; --tq-duration-xxs: 100ms; --tq-duration-xs-in: 200ms; --tq-duration-xs-out: 150ms; --tq-duration-sm-in: 280ms; --tq-duration-sm-out: 200ms; --tq-duration-md-in: 400ms; --tq-duration-md-out: 350ms; --tq-duration-glimmer: 1s; --tq-ease-enter: cubic-bezier(0.14, 1, 0.34, 1); --tq-ease-exit: cubic-bezier(0.45, 0.1, 0.2, 1); --tq-ease-move: cubic-bezier(0.17, 0.17, 0, 1); --tq-ease-fade: cubic-bezier(0, 0, 1, 1); --tq-ease-press: cubic-bezier(0.5, 2, 1, 1); --tq-opacity-disabled: 0.4; --tq-shadow-base: 0 0 0 1px rgba(0, 0, 0, 0.1); --tq-shadow-bar: 0 0.5px 0 rgba(0, 0, 0, 0.1); --tq-shadow-emphasis: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.05); --tq-shadow-raised: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.12); --tq-shadow-tooltip: 0 4px 12px rgba(0, 0, 0, 0.12); --tq-shadow-floating: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 80px 8px rgba(0, 0, 0, 0.024); --tq-shadow-sticky-top: 0 -0.5px 0 rgba(0, 0, 0, 0.1), 0 -4px 16px rgba(0, 0, 0, 0.04); --tq-shadow-sheet-header: 0 0.5px 0 rgba(0, 0, 0, 0.1); --tq-shadow-knob: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.2); --tq-shadow-switch-track: inset 0 0 0 0.5px rgba(0, 0, 0, 0.1); --tq-shadow-dialog: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 16px 48px -8px rgba(0, 0, 0, 0.16); --tq-shadow-focus: 0 0 0 2px #ffffff, 0 0 0 4px #0d0d0d; --tq-gradient-topbar-edge: linear-gradient(rgba(0, 0, 0, 0.08) 0 1px, transparent 1px); --tq-font-sans: ui-sans-serif, -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; --tq-font-mono: ui-monospace, Menlo, Consolas, Monaco, monospace; }
:root[data-theme='dark'] { color-scheme: dark; --tq-accent: #ededed; --tq-on-accent: #0d0d0d; --tq-accent-soft: #2b2b2b; --tq-accent-text: #ededed; --tq-link: #ededed; --tq-focus-ring: #ededed; --tq-wash: #000000; --tq-surface: #1b1b1b; --tq-card: #000000; --tq-surface-flat: #232323; --tq-surface-popover: rgba(35, 35, 35, 0.9); --tq-fill-secondary: #ffffff1a; --tq-fill-soft: #ffffff1a; --tq-fill-selected: #2b2b2b; --tq-fill-disabled: #ffffff12; --tq-hover-overlay: #ffffff1a; --tq-press-overlay: #ffffff26; --tq-fill-action: #ffffff1a; --tq-fill-action-hover: #ffffff26; --tq-fill-action-press: #ffffff33; --tq-scrim: #00000099; --tq-scrim-dark: #00000099; --tq-tooltip-bg: #303030; --tq-tooltip-text: #ededed; --tq-input-bg: #1b1b1b; --tq-input-bg-disabled: #121212; --tq-toast-bg: #1b1b1b; --tq-toast-text: #ededed; --tq-text-primary: #ededed; --tq-text-secondary: #b4b4b4; --tq-text-disabled: #6b6b6b; --tq-text-on-disabled: #ffffff4d; --tq-icon-primary: #ededed; --tq-icon-secondary: #b4b4b4; --tq-divider: #ffffff26; --tq-divider-soft: #ffffff1a; --tq-stroke-hairline: #ffffff1f; --tq-border-input: #ffffff33; --tq-border-input-hover: #ffffff66; --tq-scroll-thumb: #ffffff4d; --tq-switch-off: #6b6b6b; --tq-positive: #3fbb46; --tq-positive-bg: #1f3520; --tq-positive-text: #e3fae0; --tq-negative: #ff7c74; --tq-negative-bg: #b9182833; --tq-negative-text: #fff1ef; --tq-warning-bg: #483b0c; --tq-warning-text: #fff6a1; --tq-info-bg: #ffffff14; --tq-info-text: #ededed; --tq-link-accent: #8fb3e6; --tq-chart-1: #e6e6e6; --tq-chart-2: #ee8a4a; --tq-chart-3: #7fb88e; --tq-chart-4: #b98ae0; --tq-chart-5: #e0b04a; --tq-chart-6: #e57a93; --tq-chart-7: #a3a3a3; --tq-fill-secondary-hover: #ffffff26; --tq-fill-secondary-press: #ffffff33; --tq-shadow-base: 0 0 0 1px rgba(255, 255, 255, 0.12); --tq-shadow-bar: 0 1px 0 rgba(255, 255, 255, 0.1); --tq-shadow-emphasis: 0 0 0 1px rgba(255, 255, 255, 0.12); --tq-shadow-raised: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 8px 16px -4px rgba(0, 0, 0, 0.5); --tq-shadow-tooltip: 0 0 0 1px rgba(255, 255, 255, 0.1); --tq-shadow-floating: inset 0 0 0 1px rgba(255, 255, 255, 0.2); --tq-shadow-sticky-top: 0 -1px 0 rgba(255, 255, 255, 0.12); --tq-shadow-sheet-header: 0 1px 0 rgba(255, 255, 255, 0.12); --tq-shadow-dialog: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 16px 48px rgba(0, 0, 0, 0.6); --tq-shadow-focus: 0 0 0 2px #000000, 0 0 0 4px #ededed; --tq-gradient-topbar-edge: linear-gradient(rgba(255, 255, 255, 0.1) 0 1px, transparent 1px); }
.type-display { font-size: 32px; line-height: 38px; font-weight: 400; }
.type-title-1 { font-size: 24px; line-height: 28px; font-weight: 400; }
.type-title-2 { font-size: 18px; line-height: 24px; font-weight: 500; }
.type-headline { font-size: 17px; line-height: 20px; font-weight: 500; }
.type-nav { font-size: 17px; line-height: 20px; font-weight: 500; }
.type-body-lg { font-size: 17px; line-height: 20px; font-weight: 400; }
.type-body-strong { font-size: 14px; line-height: 20px; font-weight: 500; }
.type-body-medium { font-size: 14px; line-height: 20px; font-weight: 500; }
.type-body { font-size: 14px; line-height: 20px; font-weight: 400; }
.type-base { font-size: 14px; line-height: 1.34; font-weight: 400; }
.type-meta-strong { font-size: 12px; line-height: 16px; font-weight: 500; }
.type-meta { font-size: 12px; line-height: 16px; font-weight: 400; }
.type-caption { font-size: 12px; line-height: 16px; font-weight: 400; }
.type-input { font-size: 16px; line-height: 20px; font-weight: 400; }
.type-code { font-size: 13px; line-height: 20px; font-weight: 400; }

/*
 * Tanqory docs layout. Every colour, radius, shadow and type size is a @tanqory/ui token (--tq-*, generated above this
 * file from packages/ui/tokens.json). Neutral system: links are the `link` token (Tanqory black / near white) with an
 * underline; no blue (docs/developer-docs/PLAN.md §4).
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  margin: 0; background: var(--tq-surface); color: var(--tq-text-primary);
  font: 400 15px/1.6 var(--tq-font-sans); -webkit-font-smoothing: antialiased;
}
:root[data-theme='dark'] body { background: var(--tq-wash); }
a { color: var(--tq-link); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--tq-focus-ring); outline-offset: 2px; border-radius: var(--tq-radius-xs); }
img { max-width: 100%; }
code, kbd, pre { font-family: var(--tq-font-mono); font-size: 0.88em; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--tq-accent); color: var(--tq-on-accent); padding: 8px 12px; border-radius: var(--tq-radius-sm); }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- top bar and section tabs */
.top { position: sticky; top: 0; z-index: 20; background: var(--tq-surface); box-shadow: var(--tq-shadow-bar); }
:root[data-theme='dark'] .top { background: var(--tq-wash); }
.bar { display: flex; align-items: center; gap: 12px; height: var(--tq-size-topbar); padding: 0 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--tq-text-primary); white-space: nowrap; }
.brand img { border-radius: var(--tq-radius-sm); }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand-docs { font-size: 17px; color: var(--tq-text-secondary); }
.search-open {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 24px; width: min(340px, 34vw); height: var(--tq-size-control-md);
  padding: 0 8px 0 12px; border: 0; border-radius: var(--tq-radius-full); background: var(--tq-fill-secondary);
  color: var(--tq-text-secondary); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.search-open:hover { background: var(--tq-fill-secondary-hover); }
.search-open span { flex: 1; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--tq-radius-xs); background: var(--tq-surface); box-shadow: var(--tq-shadow-base); color: var(--tq-text-secondary); font-size: 12px; }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.version { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--tq-radius-full); box-shadow: var(--tq-shadow-base); color: var(--tq-text-primary); text-decoration: none; font-size: 13px; font-family: var(--tq-font-mono); white-space: nowrap; }
.version-label { font-family: var(--tq-font-sans); color: var(--tq-text-secondary); }
.version:hover, .lang:hover { background: var(--tq-hover-overlay); }
.lang { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: var(--tq-radius-full); color: var(--tq-text-primary); text-decoration: none; font-size: 14px; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--tq-radius-full); background: transparent; color: var(--tq-icon-primary); cursor: pointer; }
.icon-button:hover { background: var(--tq-hover-overlay); }
.icon-button:active { background: var(--tq-press-overlay); }
.theme .i-sun { display: none; }
:root[data-theme='dark'] .theme .i-sun { display: block; }
:root[data-theme='dark'] .theme .i-moon { display: none; }
.menu { display: none; }
.button-primary { display: inline-flex; align-items: center; height: var(--tq-size-control-md); padding: 0 16px; border-radius: var(--tq-radius-full); background: var(--tq-accent); color: var(--tq-on-accent); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.button-primary:hover { background: var(--tq-accent-hover); }
.button-primary:active { background: var(--tq-accent-press); }
.tabs { display: flex; gap: 4px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 10px; color: var(--tq-text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--tq-text-primary); }
.tabs a[aria-current] { color: var(--tq-text-primary); }
.tabs a[aria-current]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: var(--tq-size-underline); border-radius: 2px; background: var(--tq-accent); }

/* ---------------------------------------------------------------- three columns */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr) 240px; max-width: 1480px; margin: 0 auto; }
.side { position: sticky; top: 100px; align-self: start; height: calc(100vh - 100px); overflow-y: auto; padding: 20px 12px 40px 16px; border-right: 1px solid var(--tq-divider-soft); scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--tq-divider-soft); }
.nav-title { margin: 0 0 6px; padding: 0 10px; color: var(--tq-text-tertiary); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 10px; border-radius: var(--tq-radius-sm); color: var(--tq-text-secondary); text-decoration: none; font-size: 14px; line-height: 1.35; }
.side a:hover { background: var(--tq-hover-overlay); color: var(--tq-text-primary); }
.side a[aria-current='page'] { background: var(--tq-fill-selected); color: var(--tq-text-primary); font-weight: 500; }
.side .count { margin-left: auto; color: var(--tq-text-tertiary); font-size: 12px; font-variant-numeric: tabular-nums; }
.nav-sub { margin: 2px 0 6px 12px !important; padding-left: 8px !important; border-left: 1px solid var(--tq-divider); }
.nav-sub a { min-height: 28px; font-size: 13px; }
.main { min-width: 0; padding: 28px 48px 64px; }
.main:focus { outline: none; }
.rail { position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding: 32px 16px 32px 8px; }
.rail-title { margin: 0 0 10px; color: var(--tq-text-tertiary); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.rail ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--tq-divider); }
.rail li.l3 a { padding-left: 24px; }
.rail a { display: block; margin-left: -1px; padding: 4px 12px; border-left: 2px solid transparent; color: var(--tq-text-secondary); text-decoration: none; font-size: 13px; line-height: 1.4; }
.rail a:hover { color: var(--tq-text-primary); }
.rail a[aria-current] { border-left-color: var(--tq-accent); color: var(--tq-text-primary); font-weight: 500; }

/* ---------------------------------------------------------------- the page */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; color: var(--tq-text-secondary); font-size: 13px; }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--tq-text-tertiary); }
.crumbs a { color: var(--tq-text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--tq-text-primary); text-decoration: underline; }
.doc { max-width: 780px; }
.doc h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.doc h1 code { font-size: 0.82em; padding: 0; background: none; }
.doc .lead { margin: 0 0 28px; color: var(--tq-text-secondary); font-size: 19px; line-height: 1.5; }
.doc h2 { margin: 44px 0 12px; padding-top: 4px; font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.doc h3 { margin: 30px 0 8px; font-size: 18px; line-height: 1.35; font-weight: 600; }
.doc h4 { margin: 24px 0 6px; font-size: 15px; font-weight: 600; }
.doc p, .doc ul, .doc ol, .doc dl { margin: 0 0 16px; }
.doc ul, .doc ol { padding-left: 24px; }
.doc li { margin: 4px 0; }
.doc li > p { margin: 0 0 8px; }
.doc ol > li::marker { color: var(--tq-text-secondary); font-variant-numeric: tabular-nums; }
.doc strong { font-weight: 600; }
.doc hr { border: 0; border-top: 1px solid var(--tq-divider); margin: 32px 0; }
.doc :not(pre) > code { padding: 0.1em 0.35em; border-radius: var(--tq-radius-xs); background: var(--tq-fill-soft); overflow-wrap: anywhere; }
.doc a code { text-decoration: underline; }
.doc blockquote { margin: 0 0 16px; padding: 4px 16px; border-left: 3px solid var(--tq-divider); color: var(--tq-text-secondary); }

/* code blocks: div.code from the Markdoc pages and the reference; pre.code from the generated guides */
.code { margin: 0 0 18px; border-radius: var(--tq-radius-md); background: var(--tq-surface-flat); box-shadow: var(--tq-shadow-base); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--tq-divider-soft); }
.code-label { color: var(--tq-text-secondary); font-size: 12px; font-weight: 500; }
.copy { height: 28px; padding: 0 10px; border: 0; border-radius: var(--tq-radius-full); background: transparent; color: var(--tq-text-secondary); font: 500 12px/1 var(--tq-font-sans); cursor: pointer; }
.copy:hover { background: var(--tq-hover-overlay); color: var(--tq-text-primary); }
.copy.done { color: var(--tq-positive); }
.code pre, pre.code { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; tab-size: 2; }
pre.code { margin: 0 0 18px; border-radius: var(--tq-radius-md); background: var(--tq-surface-flat); box-shadow: var(--tq-shadow-base); }
.code pre:focus-visible { outline-offset: -2px; }
.codetabs { margin: 0 0 18px; border-radius: var(--tq-radius-md); box-shadow: var(--tq-shadow-base); overflow: hidden; background: var(--tq-surface-flat); }
.codetabs .code { margin: 0; box-shadow: none; border-radius: 0; }
.codetabs .code-head { position: absolute; top: 6px; right: 6px; height: auto; padding: 0; border: 0; }
.codetabs .code-label { display: none; }
.tablist { display: flex; align-items: center; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--tq-divider-soft); overflow-x: auto; }
.tablist [role='tab'] { position: relative; height: 34px; padding: 0 12px; border: 0; background: transparent; color: var(--tq-text-secondary); font: 500 13px/1 var(--tq-font-sans); cursor: pointer; border-radius: var(--tq-radius-sm) var(--tq-radius-sm) 0 0; }
.tablist [role='tab']:hover { color: var(--tq-text-primary); background: var(--tq-hover-overlay); }
.tablist [role='tab'][aria-selected='true'] { color: var(--tq-text-primary); }
.tablist [role='tab'][aria-selected='true']::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 0; height: var(--tq-size-underline); background: var(--tq-accent); border-radius: 2px; }
.tabpanel { position: relative; }
.tabpanel .copy { background: var(--tq-surface-flat); }
.codetabs .tabpanel pre { padding-right: 84px; }

/* callouts */
.callout { display: flex; gap: 12px; margin: 0 0 18px; padding: 14px 16px; border-radius: var(--tq-radius-md); background: var(--tq-info-bg); color: var(--tq-info-text); }
.callout-icon { flex: none; width: 18px; height: 18px; margin-top: 3px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.callout-icon[data-icon='note'] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M10 9v4.5M10 6.5v.01' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.callout-icon[data-icon='warning'] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 3.5 17 16H3z' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M10 8.5v3.5M10 14v.01' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.callout-body { min-width: 0; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-title { margin: 0 0 4px !important; font-weight: 600; }
.callout-important { box-shadow: inset 3px 0 0 var(--tq-accent); }
.callout-warning { background: var(--tq-warning-bg); color: var(--tq-warning-text); }
.callout-caution { background: var(--tq-negative-bg); color: var(--tq-negative-text); }
.callout a { color: inherit; }
.note { padding: 12px 16px; border-radius: var(--tq-radius-md); background: var(--tq-info-bg); }

/* diagrams ({% diagram %}, lib/diagram.mjs): inline SVG coloured by the tokens, so both themes work */
.dg { position: relative; container-type: inline-size; margin: 8px 0 24px; padding: 16px 16px 12px; border-radius: var(--tq-radius-lg); background: var(--tq-surface-flat); box-shadow: var(--tq-shadow-base); }
.dg-title { margin: 0 0 12px; color: var(--tq-text-primary); font-size: 14px; font-weight: 600; }
.dg-svg { display: block; width: 100%; height: auto; font-family: var(--tq-font-sans); }
.dg-narrow { display: none; }
.dg-actor rect { fill: var(--tq-surface); stroke: var(--tq-divider); stroke-width: 1; }
.dg-actor text { fill: var(--tq-text-primary); font-weight: 600; }
.dg-you rect { fill: var(--tq-accent); stroke: var(--tq-accent); }
.dg-you text { fill: var(--tq-on-accent); }
.dg-life { stroke: var(--tq-divider); stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; }
.dg-arrow { stroke: var(--tq-text-primary); stroke-width: 1.6; }
.dg-reply { stroke: var(--tq-text-secondary); stroke-dasharray: 6 4; }
.dg-head { fill: var(--tq-text-primary); }
.dg-label { fill: var(--tq-text-primary); }
.dg-halo { paint-order: stroke; stroke: var(--tq-surface-flat); stroke-width: 5px; stroke-linejoin: round; }
.dg-fail { fill: var(--tq-negative); }
.dg-note rect, rect.dg-note { fill: var(--tq-surface); stroke: var(--tq-border-input); stroke-width: 1; }
.dg-note text { fill: var(--tq-text-primary); }
.dg-note text.dg-fail { fill: var(--tq-negative); }
.dg-badge circle { fill: var(--tq-accent); }
.dg-badge text { fill: var(--tq-on-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.dg-steps { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; }
.dg-route { font-weight: 600; }
.dg-fail-text { color: var(--tq-negative-text); }
@media (max-width: 600px) { .dg { padding: 14px 12px 10px; } }
@container (max-width: 599px) {
  .dg-wide { display: none; }
  .dg-narrow { display: block; }
  .dg-steps { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; margin: 12px 0 0; padding-left: 28px; font-size: 14px; line-height: 1.5; }
  .dg-steps li { margin: 6px 0; }
  .dg-steps li::marker { font-weight: 600; color: var(--tq-text-primary); }
  .dg-route { display: block; color: var(--tq-text-secondary); font-size: 12px; }
}

/* screenshots ({% screenshot %}, lib/screenshot.mjs): the image that matches the docs theme */
.shot { margin: 8px 0 24px; }
.shot-frame { width: fit-content; max-width: 100%; border-radius: var(--tq-radius-lg); box-shadow: var(--tq-shadow-base); overflow: hidden; background: var(--tq-surface-flat); line-height: 0; }
.shot-img { display: block; max-width: 100%; height: auto; }
.shot-themed .shot-dark { display: none; }
:root[data-theme='dark'] .shot-themed .shot-light { display: none; }
:root[data-theme='dark'] .shot-themed .shot-dark { display: block; }
.shot figcaption { margin-top: 8px; color: var(--tq-text-secondary); font-size: 13px; }

/* tables */
.scroll { margin: 0 0 18px; overflow-x: auto; border-radius: var(--tq-radius-md); box-shadow: var(--tq-shadow-base); }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th, .doc td { padding: 10px 12px; border-bottom: 1px solid var(--tq-divider-soft); text-align: left; vertical-align: top; }
.doc thead th { background: var(--tq-surface-flat); color: var(--tq-text-secondary); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; }
.doc tbody tr:last-child > * { border-bottom: 0; }
.doc tr:target { background: var(--tq-fill-selected); }
.doc td.desc p:last-child { margin-bottom: 0; }
.doc th.name { font-weight: 400; white-space: nowrap; }

/* cards (Markdoc {% cards %} and the reference's lists of areas) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; list-style: none; margin: 0 0 24px !important; padding: 0 !important; }
.cards li { margin: 0; }
.cards li > a { display: block; height: 100%; padding: 16px; border-radius: var(--tq-radius-lg); box-shadow: var(--tq-shadow-base); color: var(--tq-text-secondary); text-decoration: none; font-size: 14px; line-height: 1.5; }
.cards li > a:hover { box-shadow: var(--tq-shadow-raised); }
.card-title { display: block; margin-bottom: 4px; color: var(--tq-text-primary); font-size: 15px; font-weight: 600; }
.cards li > a + p { margin: 6px 0 0; color: var(--tq-text-secondary); font-size: 13px; }
.cards li:not(.card) { padding: 16px; border-radius: var(--tq-radius-lg); box-shadow: var(--tq-shadow-base); }
.cards li:not(.card) > a { display: inline; padding: 0; box-shadow: none; color: var(--tq-text-primary); font-weight: 600; text-decoration: underline; }

/* the generated reference */
.pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 16px !important; padding: 0 !important; }
.pills li { margin: 0; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--tq-radius-full); background: var(--tq-fill-secondary); color: var(--tq-text-secondary); font-size: 12px; font-weight: 500; vertical-align: middle; }
.b-amber, .b-planned { background: var(--tq-warning-bg); color: var(--tq-warning-text); }
.scope { padding: 10px 14px; border-radius: var(--tq-radius-md); background: var(--tq-fill-soft); }
.deprecated { padding: 10px 14px; border-radius: var(--tq-radius-md); background: var(--tq-warning-bg); color: var(--tq-warning-text); }
.refs, .items { list-style: none; padding: 0 !important; }
.refs { columns: 2 220px; column-gap: 24px; }
.refs li { break-inside: avoid; }
.items li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--tq-divider-soft); }
.items li span { color: var(--tq-text-secondary); font-size: 14px; }
.args { margin: 8px 0 0 !important; padding-left: 16px !important; font-size: 13px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; padding: 16px; border-radius: var(--tq-radius-md); box-shadow: var(--tq-shadow-base); }
.kv dt { color: var(--tq-text-secondary); font-size: 14px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* pager and footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 780px; margin-top: 48px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--tq-radius-lg); box-shadow: var(--tq-shadow-base); color: var(--tq-text-primary); text-decoration: none; font-weight: 500; }
.pager a:hover { box-shadow: var(--tq-shadow-raised); }
.pager span { color: var(--tq-text-secondary); font-size: 12px; font-weight: 400; }
.pager .next { grid-column: 2; text-align: right; }
.foot { max-width: 780px; margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--tq-divider-soft); color: var(--tq-text-tertiary); font-size: 12px; }
.notfound { padding-top: 40px; }

/* search */
.search-dialog { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: var(--tq-scrim); }
.search-dialog[hidden] { display: none; }
.search-panel { width: min(640px, 100%); max-height: 74vh; display: flex; flex-direction: column; border-radius: var(--tq-radius-xl); background: var(--tq-surface); box-shadow: var(--tq-shadow-raised); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--tq-divider-soft); color: var(--tq-icon-secondary); }
.search-field input { flex: 1; height: 56px; border: 0; background: transparent; color: var(--tq-text-primary); font: inherit; font-size: 16px; outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-close { height: 30px; padding: 0 10px; border: 0; border-radius: var(--tq-radius-full); background: var(--tq-fill-secondary); color: var(--tq-text-secondary); font: 500 12px/1 var(--tq-font-sans); cursor: pointer; }
.search-hint { margin: 0; padding: 10px 16px 0; color: var(--tq-text-tertiary); font-size: 12px; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--tq-radius-md); color: var(--tq-text-primary); text-decoration: none; }
.search-results li[aria-selected='true'] a, .search-results a:hover { background: var(--tq-fill-selected); }
.r-title { font-weight: 500; }
code.r-title { font-size: 14px; }
.r-meta { color: var(--tq-text-secondary); font-size: 12px; }
.search-results .empty { padding: 16px 12px; color: var(--tq-text-secondary); }
body.search-on { overflow: hidden; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 256px minmax(0, 1fr); }
  .rail { display: none; }
}
@media (max-width: 860px) {
  .menu { display: inline-grid; margin-left: -6px; }
  .layout { display: block; }
  .bar { gap: 6px; padding: 0 12px; }
  .search-open { width: 40px; margin-left: auto; padding: 0; justify-content: center; }
  .search-open span, .search-open kbd { display: none; }
  .tools { margin-left: 0; }
  .version, .dash { display: none; }
  .side { position: fixed; top: 100px; left: 0; bottom: 0; z-index: 30; width: min(320px, 86vw); height: auto; background: var(--tq-surface); border-right: 0; box-shadow: var(--tq-shadow-raised); transform: translateX(-105%); transition: transform var(--tq-duration-sm-out) var(--tq-ease-exit); }
  :root[data-theme='dark'] .side { background: var(--tq-surface); }
  body.nav-open .side { transform: none; transition: transform var(--tq-duration-sm-in) var(--tq-ease-enter); }
  body.nav-open::after { content: ''; position: fixed; inset: 100px 0 0; z-index: 25; background: var(--tq-scrim); }
  .main { padding: 20px 16px 48px; }
  .doc h1 { font-size: 28px; }
  .doc .lead { font-size: 17px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: auto; }
  .refs { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
