.docs {
  position: relative;
  z-index: 1;
}

.docs-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 120px;
  align-self: start;
  max-height: calc(100vh - 160px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.docs-sidebar h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.docs-search input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: #fdf8f1;
  color: #1e1d1a;
}

.docs-search input::placeholder {
  color: var(--muted);
}

.docs-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.docs-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.docs-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.docs-filter-buttons button {
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f3efe6;
  color: #2b2a27;
  cursor: pointer;
}

.docs-filter-buttons button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.docs-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.docs-nav a {
  text-decoration: none;
  color: var(--muted);
  padding-left: 10px;
  border-left: 2px solid transparent;
}

.docs-nav a.active,
.docs-nav a:hover {
  color: var(--accent-strong);
  border-left-color: var(--accent-strong);
}

.docs-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.docs-section {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.docs-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.docs-section-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.docs-section-header small {
  color: var(--muted);
  font-size: 0.85rem;
}

.docs-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.docs-item {
  background: #f3efe6;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-item-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.95rem;
  font-weight: 600;
}

.docs-item-title code {
  font-size: 0.95rem;
}

.docs-item-kind {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
  background: rgba(12, 107, 90, 0.12);
  padding: 2px 6px;
  border-radius: 999px;
}

.docs-item-meta {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-sans);
}

.docs-item-doc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #2b2a27;
  white-space: pre-wrap;
}

.docs-item-doc.muted {
  color: var(--muted);
}

.docs-empty {
  font-size: 0.9rem;
  color: var(--muted);
}

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

  .docs-sidebar {
    position: static;
    max-height: none;
  }
}
