/* Financy · "Bold Ledger": navy header band, deep red for actions and alerts */
:root {
  --navy: #102A54; --navy-line: #3B5788; --navy-muted: #AFC0DD; --navy-soft: #DCE4F2;
  --red: #9F1239; --red-dark: #7A0E2C; --rose: #F2627F;
  --bg: #F6F7FA; --card: #FFFFFF; --ink: #0E1A33; --muted: #5A6378;
  --line: #E5E8EF; --line-soft: #F0F2F6; --field: #D9DEE8; --day: #EEF1F7;
  --in: #146C54; --in-on-navy: #8FE3C3; --chip: #E3E9F5; --faint: #8A93A6;
  --head: Archivo, "Segoe UI", system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); font-variant-numeric: tabular-nums; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3 { font-family: var(--head); }
code { font-size: .9em; word-break: break-all; }

/* ---------- logo ---------- */
.logo { font-family: var(--head); font-weight: 800; letter-spacing: -0.03em; color: var(--navy); text-decoration: none; line-height: 1; }
.logo .in { color: var(--red); }
.band .logo { color: #fff; font-size: 22px; }
.band .logo .in { color: var(--rose); }

/* ---------- header band ---------- */
/* safe-area insets (zero on a PC): on an iPhone the page runs under the status bar, the home indicator and,
   in landscape, the notch */
.band { background: var(--navy); color: #fff; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.band-inner { max-width: 1200px; margin: 0 auto; padding: 16px 24px 28px; display: flex; flex-direction: column; gap: 24px; }
.topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar nav { display: flex; gap: 6px; flex: 1; }
.topbar nav a { color: var(--navy-soft); text-decoration: none; font-weight: 500; border-radius: 999px; padding: 7px 16px; }
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar nav a.on { background: #fff; color: var(--navy); font-weight: 600; }
.topbar .meta { font-size: 13px; color: var(--navy-muted); }
.topbar .meta { position: relative; }
.topbar .meta .more { position: absolute; top: 100%; right: 0; margin-top: 4px; white-space: nowrap; }   /* under the header row: it never wraps the menu */
.topbar .meta b { color: #fff; font-weight: 600; }
.topbar .meta .now { color: #fff; }
.topbar .meta .bad { color: var(--rose); }
.topbar .meta a.bad { text-decoration: underline; }
.topbar form { margin: 0; }
.btn-ghost-light { background: transparent; color: #fff; border: 1px solid var(--navy-line); border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 14px; cursor: pointer; }
.btn-ghost-light:hover { background: rgba(255,255,255,.08); }
a.btn-ghost-light { text-decoration: none; }
.btn-ghost-light.on { background: #fff; color: var(--navy); }
.headline { display: flex; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.headline h1 { margin: 0; font-weight: 800; font-size: 46px; letter-spacing: -0.025em; line-height: 1; flex: 1; }
.stat .label { font-size: 13px; color: var(--navy-muted); }
.stat .value { font-family: var(--head); font-weight: 700; font-size: 26px; white-space: nowrap; }
.stat .value.in { color: var(--in-on-navy); }

/* personal accounts on the first row; business accounts and Cash on the second (.brk starts it) */
.balances { display: grid; grid-template-columns: repeat(5, minmax(100px, auto)); gap: 10px 28px; }
.bal.brk { grid-column-start: 1; }
.bal .label { font-size: 13px; color: var(--navy-muted); display: flex; align-items: center; gap: 6px; }
.bal .value { font-family: var(--head); font-weight: 700; font-size: 22px; white-space: nowrap; }
.bal .value.neg { color: #FFB3C1; }
.bal .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--navy-muted); }
.bal[data-acct="Revolut"] .dot { background: #C9B5F5; } .bal[data-acct="Electron"] .dot { background: #A9DDB9; }
.bal[data-acct="Gold"] .dot { background: #A8C4F0; } .bal[data-acct="Luminor"] .dot { background: #F5C89A; }
.bal[data-acct="Cash"] .dot { background: #E9D27A; }
.bal .label a { color: inherit; }

/* ---------- page ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 24px calc(24px + env(safe-area-inset-right)) 56px calc(24px + env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.card h2 { margin: 0; font-size: 19px; font-weight: 700; color: var(--navy); }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.small { font-size: 13px; color: var(--muted); }
.flash { background: var(--chip); color: var(--navy); padding: 10px 14px; border-radius: 10px; margin: 0; font-weight: 500; }
.warn { color: var(--red); font-weight: 500; }

/* ---------- controls ---------- */
input, select, button { font: inherit; }
input, select { font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--field); border-radius: 10px; padding: 9px 12px; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--red); color: #fff; border: 1px solid var(--red); border-radius: 10px; padding: 9px 18px; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 40px; }
.btn[hidden] { display: none; }
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn.navy { background: var(--navy); border-color: var(--navy); }
.btn.outline { background: transparent; color: var(--red); }
.btn.outline:hover { background: #FBEFF2; color: var(--red-dark); }
.btn.quiet { background: #fff; color: var(--navy); border-color: var(--field); }
.btn:disabled { opacity: .5; cursor: default; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 400; }
label.check input { width: 18px; height: 18px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.seg { display: flex; background: #fff; border: 1px solid var(--field); border-radius: 10px; padding: 3px; }
.seg a { color: var(--ink); text-decoration: none; border-radius: 8px; padding: 6px 14px; font-size: 14px; }
.seg a.on { background: var(--navy); color: #fff; font-weight: 600; }

/* ---------- alert: amounts changed after pending ---------- */
.alert { background: #fff; border: 2px solid var(--red); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.alert-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alert-head h2 { margin: 0; font-family: var(--body); font-size: 15px; font-weight: 600; color: var(--ink); }
.tag { background: var(--red); color: #fff; font-family: var(--head); font-weight: 700; font-size: 12px; letter-spacing: .03em; border-radius: 6px; padding: 3px 9px; }
.change { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line-soft); margin: 0; }
.change .what { flex: 1; min-width: 220px; color: var(--muted); font-size: 14px; }
.change .what b { color: var(--ink); }
.change .fix { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; color: var(--ink); }
.change .fix .where { font-weight: 600; color: var(--red-dark); }
.change .fix .cell { background: var(--bg); border-radius: 6px; padding: 2px 8px; }
.change .fix s { color: var(--muted); margin-right: 4px; }
.change .fix-add { flex-direction: column; align-items: stretch; }
.change .fix .nw { white-space: nowrap; }
.change .fix .tsv { width: 100%; box-sizing: border-box; font: 12px/1.4 ui-monospace, Consolas, monospace; white-space: pre; overflow-x: auto; resize: vertical; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--bg); color: var(--ink); }

/* ---------- transactions grouped by day ---------- */
#rv-days { display: contents; }   /* its days are spaced by main */
.day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--day); border-bottom: 1px solid var(--line); }
.day-head h3 { margin: 0; font-weight: 700; font-size: 16px; color: var(--navy); }
.day-head .net { font-size: 14px; color: var(--muted); }
.day-head .net b { color: var(--ink); }
.filters.card { padding: 14px 18px; }
.filters[open] summary { margin-bottom: 12px; }
.filters .toolbar { margin: 0; }
.badge { font-family: var(--body); font-size: 11px; font-weight: 600; color: var(--navy); background: var(--chip); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.badge.final { background: transparent; border: 1px solid var(--field); color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; padding: 6px; }

.lab { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 5px; font-size: 13px; color: var(--navy); }
.lab span { background: var(--chip); border-radius: 6px; padding: 1px 8px; }
.lab .cat { font-weight: 600; }
.lab .src { background: transparent; padding: 0; color: var(--muted); font-size: 12px; }
.lab .flow { background: var(--navy); color: #fff; font-weight: 600; }
.lab .elim { background: #FBEFF2; color: var(--red-dark); }
.lab .part { background: transparent; font-weight: 600; color: var(--ink); }
.lab.sug span:not(.src) { background: transparent; border: 1px dashed #A9B6CE; color: var(--muted); }
.lab.sug .cat { color: var(--navy); }

/* ---------- import ---------- */
.upload { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0 0; }
.upload input[type=file] { flex: 1; min-width: 220px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.kpi { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.kpi .value { font-family: var(--head); font-weight: 700; font-size: 24px; color: var(--navy); }
.kpi .label { font-size: 13px; color: var(--muted); }
table.list { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 10px; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
table.list td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list .num { text-align: right; white-space: nowrap; }
.scroll { overflow-x: auto; }
.setting { margin: 10px 0 0; }

/* ---------- review ---------- */
.topbar nav a .count { display: inline-block; min-width: 20px; text-align: center; background: var(--rose); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.topbar nav a.on .count { background: var(--red); }
.tools summary { cursor: pointer; font-family: var(--head); font-weight: 700; color: var(--navy); }
.tools-body { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 12px; }
.tools h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
/* transactions: add a row / count the wallet */
#tx-list { display: contents; }   /* a wrapper only so the list can be refreshed after a sync */
.tx-actions { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.badge.edit { text-decoration: none; background: #fff; border: 1px solid var(--field); }
/* every reviewed line can be edited: with a mouse the button shows on the line under it, so the list stays calm */
@media (hover: hover) { .tx:not(:hover):not(:focus-within) .badge.edit { visibility: hidden; } }
/* add / edit a manual row */
.add-form { display: flex; flex-direction: column; gap: 10px; }
.add-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.add-head input[name=account] { width: 170px; }
/* the head's fields and switches share one height, so their bottoms line up */
.add-head input { height: 36px; padding: 5px 10px; border-radius: 8px; }
.add-head .seg { padding: 2px; border-radius: 8px; height: 36px; box-sizing: border-box; }
.add-head .seg label { display: flex; flex-direction: row; align-items: center; gap: 6px; padding: 0 12px; font-size: 14px; cursor: pointer; border-radius: 6px; }
.add-head .seg label:has(input:checked) { background: var(--navy); color: #fff; font-weight: 600; }
.add-head .seg input { position: absolute; opacity: 0; pointer-events: none; }
.part .cur input[name=orig_amount] { width: 90px; text-align: right; } .part .cur input[name=orig_currency] { width: 64px; text-transform: uppercase; }
.add-form .hint { margin: 0; color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0 0; }
/* bulk edit: a tick box per card while "Select lines" is on, and a bar fixed to the bottom */
.rv .pick { display: none; width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--navy); }
.selecting .rv .pick { display: inline-block; }
.bulk-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end;
  padding: 12px max(calc(16px + env(safe-area-inset-right)), calc((100vw - 1152px) / 2)) calc(12px + env(safe-area-inset-bottom))
    max(calc(16px + env(safe-area-inset-left)), calc((100vw - 1152px) / 2)); background: #fff; border-top: 2px solid var(--navy); box-shadow: 0 -6px 18px rgba(16, 42, 84, .12); }
.bulk-bar[hidden] { display: none; }
.bulk-bar .bulk-count { align-self: center; color: var(--navy); }
.bulk-bar .f { font-size: 12px; }
.bulk-bar select, .bulk-bar input { padding: 7px 9px; font-size: 14px; }
.bulk-bar #bulk-sub { width: 190px; }
.selecting main { padding-bottom: 140px; }
.rv { padding: 14px 18px 16px; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.rv:last-child { border-bottom: 0; }
.rv[data-acct="Revolut"] { background: #F9F6FE; } .rv[data-acct="Electron"] { background: #F5FBF7; }
.rv[data-acct="Gold"] { background: #F5F8FE; } .rv[data-acct="Luminor"] { background: #FFF9F3; }
.rv-head { display: grid; grid-template-columns: minmax(0, 1fr) 90px 140px; gap: 14px; align-items: start; }
.rv-head .desc { font-weight: 600; display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.rv-head .party { font-size: 13px; color: var(--muted); }
.rv-head .why { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rv-head .acct { font-size: 14px; color: var(--muted); }
.rv-head .amt { text-align: right; font-family: var(--head); font-weight: 700; font-size: 18px; white-space: nowrap; }
.rv-head .amt.pos { color: var(--in); }
.rv-head .amt .sub { font-family: var(--body); font-weight: 400; font-size: 12px; color: var(--muted); }
.rv-form { margin: 10px 0 0; }
/* a part: what gets typed (amount, subcategory, place, comment) on top, what follows from it as chips below */
.part { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.part + .part { border-top: 1px dashed var(--field); }
.part-main { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.part-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.part .f { font-size: 12px; gap: 3px; min-width: 0; }
/* one height for every field: selects, text and date inputs otherwise differ by a pixel or two */
.part .f select, .part .f input { height: 36px; box-sizing: border-box; padding: 4px 10px; font-size: 15px; border-radius: 8px; width: 100%; }
.part .amt { flex: 0 0 104px; } .part .amt input { text-align: right; }
.part .amt input.neg { color: var(--red); border-color: var(--red); }
.part .subc { flex: 2.2 1 230px; } .part .plc { flex: 1.2 1 150px; } .part .cmt { flex: 1.6 1 160px; }
.part .cm { flex: 1 1 150px; } .part .typ { flex: 0 1 140px; } .part .inv { flex: 0 1 110px; }
.part[data-sheet="CM"] .cmt { flex: 3 1 320px; }   /* a movement has room: "20% papildomai nuo 1000" fits */
.part[data-sheet="PL"] .cm, .part[data-sheet="CM"] .pl { display: none; }
.part:not([data-gbp]) .gbp, .gbp-only { display: none; } .part .gbp { flex: 0 1 110px; }
form[data-gbp] .gbp-only { display: inline; } form[data-gbp] p.gbp-only { display: block; } form[data-gbp] .part .cur, form[data-gbp] .eur-only { display: none; }
/* one line, nothing to divide: the amount is the transaction's own (Review, Edit) */
.rv-form[data-n="1"] .part .amt { display: none; }
.part .chip { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; position: relative; min-height: 30px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 400; color: var(--ink); }
.part .chip .k { color: var(--faint); }
.part .chip:focus-within { border-color: var(--navy-line); }
.part .chip input, .part .chip select { border: 0; padding: 0 2px; height: 24px; font-size: 13px; background: transparent; border-radius: 4px; min-width: 0; }
.part .chip input[data-pick] { width: 15ch; field-sizing: content; min-width: 8ch; max-width: 26ch; }
.part .chip input[name=elim] { width: 9ch; field-sizing: content; min-width: 6ch; max-width: 20ch; }
@supports (field-sizing: content) { .part .chip input[data-pick], .part .chip input[name=elim] { width: auto; } }
.part .chip { max-width: 100%; } .part .chip .pick-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.part .chip input[name=orig_amount] { width: 8ch; text-align: right; } .part .chip input[name=orig_currency] { width: 5ch; text-transform: uppercase; }
.part .chip:has(input[data-pick]:placeholder-shown) { border-color: var(--red); background: #FBEFF2; }
.part .chip input[data-pick]::placeholder { color: var(--red); }
/* the Family chip in its family category's color (.fcN, set by pick.js) */
.part .chip.fam-c { background: var(--t); border-color: transparent; }
.part .chip.fam-c input { color: var(--c); font-weight: 600; }
.part .chip.fam-c::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; order: 1; }
.part .chip.fam-c .k { order: 0; } .part .chip.fam-c input { order: 2; } .part .chip.fam-c .pick-hint { order: 3; }
.part .chip.fam-c:focus-within { border-color: var(--c); }
.pick-hint { font-size: 12px; font-weight: 400; color: var(--faint); white-space: nowrap; }
.pick-hint.new { color: #fff; background: var(--navy); border-radius: 999px; padding: 0 7px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.part .vat { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.vat-btn { font: inherit; font-size: 13px; font-weight: 600; color: var(--navy); background: #fff; border: 1px solid var(--line);
  border-radius: 999px; height: 30px; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.vat-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.vat-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }
.part .rm { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; padding: 6px 8px; height: 36px; }
.part .rm[hidden] { display: none; }
/* the picker's list: one, floating under whichever field is being typed in */
.pick-list { position: fixed; z-index: 40; max-height: 380px; overflow-y: auto; background: #fff; border: 1px solid var(--field);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 42, 84, .16); padding: 4px; }
.pick-list[hidden] { display: none; }
.pick-list .pick-grp { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.pick-list .opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 12px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.pick-list .opt .path { font-size: 12px; color: var(--muted); }
.pick-list .opt .n { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 12px; color: var(--faint); }
.pick-list .opt mark { background: none; color: var(--red); font-weight: 600; }
.pick-list .opt .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: 1px; }
.pick-list .opt.hl { background: var(--chip); }
.pick-list .opt.new { color: var(--navy); }
kbd { font: 600 10.5px/1 var(--body); border: 1px solid var(--field); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: var(--navy); background: #fff; }
.btn kbd { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn.quiet kbd { background: #fff; color: var(--navy); border-color: var(--field); }
.btn.outline kbd { background: transparent; color: var(--red); border-color: currentColor; }
@media (hover: none) { kbd { display: none; } }   /* phones: no keyboard shortcuts to show */
.rv.done { padding: 8px 18px; }
.rv-done { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rv-done > span:first-child { font-weight: 600; color: var(--in); }
.rv-done .small { flex: 1; }
.rv-done form { margin: 0; }
.rv-error { margin: 4px 0; padding: 6px 10px; }
.rv-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.rv-actions .left { flex: 1; }
.card.recent { overflow-x: auto; }   /* the table is wider than a phone */
/* Copy / Paste: small chips, quieter than the action buttons */
.clip { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--navy);
  background: var(--chip); border: 1px solid transparent; border-radius: 8px; padding: 4px 10px; min-height: 28px; cursor: pointer; }
.clip:hover { border-color: var(--navy-muted); }
.clip:disabled { opacity: .6; cursor: default; }
.clip[hidden] { display: none; }
.clip.paste { max-width: min(380px, 100%); min-width: 0; }
.clip.paste span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; color: var(--muted); }

/* ---------- banks ---------- */
.sync-done[hidden] { display: none; }
.sync-done { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 2px solid var(--in); }
.sync-done .msg { flex: 1; font-weight: 600; color: var(--in); }
.sync-state { color: var(--in); font-weight: 600; }
.bcheck.ok { color: var(--in); }
.bcheck.recheck { color: var(--muted); }
.bcheck.mismatch { color: var(--red); }
.bcheck-detail { border-left: 3px solid var(--red); padding: 4px 0 4px 14px; margin: 4px 0 8px; font-size: 14px; }
.bcheck-detail p { margin: 4px 0; }
.bcheck-detail ul { margin: 4px 0 8px; padding-left: 18px; }
.bank { display: flex; flex-direction: column; gap: 10px; }
.consent { font-size: 14px; color: var(--muted); }
.consent.bad { color: var(--red); font-weight: 600; }
.account { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 12px 0 0; border-top: 1px solid var(--line-soft); margin: 0; }
.account .name { font-weight: 600; }
.account input[name=name] { width: 120px; }
table.runs { border-collapse: collapse; width: 100%; }
table.runs td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: top; }
table.runs td:first-child { white-space: nowrap; color: var(--muted); }

/* ---------- login / setup ---------- */
.auth-page { min-height: 100vh; background: var(--navy); display: flex; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); }
.auth { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.auth > .logo { color: #fff; font-size: 40px; text-align: center; }
.auth > .logo .in { color: var(--rose); }
.auth .card { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.auth .card h1 { margin: 0; font-size: 22px; color: var(--navy); }
.auth .card input:not([type=checkbox]) { width: 100%; }
.auth .flash { background: #FBEFF2; color: var(--red-dark); }
.qr { display: flex; justify-content: center; }
.qr svg { width: 200px; height: 200px; }

/* ---------- phone ---------- */
@media (max-width: 700px) {
  .band-inner { padding: 12px 16px 20px; gap: 16px; }
  .topbar { gap: 10px; }
  .topbar nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .topbar nav a { white-space: nowrap; padding: 7px 12px; }
  .topbar .meta { display: none; }
  .topbar .meta.live { display: block; order: 4; flex-basis: 100%; }   /* a sync running or just done */
  .topbar .meta .more { position: static; margin: 0; }
  .topbar .meta .more::before { content: "· "; }
  .headline { gap: 18px; }
  .headline h1 { font-size: 34px; flex-basis: 100%; }
  .headline:has(.sync-form) h1 { flex-basis: auto; }   /* title and Sync now share a line */
  .headline:has(.sync-form) .balances { flex-basis: 100%; }
  .stat .value { font-size: 19px; }
  .balances { grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 8px 6px; }
  .bal .label { font-size: 12px; gap: 4px; }
  .bal .dot { width: 6px; height: 6px; }
  .bal .value { font-size: 14px; }
  main { padding: 14px calc(16px + env(safe-area-inset-right)) 40px calc(16px + env(safe-area-inset-left)); gap: 14px; }
  .toolbar > * { flex: 1 1 auto; }
  .seg { flex-basis: 100%; }
  .seg a { flex: 1; text-align: center; padding: 9px 6px; }
  .filters.card { padding: 14px 16px; }
  .day-head { padding: 10px 14px; }
  .account { grid-template-columns: 1fr auto; }
  .btn, .seg a { min-height: 44px; }
  .tools-body { grid-template-columns: 1fr; }
  .rv-head { grid-template-columns: minmax(0, 1fr) auto; }
  .rv-head .acct { grid-column: 1; grid-row: 2; }
  .rv-head .amt { grid-column: 2; grid-row: 1 / span 2; }
  .part .f { flex: 1 1 140px; } .part .f select, .part .f input { height: 42px; }   /* finger-sized */
  .part .subc { flex-basis: 100%; }
  .part .chip { min-height: 38px; } .part .chip input, .part .chip select { height: 32px; font-size: 15px; }
  .bulk-bar { padding: 10px 16px; gap: 8px; } .bulk-bar .f { flex: 1 1 40%; } .bulk-bar .f select, .bulk-bar .f input { width: 100% !important; }
}

/* logins page */
.login-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.login-row:first-of-type { border-top: 0; }
.login-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.login-row form { margin: 0; }
.devices { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.devices li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.devices button { padding: 2px 10px; min-height: 0; font-size: 13px; }
.tag-role { display: inline-block; font-size: 12px; font-weight: 600; background: var(--chip); color: var(--navy); border-radius: 999px; padding: 1px 9px; margin-left: 6px; }
.invite-link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.invite-link input { flex: 1; min-width: 240px; font-family: ui-monospace, monospace; font-size: 13px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }

/* family pages */
.family-empty { text-align: center; padding: 48px 20px; }

/* your login (/account) */
.account-form { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.account-form .qr { justify-content: flex-start; }
.account-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.account-fields input { width: 100%; }

/* movement type on a cash movement part (Review, Add) */
.part .typ select { width: 130px; }

/* ---------- budget (/budget) ---------- */
.band-note { margin: 0; flex-basis: 100%; font-size: 14px; color: var(--navy-muted); }
table.budget { border-collapse: collapse; width: 100%; font-size: 14px; }
.budget th, .budget td { padding: 5px 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; text-align: right; }
.budget thead th { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.budget th.rowh { text-align: left; font-weight: 600; color: var(--ink); position: sticky; left: 0; background: var(--card); z-index: 1; }
.budget thead th.rowh { color: var(--muted); }
.budget thead th.cur { color: var(--navy); }
.budget td.m input { width: 84px; text-align: right; padding: 6px 8px; font-weight: 600; border-color: transparent; background: var(--bg); }
.budget td.m input:placeholder-shown { font-weight: 400; }
.budget td.m input::placeholder { color: #9AA3B5; }
.budget td.m input:hover { border-color: var(--field); }
.budget td.m.cur input { background: #fff; border-color: var(--field); }
.budget td.avg { color: var(--muted); }
.budget td.avg.hi { color: var(--red); font-weight: 600; }
.budget tr.tot td, .budget tr.tot th { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.budget tr.sep th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 16px; }
.pace { display: inline-flex; background: var(--line-soft); border-radius: 999px; padding: 2px; }
.pace label { flex-direction: row; cursor: pointer; }
.pace input { position: absolute; opacity: 0; pointer-events: none; }
.pace span { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; color: var(--muted); }
.pace input:checked + span { background: var(--navy); color: #fff; font-weight: 600; }
.pace input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 1px; }
.mstep { display: none; align-items: center; gap: 8px; margin: 10px 0; }
.mstep button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--field); background: #fff; color: var(--navy); cursor: pointer; }
.mstep button:disabled { opacity: .35; }
.mstep .label { font-family: var(--head); font-weight: 700; font-size: 17px; min-width: 150px; text-align: center; color: var(--navy); }
table.rules { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 8px; }
.rules td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line-soft); vertical-align: top; }
.rules td:first-child { font-weight: 600; white-space: nowrap; width: 1%; }
.rules td.num { text-align: right; font-weight: 600; white-space: nowrap; }
.rules details summary { cursor: pointer; color: var(--red); font-size: 13px; font-weight: 600; }
.rules ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.rules li { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
table.types select { padding: 5px 8px; font-size: 13px; }
table.types tr.typed td { background: #FAFBFD; }

/* ---------- balances (/balances) ---------- */
.acc { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) 150px minmax(0, 1fr); gap: 6px 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.acc-head { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 0 4px; border-top: 0; }
.acc .r { text-align: right; }
.acc .nm { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.acc .nm .small { font-weight: 400; flex-basis: 100%; }
.acc .calc { text-align: right; display: flex; flex-direction: column; }
.acc .calc .v { font-family: var(--head); font-weight: 700; font-size: 18px; white-space: nowrap; }
.acc .calc .how { font-size: 12px; color: var(--muted); }
.acc input { width: 100%; text-align: right; }
.acc .diff { text-align: right; font-size: 13px; }
.acc-more { grid-column: 1 / -1; background: var(--bg); border-radius: 10px; padding: 10px 14px; font-size: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.acc-more[hidden] { display: none; }
.acc-more h4 { margin: 0 0 4px; font-size: 12px; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; }
.acc-more .ln { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.acc-more .ln:last-child { border-bottom: 0; }
.acc-more .ln > span { flex: 1; }
.acc-more .src { color: var(--muted); font-size: 12px; }
.acc-more .ln b { white-space: nowrap; font-weight: 600; }
.acc-more .ln b.neg { color: var(--red); }
.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; }
.linkish:hover { color: var(--red); }
.chip-due, .chip-ok, .chip-bad, .chip-tag { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.chip-due { background: #FDF1DE; color: #B45309; }
.chip-ok { background: #E3F4EC; color: var(--in); }
.chip-bad { background: #FBEFF2; color: var(--red); }
.chip-tag { background: var(--chip); color: var(--navy); }
.acc .gap { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; background: #FBEFF2; color: var(--red); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.acc .gap b { font-family: var(--head); font-size: 15px; white-space: nowrap; }
.acc .gap .acts { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.acc .gap a { color: var(--red); font-weight: 600; }
.gap-note { background: #FBEFF2; color: var(--red); font-size: 14px; }
.save-row { display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 14px; margin-top: 6px; border-top: 2px solid var(--line); }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
.bank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px 18px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.bank-row .v { font-family: var(--head); font-weight: 700; font-size: 17px; text-align: right; white-space: nowrap; }
.bank-row .v.neg { color: var(--red); }
.bank-row .st { font-size: 13px; color: var(--in); font-weight: 600; text-align: right; }
.hdr-dot { color: var(--navy); font-size: 10px; }
.pots { background: var(--bg); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; font-size: 13px; display: grid; gap: 6px; }
.pots-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pots h4 { margin: 0; font-size: 12px; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; }
.pot { display: grid; grid-template-columns: minmax(0, 320px) 140px 24px; gap: 8px; align-items: center; }
.pot input { padding: 6px 10px; min-width: 0; }
.pot .amt { text-align: right; }
.pot.rest { border-top: 1px solid var(--line); padding-top: 6px; }
.pot.rest b { font-family: var(--head); font-size: 15px; text-align: right; padding-right: 11px; white-space: nowrap; }
.pot.rest b.neg { color: var(--red); }
.pots .over { margin: 0; }
.pots-save { display: flex; justify-content: flex-end; }

@media (max-width: 700px) {
  .mstep { display: flex; }
  .budget th.m:not(.on), .budget td.m:not(.on), .budget td.avg, .budget th.avg { display: none; }
  .budget th, .budget td { padding: 5px 3px; }
  .budget th.rowh { white-space: normal; }
  .budget td.m input { width: 80px; }
  .pace span { padding: 3px 7px; }
  .rules tr, .rules td { display: block; }
  .rules td { border-top: 0; padding: 2px 0; }
  .rules td:first-child { border-top: 1px solid var(--line-soft); padding-top: 10px; width: auto; }
  .rules td.num { text-align: left; padding-bottom: 10px; }
  .acc-head { display: none; }
  .acc { grid-template-columns: minmax(0, 1fr) auto; }
  .acc .calc { grid-column: 2; grid-row: 1; }
  .acc input { grid-column: 1; }
  .acc .diff { grid-column: 2; }
  .acc-more { grid-template-columns: 1fr; }
  .bank-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bank-row .st { grid-column: 1 / -1; text-align: left; }
  .pot { grid-template-columns: minmax(0, 1fr) 110px 24px; }
}

/* ---------- transactions: the date in a gutter, family categories as colored pills ---------- */
.fc0 { --c: #2459B8; --t: #E8F0FC; } .fc1 { --c: #7A3BBF; --t: #F3EBFC; } .fc2 { --c: #21744A; --t: #E5F4EA; }
.fc3 { --c: #0B6F75; --t: #E1F3F4; } .fc4 { --c: #9C5A0C; --t: #FCEFDD; } .fc5 { --c: #AE3159; --t: #FCE8EE; }
.fc6 { --c: #5E6F12; --t: #F0F4DE; } .fc7 { --c: #B4441C; --t: #FDEBE3; } .fc8 { --c: #3F48B5; --t: #ECEDFB; }
.fc9 { --c: #9B2C8F; --t: #FAE8F7; } .fcn { --c: #4F586C; --t: #EEF1F6; }
.dg { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 24px; }
.dg-gut { position: sticky; top: 16px; align-self: start; padding-top: 6px; display: flex; flex-direction: column; gap: 18px; }
.dg-date { display: flex; flex-direction: column; align-items: flex-start; }
.dg-date .n { font: 800 56px/.9 var(--head); color: var(--navy); letter-spacing: -.045em; }
.dg-date .w { font: 600 12px/1.5 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 8px; }
.dg-date .w > span { display: block; }
.dg-date .rel { font-size: 11px; font-weight: 600; color: var(--navy); background: var(--chip); border-radius: 999px; padding: 1px 9px; margin-top: 8px; }
.dg-date .rel.today { color: #fff; background: var(--red); }
.dg-date .net { margin-top: 16px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; }
.dg-date .net b { font: 700 17px var(--head); color: var(--ink); }
.dg-date .net .bk { font-size: 11.5px; margin-top: 1px; }
.dg-spend { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.dg-spend .lbl b { display: block; font: 700 17px var(--head); color: var(--ink); }
.dg-spend .segs { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.dg-spend .segs i { flex-basis: 0; min-width: 3px; background: var(--c); }
.dg-spend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.dg-spend li { display: flex; align-items: center; gap: 6px; }
.dg-spend li i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.dg-spend li .f { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.dg-rows { background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-width: 0; overflow: clip; }
/* each account's block of rows has a rail on its left with the account's name (a one-row block gets the short code) */
.grp { display: grid; grid-template-columns: 30px minmax(0, 1fr); --ac: var(--muted); --at: var(--day); }
.grp + .grp { border-top: 1px solid var(--line); }
.grp[data-acct="Revolut"] { --ac: #6E4FCB; --at: #F3EEFE; }
.grp[data-acct="Electron"] { --ac: #2B7F50; --at: #EAF6EF; }
.grp[data-acct="Gold"] { --ac: #3768B8; --at: #EBF2FD; }
.grp[data-acct="Luminor"] { --ac: #B5651F; --at: #FFF1E4; }
.grp[data-acct="Cash"] { --ac: #8A6E0B; --at: #FBF5DC; }
.rail { background: var(--at); border-right: 1px solid var(--line); contain: size; overflow: clip; }
.rail span { position: sticky; top: 12px; display: block; width: max-content; margin: 0 auto; padding: 10px 0; writing-mode: vertical-rl; transform: rotate(180deg);
  font: 700 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ac); white-space: nowrap; }
.gr { min-width: 0; }
.tx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px) 120px; gap: 22px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--line-soft); }
.tx:first-child { border-top: 0; }
.tx .who { min-width: 0; }
.tx .t1 { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.tx .t1 .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* your own comment: beside the Place on a computer, at the start of the grey line on a phone */
.tx .cm { font-weight: 400; font-style: italic; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 100 auto; }
.tx .t2 .cm, .tx .t2:not(:has(.bank)) { display: none; }
.tx.vanished .t2 .cm { display: block; flex: 0 0 auto; max-width: 100%; }
.tx .t2 { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; }
.tx .bank { font: 12px ui-monospace, Consolas, monospace; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tx .cats { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tx .ln { display: grid; gap: 3px; min-width: 0; }
.tx .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.tx .pill { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; border-radius: 999px; padding: 2px 11px 2px 9px; font-size: 13px; font-weight: 600;
  background: var(--t); color: var(--c); border: 1px dashed transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.tx .sug .pill { background: transparent; border-color: var(--c); font-weight: 500; font-style: italic; }
.tx .flow { font-size: 12px; background: var(--navy); color: #fff; font-weight: 600; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.tx .share { font-family: var(--head); font-weight: 600; font-size: 13px; white-space: nowrap; }
.tx .cs { padding-left: 10px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.tx .cs > span + span { margin-left: 6px; }
.tx .sug .cs { font-style: italic; }
.tx .cs .elim { font-size: 11px; font-weight: 600; background: #FBEFF2; color: var(--red-dark); border-radius: 6px; padding: 0 6px; font-style: normal; }
.tx .cs .typ { font-size: 11px; font-weight: 600; background: var(--navy-soft); color: var(--navy); border-radius: 6px; padding: 0 6px; font-style: normal; white-space: nowrap; }
.tx .typ-b { background: var(--navy-soft); }
@media (min-width: 701px) { .tx .cs .typ { display: none; } }   /* wide: the type sits by the name */
@media (max-width: 700px) { .tx .typ-b { display: none; } }     /* phone: under the label, as before */
.tx .cs .note { font-size: 11px; font-weight: 600; border: 1px dashed #A9B6CE; border-radius: 6px; padding: 0 6px; font-style: normal; white-space: nowrap; }
.tx .amt { text-align: right; font: 700 16px var(--head); white-space: nowrap; }
.tx .amt.pos { color: var(--in); }
.tx .amt .sub { font: 400 12px var(--body); color: var(--muted); }
.tx .amt .short, .tx .more { display: none; }
.tx.gone { opacity: .45; }
.tx.vanished { opacity: .65; }
.tx.vanished .t1 .cm { display: none; }
.tx.gone .nm, .tx.gone .amt { text-decoration: line-through; }
@media (max-width: 1000px) {
  .tx { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .tx .cats { grid-column: 1 / -1; grid-row: 2; }
}
/* phone: the date becomes one line pinned to the top; each row is three lines, and a tap opens the details */
@media (max-width: 700px) {
  .dg { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dg-gut { display: contents; }
  .dg-date { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 2; flex-direction: row; align-items: baseline; gap: 8px; background: var(--bg); padding: 6px 4px; }
  .dg-date .n { font-size: 24px; }
  .dg-date .w { margin: 0; font-size: 11px; }
  .dg-date .w > span { display: inline; }
  .dg-date .m { display: none; }
  .dg-date .rel { margin: 0; align-self: center; font-size: 10px; padding: 0 7px; }
  .dg-date .net { margin: 0 0 0 auto; flex-direction: row; gap: 4px; align-items: baseline; font-size: 11.5px; }
  .dg-date .net b { font-size: 14px; }
  .dg-date .net .bk { display: none; }
  .dg-spend { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 10px; padding: 0 4px 4px; font-size: 11.5px; }
  .dg-spend .lbl b { display: inline; font-size: 13px; }
  .dg-spend .segs { height: 6px; }
  .dg-spend ul { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 12px; }
  .dg-spend li .f { flex: none; }
  .dg-rows { border-radius: 12px; }
  .tx { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 6px 12px 7px; align-items: start; cursor: pointer; }
  .tx .who { grid-column: 1; grid-row: 1; }
  .tx .amt { grid-column: 2; grid-row: 1; font-size: 15px; line-height: 19px; }
  .tx .amt .long { display: none; }
  .tx .amt .short { display: inline; }
  .tx .amt .sub { font-size: 11.5px; line-height: 15px; color: var(--faint); margin-top: 1px; }
  .tx .t1 { font-size: 14.5px; line-height: 19px; gap: 6px; }
  .tx .t1 .badge { font-size: 10px; line-height: 14px; padding: 0 5px; }
  .tx .badge.edit { display: none; }
  .tx .t2 { gap: 6px; margin-top: 1px; }
  .tx .t1 .cm { display: none; }
  .tx .t2 .cm { display: block; font-size: 12px; line-height: 15px; flex: 0 0 auto; max-width: 60%; }
  .tx.vanished .t2 .cm { max-width: 100%; }
  table.final :is(th, td):nth-child(2) { display: none; }
  table.final :is(th, td):nth-child(3) { display: none; }
  table.final :is(th, td):nth-child(4) { display: none; }
  table.final :is(th, td):nth-child(5) { display: none; }
  .tx .t2:not(:has(.bank)) { display: flex; }
  .grp { grid-template-columns: 22px minmax(0, 1fr); }
  .rail span { top: 44px; font-size: 9.5px; padding: 8px 0; }
  .tx .bank { font-size: 11px; line-height: 15px; }
  .tx .cats { grid-column: 1 / -1; grid-row: 2; gap: 3px; }
  .tx .ln { display: flex; align-items: center; gap: 6px; }
  .tx .top { display: contents; }
  .tx .pill { flex: none; max-width: 62%; font-size: 12px; line-height: 17px; padding: 0 9px 0 7px; gap: 6px; }
  .tx .flow { flex: none; font-size: 11.5px; line-height: 17px; padding: 0 9px; }
  .tx .cs { order: 2; padding: 0; font-size: 12px; line-height: 17px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .tx .share { order: 3; margin-left: auto; }
  .tx.open { background: #F3F6FB; }
  .tx.open .more { display: grid; grid-column: 1 / -1; gap: 8px; padding-top: 6px; font-size: 13px; }
  .tx .more .raw { font: 11.5px/1.5 ui-monospace, Consolas, monospace; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; overflow-wrap: anywhere; }
  .tx .more dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; }
  .tx .more dt { color: var(--muted); }
  .tx .more dd { margin: 0; }
  .tx .more .btn { justify-self: start; min-height: 36px; padding: 6px 18px; }
}
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--red); text-decoration: underline; cursor: pointer; }
.acc .diff .book { display: flex; flex-direction: row; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
.acc .diff .book[hidden] { display: none; }
.acc .diff .book input { width: 15px; height: 15px; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
