:root {
  color-scheme: dark;
  --background: #171717;
  --sidebar: #171717;
  --surface: #1a1a1a;
  --surface-raised: #222222;
  --foreground: #ecebe9;
  --muted: #9d9c95;
  --quiet: hsl(50 4% 45%);
  --border: #2d2d2d;
  --border-strong: hsl(50 5% 24%);
  --selection: #222222;
  --header-height: 64px;
  --sidebar-width: 264px;
  --content-width: 760px;
  --toc-width: 220px;
  --navigation-inset: 11px;
  font-family: Inter, system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--background); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--background); color: var(--foreground); -webkit-font-smoothing: antialiased; font-feature-settings: "rlig" 1, "calt" 1; }
a { color: inherit; }
::selection { background: #ecebe9; color: #171717; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: rgb(23 23 23 / 92%);
  backdrop-filter: blur(16px);
}

.topbar-inner { display: grid; width: 100%; max-width: calc(var(--sidebar-width) + var(--content-width) + var(--toc-width)); height: 100%; margin: 0 auto; grid-template-columns: 1fr minmax(260px, 440px) 1fr; align-items: center; gap: 24px; padding: 0 var(--navigation-inset); }
.docs-search-trigger { display: flex; width: 100%; height: 30px; min-width: 0; align-items: center; gap: 9px; border: 1px solid var(--border); background: var(--surface); padding: 0 6px 0 10px; color: var(--muted); font: inherit; cursor: pointer; box-shadow: inset 0 1px 0 hsl(50 6% 92% / 3%); transition: border-color 120ms ease, background 120ms ease, color 120ms ease; }
.docs-search-trigger:hover { border-color: var(--border-strong); background: var(--surface-raised); color: var(--foreground); }
.docs-search-trigger:focus-visible, .docs-search-close:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.docs-search-trigger > svg, .docs-search-input-row > svg, .docs-search-close > svg { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.search-trigger-label { min-width: 0; flex: 1; overflow: hidden; font-size: 12px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.docs-search-trigger kbd, .docs-search-input-row kbd { display: inline-flex; height: 19px; flex: 0 0 auto; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--border); background: var(--surface-raised); padding: 0 6px; color: var(--muted); font-family: inherit; font-size: 10px; line-height: 1; box-shadow: 0 1px 0 hsl(52 27% 3%), inset 0 1px 0 hsl(50 6% 92% / 5%); }
.top-links { display: flex; justify-self: end; gap: 24px; font-size: 12px; color: var(--muted); }
.top-links a { display: inline-flex; height: 30px; align-items: center; border: 1px solid transparent; padding: 0 10px; text-decoration: none; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; }
.top-links a:hover { border-color: var(--border-strong); background: var(--surface-raised); color: var(--foreground); }
.top-links a:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }

.docs-search-dialog { width: min(620px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 80px)); margin: 11vh auto 0; overflow: hidden; border: 1px solid var(--border-strong); background: var(--background); padding: 0; color: var(--foreground); box-shadow: 0 24px 80px hsl(52 27% 3% / 72%); }
.docs-search-dialog::backdrop { background: hsl(52 27% 3% / 72%); backdrop-filter: blur(5px); }
.docs-search-panel { display: flex; max-height: min(620px, calc(100vh - 80px)); flex-direction: column; }
.docs-search-input-row { display: flex; min-height: 56px; flex-shrink: 0; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); padding: 0 8px 0 18px; color: var(--muted); }
.docs-search-input-row input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--foreground); font: inherit; font-size: 15px; }
.docs-search-input-row input::placeholder { color: var(--quiet); }
.docs-search-input-row input::-webkit-search-cancel-button { display: none; }
.docs-search-close { display: inline-flex; width: 40px; height: 40px; flex: 0 0 auto; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.docs-search-close:hover { background: var(--surface-raised); color: var(--foreground); }
.docs-search-results { min-height: 0; overflow-y: auto; padding: 7px; }
.docs-search-results a { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 11px 12px; color: var(--muted); text-decoration: none; transition: background 100ms ease, color 100ms ease; }
.docs-search-results a:hover, .docs-search-results a:focus-visible { outline: 0; background: var(--selection); color: var(--foreground); }
.docs-search-results a > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.docs-search-results strong { overflow: hidden; color: currentColor; font-size: 13px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.docs-search-results small { overflow: hidden; color: var(--quiet); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.docs-search-results em { flex: 0 0 auto; color: var(--quiet); font-size: 10px; font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
.docs-search-results [hidden] { display: none; }
.docs-search-empty { margin: 0; padding: 34px 20px; color: var(--quiet); font-size: 12px; text-align: center; }

.docs-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width)) var(--toc-width); justify-content: center; min-height: calc(100vh - var(--header-height)); }
.sidebar, .toc { position: sticky; top: var(--header-height); align-self: start; max-height: calc(100vh - var(--header-height)); overflow: auto; }
.sidebar { padding: 30px 28px 48px var(--navigation-inset); border-right: 1px solid var(--border); background: var(--sidebar); }
.toc { padding: 42px 0 40px 28px; }
.content-column { min-width: 0; padding: 62px 64px 80px; }
.mobile-nav-toggle { display: none; }
.mobile-nav-dialog { width: min(340px, calc(100vw - 32px)); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; overflow: auto; border: 0; border-left: 1px solid var(--border); padding: 0; background: var(--background); color: var(--foreground); }
.mobile-nav-dialog::backdrop { background: hsl(52 27% 3% / 72%); }
.mobile-nav-panel { min-height: 100%; padding: 12px 20px 24px; }
.mobile-nav-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.mobile-nav-toggle, .mobile-nav-close { width: 40px; height: 40px; flex: 0 0 auto; align-items: center; justify-content: center; border: 0; padding: 0; background: transparent; color: var(--muted); cursor: pointer; }
.mobile-nav-close { display: inline-flex; }
.mobile-nav-toggle:hover, .mobile-nav-close:hover { background: var(--surface-raised); color: var(--foreground); }
.mobile-nav-toggle:focus-visible, .mobile-nav-close:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.mobile-nav-toggle svg, .mobile-nav-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.mobile-nav-dialog .nav-group a { padding: 10px 9px; font-size: 14px; }
.mobile-nav-account { display: block; margin-top: 24px; border-top: 1px solid var(--border); padding: 20px 9px 0; color: var(--muted); font-size: 14px; text-decoration: none; }
.mobile-nav-open { overflow: hidden; }

.nav-group { margin-top: 28px; }
.nav-group:first-child { margin-top: 0; }
.nav-group h2, .toc h2 { margin: 0 0 9px; color: var(--quiet); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.nav-group ul, .toc ol { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; margin: 1px 0; padding: 6px 9px; color: var(--muted); font-size: 12px; line-height: 1.4; text-decoration: none; transition: background 120ms ease, color 120ms ease; }
.nav-group a:hover { background: var(--surface-raised); color: var(--foreground); }
.nav-group a[aria-current="page"] { background: var(--selection); color: var(--foreground); font-weight: 520; }

.toc a { display: block; border-left: 1px solid var(--border); padding: 5px 0 5px 14px; color: var(--quiet); font-size: 11px; line-height: 1.4; text-decoration: none; transition: color 120ms ease, border-color 120ms ease; }
.toc a:hover { border-left-color: var(--foreground); color: var(--foreground); }
.toc li.nested a { padding-left: 26px; }

.page-kicker { margin-bottom: 16px; color: var(--quiet); font-size: 10px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.page-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-heading-row h1 { margin: 0; max-width: 590px; font-size: clamp(32px, 4vw, 46px); font-weight: 540; letter-spacing: -.045em; line-height: 1.06; }
.page-copy-button { display: inline-flex; height: 26px; flex: 0 0 auto; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); padding: 0 11px; color: var(--muted); font: inherit; font-size: 11px; line-height: 1; cursor: pointer; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; }
.page-copy-button:hover { border-color: var(--border-strong); background: var(--surface-raised); color: var(--foreground); }
.page-copy-button:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.page-copy-button svg { display: block; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.page-copy-button span { display: block; line-height: 1; transform: translateY(-1.5px); }
.page-description { max-width: 660px; }
.prose { margin-top: 48px; color: hsl(50 5% 76%); font-size: 14px; line-height: 1.75; }
.prose h2 { margin: 52px 0 14px; border-top: 1px solid var(--border); padding-top: 34px; color: var(--foreground); font-size: 22px; font-weight: 540; letter-spacing: -.025em; line-height: 1.25; scroll-margin-top: 84px; }
.prose h3 { margin: 32px 0 10px; color: var(--foreground); font-size: 16px; font-weight: 560; letter-spacing: -.01em; scroll-margin-top: 84px; }
.prose p { margin: 0 0 18px; }
.prose strong { color: var(--foreground); font-weight: 580; }
.prose a { color: var(--foreground); text-decoration-color: var(--quiet); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--foreground); }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 22px; }
.prose li { margin: 7px 0; padding-left: 3px; }
.prose li::marker { color: var(--quiet); }
.prose blockquote { margin: 26px 0; border-left: 2px solid var(--foreground); background: var(--surface); padding: 15px 18px; color: var(--foreground); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { border: 1px solid var(--border); background: var(--surface-raised); padding: 1px 4px; color: var(--foreground); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .88em; }
.prose :not(pre) > code { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; line-height: 1.2; vertical-align: middle; white-space: nowrap; }
.prose pre { max-width: 100%; margin: 22px 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); background: var(--surface) !important; padding: 18px 20px; }
.prose pre code { display: block; width: max-content; min-width: 100%; max-width: none; overflow: visible; border: 0; background: transparent; padding: 0; color: hsl(50 5% 84%); font-size: 12px; line-height: 1.65; white-space: pre; }
.prose pre code span { color: hsl(50 5% 84%) !important; }
.copyable-example { margin: 18px 0 26px; border: 1px solid var(--border); background: var(--surface); }
.copyable-example-toolbar { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); padding: 5px 8px 5px 15px; color: var(--quiet); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.copyable-example-toolbar button { display: inline-flex; height: 22px; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--background); padding: 0 7px; color: var(--muted); font: inherit; font-size: 10px; letter-spacing: 0; text-transform: none; cursor: pointer; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; }
.copyable-example-toolbar button:hover { border-color: var(--border-strong); background: var(--surface-raised); color: var(--foreground); }
.copyable-example-toolbar button:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.copyable-example-toolbar button svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.copyable-example-text { padding: 16px 18px; color: hsl(50 5% 84%); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.prose table { display: block; width: 100%; max-width: 100%; margin: 24px 0; overflow-x: auto; overscroll-behavior-x: contain; border-collapse: collapse; font-size: 12px; }
.prose table code { max-width: none; overflow: visible; vertical-align: baseline; }
.prose th { border-bottom: 1px solid var(--border-strong); padding: 10px 12px; color: var(--foreground); font-weight: 560; text-align: left; }
.prose td { border-bottom: 1px solid var(--border); padding: 11px 12px; vertical-align: top; }
.prose hr { margin: 44px 0; border: 0; border-top: 1px solid var(--border); }

.agent-setup-callout { margin: 24px 0 44px; }
.agent-setup-heading { display: flex; gap: 13px; border: 1px solid var(--border-strong); background: var(--surface); padding: 18px; }
.agent-setup-heading > svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: var(--foreground); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.agent-setup-heading strong { display: block; margin-bottom: 6px; font-size: 14px; }
.agent-setup-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.agent-prompt-card { margin-top: 14px; border: 1px solid var(--border); background: var(--surface-raised); padding: 16px; }
.agent-prompt-card textarea { width: 100%; margin-top: 16px; padding: 12px; border: 1px solid var(--border); background: var(--background); color: var(--foreground); font: inherit; resize: vertical; }
.prose .agent-prompt-summary { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.agent-prompt-actions { display: flex; min-height: 40px; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 16px; }
.agent-harnesses { display: flex; align-items: center; gap: 8px; }
.agent-harnesses img { width: 19px; height: 19px; border-radius: 4px; object-fit: contain; }
.copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.agent-prompt-actions button { display: inline-flex; height: 32px; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--foreground); padding: 0 12px; color: var(--background); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.agent-prompt-actions button:hover { background: hsl(50 6% 84%); }
.agent-prompt-actions button:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.agent-prompt-actions button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.page-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 64px; border-top: 1px solid var(--border); padding-top: 24px; }
.page-navigation > span:empty { display: block; }
.page-navigation a { display: flex; width: 100%; min-width: 0; min-height: 80px; max-width: none; flex-direction: column; justify-content: center; gap: 6px; border: 1px solid var(--border); padding: 14px 16px; text-decoration: none; transition: border-color 120ms ease, background 120ms ease; }
.page-navigation a:hover { border-color: var(--border-strong); background: var(--surface); }
.page-navigation a:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; }
.page-navigation a.next { align-items: flex-end; text-align: right; }
.page-navigation span { display: flex; align-items: center; gap: 5px; color: var(--quiet); font-size: 11px; }
.page-navigation span svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.page-navigation strong { font-size: 14px; font-weight: 520; line-height: 1.35; }

.not-found { display: grid; min-height: 100vh; place-content: center; justify-items: start; padding: 32px; }
.not-found h1 { margin: 52px 0 10px; font-size: 40px; font-weight: 540; letter-spacing: -.04em; }
.not-found p { margin: 0 0 28px; color: var(--muted); }
.primary-button { display: inline-flex; height: 36px; align-items: center; border: 1px solid var(--foreground); background: var(--foreground); padding: 0 14px; color: var(--background); font-size: 12px; font-weight: 600; text-decoration: none; }
.primary-button:hover { background: hsl(50 6% 84%); }

@media (max-width: 1080px) {
  .topbar-inner { max-width: calc(230px + var(--content-width)); }
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 0 18px; }
  .top-links, .sidebar, .toc { display: none; }
  .mobile-nav-toggle { display: inline-flex; }
  .docs-shell { display: block; }
  .content-column { max-width: var(--content-width); margin: 0 auto; }
  .docs-search-trigger { width: 40px; height: 40px; justify-content: center; gap: 0; border-color: transparent; background: transparent; padding: 0; box-shadow: none; }
  .docs-search-trigger > svg { width: 18px; height: 18px; }
  .search-trigger-label, .docs-search-trigger kbd { display: none; }
}

@media (max-width: 760px) {
  .docs-search-dialog { max-height: calc(100dvh - 32px); margin-top: 16px; }
  .docs-search-panel { max-height: calc(100dvh - 34px); }
  .docs-search-input-row input { font-size: 16px; }
  .content-column { padding: 44px 22px 64px; }
  .page-heading-row { align-items: stretch; flex-direction: column; gap: 18px; }
  .page-copy-button { align-self: flex-start; }
  .page-navigation { gap: 10px; }
  .page-navigation a { min-height: 76px; padding: 12px; }
  .agent-prompt-actions { align-items: stretch; flex-direction: column; }
  .agent-harnesses { justify-content: center; }
  .agent-prompt-actions button { justify-content: center; }
}

@media (max-width: 520px) {
  .docs-search-results a { gap: 12px; }
  .docs-search-results em { display: none; }
}
