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

:root {
  --sidebar-w: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-border: rgba(255,255,255,0.07);
  --accent: #0ea5e9;
  --accent-dim: rgba(14,165,233,0.12);
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --code-bg: #f8fafc;
  --radius: 10px;
}

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fff;
  display: flex;
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

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

.sidebar-logo a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.nav-section {
  padding: 0 12px 8px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 12px 8px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13.5px;
  color: rgba(255,255,255,0.6);
  transition: background 0.1s, color 0.1s;
  font-weight: 400;
}

.nav-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-link.active { background: var(--accent-dim); color: var(--accent); font-weight: 500; }

.nav-link .icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

/* ── Search ── */
#docs-search-wrap {
  position: relative;
  padding: 12px 16px 0;
}

#docs-search {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  padding: 7px 10px 7px 30px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 9px center;
}

#docs-search::placeholder { color: rgba(255,255,255,0.3); }
#docs-search:focus { border-color: rgba(14,165,233,0.5); background-color: rgba(255,255,255,0.1); }

#docs-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 16px;
  right: 16px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
  overflow: hidden;
}

.sr-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.1s;
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: rgba(14,165,233,0.15); }
.sr-page { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.sr-sub { font-size: 11px; color: #64748b; }
.sr-empty { padding: 10px 12px; font-size: 13px; color: #64748b; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11px;
  color: rgba(255,255,255,0.25);
}

.sidebar-footer a { color: rgba(255,255,255,0.35); text-decoration: none; }
.sidebar-footer a:hover { color: rgba(255,255,255,0.6); }

/* ── Main content ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

.content {
  max-width: 780px;
  padding: 52px 56px 80px;
}

/* ── Typography ── */
.page-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.lead {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.65;
  border-bottom: 1px solid var(--border);
  padding-bottom: 28px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 40px 0 12px;
}

h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 8px;
}

p { margin-bottom: 14px; color: #334155; }

ul, ol { padding-left: 20px; margin-bottom: 14px; color: #334155; }
li { margin-bottom: 5px; }

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

/* ── Code ── */
code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  color: #0369a1;
}

pre {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  margin: 16px 0 24px;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.7;
}

/* ── Callout boxes ── */
.callout {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
}

.callout-info { background: #f0f9ff; border: 1px solid #bae6fd; color: #0369a1; }
.callout-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.callout-tip  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Diagram ── */
.diagram-wrap {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin: 24px 0 32px;
  overflow-x: auto;
}

/* ── Step list ── */
.steps { list-style: none; padding: 0; margin: 16px 0 24px; counter-reset: steps; }
.steps li {
  counter-increment: steps;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: #334155;
  font-size: 14px;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(steps);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 13.5px;
}
th {
  text-align: left;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  color: #334155;
  vertical-align: top;
}
tr:hover td { background: #f8fafc; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }

/* ── On-this-page ── */
.on-this-page {
  position: fixed;
  right: 32px;
  top: 52px;
  width: 180px;
  font-size: 12px;
}
.on-this-page-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.on-this-page a {
  display: block;
  color: var(--text-muted);
  padding: 3px 0;
  font-size: 12.5px;
  border-left: 2px solid var(--border);
  padding-left: 10px;
  margin-bottom: 2px;
}
.on-this-page a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

@media (max-width: 1100px) { .on-this-page { display: none; } }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 28px 20px 60px; }
}
