.docs-layout {
  display: grid;
  grid-template-columns: 16rem 1fr;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-height));
}

/* Sidebar */

.docs-sidebar {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--border);
}

.docs-sidebar h4 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.docs-sidebar ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.docs-sidebar li a {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color 0.15s;
}

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

.docs-sidebar li a.active {
  color: var(--accent);
}

.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  background: var(--accent);
  color: var(--bg-base);
  border: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
}

/* Content */

.docs-content {
  padding: 3rem 3rem 6rem;
  max-width: 52rem;
  min-width: 0;
}

.docs-content section {
  margin-bottom: 4rem;
}

.docs-content h2 {
  margin-bottom: 1.25rem;
  padding-top: 1rem;
}

.docs-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.docs-content p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.docs-content ul, .docs-content ol {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  line-height: 1.75;
}

.docs-content li {
  margin-bottom: 0.35rem;
}

.docs-content code {
  background: var(--bg-surface);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.88em;
  color: var(--accent);
}

.docs-content pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.65;
  overflow-x: auto;
  position: relative;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: var(--text-secondary);
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.docs-content th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-content td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.docs-content td code {
  font-size: 0.82rem;
}

/* Responsive */

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: calc(100vh - var(--nav-height));
    z-index: 150;
    background: var(--bg-base);
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .docs-sidebar.open {
    display: block;
  }

  .sidebar-toggle {
    display: block;
  }

  .docs-content {
    padding: 2rem 1.5rem 4rem;
  }

  .docs-content pre {
    max-width: calc(100vw - 3rem);
  }

  .docs-content table {
    display: block;
    overflow-x: auto;
    max-width: calc(100vw - 3rem);
  }
}
