:root {
  --docs-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --docs-body: color-mix(in srgb, var(--text) 80%, var(--bg));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { min-width: 320px; margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; top: -60px; left: 16px; z-index: 10; padding: 10px 14px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.skip-link:focus { top: 12px; }

.docs-site-header { position: sticky; top: 14px; z-index: 5; display: flex; width: min(1240px, calc(100% - 32px)); height: 56px; align-items: center; justify-content: space-between; margin: 14px auto 0; padding: 0 8px 0 22px; border: 1px solid var(--line); border-radius: 999px; background: var(--header-bg); box-shadow: 0 12px 40px -14px rgba(20, 30, 60, .28), inset 0 1px 0 rgba(255, 255, 255, .3); backdrop-filter: blur(18px) saturate(1.5); }
.docs-lockup img { display: block; width: 100px; height: auto; }
.docs-header-nav { display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.docs-header-nav > a { padding: 8px 14px; border-radius: 999px; transition: background .18s ease, color .18s ease; }
.docs-header-nav > a:hover { background: var(--hover); color: var(--text); }
.docs-header-nav > .docs-github { margin: 0 8px 0 6px; padding: 8px 16px; background: var(--text); color: var(--bg); }
.docs-header-nav > .docs-github:hover { background: var(--accent); color: var(--accent-ink); }
.docs-header-nav .docs-github span { opacity: .7; }
.docs-header-nav .theme-toggle { width: 38px; height: 38px; border-color: transparent; background: var(--hover); }

.docs-layout { display: grid; grid-template-columns: 225px minmax(0, 1fr) 200px; gap: clamp(28px, 4vw, 56px); max-width: 1320px; min-height: calc(100vh - 160px); margin: 0 auto; padding: 50px 28px 96px; }
.docs-sidebar { position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 130px); overflow-y: auto; padding: 8px 0 24px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sidebar-label { margin: 20px 0 8px; padding-left: 12px; color: var(--dim); font: 500 10px var(--docs-mono); letter-spacing: .14em; text-transform: uppercase; }
.sidebar-label:first-child { margin-top: 0; }
.docs-sidebar a { display: block; margin: 2px 0; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.docs-sidebar a:hover { background: var(--hover); color: var(--text); }
.docs-sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.docs-main { min-width: 0; max-width: 760px; }
.breadcrumbs { margin: 4px 0 20px; color: var(--dim); font: 11px var(--docs-mono); letter-spacing: .04em; }
.breadcrumbs a { color: var(--muted); }
.docs-main h1 { margin: 0 0 16px; font-size: clamp(38px, 5.8vw, 56px); font-weight: 650; letter-spacing: -.06em; line-height: 1.05; }
.docs-main .lead { max-width: 640px; margin: 0 0 32px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.docs-main h2 { margin: 56px 0 16px; padding-top: 6px; font-size: 25px; font-weight: 640; letter-spacing: -.035em; line-height: 1.25; scroll-margin-top: 100px; }
.docs-main h3 { margin: 28px 0 10px; font-size: 17px; font-weight: 620; letter-spacing: -.02em; }
.docs-main p, .docs-main li { color: var(--docs-body); font-size: 15px; line-height: 1.75; }
.docs-main p { margin: 0 0 18px; }
.docs-main ul, .docs-main ol { margin: 12px 0 24px; padding-left: 22px; }
.docs-main li { margin: 7px 0; padding-left: 3px; }
.docs-main li::marker { color: var(--accent-text); }
.docs-main strong { color: var(--text); font-weight: 620; }
.docs-main a:not(.doc-card):not(.button) { color: var(--accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-text) 35%, transparent); text-underline-offset: 3px; }
.docs-main a:hover { text-decoration-color: var(--accent-text); }
.docs-main code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--hover); color: var(--text); font: .88em var(--docs-mono); overflow-wrap: anywhere; }
.docs-main pre { overflow-x: auto; margin: 20px 0 26px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--code-bg); color: var(--code-text); font: 12.5px/1.8 var(--docs-mono); tab-size: 2; }
.docs-main pre code { padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; }
.doc-callout { margin: 26px 0; padding: 18px 21px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-left: 3px solid var(--accent); border-radius: 14px; background: linear-gradient(120deg, var(--accent-soft), var(--surface)); }
.doc-callout p:last-child { margin-bottom: 0; }
.doc-callout.warning { border-color: color-mix(in srgb, var(--violet) 40%, transparent); border-left-color: var(--violet); background: linear-gradient(120deg, var(--violet-soft), var(--surface)); }
.doc-callout strong { display: block; margin-bottom: 5px; }
.doc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 28px 0 32px; }
.doc-card { display: block; min-height: 140px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); transition: border-color .18s ease, transform .18s ease; }
.doc-card:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text); }
.doc-card .card-kicker { display: block; margin-bottom: 16px; color: var(--accent-text); font: 500 10px var(--docs-mono); letter-spacing: .12em; text-transform: uppercase; }
.doc-card strong { display: block; margin-bottom: 8px; font-size: 16px; }
.doc-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.doc-search-wrap { position: relative; margin: 26px 0 34px; }
.doc-search-label { display: block; margin: 0 0 9px; color: var(--dim); font: 500 10px var(--docs-mono); letter-spacing: .13em; text-transform: uppercase; }
.doc-search { width: 100%; min-height: 52px; padding: 0 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.doc-search::placeholder { color: var(--dim); }
.doc-search-results { position: absolute; top: calc(100% + 8px); right: 0; left: 0; z-index: 4; display: none; max-height: 320px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.doc-search-results[data-open="true"] { display: block; }
.doc-search-results a { display: block; padding: 12px 13px; border-radius: 8px; text-decoration: none !important; }
.doc-search-results a:hover, .doc-search-results a[aria-selected="true"] { background: var(--accent-soft); }
.doc-search-results strong { display: block; margin-bottom: 3px; font-size: 13px; }
.doc-search-results small { display: block; color: var(--muted); font-size: 11px; }
.doc-search-empty { padding: 14px; color: var(--muted); font-size: 13px; }
.doc-table-wrap { overflow-x: auto; margin: 20px 0 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.docs-main table { width: 100%; border-collapse: collapse; text-align: left; }
.docs-main th, .docs-main td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--docs-body); font-size: 13px; line-height: 1.65; vertical-align: top; }
.docs-main th { background: var(--hover); color: var(--text); font-weight: 600; }
.docs-main tr:last-child td { border-bottom: 0; }
.doc-pagination { display: flex; justify-content: space-between; gap: 14px; margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--line); }
.doc-pagination a { max-width: 48%; text-decoration: none !important; }
.doc-pagination span { display: block; margin-bottom: 5px; color: var(--dim); font: 10px var(--docs-mono); text-transform: uppercase; }
.doc-pagination strong { font-size: 13px; }


/* on this page */
.docs-toc { position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 130px); overflow-y: auto; padding: 8px 0 24px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.docs-toc p { margin: 0 0 12px; color: var(--dim); font: 500 10px var(--docs-mono); letter-spacing: .14em; text-transform: uppercase; }
.docs-toc a { display: block; margin: 0; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.4; transition: color .15s ease, border-color .15s ease; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.is-active { border-left-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.docs-main h2, .docs-main h3 { position: relative; }
.docs-main h2 .anchor, .docs-main h3 .anchor { position: absolute; left: -22px; top: 50%; margin-top: -9px; color: var(--dim); font-size: 15px; font-weight: 400; opacity: 0; text-decoration: none !important; transition: opacity .15s ease; }
.docs-main h2:hover .anchor, .docs-main h3:hover .anchor, .docs-main .anchor:focus { opacity: 1; }

/* code blocks */
.docs-main pre { position: relative; }
.docs-main pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 10px; right: 64px; color: #71829b; font: 500 10px var(--docs-mono); letter-spacing: .1em; text-transform: uppercase; }
.copy-btn { position: absolute; top: 8px; right: 10px; padding: 4px 10px; border: 1px solid rgba(130, 150, 182, .3); border-radius: 8px; background: rgba(255, 255, 255, .05); color: #9aa9bf; font: 500 11px var(--docs-mono); cursor: pointer; opacity: 0; transition: opacity .15s ease, color .15s ease, border-color .15s ease; }
.docs-main pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: #fff; border-color: var(--accent); }
.copy-btn.is-done { opacity: 1; color: #35c6a3; border-color: #35c6a3; }
@media (hover: none) { .copy-btn { opacity: 1; } }
.docs-main li > pre { margin: 12px 0 8px; }
.docs-main td code, .docs-main th code { white-space: normal; }
.docs-main td, .docs-main th { min-width: 90px; }
.doc-pagination a.next { margin-left: auto; text-align: right; }
.doc-pagination { align-items: stretch; }
.doc-pagination a { padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .18s ease, transform .18s ease; }
.doc-pagination a:hover { border-color: var(--accent); transform: translateY(-2px); }

@media (max-width: 1180px) {
  .docs-layout { grid-template-columns: 225px minmax(0, 1fr); }
  .docs-toc { display: none; }
  .docs-main { max-width: 800px; }
}

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 35px; }
  .docs-sidebar a { padding: 7px 9px; font-size: 12px; }
}
@media (max-width: 650px) {
  .docs-site-header { top: 8px; width: calc(100% - 20px); height: 52px; margin-top: 8px; padding: 0 6px 0 16px; }
  .docs-lockup img { width: 88px; }
  .docs-header-nav { gap: 0; }
  .docs-header-nav > a { padding: 8px 10px; }
  .docs-header-nav > .docs-github { padding: 8px 12px; }
  .docs-header-nav a:nth-child(1) { display: none; }
  .docs-layout { display: block; padding: 22px 19px 70px; }
  .docs-sidebar { position: static; display: flex; max-height: none; gap: 5px; overflow-x: auto; margin: 0 -19px 30px; padding: 7px 19px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .sidebar-label { display: none; }
  .docs-sidebar a { flex: 0 0 auto; margin: 0; padding: 9px 12px; border: 1px solid transparent; }
  .docs-sidebar a[aria-current="page"] { border-color: var(--line); }
  .breadcrumbs { margin-top: 0; }
  .docs-main h1 { font-size: 40px; }
  .docs-main .lead { font-size: 15px; }
  .docs-main h2 { margin-top: 42px; font-size: 22px; }
  .doc-cards { grid-template-columns: 1fr; }
  .doc-card { min-height: 120px; }
  .docs-footer { align-items: flex-start; flex-direction: column; padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* 404 */
.docs-404 { max-width: 760px; margin: 0 auto; padding: 72px 28px 40px; }
.docs-404 h1 { margin: 0 0 16px; font-size: clamp(38px, 6vw, 56px); font-weight: 650; letter-spacing: -.06em; line-height: 1.05; }
.docs-404 .lead { max-width: 560px; margin: 0 0 28px; color: var(--muted); font-size: 17px; line-height: 1.7; }
