/* QED — manual and ledger. Loaded after qed.css: reuses its ground, rules,
   panel and counter vocabulary, and adds only what a document and a table of
   chain facts need that the live plate did not. */

.mono { font-family: var(--mono); }

/* ── manual: document head and table of contents ───────────────────────── */

.doc-head {
  margin: 20px 4px 0;
  max-width: 72ch;
}
.doc-head h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.doc-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(220, 230, 236, 0.82);
}

.doc-toc {
  margin: 18px 4px 0;
  padding: 4px 0 10px;
}
.doc-toc h2 {
  margin: 0;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--rule);
}
.doc-toc ol {
  list-style: none;
  margin: 0;
  padding: 6px 4px;
  columns: 2;
  column-gap: 8px;
}
.doc-toc li { break-inside: avoid; }
.doc-toc a {
  display: block;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
  text-decoration: none;
}
.doc-toc a:hover { color: var(--sulphur); }

/* ── manual: sections ───────────────────────────────────────────────────── */

.doc-section {
  margin: 22px 4px 0;
  max-width: 76ch;
}
.doc-section h2 {
  margin: 0 0 7px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--sulphur);
}
.doc-section .rule.thin { margin: 0 0 11px; }
.doc-section p {
  margin: 0 0 11px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(220, 230, 236, 0.86);
}
.doc-section p:last-child { margin-bottom: 0; }
.doc-section code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--mint);
}

.doc-pre {
  margin: 0 0 11px;
  padding: 10px 13px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--mint);
  background: rgba(8, 22, 34, 0.5);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--rule-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.doc-table tr { border-bottom: 1px solid var(--rule); }
.doc-table tr:last-child { border-bottom: 0; }
.doc-table th,
.doc-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px 8px 0;
  font-weight: 400;
}
.doc-table th {
  color: var(--dim);
  width: 1%;
  white-space: nowrap;
}
.doc-table td { color: var(--ink); }

.doc-list {
  list-style: none;
  margin: 0 0 11px;
  padding: 0;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(220, 230, 236, 0.86);
}
.doc-list-tight { line-height: 1.7; }

/* ── ledger: header strip ───────────────────────────────────────────────── */

.ledger-head { margin: 20px 4px 0; }
.ledger-head .counters { margin: 0; border-top: 1px solid var(--rule); }
.ledger-head a { color: var(--mint); text-decoration: none; }
.ledger-head a:hover { text-decoration: underline; }

.ledger-note {
  margin: 0;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(220, 230, 236, 0.82);
  border-top: 1px solid var(--rule);
}

/* ── ledger: rounds and payouts ─────────────────────────────────────────── */

.ledger-panel { margin: 18px 4px 0; }

.ledger-table { font-family: var(--mono); font-size: 11.5px; }

.ledger-row {
  display: grid;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(232, 238, 242, 0.06);
  align-items: baseline;
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row-head {
  color: var(--dim);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}

.ledger-rounds .ledger-row { grid-template-columns: 54px 150px 150px 100px 110px minmax(0, 1fr); }
.lr-pages, .lr-tokens, .lr-pool { color: var(--mint); text-align: right; }
.lr-id { color: var(--sulphur); }

.ledger-payouts .ledger-row { grid-template-columns: minmax(0, 1.5fr) 100px 170px 190px 90px; }
.lp-tx {
  color: var(--sulphur);
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lp-tx:hover { text-decoration: underline; }
.lp-amount { color: var(--mint); text-align: right; }
.lp-to a, .lp-for { color: rgba(220, 230, 236, 0.78); }
.lp-to a { text-decoration: none; }
.lp-to a:hover { color: var(--mint); text-decoration: underline; }
.lp-when { color: var(--dim); text-align: right; }

.ledger-empty {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
}

@media (max-width: 760px) {
  .doc-toc ol { columns: 1; }
  .ledger-rounds .ledger-row { grid-template-columns: 40px 1fr 1fr; }
  .ledger-rounds .lr-tokens, .ledger-rounds .lr-pool { display: none; }
  .ledger-payouts .ledger-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .ledger-payouts .lp-to, .ledger-payouts .lp-for, .ledger-payouts .lp-when { display: none; }
}
