.site-nav a.active {
  color: var(--navy);
  font-weight: 700;
}

.docs-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  padding: 48px 24px 96px;
  align-items: start;
}

.docs-sidenav {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 8px;
}

.docs-sidenav-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 10px;
}

.docs-toc-label { margin-top: 32px; }

.docs-manual-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-manual-list a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding: 7px 10px;
  border-radius: 6px;
  line-height: 1.35;
}

.docs-manual-list a:hover { background: var(--surface-alt); color: var(--navy); }
.docs-manual-list a.active {
  background: rgba(15, 42, 63, 0.08);
  color: var(--navy);
  font-weight: 600;
}

.docs-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--border);
}

.docs-toc a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 5px 0 5px 14px;
  line-height: 1.4;
}

.docs-toc a:hover { color: var(--navy); }
.docs-toc .toc-l3 a { padding-left: 26px; font-size: 0.82rem; }

.docs-hero { max-width: 720px; margin-bottom: 12px; }
.docs-hero h1 { font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.5rem); }

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.doc-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.doc-card:hover { border-color: var(--navy); transform: translateY(-2px); }
.doc-card h3 { margin-bottom: 8px; color: var(--navy-deep); }
.doc-card p { font-size: 0.9rem; margin-bottom: 14px; }
.doc-card-link { font-size: 0.85rem; font-weight: 600; color: var(--navy); }

/* Article typography for rendered manual Markdown */
.docs-article { min-width: 0; }

.docs-article h1 {
  font-size: clamp(1.7rem, 1.3rem + 1.3vw, 2.3rem);
  margin-bottom: 6px;
}

.docs-article > p:first-of-type strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.docs-article h2 {
  margin-top: 48px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 1.5rem;
}

.docs-article h2:first-of-type { border-top: none; margin-top: 24px; }

/* The manual's own hand-written "Table of Contents" is redundant with the
   sidebar's generated "On this page" nav — hide it rather than show both. */
.docs-article h2[id="table-of-contents"],
.docs-article h2[id="table-of-contents"] + ol,
.docs-article h2[id="table-of-contents"] + ul,
.docs-article h2[id="table-of-contents"] + ol + hr,
.docs-article h2[id="table-of-contents"] + ul + hr {
  display: none;
}

.docs-article h3 {
  margin-top: 32px;
  font-size: 1.15rem;
  color: var(--navy-deep);
}

.docs-article h4 {
  margin-top: 22px;
  font-size: 1rem;
  color: var(--navy);
}

.docs-article p,
.docs-article li {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.docs-article li { margin-bottom: 0.35em; }

.docs-article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.docs-article table {
  font-size: 0.9rem;
}

.docs-article code {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.docs-article pre {
  background: var(--navy-deep);
  color: #e8ecef;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 1.2em;
}

.docs-article pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.docs-article blockquote {
  margin: 0 0 1.2em;
  padding: 4px 20px;
  border-left: 4px solid var(--gold-soft);
  background: var(--surface-alt);
  border-radius: 4px;
  color: var(--ink-soft);
}

.docs-article blockquote p:last-child { margin-bottom: 0; }

.docs-sidenav-summary {
  display: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy-deep);
  padding: 10px 0;
  list-style: none;
}
.docs-sidenav-summary::-webkit-details-marker { display: none; }
.docs-sidenav-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--gold);
}
.docs-sidenav-toggle[open] .docs-sidenav-summary::before { content: "▾"; }

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; padding: 32px 20px 64px; }
  .docs-sidenav { position: static; max-height: none; }
  .docs-sidenav-summary {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
  }
  .docs-sidenav-body { padding: 16px 4px 4px; }
}

@media (min-width: 901px) {
  .docs-sidenav-toggle .docs-sidenav-body { display: block !important; }
}
