.serif { font-family: var(--serif); }
.empty-state { padding: 28px 0; color: var(--muted); }

.doc { background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; padding: 12px 28px 20px; }
.par-row { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 0 32px; padding: 14px 0; border-top: 1px solid var(--line); }
.par-row:first-child { border-top: 0; }
.par { position: relative; padding-left: 34px; }
.par-no { position: absolute; left: 0; top: .5em; color: var(--faint); font-size: .78rem; }
.par-text { font-size: 1.0625rem; line-height: 1.78; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; align-content: start; }
.note { padding: 8px 10px; margin: 0 -10px; border-radius: var(--radius); cursor: pointer; }
.note + .note { border-top: 1px solid var(--line); border-radius: 0; }
.note.on { background: var(--vt); }
.note-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.note-raw { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.note-msg { font-size: .9rem; color: var(--ink); margin-top: 4px; }
.note-msg .asof { color: var(--muted); }
.note-more { margin-top: 6px; font-size: .86rem; }
.note-more summary { cursor: pointer; color: var(--muted); }
.ev { display: grid; gap: 2px; margin-top: 8px; }
.ev-label { font-size: .76rem; color: var(--muted); font-weight: 500; }
.ev-text { font-size: .9rem; overflow-wrap: anywhere; }
.ev-text.serif { font-size: .95rem; line-height: 1.6; }

.ledger-wrap { background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: .94rem; }
.ledger th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.ledger td { padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--line); }
.lrow { cursor: pointer; }
.lrow.flat { cursor: default; }
.lrow.flat:hover td { background: transparent; }
.lrow:hover td { background: var(--vt); }
.lrow.open td { background: var(--vt); border-bottom-color: transparent; }
.c-auth { overflow-wrap: anywhere; min-width: 150px; }
.c-found { min-width: 260px; }
.c-found .line { display: block; margin-bottom: 4px; }
.c-where { white-space: nowrap; color: var(--muted); }
.ldetail td { background: var(--sheet); padding: 4px 16px 18px 16px; }
.ldetail-body { display: grid; gap: 14px; max-width: 760px; }

.review { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.review-side { display: grid; gap: 12px; }
.progress { font-size: .88rem; color: var(--muted); }
.queue { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.qitem { width: 100%; display: grid; grid-template-columns: 22px 1fr; gap: 8px; text-align: left; padding: 10px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; }
.qitem:hover { background: var(--vt); }
.qitem.on { background: var(--ink); color: var(--page); }
.qitem.on .qsub { color: inherit; opacity: .8; }
.qitem .qmark { color: var(--v); font-weight: 600; }
.qitem.on .qmark { color: inherit; }
.qitem.done .mono { text-decoration: line-through; text-decoration-thickness: 1px; }
.qtext { display: grid; gap: 1px; min-width: 0; }
.qtext .mono { overflow-wrap: anywhere; font-size: .86rem; }
.qsub { font-size: .8rem; color: var(--muted); }
.review-pane { background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; display: grid; gap: 16px; }
.rp-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.rp-context { font-size: 1.05rem; line-height: 1.75; overflow-wrap: anywhere; }
.rp-row { display: grid; gap: 4px; }
.rp-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.btn.small { padding: 6px 10px; font-size: .86rem; justify-self: start; }

@media (max-width: 900px) {
  .doc { padding: 6px 16px 14px; }
  .par-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .notes { padding-left: 34px; }
  .review { grid-template-columns: minmax(0, 1fr); }
  .ledger th:nth-child(4), .ledger td:nth-child(4) { display: none; }
}
.ledger tr.ldetail[hidden] { display: none; }
@media (max-width: 640px) {
  .ledger, .ledger tbody { display: block; }
  .ledger thead { display: none; }
  .ledger tr.lrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .ledger tr.lrow td { display: block; padding: 0; border: 0; min-width: 0; }
  .ledger tr.lrow .c-found, .ledger tr.lrow .c-where { grid-column: 1 / -1; }
  .ledger tr.lrow .c-where { display: block; }
  .ledger tr.lrow:hover td, .ledger tr.lrow.open td { background: transparent; }
  .ledger tr.lrow:hover, .ledger tr.lrow.open { background: var(--vt); }
  .ledger tr.ldetail { display: block; }
  .ledger tr.ldetail td { display: block; padding: 4px 16px 16px; }
}
