/* Design tokens, copied from urnextdoor.com (app/Views/layout/styles/tokens.css + theme.css) so the
   docs look like part of the same product. Docs-only tokens are marked. The dark palette applies
   under [data-theme="dark"], which the inline pre-paint script sets before first paint. */
:root {
  color-scheme: light;
  --bg:          #f6f7f9;
  --surface:     #ffffff;
  --surface-2:   #f9fafc;
  --border:      #e4e6eb;
  --border-dk:   #d4d7dc;
  --text:        #1c1e21;
  --muted:       #65676b;
  --primary:     #2563eb;
  --primary-dk:  #1d4ed8;
  --primary-bg:  #eff4ff;
  --primary-btn:   #1d4ed8;
  --primary-btn-h: #1a44bf;
  --accent:      #f59e0b;
  --success:     #16a34a;
  --success-bg:  #ecfdf5;
  --danger:      #dc2626;
  --danger-bg:   #fef2f2;
  --tag-bg:      #eef2ff;
  --tag-text:    #3730a3;
  --hot-bg:      #fff7ed;
  --hot-text:    #c2410c;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:      0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md:   0 10px 30px -12px rgba(15, 23, 42, 0.20);
  --shadow-lg:   0 22px 50px -14px rgba(15, 23, 42, 0.26);
  --ring:        0 0 0 3px rgba(37, 99, 235, 0.30);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  --ff-mono: ui-monospace, "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  --ff-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;

  /* Docs only: layout and code colours. */
  --header-h:    60px;
  --sidebar-w:   264px;
  --toc-w:       224px;
  --content-w:   780px;
  --link:        #1d4ed8;
  --code-bg:     #f6f8fb;
  --code-border: #e1e5ec;
  --code-text:   #1f2328;
  --inline-code-bg: #eef1f6;
  --tok-c: #6a737d;
  --tok-s: #0a7d33;
  --tok-k: #9a2fbf;
  --tok-n: #b4400b;
  --tok-p: #1d4ed8;
  --tok-v: #b4400b;
  --tok-f: #6f42c1;
  --tok-o: #0e6b8a;
  --warning:     #b45309;
  --warning-bg:  #fffbeb;
  --note:        #1d4ed8;
  --scrollbar:   #c3c8d1;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0f1115;
  --surface:     #181b20;
  --surface-2:   #212530;
  --border:      #2b2f37;
  --border-dk:   #3a3f4a;
  --text:        #e7e9ec;
  --muted:       #9aa1ac;
  --primary:     #3b82f6;
  --primary-dk:  #2f6fe0;
  --primary-bg:  #172033;
  --accent:      #fbbf24;
  --success:     #34d399;
  --success-bg:  #10281d;
  --danger:      #f87171;
  --danger-bg:   #2a1618;
  --tag-bg:      #1e2333;
  --tag-text:    #a9b6ff;
  --hot-bg:      #2a1d12;
  --hot-text:    #fdba74;
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.50);
  --shadow:      0 2px 8px rgba(0, 0, 0, 0.55);
  --shadow-md:   0 10px 30px -12px rgba(0, 0, 0, 0.70);
  --shadow-lg:   0 22px 50px -14px rgba(0, 0, 0, 0.75);
  --ring:        0 0 0 3px rgba(59, 130, 246, 0.45);

  --link:        #7cb0ff;
  --code-bg:     #12151b;
  --code-border: #2b2f37;
  --code-text:   #e2e5ea;
  --inline-code-bg: #232833;
  --tok-c: #8b949e;
  --tok-s: #7ee2a8;
  --tok-k: #d2a8ff;
  --tok-n: #ffa657;
  --tok-p: #79c0ff;
  --tok-v: #ffa657;
  --tok-f: #d2a8ff;
  --tok-o: #56d4dd;
  --warning:     #fbbf24;
  --warning-bg:  #2a2112;
  --note:        #7cb0ff;
  --scrollbar:   #4a505c;
}

/* No JS (so no data-theme yet): follow the system setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0f1115; --surface: #181b20; --surface-2: #212530; --border: #2b2f37; --border-dk: #3a3f4a;
    --text: #e7e9ec; --muted: #9aa1ac; --primary: #3b82f6; --primary-dk: #2f6fe0; --primary-bg: #172033;
    --success: #34d399; --success-bg: #10281d; --danger: #f87171; --danger-bg: #2a1618;
    --tag-bg: #1e2333; --tag-text: #a9b6ff; --ring: 0 0 0 3px rgba(59, 130, 246, 0.45);
    --link: #7cb0ff; --code-bg: #12151b; --code-border: #2b2f37; --code-text: #e2e5ea; --inline-code-bg: #232833;
    --tok-c: #8b949e; --tok-s: #7ee2a8; --tok-k: #d2a8ff; --tok-n: #ffa657; --tok-p: #79c0ff;
    --tok-v: #ffa657; --tok-f: #d2a8ff; --tok-o: #56d4dd;
    --warning: #fbbf24; --warning-bg: #2a2112; --note: #7cb0ff; --scrollbar: #4a505c;
  }
}

html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color .28s ease, border-color .28s ease, color .28s ease, fill .28s ease, box-shadow .28s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  html.theme-switching,
  html.theme-switching *,
  html.theme-switching *::before,
  html.theme-switching *::after { transition: none !important; }
}

/* Base elements and typography. */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.6;
}

body { min-height: 100vh; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.25; margin: 2em 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.5rem; padding-top: 0.25em; border-top: 1px solid var(--border); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }

p, ul, ol, dl, table, blockquote { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 0.3em; }
li > ul, li > ol { margin-top: 0.3em; margin-bottom: 0; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

blockquote {
  margin-left: 0;
  padding: 0.2em 1em;
  border-left: 3px solid var(--border-dk);
  color: var(--muted);
}

code {
  font-family: var(--ff-mono);
  font-size: 0.88em;
  background: var(--inline-code-bg);
  padding: 0.12em 0.36em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

kbd {
  font-family: var(--ff-mono);
  font-size: 0.85em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--border-dk);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
}

strong { font-weight: 650; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary-btn);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

[hidden] { display: none !important; }

table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { font-weight: 650; background: var(--surface-2); border-bottom-color: var(--border-dk); }
td code, th code { white-space: nowrap; overflow-wrap: normal; }
.align-right { text-align: right; }
.align-center { text-align: center; }

/* Page frame: sticky header, sidebar, content, on-this-page column. Mobile first:
   one column under 900px (sidebar becomes a drawer with JS, or sits below the page without),
   sidebar + content from 900px, and the table of contents joins from 1200px. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 10px;
  margin-left: -6px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.menu-toggle:hover { background: var(--surface-2); }
/* Visually hidden on small screens but still the link's accessible name. */
.menu-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
}
.brand-logo { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.brand-name { display: none; }
.brand-tag {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--primary-dk);
  background: var(--primary-bg);
  padding: 2px 8px;
  border-radius: 999px;
}
:root[data-theme="dark"] .brand-tag { color: var(--link); }

.site-search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 420px; margin-left: auto; display: flex; }
.search-input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 40px 0 12px;
  border: 1px solid var(--border-dk);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
.search-submit {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.search-submit:hover { color: var(--text); }

.header-cta {
  display: none;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-btn);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}
.header-cta:hover { background: var(--primary-btn-h); color: #fff; }

.theme-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-btn:hover { background: var(--surface-2); border-color: var(--border-dk); }
.theme-btn .icon { display: none; }
:root[data-theme-pref="light"] .theme-btn .theme-icon-light,
:root[data-theme-pref="dark"] .theme-btn .theme-icon-dark,
:root[data-theme-pref="system"] .theme-btn .theme-icon-system { display: block; }

.shell {
  display: flex;
  flex-direction: column;
  max-width: 1440px;
  margin: 0 auto;
}

.main {
  order: 1;
  min-width: 0;
  padding: 24px 16px 48px;
}
.main:focus { outline: none; }
.doc { max-width: var(--content-w); margin: 0 auto; }

/* Sidebar: without JS on small screens it follows the page (Menu jumps to it). */
.sidebar {
  order: 2;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 16px 32px;
}
.toc-col { display: none; }

.nav-group-title {
  margin: 18px 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-group-title:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li + li { margin-top: 1px; }
.sidebar a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.93rem;
  line-height: 1.35;
}
.sidebar a:hover { background: var(--surface-2); }
.sidebar a[aria-current="page"] {
  background: var(--primary-bg);
  color: var(--primary-dk);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--primary);
}
:root[data-theme="dark"] .sidebar a[aria-current="page"] { color: var(--link); }

/* With JS on small screens: the sidebar is an off-canvas drawer. */
@media (max-width: 899px) {
  .js .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: min(86vw, 320px);
    border-top: 0;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: var(--shadow-lg);
  }
  .js .nav-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform .22s ease;
  }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 17, 21, 0.45);
  }
  .nav-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .js .sidebar, .js .nav-open .sidebar { transition: none; }
}

@media (min-width: 560px) {
  .brand-name { display: inline; }
  .menu-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .header-inner { padding: 0 24px; }
  .header-cta { display: inline-flex; }
  .shell { flex-direction: row; align-items: flex-start; }
  .sidebar {
    order: 0;
    position: sticky;
    top: var(--header-h);
    flex: 0 0 var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    border-top: 0;
    border-right: 1px solid var(--border);
    background: transparent;
    padding: 24px 16px 40px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) transparent;
  }
  .main { flex: 1 1 auto; padding: 32px 40px 64px; }
  .nav-backdrop { display: none !important; }
}

@media (min-width: 1200px) {
  .toc-col {
    display: block;
    order: 2;
    position: sticky;
    top: var(--header-h);
    flex: 0 0 var(--toc-w);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 32px 24px 40px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) transparent;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 16px 36px;
  display: grid;
  gap: 18px;
}
.footer-name { margin: 0; font-weight: 700; color: var(--text); }
.footer-tagline { margin: 2px 0 0; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav li + li { margin-top: 0; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-theme-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.theme-seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.theme-seg button {
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.theme-seg button:hover { background: var(--surface-2); }
.theme-seg button[aria-pressed="true"] { background: var(--primary-btn); color: #fff; }
@media (min-width: 900px) {
  .footer-inner { grid-template-columns: 1fr auto; align-items: start; padding: 32px 24px 40px; }
  .footer-nav { grid-column: 1; }
  .footer-theme { grid-column: 2; grid-row: 1 / span 2; }
}

/* Content components: page header, breadcrumbs, callouts, cards, tables, FAQ, TOC, pager, search. */

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 14px;
  padding: 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.breadcrumbs li + li { margin-top: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 4px; color: var(--border-dk); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }

.doc-head { margin-bottom: 28px; }
.doc-head h1 { font-size: clamp(1.7rem, 4vw, 2.25rem); margin: 0 0 10px; }
.doc-lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 16px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-ghost { border: 1px solid var(--border-dk); background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-primary { border: 1px solid var(--primary-btn); background: var(--primary-btn); color: #fff; }
.btn-primary:hover { background: var(--primary-btn-h); color: #fff; }

.doc-body > :first-child { margin-top: 0; }
.doc-body h2:first-child { border-top: 0; padding-top: 0; }
.doc-updated { margin: 40px 0 0; font-size: 0.86rem; color: var(--muted); }

/* Callouts */
.callout {
  margin: 0 0 1.2em;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--note);
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { margin: 0 0 4px; font-weight: 700; color: var(--note); }
.callout-warning { border-left-color: var(--warning); background: var(--warning-bg); }
.callout-warning .callout-title { color: var(--warning); }
.callout-danger { border-left-color: var(--danger); background: var(--danger-bg); }
.callout-danger .callout-title { color: var(--danger); }

/* Cards */
.cards {
  list-style: none;
  margin: 0 0 1.4em;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.cards li + li { margin-top: 0; }
.card-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.card-link:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.card-title { font-weight: 700; color: var(--link); }
.card-desc { font-size: 0.92rem; color: var(--muted); }
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tables scroll inside their own box on narrow screens (focusable for keyboard scrolling). */
.table-wrap {
  margin: 0 0 1.2em;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
.table-wrap table { margin: 0; }
.table-wrap td { min-width: 7rem; }
.table-wrap td:first-child { min-width: 0; }
.table-wrap tr:last-child td { border-bottom: 0; }

/* FAQ */
.faq-item { margin: 0 0 0.6em; }
.faq-item h3 { margin-top: 1.4em; }

/* On this page */
.toc-title {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li + li { margin-top: 0; }
.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.35;
}
.toc a:hover { color: var(--text); border-left-color: var(--border-dk); }
.toc .toc-d3 a { padding-left: 24px; font-size: 0.83rem; }

/* Previous / next */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.pager-link:hover { border-color: var(--primary); }
.pager-next { text-align: right; grid-column: 2; }
.pager-label { font-size: 0.8rem; color: var(--muted); }
.pager-title { font-weight: 650; color: var(--link); overflow-wrap: anywhere; }

/* Search popup (header) */
.search-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 70;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.search-list { list-style: none; margin: 0; padding: 4px; max-height: min(70vh, 420px); overflow-y: auto; }
.search-option {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.search-list li + li { margin-top: 0; }
.search-option[aria-selected="true"],
.search-option:hover { background: var(--primary-bg); }
.search-option-title { font-weight: 600; font-size: 0.93rem; }
.search-option-section { font-size: 0.78rem; color: var(--muted); }
.search-option-all { font-size: 0.86rem; color: var(--link); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* /search/ page */
.search-page-form { display: flex; gap: 8px; margin: 0 0 16px; }
.search-page-form .search-input { padding-right: 12px; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-result { padding: 14px 0; border-bottom: 1px solid var(--border); }
.search-results li + li { margin-top: 0; }
.search-result a { font-weight: 650; font-size: 1.05rem; }
.search-result-section { margin: 2px 0 4px; font-size: 0.8rem; color: var(--muted); }
.search-result-snippet { margin: 0; font-size: 0.93rem; }

/* Home */
.page-home .doc { max-width: 920px; }
.page-home .doc-lead { font-size: 1.2rem; }

/* Redirect stub */
.redirect { max-width: 640px; margin: 0 auto; padding: 64px 16px; }

/* Code blocks, tabs and syntax colours. Scrollbars stay visible on code (the main site hides
   them everywhere; long API samples need them). */

.code-block {
  margin: 0 0 1.2em;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 4px 6px 4px 12px;
  border-bottom: 1px solid var(--code-border);
  font-size: 0.78rem;
  color: var(--muted);
}
.code-lang { font-weight: 600; letter-spacing: 0.02em; }
.copy-btn {
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid var(--border-dk);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.copy-btn:hover { background: var(--surface-2); }

pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--ff-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--code-text);
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
pre::-webkit-scrollbar { height: 10px; width: 10px; display: block; }
pre::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 10px; border: 2px solid var(--code-bg); }
pre::-webkit-scrollbar-track { background: transparent; }
pre:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
pre code {
  display: block;
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
  overflow-wrap: normal;
  border-radius: 0;
}

/* Tabs */
.code-tabs { margin: 0 0 1.2em; }
.code-tabs .tabpanel + .tabpanel { margin-top: 10px; }
.tabs-ready .tabpanel + .tabpanel { margin-top: 0; }
.tablist {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border: 1px solid var(--code-border);
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface-2);
  padding: 4px 4px 0;
  scrollbar-width: thin;
}
.tablist [role="tab"] {
  flex: none;
  padding: 7px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.tablist [role="tab"]:hover { color: var(--text); }
.tablist [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); background: var(--code-bg); }
.tabs-ready .code-block { margin: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.tabs-ready .code-block .code-lang { visibility: hidden; }

.tok-c { color: var(--tok-c); font-style: italic; }
.tok-s { color: var(--tok-s); }
.tok-k { color: var(--tok-k); }
.tok-n { color: var(--tok-n); }
.tok-p { color: var(--tok-p); }
.tok-v { color: var(--tok-v); }
.tok-f { color: var(--tok-f); }
.tok-o { color: var(--tok-o); }

@media print {
/* Print: content only, every code tab visible, links shown. (Wrapped in @media print by the build.) */
.site-header, .sidebar, .toc-col, .site-footer, .doc-actions, .pager, .tablist, .copy-btn, .skip-link, .nav-backdrop { display: none !important; }
html, body { background: #fff; color: #000; font-size: 11pt; }
.shell { display: block; }
.main { padding: 0; }
.doc { max-width: none; }
.tabpanel[hidden] { display: block !important; }
.tabs-ready .code-block .code-lang { visibility: visible; }
pre { white-space: pre-wrap; overflow: visible; border: 1px solid #ccc; }
pre code { white-space: pre-wrap; }
.code-block, .table-wrap, .callout { break-inside: avoid; }
.doc-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
h2, h3 { break-after: avoid; }

}
