:root {
  --docs-primary: #3b82f6;
  --docs-primary-light: #dbeafe;
  --docs-bg: #ffffff;
  --docs-text: #1e293b;
  --docs-text-muted: #64748b;
  --docs-sidebar-bg: #f8fafc;
  --docs-sidebar-width: 280px;
  --docs-content-max-width: 720px;
  --docs-border: #e2e8f0;
  --docs-font-sans: system-ui, -apple-system, sans-serif;
  --docs-font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  --docs-code-bg: #f1f5f9;
  --docs-topbar-height: 48px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--docs-font-sans);
  color: var(--docs-text);
  background: var(--docs-bg);
  line-height: 1.7;
  font-size: 15px;
}

.docs-layout {
  display: flex;
  min-height: 100vh;
}

.docs-sidebar {
  width: var(--docs-sidebar-width);
  background: var(--docs-sidebar-bg);
  border-right: 1px solid var(--docs-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--docs-border);
}

.site-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--docs-text);
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
}

.sidebar-nav {
  flex: 1;
}

.sidebar-nav > ul {
  padding: 8px;
}

.sidebar-nav li a {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 14px;
  transition:
    background 0.15s,
    color 0.15s;
}

.sidebar-nav li a:hover {
  background: var(--docs-border);
  color: var(--docs-text);
}

.sidebar-nav li a.active {
  background: var(--docs-primary-light);
  color: var(--docs-primary);
  font-weight: 500;
}

.sidebar-nav li ul {
  padding-left: 12px;
}

.docs-main {
  margin-left: var(--docs-sidebar-width);
  flex: 1;
  min-width: 0;
}

.docs-topbar {
  height: var(--docs-topbar-height);
  border-bottom: 1px solid var(--docs-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--docs-text);
}

.breadcrumb {
  font-size: 13px;
  color: var(--docs-text-muted);
}

.theme-toggle {
  margin-left: auto;
}

.docs-content {
  display: flex;
  max-width: calc(var(--docs-content-max-width) + 240px + 48px);
  margin: 0 auto;
  padding: 0 24px;
}

.docs-article {
  flex: 1;
  max-width: var(--docs-content-max-width);
  padding: 32px 0;
  min-width: 0;
}

.docs-toc {
  width: 200px;
  flex-shrink: 0;
  padding: 32px 0 32px 24px;
  position: sticky;
  top: var(--docs-topbar-height);
  max-height: calc(100vh - var(--docs-topbar-height));
  overflow-y: auto;
}

.docs-toc h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--docs-text-muted);
  margin-bottom: 8px;
}

.docs-toc ul {
  list-style: none;
}
.docs-toc li a {
  display: block;
  padding: 3px 0;
  font-size: 13px;
  color: var(--docs-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 12px;
}
.docs-toc li a:hover {
  color: var(--docs-primary);
}
.docs-toc li.toc-3 a {
  padding-left: 24px;
}
.docs-toc li.toc-4 a {
  padding-left: 36px;
}

/* Typography */
.docs-article h1 {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}
.docs-article h2 {
  font-size: 1.5em;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--docs-border);
}
.docs-article h3 {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 8px;
}
.docs-article h4 {
  font-size: 1.1em;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}
.docs-article p {
  margin-bottom: 16px;
}
/* biome-ignore lint/style/noDescendingSpecificity: sidebar and article selectors target distinct containers */
.docs-article a {
  color: var(--docs-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.docs-article strong {
  font-weight: 600;
}
.docs-article code {
  font-family: var(--docs-font-mono);
  font-size: 0.875em;
  background: var(--docs-code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.docs-article pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.docs-article pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
}
.docs-article ul,
.docs-article ol {
  margin-bottom: 16px;
  padding-left: 24px;
}
.docs-article li {
  margin-bottom: 4px;
}
.docs-article blockquote {
  border-left: 4px solid var(--docs-border);
  padding: 8px 16px;
  margin-bottom: 16px;
  color: var(--docs-text-muted);
}
.docs-article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}
.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.docs-article th,
.docs-article td {
  border: 1px solid var(--docs-border);
  padding: 8px 12px;
  text-align: left;
  font-size: 14px;
}
.docs-article th {
  background: var(--docs-sidebar-bg);
  font-weight: 600;
}
.docs-article hr {
  border: none;
  border-top: 1px solid var(--docs-border);
  margin: 32px 0;
}

/* Page prev/next navigation footer */
.docs-page-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--docs-border);
}
.docs-page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.page-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s,
    background 0.15s;
  min-width: 0;
}
.page-nav-btn:hover {
  border-color: var(--docs-primary);
  background: var(--docs-sidebar-bg);
}
.page-nav-next {
  justify-content: flex-end;
  text-align: right;
}
.page-nav-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.page-nav-label {
  font-size: 12px;
  color: var(--docs-text-muted);
  font-weight: 500;
}
.page-nav-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-last-updated {
  font-size: 13px;
  color: var(--docs-text-muted);
  margin: 0;
}

/* Mobile */
@media (max-width: 768px) {
  .docs-sidebar {
    transform: translateX(-100%);
  }
  .docs-sidebar.open {
    transform: translateX(0);
  }
  .docs-main {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: block;
  }
  .docs-toc {
    display: none;
  }
  .docs-content {
    padding: 0 16px;
  }
}

/* Dark mode */
html.dark {
  --docs-primary: #60a5fa;
  --docs-primary-light: #1e3a5f;
  --docs-bg: #0f172a;
  --docs-text: #e2e8f0;
  --docs-text-muted: #94a3b8;
  --docs-sidebar-bg: #1e293b;
  --docs-border: #334155;
  --docs-code-bg: #1e293b;
}

html.dark .callout-info {
  background: #1e3a5f;
}

html.dark .callout-warning {
  background: #451a03;
}

html.dark .callout-danger {
  background: #450a0a;
}
