/* Barform docs — /docs/ and /es/docs/ (layout: src/_includes/docs.njk).
   One palette, shared with the product and site.css (CLAUDE.md rule 4):
   bg0 #15120D · bg1 #1E1A14 · bg2 #282218 · line #383024 · brass #E0A93E ·
   deep brass #A87716 · cream #F3EDDF · muted #B3A78F (+ brass-hi #F2C05C, CTA gradient only).
   Dark theme = that palette. Light theme = the same palette on paper: cream surfaces,
   bg0 as ink, and a darker brass (#875D0C) so links and labels pass WCAG AA (≥ 4.5:1)
   on paper, cream and the sunken surface. Theme: data-theme on <html> (set before paint
   by the inline head script); no attribute = follow the system. */

@font-face { font-family: "Hanken"; src: url("/fonts/hanken-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken"; src: url("/fonts/hanken-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Hanken"; src: url("/fonts/hanken-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Hanken"; src: url("/fonts/hanken-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

/* ── Tokens ───────────────────────────────────────────── */
:root {
  /* brand constants — the same in both themes (roundel, CTA buttons) */
  --brass: #E0A93E;
  --brass-deep: #A87716;
  --brass-hi: #F2C05C;
  --ink: #15120D;

  /* dark theme (default) */
  --bg: #15120D;
  --surface: #1E1A14;
  --sunken: #282218;
  --line: #383024;
  --line-strong: #4A4030;
  --text: #F3EDDF;
  --muted: #B3A78F;
  --faint: #8C8168;       /* placeholders and decoration only — 4.8:1 on --bg */
  --accent: #E0A93E;
  --accent-soft: rgba(224, 169, 62, .13);
  --accent-line: rgba(224, 169, 62, .45);
  --note: #7BA8C9;
  --tip: #E0A93E;
  --warn: #E07A5F;
  --mark: rgba(224, 169, 62, .24);
  --scroll-shadow: rgba(0, 0, 0, .55);
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --backdrop: rgba(8, 6, 3, .62);
  color-scheme: dark;

  --topbar-h: 60px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FBF8F1;
    --surface: #F3EDDF;
    --sunken: #EAE2D0;
    --line: #DED3BD;
    --line-strong: #CBBD9F;
    --text: #15120D;
    --muted: #5B5040;
    --faint: #6E6350;
    --accent: #875D0C;
    --accent-soft: rgba(168, 119, 22, .12);
    --accent-line: rgba(135, 93, 12, .4);
    --note: #2F5F86;
    --tip: #875D0C;
    --warn: #A13F28;
    --mark: rgba(224, 169, 62, .32);
    --scroll-shadow: rgba(60, 45, 20, .22);
    --shadow: 0 24px 60px rgba(60, 45, 20, .2);
    --backdrop: rgba(40, 30, 15, .35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #FBF8F1;
  --surface: #F3EDDF;
  --sunken: #EAE2D0;
  --line: #DED3BD;
  --line-strong: #CBBD9F;
  --text: #15120D;
  --muted: #5B5040;
  --faint: #6E6350;
  --accent: #875D0C;
  --accent-soft: rgba(168, 119, 22, .12);
  --accent-line: rgba(135, 93, 12, .4);
  --note: #2F5F86;
  --tip: #875D0C;
  --warn: #A13F28;
  --mark: rgba(224, 169, 62, .32);
  --scroll-shadow: rgba(60, 45, 20, .22);
  --shadow: 0 24px 60px rgba(60, 45, 20, .2);
  --backdrop: rgba(40, 30, 15, .35);
  color-scheme: light;
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* anchor targets land clear of the sticky top bar */
  scroll-padding-top: calc(var(--topbar-h) + 20px);
}
/* smooth only for in-page jumps (a link was focused): page loads and find-in-page jump straight there */
@media (prefers-reduced-motion: no-preference) { html:focus-within { scroll-behavior: smooth; } }
html.search-open, html.drawer-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hanken", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--brass); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.vh {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -200px; z-index: 100;
  background: var(--brass); color: var(--ink);
  font-weight: 700; padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: 10px; }

kbd {
  display: inline-block;
  font: 600 11.5px/1 var(--mono);
  padding: 3px 6px 2px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
}
html[data-os="apple"] .kbd-other,
html:not([data-os="apple"]) .kbd-apple { display: none; }

/* Without JS there is no search, theme switch or drawer. */
html:not(.js) .search-btn,
html:not(.js) .theme-btn,
html:not(.js) .home-search { display: none; }

/* ── Brand ────────────────────────────────────────────── */
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text); text-decoration: none; flex: none;
  border-radius: 10px;
}
.roundel {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brass); color: var(--ink);
  font-weight: 800; font-size: 16px; line-height: 1;
}
.roundel-sm { width: 26px; height: 26px; font-size: 14px; }
.wordmark { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand-docs {
  font-size: 12.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 999px; padding: 3px 9px 2px;
}

/* ── Top bar ──────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  background: var(--bg); /* Safari before 16.2 has no color-mix() */
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px;
  height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 24px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent-line); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

.theme-btn .ico { display: none; }
html[data-theme-choice="light"] .theme-btn .ico-light,
html[data-theme-choice="dark"] .theme-btn .ico-dark,
html:not([data-theme-choice="light"]):not([data-theme-choice="dark"]) .theme-btn .ico-auto { display: block; }

.search-btn {
  display: inline-flex; align-items: center; gap: 9px;
  width: 260px; height: 38px; padding: 0 7px 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
}
.search-btn:hover { color: var(--text); border-color: var(--accent-line); }
.search-btn svg { width: 17px; height: 17px; flex: none; }
.search-btn-label { flex: 1; white-space: nowrap; }
.search-btn-keys { display: inline-flex; gap: 4px; }

.lang-switch {
  display: inline-flex; flex: none; height: 38px;
  border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden;
}
.lang-switch a {
  display: grid; place-items: center; min-width: 40px; padding: 0 9px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: var(--muted); text-decoration: none;
}
.lang-switch a + a { border-left: 1px solid var(--line-strong); }
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.lang-switch a:focus-visible { outline-offset: -3px; }

.open-app {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 38px; padding: 0 13px 0 15px; border-radius: 10px;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass) 55%, var(--brass-deep) 145%);
  color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(224, 169, 62, .14);
}
.open-app:hover { filter: brightness(1.05); }
.open-app svg { width: 15px; height: 15px; }

/* ── Shell: sidebar · article · on this page ──────────── */
.docs-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 224px;
  column-gap: 48px;
  max-width: 1440px; margin: 0 auto; padding: 0 24px;
}
.docs-shell.is-home { display: block; max-width: 1120px; }

.sidenav {
  position: sticky; top: var(--topbar-h); align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  max-height: calc(100dvh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 12px 48px 0;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.drawer-head, .drawer-app { display: none; }
.sidenav-group + .sidenav-group { margin-top: 22px; }
.sidenav-title {
  margin: 0 0 6px; padding: 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li a {
  display: block; padding: 6px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none;
  font-size: 14.5px; line-height: 1.35;
}
.sidenav li a:hover { color: var(--text); background: var(--surface); }
.sidenav li a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: var(--backdrop); }

.docs-main { min-width: 0; padding: 36px 0 96px; font-size: 17px; outline: none; }
.docs-article, .pager { max-width: 70ch; }

.toc {
  position: sticky; top: var(--topbar-h); align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  max-height: calc(100dvh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 40px 0 48px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.toc-title {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.toc-list, .toc-list ul { list-style: none; margin: 0; padding: 0; }
.toc-list a {
  display: block; padding: 5px 0 5px 13px;
  border-left: 2px solid var(--line);
  color: var(--muted); text-decoration: none;
  font-size: 13.5px; line-height: 1.4;
}
.toc-list ul a { padding-left: 25px; font-size: 13px; }
.toc-list a:hover { color: var(--text); }
.toc-list a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 700; }

/* "On this page" at the top of the article, below 1200px */
.toc-inline {
  display: none;
  margin: 26px 0 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
}
.toc-inline summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 700; border-radius: 12px;
}
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; font-weight: 600; }
.toc-inline[open] summary::after { content: "–"; }
.toc-inline .toc-list { padding: 0 16px 14px; }

/* ── Article ──────────────────────────────────────────── */
.breadcrumb ol {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
  list-style: none; margin: 0 0 14px; padding: 0;
  font-size: 13.5px; color: var(--muted);
}
.breadcrumb li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--text); }

.docs-article h1 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 42px); line-height: 1.12;
  font-weight: 800; letter-spacing: -0.02em;
  text-wrap: balance;
}
.lead {
  margin: 14px 0 0;
  font-size: 19px; line-height: 1.55; color: var(--muted);
  text-wrap: pretty;
}

.docs-content { margin-top: 34px; line-height: 1.7; overflow-wrap: break-word; }
.docs-content > :first-child { margin-top: 0; }
.docs-content p,
.docs-content ul,
.docs-content ol,
.docs-content pre,
.docs-content blockquote,
.docs-content .table-wrap,
.docs-content .callout { margin: 0 0 1.15em; }

.docs-content h2,
.docs-content h3 { text-wrap: balance; } /* their offset under the top bar: scroll-padding-top on html */
.docs-content h2 {
  margin: 2.3em 0 .6em;
  font-size: 1.55em; line-height: 1.25; font-weight: 800; letter-spacing: -0.012em;
}
.docs-content h3 {
  margin: 1.9em 0 .5em;
  font-size: 1.2em; line-height: 1.3; font-weight: 700;
}
.docs-content h2 + h3 { margin-top: 1.1em; }
.docs-content h4, .docs-content h5, .docs-content h6 { margin: 1.6em 0 .4em; font-size: 1em; font-weight: 700; }

/* the "#" after each heading: on hover or keyboard focus */
.hd-anchor {
  margin-left: .4em;
  color: var(--muted); text-decoration: none; font-weight: 600;
  opacity: 0; transition: opacity .12s ease;
}
.hd-anchor::after { content: "#"; }
.docs-content :is(h2, h3):hover .hd-anchor,
.hd-anchor:focus-visible { opacity: 1; }
.hd-anchor:hover { color: var(--accent); }

.docs-content a:not(.hd-anchor) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-line);
}
.docs-content a:not(.hd-anchor):hover { text-decoration-color: currentColor; }
.docs-content strong { font-weight: 700; color: var(--text); }

.docs-content code {
  font-family: var(--mono); font-size: .86em;
  padding: .12em .38em;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--sunken);
  overflow-wrap: anywhere;
}
.docs-content pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--sunken);
  font-size: 14px; line-height: 1.55;
}
.docs-content pre code { padding: 0; border: 0; background: none; font-size: inherit; overflow-wrap: normal; }
.docs-content kbd { font-size: .74em; vertical-align: .08em; }

/* lists: brass bullets; nested lists sit close to their item */
.docs-content ul, .docs-content ol { padding-left: 1.35em; }
.docs-content ul > li::marker { color: var(--accent); }
.docs-content ol > li::marker { color: var(--muted); font-weight: 700; }
.docs-content li + li { margin-top: .35em; }
.docs-content li > p { margin: 0 0 .5em; }
.docs-content li > p:last-child { margin-bottom: 0; }
.docs-content li > ul,
.docs-content li > ol,
.docs-content li > .callout,
.docs-content li > .table-wrap { margin: .5em 0 .6em; }

/* top-level numbered lists read as steps: a brass number in a ring */
.docs-content > ol { list-style: none; padding-left: 0; counter-reset: step; }
.docs-content > ol > li {
  position: relative;
  padding-left: 2.6em;
  counter-increment: step;
}
.docs-content > ol > li + li { margin-top: .7em; }
.docs-content > ol > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .14em;
  display: grid; place-items: center;
  width: 1.75em; height: 1.75em; border-radius: 50%;
  border: 1.5px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8em; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* tables: their own sideways scroll, with edge shadows while there is more to see */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background:
    linear-gradient(to right, var(--bg) 35%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 35%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), transparent) right / 12px 100% no-repeat scroll,
    var(--bg);
}
.table-wrap:focus-visible { outline-offset: 3px; }
.docs-content table { width: 100%; border-collapse: collapse; font-size: .9em; line-height: 1.5; }
.docs-content th,
.docs-content td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.docs-content th + th,
.docs-content td + td { border-left: 1px solid var(--line); }
.docs-content thead th {
  background: var(--surface);
  font-size: .94em; font-weight: 700; color: var(--text);
}
.docs-content tbody tr:last-child td { border-bottom: 0; }

/* callouts: > [!NOTE] / [!TIP] / [!WARNING] */
.callout {
  --c: var(--note);
  padding: 14px 18px 15px;
  border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 10px;
  background: var(--surface);
  font-size: .94em; line-height: 1.62;
}
.callout-tip { --c: var(--tip); }
.callout-warning { --c: var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.callout > :last-child { margin-bottom: 0; }
.docs-content .callout-label {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 4px;
  color: var(--c);
  font-size: 12.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}
.callout-label svg { width: 16px; height: 16px; flex: none; }
.docs-content .callout ul, .docs-content .callout ol { margin-bottom: .6em; }

.docs-content blockquote:not(.callout) {
  margin-left: 0; padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}
.docs-content hr { margin: 2.6em 0; border: 0; border-top: 1px solid var(--line); }
.docs-content img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }

/* ── Previous / next ──────────────────────────────────── */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 56px; padding-top: 28px;
  border-top: 1px solid var(--line);
}
.pager-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 15px 18px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); text-decoration: none;
  transition: border-color .12s ease;
}
.pager-link:hover { border-color: var(--accent-line); }
.pager-next { grid-column: 2; text-align: right; }
.pager-dir { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pager-title { font-size: 16.5px; font-weight: 700; line-height: 1.35; color: var(--accent); }

/* ── Footer (same parts as the site's) ────────────────── */
.footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: grid; gap: 14px;
  max-width: 1440px; margin: 0 auto; padding: 34px 24px 44px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { margin: 0; font-size: 12.5px; color: var(--muted); }
.footer-legal a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.footer-legal a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Search ───────────────────────────────────────────── */
.search-dialog {
  width: min(680px, calc(100vw - 32px));
  max-width: none; max-height: none;
  margin: 72px auto auto; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--bg); color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search-dialog::backdrop { background: var(--backdrop); }
.search-panel {
  display: flex; flex-direction: column;
  max-height: min(640px, calc(100vh - 110px));
  max-height: min(640px, calc(100dvh - 110px));
}
.search-bar {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--line);
}
.search-bar > svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.search-input {
  flex: 1; min-width: 0; height: 58px;
  border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 18px;
  outline: none;
  -webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--faint); opacity: 1; }
.search-input::-webkit-search-decoration { -webkit-appearance: none; }
.search-close {
  flex: none;
  padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--muted);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.search-close:hover { color: var(--text); }
.search-status { margin: 0; padding: 12px 18px; font-size: 14px; color: var(--muted); flex: none; }
.search-status:empty { display: none; }
.search-results { overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 12px; }
.sr-group + .sr-group { margin-top: 6px; }
.sr-head {
  padding: 10px 12px 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.sr-option {
  display: block; padding: 9px 12px 10px;
  border: 1px solid transparent; border-radius: 10px;
  color: var(--text); text-decoration: none;
}
.sr-option[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.sr-title { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.sr-option[aria-selected="true"] .sr-title { color: var(--accent); }
.sr-excerpt {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden;
  margin-top: 3px;
  font-size: 14px; line-height: 1.5; color: var(--muted);
}
.sr-excerpt mark { background: var(--mark); color: var(--text); border-radius: 3px; padding: 0 1px; }
.search-keys {
  display: none; gap: 18px; flex: none;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.search-keys kbd { min-width: 20px; text-align: center; }
@media (hover: hover) and (pointer: fine) { .search-keys { display: flex; } }

/* ── Docs home ────────────────────────────────────────── */
.home { padding: 64px 0 104px; }
.home-hero { max-width: 780px; margin: 0 auto; text-align: center; }
.home-hero h1 {
  margin: 0;
  font-size: clamp(36px, 5.4vw, 56px); line-height: 1.06;
  font-weight: 800; letter-spacing: -0.025em;
}
.home-hero .lead { max-width: 62ch; margin: 18px auto 0; font-size: 19px; }
.home-search { position: relative; max-width: 640px; margin: 34px auto 0; text-align: left; }
.home-search-field {
  display: flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 20px;
  border: 1.5px solid var(--faint); border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.home-search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.home-search-field > svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.home-search-field .search-input { height: 100%; font-size: 18.5px; }
.home-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20;
  max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--bg); box-shadow: var(--shadow);
}
.home-results .search-results { overflow: visible; padding-top: 2px; }
/* nothing to show yet (the first results are on their way): no empty box */
.home-results:has(.search-status:empty):has(.search-results[hidden]) { display: none; }

.home-block { margin-top: 76px; }
.home-block h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.012em; }
.home-sub { margin: 6px 0 0; color: var(--muted); }
.start-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  list-style: none; margin: 20px 0 0; padding: 0;
}
.start-card {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  padding: 22px 22px 24px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color .12s ease, transform .12s ease;
}
.start-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.start-n {
  display: grid; place-items: center;
  width: 30px; height: 30px; margin-bottom: 8px; border-radius: 50%;
  background: var(--brass); color: var(--ink);
  font-size: 14px; font-weight: 800;
}
.start-title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.start-desc { font-size: 15px; line-height: 1.5; color: var(--muted); }

.section-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px;
  margin-top: 20px;
}
.section-card {
  padding: 20px 22px 22px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface);
}
.section-card h3 {
  margin: 0 0 12px;
  font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
}
.section-card ul { list-style: none; margin: 0; padding: 0; }
.section-card li + li { margin-top: 7px; }
.section-card a { color: var(--text); font-size: 15.5px; font-weight: 600; line-height: 1.35; text-decoration: none; }
.section-card a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.section-card:target { border-color: var(--accent-line); }

/* ── Responsive ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hd-anchor, .start-card, .pager-link, .sidenav { transition: none !important; }
  .start-card:hover { transform: none; }
}

/* below 1200px: no right column — "On this page" folds into the article */
@media (max-width: 1199px) {
  .docs-shell { grid-template-columns: 232px minmax(0, 1fr); column-gap: 40px; }
  .toc { display: none; }
  .toc-inline { display: block; }
  .search-btn { width: 200px; }
}

/* below 880px: the sidebar becomes a drawer behind the menu button */
@media (max-width: 879px) {
  .docs-shell { display: block; padding: 0 16px; }
  .topbar-inner { gap: 8px; padding: 0 12px; }
  .menu-btn { display: inline-grid; }
  .topbar-actions { gap: 8px; }
  .topbar .open-app { display: none; }
  .docs-main { padding-top: 26px; }

  html.js .sidenav {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
    /* align-self also sizes fixed boxes now: stretch it back to the full height */
    align-self: stretch; height: 100vh; height: 100dvh;
    width: min(320px, 86vw); max-height: none;
    padding: 0 14px 32px;
    background: var(--bg);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  html.js .sidenav.is-open { transform: none; visibility: visible; transition: transform .22s ease; }
  html.js .drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 1;
    height: var(--topbar-h); margin: 0 -14px 18px; padding: 0 14px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  html.js .drawer-app { display: inline-flex; margin: 26px 10px 0; }
  html:not(.js) .sidenav { position: static; max-height: none; padding: 20px 0; border-bottom: 1px solid var(--line); }

  .start-cards { grid-template-columns: 1fr; }
  .home { padding-top: 40px; }
  .home-block { margin-top: 56px; }
}

@media (max-width: 560px) {
  .search-btn { width: 38px; padding: 0; justify-content: center; }
  .search-btn-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .search-btn-keys { display: none; }
  .search-btn svg { width: 18px; height: 18px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: auto; }
  .docs-main { font-size: 16.5px; }
  .lead, .home-hero .lead { font-size: 17.5px; }
  .callout { padding: 12px 14px 13px; }
  .docs-content th, .docs-content td { padding: 9px 11px; }
  .search-dialog { width: calc(100vw - 20px); margin-top: 10px; }
  .search-panel { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  .search-input { font-size: 17px; height: 54px; }
  .home-hero { text-align: left; }
  .home-hero .lead { margin-left: 0; }
}

/* very narrow phones: the roundel + "Docs" stand in for the wordmark */
@media (max-width: 420px) {
  .topbar .wordmark, .drawer-head .wordmark { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .lang-switch a { min-width: 36px; padding: 0 7px; }
}

/* ── Print: the article only ──────────────────────────── */
@media print {
  :root, :root[data-theme], :root:not([data-theme="dark"]) {
    --bg: #fff; --surface: #fff; --sunken: #f2f2f2; --line: #bbb; --line-strong: #999;
    --text: #000; --muted: #333; --faint: #555;
    --accent: #000; --accent-soft: transparent; --accent-line: #999;
    --note: #000; --tip: #000; --warn: #000;
    color-scheme: light;
  }
  .topbar, .sidenav, .drawer-backdrop, .toc, .toc-inline, .breadcrumb, .pager,
  .footer, .search-dialog, .skip-link, .hd-anchor, .home-search { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .docs-shell { display: block; max-width: none; padding: 0; }
  .docs-main { padding: 0; font-size: 11pt; }
  .docs-article { max-width: none; }
  .docs-content a:not(.hd-anchor) { color: #000; text-decoration: underline; }
  .docs-content a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  .table-wrap { overflow: visible; background: none; }
  .callout, .table-wrap, pre, tr, img { break-inside: avoid; }
  .docs-content h2, .docs-content h3 { break-after: avoid; }
}
