/* ============================================================
   MAREGRAPH — halaman docs
   Lembar almanak: TOC menempel di KIRI, artikel di kanan,
   heading serif dengan nomor bab besar. Halaman men-scroll
   secara native — dek yang sticky, bukan shell yang dikunci.
   ============================================================ */

.doc {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── daftar isi (kiri, sticky di bawah dek) ────────────────── */
.toc {
  position: sticky;
  top: calc(var(--deck-h) + 24px);
  padding: 40px 20px 40px clamp(16px, 3vw, 32px);
}
.toc-label {
  font-size: 10px;
  color: var(--dimmer);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
/* mulai dari -1 supaya penomoran TOC cocok dengan section di body,
   yang dimulai dari 00 dan bukan 01 */
.toc ol { list-style: none; counter-reset: t -1; }
.toc li { counter-increment: t; }
.toc a {
  display: block;
  padding: 4px 0;
  font-size: 11px;
  color: var(--dim);
  transition: color .14s;
}
.toc a::before {
  content: counter(t, decimal-leading-zero) " ";
  color: var(--dimmer);
}
.toc a:hover { color: var(--ink); text-decoration: none; }

/* ── isi ───────────────────────────────────────────────────── */
.body {
  min-width: 0;
  padding: 40px clamp(20px, 3.4vw, 46px) 90px;
  border-left: 1px solid var(--line);
}

.doc-head { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.doc-head h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.doc-head .sub {
  margin-top: 16px;
  max-width: 62ch;
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(10, 10, 10, 0.62);
}

.body section { padding: 36px 0; border-bottom: 1px solid var(--line); }
.body section:last-of-type { border-bottom: 0; }

.body h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0;
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 16px;
  scroll-margin-top: calc(var(--deck-h) + 16px);
}
.body h2 .n {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.body h3 {
  font-size: 12.5px;
  font-weight: 600;
  margin: 26px 0 12px;
  letter-spacing: 0.02em;
}

.body p {
  max-width: 66ch;
  font-size: 12.5px;
  line-height: 1.85;
  color: rgba(10, 10, 10, 0.74);
  margin-bottom: 14px;
}
.body p:last-child { margin-bottom: 0; }
.body b { color: var(--ink); font-weight: 600; }
.body em { font-style: normal; color: var(--ink); border-bottom: 1px solid var(--line); }

.body code {
  font-size: 11.5px;
  background: var(--line-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  white-space: nowrap;
}

/* ── tabel ─────────────────────────────────────────────────── */
.body table {
  width: 100%;
  max-width: 620px;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.body th, .body td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.body th {
  font-weight: 600;
  color: var(--ink);
  background: var(--line-2);
  letter-spacing: 0.04em;
}
.body td { color: rgba(10, 10, 10, 0.72); }

table.calc td:first-child { color: var(--ink); width: 30%; }
table.calc td.v { text-align: right; color: var(--ink); white-space: nowrap; }
table.calc tr.tot td { background: var(--line-2); font-weight: 600; color: var(--ink); }

/* ── blok rumus ────────────────────────────────────────────── */
.formula {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 16px 2px;
  margin: 20px 0;
  max-width: 620px;
  font-size: 12.5px;
  line-height: 2;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* ── callout ───────────────────────────────────────────────── */
.callout {
  border-left: 2px solid var(--accent);
  background: var(--line-2);
  padding: 14px 16px;
  margin: 20px 0;
  max-width: 66ch;
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(10, 10, 10, 0.78);
}
.callout b { color: var(--ink); }

/* ── daftar ────────────────────────────────────────────────── */
.steps { margin: 16px 0 16px 0; padding-left: 26px; max-width: 66ch; }
.steps li {
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(10, 10, 10, 0.74);
  margin-bottom: 7px;
}

.risk ul { list-style: none; margin: 16px 0; max-width: 66ch; }
.risk li {
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(10, 10, 10, 0.74);
  padding: 12px 0 12px 18px;
  border-top: 1px solid var(--line);
  position: relative;
}
.risk li::before {
  content: "";
  position: absolute;
  left: 0; top: 20px;
  width: 7px; height: 1px;
  background: var(--accent);
}
.risk li:last-child { border-bottom: 1px solid var(--line); }

.note {
  font-size: 11px !important;
  color: var(--dim) !important;
  line-height: 1.7 !important;
  margin-top: 16px;
}

/* ── footer dokumen ────────────────────────────────────────── */
.doc-foot {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 34px;
  margin-top: 34px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
}

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .body { border-left: 0; }
  .toc {
    position: static;
    padding: 22px clamp(16px, 3vw, 32px);
    border-bottom: 1px solid var(--line);
  }
  .toc ol { display: flex; flex-wrap: wrap; gap: 4px 16px; }
}

@media (max-width: 720px) {
  .body { padding: 28px 16px 70px; }
  .toc { padding: 18px 16px; }
  .body table { font-size: 11px; }
  .body th, .body td { padding: 6px 7px; }
  table.calc td:first-child { width: auto; }
}
