:root {
  color-scheme: dark;
  --bg: #030303;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.105);
  --line-soft: rgba(255, 255, 255, 0.065);
  --text: #f4f6f5;
  --muted: #a6adaa;
  --faint: #707773;
  --cyan: #9ae6df;
  --hover-bg: rgba(255, 255, 255, 0.065);
  --nav-group-bg: #101211;
  --nav-item-hover: #181b1a;
  --nav-item-shadow: rgba(0, 0, 0, 0.62);
  --nav-button-text: #f4f6f5;
  --brand-accent: #7c3aed;
  --code-bg: #0d0f0e;
  --code-line: rgba(255, 255, 255, 0.09);
  --syntax-comment: #8b949e;
  --syntax-keyword: #ff7b72;
  --syntax-string: #a5d6ff;
  --syntax-number: #79c0ff;
  --syntax-literal: #79c0ff;
  --syntax-key: #d2a8ff;
  --docs-rail: clamp(270px, 23vw, 350px);
  --docs-gap: clamp(30px, 4vw, 64px);
  --max: 1220px;
  --radius: 8px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: rgba(124, 58, 237, 0.035);
  --panel-strong: rgba(124, 58, 237, 0.065);
  --line: rgba(17, 17, 24, 0.14);
  --line-soft: rgba(17, 17, 24, 0.08);
  --text: #0b0b0f;
  --muted: #4c4658;
  --faint: #756d83;
  --cyan: #006f69;
  --hover-bg: rgba(124, 58, 237, 0.08);
  --nav-group-bg: #ffffff;
  --nav-item-hover: #f4f0ff;
  --nav-item-shadow: rgba(76, 29, 149, 0.18);
  --nav-button-text: #0c100e;
  --brand-accent: #7c3aed;
  --code-bg: #faf8ff;
  --code-line: rgba(0, 0, 0, 0.09);
  --syntax-comment: #6e7781;
  --syntax-keyword: #cf222e;
  --syntax-string: #0a3069;
  --syntax-number: #0550ae;
  --syntax-literal: #0550ae;
  --syntax-key: #8250df;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: auto;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

.docs-page .site-nav {
  position: fixed;
  left: 0;
  right: 0;
}

.docs-shell {
  padding-top: 62px;
}

.docs-page.nav-compact .docs-sidebar {
  top: 48px;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 120ms;
  animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  animation-name: none;
}

::view-transition-new(root) {
  animation-name: theme-reveal;
  clip-path: inset(0 100% 0 0);
}

@keyframes theme-reveal {
  to {
    clip-path: inset(0 0 0 0);
  }
}

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

.docs-wrap {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.95;
}

.lead {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.docs-layout.docs-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: var(--docs-rail) minmax(0, 1fr);
  justify-content: start;
  gap: var(--docs-gap);
  box-sizing: border-box;
  padding: 34px clamp(24px, 5vw, 78px) 84px 0;
}

.docs-sidebar {
  position: fixed;
  top: 62px;
  bottom: 0;
  left: 0;
  z-index: 12;
  width: var(--docs-rail);
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--line-soft);
  padding: 18px 14px 26px 20px;
  background: var(--bg);
  scrollbar-width: thin;
}

.sidebar-head {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  text-transform: uppercase;
}

.docs-tree {
  display: grid;
  gap: 4px;
}

.doc-group {
  display: grid;
  gap: 4px;
}

.group-label {
  margin: 16px 10px 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.doc-file {
  border-radius: var(--radius);
  background: transparent;
}

.doc-file[open] {
  background: transparent;
}

.doc-file summary {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 40px;
  padding: 8px 10px 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  min-width: 0;
}

.doc-file summary::-webkit-details-marker {
  display: none;
}

.doc-file summary:hover,
.doc-file summary:focus-visible,
.doc-file.is-active summary {
  color: var(--text);
  background: transparent;
  outline: none;
}

.doc-title {
  display: block;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--code-line);
  border-radius: 6px;
  padding: 4px 7px;
  background: var(--code-bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.doc-file summary:hover .doc-title,
.doc-file summary:focus-visible .doc-title {
  border-color: var(--line);
  background: var(--hover-bg);
}

.doc-file.is-active .doc-title {
  border-color: transparent;
  background: color-mix(in srgb, var(--brand-accent) 28%, var(--code-bg));
  box-shadow: none;
  color: var(--text);
}

.doc-path {
  color: var(--faint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.doc-section-list {
  display: grid;
  gap: 1px;
  margin: 4px 0 12px 18px;
  border-left: 1px solid var(--line-soft);
  padding: 2px 0 2px 10px;
}

.doc-section-list a {
  display: flex;
  align-items: flex-start;
  position: relative;
  min-height: 26px;
  border-radius: 5px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: color 140ms ease, background 140ms ease;
}

.doc-section-list a::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 8px;
  width: 3px;
  height: 10px;
  border-radius: 999px;
  background: transparent;
  transition: background 140ms ease, height 140ms ease;
}

.doc-section-list a:hover,
.doc-section-list a:focus-visible {
  color: var(--text);
  background: transparent;
  outline: none;
}

.doc-section-list a:hover::before,
.doc-section-list a:focus-visible::before {
  background: var(--line);
}

.doc-section-list a.is-active {
  color: var(--text);
  background: transparent;
  font-weight: 650;
}

.doc-section-list a.is-active::before {
  height: 16px;
  background: var(--brand-accent);
}

.doc-section-list a[data-depth="3"] {
  padding-left: 16px;
  color: var(--faint);
}

.doc-section-list a[data-depth="4"] {
  padding-left: 26px;
  color: var(--faint);
}

.doc-content {
  grid-column: 2;
  min-width: 0;
  max-width: 900px;
  padding-top: 4px;
}

.doc-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--faint);
  font-size: 12px;
}

.doc-source a {
  color: var(--brand-accent);
}

.doc-source a:hover,
.doc-source a:focus-visible {
  color: var(--text);
  outline: none;
}

.markdown {
  max-width: 880px;
}

.markdown h1 {
  margin-bottom: 18px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.98;
}

.markdown h2,
.markdown h3,
.markdown h4 {
  scroll-margin-top: 86px;
}

.markdown h2 {
  margin: 44px 0 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 28px;
  font-size: 28px;
  line-height: 1.15;
}

.markdown h1 + h2 {
  margin-top: 30px;
}

.markdown h3 {
  margin: 30px 0 10px;
  font-size: 19px;
  line-height: 1.25;
}

.markdown h4 {
  margin: 24px 0 8px;
  color: var(--muted);
  font-size: 15px;
}

.markdown p,
.markdown li {
  color: var(--muted);
}

.markdown p {
  margin-bottom: 16px;
}

.markdown ul,
.markdown ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.markdown li + li {
  margin-top: 7px;
}

.markdown code {
  border: 1px solid var(--code-line);
  border-radius: 5px;
  padding: 0.12em 0.34em;
  background: var(--code-bg);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.markdown pre {
  overflow: auto;
  margin: 18px 0 22px;
  border: 1px solid var(--code-line);
  border-radius: var(--radius);
  background: var(--code-bg);
  padding: 15px;
}

.markdown pre code {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.syntax-comment {
  color: var(--syntax-comment);
}

.syntax-keyword {
  color: var(--syntax-keyword);
}

.syntax-string {
  color: var(--syntax-string);
}

.syntax-number {
  color: var(--syntax-number);
}

.syntax-literal {
  color: var(--syntax-literal);
}

.syntax-key {
  color: var(--syntax-key);
}

.markdown table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 18px 0 24px;
  border-collapse: collapse;
  font-size: 13px;
}

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

.markdown th {
  color: var(--text);
  background: var(--panel-strong);
  font-weight: 760;
}

.markdown td {
  color: var(--muted);
}

.markdown hr {
  height: 1px;
  margin: 28px 0;
  border: 0;
  background: var(--line-soft);
}

.markdown a {
  color: var(--brand-accent);
  font-weight: 650;
}

.markdown a:hover,
.markdown a:focus-visible {
  color: var(--text);
  outline: none;
}

.doc-loading,
.doc-error,
.empty-state {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: var(--panel);
}

.doc-skeleton {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 118px);
  padding: 0;
  border: 0;
  background: transparent;
}

.skeleton-line,
.skeleton-block,
.sidebar-skeleton span {
  display: block;
  overflow: hidden;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-strong) 45%, var(--panel) 90%);
  background-size: 220% 100%;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skeleton-line {
  width: min(100%, 760px);
  height: 14px;
}

.skeleton-source {
  width: 260px;
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-title {
  width: min(86%, 620px);
  height: 52px;
  margin-bottom: 10px;
}

.skeleton-wide {
  width: min(92%, 820px);
}

.skeleton-heading {
  width: min(52%, 420px);
  height: 28px;
  margin-top: 24px;
}

.skeleton-block {
  width: min(100%, 860px);
  height: 180px;
  margin: 10px 0;
}

.sidebar-skeleton {
  display: grid;
  gap: 10px;
}

.sidebar-skeleton span {
  height: 34px;
}

.sidebar-skeleton span:nth-child(2),
.sidebar-skeleton span:nth-child(5) {
  width: 82%;
}

.sidebar-skeleton span:nth-child(3),
.sidebar-skeleton span:nth-child(6),
.sidebar-skeleton span:nth-child(8) {
  width: 68%;
}

@keyframes skeleton-pulse {
  0% {
    background-position: 140% 0;
  }

  100% {
    background-position: -80% 0;
  }
}

@media (max-width: 980px) {
  .docs-layout.docs-wrap {
    width: min(100% - 32px, var(--max));
    margin: 0 auto;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 34px 0 84px;
  }

  .docs-sidebar {
    position: static;
    z-index: auto;
    width: auto;
    height: auto;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 0 0 18px;
    background: transparent;
  }

  .doc-content {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  .docs-wrap {
    width: min(100% - 24px, var(--max));
  }

  .lead {
    font-size: 16px;
  }

  .docs-layout.docs-wrap {
    gap: 22px;
    padding: 24px 0 64px;
  }

  .docs-sidebar {
    max-height: 34vh;
  }

  .doc-content {
    padding-top: 0;
  }

  .doc-source {
    max-width: 100%;
    flex-wrap: wrap;
    margin-bottom: 18px;
    overflow-wrap: anywhere;
  }

  .markdown h1 {
    font-size: 36px;
  }

  .markdown h2 {
    margin-top: 34px;
    padding-top: 22px;
    font-size: 24px;
  }

  .markdown pre {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .docs-wrap {
    width: min(100% - 20px, var(--max));
  }

  .docs-layout.docs-wrap {
    padding-top: 20px;
  }

  .doc-title {
    font-size: 11px;
  }

  .markdown h1 {
    font-size: 32px;
  }
}
