:root {
  color-scheme: light;
  --page: #f7f9fc;
  --surface: #ffffff;
  --text: #18212f;
  --muted: #687386;
  --line: #dfe5ed;
  --accent: #2457d6;
  --accent-soft: #edf2ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 55%);
  outline-offset: 4px;
  border-radius: 4px;
}

.empty-page {
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--surface);
}

.site-footer {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer a {
  font-size: 0.95rem;
  color: inherit;
}

.docs-page {
  background: var(--page);
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0.75rem max(1rem, env(safe-area-inset-left));
  color: var(--surface);
  background: #18212f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.docs-topbar a {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.docs-topbar span {
  color: #b9c3d1;
  font-size: 0.9rem;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 860px);
  gap: 2rem;
  justify-content: center;
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

.docs-toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.docs-toc strong {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.docs-toc ul {
  margin: 0;
  padding-left: 1.1rem;
}

.docs-toc li {
  margin: 0.35rem 0;
}

.docs-toc ul ul {
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.docs-toc a {
  color: #465267;
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--accent);
}

.docs-content {
  min-width: 0;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(31, 43, 61, 0.06);
}

.docs-content > h1:not(:first-child) {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 2px solid var(--line);
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  scroll-margin-top: 88px;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 6vw, 3.15rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-top: 2.7rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  margin-top: 2rem;
  font-size: 1.25rem;
}

p,
ul,
ol,
blockquote,
table,
pre {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

li + li {
  margin-top: 0.35rem;
}

code {
  padding: 0.12rem 0.35rem;
  background: var(--accent-soft);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  color: #f5f7fb;
  background: #18212f;
  border-radius: 10px;
}

pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

blockquote {
  margin-left: 0;
  padding: 0.75rem 1rem;
  color: #465267;
  background: #f5f7fa;
  border-left: 4px solid #9aabc2;
}

.table-wrap,
.docs-content table {
  max-width: 100%;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-spacing: 0;
  border-collapse: collapse;
}

th,
td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}

th {
  background: #f2f5f9;
}

@media (max-width: 800px) {
  .docs-topbar span {
    display: none;
  }

  .docs-layout {
    display: block;
    padding: 1rem 0.75rem 3rem;
  }

  .docs-toc {
    position: static;
    max-height: none;
    margin-bottom: 1rem;
  }

  .docs-toc ul ul {
    display: none;
  }

  .docs-content {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
