/* MABEL replication docs — book layout, no marketing.
   Shares the site's palette + type (Jost body, Space Mono for data),
   drops the display faces. Dark, dense, printable. */

:root {
  --bg: #151820;
  --bg-side: #10131a;
  --bg-code: #0d1016;
  --bg-soft: #1b1f2a;
  --ink: #e8eaf0;
  --ink-dim: #9aa1b0;
  --ink-faint: #6a7180;
  --line: #2a2f3c;
  --accent: #ffc24b;       /* site yellow */
  --accent2: #57c7ff;
  --ok: #3fb56b;
  --warn: #ff9f43;
  --bad: #ff5c5c;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Jost", system-ui, -apple-system, sans-serif;
  --side-w: 264px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16.5px; line-height: 1.62;
  font-weight: 340;
}

/* ── frame ─────────────────────────────────────────────────────────────── */
.wrap { display: flex; min-height: 100vh; }
nav.side {
  width: var(--side-w); flex: none; background: var(--bg-side);
  border-right: 1px solid var(--line);
  padding: 22px 18px 40px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
main {
  flex: 1; min-width: 0; padding: 40px 48px 90px;
  max-width: 60rem; margin: 0 auto;
}
@media (max-width: 880px) {
  .wrap { display: block; }
  nav.side { position: static; width: 100%; height: auto;
             border-right: 0; border-bottom: 1px solid var(--line);
             padding-bottom: 8px; }
  nav.side .tree { display: none; }
  nav.side.open .tree { display: block; }
  #navtoggle { display: inline-block; }
  main { padding: 26px 18px 70px; }
}
#navtoggle {
  display: none; background: none; border: 1px solid var(--line);
  color: var(--ink-dim); font-family: var(--mono); font-size: 12px;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; margin-top: 8px;
}

/* ── sidebar ───────────────────────────────────────────────────────────── */
.side .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.side .brand img { width: 26px; height: 26px; }
.side .brand b { color: var(--ink); font-weight: 600; letter-spacing: 0.04em; }
.side .brand span { color: var(--ink-faint); font-family: var(--mono); font-size: 11px; }
.side .tree { list-style: none; margin: 18px 0 0; padding: 0; }
.side .tree li { margin: 1px 0; }
.side .tree a {
  display: flex; gap: 9px; align-items: baseline; padding: 6px 9px;
  border-radius: 7px; text-decoration: none; color: var(--ink-dim);
  font-size: 14.5px; line-height: 1.3;
}
.side .tree a .n { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.side .tree a:hover { background: var(--bg-soft); color: var(--ink); }
.side .tree a.here { background: var(--bg-soft); color: var(--accent); }
.side .tree a.here .n { color: var(--accent); }
.side .foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-faint); }
.side .foot a { color: var(--ink-dim); text-decoration: none; }
.side .foot a:hover { color: var(--ink); }

/* ── content type ──────────────────────────────────────────────────────── */
h1 { font-size: 30px; font-weight: 600; letter-spacing: 0.01em; margin: 0 0 6px; }
h1 .n { font-family: var(--mono); color: var(--accent); font-size: 18px; margin-right: 10px; }
p.lead { color: var(--ink-dim); margin: 0 0 26px; max-width: 44rem; }
h2 { font-size: 21px; font-weight: 600; margin: 42px 0 10px; padding-top: 14px;
     border-top: 1px solid var(--line); }
h3 { font-size: 17px; font-weight: 600; margin: 26px 0 6px; }
a { color: var(--accent2); }
p, ul, ol { max-width: 46rem; }
li { margin: 3px 0; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); font-size: 14px; }

/* ── data ──────────────────────────────────────────────────────────────── */
code, kbd {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--bg-code); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; color: #dfe6f2;
}
pre {
  background: var(--bg-code); border: 1px solid var(--line); border-radius: 9px;
  padding: 13px 15px; overflow-x: auto; position: relative;
  font-family: var(--mono); font-size: 13px; line-height: 1.55; max-width: 52rem;
}
pre code { background: none; border: 0; padding: 0; }
pre .cbtn {
  position: absolute; top: 7px; right: 7px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--ink-faint); font-family: var(--mono);
  font-size: 10.5px; border-radius: 5px; padding: 2px 7px; cursor: pointer;
}
pre .cbtn:hover { color: var(--ink); }
pre .c { color: #5e6a7d; }               /* comment */
pre .p { color: var(--accent); }         /* prompt/emphasis */

table { border-collapse: collapse; width: 100%; max-width: 52rem;
        font-size: 14.5px; margin: 14px 0; }
th { text-align: left; font-family: var(--mono); font-size: 11.5px;
     text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-faint);
     border-bottom: 1px solid var(--line); padding: 7px 12px 7px 0; }
td { border-bottom: 1px solid rgba(42,47,60,0.55); padding: 7px 12px 7px 0;
     vertical-align: top; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 13px; }
tr.total td { border-top: 1px solid var(--line); font-weight: 600; }

/* ── steps ─────────────────────────────────────────────────────────────── */
ol.steps { counter-reset: st; list-style: none; margin: 16px 0; padding: 0; }
ol.steps > li {
  counter-increment: st; position: relative; padding: 0 0 14px 46px;
  border-left: 1px solid var(--line); margin-left: 14px;
}
ol.steps > li::before {
  content: counter(st, decimal-leading-zero);
  position: absolute; left: -15px; top: -2px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  font-family: var(--mono); font-size: 11.5px; color: var(--accent);
  padding: 3px 5px;
}
ol.steps > li:last-child { border-left-color: transparent; }
ol.steps b:first-child { font-weight: 600; }

/* ── callouts ──────────────────────────────────────────────────────────── */
.note, .warn, .stop {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px;
  padding: 10px 14px; margin: 16px 0; max-width: 48rem; font-size: 15px;
}
.note { border-left-color: var(--accent2); }
.warn { border-left-color: var(--warn); }
.stop { border-left-color: var(--bad); background: rgba(255,92,92,0.05); }
.note::before, .warn::before, .stop::before {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  display: block; margin-bottom: 3px;
}
.note::before { content: "NOTE"; color: var(--accent2); }
.warn::before { content: "CAUTION"; color: var(--warn); }
.stop::before { content: "STOP"; color: var(--bad); }

/* ── spec chips / checklists ───────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; max-width: 52rem; }
.chips span {
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
}
ul.check { list-style: none; padding-left: 0; }
ul.check li { padding-left: 26px; position: relative; }
ul.check li::before { content: "□"; position: absolute; left: 4px; color: var(--accent); }

/* ── figures / downloads ───────────────────────────────────────────────── */
figure { margin: 18px 0; max-width: 52rem; }
figure img { width: 100%; border: 1px solid var(--line); border-radius: 9px; }
figcaption { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
         gap: 10px; margin: 14px 0; max-width: 52rem; }
.files a {
  display: block; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 14px; text-decoration: none; color: var(--ink);
  background: var(--bg-soft); font-size: 14.5px;
}
.files a:hover { border-color: var(--accent); }
.files a small { display: block; color: var(--ink-faint); font-family: var(--mono);
                 font-size: 11px; margin-top: 3px; }

/* ── prev / next ───────────────────────────────────────────────────────── */
.pn { display: flex; justify-content: space-between; gap: 12px;
      margin-top: 56px; border-top: 1px solid var(--line); padding-top: 18px; }
.pn a { text-decoration: none; color: var(--ink); border: 1px solid var(--line);
        border-radius: 9px; padding: 10px 16px; max-width: 46%; }
.pn a small { display: block; color: var(--ink-faint); font-family: var(--mono); font-size: 11px; }
.pn a:hover { border-color: var(--accent); }
.pn .next { margin-left: auto; text-align: right; }

@media print {
  nav.side, .pn, #navtoggle, pre .cbtn { display: none; }
  body { background: #fff; color: #111; }
}
