/* ─── Docs layout ──────────────────────────────────────────── */
.docs-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.docs-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
  padding: 2rem 1.25rem 4rem;
  background: #02040a;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 4px; }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-section-title {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #4b5563;
  margin-bottom: .5rem;
  padding: 0 .5rem;
}
.sidebar-items { list-style: none; padding: 0; margin: 0; }
.sidebar-link {
  display: block;
  padding: .375rem .625rem;
  border-radius: .375rem;
  font-size: .8125rem;
  color: #6b7280;
  text-decoration: none;
  transition: color .15s, background .15s;
  line-height: 1.5;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar-link.active {
  color: #60a5fa;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.15);
}

/* ── Main content area ────────────────────────────────────── */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 3rem 3rem 4rem;
  max-width: 860px;
}

/* ── Prose / article styles ───────────────────────────────── */
.prose-docs h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  letter-spacing: -.03em;
  line-height: 1.15;
}
.prose-docs h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}
.prose-docs h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-top: 2rem;
  margin-bottom: .75rem;
}
.prose-docs h4 {
  font-size: .9375rem;
  font-weight: 600;
  color: #d1d5db;
  margin-top: 1.5rem;
  margin-bottom: .5rem;
}
.prose-docs p {
  color: #9ca3af;
  line-height: 1.8;
  margin-bottom: 1rem;
}
.prose-docs a { color: #60a5fa; text-decoration: underline; text-decoration-color: rgba(96,165,250,.3); text-underline-offset: 3px; }
.prose-docs a:hover { color: #93c5fd; }
.prose-docs strong { color: #e5e7eb; }
.prose-docs em { color: #9ca3af; font-style: italic; }
.prose-docs hr { border-color: rgba(255,255,255,.07); margin: 2.5rem 0; }
.prose-docs ul, .prose-docs ol {
  color: #9ca3af;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.prose-docs ul { list-style: disc; }
.prose-docs ol { list-style: decimal; }
.prose-docs li { margin-bottom: .375rem; line-height: 1.75; }
.prose-docs blockquote {
  border-left: 3px solid rgba(59,130,246,.5);
  background: rgba(59,130,246,.04);
  padding: .75rem 1rem;
  border-radius: 0 .375rem .375rem 0;
  margin: 1.5rem 0;
  color: #d1d5db;
  font-style: italic;
}
.prose-docs pre {
  background: #080b10;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .5rem;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .8125rem;
  line-height: 1.75;
}
.prose-docs pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: #c9d1d9;
  font-family: 'JetBrains Mono', monospace;
}
.prose-docs code {
  background: rgba(255,255,255,.07);
  color: #93c5fd;
  padding: .125rem .375rem;
  border-radius: .25rem;
  font-size: .8125rem;
  font-family: 'JetBrains Mono', monospace;
}

/* Tables */
.prose-docs table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  display: block;
}
.prose-docs thead th {
  background: rgba(255,255,255,.04);
  color: #e5e7eb;
  font-weight: 600;
  padding: .625rem .875rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  white-space: nowrap;
}
.prose-docs tbody td {
  color: #9ca3af;
  padding: .5rem .875rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: top;
  line-height: 1.6;
}
.prose-docs tbody tr:hover td { background: rgba(255,255,255,.02); }

/* ── Page navigation (prev / next) ───────────────────────── */
.docs-page-nav { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.06); }
.docs-page-nav-footer { margin-bottom: 1.25rem; }
.docs-page-nav-links { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.docs-nav-link {
  display: inline-flex;
  align-items: center;
  font-size: .8125rem;
  font-family: 'JetBrains Mono', monospace;
  color: #6b7280;
  text-decoration: none;
  padding: .5rem .875rem;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: .375rem;
  transition: color .15s, border-color .15s, background .15s;
}
.docs-nav-link:hover { color: #fff; border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.04); }

/* ── Mobile FAB (sidebar toggle) ─────────────────────────── */
.docs-fab {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(37,99,235,.4);
  transition: background .2s, transform .2s;
}
.docs-fab:hover { background: #1d4ed8; }
.docs-fab.active { background: #374151; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .docs-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 40;
    background: #05070a;
    box-shadow: 4px 0 32px rgba(0,0,0,.6);
  }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-fab { display: flex; }
  .docs-content { padding: 2rem 1.25rem 4rem; }
}
@media (max-width: 640px) {
  .prose-docs h1 { font-size: 1.75rem; }
  .prose-docs h2 { font-size: 1.25rem; }
  .docs-content { padding: 1.5rem 1rem 3rem; }
}
