:root {
  --bg: #f9fafb;
  --panel: #ffffff;
  --panel-muted: #f3f4f6;
  --ink: #111827;
  --ink-soft: #4b5563;
  --ink-faint: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --accent: #ea580c;
  --accent-strong: #c2410c;
  --accent-soft: #fff7ed;
  --note-soft: #eff6ff;
  --tip-soft: #ecfdf5;
  --warning-soft: #fff7ed;
  --important-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 14px 40px rgba(15, 23, 42, 0.05);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
}

body.sidebar-open,
body.search-open {
  overflow: hidden;
}

body.search-open {
  padding-right: var(--scrollbar-width, 0);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.6rem;
  padding: 0 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-faint);
  font-size: 0.72rem;
  white-space: nowrap;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.site-header-inner,
.docs-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 18px;
}

.site-header-start,
.site-header-actions,
.site-brand {
  display: flex;
  align-items: center;
}

.site-header-start,
.site-header-actions {
  gap: 14px;
}

.site-brand {
  gap: 12px;
  color: var(--ink);
}

.site-brand:hover {
  color: var(--ink);
}

.site-brand-logo {
  width: 116px;
  height: auto;
}

.site-brand-copy {
  display: grid;
  gap: 2px;
}

.site-brand-copy strong {
  font-size: 1rem;
  line-height: 1;
}

.site-brand-copy span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.menu-toggle,
.search-trigger,
.header-link,
.sidebar-utility,
.doc-badge,
.search-close,
.code-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
}

.menu-toggle,
.search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle-bar {
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.search-trigger,
.header-link,
.sidebar-utility,
.doc-badge,
.code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.search-trigger,
.header-link {
  text-decoration: none;
}

.search-trigger {
  cursor: pointer;
}

.search-trigger:hover,
.header-link:hover,
.sidebar-utility:hover,
.doc-badge-link:hover,
.search-close:hover,
.code-copy:hover {
  border-color: rgba(234, 88, 12, 0.3);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.docs-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 248px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.sidebar-inner {
  height: 100%;
  overflow-y: auto;
  padding: 24px 16px 32px;
}

.sidebar-overview {
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.sidebar-kicker,
.doc-kicker,
.page-rail-title,
.search-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-copy,
.doc-lead,
.doc-footer p,
.search-foot,
.search-result-summary,
.search-result-meta,
.page-rail-empty,
.prose p,
.prose li,
.prose td,
.prose th,
.prose blockquote {
  color: var(--ink-soft);
}

.sidebar-copy {
  margin: 0 0 16px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.sidebar-utility {
  width: 100%;
  justify-content: center;
  font-weight: 600;
}

.sidebar-section + .sidebar-section {
  margin-top: 6px;
}

.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 10px 10px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-section-toggle:hover {
  background: var(--panel-muted);
}

.sidebar-section-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.sidebar-section-chevron {
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.sidebar-section-toggle[aria-expanded="true"] .sidebar-section-chevron {
  transform: rotate(45deg);
}

.sidebar-section-panel {
  padding: 0 0 10px 14px;
}

.nav-list,
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li + li,
.toc-list li + li {
  margin-top: 4px;
}

.sidebar-link {
  display: block;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.sidebar-link:hover,
.sidebar-link.current {
  color: var(--accent-strong);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.docs-main {
  min-width: 0;
  padding: 40px 56px 64px;
}

.doc-header {
  margin-bottom: 34px;
}

.doc-header h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.doc-lead {
  margin: 16px 0 0;
  max-width: 62ch;
  font-size: 1.05rem;
  line-height: 1.7;
}

.doc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.doc-badge {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.doc-badge:first-child {
  border-color: rgba(234, 88, 12, 0.22);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.doc-content {
  min-width: 0;
}

.doc-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.doc-footer p {
  margin: 0;
  line-height: 1.7;
}

.page-rail {
  position: sticky;
  top: 81px;
  max-height: calc(100vh - 100px);
  padding: 40px 0 48px 28px;
}

.page-rail-inner {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.page-rail-title {
  margin-bottom: 16px;
}

.page-rail-empty {
  margin: 0;
  line-height: 1.5;
  font-size: 0.92rem;
}

.toc-link {
  display: block;
  padding: 6px 0 6px 12px;
  border-left: 2px solid transparent;
  color: var(--ink-faint);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: color 160ms ease, border-color 160ms ease;
}

.toc-link:hover,
.toc-link.is-active {
  color: var(--accent-strong);
  border-left-color: var(--accent);
}

.toc-link-sub {
  padding-left: 22px;
}

.prose {
  color: var(--ink);
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose table,
.prose pre,
.prose blockquote,
.prose .callout {
  margin: 0 0 22px;
}

.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin: 40px 0 14px;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.prose h2 {
  font-size: 1.9rem;
}

.prose h3 {
  font-size: 1.35rem;
}

.prose h4 {
  font-size: 1.1rem;
}

.prose p,
.prose li,
.prose td,
.prose th,
.prose blockquote {
  line-height: 1.75;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 8px;
}

.prose strong {
  color: var(--ink);
}

.prose a {
  text-underline-offset: 0.15em;
}

.prose img {
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
}

.prose thead {
  background: var(--panel-muted);
}

.prose th,
.prose td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose pre {
  position: relative;
  overflow-x: auto;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #111827;
  color: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.prose pre code {
  color: inherit;
  font-size: 0.92rem;
}

.prose :not(pre) > code {
  padding: 0.18em 0.42em;
  border-radius: 6px;
  background: #eef2f7;
  color: #1f2937;
}

.code-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.prose blockquote {
  margin-left: 0;
  padding: 14px 18px;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--panel);
}

.callout {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.callout-title {
  display: inline-flex;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-note {
  border-color: #bfdbfe;
  background: var(--note-soft);
}

.callout-note .callout-title {
  color: #1d4ed8;
}

.callout-tip {
  border-color: #86efac;
  background: var(--tip-soft);
}

.callout-tip .callout-title {
  color: #15803d;
}

.callout-warning {
  border-color: #fdba74;
  background: var(--warning-soft);
}

.callout-warning .callout-title {
  color: var(--accent-strong);
}

.callout-important {
  border-color: #fca5a5;
  background: var(--important-soft);
}

.callout-important .callout-title {
  color: #b91c1c;
}

.sidebar-backdrop,
.search-modal[hidden] {
  display: none;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.search-scrim {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.52);
}

.search-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.18);
}

.search-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.search-head h2 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.1;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-muted);
}

.search-input-icon {
  color: var(--accent);
  font-weight: 700;
}

.search-input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-results {
  display: grid;
  gap: 10px;
  min-height: 120px;
  max-height: 420px;
  overflow-y: auto;
}

.search-empty {
  padding: 18px 4px;
  color: var(--ink-soft);
}

.search-result {
  display: block;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--panel);
}

.search-result:hover,
.search-result.is-active {
  border-color: rgba(234, 88, 12, 0.3);
  background: var(--accent-soft);
}

.search-result-title {
  display: block;
  font-weight: 700;
  color: var(--ink);
}

.search-result-summary,
.search-result-meta {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

.search-result-meta {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
}

@media (max-width: 1240px) {
  .docs-shell {
    grid-template-columns: 272px minmax(0, 1fr);
  }

  .page-rail {
    display: none;
  }
}

@media (max-width: 960px) {
  .site-header-inner,
  .docs-shell {
    width: min(100% - 24px, 1440px);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: fixed;
    top: 65px;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: min(320px, 84vw);
    height: auto;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  body.sidebar-open .docs-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 65px 0 0;
    z-index: 55;
    background: rgba(17, 24, 39, 0.45);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .docs-main {
    padding: 32px 24px 56px;
  }
}

@media (max-width: 720px) {
  .site-header-inner {
    gap: 10px;
  }

  .site-brand-copy span,
  .search-trigger-label,
  .search-trigger kbd {
    display: none;
  }

  .site-brand-logo {
    width: 102px;
  }

  .site-header-actions {
    gap: 10px;
  }

  .search-trigger,
  .header-link {
    min-width: 40px;
    padding: 0 12px;
  }

  .docs-main {
    padding: 26px 8px 44px;
  }

  .doc-header h1 {
    font-size: clamp(2rem, 12vw, 2.6rem);
  }

  .search-panel {
    padding: 18px;
  }

  .search-foot {
    font-size: 0.8rem;
  }
}
