:root,
[data-theme="light"] {
  --docs-bg: #f8fafc;
  --docs-surface: #ffffff;
  --docs-surface-2: #f1f5f9;
  --docs-border: #e2e8f0;
  --docs-text: #0f172a;
  --docs-muted: #64748b;
  --docs-accent: #2563eb;
  --docs-accent-hover: #1d4ed8;
  --docs-accent-soft: #eff6ff;
  --docs-code-bg: #f1f5f9;
  --docs-note-bg: #eff6ff;
  --docs-note-border: #3b82f6;
  --docs-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --docs-sidebar-width: 17rem;
}

[data-theme="dark"] {
  --docs-bg: #0f172a;
  --docs-surface: #1e293b;
  --docs-surface-2: #334155;
  --docs-border: #334155;
  --docs-text: #f1f5f9;
  --docs-muted: #94a3b8;
  --docs-accent: #60a5fa;
  --docs-accent-hover: #93c5fd;
  --docs-accent-soft: #172554;
  --docs-code-bg: #0b1220;
  --docs-note-bg: #172554;
  --docs-note-border: #3b82f6;
  --docs-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.docs-body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  color: var(--docs-text);
  background: var(--docs-bg);
}

a { color: var(--docs-accent); text-decoration: none; }
a:hover { color: var(--docs-accent-hover); text-decoration: underline; }

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  min-height: 3.25rem;
  background: var(--docs-surface);
  border-bottom: 1px solid var(--docs-border);
  box-shadow: var(--docs-shadow);
}

.docs-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--docs-text) !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.docs-brand span { color: var(--docs-muted); font-weight: 500; }

.docs-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.docs-topbar-actions a {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  text-decoration: none !important;
  color: var(--docs-muted);
}

.docs-topbar-actions a:hover {
  color: var(--docs-text);
  background: var(--docs-surface-2);
}

.docs-topbar-actions a.docs-cta {
  background: var(--docs-accent);
  color: #fff !important;
}

.docs-topbar-actions a.docs-cta:hover {
  background: var(--docs-accent-hover);
  color: #fff !important;
}

.docs-theme-btn {
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-2);
  color: var(--docs-text);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1;
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--docs-sidebar-width) minmax(0, 1fr);
  max-width: 80rem;
  margin: 0 auto;
  min-height: calc(100vh - 3.25rem);
}

.docs-sidebar {
  position: sticky;
  top: 3.25rem;
  align-self: start;
  max-height: calc(100vh - 3.25rem);
  overflow-y: auto;
  padding: 1.25rem 0.75rem 2rem 1rem;
  border-right: 1px solid var(--docs-border);
  background: var(--docs-surface);
}

.docs-nav-group { margin-bottom: 1.25rem; }

.docs-nav-group-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--docs-muted);
  padding: 0 0.65rem;
  margin-bottom: 0.35rem;
}

.docs-nav-group a {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--docs-muted);
  text-decoration: none !important;
}

.docs-nav-group a:hover {
  color: var(--docs-text);
  background: var(--docs-surface-2);
}

.docs-nav-group a.active {
  color: var(--docs-accent);
  background: var(--docs-accent-soft);
  font-weight: 600;
}

.docs-content {
  padding: 2rem 1.5rem 4rem;
  max-width: 46rem;
}

.docs-content.wide { max-width: 52rem; }

.docs-content h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.docs-lead {
  font-size: 1.0625rem;
  color: var(--docs-muted);
  margin: 0 0 1.75rem;
}

.docs-content h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--docs-border);
}

.docs-content h2:first-of-type { border-top: none; padding-top: 0; }

.docs-content h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }

.docs-muted { color: var(--docs-muted); font-size: 0.9375rem; }

code, pre {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86em;
}

code {
  background: var(--docs-code-bg);
  padding: 0.12em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--docs-border);
}

pre {
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-border);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.45;
}

pre code { background: none; border: none; padding: 0; }

.note, .tip {
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  border-radius: 8px;
  border-left: 4px solid var(--docs-note-border);
  background: var(--docs-note-bg);
  font-size: 0.9375rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.9rem;
}

th, td {
  border: 1px solid var(--docs-border);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

th { background: var(--docs-surface-2); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--docs-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--docs-accent);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.card p { color: var(--docs-muted); font-size: 0.875rem; margin: 0 0 0.75rem; }
.card a.card-link { font-size: 0.8125rem; font-weight: 600; text-decoration: none !important; }

.steps { padding-left: 1.25rem; }
.steps li { margin: 0.35rem 0; }

.docs-footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--docs-border);
  padding: 1.25rem 1.5rem 2rem;
  text-align: center;
  color: var(--docs-muted);
  font-size: 0.8125rem;
  background: var(--docs-surface);
}

.docs-footer a { margin: 0 0.35rem; }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--docs-border);
    padding-bottom: 1rem;
  }
  .docs-nav-group { display: inline-block; vertical-align: top; min-width: 11rem; margin-right: 0.5rem; }
}
