.docs-layout {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.docs-sidebar {
  width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 24px 0;
  background: var(--bg-secondary);
  height: 100%;
}

.docs-content-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  background: var(--bg-card);
  padding-bottom: 80px;
}

.docs-sidebar-section {
  margin-bottom: 4px;
}

.docs-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 20px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  font-family: var(--font-sans);
  transition: color .15s;
}
.docs-sidebar-toggle:hover { color: var(--text); }

.docs-sidebar-arrow {
  width: 10px;
  height: 10px;
  transition: transform .2s;
  color: currentColor;
  flex-shrink: 0;
}
.docs-sidebar-section.collapsed .docs-sidebar-arrow { transform: rotate(-90deg); }
.docs-sidebar-section.collapsed .docs-sidebar-links { display: none; }

.docs-sidebar-category {
  display: block;
  padding: 10px 20px 2px 28px;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  cursor: default;
  pointer-events: none;
}

.docs-sidebar-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 20px 5px 28px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.docs-sidebar-link:hover { background: var(--bg-hover); color: var(--text); }
.docs-sidebar-link.active { background: var(--accent-glow); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.docs-sidebar-link.sub { padding-left: 40px; font-size: .82rem; }
.docs-sidebar-link.soon { cursor: default; color: var(--text-dim); opacity: .6; }
.docs-sidebar-link.soon:hover { background: none; }

.soon-badge {
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-hover);
  color: var(--text-dim);
  margin-left: auto;
  flex-shrink: 0;
}

.docs-content {
  width: 100%;
  max-width: 860px;
  padding: 48px 72px;
  line-height: 1.75;
}

.docs-content h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  margin-bottom: 12px;
}

.docs-content .docs-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.7;
  max-width: 640px;
}

.docs-content p {
  font-size: .92rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.docs-content ul, .docs-content ol {
  font-size: .92rem;
  line-height: 1.75;
}

.docs-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 12px;
}

.docs-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 8px;
}

.docs-content p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.docs-content ul, .docs-content ol {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
  padding-left: 24px;
}
.docs-content li { margin-bottom: 6px; }
.docs-content li strong { color: var(--text); }

.docs-content code {
  font-family: var(--font-mono);
  font-size: .82rem;
  background: var(--bg-hover);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--text);
}

.docs-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-size: .84rem;
  line-height: 1.6;
}

.docs-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: .84rem;
}

.docs-content strong { color: var(--text); font-weight: 600; }

.docs-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.docs-content a:hover { text-decoration: underline; }

.docs-content .docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.docs-content .docs-card {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.docs-content .docs-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.docs-content .docs-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: .9rem;
}
.docs-content .docs-card p {
  font-size: .82rem;
  margin-bottom: 0;
  line-height: 1.6;
}

/* ─── Breadcrumbs ─── */
.docs-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: .78rem;
  color: var(--text-dim);
}
.docs-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.docs-breadcrumbs a:hover { color: var(--accent); }
.docs-breadcrumbs .sep {
  color: var(--text-dim);
  font-size: .7rem;
}

/* ─── Anchor Links ─── */
.docs-content h2, .docs-content h3 {
  position: relative;
}
.docs-content .anchor-link {
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .85rem;
}
.docs-content h2:hover .anchor-link,
.docs-content h3:hover .anchor-link {
  opacity: 1;
}
.docs-content .anchor-link:hover {
  color: var(--accent);
}

/* ─── TOC ─── */
.docs-toc {
  display: none;
}

@media (min-width: 1100px) {
  .docs-content {
    max-width: 800px;
  }
  .docs-toc {
    display: block;
    position: fixed;
    right: max(24px, calc((100vw - 1080px) / 2 - 200px));
    top: 90px;
    width: 180px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    font-size: .78rem;
  }
  .docs-toc-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-dim);
    margin-bottom: 8px;
  }
  .docs-toc-link {
    display: block;
    padding: 3px 0;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
    border-left: 2px solid transparent;
    padding-left: 10px;
  }
  .docs-toc-link:hover { color: var(--text); }
  .docs-toc-link.active { color: var(--accent); border-left-color: var(--accent); }
  .docs-toc-link.h3 { padding-left: 22px; font-size: .74rem; }
}

/* ─── Code Block ─── */
.code-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--bg-secondary);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  user-select: none;
}

.code-block-lang {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .65rem;
}

.code-block-copy {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: .72rem;
  padding: 3px 8px;
  border-radius: 5px;
  transition: color .15s, background .15s;
}
.code-block-copy:hover { color: var(--text); background: var(--bg-card); }

.code-block-copy-icon { flex-shrink: 0; }

.code-block-body {
  padding: 20px 24px;
  margin: 0;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.6;
}

.code-block-body code {
  font-family: var(--font-mono);
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: .84rem;
  color: var(--text);
}

/* Syntax highlighting */
.hl-key { color: var(--accent); }
.hl-string { color: #a6e22e; }
.hl-number { color: #ae81ff; }
.hl-bool { color: #66d9ef; }
.hl-comment { color: var(--text-dim); font-style: italic; }
.hl-keyword { color: #f92672; }
.hl-function { color: #66d9ef; }

@media (max-width: 768px) {
  .docs-sidebar { display: none; }
  .docs-content { padding: 28px 20px; }
}
