:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #1c2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #2a5bd7; --accent-ink: #fff; --neg: #b42318; --pos: #067647; --warn: #b54708; --hover: #eef2fb;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12151b; --panel: #1b2029; --ink: #e8ebf1; --muted: #9aa3b2; --line: #2b323e; --accent: #6b8cff; --accent-ink: #0b1020;
          --neg: #ff8a80; --pos: #5bd69a; --warn: #ffb066; --hover: #232a38; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--ink); }
#app { display: flex; min-height: 100vh; }
#side { width: var(--side-w, 270px); flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; height: 100vh; position: sticky; top: 0; }
#main { flex: 1; padding: 20px 24px; min-width: 0; }
.sidehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 8px 8px; }
.brand { font-weight: 700; font-size: 18px; margin: 0; }
#networth { margin: 0 8px 14px; color: var(--muted); font-size: 12px; }
#networth b { display: block; font-size: 20px; color: var(--ink); }
#nav a, .acc { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; color: inherit; text-decoration: none; cursor: pointer; }
#nav a:hover, .acc:hover { background: var(--hover); }
.active { background: var(--hover); font-weight: 600; }
.ent { margin: 14px 8px 4px; display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: pointer; }
.ent.sel { color: var(--accent); }
.acc .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .bal { font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc.closed { opacity: .5; }
.side-actions { margin: 16px 8px 0; display: flex; justify-content: space-between; }
.neg { color: var(--neg); } .pos { color: var(--pos); } .muted { color: var(--muted); } .warn { color: var(--warn); }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 15px; margin: 24px 0 8px; }
.sub { color: var(--muted); margin-bottom: 14px; }
button, .btn, select, input, textarea { font: inherit; }
button, .btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
button:hover { background: var(--hover); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--neg); }
button.link, a.link { border: 0; background: none; color: var(--accent); padding: 0; text-decoration: none; cursor: pointer; }
input, select, textarea { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 6px 8px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.bar input[type=search] { width: 220px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.row { cursor: pointer; } tr.row:hover td { background: var(--hover); }
tr.splitrow td { background: var(--bg); font-size: 12px; color: var(--muted); padding-top: 3px; padding-bottom: 3px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--hover); color: var(--muted); margin-left: 4px; }
.quick td { background: var(--hover); }
.quick input, .quick select { width: 100%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 14px; }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
label.f input, label.f select, label.f textarea { color: var(--ink); font-size: 14px; }
label.f button.picker { font-size: 14px; }       /* the category picker is a field too: same text size, so the same height as Payee beside it */
#modal, #modal2 { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow-y: auto; z-index: 10; }
#modal.hidden, #modal2.hidden, #toast.hidden { display: none; }
#modal-box, #modal2-box { background: var(--panel); border-radius: 10px; padding: 18px 20px; width: min(560px, 100%); }
#modal-box h3, #modal2-box h3 { margin: 0 0 12px; font-size: 16px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.actions .left { margin-right: auto; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 20; max-width: 90vw; }
#toast.err { background: var(--neg); color: #fff; }
.split-line { display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.diff { font-weight: 600; margin: 6px 0; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
@media (max-width: 800px) {
  #app { flex-direction: column; } #resizer { display: none; } #side { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  #main { padding: 14px; } th:nth-child(n+5), td:nth-child(n+5) { font-size: 13px; }
}
#modal2 { z-index: 30; }
a.sortlink { color: inherit; font-weight: 600; white-space: nowrap; } a.sortlink:hover { color: var(--accent); }
#main.fixed { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
#main.fixed > * { flex: none; }
#main.fixed > .tablewrap { flex: 1 1 auto; min-height: 0; }
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.tablewrap table { border: 0; border-radius: 0; overflow: visible; }
.tablewrap th { z-index: 1; }
@media (max-width: 800px) { #main.fixed { height: auto; display: block; overflow: visible; } .tablewrap { overflow-x: auto; } }
.tablewrap thead tr.quick td { position: sticky; top: var(--thh, 33px); z-index: 1; background: var(--hover); border-bottom: 1px solid var(--line); }
button.picker { display: block; width: 100%; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; font-weight: normal; position: relative; padding-right: 20px; }
button.picker::after { content: "▾"; position: absolute; right: 7px; color: var(--muted); }
button.picker.empty { color: var(--muted); }
.quick button.picker { padding: 6px 20px 6px 8px; }
#pickpanel { position: fixed; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
#pickpanel .psearch { margin: 8px; width: calc(100% - 16px); }
#pickpanel .plist { overflow-y: auto; padding: 0 4px 6px; }
.pitem { padding: 5px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem.on { background: var(--hover); } .pitem.cur { font-weight: 600; }

.grp { display: flex; align-items: center; gap: 4px; margin: 8px 4px 2px; padding: 3px 4px; border-radius: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.grp .gname { flex: 1; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp .gtot { font-variant-numeric: tabular-nums; }
.grp.sel { color: var(--accent); }
.grp .caret { border: 0; background: none; padding: 0 4px; color: inherit; line-height: 1; }
.grp.drop, .acc.drop { background: var(--hover); outline: 1px dashed var(--accent); }
.grp.before { box-shadow: 0 -2px 0 var(--accent); } .grp.after { box-shadow: 0 2px 0 var(--accent); }
.grp.ungrouped { margin-top: 12px; }
.acc.before { box-shadow: 0 -2px 0 var(--accent); } .acc.after { box-shadow: 0 2px 0 var(--accent); }
.acc .name { flex: 1 1 0; min-width: 0; }
.acc .unc { flex: none; margin: 0; font-size: 10px; align-self: center; background: var(--accent); color: var(--accent-ink); }
#resizer { flex: none; width: 6px; margin-left: -3px; cursor: col-resize; position: sticky; top: 0; height: 100vh; z-index: 5; }
#resizer:hover, #resizer.drag { background: var(--accent); opacity: .35; }
body.resizing { cursor: col-resize; user-select: none; }
tbody tr { scroll-margin-top: var(--thh, 36px); }
tr.ksel td { background: color-mix(in srgb, var(--accent) 16%, transparent); }
tr.ksel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td.rowmenu { width: 28px; text-align: right; padding-left: 0; padding-right: 4px; }
button.kebab { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 8px; border-radius: 6px; }
button.kebab:hover, tr.ksel button.kebab { background: var(--hover); color: var(--ink); }
#rowmenu { position: fixed; z-index: 60; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.25); padding: 4px; display: flex; flex-direction: column; }
#rowmenu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; }
#rowmenu button:focus { background: var(--hover); outline: none; }
#rowmenu button.danger { color: var(--neg); }
.cx { position: relative; display: inline-block; }
.cx input { padding-right: 26px; }
.cx .cxbtn { display: none; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 6px; border-radius: 50%; cursor: pointer; }
.cx.has .cxbtn { display: block; }
.cx .cxbtn:hover { color: var(--ink); background: var(--hover); }
input[type=search]::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
#pickpanel .cx { display: block; margin: 8px; }
#pickpanel .cx .psearch { margin: 0; width: 100%; box-sizing: border-box; }
.bar input.amtq { width: 190px; } input.bad { border-color: var(--neg); }
#undobar { display: flex; gap: 2px; margin: 0; }
#undobar button { flex: none; width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; background: none; box-shadow: none; color: var(--muted); border-radius: 6px; }
#undobar button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
#undobar button:disabled { opacity: .35; cursor: default; }
#pickpanel .pnew { border-top: 1px solid var(--line); padding: 4px 4px 6px; flex: none; }
#pickpanel .pnew:empty { display: none; }

/* tags */
.pill { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; line-height: 1.5; padding: 0 4px 0 9px; margin: 1px 4px 1px 0; border-radius: 999px;
  background: hsl(var(--h) 70% 50% / .16); color: hsl(var(--h) 55% 32%); border: 1px solid hsl(var(--h) 60% 50% / .35); }
@media (prefers-color-scheme: dark) { .pill { color: hsl(var(--h) 80% 76%); } }
.pill:not(:has(.tagx)) { padding-right: 9px; }
.tagx { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 3px; border-radius: 50%; opacity: .6; }
.tagx:hover { opacity: 1; background: hsl(var(--h) 60% 50% / .25); }
.pill .tagx { padding: 0 3px; border-radius: 50%; }            /* a design's own button padding and radius must not stretch the pill */
.tagrow { margin-top: 2px; }
.tagbox { display: flex; flex-wrap: wrap; align-items: center; gap: 0; padding: 6px 8px; min-height: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: text; margin-top: 0; }
.tagbox:focus-within { border-color: var(--accent); }
.tagbox .pill { margin-top: 0; margin-bottom: 0; }
.tagbox input.tagtype { flex: 1; min-width: 90px; border: 0; outline: 0; background: transparent; color: inherit; padding: 0 2px; margin: 0; width: auto; box-shadow: none; }
#tagsug, #paysug { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.2); padding: 3px; max-height: 240px; overflow: auto; }
#tagsug .tsrow, #paysug .tsrow { display: flex; justify-content: space-between; gap: 12px; padding: 5px 8px; border-radius: 4px; cursor: pointer; }
#tagsug .tsrow.on, #tagsug .tsrow:hover, #paysug .tsrow.on, #paysug .tsrow:hover { background: var(--hover); }
#tagsug .tsrow.pnew { color: var(--accent); border-top: 0; }

/* import drop zone */
.dropzone { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px dashed var(--line); border-radius: 8px; transition: border-color .12s, background .12s; }
.dropzone.over { border-color: var(--accent); background: var(--hover); }

/* inline transaction editor */
tr.editrow > td { padding: 10px 12px; background: var(--hover); border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); white-space: normal; }
.inl { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.inl .f { margin: 0; flex: 0 0 auto; }
.inl .f.grow { flex: 1 1 160px; min-width: 140px; }
.inl .f.w { flex: 0 0 110px; }
.inl .cl { display: flex; align-items: center; gap: 4px; padding-bottom: 8px; }
.inl-actions { margin-left: auto; display: flex; gap: 6px; padding-bottom: 2px; }
.inl .tagbox { margin-top: 0; }
.split-line .split-fx { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.split-line .split-fx input { width: 140px; }
.dt { white-space: nowrap; }
.plus { width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }

/* category suggestions */
button.sugg { display: block; margin-top: 3px; padding: 1px 8px; font-size: 12px; border-radius: 999px; border: 1px dashed var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
button.sugg:hover { background: var(--hover); }
button.sugg.ai { border-style: solid; }
button.sugg:has(.sugg-src) { border-radius: 8px; text-align: left; padding: 2px 8px; }
button.sugg b { font-weight: 600; }
button.sugg .sugg-src { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.sugbar { display: inline-flex; align-items: center; gap: 6px; }

/* rule conditions */
.cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.cond input[data-f] { flex: 1 1 100px; min-width: 70px; }
.cond .cx-rm { width: 30px; padding: 4px 0; }

/* inbox card view */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--panel); padding: 5px 12px; cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.cv { max-width: 640px; margin: 8px auto 24px; }
.cv-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cv-bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.cv-bar > div { height: 100%; background: var(--accent); }
.cv-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.cv-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cv-date { font-weight: 600; }
.cv-amt { font-size: 26px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-amt small { font-size: 13px; font-weight: 400; color: var(--muted); }
.cv-card .f { display: block; margin-top: 10px; }
.cv-card .f input, .cv-card .f select { width: 100%; }
.cv-sug { min-height: 4px; }
.cv-sug button.sugg { display: inline-block; margin-top: 6px; }
.cv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cv-actions .primary { margin-left: auto; }
.cv-hint { margin-top: 10px; font-size: 12px; }
.cv [hidden] { display: none !important; }

/* batch selection */
th.selc, td.selc { width: 28px; padding-left: 8px; padding-right: 0; }
tr.picked td { background: var(--hover); }
.batchbar { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px 2px 10px; border: 1px solid var(--accent); border-radius: 8px; }
.batchbar[hidden] { display: none; }
#paysug .tshint { padding: 4px 8px 2px; font-size: 11px; color: var(--muted); }

.tagwrap { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.tagwrap table { border: 0; border-radius: 0; overflow: visible; }
.tagwrap th { position: sticky; top: 0; z-index: 1; }
.tagchip { border-radius: 999px; padding: 2px 10px; }

.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 7px 12px; border-radius: 6px 6px 0 0; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: inherit; background: var(--hover); }
.subnav a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

:root { --c-inc: #2a78c4; --c-exp: #d9822b; }
@media (prefers-color-scheme: dark) { :root { --c-inc: #3d85d6; --c-exp: #c47428; } }
.repchart { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0 14px; overflow-x: auto; }
.replegend { display: flex; gap: 16px; font-size: 12px; margin-bottom: 4px; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; } .sw.rinc, path.rinc { background: var(--c-inc); fill: var(--c-inc); } .sw.rexp, path.rexp { background: var(--c-exp); fill: var(--c-exp); }
.rg { stroke: var(--line); stroke-width: 1; } .rt { fill: var(--muted); font-size: 11px; } .rhit { fill: transparent; } .rgrp:hover .rhit { fill: var(--hover); } 
.repwrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.reptable { border: 0; border-radius: 0; overflow: visible; } .reptable th { position: sticky; top: 0; z-index: 2; white-space: nowrap; } .reptable td.num { white-space: nowrap; }
.reptable td.repname, .reptable th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; white-space: nowrap; } .reptable th:first-child { z-index: 3; }
.repsec td { background: var(--hover); font-weight: 700; } .reptot td { font-weight: 700; border-top: 2px solid var(--line); background: var(--panel); } .reptot td:first-child { position: sticky; left: 0; }
.repkid td { font-size: 13px; } .reptable td[data-cat]:hover { background: var(--hover); } .tw { width: 18px; padding: 0; margin-right: 2px; }
.reptable td:first-child, .reptable th:first-child { white-space: nowrap; min-width: 190px; } .reptable th.num, .reptable td.num { min-width: 84px; }

:root { --pc0: #2a78d6; --pc1: #eb6834; --pc2: #1baf7a; --pc3: #eda100; --pc4: #e87ba4; --pc5: #008300; --pc-o: #9aa3b2; }
@media (prefers-color-scheme: dark) { :root { --pc0: #3987e5; --pc1: #d95926; --pc2: #199e70; --pc3: #c98500; --pc4: #d55181; --pc5: #008300; --pc-o: #6b7280; } }
.slice { stroke: var(--panel); stroke-width: 2; } .slice:hover { opacity: .85; }
.slice.pc0, .sw.pc0 { fill: var(--pc0); background: var(--pc0); } .slice.pc1, .sw.pc1 { fill: var(--pc1); background: var(--pc1); } .slice.pc2, .sw.pc2 { fill: var(--pc2); background: var(--pc2); }
.slice.pc3, .sw.pc3 { fill: var(--pc3); background: var(--pc3); } .slice.pc4, .sw.pc4 { fill: var(--pc4); background: var(--pc4); } .slice.pc5, .sw.pc5 { fill: var(--pc5); background: var(--pc5); } .slice.pc-o, .sw.pc-o { fill: var(--pc-o); background: var(--pc-o); }
.repchart.pies { display: flex; gap: 32px; flex-wrap: wrap; } .reppie { flex: 1 1 380px; min-width: 0; } .reppie h3 { margin: 0 0 8px; font-size: 14px; }
.pierow { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .pielegend { border: 0; width: auto; flex: 1 1 200px; } .pielegend td { padding: 3px 8px; border: 0; } .pielegend tr:hover td { background: var(--hover); }

.ms { margin-top: 10px; } .ms-title { margin-bottom: 4px; } .ms-btn { width: 100%; text-align: left; } .ms-btn.limited { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ms-panel { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-top: 4px; background: var(--panel); } .ms-q { width: 100%; margin-bottom: 6px; }
.ms-list { max-height: 190px; overflow: auto; } .ms-opt { display: block; padding: 3px 4px; border-radius: 4px; white-space: pre; } .ms-opt:hover { background: var(--hover); } .ms-opt[hidden] { display: none; }
.ms-grp { font-weight: 700; font-size: 12px; color: var(--muted); padding: 6px 4px 2px; text-transform: uppercase; } .ms-acts { margin-top: 6px; text-align: right; }
.ms .ms-panel .ms-q { width: 100%; display: block; }

.src { display: inline-block; font-size: 11px; line-height: 1.5; padding: 0 7px; margin-left: 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.src-api { border-color: var(--c-inc); color: var(--c-inc); } .src-file { border-style: dashed; }

/* reconciliation */
#nav .tag:empty { display: none; }
.tag.rec { color: var(--pos); text-decoration: none; }
a.tag.warn { color: var(--warn); text-decoration: none; }
.nowrap { white-space: nowrap; }
.recstmt label { display: flex; align-items: center; gap: 6px; }
.recstmt input.money { width: 140px; text-align: right; }
.recsum { padding: 8px 12px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.recsum .sep { color: var(--muted); margin: 0 6px; }
.recchanged { padding: 8px 12px; margin: 0 0 12px; border: 1px solid var(--warn); border-radius: 8px; }
.recchanged ul { margin: 4px 0; padding-left: 20px; }
.rectable tr.recrow { cursor: pointer; }
.rectable tr.recrow:not(.ticked) td:not(.selc) { opacity: .7; }
.rectable tr.flash td { background: var(--hover); }
.recstmt { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0 0 6px; }
.recstmt .recfixed { padding: 0 4px; font-weight: 600; }
.recnote { margin: 0 0 10px; font-size: 12px; }
.reccheck { padding: 6px 12px; margin: 0 0 10px; border-radius: 8px; border: 1px solid currentColor; }

/* your own note on a transaction */
.grid2 .wide { grid-column: 1 / -1; }
.f textarea { width: 100%; resize: vertical; font: inherit; }
.txnote { font-size: 12px; color: var(--accent); font-style: italic; }
/* Option + letter jumps to a field: the letter is underlined while Option is held (fieldkeys.js) */
u.fkey { text-decoration: underline 2px; text-underline-offset: 2px; color: var(--accent); font-weight: 700; }
/* every disabled button looks disabled (it used to look active and simply do nothing) */
button:disabled, button:disabled:hover { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
/* keyboard shortcuts panel (help.js) */
.keyhelp { columns: 2 320px; column-gap: 28px; }
.keyhelp section { break-inside: avoid; margin-bottom: 14px; }
.keyhelp h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.keyhelp dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.keyhelp dt { white-space: nowrap; }
.keyhelp dd { margin: 0; }
kbd { display: inline-block; min-width: 1.4em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--panel); font: 12px/1.5 inherit; text-align: center; }
/* the hint after pressing G (gokeys.js): one key per line */
#gohint { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--ink); box-shadow: 0 6px 24px rgba(0,0,0,.18); display: grid; gap: 5px; font-size: 13px; }
#gohint[hidden] { display: none; }
#gohint .gh-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
#gohint kbd { margin-right: 6px; }
/* the calculator on split amounts (calc.js) */
#calcbox { position: fixed; z-index: 70; width: 230px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
#calcbox .calc-in { width: 100%; font: 15px ui-monospace, Menlo, monospace; text-align: right; }
#calcbox .calc-out { text-align: right; font-weight: 600; color: var(--ink); margin-top: 6px; min-height: 1.3em; }
#calcbox .calc-out.warn { color: var(--warn); font-weight: 400; }
#calcbox .calc-help { font-size: 11px; margin-top: 4px; }
/* the pill that tells the JavaScript and TypeScript versions of a page apart (Statements) */
.tsbadge { display: inline-block; font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 10px; margin: 0 0 8px; }

/* user manual (manual.js) */
.manual { display: flex; gap: 28px; align-items: flex-start; max-width: 1100px; }
.man-toc { position: sticky; top: 0; min-width: 190px; display: flex; flex-direction: column; gap: 2px; }
.man-toc h3 { margin: 0 0 6px; }
.man-toc a { padding: 4px 8px; border-radius: 6px; text-decoration: none; color: inherit; }
.man-toc a:hover, .man-toc a.active { background: rgba(127,127,127,.18); }
.man-body { flex: 1; min-width: 0; max-width: 780px; line-height: 1.55; }
.man-body h1 { margin-top: 0; }
.man-body code { background: rgba(127,127,127,.18); padding: 1px 5px; border-radius: 4px; }
.man-body blockquote { margin: 12px 0; padding: 6px 14px; border-left: 3px solid rgba(127,127,127,.5); background: rgba(127,127,127,.08); }
.man-table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.man-table th, .man-table td { border: 1px solid rgba(127,127,127,.3); padding: 5px 9px; text-align: left; vertical-align: top; }
.man-table th { background: rgba(127,127,127,.12); }

/* documents on a transaction (documents.js) */
.docs { margin-top: 12px; padding-top: 8px; border-top: 1px solid rgba(127,127,127,.3); }
.docrow { display: flex; gap: 10px; align-items: baseline; padding: 2px 0; }
.docrow .link { margin-left: auto; }
.docs-drop { margin-top: 6px; padding: 8px; border: 1px dashed rgba(127,127,127,.5); border-radius: 6px; }
.docs-drop.over { background: rgba(127,127,127,.15); }
.docwith { margin: -2px 0 6px; font-size: 12px; }
.grid2 > .docs { grid-column: 1 / -1; }
.cv-splits { width: 100%; margin: 0 0 10px; font-size: 13px; } .cv-splits td { padding: 3px 6px; border-top: 1px solid var(--line); }
.whynone { margin: 4px 0 10px 18px; padding: 0; } .whynone li { margin: 3px 0; }
.whynone { margin: 4px 0 10px 18px; padding: 0; } .whynone li { margin: 3px 0; }
.man-body img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.bb-total { font-variant-numeric: tabular-nums; }
.acc .acc-ic { flex: none; align-self: center; opacity: .65; margin-right: -2px; }
.acc.active .acc-ic { opacity: 1; }

/* dragging a file over the list: a banner, and a flash when the file has landed */
.cv-card { position: relative; }
#dropbanner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 7px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; box-shadow: 0 2px 10px rgba(0,0,0,.25); pointer-events: none; }
#dropbanner[hidden] { display: none; }
@keyframes dropflash { from { background: color-mix(in srgb, var(--pos, #1a8a4a) 35%, var(--panel)); } to { background: transparent; } }
tr.row.drop-flash > td { animation: dropflash 1.4s ease-out; }
.cv-card.drop-flash { animation: dropflash 1.4s ease-out; }
.docrow a.txnlink { color: inherit; text-decoration: none; }
.docrow a.txnlink:hover b { text-decoration: underline; color: var(--accent); }
#login { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; padding: 16px; }
#login .lg-card { width: min(420px, 100%); }
#login .lg-bad { color: var(--neg); min-height: 1.3em; }
#login .muted { min-height: 1.3em; }
#demobadge { position: fixed; bottom: 10px; right: 12px; z-index: 55; padding: 4px 12px; border-radius: 999px; background: #c2410c; color: #fff; font-size: 12px; font-weight: 600; opacity: .92; pointer-events: none; }

/* the sidebar can be hidden (static/sidetoggle.js); a narrow strip with one button takes its place, so nothing is covered in any design */
#siderail { display: none; flex: none; width: 26px; position: sticky; top: 0; height: 100vh; padding: 12px 0 0 3px; }
#side-show { width: 22px; height: 22px; padding: 0; border-radius: 6px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 8px; cursor: pointer; }
#side-show:hover { color: var(--ink); background: var(--hover); }
html.nosidebar #side, html.nosidebar #resizer { display: none; }
html.nosidebar #siderail { display: block; }
html[data-design=topnav] #siderail { width: auto; height: auto; position: static; padding: 8px 12px 0; }
@media (max-width: 800px) { #siderail { width: auto; height: auto; position: static; padding: 8px 12px 0; } }
