:root {
  --bg: #050607;
  --surface: #0d0f12;
  --surface2: #14171c;
  --surface3: #191d24;
  --text: #f6f8fb;
  --muted: #aab3c2;
  --muted2: #7f8898;
  --border: rgba(255,255,255,0.09);
  --border2: rgba(255,255,255,0.14);
  --accent: #35d96b;
  --accent2: #93c5fd;
  --gold: #fbbf24;
  --shadow: 0 24px 80px rgba(0,0,0,0.38);
  --sidebar: 292px;
  --toc: 260px;
}

:root[data-theme="light"] {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface2: #f0f3f8;
  --surface3: #e9edf5;
  --text: #10151f;
  --muted: #526071;
  --muted2: #6b7585;
  --border: rgba(15,23,42,0.1);
  --border2: rgba(15,23,42,0.16);
  --shadow: 0 24px 70px rgba(15,23,42,0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(53,217,107,0.45) rgba(255,255,255,0.05);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(53,217,107,0.72), rgba(147,197,253,0.54));
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(53,217,107,0.9), rgba(147,197,253,0.72));
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: inherit; }

.docs-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.docs-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(53,217,107,0.04), transparent 220px), var(--surface);
  padding: 22px 18px;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 26px;
}

.docs-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.docs-nav-section {
  margin: 18px 0 20px;
}

.docs-nav-title {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--muted2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.docs-nav-link iconify-icon {
  color: var(--muted2);
  font-size: 16px;
}

.docs-nav-link:hover,
.docs-nav-link.is-active {
  background: rgba(53,217,107,0.08);
  color: var(--text);
}

.docs-nav-link.is-active iconify-icon { color: var(--accent); }

.docs-main { min-width: 0; }

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.docs-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(620px, 100%);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.docs-search iconify-icon { font-size: 18px; }

.docs-search span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

kbd {
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 2px 7px;
  background: var(--surface2);
  color: var(--muted2);
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(53,217,107,0.28);
  border-radius: 8px;
  background: rgba(53,217,107,0.11);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-btn iconify-icon { font-size: 18px; }

.mobile-menu { display: none; }

.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px) var(--toc);
  justify-content: center;
  gap: 56px;
  padding: 54px 36px 90px;
}

.docs-content {
  min-width: 0;
  outline: none;
}

.docs-article-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-content h1,
.docs-content h2,
.docs-content h3 {
  letter-spacing: 0;
  line-height: 1.18;
}

.docs-content h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  font-weight: 850;
}

.docs-content h2 {
  margin: 46px 0 14px;
  padding-top: 6px;
  font-size: 1.7rem;
}

.docs-content h3 {
  margin: 28px 0 10px;
  font-size: 1.12rem;
}

.docs-content p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}

.docs-content strong { color: var(--text); }

.docs-content ul,
.docs-content ol {
  margin: 0 0 22px;
  padding-left: 22px;
  color: var(--muted);
}

.docs-content li { margin: 8px 0; }

.docs-content blockquote {
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid rgba(53,217,107,0.22);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(53,217,107,0.07);
  color: var(--text);
}

.docs-content blockquote p { margin: 0; color: var(--text); }

.docs-content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface2);
  color: var(--accent2);
  font-family: "Roboto Mono", monospace;
  font-size: 0.9em;
}

.copy-block {
  position: relative;
  margin: 22px 0;
}

.copy-block pre,
.docs-content pre {
  overflow-x: visible;
  margin: 22px 0;
  padding: 46px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #090b0f;
}

.copy-block pre {
  margin: 0;
}

:root[data-theme="light"] .docs-content pre { background: #101827; }

.docs-content pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: #dbeafe;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

.copy-block-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(147,197,253,0.24);
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  color: #dbeafe;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.copy-block-btn:hover,
.copy-block-btn.is-copied {
  border-color: rgba(53,217,107,0.38);
  background: rgba(53,217,107,0.14);
  color: var(--text);
}

.copy-block-btn iconify-icon {
  font-size: 14px;
}

.docs-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 34px 0;
}

.powered-by-badge-preview {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  margin: 2px 0 16px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  background: #11141a;
  color: #aab3c2 !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.powered-by-badge-preview img {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  object-fit: cover;
}

.powered-by-badge-preview:hover {
  border-color: rgba(53,217,107,0.35);
  color: var(--text) !important;
}

.docs-content a {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 700;
}

.docs-content a:hover { text-decoration: underline; }

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 30px;
}

.doc-card {
  display: flex;
  gap: 13px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.doc-card:hover {
  border-color: rgba(53,217,107,0.32);
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
}

.doc-card iconify-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(53,217,107,0.1);
  color: var(--accent);
  font-size: 20px;
  flex: 0 0 auto;
}

.doc-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 14px;
}

.doc-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.docs-footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.footer-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.footer-card span {
  color: var(--muted2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-card strong { font-size: 14px; }

.footer-card.next { text-align: right; }

.docs-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.toc-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.toc-link {
  display: block;
  padding: 5px 0;
  color: var(--muted2);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.45;
}

.toc-link:hover { color: var(--text); }
.toc-link.is-h3 { padding-left: 12px; }

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: 80px 18px;
  background: rgba(0,0,0,0.62);
}

.search-modal.is-open { display: block; }

.search-panel {
  width: min(720px, 100%);
  margin: 0 auto;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-input-wrap {
  display: grid;
  grid-template-columns: 22px 1fr 38px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrap iconify-icon { color: var(--muted2); }

.search-input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

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

.search-result {
  display: block;
  padding: 13px 14px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.search-result:hover,
.search-result.is-active { background: var(--surface2); }

.search-result strong {
  display: block;
  font-size: 14px;
}

.search-result span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

@media (max-width: 1120px) {
  .docs-layout {
    grid-template-columns: minmax(0, 820px);
    gap: 0;
  }

  .docs-toc { display: none; }
}

@media (max-width: 860px) {
  .docs-shell { display: block; }

  .docs-sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  body.nav-open .docs-sidebar { transform: translateX(0); }

  .docs-topbar {
    grid-template-columns: 38px 1fr auto;
    padding: 12px 14px;
  }

  .mobile-menu { display: inline-grid; }
  .topbar-link { display: none; }
  .docs-search kbd { display: none; }
  .docs-layout { padding: 36px 18px 70px; }
  .doc-card-grid { grid-template-columns: 1fr; }
  .docs-footer-nav { grid-template-columns: 1fr; }
  .footer-card.next { text-align: left; }
}
