/* docs.css — /docs/ shell on the cream/terracotta system (build-docs-pages.mjs) */
.docs-body { background: var(--paper); }
.docs-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; width: min(calc(100% - 32px), 1240px); margin: 0 auto; padding: 28px 0 64px; }
@media (min-width: 1200px) { .docs-shell { grid-template-columns: 250px minmax(0, 1fr) 210px; } }

/* Sidebar */
.docs-sidebar { position: sticky; top: 20px; align-self: start; max-height: calc(100vh - 40px); overflow-y: auto; padding-right: 6px; font-size: 0.9rem; }
.docs-nav-group { margin-top: 18px; display: flex; flex-direction: column; }
.docs-nav-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.docs-sidebar a { color: var(--ink-soft); text-decoration: none; padding: 6px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.docs-sidebar a:hover { color: var(--ink); background: var(--paper-alt); }
.docs-sidebar a.active { color: var(--accent-strong); background: var(--accent-soft); border-left-color: var(--accent); font-weight: 600; }

/* Search */
.docs-search { position: relative; margin-top: 4px; }
.docs-search input { width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-size: 0.9rem; color: var(--ink); }
.docs-search input:focus { outline: none; border-color: var(--accent); }
.docs-search-results { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 8px 28px rgba(26,26,26,0.12); overflow: hidden; }
.docs-search-results a { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-left: 0; border-bottom: 1px solid var(--line); }
.docs-search-results a:last-child { border-bottom: 0; }
.docs-search-results a strong { font-size: 0.78rem; color: var(--accent-strong); }
.docs-search-results a span { color: var(--ink-soft); }
.dsr-empty { padding: 10px 12px; color: var(--muted); font-size: 0.85rem; }

/* Main */
.docs-main { min-width: 0; max-width: 760px; }
.docs-breadcrumb { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
.docs-breadcrumb span { opacity: 0.5; margin: 0 2px; }
.docs-main h1 { font-family: var(--font-display); font-size: 2rem; line-height: 1.15; margin: 0 0 14px; }
.docs-lead { font-size: 1.02rem; color: var(--ink-soft); line-height: 1.65; }
.docs-main h2 { font-family: var(--font-display); font-size: 1.35rem; margin: 36px 0 10px; scroll-margin-top: 24px; }
.docs-main h3 { font-size: 1.05rem; margin: 24px 0 8px; scroll-margin-top: 24px; }
.docs-main p, .docs-main li { line-height: 1.65; color: var(--ink-soft); }
.docs-main a { color: var(--accent-strong); }
.docs-anchor { opacity: 0; margin-left: 8px; text-decoration: none; font-weight: 400; color: var(--muted); }
h2:hover .docs-anchor, h3:hover .docs-anchor { opacity: 1; }

.docs-main table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 14px 0 8px; display: block; overflow-x: auto; }
.docs-main th, .docs-main td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs-main th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.docs-main td:first-child { white-space: nowrap; }

.docs-main pre { position: relative; background: #211f1c; color: #f3f0e8; border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.83rem; line-height: 1.55; margin: 12px 0; }
.docs-main pre code { background: none; color: inherit; padding: 0; }
.docs-main code { font-family: var(--font-mono); font-size: 0.85em; background: var(--paper-alt); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.docs-copy { position: absolute; top: 10px; right: 10px; background: rgba(250,249,245,0.12); color: #f3f0e8; border: 1px solid rgba(250,249,245,0.25); border-radius: 8px; font-size: 0.72rem; padding: 4px 10px; cursor: pointer; }
.docs-copy:hover { background: rgba(250,249,245,0.22); }

/* TOC */
.docs-toc { position: sticky; top: 20px; align-self: start; display: none; flex-direction: column; gap: 2px; font-size: 0.82rem; max-height: calc(100vh - 40px); overflow-y: auto; }
@media (min-width: 1200px) { .docs-toc { display: flex; } }
.docs-toc-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.docs-toc a { color: var(--ink-soft); text-decoration: none; padding: 4px 10px; border-left: 2px solid var(--line); }
.docs-toc a.lvl3 { padding-left: 22px; }
.docs-toc a:hover { color: var(--ink); }
.docs-toc a.active { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 600; }

/* Prev/next */
.docs-prevnext { display: flex; justify-content: space-between; gap: 14px; margin-top: 48px; }
.docs-prevnext a { flex: 1; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-decoration: none; background: var(--surface); }
.docs-prevnext a:hover { border-color: var(--accent); }
.docs-prevnext a span { font-size: 0.75rem; color: var(--muted); }
.docs-prevnext a strong { color: var(--ink); }
.docs-prevnext .pn-next { text-align: right; }

/* Mobile */
.docs-menu-btn { display: none; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 14px; font-size: 0.9rem; cursor: pointer; color: var(--ink); }
@media (max-width: 900px) {
  .docs-main td:first-child { white-space: normal; }
  .docs-shell { grid-template-columns: 1fr; gap: 0; }
  .docs-sidebar { display: none; position: static; max-height: none; margin-bottom: 18px; }
  .docs-sidebar.open { display: block; }
  .docs-menu-btn { display: inline-block; }
}
