/* NewRealist — design tokens drawn from the logo:
   aged parchment ground, dark ink, bronze rules, rust-red accent, Times serif throughout.
   Layout: a magazine — masthead with double rule, section nav in letter-spaced caps,
   cover story + wire columns on the front page. BookKeeper reuses the same tokens. */
:root {
  --paper: #EFE8D6;        /* page */
  --paper-2: #E6DCC3;      /* bands, cards (logo ground) */
  --paper-3: #D8CBA8;      /* deeper parchment */
  --ink: #1A1208;          /* text (logo wordmark) */
  --ink-2: #3C2E14;        /* secondary headings (bronze dark) */
  --muted: #6A5530;        /* captions (bronze) */
  --rule: #A8946A;         /* rules (bronze light) */
  --rule-soft: #D3C49E;
  --rust: #8B2010;         /* accent (logo needle) */
  --rust-2: #A83020;
  --rust-soft: #EBD3C4;
  --pos: #3F6A2C;  --pos-soft: #DCE6CB;
  --neg: #8B2010;  --neg-soft: #F0D6CC;
  --warn: #8A5A12; --warn-soft: #F1E2C2;
  --est: #5E4B8C;  --est-soft: #E3DDEE;
  --focus: #8B2010;
  --serif: "Times New Roman", Tinos, Times, "Liberation Serif", serif;
  --measure: 68ch;
  --r: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15100A; --paper-2: #1E170E; --paper-3: #2A2014;
    --ink: #EDE4CC; --ink-2: #D9CCAA; --muted: #B3A27C;
    --rule: #6A5530; --rule-soft: #3A2E1C;
    --rust: #DD6A4E; --rust-2: #E8836A; --rust-soft: #3B1C14;
    --pos: #A3C987; --pos-soft: #22301A; --neg: #E8836A; --neg-soft: #3B1C14;
    --warn: #E2B867; --warn-soft: #3A2C12; --est: #B9AAE8; --est-soft: #29233F;
    --focus: #E8836A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15100A; --paper-2: #1E170E; --paper-3: #2A2014;
  --ink: #EDE4CC; --ink-2: #D9CCAA; --muted: #B3A27C;
  --rule: #6A5530; --rule-soft: #3A2E1C;
  --rust: #DD6A4E; --rust-2: #E8836A; --rust-soft: #3B1C14;
  --pos: #A3C987; --pos-soft: #22301A; --neg: #E8836A; --neg-soft: #3B1C14;
  --warn: #E2B867; --warn-soft: #3A2C12; --est: #B9AAE8; --est-soft: #29233F;
  --focus: #E8836A; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--serif); font-variant-numeric: lining-nums; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { color: var(--rust); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink); }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.caps { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 700; }
.kicker { text-transform: uppercase; letter-spacing: .16em; font-size: 11.5px; font-weight: 700; color: var(--rust); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.dek { font-style: italic; color: var(--ink-2); }
.rule-double { border: 0; border-top: 3px double var(--rule); margin: 0; }
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- masthead ---------- */
.topbar { border-bottom: 1px solid var(--rule-soft); font-size: 13px; color: var(--muted); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 6px; }
.topbar a { text-decoration: none; }
.topbar .acct { display: flex; gap: 14px; align-items: center; }
.topbar .acct a { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.mast { text-align: center; padding-block: 18px 12px; }
.mast a { text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: 16px; }
.mast img { width: 64px; height: 64px; }
.mast .word { display: grid; gap: 2px; text-align: left; }
.mast .name { font-size: clamp(28px, 5vw, 46px); font-weight: 700; letter-spacing: .18em; line-height: 1; }
.mast .tagline { font-style: italic; font-weight: 700; color: var(--rust); letter-spacing: .24em; font-size: clamp(11px, 1.4vw, 13px); }
.nav { border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule); }
.nav ul { list-style: none; margin: 0 auto; padding: 0; display: flex; justify-content: center; gap: 4px 22px; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a { display: block; padding: 10px 0; text-decoration: none; white-space: nowrap; text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px; font-weight: 700; color: var(--ink-2); border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { color: var(--rust); border-bottom-color: var(--rust); }
.compact .mast { padding-block: 10px 8px; }
.compact .mast img { width: 40px; height: 40px; }
.compact .mast .name { font-size: 24px; }
@media (max-width: 720px) {
  .nav ul { justify-content: flex-start; }
  .mast img { width: 48px; height: 48px; }
  .topbar .date { display: none; }
}

main { padding-block: 26px 64px; }
.banner { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--rule-soft); padding: 10px 14px; border-radius: var(--r); font-size: 15px; margin-bottom: 20px; }
.banner code { font-size: 14px; }

/* ---------- section headers ---------- */
.sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: 14px; }
.sechead h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .16em; }
.sechead a { font-size: 14px; font-style: italic; color: var(--rust); text-decoration: none; }
.pagehead { margin-bottom: 26px; display: grid; gap: 6px; max-width: var(--measure); }
.pagehead h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: .01em; }
.pagehead p { font-size: 19px; margin: 0; }

/* ---------- front page ---------- */
.cover { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 34px; padding-bottom: 28px; border-bottom: 3px double var(--rule); }
.lead h2 { font-size: clamp(32px, 4.4vw, 54px); margin: 8px 0 10px; }
.lead h2 a { text-decoration: none; }
.lead .dek { font-size: 21px; margin-bottom: 12px; }
.lead .excerpt { max-width: var(--measure); }
.lead .more { font-style: italic; color: var(--rust); font-weight: 700; text-decoration: none; }
.mission { border-left: 1px solid var(--rule); padding-left: 26px; display: grid; gap: 14px; align-content: start; }
.mission img { width: 120px; margin: 0 auto; display: block; }
.mission blockquote { margin: 0; font-size: 19px; font-style: italic; color: var(--ink-2); }
.pillars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 15px; }
.pillars a { text-decoration: none; display: flex; justify-content: space-between; border-bottom: 1px dotted var(--rule); padding-bottom: 4px; }
.pillars b { letter-spacing: .1em; text-transform: uppercase; font-size: 12.5px; }
.pillars span { color: var(--muted); font-style: italic; }

.band { padding-block: 26px; border-bottom: 1px solid var(--rule); }
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--rule); background: var(--paper-2); }
.numbers .n { padding: 12px 14px; border-right: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); min-width: 0; }
.numbers .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--ink-2); }
.numbers .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums lining-nums; line-height: 1.2; }
.numbers .v small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.numbers .chg { font-size: 13px; color: var(--muted); }
.numbers .chg.up::before { content: "▲ "; font-size: 10px; }
.numbers .chg.down::before { content: "▼ "; font-size: 10px; }
.numbers .asof { font-size: 12px; color: var(--muted); font-style: italic; }

.wire { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.wire > section { min-width: 0; }
.wire h3 { font-size: 22px; font-style: italic; margin-bottom: 8px; }
.wire h3 a { text-decoration: none; }
.hl { list-style: none; margin: 0; padding: 0; }
.hl li { padding: 9px 0; border-bottom: 1px solid var(--rule-soft); }
.hl li:last-child { border-bottom: 0; }
.hl a { text-decoration: none; font-weight: 700; font-size: 17px; line-height: 1.3; display: block; }
.hl .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.hl .meta b { color: var(--rust); font-weight: 700; letter-spacing: .04em; }
.hl .sum { font-size: 15px; color: var(--ink-2); margin-top: 3px; }
.empty { color: var(--muted); font-style: italic; padding: 10px 0; }

.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.three > section { min-width: 0; }
.cal { list-style: none; margin: 0; padding: 0; }
.cal li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); }
.cal .d { text-align: center; border: 1px solid var(--rule); background: var(--paper-2); padding: 4px 0; line-height: 1.1; height: max-content; }
.cal .d b { display: block; font-size: 22px; }
.cal .d span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--rust); font-weight: 700; }
.cal .t { font-weight: 700; line-height: 1.3; }
.cal .t a { text-decoration: none; }
.cal .s { font-size: 14px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.card { border: 1px solid var(--rule); background: var(--paper-2); padding: 16px 18px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.card h3 { font-size: 20px; }
.card h3 a { text-decoration: none; }
.card p { margin: 0; font-size: 15.5px; color: var(--ink-2); }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); border: 1px solid var(--rule-soft); padding: 1px 7px; border-radius: 2px; }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.mini a { font-weight: 700; text-decoration: none; }
.mini p { margin: 2px 0 0; font-size: 14.5px; color: var(--muted); }
.product { border: 1px solid var(--rule); background: var(--paper-2); padding: 18px; display: grid; gap: 8px; }
.product h3 { font-size: 26px; font-style: italic; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid var(--rust); background: var(--rust); color: var(--paper); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px; text-decoration: none; cursor: pointer; border-radius: 2px; white-space: nowrap; }
.btn:hover { background: var(--rust-2); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--rust); }
.btn.ghost:hover { background: var(--rust-soft); color: var(--rust); }
.btn.small { height: 30px; padding: 0 10px; font-size: 11.5px; }
.btn.danger { border-color: var(--neg); color: var(--neg); background: transparent; }
.btn.danger.armed { background: var(--neg); color: var(--paper); }
.btn:disabled { opacity: .45; cursor: default; }

.essays { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.essays li { padding: 14px 0; border-bottom: 1px solid var(--rule-soft); display: grid; gap: 4px; }
.essays h3 { font-size: 24px; }
.essays h3 a { text-decoration: none; }
.essays .dek { margin: 0; }

/* chips / filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.chip { border: 1px solid var(--rule); background: transparent; padding: 4px 12px; border-radius: 99px; cursor: pointer; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search { height: 36px; border: 1px solid var(--rule); background: var(--paper); padding: 0 12px; border-radius: 2px; min-width: 0; flex: 1 1 200px; max-width: 320px; }

/* article */
.article { max-width: var(--measure); margin: 0 auto; }
.article h1 { font-size: clamp(34px, 5.2vw, 56px); margin: 10px 0; }
.article .dek { font-size: 22px; margin-bottom: 8px; }
.article .byline { font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 0; margin: 16px 0 26px; }
.prose { font-size: 19px; line-height: 1.65; }
.prose h2 { font-size: 28px; margin: 1.4em 0 .5em; }
.prose h3 { font-size: 22px; margin: 1.2em 0 .4em; }
.prose blockquote { margin: 1.2em 0; padding-left: 18px; border-left: 3px solid var(--rust); font-style: italic; color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--paper-2); padding: 1px 4px; }
.prose > p:first-of-type::first-letter { float: left; font-size: 3.6em; line-height: .85; padding: 6px 8px 0 0; color: var(--rust); font-weight: 700; }

/* footer */
.foot { border-top: 3px double var(--rule); padding-block: 24px 40px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.foot .tag2 { font-style: italic; color: var(--rust); letter-spacing: .2em; font-weight: 700; }

/* forms (sign in, studio) */
.formcard { max-width: 420px; margin: 20px auto; border: 1px solid var(--rule); background: var(--paper-2); padding: 24px; display: grid; gap: 12px; }
.formcard h2 { font-size: 26px; font-style: italic; }
label.f { display: grid; gap: 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); min-width: 0; }
.f input, .f select, .f textarea { height: 40px; border: 1px solid var(--rule); background: var(--paper); padding: 0 10px; border-radius: 2px; font-size: 16px; text-transform: none; letter-spacing: 0; font-weight: 400; min-width: 0; width: 100%; }
.f textarea { height: auto; min-height: 320px; padding: 10px; line-height: 1.5; font-family: var(--serif); resize: vertical; }
.f.inline { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 15px; }
.f.inline input { width: 18px; height: 18px; }
.formrow { display: flex; flex-wrap: wrap; gap: 12px; }
.formrow > * { flex: 1 1 180px; }
.err { color: var(--neg); font-size: 15px; }
.okmsg { color: var(--pos); font-size: 15px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--rust); cursor: pointer; font-style: italic; text-decoration: underline; text-underline-offset: 3px; }
.tabs2 { display: flex; gap: 18px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; overflow-x: auto; }
.tabs2 button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 0; cursor: pointer; text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tabs2 button[aria-selected="true"] { color: var(--rust); border-bottom-color: var(--rust); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 28px; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list li { padding: 10px 0; border-bottom: 1px solid var(--rule-soft); display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.list li button.pick { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-weight: 700; font-size: 16px; }
.list li button.pick:hover { color: var(--rust); }
.list li.sel button.pick { color: var(--rust); }
.status { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; padding: 1px 7px; border-radius: 2px; white-space: nowrap; }
.status.pub { background: var(--pos-soft); color: var(--pos); }
.status.draft { background: var(--warn-soft); color: var(--warn); }
.status.bad { background: var(--neg-soft); color: var(--neg); }
.scroll { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: 15px; }
table.t th, table.t td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
table.t th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border-bottom: 1px solid var(--rule); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 3px; font-size: 15px; z-index: 50; max-width: calc(100% - 32px); }

@media (max-width: 900px) {
  .cover, .split { grid-template-columns: 1fr; }
  .mission { border-left: 0; border-top: 1px solid var(--rule); padding: 20px 0 0; }
  .wire, .three { grid-template-columns: 1fr; gap: 26px; }
}

/* =================================================================
   BookKeeper (scoped under .bk)
   ================================================================= */
.bk { font-size: 15.5px; }
.bk .appbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-block: 4px 0; }
.bk .appbar h1 { font-size: 30px; font-style: italic; flex: 1 1 auto; }
.bk .appbar h1 small { font-style: normal; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: 8px; }
.bk .stepper { display: flex; align-items: center; gap: 6px; }
.bk .stepper button { width: 34px; height: 34px; border: 1px solid var(--rule); background: var(--paper-2); cursor: pointer; font-size: 18px; border-radius: 2px; }
.bk .stepper button:disabled { opacity: .35; cursor: default; }
.bk .stepper select { height: 34px; border: 1px solid var(--rule); background: var(--paper-2); padding: 0 10px; font-weight: 700; min-width: 120px; border-radius: 2px; }
.bk .state { font-size: 13px; color: var(--muted); font-style: italic; }
.bk .tabs2 { margin: 12px 0 20px; }
.bk .grid { display: grid; gap: 20px; }
.bk .panel { background: var(--paper-2); border: 1px solid var(--rule); padding: 18px; min-width: 0; }
.bk .panel h2 { font-size: 21px; font-style: italic; margin-bottom: 10px; }
.bk .eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.bk .stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--rule); background: var(--paper-2); }
.bk .stat { padding: 14px 16px; border-right: 1px solid var(--rule-soft); min-width: 0; }
.bk .stat:last-child { border-right: 0; }
.bk .stat .v { font-size: clamp(19px, 2.4vw, 27px); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.bk .stat.net { background: var(--paper-3); }
.bk .stat.net.pos .v { color: var(--pos); }
.bk .stat.net.neg .v { color: var(--neg); }
.bk .pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.bk .pill.pos { background: var(--pos-soft); color: var(--pos); }
.bk .pill.neg { background: var(--neg-soft); color: var(--neg); }
.bk .pill.est { background: var(--est-soft); color: var(--est); }
.bk .sub { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 14px; }
.bk .sub b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bk .periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.bk .ledger { width: 100%; border-collapse: collapse; }
.bk .ledger td { padding: 6px 4px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.bk .ledger tr.grp td { padding-top: 14px; border-bottom: 1px solid var(--rule); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.bk .ledger .chk { width: 30px; }
.bk .ledger .nm { word-break: break-word; }
.bk .ledger .nm .note { display: block; font-size: 13px; color: var(--muted); font-style: italic; line-height: 1.35; }
.bk .ledger .amt { width: 120px; text-align: right; }
.bk .ledger tr.done .nm > span:first-child { color: var(--muted); }
.bk .ledger tr.due .nm > span:first-child::after { content: " · due"; color: var(--warn); font-size: 13px; font-weight: 700; font-style: italic; }
.bk .tot { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-top: 12px; font-size: 15px; }
.bk .tot div:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.bk .tot .big { font-weight: 700; border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 4px; }
.bk input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--rust); cursor: pointer; }
.bk .amtin { width: 100%; text-align: right; font-variant-numeric: tabular-nums; border: 1px solid transparent; background: transparent; border-radius: 2px; padding: 4px 6px; font-size: 15.5px; }
.bk .amtin:hover { border-color: var(--rule); }
.bk .amtin:focus { border-color: var(--rust); background: var(--paper); outline: none; }
.bk .amtin.est { color: var(--est); font-style: italic; }
.bk .form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.bk .form label { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; min-width: 0; }
.bk .form input, .bk .form select { height: 36px; border: 1px solid var(--rule); background: var(--paper); padding: 0 10px; border-radius: 2px; min-width: 0; font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.bk .form .grow { flex: 1 1 180px; }
.bk .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 2px; }
.bk .x:hover { background: var(--neg-soft); color: var(--neg); }
.bk .x.armed { background: var(--neg); color: var(--paper); font-size: 12px; font-weight: 700; }
.bk table.grid2 { border-collapse: collapse; width: 100%; font-size: 15px; }
.bk table.grid2 th, .bk table.grid2 td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--rule-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bk table.grid2 th:first-child, .bk table.grid2 td:first-child { text-align: left; position: sticky; left: 0; background: var(--paper-2); }
.bk table.grid2 thead th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); }
.bk table.grid2 tr.click { cursor: pointer; }
.bk table.grid2 tr.click:hover td { background: var(--paper-3); }
.bk table.grid2 tr.sum td { font-weight: 700; border-top: 1px solid var(--rule); }
.bk table.grid2 td.pos { color: var(--pos); }
.bk table.grid2 td.neg { color: var(--neg); }
.bk table.grid2 tr.cur td { background: var(--rust-soft); }
.bk .cats { display: grid; gap: 8px; }
.bk .cat { display: grid; grid-template-columns: 110px 1fr 100px; gap: 10px; align-items: center; font-size: 15px; }
.bk .track { background: var(--paper-3); height: 8px; }
.bk .bar { height: 8px; background: var(--rust); }
.bk .txlist { display: grid; }
.bk .tx { display: grid; grid-template-columns: 78px minmax(0, 1fr) 110px 100px 34px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); font-size: 15px; }
.bk .tx .d, .bk .tx .c { color: var(--muted); font-size: 13.5px; }
.bk .tx .a { text-align: right; font-variant-numeric: tabular-nums; }
.bk .billrow { border-bottom: 1px solid var(--rule-soft); padding: 10px 0; display: grid; gap: 8px; }
.bk .billhead { display: grid; grid-template-columns: minmax(0, 1fr) 150px 140px 110px auto; gap: 8px; align-items: center; }
.bk .billhead input[type=text] { height: 34px; border: 1px solid transparent; padding: 0 8px; background: transparent; font-weight: 700; min-width: 0; width: 100%; font-size: 16px; }
.bk .billhead input[type=text]:hover { border-color: var(--rule); }
.bk .billhead select { height: 34px; border: 1px solid var(--rule); background: var(--paper); padding: 0 6px; min-width: 0; width: 100%; }
.bk .months { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; background: var(--paper-3); padding: 10px; }
.bk .months label { display: grid; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.bk .months input { height: 30px; border: 1px solid var(--rule); background: var(--paper); text-align: right; font-size: 14px; padding: 0 6px; width: 100%; font-variant-numeric: tabular-nums; }
.bk .months input.est { color: var(--est); font-style: italic; }
.bk .months .cur input { border-color: var(--rust); }
.bk .rowtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.bk .chart text { fill: var(--muted); font-family: var(--serif); font-size: 12px; }
.bk .chart .zero { stroke: var(--rule); }
.bk .chart .p { fill: var(--pos); }
.bk .chart .n { fill: var(--neg); }
.bk .chart .e { opacity: .5; }
@media (max-width: 860px) {
  .bk .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk .stat { border-bottom: 1px solid var(--rule-soft); }
  .bk .stat.net { grid-column: 1 / -1; border-bottom: 0; }
  .bk .periods { grid-template-columns: 1fr; }
  .bk .billhead { grid-template-columns: 1fr 1fr; }
  .bk .billhead .nmcell { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .bk .tx { grid-template-columns: minmax(0, 1fr) 92px 30px; }
  .bk .tx .d, .bk .tx .c { display: none; }
  .bk .tx .m small { display: block; color: var(--muted); font-size: 12.5px; }
  .bk .cat { grid-template-columns: 90px 1fr 86px; }
  .bk .ledger .amt { width: 104px; }
}
@media (min-width: 521px) { .bk .tx .m small { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

input[type=checkbox] { accent-color: var(--rust); }
