/* Shared shell for every static docs page generated by scripts/build-docs.js.
 * Mirrors the SPA shell in /os/docs.html so the look stays consistent.
 */
body { background: var(--bg); color: var(--ink); margin: 0; }

/* ── topbar ──────────────────────────────────────────────────── */
.docs-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.docs-topbar .brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 16px; color: var(--ink); text-decoration: none;
}
.docs-topbar .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--ink); color: #fff;
}
.docs-topbar .brand-mark svg { width: 16px; height: 16px; stroke: currentColor; }
.docs-topbar .right { display: inline-flex; align-items: center; gap: 10px; }
.docs-topbar .btn-line {
  padding: 7px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 500; text-decoration: none;
}
.docs-topbar .btn-line:hover { background: var(--bg-soft); border-color: var(--ink); }
.docs-topbar .btn-fill {
  padding: 7px 14px; border-radius: var(--radius-md);
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 500; text-decoration: none;
}
.docs-topbar .btn-fill:hover { background: #000; }

.menu-btn {
  display: none;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: #fff;
  cursor: pointer; padding: 0;
}
.menu-btn svg { width: 18px; height: 18px; }

/* ── layout: sidebar + content ───────────────────────────────── */
.sidebar-backdrop { display: none; }

.layout {
  display: grid; grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1400px; margin: 0 auto;
}

.sidebar {
  position: sticky; top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 28px 18px 80px 24px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.sb-search {
  width: 100%;
  padding: 9px 12px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--bg-soft); color: var(--ink); font-size: 13px;
  font-family: inherit;
}
.sb-search:focus { outline: none; border-color: var(--accent); background: #fff; }
.sb-group { margin-bottom: 8px; }
.sb-group > .sb-cat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  cursor: pointer; user-select: none;
}
.sb-group > .sb-cat:hover { background: var(--bg-hover); }
.sb-group .chev { width: 12px; height: 12px; transition: transform 160ms ease; color: var(--ink-soft); }
.sb-group.collapsed .chev { transform: rotate(-90deg); }
.sb-group.collapsed .sb-list { display: none; }
.sb-list { display: flex; flex-direction: column; gap: 1px; padding: 4px 0 8px 0; }
.sb-link {
  display: block; padding: 6px 10px 6px 22px;
  color: var(--ink-mute); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer;
  border-left: 2px solid transparent; margin-left: 8px;
  text-decoration: none;
}
.sb-link:hover { color: var(--ink); background: var(--bg-hover); }
.sb-link.active { color: var(--ink); background: var(--accent-soft); border-left-color: var(--accent); }

/* ── content / article body ──────────────────────────────────── */
.content { padding: 40px 56px 120px 56px; max-width: 920px; }
.crumb {
  color: var(--ink-soft); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 600; margin-bottom: 6px;
}

.title-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 12px;
}
.title-row h1 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: 38px; line-height: 1.15; letter-spacing: -0.02em;
  color: var(--ink); margin: 0; flex: 1;
}

.copy-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.copy-btn:hover { background: var(--bg-soft); border-color: var(--ink); }
.copy-btn:active { transform: translateY(1px); }
.copy-btn svg { width: 15px; height: 15px; }

.content .lede {
  color: var(--ink-mute); font-size: 17px; line-height: 1.6;
  margin-bottom: 28px;
}
.content h2 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: 24px; letter-spacing: -0.015em;
  margin: 38px 0 12px 0; color: var(--ink-2);
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.content h3 { font-size: 16px; font-weight: 600; color: var(--ink); margin: 26px 0 10px 0; }
.content h4 { font-size: 14px; font-weight: 600; color: var(--ink); margin: 18px 0 8px 0; }
.content p { color: var(--ink-mute); line-height: 1.7; margin-bottom: 14px; font-size: 15px; }
.content ul, .content ol { color: var(--ink-mute); line-height: 1.7; margin: 0 0 14px 22px; font-size: 15px; }
.content li { margin-bottom: 4px; }
.content strong { color: var(--ink); font-weight: 600; }
.content a { color: var(--accent); text-decoration: none; }
.content a:hover { text-decoration: underline; }

.content code {
  background: var(--bg-hover); padding: 1.5px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88em; color: var(--ink);
  border: 1px solid var(--line);
}
.content pre {
  background: var(--ink); color: #F5F5F5; padding: 16px 18px;
  border-radius: var(--radius-md); overflow-x: auto;
  font-size: 13px; line-height: 1.6;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin: 14px 0;
}
.content pre code { background: none; color: inherit; padding: 0; border: none; font-size: inherit; }

.content table {
  width: 100%; border-collapse: collapse;
  margin: 14px 0 18px 0; font-size: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden;
}
.content th, .content td {
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top;
}
.content th {
  font-weight: 600; color: var(--ink-2); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--bg-soft);
}
.content tr:last-child td { border-bottom: none; }
.content td { color: var(--ink-mute); }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; background: var(--bg-hover);
  color: var(--ink-mute); font-size: 11px; font-weight: 500;
  border: 1px solid var(--line);
}
.pill.safe   { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.pill.free   { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.pill.scrub  { background: #FEF3C7; color: #92400E; border-color: #FCD34D; }
.pill.baa    { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }
.pill.warn   { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--bg-soft); padding: 14px 18px; border-radius: var(--radius-md);
  margin: 16px 0; font-size: 14px; color: var(--ink-mute);
}
.callout.warn   { border-left-color: var(--warn); background: #FFFBEB; }
.callout.danger { border-left-color: var(--danger); background: #FEF2F2; }
.callout strong { color: var(--ink); }

.cards {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin: 12px 0 18px 0;
}
.cards .card {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px; background: var(--bg-card);
}
.cards .card .label { font-weight: 600; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.cards .card .blurb { color: var(--ink-mute); font-size: 13px; line-height: 1.55; }
.cards .card a { color: var(--ink); border-bottom: 1px dashed var(--line-2); text-decoration: none; }
.cards .card a:hover { border-bottom-color: var(--ink); }

.step {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px;
  margin: 16px 0;
}
.step .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.step .body { color: var(--ink-mute); font-size: 15px; line-height: 1.7; }
.step .body strong { color: var(--ink); }

/* ── prev / next ─────────────────────────────────────────────── */
.prev-next {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 60px; padding-top: 32px;
  border-top: 1px solid var(--line);
}
.pn-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--bg-card); text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease;
}
.pn-link:hover { border-color: var(--ink); background: var(--bg-soft); }
.pn-link.next  { text-align: right; }
.pn-dir   { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.pn-title { font-size: 14px; color: var(--ink); font-weight: 600; }

/* ── mobile ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .docs-topbar .right .btn-line { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 60px; left: 0;
    width: 280px; max-width: 80vw; height: calc(100vh - 60px);
    background: #fff; border-right: 1px solid var(--line);
    transform: translateX(-100%); transition: transform 220ms ease;
    z-index: 40; box-shadow: 0 16px 40px rgba(0,0,0,0.08);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed; inset: 60px 0 0 0; z-index: 35;
    background: rgba(10,10,10,0.35);
    opacity: 0; pointer-events: none; transition: opacity 200ms ease;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .content { padding: 28px 18px 80px 18px; }
  .title-row { flex-wrap: wrap; }
  .title-row h1 { font-size: 30px; }
  .cards { grid-template-columns: 1fr; }
  .content pre { font-size: 12px; padding: 12px 14px; }
  .content table { font-size: 13px; }
  .content th, .content td { padding: 8px 10px; }
  .prev-next { grid-template-columns: 1fr; }
  .pn-link.next { text-align: left; }
}

@media (max-width: 480px) {
  .docs-topbar { padding: 10px 14px; }
  .title-row h1 { font-size: 26px; }
  .content .lede { font-size: 15px; }
}
