:root {
  color-scheme: dark;
  --docs-bg: #141414;
  --docs-bg-grid: rgba(255, 255, 255, 0.035);
  --docs-panel: rgba(31, 32, 33, 0.96);
  --docs-panel-strong: #242526;
  --docs-ink: #f4efe4;
  --docs-muted: #a8a29a;
  --docs-rule: rgba(244, 239, 228, 0.16);
  --docs-rule-strong: rgba(244, 239, 228, 0.32);
  --docs-accent: #e0a628;
  --docs-accent-ink: #15120d;
  --docs-blue: #7fb0ff;
  --docs-red: #ff725f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  color: var(--docs-ink);
  background:
    linear-gradient(90deg, var(--docs-bg-grid) 1px, transparent 1px),
    linear-gradient(var(--docs-bg-grid) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(224, 166, 40, 0.10), transparent 34rem),
    var(--docs-bg);
  background-size: 18px 18px, 18px 18px, auto, auto;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3rem;
  border-bottom: 1px solid var(--docs-rule-strong);
  padding: 0.45rem 0.8rem;
  background: rgba(20, 20, 20, 0.94);
  backdrop-filter: blur(18px);
}

.docs-brand,
.docs-topbar a {
  color: var(--docs-ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.docs-topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.docs-topbar nav a {
  border: 1px solid var(--docs-rule);
  padding: 0.35rem 0.55rem;
  color: var(--docs-muted);
}

.docs-topbar a:hover,
.docs-topbar nav a:hover {
  border-color: var(--docs-accent);
  color: var(--docs-accent);
}

.docs-shell {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr) minmax(12rem, 16rem);
  gap: 0.75rem;
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 0.75rem;
}

.docs-sidebar,
.docs-toc {
  position: sticky;
  top: 3.75rem;
  align-self: start;
  max-height: calc(100vh - 4.5rem);
  overflow: auto;
  border: 1px solid var(--docs-rule);
  background: rgba(24, 25, 26, 0.88);
}

.docs-sidebar { padding: 0.6rem; }
.docs-toc { padding: 0.7rem; }

.docs-sidebar-section + .docs-sidebar-section {
  margin-top: 0.85rem;
  border-top: 1px solid var(--docs-rule);
  padding-top: 0.75rem;
}

.docs-sidebar h2,
.docs-toc h2 {
  margin: 0 0 0.45rem;
  color: var(--docs-accent);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-sidebar ol,
.docs-toc ol {
  display: grid;
  gap: 0.12rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-sidebar a,
.docs-toc a {
  display: block;
  border-left: 2px solid transparent;
  padding: 0.28rem 0.4rem;
  color: var(--docs-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-decoration: none;
}

.docs-sidebar a:hover,
.docs-toc a:hover {
  border-color: var(--docs-accent);
  color: var(--docs-ink);
  background: rgba(224, 166, 40, 0.10);
}

.docs-sidebar a.active {
  border-color: var(--docs-accent);
  color: var(--docs-accent-ink);
  background: var(--docs-accent);
  font-weight: 900;
}

.docs-toc p {
  margin: 0;
  color: var(--docs-muted);
  font-size: 0.78rem;
}

.docs-toc .toc-level-3 { padding-left: 0.75rem; }

.docs-article {
  min-width: 0;
  border: 1px solid var(--docs-rule-strong);
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--docs-panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.docs-breadcrumbs {
  margin-bottom: 1rem;
  color: var(--docs-muted);
  font-size: 0.78rem;
}

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

.docs-article h1 {
  margin: 0 0 1.2rem;
  border-bottom: 1px solid var(--docs-rule-strong);
  padding-bottom: 0.8rem;
  color: var(--docs-ink);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.07em;
}

.docs-article h2 {
  margin: 2.2rem 0 0.7rem;
  border-top: 1px solid var(--docs-rule);
  padding-top: 0.8rem;
  color: var(--docs-accent);
  font-size: 1.12rem;
}

.docs-article h3 {
  margin: 1.5rem 0 0.45rem;
  color: var(--docs-blue);
  font-size: 0.98rem;
}

.docs-article h4,
.docs-article h5,
.docs-article h6 {
  color: var(--docs-ink);
}

.docs-article p,
.docs-article li,
.docs-article td,
.docs-article th {
  font-size: 0.93rem;
  line-height: 1.65;
}

.docs-article p,
.docs-article ul,
.docs-article ol,
.docs-article table,
.docs-article pre,
.docs-article blockquote { margin: 0.85rem 0; }

.docs-article img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.docs-article a {
  color: var(--docs-blue);
  font-weight: 800;
  text-underline-offset: 0.15rem;
}

.docs-article code {
  border: 1px solid var(--docs-rule);
  padding: 0.05rem 0.22rem;
  color: #ffd37a;
  background: rgba(224, 166, 40, 0.11);
}

.docs-article pre {
  overflow: auto;
  border: 1px solid var(--docs-rule-strong);
  padding: 0.85rem;
  background: #0f1011;
}

.docs-article pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.docs-article .hljs-comment,
.docs-article .hljs-quote { color: #8f9b87; font-style: italic; }
.docs-article .hljs-keyword,
.docs-article .hljs-selector-tag,
.docs-article .hljs-name { color: #ff8f7d; }
.docs-article .hljs-string,
.docs-article .hljs-attr { color: #a9d18e; }
.docs-article .hljs-number,
.docs-article .hljs-literal { color: #d6a8ff; }
.docs-article .hljs-symbol,
.docs-article .hljs-bullet { color: #ffd37a; }
.docs-article .hljs-title,
.docs-article .hljs-built_in { color: #7fb0ff; font-weight: 800; }
.docs-article .hljs-meta { color: #e0a628; }

.docs-article table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  width: 100%;
}

.docs-article th,
.docs-article td {
  border: 1px solid var(--docs-rule);
  padding: 0.45rem 0.55rem;
  vertical-align: top;
}

.docs-article th {
  color: var(--docs-accent-ink);
  background: var(--docs-accent);
  text-align: left;
}

.docs-article blockquote {
  border-left: 3px solid var(--docs-red);
  padding: 0.3rem 0.8rem;
  color: var(--docs-muted);
  background: rgba(255, 114, 95, 0.08);
}

.docs-article .mermaid {
  overflow: auto;
  border-color: var(--docs-accent);
  background: #f4efe4;
  color: #15120d;
}

.docs-article .mermaid svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.docs-article .mermaid .edgePath path {
  stroke-width: 2.5px !important;
}

.docs-article .mermaid .marker {
  fill: #315f9c !important;
  stroke: #315f9c !important;
}

.docs-article .mermaid .nodeLabel {
  font-size: 16px;
  font-weight: 700;
}

.docs-page--internal .docs-brand::after {
  content: "  unlisted";
  margin-left: 0.5rem;
  color: var(--docs-accent);
  font-size: 0.68rem;
}

@media (max-width: 1120px) {
  .docs-shell { grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 760px) {
  .docs-topbar { position: static; align-items: flex-start; flex-direction: column; }
  body { overflow-x: hidden; }
  .docs-shell { display: block; width: 100vw; max-width: 100vw; padding: 0.5rem; }
  .docs-sidebar,
  .docs-toc { position: static; max-width: 100%; max-height: none; margin-bottom: 0.6rem; }
  .docs-sidebar { max-height: 18rem; }
  .docs-article {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    overflow: hidden;
    overflow-wrap: anywhere;
    padding: 1rem;
  }
  .docs-article pre,
  .docs-article table,
  .docs-article .mermaid { max-width: 100%; overflow-x: auto; }
  .docs-article h1 {
    max-width: 100%;
    overflow-wrap: break-word;
    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }
}
