/* Depreciation Practice: an accounts clerk's ruled ledger. Cool blue-grey paper, ink-navy text, an oxblood accent,
   ledger-blue double rules under the column heads and down the Dr / Cr fold, figures in a mono face, slab headings.
   The hero carries five falling bars: a reducing balance. On paper: black rules on white, every problem kept whole. */
:root {
  --bg: #eef0f4;
  --paper: #fbfcfe;
  --ink: #161b2e;
  --muted: #4a5168;
  --line: #d3d8e3;
  --edge: #7b8399;
  --accent: #8c2f2b;
  --accent-ink: #ffffff;
  --accent-soft: #f3e3e1;
  --rule: #2f5f9e;
  --given: #f1f3f8;
  --info: #2f5f9e;
  --ok: #1f6a3a;
  --ok-soft: #dcefe2;
  --close: #7a5300;
  --close-soft: #f6ead0;
  --bad: #a3271f;
  --bad-soft: #f8e1dd;
  --focus: #1b5fd0;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --slab: "Rockwell", "Roboto Slab", "Zilla Slab", "Clarendon", "Bookman Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --r: 3px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151821;
    --paper: #1c2030;
    --ink: #e6e9f2;
    --muted: #a8afc4;
    --line: #2e3448;
    --edge: #6b7390;
    --accent: #f2a097;
    --accent-ink: #2a0f0d;
    --accent-soft: #3a2020;
    --rule: #8fb3ea;
    --given: #20253a;
    --info: #8fb3ea;
    --ok: #8fd8a3;
    --ok-soft: #15301d;
    --close: #f0c56b;
    --close-soft: #352a12;
    --bad: #ff9c8f;
    --bad-soft: #3a1c18;
    --focus: #8ab8ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 22px 0 10px; border-bottom: 3px double var(--rule); }
.hero > div:first-child { max-width: 780px; }
h1 { font: 700 clamp(1.75rem, 4.6vw, 2.6rem)/1.08 var(--slab); margin: 0 0 8px; letter-spacing: -0.01em; }
.lede { margin: 0 0 4px; color: var(--muted); max-width: 64ch; }
h2 { font: 700 1.3rem/1.2 var(--slab); margin: 0 0 10px; }
/* five falling bars: 20% reducing balance */
.decline { display: flex; align-items: flex-end; gap: 5px; height: 64px; flex: none; }
.decline span { display: block; width: 14px; background: var(--accent); border-radius: 1px 1px 0 0; }
.decline span:nth-child(1) { height: 100%; } .decline span:nth-child(2) { height: 80%; opacity: 0.88; } .decline span:nth-child(3) { height: 64%; opacity: 0.76; }
.decline span:nth-child(4) { height: 51%; opacity: 0.64; } .decline span:nth-child(5) { height: 41%; opacity: 0.52; }
@media (max-width: 640px) { .decline { display: none; } }

/* layout: settings, then the sheet at full width (a ledger account needs every column) */
.setup { margin: 14px 0 4px; }
.work-area { min-width: 0; }
@media (min-width: 1000px) {
  .setup { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 4px 22px; align-items: end; }
  .setup .setrow { grid-column: 1 / -1; }
}
fieldset { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--edge); border-radius: var(--r); overflow: hidden; max-width: 420px; }
.sg, .lg { position: relative; display: block; cursor: pointer; }
.sg + .sg { border-left: 1px solid var(--edge); }
.sg input, .lg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sg > span { display: flex; align-items: center; justify-content: center; min-height: 44px; height: 100%; padding: 4px 6px; text-align: center; font-size: 0.95rem; font-weight: 650; background: var(--paper); }
.sg input:checked + span { background: var(--ink); color: var(--bg); }
.lseg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.lseg[data-n="7"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 700px) { .lseg { grid-template-columns: repeat(5, minmax(0, 1fr)); } .lseg[data-n="7"] { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.lg > span { display: flex; flex-direction: column; justify-content: center; min-height: 48px; height: 100%; padding: 4px 8px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); font-size: 0.9rem; font-weight: 600; line-height: 1.15; }
.lg b { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.lg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lg input:checked + span b { color: inherit; opacity: 0.85; }
.sg input:focus-visible + span, .lg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.setrow { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
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 10px; }
select { max-width: 100%; }
.btn { font: inherit; font-weight: 650; min-height: 44px; padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 6px 14px; }
.btn:hover { filter: brightness(0.95); }
.link { font: inherit; background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* the marking rules, closed above the sheet */
.rules { margin: 12px 0 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); font-size: 1rem; }
.rules > summary { cursor: pointer; font-weight: 650; padding: 10px 12px; min-height: 44px; }
.rules ul { margin: 0; padding: 0 12px 10px 30px; color: var(--muted); max-width: 80ch; }
.rules li { margin: 0 0 6px; }

.note { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--close); background: var(--close-soft); overflow-wrap: anywhere; border-radius: var(--r); }
.note.info { border-color: var(--info); background: var(--paper); }
.note .link { min-height: 0; padding: 0; font-weight: 600; }

/* the sheet */
.sheet { margin: 12px 0 0; }
.sheet:focus { outline: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.code { font-family: var(--mono); letter-spacing: 0.08em; color: var(--accent); }
.lvname { font: 500 0.9rem var(--sans); color: var(--muted); margin-left: 4px; }
.score { margin: 0; font-size: 0.95rem; color: var(--muted); }
.practice { margin: 6px 0 0; font-size: 0.9rem; color: var(--muted); }
.qs { list-style: none; margin: 0; padding: 0; }
.q { border-bottom: 1px solid var(--line); padding: 22px 0 10px; }
.q h3 { font: 700 1.15rem/1.25 var(--slab); margin: 0 0 4px; }
.q h3 .qn { color: var(--accent); margin-right: 6px; font-family: var(--mono); }
.q .scen { margin: 0 0 8px; max-width: 76ch; }
.qhint { margin: 0 0 10px; font-size: 0.9rem; color: var(--muted); max-width: 76ch; }

/* the schedule and data tables */
.fig { margin: 0 0 12px; min-width: 0; }
.twrap { overflow-x: auto; max-width: 100%; background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r); }
.twrap:focus-visible { outline-offset: -3px; }
.tcap { margin: 0; padding: 7px 10px 5px; font: 700 0.82rem var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--rule); border-bottom: 1px solid var(--line); }
.dt { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.dt th, .dt td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.dt thead th { font-size: 0.78rem; color: var(--muted); font-weight: 650; border-bottom: 3px double var(--rule); vertical-align: bottom; white-space: normal; min-width: 6.5em; }
.dt thead th.c-y { min-width: 0; }
.dt .num { text-align: right; }
.dt td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dt td.num:not(.in) { background: var(--given); }
.dt tbody th { font-weight: 600; font-size: 0.9rem; position: sticky; left: 0; background: var(--paper); z-index: 1; box-shadow: 1px 0 0 var(--line); }
.dt .from { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.dt td.in { padding: 3px 4px; background: transparent; }
.dt.key td.num, .key .dt td.num { background: transparent; }
.fig > .twrap, .keyfig > .twrap { max-width: 900px; }
.je { width: auto; }
.je tr.cr th { padding-left: 2.2em; }
.tacct table.ledger { table-layout: auto; }
.je td.num { min-width: 7em; }

/* ledger accounts: Dr on the left, Cr on the right, the fold ruled in blue */
.accts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.accts.tpair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.ledger-doc { background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r); max-width: 100%; min-width: 0; }
.lhead { padding: 7px 10px 5px; border-bottom: 1px solid var(--line); }
.ltitle { margin: 0; font: 700 1rem var(--slab); text-align: center; }
.lwrap { overflow-x: auto; max-width: 100%; }
.lwrap:focus-visible { outline-offset: -3px; }
table.ledger { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.ledger th, .ledger td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.ledger thead th { font-size: 0.78rem; font-weight: 650; color: var(--muted); text-align: left; vertical-align: bottom; }
.ledger thead th.num { text-align: right; }
.ledger thead th.grp { color: var(--ink); font-size: 0.85rem; border-bottom: 1px solid var(--line); text-align: center; }
.ledger thead tr:last-child th { border-bottom: 3px double var(--rule); }
.ledger .gs:not(:first-child), .ledger thead th.grp + th.grp { border-left: 3px double var(--rule); }
.ledger td.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.ledger td.txt { font-size: 0.88rem; }
.ledger td.c-dd, .ledger td.c-cd { color: var(--muted); font-size: 0.85rem; }
.ledger td.c-dj, .ledger td.c-cj { min-width: 2.2em; }
.ledger td.in { padding: 3px 3px; }
.ledger tr.r-tot td { border-bottom: 1px solid var(--line); }
.ledger tr.r-tot td.num { border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.ledger tr.r-tot td.num.in { padding-top: 4px; padding-bottom: 4px; }
.ledger tr.r-bal td { border-top: 1px solid var(--ink); font-weight: 650; }
.ledger.key td, .key .ledger td { vertical-align: top; }
input.cell { font-family: var(--mono); text-align: right; padding: 5px 5px; min-height: 40px; width: 7.2em; }
/* each problem's boxes fit its longest figure plus one spare character (app.js cellWidth) */
input.cell.w7 { width: calc(8ch + 14px); } input.cell.w8 { width: calc(9ch + 14px); } input.cell.w9 { width: calc(10ch + 14px); }
input.cell.w10 { width: calc(11ch + 14px); } input.cell.w11 { width: calc(12ch + 14px); } input.cell.w12 { width: calc(13ch + 14px); }
select.cell { min-height: 40px; padding: 5px 4px; width: 13em; font-size: 16px; }
.in select.cell { width: 15.5em; }
.uk select.cell { width: 13.5em; }
/* wide screens: the long India names ("Plant and Machinery Disposal", "Profit and loss (profit on sale)") show in full */
@media screen and (min-width: 1100px) { .in select.cell { width: 18.5em; } }
input.cell.is-right, select.cell.is-right { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); background: var(--ok-soft); }
input.cell.is-wrong, input.cell.is-unread, select.cell.is-wrong { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); background: var(--bad-soft); }
input.cell.is-close { border-color: var(--close); box-shadow: inset 0 0 0 1px var(--close); background: var(--close-soft); }
.cellfb { max-width: 76ch; margin: -4px 0 10px; }

/* narrow screens: each account's debit side above its credit side (draw.js split) */
.split .ledger-doc { border: 0; border-radius: 0; }
.split .ledger-doc + .ledger-doc { border-top: 2px solid var(--rule); }
.split .lhead { border-bottom: 0; }
.split .ledger thead th.grp { text-align: left; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--rule); }
.split .ledger thead th.grp + th.grp { border-left: 0; }
.split .ledger .gs:not(:first-child) { border-left: 0; }
.split table.ledger { table-layout: auto; }
.split .ledger td.c-dd, .split .ledger td.c-cd { width: 1%; font-size: 0.8rem; }
.split .ledger td.c-dx, .split .ledger td.c-cx { width: 100%; }
.split select.cell, .split.in select.cell, .split.uk select.cell { width: 100%; min-width: 6em; }
.split .sdate { display: block; font-size: 0.78rem; color: var(--muted); margin: 0 0 2px; }
.split .ledger td.c-dx, .split .ledger td.c-cx { white-space: normal; }
.split .ledger td.c-dj, .split .ledger td.c-cj, .split .ledger .c-dj, .split .ledger .c-cj { display: none; }

/* questions */
.qparts { max-width: 760px; min-width: 0; }
.qparts.pre { margin: 0 0 6px; }
.work[open] { max-width: none; }
.part { margin: 0 0 14px; min-width: 0; }
.part > .prompt, .part legend { display: block; font-weight: 600; margin: 0 0 6px; }
.opts { display: grid; gap: 4px; }
.opt { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); cursor: pointer; }
.opt input { margin: 3px 0 0; min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.opt .ot { min-width: 0; }
.long .opt .ot { font-family: var(--mono); font-size: 0.85rem; }
.opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.ain { display: flex; align-items: center; gap: 4px; }
.ain .pre { font-family: var(--mono); color: var(--muted); }
.ain input { width: 10em; font-family: var(--mono); }
.qfoot { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.qfoot .fb { margin: 0; }
.fbwrap:empty { display: none; }
.fb { margin: 6px 0 0; padding: 6px 10px; border-radius: var(--r); max-width: 76ch; }
.fb.right { background: var(--ok-soft); color: var(--ok); }
.fb.close { background: var(--close-soft); color: var(--close); }
.fb.wrong, .fb.unread { background: var(--bad-soft); color: var(--bad); }
.fb.more { color: var(--muted); padding: 2px 10px; }
.part.is-right .ain input { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.part.is-wrong .ain input, .part.is-unread .ain input { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.part.is-close .ain input { border-color: var(--close); box-shadow: inset 0 0 0 1px var(--close); }
.work { margin-top: 4px; min-width: 0; }
.work .steps, .work .ans { max-width: 80ch; }
.work > summary { cursor: pointer; color: var(--muted); font-size: 0.93rem; padding: 10px 0; min-height: 44px; display: flex; align-items: center; list-style: none; }
.work > summary::-webkit-details-marker { display: none; }
.work > summary::before { content: "+"; margin-right: 6px; font-weight: 700; font-family: var(--mono); }
.work[open] > summary::before { content: "−"; }
.keyfig { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0 0 10px; }
.work .ans { margin: 0 0 2px; }
.steps { list-style: disc; margin: 2px 0 10px; padding-left: 1.4em; font-size: 0.93rem; overflow-wrap: anywhere; }
.sheet-foot { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 12px 0; }
.confirm { flex: 1 1 100%; margin: 0; padding: 10px 12px; border: 1px solid var(--close); border-radius: var(--r); background: var(--close-soft); }
.confirm[hidden] { display: none; }

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

.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; }
.toast.on { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* content */
.content { padding: 22px 0 8px; max-width: 800px; }
.content h2 { margin-top: 30px; }
.content p { max-width: 68ch; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 11px 0; font-weight: 600; min-height: 44px; }
.faq details p { margin: 0 0 12px; }
.sources { font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; margin-top: 22px; }

footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 16px 0 28px; color: var(--muted); font-size: 0.92rem; }
.indep { margin: 0 0 10px; }
.sb-footer p { margin: 6px 0; }
.sb-more { line-height: 1.8; }
.sb-footer a { color: var(--ink); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }

@media (max-width: 600px) {
  .hero { padding-top: 10px; }
  .q .scen { font-size: 0.97rem; }
  .ledger th, .ledger td, .dt th, .dt td { padding: 3px 4px; }
  select.cell, .in select.cell, .uk select.cell { width: 11.5em; }
  .ledger .c-dj, .ledger .c-cj { display: none; }
}
@media screen and (max-width: 360px) {
  .lg > span { padding: 4px 4px; font-size: 0.82rem; }
  .setrow { gap: 8px 10px; }
  /* 320 px phones: the picked details get the full width and the amount goes under them, so long names such as
     "Profit and loss (profit on sale)" or "Statement of profit or loss" are never cut off (fresh-eyes 2026-10-26) */
  .split:not(.us):not(.key) table.ledger, .split:not(.us):not(.key) .ledger thead, .split:not(.us):not(.key) .ledger tbody { display: block; }
  .split:not(.us):not(.key) .ledger tr { display: flex; flex-wrap: wrap; justify-content: flex-end; border-bottom: 1px solid var(--line); }
  .split:not(.us):not(.key) .ledger th, .split:not(.us):not(.key) .ledger td { display: block; border-bottom: 0; }
  .split:not(.us):not(.key) .ledger thead tr:last-child { border-bottom: 3px double var(--rule); }
  .split:not(.us):not(.key) .ledger thead tr:last-child th { border-bottom: 0; }
  .split:not(.us):not(.key) .ledger thead th.grp, .split:not(.us):not(.key) .ledger td.c-dx, .split:not(.us):not(.key) .ledger td.c-cx { flex: 1 0 100%; width: auto; }
  .split:not(.us):not(.key) .ledger thead th.c-dx, .split:not(.us):not(.key) .ledger thead th.c-cx { flex: 1 1 auto; }
  .split:not(.us):not(.key) .ledger td.num { flex: 0 0 auto; }
  .split:not(.us):not(.key) .ledger td.blank, .split:not(.us):not(.key) .ledger .c-dj, .split:not(.us):not(.key) .ledger .c-cj { display: none; }
  .split:not(.us):not(.key) .ledger tr.r-tot { border-bottom: 1px solid var(--line); }
}

/* print: worksheet and key only, black on white */
.print-root { display: none; }
@page { margin: 0.45in 0.45in; }
@media print {
  :root { --ink: #000; --muted: #333; --line: #888; --paper: #fff; --edge: #444; --rule: #000; --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; }
  .ph { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2pt solid #000; margin-bottom: 6pt; }
  .ph h2 { font: 700 14pt var(--slab); margin: 0; }
  .ph p { margin: 0; font-size: 9pt; }
  .pmeta { display: flex; justify-content: space-between; gap: 12pt; margin: 4pt 0 6pt; }
  .plabel { margin: 0 0 6pt; font-size: 8.5pt; font-style: italic; }
  .pq, .pk { list-style: none; margin: 0; padding: 0; }
  .pq > li { padding: 5pt 0 6pt; border-bottom: 0.75pt solid #999; break-inside: avoid; page-break-inside: avoid; }
  .pqh { break-after: avoid; page-break-after: avoid; }
  .pq h3, .pk h3 { font: 700 11pt var(--slab); margin: 0 0 2pt; }
  .pq .pscen { margin: 0 0 4pt; }
  .phint { margin: 0 0 4pt; font-size: 8.5pt; font-style: italic; }
  .fig { margin: 0 0 6pt; }
  .twrap { overflow: visible; border: 0.9pt solid #000; border-radius: 0; }
  .tcap { font-size: 8pt; color: #000; padding: 2pt 5pt; border-bottom: 0.6pt solid #000; }
  .dt { font-size: 9pt; table-layout: fixed; }
  .dt th, .dt td { padding: 2pt 4pt; border: 0.5pt solid #777; white-space: normal; }
  .dt thead th { color: #000; border-bottom: 2pt double #000; font-size: 7.8pt; min-width: 0; }
  .dt tbody th { position: static; box-shadow: none; font-size: 8.5pt; }
  .dt .from { font-size: 7.5pt; color: #000; }
  .dt td.num { white-space: nowrap; }
  .pq .dt tbody td, .pq .dt tbody th { height: 20pt; }
  .sched thead th.c-y { width: 20%; }
  .ledger-doc { border: 0.9pt solid #000; border-radius: 0; break-inside: avoid; page-break-inside: avoid; }
  .lhead { padding: 2pt 5pt; border-bottom: 0.6pt solid #000; }
  .ltitle { font-size: 9.5pt; }
  .lwrap { overflow: visible; }
  table.ledger { font-size: 8.3pt; table-layout: fixed; }
  .ledger th, .ledger td { padding: 2pt 3pt; border: 0.5pt solid #777; white-space: normal; overflow-wrap: anywhere; }
  .ledger thead th { font-size: 7.5pt; color: #000; }
  .ledger thead th.grp { font-size: 9pt; }
  .ledger td.txt { font-size: 8pt; }
  .ledger thead tr:last-child th { border-bottom: 2.2pt double #000; }
  .ledger .gs:not(:first-child), .ledger thead th.grp + th.grp { border-left: 2.2pt double #000; }
  .ledger td.c-dd, .ledger td.c-cd { color: #000; font-size: 7.6pt; }
  .ledger td.num { white-space: nowrap; }
  .ledger col.k-dd, .ledger col.k-cd { width: 13%; } .ledger col.k-dx, .ledger col.k-cx { width: 23%; } .ledger col.k-da, .ledger col.k-ca { width: 14%; }
  .acct.in col.k-dd, .acct.in col.k-cd { width: 12%; } .acct.in col.k-dx, .acct.in col.k-cx { width: 21%; } .acct.in col.k-dj, .acct.in col.k-cj { width: 5%; } .acct.in col.k-da, .acct.in col.k-ca { width: 12%; }
  .tacct table.ledger { min-width: 0; table-layout: fixed; }
  .tacct col.k-dd, .tacct col.k-cd { width: 27%; } .tacct col.k-da, .tacct col.k-ca { width: 23%; }
  table.ledger tr { break-inside: avoid; page-break-inside: avoid; }
  .pq table.ledger tbody td { height: 17pt; }
  .ledger tr.r-tot td.num { border-top: 0.9pt solid #000; border-bottom: 2.2pt double #000; }
  .accts { gap: 6pt; }
  .accts.tpair { grid-template-columns: 1fr 1fr; }
  .pparts { columns: 2; column-gap: 8mm; margin-top: 4pt; }
  .pparts .pp { margin: 0 0 6pt; break-inside: avoid; page-break-inside: avoid; }
  .pparts .pp.long { column-span: all; }
  .pparts .pp p { margin: 0 0 1pt; }
  .pparts ol.popts { margin: 0; padding-left: 14pt; list-style: upper-alpha; font-size: 8.5pt; }
  .pparts .pline { margin-top: 8pt !important; }
  .pparts.pre { margin: 0 0 4pt; }
  .pkey { break-before: page; page-break-before: always; }
  /* each problem's key stays whole, so no answer lines are left alone on the next page (QA 2026-10-26) */
  .pk > li { padding: 4pt 0 5pt; border-bottom: 0.75pt solid #bbb; break-inside: avoid; page-break-inside: avoid; }
  .pk .keyfig { margin: 2pt 0 4pt; gap: 6pt; }
  .pk .twrap, .pk .ledger-doc { break-inside: avoid; page-break-inside: avoid; }
  .pk h3 { break-after: avoid; page-break-after: avoid; }
  .pk .ans { margin: 1pt 0 0; font-weight: 600; font-size: 9.5pt; }
  .pk .steps { margin: 0 0 2pt; padding-left: 13pt; font-size: 8.4pt; line-height: 1.28; }
  .pk .steps li { break-inside: avoid; page-break-inside: avoid; }
  .je { width: 60%; }
}
