@font-face { font-family: "Old Standard"; src: url("fonts/old-standard-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
:root {
  --paper: #f4efe2; --sheet: #fbf8ef; --ink: #1f2a33; --muted: #55606a; --rule: #d9cfb6; --line: #c2b694;
  --red: #9e2f28; --red-ink: #fff; --blue: #2c4a63; --ok: #2d6a3e; --bad: #9e2f28; --field: #fffdf7; --focus: #2c4a63;
  --head: "Old Standard", "Iowan Old Style", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #1a1d1f; --sheet: #23272a; --ink: #ece6d6; --muted: #aab1b6; --rule: #3a4045; --line: #4f565c;
    --red: #e0776c; --red-ink: #1a1d1f; --blue: #9fc0dc; --ok: #84c795; --bad: #f09086; --field: #1d2124; --focus: #9fc0dc; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--body); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
a { color: var(--blue); }
h1, h2, h3, .brand { font-family: var(--head); font-weight: 700; letter-spacing: .005em; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--sheet); padding: 8px; z-index: 9; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* header: a ledger page top with the red double rule */
.top { padding: 18px 0 14px; border-bottom: 3px double var(--red); margin-bottom: 14px; }
.brand { margin: 0; font-size: 1rem; } .brand a { color: var(--red); text-decoration: none; }
.crumbs { font-size: .92rem; } .crumbs a { color: var(--red); }
h1 { font-size: clamp(1.6rem, 4.6vw, 2.35rem); line-height: 1.12; margin: 6px 0 6px; }
.lede { margin: 0; max-width: 64ch; color: var(--muted); }
.regions { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 10px 0 0; font-size: .92rem; }
.regions a { display: inline-flex; align-items: center; min-height: 36px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); text-decoration: none; background: var(--sheet); }
.regions a[aria-current=page] { border-color: var(--red); color: var(--red); font-weight: 650; }

/* tool */
.tool { background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--red); padding: 12px 14px 16px; }
.bookbar { display: flex; gap: 8px; align-items: center; }
.book-sel { flex: 1; min-width: 0; }
.status { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
.status b { font-weight: 650; }
.st-ok { color: var(--ok); font-weight: 600; } .st-bad { color: var(--bad); font-weight: 600; }
.banner, .note-line { margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--line); background: var(--field); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin: 12px -14px 0; border-bottom: 1px solid var(--line); }
.tabs button { font: 600 .98rem var(--body); background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 10px 2px; min-height: 46px; cursor: pointer; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--red); }
.panel { padding-top: 12px; }
.ph { font-size: 1.2rem; margin: 20px 0 4px; }
.panel > .ph:first-child { margin-top: 4px; }
.hint { color: var(--muted); font-size: .95rem; margin: 2px 0 8px; }
.opt { color: var(--muted); font-weight: 400; }
.field { margin: 0 0 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field label, .lab { font-size: .9rem; font-weight: 600; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline label { font-weight: 500; display: flex; gap: 8px; align-items: center; }
input, select, textarea { font: 16px/1.3 var(--body); color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 3px; padding: 9px 10px; min-height: 44px; width: 100%; min-width: 0; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--red); }
input[aria-invalid] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
input[inputmode=decimal] { font-variant-numeric: tabular-nums; }
.grid2, .grid3, .entry-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .grid2, .entry-grid { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: repeat(3, 1fr); }
  .wide { grid-column: 1 / -1; }
}
.btn { font: 600 .95rem var(--body); display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--ink); background: var(--field); color: var(--ink); border-radius: 3px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.btn.ghost { border-color: var(--line); }
.btn.small { min-height: 36px; padding: 4px 10px; font-size: .9rem; }
.btn.danger, .link.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--blue); text-decoration: underline; font: inherit; padding: 4px 0; cursor: pointer; text-align: left; min-height: 32px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.icon-btn { background: none; border: 0; color: var(--bad); font: 600 .88rem var(--body); min-height: 44px; padding: 0 6px; cursor: pointer; text-decoration: underline; }
.err { color: var(--bad); margin: 0; font-weight: 600; min-height: 0; }
.err:empty { display: none; }
.ok-line { color: var(--ok); } .bad-line { color: var(--bad); }
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows > li { border-top: 1px solid var(--rule); padding: 8px 0 2px; }
.fund-row, .acct-row, .asset-row, .nz-row { display: grid; gap: 0 10px; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 560px) {
  .fund-row { grid-template-columns: 2fr 1fr auto; }
  .acct-row { grid-template-columns: 1fr 1fr auto; }
  .acct-row .open-grid { grid-column: 1 / -1; }
  .asset-row { grid-template-columns: 2fr repeat(3, 1fr) auto; }
  .asset-row .wide { grid-column: auto; }
  .nz-row { grid-template-columns: 2fr 1fr 1fr; }
}
.nz-label { font-weight: 600; padding-bottom: 12px; }
.fund-purpose { grid-column: 1 / -1; }
.sc-row { display: grid; gap: 0 10px; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 560px) { .sc-row { grid-template-columns: 2fr 1.4fr 1fr 1fr auto; } .asset-list.wide4 .asset-row { grid-template-columns: 2fr repeat(4, 1fr) auto; } }
.ac small.purpose { display: block; font-weight: 400; }
.sh4 { font-size: .98rem; margin: 10px 0 2px; }
.fill-in { color: var(--bad); font-weight: 600; }
.open-grid { display: grid; gap: 0 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.acct-row .err { grid-column: 1 / -1; }
details.more { border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 4px; }
details.more > summary { cursor: pointer; font-weight: 650; min-height: 44px; display: flex; align-items: center; gap: 6px; }
details.more.inner { margin-top: 4px; border-top: 0; }
.sumnote { color: var(--muted); font-weight: 400; }
.row-field { display: grid; grid-template-columns: 1fr 9rem; align-items: center; gap: 10px; margin-bottom: 4px; }
.row-field label { font-weight: 500; }
fieldset { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
legend { font-family: var(--head); font-weight: 700; padding: 0; margin-bottom: 4px; }
.cat-sec ul.rows li { display: flex; gap: 6px; align-items: center; padding: 4px 0; }

/* entry form */
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0 0 10px; }
@media (min-width: 620px) { .seg { grid-template-columns: repeat(4, 1fr); } }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--line); background: var(--field); font-weight: 600; font-size: .93rem; padding: 4px 6px; text-align: center; cursor: pointer; }
.seg input:checked + span { border: 2px solid var(--red); color: var(--red); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.split-box { border-left: 3px solid var(--line); padding-left: 10px; margin-top: 6px; }

/* ledger */
.ledger-head { display: flex; justify-content: space-between; align-items: end; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ledger-head .field { margin: 0; }
.ledger-head select { width: auto; }
ol.ledger { list-style: none; margin: 6px 0 0; padding: 0; }
.lmonth { font: 700 .95rem var(--head); color: var(--red); padding: 10px 0 2px; border-bottom: 1px solid var(--line); }
.lrow { width: 100%; display: grid; grid-template-columns: 3.4rem 1fr auto; gap: 8px; align-items: start; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 8px 2px; color: var(--ink); font: inherit; cursor: pointer; min-height: 44px; }
.lrow:hover, .lrow.editing { background: var(--field); }
.ldate { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.ldesc { min-width: 0; overflow-wrap: anywhere; }
.ldesc small { display: block; color: var(--muted); font-size: .85rem; }
.lamt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.lamt.in { color: var(--ok); } .lamt.out { color: var(--ink); } .lamt.mv { color: var(--muted); }
.lempty { color: var(--muted); padding: 10px 0; }
.flag { display: inline-block; margin-left: 6px; font-size: .8rem; font-weight: 700; color: var(--bad); }
.imp-list { list-style: none; padding: 0; margin: 0; }
.imp-list li { display: grid; grid-template-columns: 44px 1fr; border-bottom: 1px solid var(--rule); padding: 6px 0; }
.imp-list li.off .imp-main { opacity: .6; }
.imp-tick { display: flex; align-items: center; justify-content: center; min-height: 44px; }
.imp-top { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; }
.imp-desc { display: block; overflow-wrap: anywhere; }
.imp-sel { display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 4px; }
@media (min-width: 560px) { .imp-sel { grid-template-columns: 2fr 1fr; } }
.imp-main .flag { margin: 2px 0 0; display: block; }
.sticky-add { position: sticky; bottom: 0; background: var(--sheet); padding: 8px 0; margin: 0; border-top: 1px solid var(--rule); }

/* assets */
.stmt-name { margin: 0 0 4px; } .stmt-name span { color: var(--muted); font-variant-numeric: tabular-nums; }
.stmt-res { margin: 0 0 6px; font-weight: 600; }
.stmt-res:empty { display: none; }
.carried { grid-column: 1 / -1; margin: 0 0 8px; padding: 6px 8px; border-left: 3px solid var(--red); background: var(--field); font-size: .93rem; }
.carried .link { min-height: 0; padding: 0; }
.lab-sm { font-size: .85rem; font-weight: 600; }

/* accounts */
.checks { list-style: none; padding: 0; margin: 0 0 10px; }
.checks li { display: grid; grid-template-columns: 4rem 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
.checks .mark { font-weight: 800; font-size: .85rem; letter-spacing: .02em; }
.checks .ok .mark { color: var(--ok); } .checks .bad .mark { color: var(--bad); }
.issue-box { border: 1px solid var(--line); padding: 6px 12px; margin: 10px 0; background: var(--field); }
.issue-box.bad { border-color: var(--bad); }
.issue-box h3 { font-size: 1rem; margin: 4px 0; }
.issue-box ul { margin: 4px 0; padding-left: 18px; }
.sheet { container-type: inline-size; margin: 14px 0; }
.pr-head h2 { font-size: 1.35rem; margin: 6px 0 0; }
.pr-head p { margin: 0; color: var(--muted); }
.pr-head .pr-title { color: var(--ink); font-weight: 700; }
.sh { font-size: 1.05rem; margin: 16px 0 4px; }
table.ac { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.ac th, .ac td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; font-weight: 400; }
.ac thead th { font-size: .85rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.ac .num { text-align: right; white-space: nowrap; }
.ac .run-p { display: none; }
@media screen { .ac thead th.num { white-space: normal; } }
@container (max-width: 680px) { .ac.cols-5 th, .ac.cols-5 td, .ac.cols-6 th, .ac.cols-6 td { padding-left: 3px; padding-right: 3px; } }
.ac .sec-h th { font-family: var(--head); font-weight: 700; padding-top: 12px; }
.ac .sub th, .ac .sub td { border-top: 1px solid var(--ink); font-weight: 600; }
.ac .total th, .ac .total td { font-weight: 700; border-bottom: 3px double var(--red); }
.ac .none { color: var(--muted); font-style: italic; }
.ac .agree td { color: var(--ok); font-weight: 600; }
.ac small { color: var(--muted); }
.sign { margin-top: 18px; }
.sig { display: grid; grid-template-columns: 2fr 2fr 1.2fr; gap: 14px; margin-top: 26px; }
.sig-l { border-top: 1px solid var(--ink); font-size: .85rem; color: var(--muted); padding-top: 3px; }
.sig-l b { display: block; color: var(--ink); font-weight: 600; font-size: .95rem; }
.pr-warn { border: 2px solid var(--bad); padding: 6px 10px; margin: 8px 0; }
.pr-warn ul { margin: 2px 0 0; padding-left: 16px; }
.small { font-size: .88rem; color: var(--muted); }
.pre { white-space: pre-wrap; }
@container (max-width: 600px) {
  .ac thead { display: none; }
  .ac tr { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); border-bottom: 1px solid var(--rule); padding: 4px 0; }
  .ac th[scope=row], .ac .sec-h th, .ac td[colspan] { grid-column: 1 / -1; border: 0; padding: 2px 0; }
  .ac td { border: 0; padding: 0 4px 2px 0; text-align: left !important; white-space: normal; }
  .ac td.num::before { content: attr(data-c); display: block; font-size: .72rem; color: var(--muted); }
  .ac .total, .ac .sub { border-bottom: 3px double var(--red); }
  .ac .total th, .ac .total td, .ac .sub th, .ac .sub td { border: 0; }
  .ac tr.bl { min-height: 2em; }
  .sig { grid-template-columns: 1fr; gap: 18px; }
}
.ac tr { --n: 3; }
.ac.cols-6 tr { --n: 3; }
.ac.cols-1 tr { --n: 1; } .ac.cols-2 tr { --n: 2; } .ac.cols-3 tr { --n: 3; } .ac.cols-4 tr { --n: 4; } .ac.cols-5 tr { --n: 5; }
@container (max-width: 600px) { .ac.cols-4 td, .ac.cols-5 td, .ac.cols-6 td { font-size: .76rem; letter-spacing: -.01em; } .ac td.num::before { font-size: .68rem; } .ac tr { column-gap: 6px; } }
@container (max-width: 300px) { .ac.cols-4 tr, .ac.cols-5 tr { --n: 3; } }
/* five figure columns (unrestricted, restricted, endowment, total, last year) need 3 per line on a phone: a bold £10,381.31 is wider than a fifth of 330px */
@container (max-width: 380px) { .ac.cols-5 tr { --n: 3; } }
.rules { border-top: 3px double var(--red); margin-top: 14px; padding-top: 4px; }
.rules h3 { font-size: 1.1rem; margin: 8px 0 4px; }
.rules ul { padding-left: 18px; margin: 4px 0; }
.rules li { margin: 4px 0; }
.start { padding: 6px 0; }
.files { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 8px; }
.confirm { border: 2px solid var(--red); background: var(--field); padding: 8px 12px; margin: 8px 0; }
.confirm p { margin: 4px 0; }
.undo-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 20; width: min(560px, calc(100% - 24px)); display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--ink); color: var(--paper); padding: 8px 10px 8px 14px; border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.undo-bar .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); flex: none; }

/* reading content */
.prose { max-width: 70ch; margin: 28px 0 0; }
.prose h2 { font-size: 1.4rem; margin: 26px 0 6px; }
.tbl-wrap { overflow-x: auto; }
.rules-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.rules-table th, .rules-table td { border-bottom: 1px solid var(--rule); padding: 6px 6px; text-align: left; vertical-align: top; }
.rules-table thead th { border-bottom: 2px solid var(--red); font-size: .88rem; }
.rules-table tbody th { font-weight: 500; }
details.qa { border-bottom: 1px solid var(--rule); }
details.qa summary { cursor: pointer; font-weight: 650; padding: 10px 0; min-height: 44px; }
details.qa p { margin: 0 0 12px; }
.foot { margin-top: 40px; border-top: 3px double var(--red); padding: 14px 0 28px; font-size: .92rem; color: var(--muted); }
.disclaimer { color: var(--ink); }
.sb-footer p { margin: 8px 0; } .sb-more a { color: var(--muted); } .sb-credit a { color: var(--red); }
.print-root { display: none; }
.pr-run { display: none; }
.ac.b-list { table-layout: fixed; }
.ac.b-list col.c-f { width: 24%; }
.ac.b-list col.c-n { width: 17%; }
.ac.b-list th, .ac.b-list td { overflow-wrap: anywhere; }
.ac.cashbook .run th { text-align: right; font-weight: 400; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

@media print {
  @page { margin: 14mm 13mm; }
  :root { --ink: #000; --muted: #333; --rule: #999; --line: #666; --red: #000; --paper: #fff; --sheet: #fff; --ok: #000; --bad: #000; }
  html, body { background: #fff !important; color: #000; }
  body { font-size: 10pt; line-height: 1.3; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; }
  .pr-page { break-after: page; page-break-after: always; }
  .pr-acct + .pr-acct { margin-top: 16pt; }
  .pr-acct + .pr-acct.long { break-before: page; page-break-before: always; margin-top: 0; }
  .pr-acct.short { break-inside: avoid; page-break-inside: avoid; }
  .ac.cashbook td.nw { white-space: nowrap; }
  .pr-page:last-child { break-after: auto; page-break-after: auto; }
  .pr-head { border-bottom: 2.5pt double #000; padding-bottom: 4pt; margin-bottom: 6pt; }
  .pr-head h2 { font-size: 15pt; margin: 0; }
  .pr-head p { font-size: 10pt; color: #000; }
  .pr-head .fill span, .fill span { display: inline-block; min-width: 60mm; border-bottom: .6pt solid #000; }
  .sh { font-size: 11.5pt; margin: 10pt 0 3pt; break-after: avoid; page-break-after: avoid; }
  table.ac { font-size: 9.2pt; margin-bottom: 6pt; }
  .ac th, .ac td { padding: 2.2pt 4pt; border-bottom: .5pt solid #aaa; }
  .ac thead th { color: #000; font-size: 8.4pt; border-bottom: .8pt solid #000; }
  .ac .num { width: 19mm; }
  body[data-region=sc] .ac thead th.num { white-space: normal; }
  .ac.cols-6 .num { width: 16.5mm; }
  .ac.cols-6 td, .ac.cols-6 th { font-size: 8.6pt; padding-left: 2.5pt; padding-right: 2.5pt; }
  .ac.sc-b .num { width: 24mm; }
  .ac.cols-6 th, .ac.cols-6 td { padding-top: 1.4pt; padding-bottom: 1.4pt; }
  .ac.sc-b th, .ac.sc-b td { font-size: 8.6pt; padding-top: 1.4pt; padding-bottom: 1.4pt; }
  body[data-region=sc] .sh { margin: 6pt 0 2pt; }
  body[data-region=sc] .sig { margin-top: 9mm; }
  body[data-region=sc] .pr-head { margin-bottom: 3pt; }
  body[data-region=sc] .ac.blank tr.bl th, body[data-region=sc] .ac.blank tr.bl td { height: 4.6mm; }
  body[data-region=sc] .ac.blank .num { width: 14mm; }
  body[data-region=sc] .fill-lines { padding-top: 7mm; }
  .ac .sec-h th { padding-top: 6pt; }
  .ac tr { break-inside: avoid; page-break-inside: avoid; }
  .ac tbody.keep { break-inside: avoid; page-break-inside: avoid; }
  .ac .sub th, .ac .sub td { border-top: .8pt solid #000; }
  .ac .total th, .ac .total td { border-bottom: 2.4pt double #000; }
  .ac .agree td { color: #000; }
  .ac.blank tr.bl th, .ac.blank tr.bl td { height: 5.8mm; }
  .ac.cashbook td small { display: block; color: #333; }
  .ac.cashbook .d { white-space: nowrap; width: 22mm; }
  .ac.cashbook .mon th { font-family: var(--head); padding-top: 6pt; }
  .ac.cashbook thead { display: table-header-group; }
  .ac.cashbook .run th { font-weight: 400; font-size: 8pt; border-bottom: 0; text-align: right; color: #333; }
  .pr-run { display: block; font-size: 8pt; text-align: right; color: #333; margin: 0 0 2pt; }
  .ac .run-p { display: table-row; }
  .ac .run-p th { font-weight: 400; font-size: 8pt; border-bottom: 0; text-align: right; color: #333; }
  .ac.funds th small { font-size: 8pt; }
  .fill-lines { border-bottom: .6pt solid #000; padding: 10mm 0 1mm; margin: 0; font-weight: 700; }
  .sign, .keep-all { break-inside: avoid; page-break-inside: avoid; }
  .sig { grid-template-columns: 2fr 2fr 1.2fr; margin-top: 11mm; gap: 8mm; }
  body[data-region=nz] table.ac { font-size: 9pt; }
  body[data-region=nz] .sh { margin-top: 7pt; }
  .sig-l { color: #000; font-size: 8.5pt; border-top: .7pt solid #000; }
  .pr-warn { border: 1.5pt solid #000; font-size: 9pt; }
  .small { font-size: 8.5pt; color: #222; }
  a { color: #000; text-decoration: none; }
}
