:root {
  color-scheme: light;
  --surface: #ffffff;
  --sidebar: #fafafa;
  --soft: #f3f3f3;
  --text: #373737;
  --heading: #191919;
  --muted: #626262;
  --line: #e7e7e7;
  --line-strong: #c8c8c8;
  --link: #345d85;
  --warning: #775521;
  --warning-bg: #faf7f0;
  --danger: #a13333;
  --danger-bg: #fcf4f3;
  --scrim: rgba(0,0,0,.32);
  --body: 'Inter','Segoe UI',sans-serif;
  --topbar-h: 64px;
  --sidebar-w: 236px;
  --maxw: 688px;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --surface: #191919;
  --sidebar: #171717;
  --soft: #232323;
  --text: #d2d2d2;
  --heading: #f2f2f2;
  --muted: #ababab;
  --line: #303030;
  --line-strong: #515151;
  --link: #a2c2df;
  --warning: #dfc18c;
  --warning-bg: #28241d;
  --danger: #e8aaaa;
  --danger-bg: #2b2020;
  --scrim: rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); scrollbar-color: var(--line-strong) var(--surface); }
body { margin: 0; background: var(--surface); color: var(--text); font: 15px/1.75 var(--body); -webkit-font-smoothing: antialiased; }
::selection { background: var(--line); color: var(--heading); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--heading); }
button,input { font: inherit; }
input { caret-color: var(--heading); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 10px 16px; background: var(--surface); color: var(--heading); border: 1px solid var(--line-strong); }
.skip:focus { left: 8px; }

.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 20px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 16px; flex: none; color: var(--heading); text-decoration: none; }
.brand-logo { display: block; width: 112px; height: auto; }
.brand-logo-dark,.brand-icon { display: none; }
:root[data-theme='dark'] .brand-logo-light { display: none; }
:root[data-theme='dark'] .brand-logo-dark { display: block; }
.docs-label { color: var(--muted); font-size: 13px; padding-left: 16px; border-left: 1px solid var(--line); }
.menu-btn,.theme-btn { width: 44px; height: 44px; padding: 12px; flex: none; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.menu-btn { display: none; }
.theme-btn { display: grid; place-items: center; }
.menu-btn:hover,.theme-btn:hover { background: var(--soft); color: var(--heading); }
.menu-btn svg,.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sun-icon { display: none; }
:root[data-theme='dark'] .moon-icon { display: none; }
:root[data-theme='dark'] .sun-icon { display: block; }
.search { position: relative; margin-left: auto; width: min(360px,34vw); min-width: 0; }
.search-icon { position: absolute; left: 12px; top: 12px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 38px; background: var(--sidebar); color: var(--heading); border: 1px solid var(--line); border-radius: 5px; font-size: 13px; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--link); outline-offset: 2px; }
.search-key { position: absolute; right: 11px; top: 9px; color: var(--muted); font: 13px/22px var(--body); pointer-events: none; }
.search-results { position: absolute; top: 48px; right: 0; width: min(520px,90vw); max-height: 70vh; overflow: auto; z-index: 50; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; }
.search-results a { display: block; padding: 12px; color: var(--text); text-decoration: none; border-radius: 3px; }
.search-results a:hover,.search-results a:focus-visible { background: var(--soft); }
.search-results a:focus-visible { outline-offset: -2px; }
.search-results strong { display: block; color: var(--heading); font-size: 14px; line-height: 1.5; font-weight: 600; }
.search-results span { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; }
.search-results .search-group { margin-bottom: 3px; font-size: 11px; }
.search-empty { margin: 0; padding: 12px; color: var(--muted); font-size: 13px; }
.site-link { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; text-decoration: none; }
.site-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.layout { display: flex; align-items: flex-start; max-width: 1480px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--topbar-h); flex: none; width: var(--sidebar-w); height: calc(100dvh - var(--topbar-h)); overflow-y: auto; padding: 30px 20px 32px 28px; background: var(--sidebar); border-right: 1px solid var(--line); scrollbar-width: thin; }
.nav-group { margin: 25px 0 6px; padding-left: 8px; color: var(--heading); font-size: 13px; font-weight: 600; }
.nav-group:first-child { margin-top: 0; }
.nav-group:not(:first-child) { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 0; }
.nav-list a, .nav-list a:visited { display: flex; align-items: center; min-height: 38px; padding: 6px 8px; color: var(--muted); border-radius: 3px; font-size: 14.5px; line-height: 1.55; text-decoration: none; }
.nav-list a:hover, .nav-list a:visited:hover { background: var(--soft); color: var(--heading); }
.nav-list a.active, .nav-list a.active:visited { color: var(--heading); font-weight: 600; }
.sidebar-foot { margin: 28px 8px 0; color: var(--muted); font-size: 12px; }
.sidebar-foot a { color: inherit; }

main { flex: 1; min-width: 0; padding: 52px 48px 64px; }
.doc-grid { display: grid; grid-template-columns: minmax(0,var(--maxw)) 168px; align-items: start; gap: 56px; max-width: 912px; margin: 0 auto; }
.prose { min-width: 0; }
h1,h2,h3,h4 { color: var(--heading); font-weight: 600; }
h1 { margin: 0 0 12px; font-size: 32px; line-height: 1.25; letter-spacing: -.035em; }
.lede { margin: 0 0 32px; max-width: 65ch; color: var(--muted); font-size: 16px; line-height: 1.65; }
h2 { margin: 42px 0 14px; font-size: 22px; line-height: 1.4; letter-spacing: -.025em; }
h3 { margin: 28px 0 10px; font-size: 17px; line-height: 1.45; letter-spacing: -.015em; }
h4 { margin: 24px 0 8px; font-size: 15px; }
.prose>h2:first-of-type { margin-top: 30px; }
.prose>h2 { padding-top: 32px; border-top: 1px solid var(--line-strong); margin-top: 48px; }
.prose>h2:first-of-type { padding-top: 0; border-top: 0; }
p { margin: 14px 0; }
p,li { overflow-wrap: break-word; }
strong { color: var(--heading); font-weight: 600; }
ul,ol { padding-left: 22px; }
li { margin: 8px 0; }
li::marker { color: var(--muted); }
.anchor { margin-left: 8px; color: var(--muted); opacity: 0; text-decoration: none; font-weight: 400; }
h2:hover .anchor,h3:hover .anchor,h4:hover .anchor,.anchor:focus-visible { opacity: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
code { padding: 2px 5px; border-radius: 3px; background: var(--soft); color: var(--heading); font: .88em ui-monospace,Consolas,monospace; }
blockquote { margin: 24px 0; padding: 0 18px; border-left: 1px solid var(--line-strong); color: var(--muted); }
blockquote>:first-child { margin-top: 0; }
blockquote>:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 24px 0; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.65; font-variant-numeric: tabular-nums; }
th,td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { padding-top: 0; color: var(--heading); font-size: 12px; font-weight: 600; }
th:first-child,td:first-child { padding-left: 0; }
th:last-child,td:last-child { padding-right: 0; }
.callout { margin: 24px 0; padding: 16px 18px; background: var(--soft); border-radius: 4px; }
.callout-title { margin: 0 0 6px; color: var(--heading); font-size: 14px; font-weight: 600; }
.callout>:last-child { margin-bottom: 0; }
.callout-warn { background: var(--warning-bg); }
.callout-warn .callout-title { color: var(--warning); }
.callout-danger { background: var(--danger-bg); }
.callout-danger .callout-title { color: var(--danger); }
.callout-paths { margin: 18px 0 30px; padding: 0; background: none; }
.callout-paths .callout-title { display: none; }
.callout-paths ul { list-style: none; padding: 0; margin: 0; }
.callout-paths li { position: relative; margin: 0; padding: 12px 0; color: var(--muted); font-size: 14px; }
.callout-paths strong { display: inline-block; width: 192px; padding-right: 12px; vertical-align: top; }
.callout-paths a { color: var(--heading); font-size: 14px; text-decoration-color: var(--line-strong); }
.callout-paths a:hover { text-decoration-color: var(--heading); }
.callout-paths a::after { content: ''; position: absolute; inset: 0; }
.callout-paths li:focus-within { outline: 2px solid var(--link); outline-offset: 3px; }

.page-outline { position: sticky; top: calc(var(--topbar-h) + 52px); min-width: 0; max-height: calc(100dvh - var(--topbar-h) - 76px); overflow-y: auto; scrollbar-width: thin; }
.toc-title { margin: 2px 0 12px; color: var(--heading); font-size: 12px; font-weight: 600; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0 0 10px; }
.toc a { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; text-decoration: none; }
.toc a:hover { color: var(--heading); text-decoration: underline; }
.mobile-outline { display: none; }
.pager { display: flex; gap: 32px; justify-content: space-between; margin: 48px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { flex: 1; color: var(--heading); font-size: 14px; font-weight: 500; text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.pager-next { text-align: right; }
.foot { max-width: var(--maxw); margin: 40px auto 0; padding-top: 20px; color: var(--muted); font-size: 12px; }
.foot p { margin: 4px 0; }
.foot a { color: inherit; }
.scrim { position: fixed; inset: var(--topbar-h) 0 0; z-index: 35; background: var(--scrim); }

@media(max-width:1200px) {
  .doc-grid { grid-template-columns: minmax(0,var(--maxw)); max-width: var(--maxw); }
  .page-outline { display: none; }
  .mobile-outline { display: block; margin: 0 0 24px; border-block: 1px solid var(--line); }
  .mobile-outline summary { min-height: 44px; padding: 10px 0; color: var(--muted); font-size: 13px; cursor: pointer; }
  .mobile-outline .toc { padding-bottom: 10px; }
  .mobile-outline .toc-title { display: none; }
  .mobile-outline .toc a { min-height: 36px; padding: 7px 0; font-size: 13px; }
  .mobile-outline .toc li { margin: 0; }
}
@media(max-width:900px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .menu-btn { display: grid; place-items: center; }
  .sidebar { position: fixed; left: 0; z-index: 38; width: 270px; transform: translateX(-102%); transition: transform .18s ease-out; }
  .sidebar.open { transform: none; }
  .nav-list a { min-height: 44px; }
  body.menu-open { overflow: hidden; }
  main { padding: 36px 28px 48px; }
  .site-link { display: none; }
  .search { width: auto; flex: 1; }
  .search-results { position: fixed; top: calc(var(--topbar-h) + 8px); left: 12px; right: 12px; width: auto; max-height: calc(100dvh - var(--topbar-h) - 24px); }
}
@media(max-width:560px) {
  .topbar { padding: 0 8px; gap: 4px; }
  .brand-logo,.docs-label { display: none !important; }
  .brand-icon { display: block; width: 32px; height: 32px; object-fit: contain; }
  .brand { margin-right: 8px; }
  .search-key { display: none; }
  .search input { padding-right: 10px; }
  main { padding: 30px 22px 40px; }
  h1 { font-size: 28px; }
  h2 { font-size: 21px; margin-top: 34px; }
  .lede { font-size: 15px; margin-bottom: 24px; }
  .callout-paths strong { display: block; width: auto; margin-bottom: 2px; }
  .callout-paths li { padding: 10px 0; }
  .pager { flex-direction: column; gap: 20px; }
  .pager-next { text-align: left; }
  th,td { padding: 10px; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { transition: none !important; animation: none !important; }
}
@media print {
  .topbar,.sidebar,.page-outline,.mobile-outline,.pager,.scrim,.foot,.anchor { display: none; }
  :root,:root[data-theme='dark'] { --surface: #fff; --text: #222; --heading: #000; --muted: #444; --soft: #f5f5f5; --link: #222; }
  main { padding: 0; }
  .doc-grid { display: block; }
  .table-wrap { overflow: visible; }
}
