:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-strong: #f1f4f9;
  --ink: #121826;
  --muted: #647084;
  --line: #dbe2ec;
  --line-soft: #e8edf4;
  --accent: #276ef1;
  --accent-ink: #0d47b8;
  --success: #087f5b;
  --warning: #b76e00;
  --danger: #b42318;
  --code-bg: #111827;
  --code-bar: #0b1220;
  --shadow: 0 18px 45px rgba(18, 24, 38, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(39, 110, 241, 0.06), rgba(255, 255, 255, 0) 260px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid rgba(39, 110, 241, 0.38);
  outline-offset: 3px;
}

code,
kbd,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--accent-ink);
  background: white;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 260px minmax(220px, 520px) 1fr auto;
  gap: 18px;
  align-items: center;
  height: 66px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(219, 226, 236, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, #0b1220, #276ef1);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.search-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px 0 14px;
  color: var(--muted);
  background: #fbfcfe;
  box-shadow: 0 1px 0 rgba(18, 24, 38, 0.03);
  cursor: pointer;
}

.search-trigger kbd,
.search-box-row button {
  border: 1px solid var(--line);
  border-bottom-color: #c5cedb;
  border-radius: 6px;
  padding: 1px 7px;
  color: #475569;
  background: white;
  font-size: 12px;
}

.top-links {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.top-links a:hover,
.side-nav a:hover,
.toc a:hover {
  color: var(--accent);
}

.mobile-search-button,
.menu-button {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 252px;
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 26px 28px 56px;
}

.sidebar {
  position: sticky;
  top: 92px;
  height: calc(100vh - 112px);
  overflow: auto;
  padding-right: 6px;
}

.sidebar-head {
  display: none;
}

.version-strip {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}

.version-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: white;
  font-size: 12px;
  font-weight: 650;
}

.version-pill.active {
  color: var(--accent-ink);
  border-color: rgba(39, 110, 241, 0.32);
  background: rgba(39, 110, 241, 0.08);
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group h2,
.toc-card h2 {
  margin: 0 0 9px;
  color: #7a8699;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-nav a {
  display: block;
  border-radius: var(--radius);
  padding: 7px 10px;
  color: #445167;
  font-size: 14px;
  line-height: 1.35;
}

.side-nav a.active {
  color: var(--accent-ink);
  background: rgba(39, 110, 241, 0.09);
  font-weight: 700;
}

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

.doc-frame {
  min-height: 75vh;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 34px 44px 28px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 2px rgba(18, 24, 38, 0.04);
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a {
  color: var(--accent-ink);
}

.crumb-separator {
  color: #a6b0bf;
}

.doc-content {
  max-width: 830px;
}

.doc-content h1 {
  margin: 0 0 14px;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: 0;
}

.doc-content h2 {
  margin: 42px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

.doc-content h3 {
  margin: 28px 0 10px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
}

.doc-content h4 {
  margin: 22px 0 8px;
  font-size: 15px;
}

.heading-anchor {
  margin-left: 8px;
  color: #b3bdca;
  opacity: 0;
  font-size: 0.8em;
}

.doc-content h2:hover .heading-anchor,
.doc-content h3:hover .heading-anchor,
.doc-content h4:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.doc-content p,
.doc-content ul,
.doc-content ol {
  color: #334155;
}

.doc-content a {
  color: var(--accent-ink);
  font-weight: 650;
}

.doc-content code {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 1px 5px;
  color: #0f3d91;
  background: #f4f7fb;
  font-size: 0.92em;
}

.doc-content ul,
.doc-content ol {
  padding-left: 22px;
}

.doc-content li {
  margin: 5px 0;
}

.callout {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  margin: 22px 0;
  border: 1px solid rgba(39, 110, 241, 0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: #233049;
  background: rgba(39, 110, 241, 0.06);
}

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

.callout.warning {
  border-color: rgba(183, 110, 0, 0.26);
  background: rgba(183, 110, 0, 0.07);
}

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

.callout.danger {
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.07);
}

.callout.danger strong {
  color: var(--danger);
}

.code-block {
  overflow: hidden;
  margin: 22px 0;
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 12px 0 14px;
  color: #aeb9ca;
  background: var(--code-bar);
  font-size: 12px;
}

.code-bar button {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  padding: 4px 8px;
  color: #d7deea;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.code-block pre {
  overflow: auto;
  margin: 0;
  padding: 18px;
  color: #e8eef8;
  font-size: 13px;
  line-height: 1.7;
}

.code-block code {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
}

.doc-table-wrap {
  overflow: auto;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

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

th {
  color: #233049;
  background: #f6f8fb;
  font-size: 13px;
}

blockquote {
  margin: 20px 0;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 16px;
  color: #4b5870;
}

.source-note {
  margin-top: 34px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.pager-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: white;
}

.pager-link span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pager-link strong {
  display: block;
  margin-top: 2px;
  color: #1f2937;
}

.pager-link.next {
  text-align: right;
}

.toc {
  position: sticky;
  top: 92px;
  height: max-content;
}

.toc-card {
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.toc nav {
  display: grid;
  gap: 7px;
}

.toc a,
.toc-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.toc a.active {
  color: var(--accent-ink);
  font-weight: 700;
}

.toc-level-3 {
  padding-left: 12px;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding-top: 84px;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(6px);
}

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

.search-panel {
  width: min(720px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.search-box-row {
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px;
}

.search-box-row:focus-within {
  box-shadow: inset 0 -2px 0 rgba(39, 110, 241, 0.36);
}

.search-status {
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.search-box-row input {
  width: 100%;
  border: 0;
  outline: none;
  font: inherit;
}

.search-results {
  max-height: 430px;
  overflow: auto;
  padding: 8px;
}

.search-result {
  display: grid;
  gap: 2px;
  border-radius: var(--radius);
  padding: 10px 12px;
}

.search-result:hover {
  background: #f5f8fc;
}

.search-result span {
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.search-result small {
  color: var(--muted);
}

.search-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto auto;
    height: auto;
    min-height: 62px;
    padding: 12px 16px;
  }

  .search-trigger,
  .top-links {
    display: none;
  }

  .mobile-search-button,
  .menu-button {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 7px 10px;
    color: #243044;
    background: white;
  }

  .layout {
    display: block;
    padding: 18px 14px 40px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: min(320px, calc(100vw - 42px));
    height: 100vh;
    transform: translateX(-105%);
    padding: 16px;
    background: white;
    box-shadow: var(--shadow);
    transition: transform 160ms ease;
  }

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

  .sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }

  .sidebar-head span {
    font-weight: 750;
  }

  .sidebar-head button {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 5px 8px;
    background: white;
  }

  .doc-frame {
    padding: 24px 18px;
  }

  .doc-content h1 {
    font-size: 32px;
  }

  .doc-content h2 {
    font-size: 22px;
  }

  .callout {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .pager {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
