/* ─── Docs Layout ─── */
.docs-layout {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin: 0 auto;
  padding: 4.5rem 1.25rem 0;
  gap: 0;
}
@media (min-width: 768px) {
  .docs-layout {
    flex-direction: row;
    padding: 4.5rem 2rem 0;
    gap: 2rem;
  }
}
@media (min-width: 1024px) { .docs-layout { padding: 4.5rem 3rem 0; gap: 3rem; } }

/* ─── Sidebar ─── */
.docs-sidebar {
  width: 100%;
  flex-shrink: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.docs-sidebar-inner {
  display: flex;
  gap: 0.25rem;
  white-space: nowrap;
  padding-bottom: 0.5rem;
}
@media (min-width: 768px) {
  .docs-sidebar {
    width: 180px;
    overflow-x: visible;
    border-bottom: none;
    margin-bottom: 0;
  }
  .docs-sidebar-inner {
    position: sticky;
    top: 5rem;
    flex-direction: column;
    white-space: normal;
    padding-bottom: 0;
  }
}
.sidebar-link {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}
.sidebar-link:hover {
  color: var(--fg);
  opacity: 1;
}
.sidebar-link.active {
  color: var(--fg);
  background: hsl(0, 0%, 12%);
  opacity: 1;
}

/* ─── Content ─── */
.docs-content {
  flex: 1;
  min-width: 0;
  padding-bottom: 4rem;
}
.docs-content h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.docs-content section {
  margin-bottom: 3rem;
  scroll-margin-top: 5rem;
}
.docs-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.docs-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.docs-content p {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.docs-content ul {
  list-style: none;
  margin-bottom: 1rem;
}
.docs-content ul li {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.7;
  padding-left: 1rem;
  position: relative;
}
.docs-content ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: hsl(0, 0%, 30%);
}
.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: hsl(0, 0%, 12%);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  color: var(--terminal-text);
}

/* ─── Code Blocks ─── */
.code-block {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}
.code-header {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.code-header span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.code-block pre {
  padding: 0.875rem 1rem;
  overflow-x: auto;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--terminal-text);
  background: none;
  padding: 0;
  border-radius: 0;
}
/* ─── Syntax Highlighting (VS Code Dark+ aligned with db9) ─── */
.code-block .c  { color: #6A9955; }  /* comments */
.code-block .cmd { color: #DCDCAA; } /* commands: curl, sh, skill9 */
.code-block .fl  { color: #61A2D9; } /* flags: --all, -fsSL */
.code-block .str { color: #CE9178; } /* strings, URLs */
.code-block .var { color: #9CDCFE; } /* variables: $HOME */
.code-block .op  { color: #D4D4D4; } /* operators: |, =  */
.code-block .out { color: #6A9955; } /* output/result lines */

/* ─── Tables ─── */
.docs-content .table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 480px;
}
.docs-content th {
  text-align: left;
  font-weight: 700;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.docs-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid hsl(0, 0%, 12%);
  color: var(--muted);
  vertical-align: top;
}
.docs-content td code {
  white-space: nowrap;
}

/* ─── Docs Intro ─── */
.docs-intro {
  font-size: 1.0625rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* ─── Sidebar Groups ─── */
.sidebar-group {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(0, 0%, 40%);
  padding: 0.75rem 0.75rem 0.25rem;
  display: none;
}
@media (min-width: 768px) { .sidebar-group { display: block; } }

/* ─── H4 Command Headings ─── */
.docs-content h4 {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--fg);
  margin: 1.75rem 0 0.5rem;
  padding: 0.375rem 0.625rem;
  background: hsl(0, 0%, 8%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* ─── Callout Box ─── */
.callout {
  background: hsl(0, 0%, 8%);
  border-left: 3px solid hsl(0, 0%, 30%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}
.callout strong {
  color: var(--fg);
}
.callout .code-block {
  border: none;
}

/* ─── Nav active state ─── */
.nav-active {
  color: var(--fg) !important;
}
