:root {
  color-scheme: light;
  --docs-bg: #f7f9fb;
  --docs-surface: #ffffff;
  --docs-text: #1f2933;
  --docs-muted: #667085;
  --docs-border: #d8e0ea;
  --docs-accent: #1d6f68;
  --docs-accent-strong: #155e57;
  --docs-code-bg: #111827;
  --docs-code-text: #f8fafc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--docs-bg);
  color: var(--docs-text);
  font-family: var(--font-sans, Geist, Inter, system-ui, sans-serif);
}

a { color: var(--docs-accent); text-decoration: none; }
a:hover { color: var(--docs-accent-strong); }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--docs-border);
  background: rgba(247, 249, 251, 0.94);
  backdrop-filter: blur(18px);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1440px, 100%);
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-nav__logo,
.site-nav__links,
.site-nav__actions {
  display: flex;
  align-items: center;
}

.site-nav__logo {
  gap: 10px;
  color: var(--docs-text);
  font-weight: 700;
}

.site-nav__logo-mark {
  width: 28px;
  height: 28px;
}

.site-nav__links {
  gap: 18px;
  font-size: 14px;
}

.site-nav__links a {
  color: var(--docs-muted);
  font-weight: 600;
}

.site-nav__links a.is-active {
  color: var(--docs-text);
}

.site-nav__spacer { flex: 1; }
.site-nav__actions { gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  font-weight: 700;
}

.btn-primary {
  border-color: var(--docs-accent);
  background: var(--docs-accent);
  color: #fff;
}

.btn-primary:hover { color: #fff; background: var(--docs-accent-strong); }
.btn-ghost { color: var(--docs-text); background: transparent; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 14px; }

.docs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 240px;
  gap: 36px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.docs-sidebar,
.docs-toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.docs-sidebar {
  padding-right: 12px;
  border-right: 1px solid var(--docs-border);
}

.docs-sidebar__group {
  margin: 18px 0 8px;
  color: var(--docs-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.docs-sidebar__group:first-child { margin-top: 0; }

.docs-sidebar__link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--docs-text);
  font-size: 14px;
  line-height: 1.35;
}

.docs-sidebar__link:hover,
.docs-sidebar__link.is-active {
  background: #e8f2ef;
  color: var(--docs-text);
}

.docs-content {
  min-width: 0;
  max-width: 880px;
}

.doc-article,
.docs-home {
  max-width: 860px;
}

.doc-kicker {
  margin: 0 0 10px;
  color: var(--docs-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.doc-article h1,
.docs-home h1 {
  margin: 0 0 18px;
  color: var(--docs-text);
  font-size: 44px;
  line-height: 1.05;
}

.doc-article h2 {
  margin: 44px 0 14px;
  padding-top: 8px;
  font-size: 26px;
  line-height: 1.2;
}

.doc-article h3 {
  margin: 28px 0 10px;
  font-size: 20px;
}

.doc-article h1 a,
.doc-article h2 a,
.doc-article h3 a {
  color: inherit;
}

.doc-article p,
.doc-article li {
  color: var(--docs-text);
  font-size: 16px;
  line-height: 1.72;
}

.doc-article p { margin: 0 0 18px; }
.doc-article ul,
.doc-article ol { padding-left: 22px; margin: 0 0 22px; }
.doc-article li + li { margin-top: 8px; }

.doc-article code {
  padding: 2px 5px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #eef3f7;
  font-family: var(--font-mono, "SFMono-Regular", Consolas, monospace);
  font-size: 0.92em;
}

.code-block {
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: var(--docs-code-bg);
}

.code-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #374151;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.code-block__copy {
  border: 1px solid #4b5563;
  border-radius: 6px;
  background: #1f2937;
  color: #f8fafc;
  cursor: pointer;
  font: inherit;
  padding: 4px 9px;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: var(--docs-code-text);
  font-size: 14px;
  line-height: 1.6;
}

.code-block code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.table-wrap {
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  background: var(--docs-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--docs-border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.55;
}

th {
  background: #edf3f7;
  font-weight: 800;
}

tr:last-child td { border-bottom: 0; }

.callout {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid #b7dcd7;
  border-left: 4px solid var(--docs-accent);
  border-radius: 8px;
  background: #eaf6f4;
}

.callout--warning {
  border-color: #f1c27d;
  border-left-color: #d97706;
  background: #fff7ed;
}

.callout__label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.callout p:last-child { margin-bottom: 0; }

.doc-link--disabled {
  color: var(--docs-muted);
  text-decoration: line-through;
}

.docs-toc {
  padding-left: 4px;
}

.docs-toc__label {
  margin-bottom: 12px;
  color: var(--docs-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.docs-toc__link,
.docs-toc__empty {
  display: block;
  margin: 0 0 8px;
  color: var(--docs-muted);
  font-size: 13px;
  line-height: 1.45;
}

.docs-toc__link--h3 { padding-left: 12px; }

.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--docs-border);
}

.chapter-nav__item {
  display: block;
  padding: 16px;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  background: var(--docs-surface);
  color: var(--docs-text);
}

.chapter-nav__item--next { text-align: right; }
.chapter-nav__item span { display: block; color: var(--docs-muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.chapter-nav__item strong { display: block; margin-top: 6px; }

.docs-home__intro {
  max-width: 760px;
  color: var(--docs-muted);
  font-size: 18px;
  line-height: 1.6;
}

.docs-home__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 42px;
}

.docs-home-card {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  background: var(--docs-surface);
  color: var(--docs-text);
}

.docs-home-card span {
  display: block;
  margin-bottom: 14px;
  color: var(--docs-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.docs-home-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
}

.docs-home__group {
  margin-top: 34px;
}

.docs-home__group h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.docs-home__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.docs-home__list a {
  padding: 12px 14px;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  background: var(--docs-surface);
  color: var(--docs-text);
  font-weight: 650;
}

blockquote {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--docs-border);
  background: #eef3f7;
}

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

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

@media (max-width: 760px) {
  .site-nav__inner {
    min-height: 58px;
    padding: 0 16px;
  }
  .site-nav__links,
  .site-nav__actions .btn-ghost {
    display: none;
  }
  .docs-layout {
    display: block;
    padding: 20px 16px 56px;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 24px;
    padding: 0 0 18px;
    border-right: 0;
    border-bottom: 1px solid var(--docs-border);
  }
  .docs-sidebar__link {
    display: inline-flex;
    margin: 0 6px 8px 0;
    border: 1px solid var(--docs-border);
    background: var(--docs-surface);
  }
  .doc-article h1,
  .docs-home h1 {
    font-size: 34px;
  }
  .docs-home__cards,
  .docs-home__list,
  .chapter-nav {
    grid-template-columns: 1fr;
  }
}
