/* Larch Manual — docs chrome + content styles. Page chrome (topbar, sidebar, pager) is injected by docs.js */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-sans);
  background: var(--larch-warm-stone);
  color: var(--larch-midnight);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--larch-gold); color: var(--larch-midnight); }
a { color: inherit; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- topbar ---------- */
.dtop {
  position: sticky; top: 0; z-index: 50;
  background: var(--larch-midnight);
  border-bottom: 1px solid rgba(212,160,75,0.55);
}
.dtop-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 40px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.dtop-brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.dtop-brand img { height: 30px; display: block; align-self: center; }
.dtop-brand .manual {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--larch-gold); font-weight: 500;
  border-left: 1px solid rgba(251,250,248,0.25); padding-left: 14px;
}
.dtop-links { display: flex; align-items: center; gap: 22px; }
.dtop-links a {
  font-size: 13.5px; font-weight: var(--weight-bold); color: var(--larch-muted);
  text-decoration: none; white-space: nowrap; transition: color 140ms ease;
}
.dtop-links a:hover { color: var(--larch-snow); }

/* ---------- shell ---------- */
.dshell {
  max-width: 1200px; margin: 0 auto; padding: 0 40px;
  display: grid; grid-template-columns: 248px minmax(0, 1fr);
  gap: 72px; align-items: start;
}

/* ---------- sidebar ---------- */
.dnav { position: sticky; top: 64px; padding: 44px 0 60px; max-height: calc(100vh - 64px); overflow-y: auto; }
.dnav .dn-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: #a87a2e; font-weight: 500;
  display: block; margin-bottom: 12px;
}
.dnav ol { list-style: none; border-top: 1px solid rgba(14,22,33,0.18); }
.dnav li { border-bottom: 1px solid rgba(14,22,33,0.08); }
.dnav a {
  display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: baseline;
  padding: 9px 2px; font-size: 13.5px; font-weight: var(--weight-semibold);
  color: var(--larch-steel-ink); text-decoration: none; line-height: 1.4;
  transition: color 140ms ease, background 140ms ease;
}
.dnav a .n { font-family: var(--font-mono); font-size: 10px; color: #a87a2e; }
.dnav a:hover { color: var(--larch-midnight); background: var(--larch-snow); }
.dnav a.active { color: var(--larch-midnight); font-weight: var(--weight-extrabold); }
.dnav a.active .n { font-weight: 600; }
.dnav .dn-foot {
  margin-top: 20px; font-size: 12px; line-height: 1.6; color: var(--larch-steel-ink);
}
.dnav .dn-foot a { display: inline; padding: 0; font-weight: var(--weight-extrabold); color: var(--larch-midnight); border-bottom: 1px solid var(--larch-gold); text-decoration: none; }

/* ---------- article ---------- */
main.doc { padding: 52px 0 80px; max-width: 720px; }
.doc .sec-index {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: #a87a2e; font-weight: 500;
}
.doc h1 {
  font-family: var(--font-heading); font-weight: 400;
  font-size: 38px; line-height: 1.14; letter-spacing: -0.012em;
  margin: 14px 0 0; text-wrap: pretty;
}
.doc .standfirst {
  margin-top: 14px; font-size: 17px; line-height: 1.65; color: var(--larch-steel-ink);
  max-width: 54ch; text-wrap: pretty;
  padding-bottom: 28px; border-bottom: 2px solid var(--larch-midnight); margin-bottom: 8px;
}
.doc h2 {
  font-family: var(--font-heading); font-weight: 400;
  font-size: 24px; letter-spacing: -0.008em; line-height: 1.25;
  margin: 40px 0 12px;
}
.doc h3 {
  font-size: 15.5px; font-weight: var(--weight-extrabold);
  margin: 28px 0 8px;
}
.doc p { margin: 12px 0 0; font-size: 15px; line-height: 1.75; color: var(--larch-steel-ink); max-width: 62ch; text-wrap: pretty; }
.doc p b, .doc li b { color: var(--larch-midnight); font-weight: var(--weight-bold); }
.doc p a, .doc li a { color: var(--larch-midnight); font-weight: var(--weight-bold); text-decoration: none; border-bottom: 1px solid var(--larch-gold); padding-bottom: 1px; }
.doc .mono, .doc code {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 0.85em; color: var(--larch-midnight);
  background: rgba(14,22,33,0.05); border: 1px solid rgba(14,22,33,0.08);
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.doc .path { font-weight: var(--weight-bold); color: var(--larch-midnight); }

/* lists */
.doc ul, .doc ol { margin: 14px 0 0; padding-left: 0; list-style: none; max-width: 62ch; }
.doc ul li, .doc ol li {
  position: relative; padding: 10px 0 10px 30px;
  border-bottom: 1px solid rgba(14,22,33,0.08);
  font-size: 15px; line-height: 1.7; color: var(--larch-steel-ink);
}
.doc ul li:first-child, .doc ol li:first-child { border-top: 1px solid rgba(14,22,33,0.14); }
.doc ul li::before {
  content: "·"; position: absolute; left: 8px; top: 9px;
  color: #a87a2e; font-weight: 700;
}
.doc ol { counter-reset: doc-steps; }
.doc ol li { counter-increment: doc-steps; padding-left: 44px; }
.doc ol li::before {
  content: counter(doc-steps, decimal-leading-zero);
  position: absolute; left: 2px; top: 13px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: #a87a2e;
}

/* callouts */
.doc .callout {
  margin: 22px 0 0; max-width: 62ch;
  border-left: 2px solid var(--larch-gold); padding: 2px 0 2px 18px;
  font-size: 15px; line-height: 1.7; color: var(--larch-midnight); text-wrap: pretty;
}
.doc .callout.rule {
  font-family: var(--font-heading); font-weight: 400; font-size: 18.5px; line-height: 1.5;
}

/* tables */
.doc table {
  margin: 18px 0 0; width: 100%; border-collapse: collapse;
  font-size: 13.5px; line-height: 1.55;
}
.doc th {
  text-align: left; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--larch-steel-ink);
  font-weight: 500; padding: 0 14px 8px 0;
  border-bottom: 2px solid var(--larch-midnight);
}
.doc td {
  vertical-align: top; padding: 11px 14px 11px 0;
  border-bottom: 1px solid rgba(14,22,33,0.10);
  color: var(--larch-steel-ink);
}
.doc td:first-child { font-weight: var(--weight-extrabold); color: var(--larch-midnight); white-space: nowrap; }

/* status pills used on people & access */
.doc .pill {
  display: inline-block; font-size: 9.5px; font-weight: var(--weight-extrabold);
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 10px; border-radius: var(--radius-full); white-space: nowrap;
  position: relative; top: -1px;
}
.doc .pill.enforced { background: rgba(23,63,53,0.10); color: var(--larch-evergreen); border: 1px solid rgba(23,63,53,0.30); }
.doc .pill.label { background: rgba(70,97,122,0.10); color: var(--larch-steel); border: 1px solid rgba(70,97,122,0.30); }
.doc .pill.planned { background: rgba(212,160,75,0.14); color: #8a6420; border: 1px solid rgba(212,160,75,0.45); }

/* footer / pager */
.dpager {
  margin-top: 56px; padding-top: 18px; border-top: 1px solid rgba(14,22,33,0.18);
  display: flex; justify-content: space-between; gap: 20px;
}
.dpager a { text-decoration: none; max-width: 46%; }
.dpager .pk {
  display: block; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: #a87a2e;
}
.dpager .pt {
  display: block; margin-top: 4px;
  font-family: var(--font-heading); font-weight: 400; font-size: 18px; color: var(--larch-midnight);
  border-bottom: 1px solid transparent; transition: border-color 140ms ease;
}
.dpager a:hover .pt { border-bottom-color: var(--larch-gold); }
.dpager .next { text-align: right; margin-left: auto; }
.doc-foot {
  margin-top: 36px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--larch-steel-ink); line-height: 1.9;
}

@media (max-width: 1020px) {
  .dshell { grid-template-columns: 1fr; gap: 0; padding: 0 24px; }
  .dnav { position: static; max-height: none; padding: 32px 0 0; }
  .dnav ol { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(14,22,33,0.18); }
  .dtop-inner { padding: 0 24px; }
  .dtop-links { display: none; }
  main.doc { padding-top: 36px; }
}
