/* Partnership accounts practice: a deed-and-ledger look. Warm grey paper, mulberry ink for the firm, one colour dot
   per partner in every account (teal, ochre, mulberry), serif headings like a printed deed. */
:root {
  --bg: #f3eef0; --paper: #fffdfd; --ink: #221a1e; --muted: #5e5359; --line: #dccfd5; --edge: #8c7e85;
  --accent: #7a2148; --accent-ink: #ffffff; --accent-soft: #f4e1ea; --gold: #85600f; --given: #f8f3f5;
  --p0: #1d6a73; --p1: #8a5a0b; --p2: #7a2148;
  --ok: #1d6b3a; --ok-soft: #e3f1e7; --bad: #a3271d; --bad-soft: #f8e4e1; --warn: #7a5600; --warn-soft: #f6ecd2;
  --r: 6px;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1619; --paper: #241d21; --ink: #f1e9ed; --muted: #c0b2b9; --line: #43363d; --edge: #8a7a82;
    --accent: #e48ab2; --accent-ink: #1b1619; --accent-soft: #3d2330; --gold: #ddb45e; --given: #2a2226;
    --p0: #6cc3cc; --p1: #e0ad55; --p2: #e48ab2;
    --ok: #7fd49a; --ok-soft: #1f3326; --bad: #ff9a8f; --bad-soft: #3d201d; --warn: #e8c46e; --warn-soft: #3a3020;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; }

/* ---------- hero ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 12px; }
.hero h1 { font-size: clamp(1.55rem, 4.4vw, 2.35rem); margin: 0 0 6px; max-width: 22ch; }
.lede { margin: 0; color: var(--muted); max-width: 62ch; }
.seal { flex: none; width: 104px; height: 104px; border-radius: 50%; border: 3px double var(--accent); display: flex; align-items: center; justify-content: center; gap: 3px; font-family: var(--serif); color: var(--accent); transform: rotate(-8deg); }
.seal .sr { font-size: 1.6rem; font-weight: 700; }
.seal .sc { font-size: 1.2rem; color: var(--gold); }
@media (max-width: 560px) { .seal { display: none; } .hero { padding-top: 14px; } }

/* ---------- setup: the deed card ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1000px) { .tool { grid-template-columns: 280px minmax(0, 1fr); } .setup { position: sticky; top: 12px; } }
.setup { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--r); padding: 12px 14px; }
/* phones and tablets: two selects; the desktop sidebar lists every course and task */
.selrow { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-bottom: 10px; }
.selrow label { display: flex; flex-direction: column; gap: 2px; font-family: var(--serif); font-weight: 700; min-width: 0; }
.selrow select { width: 100%; font-family: var(--sans); font-weight: 400; }
.course-f, .levels-f { display: none; }
@media (min-width: 1000px) { .selrow { display: none; } .course-f, .levels-f { display: block; } }
fieldset { border: 0; margin: 0 0 10px; padding: 0; min-width: 0; }
legend { font-family: var(--serif); font-weight: 700; padding: 0; margin-bottom: 6px; }
.seg, .lseg { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 1000px) { .seg, .lseg { flex-direction: column; } }
.sg, .lg { position: relative; }
.sg input, .lg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.sg span, .lg span { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); cursor: pointer; white-space: nowrap; }
.lg b { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.sg input:checked + span, .lg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lg input:checked + span b { color: var(--accent-ink); }
.sg input:focus-visible + span, .lg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.setrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
label.inline { display: flex; align-items: center; gap: 8px; }
select, input { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r); min-height: 44px; padding: 6px 8px; }
.btn { font: inherit; min-height: 44px; padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--accent); background: var(--paper); color: var(--accent); cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 40px; padding: 6px 14px; }
.link { font: inherit; background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 10px 2px; min-height: 44px; }

/* ---------- notes and rules ---------- */
.note { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--r); background: var(--warn-soft); border: 1px solid var(--warn); }
.note.info { background: var(--accent-soft); border-color: var(--accent); }
/* the kept-copy note names a storage key with no spaces; it wraps instead of pushing the page sideways at 320 px */
#store-note { overflow-wrap: anywhere; }
.rules { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px; margin-bottom: 12px; }
.rules summary { min-height: 44px; display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.rules summary span { font-weight: 400; color: var(--muted); }
.rules ul { margin: 0 0 12px; padding-left: 20px; }
.rules li + li { margin-top: 4px; }

/* ---------- the sheet ---------- */
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.sheet:focus { outline: none; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.sheet-head h2 { margin: 0; font-size: 1.3rem; }
.code { font-family: var(--mono); letter-spacing: 0.08em; color: var(--accent); }
.lvname { font-family: var(--sans); font-size: 0.95rem; font-weight: 400; color: var(--muted); }
.score { margin: 0; color: var(--muted); }
.practice { margin: 6px 0 4px; font-size: 0.9rem; color: var(--muted); }
.qs { list-style: none; margin: 0; padding: 0; }
.q { padding: 16px 0; margin: 14px 0; }
.q h3 { margin: 0 0 6px; font-size: 1.15rem; display: flex; gap: 8px; align-items: baseline; }
.q h3 .qn { font-family: var(--mono); color: var(--accent); font-size: 1rem; }
.scen { margin: 0 0 10px; max-width: 75ch; }
.qhint { margin: 8px 0; font-size: 0.92rem; color: var(--muted); }
.given { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 6px; }
.given .twrap { flex: 0 1 auto; }
.fig { margin: 0 0 12px; }

/* ---------- tables ---------- */
.twrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.tcap { margin: 0; padding: 6px 10px; font-family: var(--serif); font-weight: 700; border-bottom: 1px solid var(--line); background: var(--given); }
.dt { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.dt th, .dt td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dt thead th { font-size: 0.82rem; color: var(--muted); font-weight: 600; text-align: left; border-bottom: 2px solid var(--edge); }
.dt .num { text-align: right; white-space: nowrap; }
.dt .txt { text-align: left; }
.dt tbody th { font-weight: 400; }
.dt tfoot th, .dt tfoot td { border-top: 2px solid var(--edge); font-weight: 600; }
.dt td.in { padding: 4px; }
.gt td, .gt th { padding: 5px 10px; }
.cell { width: 8.5em; text-align: right; font-variant-numeric: tabular-nums; }
.cell.t-months { width: 5em; }
.cell.is-right { border-color: var(--ok); background: var(--ok-soft); }
.cell.is-wrong, .cell.is-unread { border-color: var(--bad); background: var(--bad-soft); }
.cell.is-missing { border-color: var(--warn); background: var(--warn-soft); border-style: dashed; }
.calc { width: auto; min-width: 100%; }
.tacc.one, .vert { width: auto; min-width: min(100%, 520px); }
.tacc .grp { text-align: center; border-left: 2px solid var(--edge); }
.tacc .gs { border-left: 2px solid var(--edge); }
.pdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--p0); }
.p1 .pdot { background: var(--p1); } .p2 .pdot { background: var(--p2); }
.tacc.wide th.txt { min-width: 9.5em; }
.acw.split > .tcap { border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; border-bottom: 0; }
.acw.split > .twrap { border-radius: 0; }
.acw.split > .twrap + .twrap { border-top: 0; }
.acw.split > .twrap:last-child { border-radius: 0 0 var(--r) var(--r); }
.pblock caption { text-align: left; padding: 8px 10px 4px; font-weight: 700; }
.pblock .cell { width: 7.2em; }
.vert td.pre { color: var(--muted); font-size: 0.85rem; width: 3.5em; }
.vert th.pre { width: 3.5em; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.vert tr.sub th, .vert tr.sub td { border-top: 2px solid var(--edge); font-weight: 600; }
.adjt .tag { color: var(--muted); font-size: 0.82rem; }
.adjt th.txt { min-width: 12em; }

/* ---------- lettered questions ---------- */
.qparts { display: grid; gap: 10px; margin: 0 0 12px; max-width: 640px; }
.part { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); }
.part.is-right { border-color: var(--ok); } .part.is-wrong, .part.is-unread { border-color: var(--bad); }
.prompt { display: block; margin-bottom: 6px; }
.ain { display: flex; align-items: center; gap: 6px; }
.ain input { width: 11em; text-align: right; }
.ain .pre, .ain .post { color: var(--muted); }

/* ---------- feedback ---------- */
.fbwrap:empty { display: none; }
.fb { margin: 6px 0 0; padding: 6px 10px; border-radius: var(--r); background: var(--bad-soft); font-size: 0.93rem; }
.fb.right { background: var(--ok-soft); } .fb.missing { background: var(--warn-soft); } .fb.more { background: none; color: var(--muted); }
.cellfb { margin: 0 0 8px; }
.qfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.work { margin-top: 10px; }
.work summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; }
.keyfig > * + * { margin-top: 10px; }
.kans .ans { margin: 4px 0; }
.wh { margin: 12px 0 4px; font-size: 1rem; }
.steps { margin: 0; padding-left: 20px; font-variant-numeric: tabular-nums; }
.steps li { margin: 2px 0; }

/* ---------- key: two-sided accounts ---------- */
.tform { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tsides { display: flex; flex-wrap: wrap; }
.tside { flex: 1 1 300px; width: auto; }
.tside.dr { border-right: 2px solid var(--edge); }
.tside .sidehead th { text-align: center; font-family: var(--serif); color: var(--ink); font-size: 0.95rem; border-bottom: 1px solid var(--line); }
.tside td.inner, .vert td.inner, .tside th.inner, .vert th.inner { color: var(--muted); }
.tside tr.mem th, .vert tr.mem th { padding-left: 22px; }
.tside tr.sub th { padding-left: 22px; font-size: 0.85rem; color: var(--muted); }
.tside tbody tr:empty { display: none; }
.tform .twrap { border: 0; }
.jkey .jdr { float: right; color: var(--muted); }
.jkey .ind { padding-left: 24px; }
.jkey tr.narr th { font-size: 0.88rem; color: var(--muted); }

.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.confirm { margin: 0; flex-basis: 100%; }
.share { margin: 14px 0 0; }
.print-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.print-row label { display: flex; align-items: center; gap: 6px; }
.share-out label { display: flex; flex-direction: column; gap: 4px; }
.share-out input { width: 100%; }
.recent { margin-top: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px; }
.recent summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.recent ul { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 6px 0; }
.recent small { display: block; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9rem; }

/* ---------- content ---------- */
.content { max-width: 75ch; margin: 30px 0 10px; }
.content h2 { font-size: 1.35rem; margin: 26px 0 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.faq p { margin: 0 0 12px; }
.sources { font-size: 0.88rem; color: var(--muted); }
footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 16px 0 30px; font-size: 0.9rem; color: var(--muted); }
.indep { margin: 0 0 10px; }
.sb-footer p { margin: 6px 0; }
.sb-more { line-height: 1.9; }
.sb-footer a { color: var(--ink); }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 160%); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r); max-width: calc(100% - 32px); transition: transform 0.2s; z-index: 20; pointer-events: none; }
.toast.on { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } * { scroll-behavior: auto !important; } }
.print-root { display: none; }
@media (max-width: 480px) {
  .sheet { padding: 10px; }
  .dt th, .dt td { padding: 5px 6px; }
  .cell { width: 7.4em; }
  .calc .cell { width: 6.6em; padding: 6px 5px; }
  .calc .cell.t-months { width: 3.4em; }
  .calc th, .calc td { padding: 5px 4px; }
  .tacc.one th.txt, .vert th.txt { font-size: 0.92rem; }
  .sg span, .lg span { padding: 8px 10px; }
}

/* ---------- print ---------- */
@page { margin: 13mm 12mm; }
@media print {
  :root { --ink: #000; --muted: #333; --line: #888; --paper: #fff; --edge: #444; --given: #fff; --accent: #000; }
  body { background: #fff; color: #000; font: 10pt/1.36 var(--sans); }
  main, footer, .toast, .skip { display: none !important; }
  .print-root { display: block; }
  table.pt { width: 100%; border-collapse: collapse; }
  table.pt > tbody > tr > td, table.pt > thead > tr > td { padding: 0; }
  .prun { font: 8pt var(--sans); color: #444; text-align: right; padding-bottom: 5pt !important; }
  .psheet + .psheet, .pkey { break-before: page; page-break-before: always; }
  .ph { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2pt solid #000; margin-bottom: 6pt; gap: 10pt; }
  .ph h2 { font: 700 15pt var(--serif); margin: 0; }
  .ph p { margin: 0; font-size: 9pt; text-align: right; }
  .pmeta { display: flex; justify-content: space-between; gap: 12pt; margin: 4pt 0 6pt; }
  .prules { margin: 0 0 6pt; padding-left: 12pt; font-size: 8pt; }
  .pq, .pk { list-style: none; margin: 0; padding: 0; }
  .pq > li, .pk > li { padding: 5pt 0 6pt; border-bottom: 0.75pt solid #999; }
  .pq > li.pq-iod, .pq > li.pq-ioc, .pq > li.pq-gty, .pq > li.pq-past, .pq > li.pq-app, .pk > li.pk-iod, .pk > li.pk-ioc, .pk > li.pk-gty, .pk > li.pk-app, .pk > li.pk-past { break-inside: avoid; page-break-inside: avoid; }
  .pqh { break-after: avoid; page-break-after: avoid; }
  .pq h3, .pk h3 { font: 700 11.5pt var(--serif); margin: 0 0 2pt; break-after: avoid; page-break-after: avoid; }
  .pscen { margin: 0 0 4pt; }
  .given { display: flex; flex-wrap: wrap; gap: 6pt; margin: 0 0 5pt; }
  .fig { margin: 0 0 5pt; }
  .twrap, .tform { overflow: visible; border: 0.9pt solid #000; border-radius: 0; break-inside: avoid; page-break-inside: avoid; }
  .tform .twrap { border: 0; }
  .tcap { font-size: 9pt; color: #000; padding: 2pt 5pt; border-bottom: 0.6pt solid #000; background: #fff; }
  .dt { font-size: 8.8pt; }
  .dt th, .dt td { padding: 2pt 4pt; border: 0.5pt solid #777; }
  .dt thead th { color: #000; border-bottom: 1.6pt double #000; font-size: 7.8pt; }
  .dt tfoot th, .dt tfoot td { border-top: 0.9pt solid #000; border-bottom: 2.2pt double #000; }
  .pq .calc tbody td, .pq .tside tbody td, .pq .vert tbody td, .pq .adjt tbody td, .pq .jkey tbody td, .pq .calc tfoot td, .pq .tside tfoot td, .pq .adjt tfoot td { height: 15pt; }
  .calc, .tacc.one, .vert { width: 100%; min-width: 0; }
  .vert.blank th.txt { width: 60%; }
  .tsides { display: flex; flex-wrap: nowrap; }
  .tside { flex: 1 1 0; table-layout: fixed; }
  .tside.dr { border-right: 1.6pt double #000; }
  .tside th, .tside td { overflow-wrap: anywhere; }
  .tside.multi thead tr:last-child th.txt { width: 34%; }
  .tside:not(.multi) thead tr:last-child th.txt { width: 54%; }
  .tside .sidehead th { font-size: 9pt; }
  .tside tr.mem th, .vert tr.mem th { padding-left: 10pt; }
  .steps { padding-left: 12pt; font-size: 8.4pt; columns: 2; column-gap: 16pt; }
  .steps li { break-inside: avoid; page-break-inside: avoid; }
  .wh { font: 700 9pt var(--sans); margin: 5pt 0 2pt; }
  .kans .ans { margin: 1pt 0; font-size: 9pt; }
  .pk .keyfig > * + * { margin-top: 5pt; }
  .qparts { display: grid; grid-template-columns: 1fr 1fr; gap: 3pt 14pt; max-width: none; margin: 0 0 5pt; }
  .pp p { margin: 0; }
  .pp .pline { margin: 3pt 0 4pt; }
  .pdot { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .jkey .jdr { float: right; }
}
@media screen and (max-width: 360px) {
  .sheet { padding: 8px; }
  .calc .cell { width: 5.1em; }
  .calc .cell.t-months { width: 2.9em; }
  .calc th, .calc td { padding: 4px 3px; }
  .calc tbody th, .calc tfoot th, .calc td.num, .calc thead th { font-size: 0.84rem; }
}
@media screen and (max-width: 480px) {
  .pblock .cell { width: 6.2em; }
  .pblock th.txt { overflow-wrap: anywhere; font-size: 0.92rem; }
  .pblock th, .pblock td { padding: 4px; }
}
@media screen and (max-width: 360px) {
  .tacc.one, .vert { min-width: 0; }
  .tacc.one .cell, .vert .cell, .pblock .cell { width: 5.6em; }
  .tacc.one th, .tacc.one td, .gt th, .gt td { padding: 4px 3px; }
  .gt th, .gt td, .tacc.one th.txt { font-size: 0.86rem; }
}
@media screen and (max-width: 360px) {
  .gt td.num { white-space: normal; }
  .calc tbody th { font-size: 0.8rem; }
}
@media screen and (max-width: 480px) {
  .tacc.one .cell, .vert .cell { width: 6.4em; }
  .tacc.one th, .tacc.one td, .vert th, .vert td { padding: 4px; }
}
/* phones: every form is a fixed-layout table as wide as its box, the answer boxes fill their cells, so no form ever
   scrolls sideways (lessons §5) */
@media screen and (max-width: 480px) {
  #qs .dt.calc, #qs .dt.tacc, #qs .dt.vert, #qs .dt.adjt, #qs .dt.gt { table-layout: fixed; width: 100%; min-width: 0; }
  #qs .dt td.in .cell { width: 100%; min-width: 0; padding: 6px 4px; }
  #qs .dt th, #qs .dt td { padding: 4px 3px; overflow-wrap: anywhere; }
  #qs .dt .num { white-space: normal; }
  #qs .calc thead th:first-child { width: 31%; }
  #qs .calc thead th:nth-child(2) { width: 21%; }
  #qs .tacc.one thead th:first-child, #qs .pblock thead th:first-child { width: 42%; }
  #qs .vert thead th.pre { width: 2.6em; }
  #qs .vert thead th.txt { width: 46%; }
  #qs .gt thead th:first-child { width: 34%; }
  #qs .dt thead th { font-size: 0.78rem; }
  #qs .dt tbody th, #qs .dt td.num { font-size: 0.9rem; }
}
@media screen and (max-width: 480px) {
  #qs .dt td.num, #qs .dt th.num { overflow-wrap: normal; white-space: nowrap; }
  #qs .gt td.num { white-space: normal; }
  #qs .calc thead th:first-child { width: 29%; }
  #qs .calc thead th:nth-child(2) { width: 23%; }
  #qs .vert thead th.pre { width: 3.3em; }
  #qs .vert td.pre { font-size: 0.8rem; overflow-wrap: normal; }
}
@media screen and (max-width: 360px) {
  #qs .calc tbody td.num, #qs .calc tfoot td.num { font-size: 0.82rem; }
}
@media screen and (max-width: 360px) {
  #qs .gt th.num { white-space: normal; }
  #qs .gt td.num { font-size: 0.8rem; }
  #qs .gt thead th:first-child { width: 30%; }
}
/* ruled like a ledger: square tables, lettered questions on a rule rather than in boxes, the rules panel open on the page */
.twrap, .tform { border-radius: 0; }
.acw.split > .tcap, .acw.split > .twrap:last-child { border-radius: 0; }
.part { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 0 10px; }
.part.is-right { border-bottom-color: var(--ok); } .part.is-wrong, .part.is-unread { border-bottom-color: var(--bad); }
.rules { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 0 2px; }
.recent { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 0 2px; }
@media print {
  .ph h2 { white-space: nowrap; }
  .ph p { max-width: 62%; }
  .pq .calc tbody td, .pq .tside tbody td, .pq .vert tbody td, .pq .adjt tbody td, .pq .jkey tbody td, .pq .calc tfoot td, .pq .tside tfoot td, .pq .adjt tfoot td { height: 13pt; }
  .dt th, .dt td { padding: 1.5pt 4pt; }
  /* a whole problem stays on one page; a problem that is longer than a page may still run on */
  .pq > li.pq-acc, .pk > li.pk-acc { break-inside: avoid; page-break-inside: avoid; }
  .pq > li + li.pq-acc { break-before: page; page-break-before: always; }
}
@media print {
  /* problem 1 starts under the sheet header; its tables still never split */
  .pq > li.pq-acc:first-child { break-inside: auto; page-break-inside: auto; }
}
@media screen and (max-width: 480px) {
  /* dates and labels wrap between words, never inside one ("Decembe / r") */
  #qs .calc tbody th, #qs .calc tfoot th { overflow-wrap: normal; word-break: normal; }
}
/* the net effect in the key ("Dr. 9,120 (excess)") wraps under its amount on a phone */
.adjt.key td.num { white-space: normal; }
.adjt.key td.num small { display: inline-block; }
#qs .adjt.key td.num { white-space: normal; }
#qs .adjt.key td.num small { display: block; }
.jkey .jdr { margin-left: 8px; }
/* per-partner blocks: each reads as one T-account (Dr and Cr boxes close together), two or three up when the sheet is
   wide, one under another on a phone; the caption spans the row (builder recheck 2026-10-27) */
.acw.split { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px 14px; align-items: start; }
.acw.split > .tcap { grid-column: 1 / -1; border: 0; border-bottom: 2px solid var(--edge); background: none; padding: 4px 0; }
.acw.split > .twrap, .acw.split > .twrap + .twrap { border: 1px solid var(--line); border-top: 3px solid var(--edge); max-width: 420px; }
.acw.split .pblock .cell { width: 100%; min-width: 4.5em; }
.acw.split .pblock thead th:first-child { width: 46%; }
.pblock.p0 caption .pdot { background: var(--p0); }
/* a one-column account or statement keeps its frame to its own width */
.twrap.acw { width: fit-content; max-width: 100%; }
