/* Cash budget practice: a bookkeeper's analysis pad. Navy ink on buff paper, terracotta for what matters, month columns
   with tabular figures, deficits in brackets. */
:root {
  --bg: #f4f0e4; --paper: #fffef9; --ink: #18213a; --muted: #3b4560; --line: #d8d2c0; --line2: #7b7f8e; --rule: #1f2a44;
  --accent: #a3401a; --accent-ink: #fff; --hi: #ebeef5; --soft: #f7f4ea; --given: #f2eee2;
  --right: #1d6b3a; --wrong: #a8231a; --close: #7a5300; --info: #1f2a44;
  --mk-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231d6b3a' stroke-width='2.4'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E");
  --mk-wrong: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a8231a' stroke-width='2.4'%3E%3Cpath d='M3.5 3.5l9 9M12.5 3.5l-9 9'/%3E%3C/svg%3E");
  --mk-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237a5300' stroke-width='2.4'%3E%3Cpath d='M8 2.5v7M8 13v.5'/%3E%3C/svg%3E");
  --mk-empty: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a8231a' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3C/svg%3E");
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", "P052", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r: 4px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141f; --paper: #172036; --ink: #e9ecf3; --muted: #bcc4d6; --line: #2d3752; --line2: #6b7591; --rule: #a9bbe6;
    --accent: #f2a27e; --accent-ink: #1b0f08; --hi: #222d48; --soft: #1b2440; --given: #1a2239;
    --right: #6fd394; --wrong: #ff8f80; --close: #f0c060; --info: #a9bbe6;
    --mk-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236fd394' stroke-width='2.4'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E");
    --mk-wrong: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ff8f80' stroke-width='2.4'%3E%3Cpath d='M3.5 3.5l9 9M12.5 3.5l-9 9'/%3E%3C/svg%3E");
    --mk-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23f0c060' stroke-width='2.4'%3E%3Cpath d='M8 2.5v7M8 13v.5'/%3E%3C/svg%3E");
    --mk-empty: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ff8f80' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='5.5'/%3E%3C/svg%3E");
  }
}
* { 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); }
a { color: var(--accent); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 9; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; font-weight: 700; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.hero { padding: 22px 0 4px; }
.hero h1 { font-size: clamp(1.5rem, 4.4vw, 2.3rem); margin: 0 0 6px; }
.lede { margin: 0 0 4px; max-width: 66ch; }

/* setup */
.setup { margin: 10px 0 12px; }
fieldset { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
legend { font-weight: 650; margin-bottom: 4px; }
.chips, .steps-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .step { position: relative; }
.chip input, .step input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span, .step span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 13px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--paper); }
.step b { font-family: var(--mono); font-weight: 600; }
.chip input:checked + span, .step input:checked + span { background: var(--rule); color: var(--paper); border-color: var(--rule); }
.chip input:focus-visible + span, .step input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.setrow { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.inline { display: inline-flex; align-items: center; gap: 8px; }
select, input { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line2); border-radius: var(--r); min-height: 44px; padding: 6px 8px; max-width: 100%; }
.btn { font: inherit; font-weight: 600; min-height: 44px; padding: 8px 16px; border-radius: var(--r); border: 1.5px solid var(--accent); background: var(--paper); color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.small { min-height: 44px; padding: 6px 14px; }
.link { font: inherit; background: none; border: 0; padding: 8px 2px; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 44px; }
.note { padding: 10px 12px; background: var(--paper); border: 1px solid var(--wrong); border-radius: var(--r); margin: 8px 0; }
#store-note { overflow-wrap: anywhere; }
.note.info { border-color: var(--info); }

/* the sheet: an analysis pad, a double rule under its heading */
.sheet { background: var(--paper); border: 1px solid var(--line2); padding: 14px 18px; margin: 8px 0 18px; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; border-bottom: 3px double var(--rule); padding-bottom: 6px; }
.sheet-head h2 { margin: 0; font-size: 1.3rem; }
.code { font-family: var(--mono); letter-spacing: .06em; color: var(--accent); }
.lvname { font-family: var(--sans); font-weight: 400; font-size: 1rem; color: var(--muted); }
.score { margin: 0; color: var(--muted); }
.rules { margin: 6px 0; }
.rules summary, details.work summary, .recent summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--accent); }
.rules ul { margin: 2px 0 8px; padding-left: 20px; max-width: 72ch; }
.qs { list-style: none; margin: 0; padding: 0; }
.q { padding: 12px 0 18px; border-bottom: 1px solid var(--line2); }
.q h3 { font-size: 1.2rem; margin: 4px 0 6px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.q h3 .see { margin-left: auto; font: 600 1rem var(--sans); white-space: nowrap; padding: 10px 0; }
.qn { font-family: var(--mono); color: var(--accent); }
.qt { flex: 1 1 14rem; min-width: 0; }
.scen, .task { margin: 0 0 8px; max-width: 72ch; }
.task { font-weight: 600; }
.part { margin: 14px 0 4px; }
.part h4 { font-size: 1.08rem; margin: 0 0 6px; }
.info { margin: 0 0 10px; padding-left: 22px; max-width: 76ch; }
.info li { margin: 2px 0; }
.calc { margin: 0 0 6px; padding-left: 26px; max-width: 76ch; }
.calc > li { margin: 0 0 10px; }
.calc p { margin: 0 0 4px; }
.copts { margin: 4px 0; }

/* tables: sales by month, the schedules, the cash budget */
.twrap { overflow-x: auto; max-width: 100%; margin: 0 0 10px; position: relative; }
table.st { border-collapse: collapse; width: 100%; }
.st caption { text-align: left; padding-bottom: 4px; }
.st-t { font-family: var(--head); font-weight: 700; font-size: 1.08rem; margin-right: 10px; }
.st-s { color: var(--muted); }
.st th, .st td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: middle; }
.st thead th { font-weight: 600; border-bottom: 1.5px solid var(--rule); vertical-align: bottom; }
.st thead th.grp { text-align: center; border-bottom: 1px solid var(--line2); }
.st .amt { text-align: right; font-variant-numeric: tabular-nums; }
.st td.amt + td.amt, .st th.amt + th.amt, .st th.grp + th.grp { border-left: 1px solid var(--line); }
.st td.given, .st tr.given td { background: var(--given); }
.st th[scope="row"] { white-space: nowrap; }
.st tfoot th, .st tfoot td, .st tr.tot th, .st tr.tot td { border-top: 1.5px solid var(--rule); font-weight: 650; background: var(--hi); }
.st tfoot th, .st tfoot td, .st tr.end th, .st tr.end td { border-bottom: 3px double var(--rule); }
.st thead th.sech { font-family: var(--head); font-weight: 700; text-align: left; }
.st.sales thead td { border-bottom: 1.5px solid var(--rule); }
.st tr.sec th { font-family: var(--head); font-weight: 700; padding-top: 10px; border-bottom: 0; }
.bas-s { display: block; color: var(--muted); font-size: 1rem; }
.narrow { max-width: 34rem; }
.st.sales { max-width: 46rem; }
.st.sched { max-width: 54rem; }
.st.cb { max-width: 54rem; }
.st.cb th[scope="row"] { white-space: normal; min-width: 13rem; }
.st.items th[scope="row"] { white-space: normal; min-width: 16rem; }
.st.bva th[scope="row"] { white-space: normal; min-width: 10rem; }
.inum { font-family: var(--mono); color: var(--accent); }

/* answer boxes: one width per kind of answer */
.cell { font-variant-numeric: tabular-nums; text-align: right; padding: 6px 6px; }
.cell.u-r { width: 9.5rem; }
.cell.u-pct { width: 8rem; }
select.cell { text-align: left; padding-right: 4px; }
select.m-c { width: 19rem; }
.answers { display: grid; gap: 6px; margin: 8px 0 4px; max-width: 46rem; }
.arow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 6px; max-width: 46rem; }
.kv { font-variant-numeric: tabular-nums; font-weight: 650; }
.arow .kv { text-align: right; }
.cell.is-right { border-color: var(--right); box-shadow: inset 0 0 0 1px var(--right); }
.cell.is-wrong, .cell.is-unread, .cell.is-empty { border-color: var(--wrong); box-shadow: inset 0 0 0 1px var(--wrong); }
.cell.is-empty { border-style: dashed; }
.cell.is-close, .cell.is-own { border-color: var(--close); box-shadow: inset 0 0 0 1px var(--close); border-style: dashed; }
.cell:is(.is-right, .is-wrong, .is-unread, .is-close, .is-own, .is-empty) { background-repeat: no-repeat; background-position: 5px center; background-size: 15px; padding-left: 24px; }
.cell.is-right { background-image: var(--mk-right); }
.cell.is-wrong, .cell.is-unread { background-image: var(--mk-wrong); }
.cell.is-close, .cell.is-own { background-image: var(--mk-close); }
.cell.is-empty { background-image: var(--mk-empty); }

/* tables that do not fit (fit.js): each row a block, each value on its own line with its column name */
.twrap.rows table, .twrap.rows tbody, .twrap.rows thead, .twrap.rows tfoot, .twrap.rows tr, .twrap.rows caption { display: block; width: 100%; }
.twrap.rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.twrap.rows tr { border-bottom: 1.5px solid var(--line2); padding: 4px 0 6px; }
.twrap.rows th[scope="row"], .twrap.rows tr.sec th { display: block; border: 0; padding: 2px 0; font-weight: 650; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.twrap.rows tr.sec { border-bottom: 0; padding-top: 10px; }
.twrap.rows td { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; padding: 2px 0; background: none; text-align: right; }
.twrap.rows td::before { content: attr(data-l); text-align: left; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.twrap.rows td.nil { display: none; }
.twrap.rows tr.given td, .twrap.rows tr.given { background: var(--given); }
.twrap.rows tfoot tr, .twrap.rows tr.tot { background: var(--hi); border-top: 1.5px solid var(--rule); border-bottom: 3px double var(--rule); }
.twrap.rows tfoot th, .twrap.rows tfoot td, .twrap.rows tr.tot th, .twrap.rows tr.tot td { border: 0; background: none; }
.twrap.rows .cell { flex: none; }
.twrap.rows td > .kv, .twrap.rows td > input.cell { margin-left: auto; text-align: right; }
.twrap.rows td > select.cell { margin-left: auto; }
.twrap.rows td.amt + td.amt { border-left: 0; }
.twrap.rows .bas-s { display: inline; margin-left: 6px; }
.twrap.rows td.cm { flex-wrap: wrap; }
.twrap.rows td.cm::before { flex-basis: 100%; }
.twrap.rows td.cm > select.cell { width: 100%; margin-left: 0; }

/* feedback */
.fbwrap { margin: 8px 0 0; max-width: 72ch; }
.fb { margin: 4px 0; padding: 6px 10px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--soft); }
.fb.right { border-color: var(--right); }
.fb.sum, .fb.wrong, .fb.unread, .fb.empty { border-color: var(--wrong); }
.fb.close, .fb.own { border-color: var(--close); }
.fblist { margin: 6px 0 0; padding-left: 1.8em; }
.fblist li.fb { margin: 4px 0; }
.qfoot { margin-top: 8px; }

/* the key */
details.work { margin-top: 8px; }
.keyfig { margin: 4px 0; }
.steps { margin: 6px 0 8px; padding-left: 20px; max-width: 76ch; }
.steps li { margin: 2px 0; font-variant-numeric: tabular-nums; }
.steps li.say { list-style: none; margin: 6px 0 2px -20px; }
.steps li.sh { list-style: none; margin: 10px 0 2px -20px; font-weight: 650; }
.st.bva .bas-s { white-space: nowrap; }

.sheet-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 12px; }
.confirm { flex-basis: 100%; margin: 0; padding: 8px 10px; background: var(--soft); border: 1px solid var(--close); border-radius: var(--r); }
.save-hint { flex-basis: 100%; margin: 0; color: var(--muted); }
.share { margin: 0 0 22px; }
.print-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.print-row label, .share-out label { display: grid; gap: 2px; }
.share-out input { width: 100%; font-family: var(--mono); }
.recent ul { list-style: none; padding: 0; margin: 4px 0; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.recent small { display: block; color: var(--muted); font-size: 1rem; }
.hint { color: var(--muted); margin: 6px 0; }

/* content below the tool */
.content { max-width: 72ch; padding-bottom: 20px; }
.content h2 { font-size: 1.4rem; margin: 26px 0 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 10px 0; font-weight: 600; min-height: 44px; }
.faq p { margin: 0 0 12px; }
.sources { color: var(--muted); overflow-wrap: anywhere; }

footer { border-top: 1px solid var(--line2); padding: 16px 0 28px; color: var(--muted); font-size: 1rem; }
.indep { margin: 0 0 10px; }
.sb-footer p { margin: 6px 0; }
.sb-more { line-height: 1.8; }
.sb-footer a { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 140%); max-width: min(92vw, 520px); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r); transition: transform .2s; z-index: 10; pointer-events: none; }
.toast.on { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
.print-root { display: none; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .sheet { padding: 10px 8px; }
  .hero { padding-top: 14px; }
  .hero h1 { font-size: 1.4rem; }
  .lede { display: none; }
  .chip span, .step span { padding: 6px 10px; }
  .steps-row { display: grid; grid-template-columns: 1fr 1fr; }
  .step span { width: 100%; height: 100%; }
  .arow { grid-template-columns: minmax(0, 1fr); }
  .arow > .cell, .arow .kv { justify-self: end; }
  .calc { padding-left: 20px; }
}
@media (max-width: 380px) {
  select.m-c { width: 15rem; }
  .twrap.rows td { flex-wrap: wrap; }
}

@media print {
  :root { --ink: #000; --muted: #222; --line: #888; --line2: #444; --rule: #000; --paper: #fff; --bg: #fff; --accent: #000; --hi: #fff; --given: #fff; --soft: #fff; }
  @page { margin: 9mm 12mm; }
  body { background: #fff; color: #000; font: 10pt/1.25 var(--sans); }
  main, footer, .skip, .toast { display: none !important; }
  .print-root { display: block; }
  .psheet, .pkey { break-after: page; }
  .pkey:last-child, .psheet:last-child { break-after: auto; }
  table.pt { width: 100%; border-collapse: collapse; }
  .pt > thead .prun { color: #222; font-size: 10pt; padding-bottom: 4px; border-bottom: 0.5pt solid #888; }
  .ph h2 { margin: 4px 0 4px; font-size: 15pt; }
  .ph p { margin: 0 0 4px; }
  .pmeta { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; }
  .phrow { display: flex; align-items: baseline; gap: 12mm; margin: 0 0 6pt; }
  .phrow .pmeta { flex: 1; margin: 0; }
  .prules { margin: 0 0 6pt; padding-left: 14pt; columns: 2; column-gap: 8mm; }
  .prules li { break-inside: avoid; }
  .pq, .pk { list-style: none; margin: 0; padding: 0; }
  .pq > li { padding: 2pt 0 3pt; border-top: 0.5pt solid #888; }
  .pq > li.pb { break-before: page; }
  .pk > li { padding: 4pt 0 8pt; border-top: 0.5pt solid #888; }
  .pk > li:last-child { padding-bottom: 0; }
  .pk > li:last-child .steps { margin-bottom: 0; }
  /* a short key (which statement, missing figures) stays on one page with its table */
  .pk > li.pk-items, .pk > li.pk-mf { break-inside: avoid; }
  .pqh { break-after: avoid; }
  .pqh h3, .pk h3 { font-size: 12pt; margin: 2pt 0 2pt; break-after: avoid; }
  .part { margin: 4pt 0 0; }
  .task.run { break-inside: avoid; break-after: avoid; margin: 0 0 2pt; }
  .task.run .th { font-family: var(--head); font-size: 11pt; }
  .part h4 { font-size: 11pt; margin: 0 0 2pt; break-after: avoid; }
  .scen, .task { margin: 0 0 3pt; max-width: none; }
  .info { margin: 0 0 3pt; padding-left: 14pt; max-width: none; columns: 2; column-gap: 7mm; }
  .info li { margin: 0 0 1pt; break-inside: avoid; }
  .calc { padding-left: 14pt; max-width: none; margin: 0 0 3pt; }
  .calc > li { margin: 0 0 3pt; break-inside: avoid; }
  .calc p { margin: 0; }
  .twrap { overflow: visible; margin: 0 0 3pt; }
  .st { break-inside: avoid; }
  .st caption { padding-bottom: 2pt; }
  .st-t { font-size: 11pt; }
  .st-s { font-size: 10pt; }
  .st th, .st td { padding: 1pt 4pt; border-bottom: 0.5pt solid #999; }
  .st td.amt + td.amt, .st th.amt + th.amt, .st th.grp + th.grp { border-left: 0.5pt solid #999; }
  /* the first amount column has a left edge too, so the first month's box starts at a rule */
  .st:is(.cb, .sched) tbody th[scope="row"] + td, .st:is(.cb, .sched) tfoot th[scope="row"] + td, .st:is(.cb, .sched) thead th:first-child + th { border-left: 0.5pt solid #999; }
  .st.bva thead th:last-child, .st.bva td.cm, .st.bva tr.given td.nil:last-child { border-left: 0.5pt solid #999; padding-left: 6pt; }
  .st thead th { border-bottom: 1pt solid #000; }
  .st tfoot th, .st tfoot td, .st tr.tot th, .st tr.tot td { border-top: 1pt solid #000; background: none; }
  .st tfoot th, .st tfoot td, .st tr.end th, .st tr.end td { border-bottom: 2.5pt double #000; }
  .st tr.sec th { padding-top: 3pt; }
  .psheet .st tbody tr:not(.given):not(.sec) th, .psheet .st tbody tr:not(.given):not(.sec) td, .psheet .st tfoot th, .psheet .st tfoot td { height: 21pt; vertical-align: bottom; }
  /* a cash budget too long for one page at 21pt prints its write-in rows at 17pt (draw.js cbTight) */
  .psheet .st.cb.tight tbody tr:not(.given):not(.sec) th, .psheet .st.cb.tight tbody tr:not(.given):not(.sec) td { height: 17pt; }
  .st.sales, .st.sched, .st.cb, .st.capur { max-width: none; }
  .st.sched, .st.cb, .st.bva, .st.items { table-layout: fixed; }
  .st.sched thead th:first-child { width: 42mm; }
  .st.cb thead th:first-child { width: 62mm; }
  .st.items thead tr:first-child th:first-child { width: 100mm; }
  .st.bva thead th:first-child { width: 36mm; }
  .st.bva thead th:last-child { width: 44mm; }
  .bas-s { font-size: 10pt; }
  .narrow { max-width: 120mm; }
  .pblank { display: inline-block; width: 30mm; height: 15pt; }
  .st .pblank { display: block; width: auto; height: 0; }
  .answers { max-width: 150mm; gap: 0; margin: 4pt 0; break-inside: avoid; }
  .arow { border-bottom: 0; padding: 0; grid-template-columns: minmax(0, 1fr) 45mm; max-width: 170mm; }
  .arow .al { align-self: end; padding-bottom: 1pt; }
  .psheet .arow .pblank { width: 45mm; height: 21pt; border-bottom: 0.75pt solid #000; }
  .psheet .arow + .twrap { margin-top: 8pt; }
  .pkey .arow { border-bottom: 0.5pt solid #bbb; grid-template-columns: minmax(0, 1fr) auto; }
  .copts { margin: 2pt 0; }
  .steps { margin: 4pt 0; max-width: none; padding-left: 14pt; }
  .steps li { margin: 0 0 1pt; break-inside: avoid; }
  /* no answer-key page with one line alone: the last three working lines go over together */
  .steps li:nth-last-child(-n+2) { break-before: avoid; }
  .steps li.say { margin: 2pt 0 1pt -14pt; }
  .steps li.sh { margin: 4pt 0 1pt -14pt; break-after: avoid; }
  .keyfig { margin: 2pt 0 4pt; }
  .pk-cb .steps, .pk-dcs .steps, .pk-cps .steps { columns: 2; column-gap: 7mm; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
