/* Shared docs shell: one header, sidebar, mobile menu, theme, and search surface. */
:root {
  color-scheme: light;
  --bg: #fff;
  --panel: #f8f8fa;
  --panel2: #f1f1f4;
  --soft: #f8f8fa;
  --ink: #171717;
  --muted: #65666b;
  --line: #e7e7e7;
  --accent: #6554d9;
  --purple: #6554d9;
  --cyan: #008f80;
  --docs-shell-header-height: 62px;
  --docs-shell-mobile-header-height: 56px;
  --docs-shell-sidebar-width: 288px;
  --docs-shell-sidebar-gutter: 12px;
  --docs-shell-menu-row-height: 50px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318;
  --panel: #181b22;
  --panel2: #222631;
  --soft: #181b22;
  --ink: #eff1f6;
  --muted: #a5abba;
  --line: #2b303a;
  --accent: #aaa1ff;
  --purple: #aaa1ff;
  --cyan: #18d5c1;
}
@media (max-width: 560px) { :root { --docs-shell-header-height: var(--docs-shell-mobile-header-height); } }
html, body { background: var(--bg); color: var(--ink); }
body.docs-shell-page { min-height: 100vh; margin: 0; }
.docs-brand { display: inline-flex; align-items: center; min-width: 0; text-decoration: none; }
.docs-brand img { display: block; width: auto; height: 27px; max-width: min(190px, 40vw); object-fit: contain; }
.docs-shell-header {
  box-sizing: border-box; position: sticky; inset-block-start: 0; z-index: 100;
  display: flex; align-items: center; gap: 20px; width: 100%; height: var(--docs-shell-header-height);
  min-height: var(--docs-shell-header-height); padding-inline: clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.docs-shell-header .docs-brand img { width: auto; height: 27px; max-width: min(190px, 40vw); object-fit: contain; }
html[data-theme="dark"] .docs-shell-header .docs-brand img { content: url('/assets/brand/web/logo-full-color-on-dark.png'); }
.docs-shell-nav { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 30px); margin-inline-start: auto; }
.nav-label-compact { display: none; }
.docs-shell-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.docs-shell-nav a:hover, .docs-shell-nav a[aria-current="page"] { color: var(--purple); }
.theme-switch {
  box-sizing: border-box; width: 46px; height: 26px; min-height: 26px; padding: 2px;
  display: flex; align-items: center; flex: none; border: 1px solid var(--line); border-radius: 999px;
  background: var(--soft); cursor: pointer; transition: background .18s;
}
.theme-switch-thumb { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); color: var(--muted); box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .18s, background .18s, color .18s; }
.theme-switch[aria-checked="true"] { background: var(--accent); }
.theme-switch[aria-checked="true"] .theme-switch-thumb { transform: translateX(20px); background: #fff; color: #45405e; }
.theme-switch svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-moon { display: none; }
.theme-switch[aria-checked="true"] .theme-sun { display: none; }
.theme-switch[aria-checked="true"] .theme-moon { display: block; }
.docs-shell-layout { display: grid; grid-template-columns: var(--docs-shell-sidebar-width) minmax(0, 1fr); min-height: calc(100dvh - var(--docs-shell-header-height)); }
.docs-shell-sidebar {
  box-sizing: border-box; position: sticky; inset-block-start: var(--docs-shell-header-height); z-index: 30;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: var(--docs-shell-sidebar-width);
  height: calc(100dvh - var(--docs-shell-header-height)); min-height: 0; overflow: hidden;
  border-right: 1px solid var(--line); background: var(--bg);
  font: 400 14px/20px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.docs-sidebar-search { position: sticky; top: 0; z-index: 2; padding: var(--docs-shell-sidebar-gutter) var(--docs-shell-sidebar-gutter) 0; background: var(--bg); }
.docs-search-trigger {
  box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; min-height: 32px;
  padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--muted);
  font: 400 14px/16px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-align: left; cursor: pointer;
}
.docs-search-trigger:disabled { opacity: .6; cursor: wait; }
.docs-search-trigger svg { width: 16px; height: 16px; flex: none; }
.docs-search-trigger kbd { margin-inline-start: auto; padding: 2px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font: 500 11px/14px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.docs-side-scroll { box-sizing: border-box; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px; scrollbar-gutter: stable; }
.docs-side-scroll details { margin: 0; }
.docs-side-scroll summary, .docs-side-link {
  box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 8px;
  border: 0; border-radius: 4px; background: transparent; color: var(--muted);
  font: 400 14px/16px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left; text-decoration: none; cursor: pointer; list-style: none;
}
.docs-side-scroll summary { justify-content: space-between; }
.docs-side-scroll summary::-webkit-details-marker { display: none; }
.docs-side-scroll summary::after { content: ""; width: 7px; height: 7px; margin-inline-end: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .16s; }
.docs-side-scroll details[open] > summary::after { transform: rotate(225deg); }
.docs-side-scroll summary:hover, .docs-side-scroll summary:focus-visible, .docs-side-link:hover { background: var(--panel2); color: var(--ink); }
.docs-side-link[aria-current="location"] { background: var(--panel2); color: var(--purple); }
.docs-side-children { display: grid; gap: 1px; margin: 0 8px 0 16px; padding: 0; border-left: 1px solid var(--line); }
.docs-side-children .docs-side-link { min-height: 32px; padding: 8px 8px 8px 11px; font-weight: 400; }
.docs-side-link.docs-operation-link { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: start; gap: 4px 7px; padding: 7px 8px; line-height: 18px; }
.docs-operation-link > svg { grid-row: span 2; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.docs-op-title { min-width: 0; color: inherit; font-size: 13px; line-height: 17px; }
.docs-op-meta { grid-column: 2; min-width: 0; overflow-wrap: anywhere; color: var(--muted); font: 11px/15px ui-monospace, SFMono-Regular, Menlo, monospace; }
.docs-sidebar-footer { position: sticky; bottom: 0; z-index: 2; padding: 12px 12px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.docs-sidebar-action { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-weight: 650; text-decoration: none; }
.docs-sidebar-action svg { width: 18px; height: 18px; flex: none; stroke: currentColor; stroke-width: 1.7; fill: none; }
.docs-sidebar-action span:last-child { margin-inline-start: auto; color: var(--muted); }
.docs-sidebar-footer p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.docs-shell-main { min-width: 0; }
.agent-guide-shell .docs-shell-main { width: 100%; max-width: 1000px; margin: 0 auto; }
.api-docs-shell .docs-shell-main { width: 100%; max-width: none; margin: 0; }
#api-reference-root { min-width: 0; min-height: calc(100vh - var(--docs-shell-header-height)); }
.api-docs-shell .scalar-api-reference { --scalar-custom-header-height: var(--docs-shell-header-height); display: block !important; min-height: calc(100dvh - var(--docs-shell-header-height)); }
.api-docs-shell .scalar-api-reference .t-doc__sidebar, .api-docs-shell .scalar-api-reference .t-doc__header { display: none !important; }
.api-docs-shell .scalar-api-reference .references-layout { display: block !important; min-height: inherit; }
.api-docs-shell .scalar-api-reference .references-rendered { grid-area: auto; min-width: 0; }
.docs-menu-row { display: none; }
.docs-shell-menu-toggle { display: none; box-sizing: border-box; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.docs-shell-menu-toggle svg { width: 18px; height: 18px; }
.docs-shell-menu-toggle .menu-close-icon { display: none; }
.docs-search-overlay[hidden] { display: none; }
.docs-search-overlay { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 15svh 20px 20px; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.docs-search-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.22); }
.docs-search-dialog { position: relative; display: flex; flex-direction: column; box-sizing: border-box; width: min(600px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 40px)); max-height: min(680px, calc(100dvh - 40px)); overflow: hidden; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); box-shadow: 0 28px 90px rgba(0,0,0,.5); }
.docs-search-field { box-sizing: border-box; display: flex; align-items: center; gap: 9px; width: 100%; height: 40px; min-height: 40px; padding: 0 6px 0 12px; color: var(--muted); }
.docs-search-field svg { width: 16px; height: 16px; flex: none; }
.docs-search-dialog #docsSearchQuery { box-sizing: border-box; width: 100%; height: 24px; min-height: 24px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 16px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.docs-search-dialog #docsSearchResults { display: grid; flex: 1 1 auto; gap: 0; min-height: 0; max-height: 550px; margin: 0; padding: 0 4px 4px; overflow: auto; }
.docs-search-result { box-sizing: border-box; display: grid; grid-template-columns: 16px minmax(0,1fr); align-items: start; gap: 7px; padding: 7px 8px; border-radius: 4px; color: var(--ink); text-decoration: none; }
.docs-search-result:hover, .docs-search-result:focus-visible { background: var(--panel2); outline: none; }
.docs-search-result-icon { display: grid; place-items: center; width: 16px; height: 20px; color: var(--muted); font-size: 18px; font-weight: 500; }
.docs-search-result-copy { display: grid; gap: 2px; min-width: 0; }
.docs-search-result-title { color: var(--ink); font-size: 14px; line-height: 20px; font-weight: 500; }
.docs-search-result small { display: block; color: var(--muted); font-size: 12px; line-height: 18px; }
.docs-search-results > p, #docsSearchResults > p { display: flex; align-items: center; justify-content: center; margin: 0; padding: 20px 12px; color: var(--muted); font-size: 14px; text-align: center; }
.docs-search-footer { display: flex; flex: none; gap: 12px; margin: 0 -28px -28px; padding: 6px 12px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 600; }
.docs-shell-page :focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.docs-brand { view-transition-name: none; }
.api-docs-shell .light-mode { --scalar-color-accent: #6554d9; --scalar-background-1: #fff; --scalar-background-2: #f8f8fa; --scalar-background-3: #f1f1f4; }
.api-docs-shell .light-mode .sidebar { --scalar-sidebar-background-1: #fff; --scalar-sidebar-item-hover-background: #f3f2fb; --scalar-sidebar-item-active-background: #f0effa; --scalar-sidebar-search-background: #f7f7f9; --scalar-sidebar-search-border-color: #e6e5eb; }
.api-docs-shell .dark-mode { --scalar-color-accent: #aaa1ff; --scalar-background-1: #111318; --scalar-background-2: #181b22; --scalar-background-3: #222631; --scalar-color-1: #eff1f6; --scalar-color-2: #a5abba; }
.api-docs-shell .dark-mode .sidebar { --scalar-sidebar-background-1: #111318; --scalar-sidebar-item-hover-background: #1d2029; --scalar-sidebar-item-active-background: #25213e; --scalar-sidebar-search-background: #181b22; --scalar-sidebar-search-border-color: #2b303a; }
@media (max-width: 1000px) {
  .docs-shell-layout { display: block; min-height: calc(100dvh - var(--docs-shell-header-height) - var(--docs-shell-menu-row-height)); }
  .docs-shell-menu-row { box-sizing: border-box; position: sticky; inset-block-start: var(--docs-shell-header-height); z-index: 80; display: flex; align-items: center; gap: 12px; width: 100%; height: var(--docs-shell-menu-row-height); padding-inline: 12px; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 500 16px/1.25 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
  .docs-shell-menu-toggle { display: grid; flex: none; }
  body.menu-open .docs-shell-menu-row { position: fixed; inset-block-start: var(--docs-shell-header-height); inset-inline: 0; }
  body.menu-open .docs-shell-menu-toggle .menu-open-icon { display: none; }
  body.menu-open .docs-shell-menu-toggle .menu-close-icon { display: block; }
  body.menu-open .docs-shell-menu-toggle { color: var(--purple); }
  .docs-shell-sidebar { display: none; position: fixed; inset-block-start: calc(var(--docs-shell-header-height) + var(--docs-shell-menu-row-height)); inset-inline: 0; bottom: 0; z-index: 70; width: 100vw; height: calc(100dvh - var(--docs-shell-header-height) - var(--docs-shell-menu-row-height)); max-height: none; border: 0; box-shadow: none; }
  body.menu-open .docs-shell-sidebar { display: grid; }
  body.menu-open { overflow: hidden; }
  .docs-shell-layout { grid-template-columns: minmax(0,1fr); }
  .docs-shell-header { gap: 10px; padding-inline: 14px; }
  .docs-shell-nav { flex: none; gap: 9px; margin-inline-start: auto; }
  .docs-shell-nav .nav-label-wide { display: none; }
  .docs-shell-nav .nav-label-compact { display: inline; }
  .docs-shell-nav a { min-height: 40px; font-size: 12px; }
  .docs-search-overlay { padding: 12svh 16px 20px; }
  .docs-search-dialog { padding: 20px; }
  .docs-search-footer { margin: 0 -20px -20px; }
  .agent-guide-shell .docs-shell-main { max-width: none; }
}
@media (max-width: 680px) { .docs-shell-header .docs-brand img { content: url('/assets/brand/logo-mark-color-on-light.png'); width: 32px; height: 32px; max-width: none; } html[data-theme="dark"] .docs-shell-header .docs-brand img { content: url('/assets/brand/logo-mark-color-on-dark.png'); } }
@media (max-width: 720px) and (max-height: 480px) { .docs-search-overlay { padding-top: 5svh; } }
@media (max-width: 560px) { .docs-search-dialog { max-height: calc(100dvh - 28px); height: calc(100dvh - 28px); padding: 16px; } .docs-search-footer { margin: 0 -16px -16px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
