html {
  scroll-behavior: smooth;
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding: calc(var(--nav-h) + 48px) 0 80px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  width: 260px;
  height: calc(100vh - var(--nav-h) - 48px);
  height: calc(100dvh - var(--nav-h) - 48px);
  max-height: calc(100vh - var(--nav-h) - 48px);
  max-height: calc(100dvh - var(--nav-h) - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 77, 173, 0.5) rgba(255, 255, 255, 0.04);
  padding-bottom: 20px;
  box-sizing: border-box;
}

.docs-sidebar::-webkit-scrollbar {
  width: 8px;
}

.docs-sidebar::-webkit-scrollbar-button,
.docs-sidebar::-webkit-scrollbar-button:single-button,
.docs-sidebar::-webkit-scrollbar-button:vertical:start:decrement,
.docs-sidebar::-webkit-scrollbar-button:vertical:start:increment,
.docs-sidebar::-webkit-scrollbar-button:vertical:end:decrement,
.docs-sidebar::-webkit-scrollbar-button:vertical:end:increment {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.docs-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 77, 173, 0.55), rgba(168, 85, 247, 0.42));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 48px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 77, 173, 0.78), rgba(168, 85, 247, 0.62));
  box-shadow: 0 0 12px rgba(255, 77, 173, 0.25);
}

.docs-sidebar::-webkit-scrollbar-corner {
  background: transparent;
}

.docs-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 8px;
}

.docs-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-sidebar h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.docs-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}

.docs-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.docs-nav a:hover,
.docs-nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.docs-nav a:focus {
  outline: none;
}

.docs-nav a:focus-visible {
  outline: 2px solid rgba(255, 77, 173, 0.45);
  outline-offset: 2px;
}

.docs-content h1 {
  margin: 0 0 12px;
  font-size: 2.5rem;
  letter-spacing: -0.03em;
}

.docs-content .lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0 0 40px;
  max-width: 680px;
}

.docs-section {
  margin-bottom: 48px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.docs-section h2 {
  margin: 0 0 16px;
  font-size: 1.5rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.docs-section h2.docs-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.docs-section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, rgba(255, 77, 173, 0.28), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(255, 77, 173, 0.25);
}

.docs-section-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.docs-content .docs-section-icon svg {
  --icon-size: 18px;
}

.docs-section h3 {
  margin: 28px 0 12px;
  font-size: 1.1rem;
  color: var(--accent);
}

.docs-section p {
  color: var(--text-muted);
  margin: 0 0 16px;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 24px;
}

.docs-table th,
.docs-table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.docs-table th {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
}

.docs-table td {
  color: var(--text-muted);
}

.docs-table code {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent);
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .docs-sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
  }
}
