:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --surface-3: #e8ebf1;
  --text: #0c1426;
  --muted: #647087;
  --muted-strong: #46536a;
  --line: #dce2ec;
  --line-strong: #c9d1de;
  --primary: #b68a2d;
  --primary-strong: #8c661c;
  --primary-soft: #fff4d7;
  --success: #118a4e;
  --success-soft: #e6f8ed;
  --danger: #d43c49;
  --danger-soft: #ffebed;
  --info: #315da8;
  --info-soft: #edf4ff;
  --code: #090b0f;
  --code-text: #e9edf5;
  --shadow: 0 16px 42px rgba(12, 20, 38, 0.09);
  --radius: 8px;
  --header-height: 66px;
  --content-width: 1500px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090a0c;
  --surface: #111318;
  --surface-2: #181b21;
  --surface-3: #20242c;
  --text: #f5f7fb;
  --muted: #9ba5b7;
  --muted-strong: #c2c8d3;
  --line: #292e37;
  --line-strong: #3a414d;
  --primary: #d0aa58;
  --primary-strong: #f0cc78;
  --primary-soft: rgba(208, 170, 88, 0.14);
  --success: #49d17d;
  --success-soft: rgba(73, 209, 125, 0.12);
  --danger: #ff6974;
  --danger-soft: rgba(255, 105, 116, 0.12);
  --info: #83aaf0;
  --info-soft: rgba(91, 142, 231, 0.13);
  --code: #030405;
  --code-text: #edf1f8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 28px);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input { font: inherit; letter-spacing: 0; }
button { border: 0; }
img, svg { display: block; }
strong { font-weight: 760; }
code, pre, kbd { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

::selection { background: var(--primary); color: #fff; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -70px;
  z-index: 500;
  padding: 9px 13px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font-weight: 750;
}

.skip-link:focus { top: 12px; }

.docs-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(15px) saturate(140%);
}

.docs-header-inner {
  width: min(var(--content-width), calc(100% - 40px));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 18px;
  font-weight: 850;
}

.docs-brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #050505;
  color: #fff;
}

.docs-brand-mark img { width: 21px; height: 21px; }
.docs-brand small { color: var(--primary); font-size: 10px; font-weight: 800; }

.docs-header-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.docs-header-title { color: var(--muted-strong); font-size: 13px; font-weight: 700; }

.docs-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-link,
.header-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 730;
}

.header-link:hover,
.header-button:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.header-link.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.header-button { width: 38px; padding: 0; }
.header-button svg, .header-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon { display: none; }
:root[data-theme="dark"] .sun-icon { display: none; }
:root[data-theme="dark"] .moon-icon { display: block; }
.mobile-nav-button { display: none; }

.docs-layout {
  width: min(var(--content-width), calc(100% - 40px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 220px;
  gap: 42px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 24px 10px 32px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.sidebar-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 14px;
}

.sidebar-head strong { font-size: 15px; }

.docs-search-wrap { position: relative; margin-bottom: 22px; }

.docs-search {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.docs-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.docs-search-wrap > svg { position: absolute; left: 12px; top: 13px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search-shortcut { position: absolute; right: 10px; top: 9px; min-width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-2); font-size: 11px; }

.search-results {
  position: absolute;
  z-index: 20;
  top: 48px;
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-results[hidden] { display: none; }
.search-result { width: 100%; display: block; padding: 9px 10px; border-radius: 6px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus { background: var(--surface-2); outline: none; }
.search-result strong { display: block; font-size: 12px; }
.search-result span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { padding: 13px 10px; color: var(--muted); font-size: 12px; }

.nav-group { margin: 0 0 18px; }
.nav-group-title { display: block; padding: 0 10px 6px; color: var(--muted); font-size: 10px; font-weight: 820; text-transform: uppercase; }
.docs-nav a {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted-strong);
  font-size: 12.5px;
  font-weight: 620;
}
.docs-nav a:hover { color: var(--text); background: var(--surface-2); }
.docs-nav a.active { border-left-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.docs-nav a svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-meta { padding: 14px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.sidebar-meta strong { display: block; color: var(--text); font-size: 12px; }

.docs-main {
  min-width: 0;
  max-width: 900px;
  padding: 54px 0 100px;
}

.docs-hero {
  position: relative;
  padding: 0 0 42px;
  border-bottom: 1px solid var(--line);
}

.docs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}
.docs-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.docs-hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: 62px;
  line-height: 1.02;
  font-weight: 900;
}

.docs-hero > p { max-width: 720px; margin: 18px 0 0; color: var(--muted-strong); font-size: 17px; line-height: 1.7; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}
.hero-meta span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted-strong); font-size: 11px; font-weight: 700; }

.quick-start {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.quick-start a { min-width: 0; padding: 14px; border-right: 1px solid var(--line); }
.quick-start a:last-child { border-right: 0; }
.quick-start a:hover { background: var(--surface-2); }
.quick-start small { display: block; color: var(--primary); font-size: 10px; font-weight: 800; }
.quick-start strong { display: block; margin-top: 3px; font-size: 12px; }

.doc-section {
  padding: 52px 0 0;
}
.doc-section + .doc-section { margin-top: 18px; }
.section-label { color: var(--primary-strong); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.doc-section h2 { margin: 4px 0 13px; font-size: 30px; line-height: 1.2; font-weight: 860; }
.doc-section > p:first-of-type { max-width: 760px; color: var(--muted-strong); }
.doc-section h3 { margin: 36px 0 10px; padding-top: 4px; font-size: 21px; line-height: 1.3; font-weight: 810; }
.doc-section h4 { margin: 24px 0 8px; font-size: 15px; line-height: 1.4; font-weight: 800; }
.doc-section p { margin: 0 0 14px; }
.doc-section a:not(.button-link) { color: var(--primary-strong); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc-section ul, .doc-section ol { margin: 10px 0 18px; padding-left: 22px; }
.doc-section li { margin: 5px 0; }
.doc-section li::marker { color: var(--primary); font-weight: 800; }

.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.doc-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.doc-card svg { width: 21px; height: 21px; margin-bottom: 12px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-card h3, .doc-card h4 { margin: 0 0 6px; padding: 0; font-size: 14px; }
.doc-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.58; }

.callout {
  position: relative;
  margin: 20px 0;
  padding: 16px 18px 16px 48px;
  border: 1px solid color-mix(in srgb, var(--info) 36%, var(--line));
  border-radius: 8px;
  background: var(--info-soft);
}
.callout.warning { border-color: color-mix(in srgb, var(--primary) 42%, var(--line)); background: var(--primary-soft); }
.callout.danger { border-color: color-mix(in srgb, var(--danger) 36%, var(--line)); background: var(--danger-soft); }
.callout.success { border-color: color-mix(in srgb, var(--success) 34%, var(--line)); background: var(--success-soft); }
.callout-icon { position: absolute; left: 17px; top: 18px; width: 18px; height: 18px; fill: none; stroke: var(--info); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.callout.warning .callout-icon { stroke: var(--primary-strong); }
.callout.danger .callout-icon { stroke: var(--danger); }
.callout.success .callout-icon { stroke: var(--success); }
.callout strong { display: block; margin-bottom: 3px; font-size: 13px; }
.callout p, .callout ul { margin: 0; color: var(--muted-strong); font-size: 12.5px; }
.callout ul { padding-left: 18px; }

.table-wrap { width: 100%; margin: 18px 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-2); color: var(--muted-strong); font-size: 10px; font-weight: 820; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td code { color: var(--primary-strong); font-size: 11.5px; }

.code-block { position: relative; margin: 16px 0 22px; border: 1px solid #262b35; border-radius: 8px; overflow: hidden; background: var(--code); }
.code-label { min-height: 34px; display: flex; align-items: center; padding: 0 12px; border-bottom: 1px solid #262b35; color: #8f99aa; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.code-block pre { margin: 0; padding: 17px 54px 17px 17px; overflow-x: auto; color: var(--code-text); font-size: 12px; line-height: 1.65; tab-size: 2; }
.copy-code { position: absolute; top: 42px; right: 9px; width: 34px; height: 32px; display: grid; place-items: center; border: 1px solid #343a46; border-radius: 6px; background: #151920; color: #aeb7c7; cursor: pointer; }
.copy-code:hover { color: #fff; border-color: #596171; }
.copy-code svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.copy-code.copied { color: #62e391; border-color: #347d50; }

.steps { counter-reset: doc-step; margin: 20px 0; }
.step { position: relative; min-height: 56px; padding: 0 0 24px 50px; }
.step:last-child { padding-bottom: 0; }
.step::before { counter-increment: doc-step; content: counter(doc-step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--primary); border-radius: 50%; background: var(--surface); color: var(--primary-strong); font-size: 11px; font-weight: 850; }
.step::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
.step:last-child::after { display: none; }
.step h3, .step h4 { margin: 0 0 4px; padding: 0; font-size: 14px; }
.step p { margin: 0; color: var(--muted-strong); font-size: 13px; }

.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 16px 0 24px; padding: 0; list-style: none; }
.feature-list li { position: relative; margin: 0; padding: 9px 0 9px 23px; border-bottom: 1px solid var(--line); }
.feature-list li::before { content: ""; position: absolute; left: 1px; top: 17px; width: 8px; height: 4px; border-left: 2px solid var(--success); border-bottom: 2px solid var(--success); transform: rotate(-45deg); }

.architecture {
  display: grid;
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
  align-items: stretch;
  margin: 20px 0;
}
.architecture-node { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.architecture-node small { color: var(--primary); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.architecture-node strong { display: block; margin-top: 4px; font-size: 13px; }
.architecture-node span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.architecture-arrow { display: grid; place-items: center; color: var(--primary); font-weight: 850; }

.status-list { margin: 14px 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.status-list > ul { margin: 0; padding: 0; list-style: none; }
.status-list li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; margin: 0; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.status-list li:last-child { border-bottom: 0; }
.status-list strong { font-size: 12px; }
.status-list span { color: var(--muted-strong); font-size: 12px; }

.troubleshooting { margin-top: 18px; border-top: 1px solid var(--line); }
.troubleshooting details { border-bottom: 1px solid var(--line); }
.troubleshooting summary { position: relative; padding: 16px 38px 16px 0; cursor: pointer; list-style: none; font-size: 13px; font-weight: 760; }
.troubleshooting summary::-webkit-details-marker { display: none; }
.troubleshooting summary::after { content: "+"; position: absolute; right: 8px; top: 12px; color: var(--primary); font-size: 22px; font-weight: 400; }
.troubleshooting details[open] summary::after { content: "-"; }
.troubleshooting .answer { padding: 0 30px 16px 0; color: var(--muted-strong); font-size: 13px; }
.troubleshooting .answer p:last-child, .troubleshooting .answer ul:last-child { margin-bottom: 0; }

.checklist { margin: 16px 0; padding: 0; list-style: none; }
.checklist li { position: relative; margin: 0; padding: 10px 12px 10px 38px; border-bottom: 1px solid var(--line); }
.checklist li::before { content: ""; position: absolute; left: 11px; top: 13px; width: 15px; height: 15px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); }

.docs-right-rail { position: sticky; top: calc(var(--header-height) + 26px); padding-top: 26px; }
.rail-title { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 820; text-transform: uppercase; }
.on-page a { display: block; padding: 5px 0 5px 11px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.45; }
.on-page a:hover, .on-page a.active { border-left-color: var(--primary); color: var(--primary-strong); }
.rail-card { margin-top: 24px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.rail-card strong { display: block; font-size: 12px; }
.rail-card p { margin: 5px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.rail-card a { color: var(--primary-strong); font-size: 11px; font-weight: 760; }

.docs-footer { margin-top: 64px; padding: 26px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.docs-footer-inner { display: flex; justify-content: space-between; gap: 20px; }
.docs-footer nav { display: flex; gap: 14px; }
.docs-footer a:hover { color: var(--text); }

.nav-backdrop { display: none; position: fixed; inset: 0; z-index: 129; background: rgba(0, 0, 0, 0.55); }
.back-to-top { position: fixed; right: 18px; bottom: 18px; z-index: 80; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 150ms ease, transform 150ms ease; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

@media (max-width: 1180px) {
  .docs-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 34px; }
  .docs-right-rail { display: none; }
  .docs-main { max-width: none; }
}

@media (max-width: 820px) {
  :root { --header-height: 60px; }
  .docs-header-inner, .docs-layout { width: min(calc(100% - 28px), var(--content-width)); }
  .docs-header-title, .docs-header-divider, .header-link.hide-mobile { display: none; }
  .header-link.primary { display: none; }
  .mobile-nav-button { display: inline-flex; }
  .docs-layout { display: block; }
  .docs-sidebar { position: fixed; z-index: 130; top: 0; left: 0; width: min(330px, calc(100% - 42px)); height: 100dvh; padding: 18px 14px 28px; border-right: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transform: translateX(-105%); transition: transform 180ms ease; }
  body.nav-open .docs-sidebar { transform: translateX(0); }
  body.nav-open .nav-backdrop { display: block; }
  .sidebar-head { display: flex; }
  .docs-main { padding-top: 36px; }
  .docs-hero h1 { font-size: 40px; }
  .docs-hero > p { font-size: 15px; }
  .quick-start { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-start a:nth-child(2) { border-right: 0; }
  .quick-start a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .doc-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .architecture { grid-template-columns: 1fr; gap: 8px; }
  .architecture-arrow { min-height: 18px; transform: rotate(90deg); }
}

@media (max-width: 560px) {
  .docs-header-inner, .docs-layout { width: calc(100% - 24px); }
  .docs-brand { font-size: 16px; }
  .docs-brand-mark { width: 34px; height: 34px; }
  .docs-brand small { display: none; }
  .header-link { width: 38px; padding: 0; }
  .header-link span { display: none; }
  .docs-main { padding-bottom: 64px; }
  .docs-hero { padding-bottom: 34px; }
  .docs-hero h1 { font-size: 34px; }
  .hero-meta { gap: 6px; }
  .hero-meta span { font-size: 10px; }
  .doc-section { padding-top: 42px; }
  .doc-section h2 { font-size: 25px; }
  .doc-section h3 { font-size: 19px; }
  .doc-grid, .doc-grid.three, .feature-list { grid-template-columns: 1fr; }
  .callout { padding-left: 44px; }
  .status-list li { grid-template-columns: 1fr; gap: 2px; }
  .quick-start a { padding: 12px; }
  .docs-footer-inner { display: block; }
  .docs-footer nav { margin-top: 10px; flex-wrap: wrap; }
  .back-to-top { right: 12px; bottom: 12px; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f5f5f5; --text: #000; --muted: #444; --muted-strong: #222; --line: #ccc; }
  body { font-size: 11pt; }
  .docs-header, .docs-sidebar, .docs-right-rail, .back-to-top, .copy-code, .nav-backdrop { display: none !important; }
  .docs-layout { display: block; width: 100%; }
  .docs-main { max-width: none; padding: 0; }
  .doc-section { break-inside: avoid; }
  .code-block { break-inside: avoid; }
  a { text-decoration: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
