/* aboo brand layer over tina4css — admin PWA shell, mobile-first.
   tina4css provides btn/card/badge/grid/forms; this adds the app frame. */
/* Colour: every colour in this sheet is a token from the one palette, public/brand/palette.css (plan/one-palette.md).
   A brand re-skins the whole app by setting those tokens in its public/brand/<key>/colors.css; no colour literal is
   written below (test/every_colour_comes_from_a_token.test.js). Layout metrics stay here. */
:root{
  /* v2 layout metrics (sleek.css): 8px radius, 12px cards; tenant sidebar is 200px (t-shell) */
  --drawer-w:248px; --bar-h:58px; --radius:8px; --radius-lg:12px;
  /* mobile bottom nav: bar height, and the padding pages need so content clears it (+ the
     iPhone home-indicator inset, available because index.html sets viewport-fit=cover) */
  --bottom-nav-h:56px; --bottom-nav-space:calc(var(--bottom-nav-h) + env(safe-area-inset-bottom,0px));
}
:root[data-theme="dark"] .drawer{ background:var(--c-cyan-l8); }
:root[data-theme="dark"] .form-control{ background:var(--c-cyan-l10); color:var(--ink); border-color:var(--line); }
:root[data-theme="dark"] .form-control::placeholder{ color:var(--c-slate-l51); }
:root[data-theme="dark"] .cat-code,
:root[data-theme="dark"] .iso-badge{ background:var(--c-cyan-l8); color:var(--hue-brand-bright); }
:root[data-theme="dark"] .row-card:hover,
:root[data-theme="dark"] .kpi{ box-shadow:0 1px 2px var(--shade-30); }
*{box-sizing:border-box}
html,body{margin:0;height:100%}
/* v2 typography: the system stack at 16px/1.5 (sleek.css body) — Sora retired */
body{background:var(--bg);color:var(--ink);
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
#app{height:100%}
a{color:var(--brand);text-decoration:none}

/* ---------- brand lockup ---------- */
.brand-lockup{display:flex;align-items:center;gap:8px;font-weight:800;letter-spacing:-.01em}
.brand-dot{width:14px;height:14px;border-radius:50%;background:var(--brand);box-shadow:0 0 0 4px color-mix(in srgb, var(--hue-brand) 25%, transparent)}
.brand-name{font-size:20px}
.brand-sub{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.12em;opacity:.6;margin-left:2px}

/* ---------- layout ---------- */
.layout{min-height:100%}
.drawer{position:fixed;top:0;left:0;width:var(--drawer-w);height:100%;background:var(--brand-ink);
  color:var(--c-cyan-l86);display:flex;flex-direction:column;z-index:40;transition:transform .22s ease;overflow-y:auto}
.drawer-brand{padding:16px 18px;color:var(--hue-paper);border-bottom:1px solid var(--sheen-08)}
.nav-list{padding:10px 10px 24px}
.nav-section{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:var(--c-slate-l60);
  padding:14px 12px 6px;font-weight:700}
.nav-item{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:10px;color:var(--c-cyan-l86);
  cursor:pointer;font-weight:500;user-select:none}
.nav-item:hover{background:var(--sheen-06);color:var(--hue-paper)}
.nav-item.active{background:var(--brand);color:var(--hue-deep);font-weight:600}
.nav-item.soon{opacity:.45;cursor:default}
.nav-item.soon:hover{background:none;color:var(--c-cyan-l86)}
/* an item split into sub-items (Ledger categories → IFRS / GAAP): the sub-items sit under it, their labels
   aligned with its label (12px padding + 20px icon + 11px gap); the item itself lights up while one is open */
.nav-item.nav-parent.open{color:var(--hue-paper)}
.nav-item.nav-sub{padding:7px 12px 7px 43px;font-size:14px}
.nav-ico{width:20px;text-align:center;font-size:15px;opacity:.9}
/* The Reports "∑" reads optically high beside its label — the glyph has no descender like the "p"
   in "Reports", so align-items:center (which aligns ink centres) leaves the title looking a touch
   high. Owner-chosen: nudge the LABEL down 2px (not the icon) so "Reports" sits in the middle of
   the ∑. Scoped to Reports only, via the adjacent sibling of its per-key icon class. */
.nav-ico-reports + .nav-lbl{position:relative;top:2px}
.nav-lbl{flex:1}
.soon-badge{font-size:12px;opacity:.8}

.main{margin-left:var(--drawer-w);min-height:100%;display:flex;flex-direction:column}
.app-bar{position:sticky;top:0;height:var(--bar-h);background:var(--surface);border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:12px;padding:0 16px;z-index:30}
.app-title-wrap{display:flex;flex-direction:column;line-height:1.1}
.app-company{font-weight:700;font-size:15px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:38ch}
.app-title{font-weight:500;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.app-user{display:flex;align-items:center;gap:10px;margin-left:auto}
.user-name{font-size:13px;color:var(--muted);max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Regional Partner: a locked region chip in the app bar (plan/partners.md Phase 1C). */
.region-chip{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:500;color:var(--c-cyan-l10b);background:var(--hue-brand);padding:3px 9px;border-radius:999px;white-space:nowrap}
.region-chip svg{width:13px;height:13px}
/* Admin/Member role badge next to the signed-in name (owner 2026-09-10 — "tells you if you are an
   admin or normal user"). Sits on the header band; admin = brand pill, member = subtle neutral. */
.role-badge{display:inline-flex;align-items:center;font-size:12px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:1px 7px;border-radius:999px;line-height:1.3;white-space:nowrap;flex:0 0 auto}
.role-admin{background:var(--brand);color:var(--hue-paper)}
/* Owner badge: a fixed amber pill (Andre 2026-09-14 — the old var(--ink) was near-black in light
   and white-on-white in DARK, unreadable). Amber-700 + white reads on both themes, distinct from
   the teal admin badge. */
.role-owner{background:var(--c-amber-700);color:var(--hue-paper)}
.role-member{background:color-mix(in srgb, var(--c-slate-l51b) 22%, transparent);color:var(--muted)}
/* tenant header: global "+ New" create menu + Approvals/Expenses notification shortcuts */
.t-newmenu-wrap{position:relative;display:inline-flex}
.t-new-btn{display:inline-flex;align-items:center;gap:5px;background:var(--brand);color:var(--hue-deep);
  border:0;border-radius:9px;padding:6px 12px;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap;line-height:1.2}
.t-new-btn:hover{filter:brightness(1.06)}
.t-new-caret{font-size:12px;opacity:.85}
.t-menu-backdrop{position:fixed;inset:0;z-index:60}
.t-newmenu-pop{position:absolute;top:calc(100% + 6px);left:0;z-index:61;min-width:196px;
  background:var(--surface);border:1px solid var(--line);border-radius:10px;
  box-shadow:0 10px 30px var(--shade-18);padding:6px;display:flex;flex-direction:column}
.t-newmenu-cap{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700;padding:7px 10px 2px}
.t-newmenu-item{text-align:left;background:none;border:0;border-radius:6px;padding:8px 10px;font-size:13px;color:var(--ink);cursor:pointer;width:100%}
.t-newmenu-item:hover{background:var(--brand-faint)}
.t-notif{position:relative;appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--ink);
  border-radius:9px;padding:5px 9px;cursor:pointer;font-size:15px;line-height:1}
.t-notif:hover{border-color:var(--muted)}
.t-notif-badge{position:absolute;top:-7px;right:-7px;background:var(--bad);color:var(--hue-paper);
  font-size:12px;font-weight:800;min-width:18px;height:18px;line-height:18px;border-radius:9px;padding:0 4px;text-align:center}
.nav-badge{margin-left:auto;background:var(--bad);color:var(--hue-paper);font-size:12px;font-weight:800;
  min-width:19px;height:19px;line-height:19px;border-radius:10px;padding:0 5px;text-align:center}
.nav-item.active .nav-badge{background:var(--hue-paper);color:var(--bad)}
/* NOTE: the app-bar hamburger is gone. On mobile the menu is the bottom bar (its "More" tab opens
   this drawer); on desktop the drawer is always visible. Nothing left for a top-left ☰ to do. */
.content{padding:18px 16px 64px;flex:1}
.scrim{display:none;position:fixed;inset:0;background:color-mix(in srgb, var(--c-slate-900) 45%, transparent);z-index:35}

/* mobile */
@media (max-width:767px){
  .drawer{transform:translateX(-100%)}
  .layout.nav-open .drawer{transform:translateX(0)}
  .layout.nav-open .scrim{display:block}
  .main{margin-left:0}
  .cb-summary{flex-wrap:wrap;gap:8px;position:static}
  .cb-summary-staged{flex-wrap:wrap;gap:8px}
}

/* ---------- page ---------- */
.page{max-width:920px;margin:0 auto}
.page-head{margin:2px 0 16px}
/* keep the title + "+ Add" action in reach while scrolling long grids (#9) */
.page-head.with-action{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  position:sticky;top:var(--bar-h);z-index:20;background:var(--bg);padding:10px 0;margin:0 0 12px}
.page-title{font-size:22px;margin:0 0 2px}
.page-sub{color:var(--muted);font-size:13px;display:flex;align-items:center;gap:8px}
.muted-block{color:var(--muted);text-align:center;padding:42px 0}
.count-line{font-size:12px;color:var(--muted);margin:0 2px 10px}
.toolbar{display:flex;gap:8px;margin:6px 0 12px;flex-wrap:wrap}
.toolbar .form-control{flex:1 1 200px}
.per-select{flex:0 0 130px;max-width:140px}

/* ---------- list pager (Prev · page numbers · Next · range) — top & bottom of lists ---------- */
.pager{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;margin:12px 2px}
.pager-hidden{display:none}
.pager-info{font-size:12.5px;color:var(--muted);margin-left:6px}
.pager-btn{background:var(--surface);color:var(--brand);border:1px solid var(--line);
  border-radius:var(--radius);padding:7px 14px;font-weight:600;cursor:pointer}
.pager-btn:hover:not(:disabled){background:var(--brand);color:var(--hue-paper);border-color:var(--brand)}
.pager-btn:disabled{opacity:.4;cursor:not-allowed;color:var(--muted);background:var(--surface)}
.pager-num{min-width:36px;text-align:center;background:var(--surface);color:var(--ink);
  border:1px solid var(--line);border-radius:var(--radius);padding:7px 10px;font-weight:600;cursor:pointer}
.pager-num:hover{border-color:var(--brand);color:var(--brand)}
.pager-num.active{background:var(--brand);color:var(--hue-paper);border-color:var(--brand);cursor:default}
.pager-gap{color:var(--muted);padding:0 2px;user-select:none}

/* ---------- KPI dashboard ---------- */
.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.kpi{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);
  border-left:4px solid var(--line);box-shadow:0 1px 2px color-mix(in srgb, var(--c-slate-900) 4%, transparent)}
.kpi .card-body{padding:14px 16px}
.kpi-label{font-size:12.5px;color:var(--muted);font-weight:600}
.kpi-val{font-size:30px;font-weight:800;line-height:1.1;margin:6px 0 4px;letter-spacing:-.02em}
.kpi-sub.pending{color:var(--warn)}
.kpi.accent-primary{border-left-color:var(--brand)}
.kpi.accent-success{border-left-color:var(--ok)}
.kpi.accent-danger{border-left-color:var(--bad)}
.kpi.accent-info{border-left-color:var(--info)}
.kpi.accent-dark{border-left-color:var(--brand-ink)}

/* ---------- ledger categories ---------- */
.cat-root{margin:0 0 16px}
.cat-root-head{display:flex;align-items:baseline;gap:8px;padding:0 2px 7px}
.cat-root-head h2{font-size:14px;margin:0;text-transform:uppercase;letter-spacing:.05em}
.cat-stmt,.kpi-sub{font-size:12.5px;color:var(--muted)}
.cat-cards{display:flex;flex-direction:column;gap:8px}
.cat-card{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);padding:11px 14px}
.cat-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700;font-size:12.5px;
  background:var(--brand-ink);color:var(--hue-paper);padding:3px 8px;border-radius:8px;min-width:48px;text-align:center}
.cat-name{flex:1;font-weight:600}
.cat-edit{padding:2px 9px;line-height:1.4}

/* ---------- list rows (clickable) ---------- */
.row-list{display:flex;flex-direction:column;gap:8px}
.row-card.inactive{opacity:.55}
.row-card.is-root{cursor:default;border-left:3px solid var(--brand)}
.trans-key{flex:0 0 auto;max-width:42%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-family:SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--brand);
  background:var(--bg);border:1px solid var(--line);padding:3px 9px;border-radius:7px}
.row-card{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);padding:12px 14px;cursor:pointer;transition:border-color .12s,box-shadow .12s}
.row-card:hover{border-color:var(--brand);box-shadow:0 2px 10px color-mix(in srgb, var(--c-indigo-l59) 12%, transparent)}
.iso-badge{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700;font-size:12px;
  background:var(--brand-ink);color:var(--hue-paper);padding:4px 9px;border-radius:8px;min-width:42px;text-align:center}
.row-main{flex:1;display:flex;flex-direction:column;min-width:0}
.row-main b{font-weight:600}
.row-sub{font-size:12px;color:var(--muted)}
.row-chevron{color:var(--muted);font-size:22px;line-height:1}
/* ---------- Ledger categories: the IFRS list and each country's GAAP list (owner 2026-10-20) ---------- */
/* GAAP: the country buttons (with the size of each country's list) and one line on the picked country */
.lc-chips{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 8px}
.lc-chips .chip-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;font-size:13px}
.lc-chip-n{font-size:12px;font-weight:700;opacity:.75}
.lc-status{font-size:12px;color:var(--muted);margin:0 2px 10px}
.lc-status-link{color:var(--brand);font-weight:600;cursor:pointer}
/* a category edited in place at its row (golden rule 7): labelled controls in one row on a wide screen, one
   column on a phone, every control one height (golden rule 9); Cancel + Save changes on the right */
.row-card.lc-edit{display:block;cursor:default;padding:10px 12px}
.row-card.lc-edit:hover{box-shadow:none}
.lc-edit-form{display:grid;grid-template-columns:1fr;gap:8px}
.lc-fld{display:flex;flex-direction:column;gap:3px;margin:0;min-width:0}
.lc-lbl{font-size:12px;color:var(--muted)}
.lc-edit-form .form-control{width:100%;min-width:0;margin:0;height:var(--control-h);box-sizing:border-box;
  padding-top:4px;padding-bottom:4px}
.lc-edit-err,.lc-edit-actions{grid-column:1 / -1}
.lc-edit-actions{display:flex;justify-content:flex-end;gap:8px}
@media (min-width:760px){.lc-edit-form{grid-template-columns:120px minmax(0,2fr) minmax(0,1.4fr) 110px}}
/* billing status pill on a company row (green = active, per the colour convention) */
.row-status{font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;white-space:nowrap}
.row-status.ok{background:color-mix(in srgb,var(--c-green-600) 16%,transparent);color:var(--c-green-600)}

/* ---------- DEMO badge ----------
   The demo company is a sandbox. Everything it produces must be impossible to mistake for the real
   thing, so the badge is deliberately LOUD and does not reuse .row-status / .badge (both of which
   read as ordinary metadata): amber, uppercase, letter-spaced, with a solid border. Amber is the
   convention's "V" colour — attention, not error. */
.demo-badge{display:inline-flex;align-items:center;gap:5px;flex:0 0 auto;
  font-size:12px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;white-space:nowrap;
  padding:3px 9px;border-radius:6px;line-height:1.4;
  color:var(--c-amber-800);background:color-mix(in srgb,var(--c-amber-500) 26%,transparent);border:1px solid var(--c-amber-500);
  /* align-self, not just flex, because .row-main is a COLUMN flex container: `flex:0 0 auto`
     governs the main (vertical) axis there, and the default `align-items:stretch` then blew the
     badge out to the full row width. Measured at 375px before this line: 313px wide. */
  align-self:flex-start}
:root[data-theme="dark"] .demo-badge{color:var(--c-amber-200);background:color-mix(in srgb,var(--c-amber-500) 22%,transparent)}
/* in the app bar (a ROW flex) it sits beside the title and should stay vertically centred */
.app-bar .demo-badge{margin-left:10px;align-self:center}
/* on a row card it sits on the name's line, not under it */
.row-main > b + .demo-badge{margin:3px 0 1px}
.demo-note{font-size:12px;color:var(--muted);line-height:1.35}

/* dashboard quick links (#2) */
.quick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin:0 0 20px}
.quick-card{display:flex;align-items:center;gap:12px;text-align:left;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);padding:14px;cursor:pointer;
  transition:border-color .12s,box-shadow .12s}
.quick-card:hover{border-color:var(--brand);box-shadow:0 2px 10px color-mix(in srgb, var(--c-indigo-l59) 12%, transparent)}
.quick-ico{font-size:20px;color:var(--brand);line-height:1}
.quick-text{flex:1;display:flex;flex-direction:column;min-width:0}
.quick-sub{font-size:12px;color:var(--muted)}

/* flash the just-added / just-edited row so the user sees where it went */
@keyframes rowflash{0%{background:color-mix(in srgb, var(--c-teal-l46) 28%, transparent)}100%{background:transparent}}
.row-card.row-hl,.cat-card.row-hl,.tier.row-hl{animation:rowflash 1.8s ease-out}
/* pane switch (e.g. Debtors ↔ Creditors) — a quick fade-rise on the fresh pane */
@keyframes pane-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.pane-in{animation:pane-in .22s ease}
@media (prefers-reduced-motion: reduce){.pane-in{animation:none}}

/* inline delete (no window.confirm) — ONE small trash icon; in-place "Delete? Yes/No" when armed. */
.btn-row-del{appearance:none;border:1px solid transparent;background:none;cursor:pointer;line-height:1;
  display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border-radius:7px;
  font-size:14px;color:var(--muted);transition:color .12s,background .12s,border-color .12s}
.btn-row-del .del-ico{font-size:14px;filter:none;display:inline-flex;align-items:center}
.btn-row-del .del-lbl{display:none}
.btn-row-del:hover{color:var(--bad);border-color:var(--bad);background:color-mix(in srgb, var(--c-red-700) 10%, transparent)}

/* ── Andre "basics": figures tabular + right-aligned, app-wide ─────────────────
   tabular-nums is harmless on non-digits, so apply it broadly; the right-align
   utilities are additive (screens already right-align via scoped rules — these just
   make .num/.text-right/.ta-r/td.r work everywhere, so no numeric column is missed). */
body,input,select,textarea,button,table,.dash-kpi-val{font-variant-numeric:tabular-nums}
.text-right,.ta-r,.num,.money,.currency{text-align:right}
td.text-right,th.text-right,td.ta-r,th.ta-r,td.num,th.num,td.r,th.r,td.money,th.money,td.currency,th.currency{text-align:right}
.num,.money,.currency{font-variant-numeric:tabular-nums;white-space:nowrap}
/* Owner (2026-09-17): every price / currency INPUT is right-aligned by default so the
   decimal point stays under the column heading — same rule for a bare <input type="number">
   and for an inputmode="decimal" text input. Explicit .text-left on the field opts out on
   the rare non-money numeric input (e.g. a page count). */
input[type="number"],input[inputmode="decimal"],input[inputmode="numeric"].money-in{text-align:right}
input.text-left{text-align:left}
.btn-row-del:hover .del-ico{filter:none}
.confirm-inline{display:inline-flex;align-items:center;gap:7px}
.confirm-q{font-size:13px;font-weight:600;color:var(--bad)}
/* delete blocked → show why, inline on the row (#34) */
.confirm-err{flex-wrap:wrap;max-width:320px;text-align:right}
.confirm-errmsg{font-size:12px;color:var(--bad);line-height:1.35}
/* blocked-delete message shown beside the name so the row's action buttons stay put */
.row-err{flex:1 1 auto;min-width:120px;font-size:12px;color:var(--bad);line-height:1.35}
.row-card.row-blocked .row-main{flex:0 0 auto}
/* required-field validation highlight (#10) */
.form-control.is-invalid{border-color:var(--bad)}
.form-control.is-invalid:focus{border-color:var(--bad);box-shadow:0 0 0 3px color-mix(in srgb, var(--c-red-700) 15%, transparent)}
.field-required{color:var(--bad);font-size:12px;margin:-4px 0 8px}
/* forgot-password link under the login password field */
.login-forgot{text-align:right;font-size:13px}
.login-forgot a{color:var(--brand);cursor:pointer}
/* email templates (per-country) */
.tpl-card{cursor:pointer}
.tpl-vars{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 6px}
.tpl-vars-lbl{font-size:12px;color:var(--muted)}
.tpl-var{appearance:none;border:1px solid var(--line);background:var(--bg);color:var(--ink);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;padding:2px 8px;
  border-radius:6px;cursor:pointer}
.tpl-var:hover{border-color:var(--brand);color:var(--brand)}
.tpl-body{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;line-height:1.5}
.tpl-preview-head{display:flex;align-items:center;gap:12px;margin:2px 0 6px}
.tpl-preview-wrap{border:1px solid var(--line);border-radius:10px;overflow:hidden;margin:0 0 10px}
.tpl-preview{width:100%;height:280px;border:0;background:var(--c-slate-l94);display:block}
.btn-danger-text{color:var(--bad);border-color:var(--bad)}
/* tenant home / onboarding (no admin drawer) */
.tenant-main{margin-left:0}
/* Tenant drawer company context (v2 left-nav header: back-to-companies + company name) */
.drawer-co{padding:10px 14px 6px;border-bottom:1px solid var(--sheen-08)}
.drawer-back{background:none;border:none;color:var(--c-cyan-l86);font-size:12.5px;font-weight:600;cursor:pointer;padding:2px 0}
.drawer-back:hover{color:var(--hue-paper)}
.drawer-co-name{color:var(--hue-paper);font-weight:700;font-size:14px;margin-top:2px;line-height:1.25}
.onboard-wrap{max-width:520px;margin:32px auto;padding:0 16px}
.onboard-card{width:100%}
.onboard-title{font-size:22px;font-weight:800;margin:0 0 4px}
.onboard-page{max-width:720px;margin:0 auto}
/* regime reporting-fields editor rows */
.rg-field-row{display:flex;gap:8px;align-items:center;margin-bottom:8px}
.rg-field-row .form-control{flex:1;margin:0}
/* idle auto-logout warning (#1) */
.idle-overlay{z-index:1200}
.idle-card{max-width:400px}
.idle-msg{margin:4px 0 16px;color:var(--ink);line-height:1.5}
.btn-confirm-yes,.btn-confirm-no{appearance:none;border:1px solid var(--line);border-radius:8px;
  padding:4px 12px;font-size:13px;font-weight:600;cursor:pointer;background:var(--surface);color:var(--ink)}
.btn-confirm-yes{background:var(--bad);border-color:var(--bad);color:var(--hue-paper);min-width:44px}
.btn-confirm-yes:hover{filter:brightness(.93)}
.btn-confirm-yes:disabled{opacity:.6;cursor:default}
.btn-confirm-no:hover{border-color:var(--muted)}
/* Journal post is a positive action, not a destructive delete — its confirm strip is GREEN, not the shared red (Andre 2026-09-17) */
.confirm-inline.confirm-go .confirm-q{color:var(--ok)}
.confirm-inline.confirm-go .btn-confirm-yes{background:var(--ok);border-color:var(--ok)}

/* ---------- detail: back link, tabs, fields ---------- */
.back-link{display:inline-block;color:var(--muted);font-size:13px;cursor:pointer;margin:0 0 6px}
.back-link:hover{color:var(--brand)}
.tabbar{display:flex;gap:4px;border-bottom:1px solid var(--line);margin:4px 0 16px;overflow-x:auto}
.tab{appearance:none;background:none;border:none;border-bottom:2px solid transparent;color:var(--muted);
  font-size:14px;font-weight:600;padding:9px 12px;cursor:pointer;white-space:nowrap}
.tab:hover{color:var(--ink)}
.tab.active{color:var(--brand);border-bottom-color:var(--brand)}
.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.field{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px}
.field-label{font-size:12.5px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.field-val{font-size:15px;font-weight:600;margin-top:3px}
.hint{margin-top:14px;font-size:12.5px;color:var(--muted);background:var(--c-cyan-l92);border-radius:10px;padding:10px 12px}

/* tina4: tina4-css sets .badge{font-size:0.75em}, so a badge inherits 75% of whatever it sits in —
   measured at 9.75px inside a 13px .page-sub and 11.25px inside body copy. Relative sizing means
   there is no floor, so badges get illegible wherever the context is small. Pin an absolute
   readable size; the em-based default is part of the upstream write-up
   (plan/upstream-tina4-css-touch-targets.md). */
.badge{font-size:12px}
/* tina4css button/badge primaries → aboo teal (dark text for contrast on the bright teal) */
.btn-primary{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
.btn-primary:hover{background:var(--brand-hover,var(--brand));border-color:var(--brand-hover,var(--brand));filter:var(--brand-hover-filter,brightness(.94))}
.badge-primary{background:var(--brand);color:var(--hue-deep)}
.brand-dot{background:var(--brand)}
/* outline / secondary button — theme-aware (tina4css default has dark text invisible on dark) */
.btn-outline{background:transparent;border:1px solid var(--line);color:var(--ink)}
.btn-outline:hover{background:color-mix(in srgb, var(--c-slate-l56) 14%, transparent);border-color:var(--muted);color:var(--ink)}
/* comfortable, consistent modal actions */
.form-actions .btn{padding:9px 18px;border-radius:10px;font-weight:600;min-width:96px}
.muted-sub{font-size:12.5px;color:var(--muted)}

/* ---------- pricing tiers ---------- */
.tier-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.tier{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.tier.inactive{opacity:.55}
.tier-head{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.tier-name{font-weight:700;font-size:15px}
.tier-head-actions{display:inline-flex;align-items:center;gap:6px;flex-wrap:nowrap}
.tier-code{font-size:12.5px;color:var(--muted);letter-spacing:.04em;text-transform:uppercase;margin-top:1px}
.tier-price{font-size:22px;font-weight:800;margin:8px 0 0;color:var(--brand)}
.tier-per{font-size:12px;font-weight:600;color:var(--muted)}
.tier-year{font-size:12.5px;color:var(--muted);margin-top:1px}
.tier-caps{font-size:12px;color:var(--muted);margin-top:8px}
.tier-badges{margin-top:8px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}

/* form layout helpers (side-by-side fields + left-aligned destructive action) */
.form-row{display:flex;gap:10px}
.form-col{flex:1;min-width:0}
.form-actions-spacer{flex:1}
.tier-delete{color:var(--bad);border-color:var(--bad)}
.tier-delete:hover{background:var(--bad);color:var(--hue-paper)}

/* ---------- account add/edit form + modal ---------- */
.tab-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 12px}
.tab-actions-right{display:flex;align-items:center;gap:8px}
.tab-actions-right .per-select{flex:0 0 120px}
.ledger-search{margin:0 0 12px}
.modal-overlay{position:fixed;inset:0;background:color-mix(in srgb, var(--c-slate-900) 55%, transparent);display:flex;align-items:flex-start;
  justify-content:center;z-index:50;padding:24px 16px;overflow-y:auto}
.modal-card{background:var(--surface);color:var(--ink);border-radius:16px;width:100%;max-width:440px;
  padding:20px 22px;box-shadow:0 24px 60px var(--shade-40)}
.modal-wide{max-width:620px}
/* the actions row of a modal openModal() builds (shared/modal.js): right-aligned, as every edit's Save + Cancel */
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}
.modal-card .fld{margin-bottom:8px}
/* oversight grants list inside the admin modal (#8) — scrolls when an admin oversees many */
.grants-list{margin-top:8px;max-height:min(46vh,340px);overflow-y:auto}
/* default-codes picker — scrollable checklist of the country chart */
.code-picker{max-height:48vh;overflow-y:auto;border:1px solid var(--line);border-radius:10px;
  background:var(--bg);padding:4px}
.code-row{display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:8px;cursor:pointer;font-size:14px}
.code-row:hover{background:var(--surface)}
.code-row.on{background:color-mix(in srgb, var(--brand) 14%, transparent)}
.code-row .cat-code{flex:0 0 auto}
.code-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.code-desc{flex:1;min-width:0;height:30px;padding:3px 8px;font-size:13px}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.modal-head h3{margin:0;font-size:18px}
.modal-x{appearance:none;border:none;background:none;font-size:18px;color:var(--muted);cursor:pointer;line-height:1}
.form-check{display:flex;align-items:center;gap:8px;font-size:14px;margin:8px 0;cursor:pointer}
.form-note{font-size:13px;color:var(--muted);margin:-2px 0 10px}
.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.cat-card.inactive{opacity:.55}
.tag-off{font-size:12px;background:var(--c-red-100);color:var(--bad);padding:1px 6px;border-radius:999px;margin-left:8px;font-weight:600}
.tag-on{font-size:12px;background:var(--c-green-100);color:var(--c-green-700);padding:1px 6px;border-radius:999px;font-weight:600}

/* ---------- theme toggle ---------- */
.theme-toggle{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--ink);
  border-radius:9px;padding:5px 9px;cursor:pointer;font-size:15px;line-height:1}

/* ---------- dark mode (brand) — token mapping handles bg/ink/surface; these are tweaks ---------- */
:root[data-theme="dark"] .hint{background:var(--c-cyan-l15)}
:root[data-theme="dark"] .tag-off{background:var(--c-red-l15)}
:root[data-theme="dark"] .tag-on{background:var(--c-green-l14);color:var(--c-green-400)}
:root[data-theme="dark"] .row-card:hover{box-shadow:0 2px 10px var(--shade-40)}

/* ---------- login ---------- */
.login-wrap{min-height:100%;display:flex;align-items:center;justify-content:center;padding:20px;
  background:var(--login-bg)}
/* The login card is a fixed white card on the teal gradient — theme-independent (don't inherit
   dark-mode text colours, or it goes invisible on white). */
/* theme toggle floating on the gradient (light styling so it shows on the dark backdrop) */
.login-toggle{position:fixed;top:16px;right:16px;z-index:2;background:var(--login-toggle-bg);
  border-color:var(--login-toggle-line);color:var(--login-toggle-ink)}
/* login card adapts to the theme (white card / dark text in light; dark card / light text in dark) */
.login-card{width:100%;max-width:380px;border:1px solid var(--line);border-radius:18px;
  box-shadow:var(--login-card-shadow);background:var(--surface);color:var(--ink)}
.login-card .card-body{padding:28px 26px 30px}
.login-card .brand-name{color:var(--ink)}
.login-title{font-size:22px;margin:6px 0 0;color:var(--ink)}
.login-hint{font-size:13px;color:var(--muted)}
/* dev-only surface switch on the login (never rendered in a production build) */
.login-devhint{font-size:12px;color:var(--muted);border:1px dashed var(--line);border-radius:8px;padding:6px 10px}
.login-devhint a{color:var(--brand);cursor:pointer;text-decoration:underline}
.login-remember{margin:2px 0 14px;color:var(--muted)}
.login-card .btn-primary{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
/* Companies / Admin sign-in choice (#8) — segmented, mirrors .signup-kind */
.login-kind{display:flex;gap:8px;margin:0 0 16px}
.login-kind-btn{flex:1;padding:9px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--surface);color:var(--muted);font-size:13.5px;font-weight:600;cursor:pointer;
  transition:border-color .15s,background .15s,color .15s}
.login-kind-btn:hover{border-color:var(--brand)}
.login-kind-btn.on{border-color:var(--brand);color:var(--ink);
  background:color-mix(in srgb,var(--brand) 12%,transparent)}
.form-label{display:block;font-size:12.5px;font-weight:600;color:var(--muted);margin:0 0 5px}
/* ---------- sign-up ---------- */
.login-card{max-width:420px}
.login-alt{font-size:13px;color:var(--muted);text-align:center;margin:0}
.login-alt a{color:var(--brand);cursor:pointer;font-weight:600}
.signup-kinds{display:flex;gap:10px}
.signup-kind{flex:1;display:flex;flex-direction:column;gap:2px;align-items:flex-start;text-align:left;
  padding:11px 13px;border:1px solid var(--line);border-radius:12px;background:var(--surface);
  color:var(--ink);cursor:pointer;transition:border-color .15s,background .15s}
.signup-kind:hover{border-color:var(--brand)}
.signup-kind.active{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 12%,transparent)}
.signup-kind-label{font-weight:700;font-size:14px}
.signup-kind-sub{font-size:13px;color:var(--muted)}
.signup-done{text-align:center}
.signup-done .brand-lockup{justify-content:center}
.signup-tick{width:56px;height:56px;margin:14px auto 4px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-size:28px;color:var(--hue-paper);background:var(--brand)}

/* ---------- data import (CSV -> chart of accounts) ---------- */
/* Phases are shown/hidden with [hidden] so the file input never sits in a reactive block. */
.import-phase[hidden]{display:none}
.import-counts{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px}
.import-rows{margin:10px 0 4px}
/* Mobile-first: each row stacks, then becomes one line from tablet up. */
.import-row{flex-wrap:wrap;cursor:default;align-items:flex-start;gap:8px}
.import-row .row-main{flex:1 1 100%}
.import-row .form-control{flex:1 1 140px;min-width:0;font-size:13px;padding:6px 9px;margin:0}
.import-row.row-warn{border-left:3px solid var(--warn)}
/* a row's code outside its category's range (Raymond's item 12): the API's words and its next free code, on a line of
   their own under the row's controls */
.import-row .import-range{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.import-row .import-range[hidden]{display:none}
.import-errors{margin:6px 0 0;padding-left:20px;font-size:13px}
.import-offer{border-top:1px solid var(--line);margin:14px 0 4px;padding-top:14px}
@media (min-width:720px){
  .import-row{flex-wrap:wrap;align-items:center}
  .import-row .row-main{flex:1 1 0;min-width:0}
  .import-row .import-action{flex:0 0 150px}
  .import-row .import-target{flex:0 0 96px}
  .import-row .import-category{flex:0 0 190px}
}

/* ---------- bottom navigation (MOBILE) ----------
   Product decision 2026-07-23 (Andre): on a phone the menu belongs under the thumb — a top-left
   hamburger is the hardest one-handed target on a modern handset. So below the breakpoint the
   bottom bar IS the navigation and the drawer only appears when its "More" tab asks for it; from
   767px up the bar disappears and the drawer is the static desktop sidebar.
   The SAME max-width:767px query the drawer already uses — deliberately not a new breakpoint. */
.bottom-nav{display:none}
.form-actions-center{justify-content:center}
@media (max-width:767px){
  .bottom-nav{display:flex;align-items:stretch;position:fixed;left:0;right:0;bottom:0;z-index:45;
    background:var(--surface);border-top:1px solid var(--line);box-shadow:0 -2px 10px color-mix(in srgb, var(--c-slate-900) 7%, transparent);
    /* iPhone home indicator — without this the tabs sit under it and are unhittable */
    padding-bottom:env(safe-area-inset-bottom,0px)}
  .bn-item{flex:1 1 0;min-width:0;min-height:var(--bottom-nav-h);display:flex;flex-direction:column;
    align-items:center;justify-content:center;gap:3px;padding:8px 4px;appearance:none;border:none;
    background:none;color:var(--muted);font:inherit;cursor:pointer}
  .bn-item.active{color:var(--brand)}
  .bn-ico{font-size:18px;line-height:1}
  .bn-lbl{font-size:12px;font-weight:600;line-height:1.1;max-width:100%;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bn-confirm{flex:1;display:flex;align-items:center;justify-content:center;gap:10px;
    min-height:var(--bottom-nav-h);padding:8px 14px}
  .bn-confirm-q{font-size:14px;font-weight:600;color:var(--bad)}
  /* content must clear the bar — otherwise the last row of every list hides behind it */
  .content{padding-bottom:calc(24px + var(--bottom-nav-space))}
  .drawer{padding-bottom:var(--bottom-nav-space)}
  .modal-overlay{padding-bottom:calc(24px + var(--bottom-nav-space))}
  /* the tenant screens' session actions now live in the bottom bar — don't show them twice.
     (Admin keeps its app-bar "Sign out": its bar's five slots are all navigation.) */
  .tenant-main .app-user .btn,
  .tenant-main .app-user .confirm-inline{display:none}
}

/* ---------- touch targets: >= 44px on touch devices (WCAG 2.5.5 / Apple HIG) ----------
   tina4: LOCAL OVERRIDE of tina4-css. public/css/tina4.min.css ships
     .btn         { padding:.375rem .75rem; font-size:1rem; line-height:1.5 }
     .form-control{ padding:.375rem .75rem; font-size:1rem; line-height:1.5;
                    min-height:calc(1.5em + .75rem + 2px) }
   which renders 38px — under the 44px touch minimum. That is a Bootstrap-derived default that
   predates touch guidance, and it fails on EVERY tina4 app, not just aboo, so the real fix belongs
   upstream in tina4-css (CLAUDE.md rule #7). The case is written up in
   plan/upstream-tina4-css-touch-targets.md. DO NOT edit or fork public/css/tina4.min.css.
   TEMPORARY: delete this block once a tina4-css release ships touch-sized controls.
   Scoped to (pointer: coarse) so mouse/trackpad density on desktop is untouched. */
@media (pointer: coarse){
  .btn,.form-control,.theme-toggle,.pager-btn,.pager-num,.tab,.quick-card,.cat-edit,
  .btn-confirm-yes,.btn-confirm-no,.btn-row-del,.tpl-var,.modal-x,.nav-item,.code-row,
  .form-check,.signup-kind,.lc-chips .chip-btn{min-height:44px}
  .btn{padding-top:10px;padding-bottom:10px}
  .btn-sm{padding-top:9px;padding-bottom:9px;font-size:14px}
  /* 16px is also what stops iOS Safari zooming the page when a field takes focus */
  .form-control{padding-top:10px;padding-bottom:10px;font-size:16px}
  .import-row .form-control{min-height:44px;padding:10px 9px;font-size:16px}
  .theme-toggle{min-width:44px;padding:8px 11px;font-size:17px}
  .pager-num,.modal-x{min-width:44px}
  .form-check input[type=checkbox]{width:22px;height:22px}
  /* inline text links measured 16.5px tall — the smallest real targets on the public screens */
  .login-forgot a,.login-alt a,.back-link{display:inline-flex;align-items:center;min-height:44px}
}
/* Debtors, creditors, claims and Approvals on a phone (owner 5 Dec 2026: "very mobile friendly"). Measured at 375px
   with a touch pointer: filter tabs 31px, the back and calendar buttons 18-25px, the bank register's row buttons and
   chips 20-24px, its card icons 14px, table checkboxes 13px. A control on its own is 44px; one inside a list row is
   36px, so a row stays readable; a checkbox is 22px. Mouse screens are untouched. */
@media (pointer: coarse){
  .seg,.nav-pill,.ct-back,.cb-mode-btn,.cb-todo,.ss-input,.ct-vat-chip{min-height:44px}
  .sleek-date-cal-btn{min-width:40px;min-height:40px}
  .icon-btn,.cb-card-icon,.cb-clear-btn,.del-btn,.cb-flip,.de-row-more{min-width:36px;min-height:36px}
  .tag-link,.btn-link.mono,.alloc-btn,.alloc-btn-matched,.cb-ai-chip,.attach-open,.ct-quick{min-height:36px}
  .tag-link,.btn-link.mono,.alloc-btn,.alloc-btn-matched,.cb-ai-chip,.ct-quick{display:inline-flex;align-items:center}
  main input[type=checkbox],.alloc-pop input[type=checkbox]{width:22px;height:22px;min-width:22px}
}
/* Overdue charges on a phone: each customer a card - the tick, the name and what is charged on the first line, how it
   is worked out under it, then the interest and the fee, each named - so no amount needs a sideways scroll. */
@media (max-width:767px){
  [data-overdue-table].run-table thead{display:none}
  [data-overdue-table].run-table tbody tr{display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:10px;row-gap:2px;
    align-items:center;padding:10px 4px;border-bottom:1px solid var(--line)}
  [data-overdue-table].run-table tbody td{display:block;padding:0;border:0;text-align:left;background:none}
  [data-overdue-table].run-table tbody td:first-child{grid-row:1 / span 4;align-self:start;padding-top:2px}
  [data-overdue-table].run-table tbody td:nth-child(2){font-weight:600}
  [data-overdue-table].run-table tbody td.run-total{grid-column:3;grid-row:1;text-align:right;font-weight:600}
  [data-overdue-table].run-table tbody td.run-notes{grid-column:2 / span 2}
  [data-overdue-table].run-table tbody td[data-label]{grid-column:2 / span 2;display:flex;justify-content:space-between;gap:8px;
    font-size:13px}
  [data-overdue-table].run-table tbody td[data-label]::before{content:attr(data-label);color:var(--muted);margin-right:auto;font-family:var(--font-body,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif)}
  [data-overdue-table].run-table tbody td,[data-overdue-table].run-table tbody th{border-top:0;border-bottom:0;box-shadow:none}
  [data-overdue-table].run-table tbody td[data-label] .cell-sub{display:inline;margin-left:6px}
  [data-overdue-table].run-table tfoot tr{display:flex;justify-content:space-between;padding:10px 4px}
  [data-overdue-table].run-table tfoot th{padding:0;border:0}
  [data-overdue-table].run-table .tbl-wrap,[data-overdue-table].run-table{overflow:visible}
}

/* ---------------------------------------------------------------------------------------------
   MOBILE STACKING — must live at the END of this file.
   These override base rules (.row-main{flex:1} at ~line 149, .app-title{flex:1} at ~line 65) which
   have the SAME specificity, so they only win by coming later. An earlier @media block silently
   loses — measured: flex-wrap took effect but .row-main stayed on the buttons' line.

   The bug being fixed (measured on staging at 375px): .row-card is flex/nowrap, and once the
   touch-target pass grew the action buttons (92px + 197px + gaps inside a 343px card) the flex:1
   .row-main was squeezed to width:0, so the company name painted straight over the buttons.

   NOTE this class of bug does NOT surface as horizontal overflow — scrollWidth stayed exactly ==
   the viewport, because the elements collide INSIDE the viewport instead of spilling outside it.
   The no-overflow tests all passed while the screen was visibly broken.
   --------------------------------------------------------------------------------------------- */
@media (max-width:767px){
  /* Row cards: title on its own line, actions wrapping beneath it. */
  .row-card{flex-wrap:wrap}
  .row-card > .row-main{flex:1 0 100%}
  .row-card > .btn{flex:1 1 auto}

  /* App bar: brand + title + user could not share 375px and .app-user's right edge landed past the
     viewport edge. The bottom nav already says which screen you are on, so the middle title goes. */
  .app-bar .app-title{display:none}
  .app-bar .app-user{min-width:0;flex:0 1 auto}

  /* The ACTION must never be the thing that shrinks — the NAME is what may ellipsise.

     Kept as a DEFENSIVE rule, and the comment says so honestly rather than claiming a repro it
     does not have. A report described the app-bar "Sign out" as collapsed to 0x0 at 375px and
     blamed the `min-width:0` above for letting the flex algorithm crush the last child. Measured
     against this stylesheet in a real browser (Chromium, 375px AND 320px, long and short user
     names), with these two rules present and again with them reverted, the button measured
     78x31 every single time. The crush does not reproduce here.

     What DOES measure 0x0 at 375px is the TENANT bar's "Sign out", and the cause is
     `display:none` from the deliberate `.tenant-main .app-user .btn` rule ~50 lines above — the
     tenant's session actions moved to the bottom nav, which really does carry a 188x56 "Sign out"
     tab. Measured tenant bar at 375px: brand 16..91, .app-title display:none, .app-user at
     x=103, "Sign out" display:none 0x0 — which matches the report exactly. So that is intent,
     not breakage. (Admin keeps its app-bar button, and needs it: the admin drawer and bottom nav
     have no sign-out of their own. Measured visible at both 375px and 320px.)

     These two lines stay because they make the intent explicit and cost nothing: whatever the
     available width, pin the button and let the name be the flexible item. */
  .app-bar .app-user > .btn{flex:0 0 auto;white-space:nowrap}
  .app-bar .user-name{flex:0 1 auto;min-width:0;max-width:92px}

  /* The DEMO badge must survive the same squeeze — it is a safety label, not decoration. */
  .app-bar .demo-badge{margin-left:6px}

  /* Page heading and its primary action, stacked so neither gets crushed. */
  .page-head.with-action{flex-wrap:wrap}
  .page-head.with-action > :first-child{flex:1 0 100%}
}

/* ---------------------------------------------------------------------------------------------
   APP BAR — the action must never shrink or wrap, at ANY width. GLOBAL, deliberately NOT inside a
   media query.

   Reported with a screenshot: "Sign out" wrapped onto two lines and clipped at the right edge.
   The earlier fix for this lived inside @media (max-width:767px), so it did nothing in the band
   just above the breakpoint — measured at 820px: .app-title{flex:1 1 0%} claimed 444px and the
   user block was squeezed until the button wrapped. Chasing that with another breakpoint would
   just move the failure, so the rule is stated once, unconditionally:

     the TITLE is the flexible item and truncates; the ACTION is fixed and stays whole.

   .app-title needs min-width:0 because a flex item's default min-width:auto refuses to shrink
   below its content — without it the title pushes the button out instead of ellipsising.
   --------------------------------------------------------------------------------------------- */
.app-bar .app-user{flex:0 0 auto}
.app-bar .app-user > .btn{flex:0 0 auto;white-space:nowrap}
.app-bar .app-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---------------------------------------------------------------------------------------------
   CHART OF ACCOUNTS — read-only chart screen (src/tenant/chart.js).

   MUST STAY AT THE END OF THIS FILE. `.chart-row > .row-main` and the MOBILE STACKING block's
   `.row-card > .row-main{flex:1 0 100%}` have IDENTICAL specificity (two classes + a child
   combinator), so these rules only win by coming later — exactly the trap documented in the
   MOBILE STACKING header above. Appending anything after this block is fine; MOVING this block
   above MOBILE STACKING silently reverts the phone layout.

   The generic mobile rule would give each account row three stacked lines (code, name, nothing),
   wasting a third of a phone screen on an 86-row list. The chart wants the CODE and the NAME on
   the SAME line — the code is the mapping key, so it is the thing being scanned — with the
   classification wrapping underneath it. Hence the override.
   --------------------------------------------------------------------------------------------- */
.chart-count{font-size:13px;color:var(--muted);font-weight:600;margin:0 2px 12px}
.chart-groups{display:flex;flex-direction:column;gap:18px}
.chart-group-head{display:flex;align-items:baseline;gap:8px;padding:0 2px 7px;flex-wrap:wrap}
.chart-group-head h2{font-size:14px;margin:0;text-transform:uppercase;letter-spacing:.05em}
.chart-group-root{font-size:12.5px;color:var(--muted)}
.chart-group-n{margin-left:auto;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
/* The CODE is the mapping key — mono, boxed and the first thing the eye lands on. */
.chart-code{flex:0 0 auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:700;
  font-size:13px;background:var(--brand-ink);color:var(--hue-paper);padding:4px 9px;border-radius:8px;
  min-width:54px;text-align:center;font-variant-numeric:tabular-nums}
.chart-vat{flex:0 0 auto;margin-left:auto;align-self:center;font-size:12px;font-weight:600;color:var(--brand);background:var(--surface-2);border:1px solid var(--line);border-radius:6px;padding:1px 7px;white-space:nowrap}
/* a country ledger code's GAAP category (Countries › Ledger codes), beside its VAT code */
.chart-gaap{flex:0 0 auto;align-self:center;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:600;color:var(--ink);border:1px dashed var(--line);border-radius:6px;padding:1px 7px;white-space:nowrap}
.chart-row{cursor:default}
.chart-row:hover,.import-row:hover{border-color:var(--line);box-shadow:none}
/* A system-role account (retained earnings, year-end contra, FX, rounding, suspense) is one an
   import must never remap — flagged so it reads as special, not as an ordinary account. */
.chart-row.chart-system{border-left:3px solid var(--brand)}
.chart-row.inactive .chart-code{background:var(--muted)}
/* Tenant screens: vt.css re-defines --brand-ink as the ink ON the brand colour (white in the light
   theme), which made the chip white on white. The chip takes the deep-teal ink itself there. */
body.vt .chart-code{background:var(--hue-deep)}

@media (max-width:767px){
  /* Code and name share line 1; the classification wraps beneath. See the header above for why
     this must not be hoisted anywhere earlier in the file. */
  .chart-row{flex-wrap:wrap;align-items:flex-start;gap:10px}
  .chart-row > .chart-code{flex:0 0 auto}
  /* flex-basis MUST be 0, not auto. Measured in Chromium at 375px with `flex:1 1 auto`: flex line
     breaking uses each item's HYPOTHETICAL main size (here the name's max-content width) BEFORE
     any shrinking, so a long account name — "Machinery and Equipment - Cost" — pushed .row-main
     onto its own line and the code sat alone above it, making that one row twice as tall as its
     neighbours. Basis 0 means it always fits beside the code and then grows into the space. */
  .chart-row > .row-main{flex:1 1 0;min-width:0}
  .chart-group-n{margin-left:0}
}
/* ── tenant bank screens (feature/bank-accounts) ─────────────────────── */
.btn-back{border:0;background:none;color:var(--ink);font-size:22px;line-height:1;padding:4px 10px;cursor:pointer;border-radius:8px}
.btn-back:hover{background:var(--surface-2)}
.tshell-title{display:flex;flex-direction:column;min-width:0}
.tshell-co,.alloc-pay-doc > .mono{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tshell-screen{font-size:12px;color:var(--muted)}
.row-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
/* company picker: pop a company out into its own window (icon + label on one line) */
.co-popout{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.row-open{color:var(--muted);font-size:20px;padding-left:2px}
.co-card{cursor:pointer}
/* DESKTOP EXCEPTION: home company card wrap (#133) — a deliberate desktop fix, outside the phone-only block.
   A demo card's inline "Reset — wipes this practice data? Yes/No" confirm sits beside Chart of accounts /
   Import data / New window; the actions never shrink (.row-actions flex:0 0 auto), so they crushed the
   name (.row-main min-width:0) to one word per line and painted over it. Now the name keeps 220px and,
   only when the actions would take that from it, they move to their own line, still on the right.
   A card that fits is laid out exactly as before (same flex sizes; nothing grows). */
.co-card{flex-wrap:wrap}
.co-card > .row-main{min-width:220px}
.co-card > .row-actions{margin-left:auto;flex-wrap:wrap;max-width:100%}
/* END DESKTOP EXCEPTION */
.co-backbar{margin:0 0 12px}
.icon-btn{border:0;background:none;cursor:pointer;font-size:15px;padding:4px 6px;border-radius:8px;line-height:1}
.icon-btn:hover{background:var(--surface-2)}
.chip-btn{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:999px;padding:3px 10px;font-size:12px;cursor:pointer;font-weight:600}
.chip-btn:hover{border-color:var(--brand)}
/* Reminder day-tier editor (Settings → Reminders): inline caption + removable day pills + a number
   "Add" box (owner: needs an interface, not hand-entered text). No on/off toggle — adding a day means
   you want it as a reminder (owner 2026-09-15); the ✕ removes a tier. */
.remday-field{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:6px 0 2px}
.remday-cap{font-size:13px;font-weight:600;color:var(--muted)}
.remday-chip{display:inline-flex;align-items:center;gap:4px;background:var(--surface);border:1px solid var(--brand);color:var(--brand);border-radius:999px;padding:4px 5px 4px 12px;font-weight:700;font-size:13px;line-height:1}
.remday-x{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:0;border-radius:999px;background:transparent;color:var(--brand);cursor:pointer;font-size:13px;line-height:1;padding:0}
.remday-x:hover{background:var(--brand);color:var(--hue-paper)}
/* margin-left:auto right-aligns the add group so BOTH day-tier rows' "+ Add" line up (owner 2026-09-15) */
.remday-add{display:inline-flex;align-items:center;gap:6px;margin-left:auto}
.remday-in{width:110px;box-sizing:border-box;text-align:left}
.remday-add-btn{white-space:nowrap}
/* Documents: Dashboard button sits on its own row above the Debtors/Creditors strip (owner 2026-09-15) */
.doc-dash-row{display:flex;justify-content:flex-end;margin-bottom:8px}
.amt-in{color:var(--ok)}
.amt-out{color:var(--bad)}
.form-control-sm{padding:4px 8px;font-size:13px}
.alert-ok{border:1px solid var(--ok);color:var(--ok);border-radius:10px;padding:6px 12px;background:var(--surface)}
.alert-warn{border:1px solid var(--c-amber-700);color:var(--c-amber-700);border-radius:10px;padding:6px 12px;background:var(--surface)}
.check-line{display:flex;gap:8px;align-items:center;font-size:14px;margin:6px 0}
/* rules form */
.rule-form{display:grid;grid-template-columns:1fr;gap:8px}
.rule-form-err{grid-column:1 / -1}
.rule-edit-form{display:flex;flex-direction:column;gap:8px}
.rule-edit-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:2px}
@media (min-width:760px){.rule-form{grid-template-columns:2fr 1fr 1fr 2fr auto}}
/* "＋ Create account" from a rule's "— Allocate to GL —" (Raymond's item 11): the account's form under the fields, the
   whole width, boxed as the allocate popup's; nothing there until it is opened */
/* "＋ Create account" in place (Raymond's item 11): the account's form (alloc_popup.js createAccountForm) under the
   field it was asked from — a rule's GL, a claim's expense account, a co-op statement's difference; a row of its own
   in a form's grid, nothing while closed */
.gl-create-slot{grid-column:1 / -1}
.gl-create-slot:empty{display:none}
.gl-create-slot .alloc-create-form{max-width:420px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.rule-form .gl-create-slot .alloc-create-form,.rule-edit-form .gl-create-slot .alloc-create-form{margin-left:auto}
.coop-diff .gl-create-slot{margin-top:8px}
/* the allocate popup pays a receipt's invoices (Raymond's item 8): the documents it most likely pays first, then a
   contact's open documents — each a line: ticked, its number and date, what is owed, the amount it takes */
.alloc-settle .mono:first-child{font-weight:600}
/* matching plan: the reasons a document is suggested, under its line; a tie marked so the user chooses */
.alloc-settle-main{display:flex;flex-direction:column;min-width:0}
.alloc-settle-why{font-size:12px;color:var(--muted);white-space:normal;line-height:1.3}
.alloc-settle-tied .alloc-settle-why{color:var(--c-amber-700)}
.alloc-pay-list{max-height:260px;overflow:auto}
/* a grid by a stronger selector than .cb-drop-item's flex (declared later): the box, the number over its date and
   amount owed, the amount — nothing overlaps however narrow the popup */
.alloc-pop .cb-drop-item.alloc-pay-row{display:grid;grid-template-columns:auto minmax(0,1fr) 104px;gap:8px;align-items:center;cursor:default}
.alloc-pay-doc{display:flex;flex-direction:column;min-width:0;line-height:1.3}
.alloc-pay-meta{display:flex;flex-wrap:wrap;column-gap:4px;font-size:12px;color:var(--muted)}
.alloc-pay-meta > span{white-space:nowrap}
.alloc-pay-meta .cb-drop-bal{font-size:12px}
.alloc-pay-amt{width:104px}
.alloc-pay-sum{text-align:right;font-size:12px;font-weight:600;margin:6px 2px 0}
/* a short payment (short-payments plan): what happens to the rest of the part-paid document, and the journal it makes */
.alloc-pay-diff{margin:8px 2px 0;padding:8px;border:1px solid var(--line);border-radius:8px;display:grid;gap:6px}
.alloc-pay-diff-lead{font-size:12px;font-weight:600}
.alloc-pay-diff-choices{display:flex;flex-wrap:wrap;gap:6px}
.alloc-pay-diff-choices .alloc-diff-pill{padding:6px 12px;min-height:32px}
.alloc-pay-diff-choices .alloc-diff-pill.active{background:var(--brand);color:var(--hue-paper);border-color:var(--brand)}
.alloc-pay-diff-journal{font-size:12px;color:var(--muted);overflow-wrap:anywhere}

/* ── the cashbook — live-parity single page (feature/bank-accounts) ────── */
/* live v2 works on a 1200px surface — the summary strip needs it to hold one line */
.page.cb-page{max-width:1200px}
/* Bank accounts: a click on a card's button (✎ ⚙ ⚖ …) redraws the whole view at once, and the browser's scroll anchoring
   then re-anchored the page on another element — the view jumped (5 Nov, measured: a cashbook's ✎ moved it 258px and
   its card's top off the screen; Cancel jumped it back). Off on this page only, so the view stays where it is; the
   open card is then brought into view by the page itself (cashbook.js). Callan 5 Nov. */
.cb-page{overflow-anchor:none}
/* a card (or a supplier's sub-accounts) brought into view stops below the sticky top bar, not under it */
.cb-page .cb-card,.cb-page .cb-coop-panel{scroll-margin-top:calc(var(--topbar-h, 62px) + 8px)}
.page.page-wide{max-width:1200px}
.cb-page .mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums}
.cb-page .text-right{text-align:right}
.cb-page .fw-700{font-weight:700}
.t-in{color:var(--ok)}
.t-out{color:var(--bad)}
.t-label{color:var(--muted)}
/* Signed financial figures: positive is green, negative is red, zero stays neutral. `totalTone()`
   supplies these classes to balances, totals, and line amounts across the tenant application. */
.tot-pos{color:var(--ok) !important}
.tot-neg{color:var(--bad) !important}
.t-val{font-weight:600}
/* statement-import notice (no AI key / extraction error) — persistent, above the drop cards */
.cb-keynotice{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--surface);
  border:1px solid var(--warn);border-left:4px solid var(--warn);border-radius:var(--radius,8px);
  padding:10px 12px;margin:6px 0 4px;font-size:13px;color:var(--ink)}
.cb-keynotice-key{border-color:var(--info);border-left-color:var(--info)}
.cb-keynotice-icon{font-size:16px;line-height:1}
.cb-keynotice-msg{flex:1 1 220px;min-width:0}
.cb-keynotice-x{flex:0 0 auto;background:none;border:0;color:var(--muted);font-size:15px;line-height:1;
  cursor:pointer;padding:2px 4px;border-radius:6px}
/* statements held for their bank account or co-op — listed above the drop cards until each is imported or discarded */
.cb-held-imports{display:flex;flex-direction:column;gap:6px;background:var(--surface);
  border:1px solid var(--warn);border-left:4px solid var(--warn);border-radius:var(--radius,8px);
  padding:8px 12px;margin:6px 0 4px;font-size:13px;color:var(--ink)}
.cb-held-imports-head{font-weight:700}
.cb-held-import{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cb-held-import-what{flex:1 1 220px;min-width:0;display:flex;flex-direction:column}
.cb-held-import-files{font-weight:600;overflow-wrap:anywhere}
.cb-held-import-ask{color:var(--muted);overflow-wrap:anywhere}
.cb-held-import-acts{flex:0 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}
/* a held statement answered on the list (2026-10-27): the bank account chosen for one whose number was not read, and the
   buttons beside it — one row at one height (golden rule #9), wrapping under the statement on a phone */
.cb-held-import-acts .cb-held-pick{flex:1 1 180px;min-width:0;max-width:280px}
/* T5: a supplier statement's new sub-accounts mapped in place under it — a row per sub-account (the account it goes
   onto, and a new account's number), wrapping on a phone; Save changes and Cancel to the right; one control height */
.cb-map-form{flex:1 1 100%;min-width:0;display:flex;flex-direction:column;gap:6px;padding-top:6px;border-top:1px solid var(--line)}
.cb-map-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:6px}
.cb-map-row .cb-map-for{flex:1 1 240px;min-width:0}
.cb-map-row .cb-map-no-lbl{flex:0 1 120px;min-width:0}
.scan-keynotice{margin:0 0 10px}
/* AI-assist bar: proactive no-key note (shown when no AI key is configured; the key box sits under it) */
.ai-bar-nokey{font-size:12.5px;color:var(--warn);flex:1 1 100%}
/* The AI key box (src/shared/aikeysetup.js) — inside every lasting "no AI key" notice: the guide (which key works best,
   then numbered steps), then one row of controls at one height — provider, key box + Show / Hide, Test key and Save
   key, the two buttons to the right. It takes a full line of its own in the notice it sits in (a flex row that wraps),
   under the notice's own words, and stops at a comfortable width on a wide screen. Spacing (Callan 14 Nov 2026, "fix
   the ui and padding"): 10px between the guide, the controls and the message; 8px between controls. Phone first: the
   controls wrap — the provider and the key box (170px + 220px) cannot share a phone's line, so each takes the full
   width, and Test key + Save key get a line of their own on the right; from about 400px of room provider and key box
   share a line, from about 600px the two buttons join them. No phone-only rule is needed. */
.aikey{flex:1 1 100%;min-width:0;display:flex;flex-direction:column;gap:10px;
  font-size:13px;font-weight:400;color:var(--ink);text-align:left}
/* the comfortable width sits on what is inside: a max-width on .aikey itself would let a wide notice fit it on the
   same line as the notice's words (flex-wrap breaks lines on the clamped size) */
.aikey > *{max-width:880px}
.aikey [hidden]{display:none}
.aikey-form{display:flex;flex-direction:column;gap:10px;min-width:0}
.aikey-guide{display:flex;flex-direction:column;gap:4px;min-width:0}
.aikey-best{margin:0;overflow-wrap:anywhere}
.aikey-guide a{text-decoration:underline}
.aikey-steps{margin:0;padding-left:20px;overflow-wrap:anywhere}
.aikey-steps > li{margin:0;padding:0}
/* step 4 — where the key is found later — in bold, its number too (Callan 15 Nov 2026) */
.aikey-steps > li.aikey-where{font-weight:700}
.aikey-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}
.aikey-row{flex:1 1 400px;display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}
.aikey-row > .aikey-provider{flex:1 1 170px;min-width:0;width:auto}
.aikey-row > .aikey-keybox{flex:3 1 220px;min-width:0;display:flex;align-items:center;gap:8px}
.aikey-keybox > .aikey-input{flex:1 1 auto;min-width:0;width:auto}
.aikey-keybox > .aikey-show{flex:0 0 auto}
.aikey-actions{flex:0 0 auto;margin-left:auto;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}
.aikey-note{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--muted)}
.aikey-msg{font-size:12.5px;line-height:1.35;overflow-wrap:anywhere}
.aikey-msg-ok{color:var(--ok);font-weight:600}
.aikey-msg-err{color:var(--bad)}
.aikey .form-control,body.vt .aikey .form-control,.aikey .btn,body.vt .aikey .btn,body.vt .cb-map-form .cb-in,
body.vt .cb-map-form .btn,body.vt .cb-held-import-acts select.cb-in,body.vt .cb-held-import-acts .btn{height:var(--control-h);min-height:var(--control-h);box-sizing:border-box;margin:0}
.aikey .btn{white-space:nowrap}
/* Save key once pressed: disabled and dimmed while it tests and saves, and it stays so when it reads "Key saved"
   (Callan 15 Nov 2026: "the button must dim and also disable once pressed"). The dimming is the app's own rule for a
   disabled button (tina4.min.css .btn:disabled{opacity:.65;pointer-events:none}) — nothing here overrides it. */
/* the provider list shows its ▾ again: on tenant screens body.vt select{background:…} (vt.css) wipes the arrow that
   select.form-control gets above — put back for this box only; dark mode draws it in a light stroke */
.aikey select.form-control,body.vt .aikey select.form-control{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232E575E' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .6rem center;padding-right:1.9rem;cursor:pointer}
[data-theme="dark"] .aikey select.form-control,[data-theme="dark"] body.vt .aikey select.form-control{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23EAF3F2' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")}
/* The "no AI key" notice (src/shared/aikeycorner.js) — one card in the top-left corner of every company screen
   (Callan 15 Nov 2026: "in the corner of every screen … it must follow the scroll of the user"). The tenant shell
   wraps its top bar and this card in .shell-top, which is sticky at the top of the scrolling area (.shell-main): the
   card sits under the bar's left end, takes its own room above the page (it covers nothing while the page is at the
   top) and stays there with the bar however far the page scrolls — no height or offset to keep in step. It closes
   with its ✕. As wide as the notice was above the Bank Accounts cards (Callan 15 Nov: "make it the same width that
   it was" — 1396px on a wide screen), never wider than the screen less 12px each side; on a short screen its own
   content scrolls. Inside, the box lines up with the notice's words, past the 🔑 (22px + the 10px gap), and wraps
   on a phone as it did. */
body.vt .shell-top{position:sticky;top:0;z-index:50}
/* A phone, or a short window (a phone on its side): the card is too tall to keep in view there — checked live, a
   320px-wide phone was left 22px of page. The block steps aside (display:contents): the bar stays at the top by its
   own rule, as before, and the card sits at the top of every screen and scrolls away with the page. (The card is
   then a child of the scrolling area itself, a flex column of fixed height: flex:0 0 auto on .ai-corner keeps it its
   full height there — without it the column squeezed the card to one line.) */
@media (max-width:767px),(max-height:640px){body.vt .shell-top{display:contents}.ai-corner{max-height:none;overflow-y:visible}}
.ai-corner{box-sizing:border-box;margin:8px 12px 0;flex:0 0 auto;
  width:min(1396px,calc(100% - 24px));max-height:calc(100dvh - 160px);overflow-y:auto;overscroll-behavior:contain;
  display:flex;flex-direction:column;gap:10px;padding:10px 12px;
  background:var(--surface);color:var(--ink);font-size:13px;font-weight:400;text-align:left;white-space:normal;
  border:1px solid var(--info);border-left:4px solid var(--info);border-radius:var(--radius,8px);
  box-shadow:0 6px 18px var(--shade-25)}
.ai-corner[hidden]{display:none}
.ai-corner-head{display:flex;align-items:flex-start;gap:10px;min-width:0}
.ai-corner-icon{flex:0 0 22px;text-align:center;font-size:16px;line-height:1.3}
.ai-corner-msg{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.ai-corner-x{flex:0 0 auto;min-width:32px;min-height:32px;margin:-6px -6px 0 0;background:none;border:0;
  color:var(--muted);font-size:15px;line-height:1;cursor:pointer;padding:2px 4px;border-radius:6px}
.ai-corner-x:hover,.cb-keynotice-x:hover{color:var(--ink);background:color-mix(in srgb, var(--c-grey-808080) 14%, transparent)}
.ai-corner-box{min-width:0;margin-left:32px}
.ai-corner-box:empty{display:none}
/* asked for again by something that needs the key (a statement dropped with none): one blink */
.ai-corner-ask{animation:ai-corner-ask .9s ease-out 1}
@keyframes ai-corner-ask{0%{box-shadow:0 0 0 0 var(--info)}60%{box-shadow:0 0 0 8px transparent}
  100%{box-shadow:0 6px 18px var(--shade-25)}}
@media (prefers-reduced-motion:reduce){.ai-corner-ask{animation:none}}
@media print{.ai-corner{display:none}}
/* where a notice is not itself a wrapping row: the AI bar's place for it and the statement viewer's message (the
   expense capture card holds no key box since 17 Nov 2026: it points to the corner notice) */
.ai-bar-keyform{flex:1 1 100%;min-width:0}
.cb-stmt-err .aikey{margin-top:8px}
.cb-stmt-err:has(.aikey){padding:14px 16px}
/* the same guide under the key box in Settings ▸ API Keys (in place of the lone "Get a key at …" hint) */
.set-row > .aikey-guide{font-size:12.5px;margin-top:2px}
/* account cards strip */
.cb-cards{display:flex;gap:10px;overflow-x:auto;-webkit-overflow-scrolling:touch;padding:8px 2px 6px}
/* a card's edit form floats under it (11 Nov, below): no card grows, so the strip's cards keep their height and place */
.cb-card{flex:0 0 auto;min-width:160px;max-width:210px;background:var(--surface);border:2px solid var(--line);border-radius:12px;padding:10px 12px;cursor:pointer;position:relative;transition:border-color .15s,box-shadow .15s;display:flex;flex-direction:column;gap:2px}
.cb-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:6px}
.cb-card:hover{border-color:var(--muted)}
.cb-card.active{border-color:var(--brand);box-shadow:0 0 0 1px var(--brand)}
.cb-card-drag{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand);background:var(--surface-2)}
.cb-card-add{border-style:dashed;color:var(--muted)}
.cb-card-name{font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}
.cb-card-acct{font-size:12px;color:var(--muted);margin-top:2px}
.cb-card-bal{font-size:14px;font-weight:700;margin-top:4px;text-align:right;white-space:nowrap}
.cb-card-badge{position:absolute;top:-8px;right:-8px;background:var(--brand);color:var(--hue-paper);font-size:12px;font-weight:700;padding:2px 7px;border-radius:10px;min-width:20px;text-align:center;z-index:2}
.cb-pwd-icon{position:absolute;top:6px;right:6px;border:0;background:none;cursor:pointer;font-size:12px;opacity:.5;padding:2px}
.cb-pwd-icon:hover{opacity:1}
.cb-pwd-row{display:flex;gap:4px;margin-top:6px}
.cb-pwd-input{font-size:12px;padding:3px 6px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);width:100%;min-width:0}
.cb-pwd-save{background:var(--brand);color:var(--hue-paper);border:0;border-radius:6px;padding:2px 8px;cursor:pointer;flex:0 0 auto}
.cb-addform{display:grid;grid-template-columns:1fr;gap:8px;padding:0;margin:2px 2px 10px}
.cb-in-gl{background:var(--hover,color-mix(in srgb, var(--hue-brand) 8%, transparent));cursor:default}
@media (min-width:760px){.cb-addform{grid-template-columns:3fr 1fr 3fr 2fr 1.5fr auto}}
/* Bank-account add row (owner 2026-09-15 "currency and add button must be same size as others"): the
   text inputs, the native <select> and the Add button otherwise resolve to three different heights
   (.cb-in 32px vs body.vt select 38px vs the button's own padding). Force EVERY control in the row to
   one identical height + border-box so the whole row lines up regardless of which base rule wins —
   this selector out-ranks .cb-in, body.vt select and body.vt .btn alike. */
body.vt .cb-addform .cb-in,
body.vt .cb-addform select.cb-in,
body.vt .cb-addform .btn{height:34px;min-height:34px;box-sizing:border-box}

/* Guided "new bank account" wizard (4 steps): overrides the flat add-row grid above */
.cb-wizard{display:block;max-width:520px;border:1px solid var(--line);border-radius:12px;
  padding:14px;background:var(--surface)}
.cb-wiz-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.cb-wiz-steps{display:flex;gap:8px}
.cb-wiz-dot{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-size:12px;font-weight:700;background:var(--hover,color-mix(in srgb, var(--hue-brand) 8%, transparent));color:var(--muted)}
.cb-wiz-dot.active{background:var(--brand);color:var(--hue-paper)}
.cb-wiz-dot.done{background:var(--ok);color:var(--hue-paper)}
.cb-wiz-x{border:0;background:none;cursor:pointer;font-size:15px;color:var(--muted);line-height:1}
.cb-wiz-body{display:flex;flex-direction:column;gap:10px}
.cb-wiz-lbl{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.cb-wiz-lbl .cb-in{width:100%}
.cb-wiz-nav{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.cb-wiz-back{margin-right:auto}
.cb-wiz-glmode{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}
.cb-wiz-radio{display:flex;align-items:center;justify-content:flex-start;gap:8px;font-size:13px;color:var(--ink);cursor:pointer;white-space:normal}
.cb-wiz-radio input{flex:0 0 auto;width:auto;margin:0}
.cb-wiz-pills{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.cb-pill{flex:1 1 auto;min-width:0;padding:9px 14px;border:1px solid var(--line);border-radius:999px;
  background:var(--surface);color:var(--ink);font-size:13px;font-weight:500;line-height:1.3;
  text-align:center;cursor:pointer;transition:background .12s,border-color .12s,color .12s;white-space:normal}
.cb-pill:hover{border-color:var(--brand);background:var(--brand-faint)}
.cb-pill.is-on,.cb-pill.is-on:hover{background:var(--brand);border-color:var(--brand);color:var(--hue-paper)}
.cb-wiz-hint{font-size:12px;color:var(--muted);line-height:1.5}
.cb-wiz-confirm{display:flex;flex-direction:column;gap:2px}
.cb-wiz-crow{display:flex;justify-content:space-between;gap:12px;font-size:13px;
  border-bottom:1px solid var(--line);padding:5px 0}
.cb-wiz-crow span{color:var(--muted)}
.cb-wiz-note{font-size:12px;color:var(--brand);font-weight:600;margin-top:8px}

/* Wrong-account-drop confirm (reuses .cb-stmt-overlay for the backdrop) */
.cb-confirm-modal{background:var(--surface);color:var(--ink);border-radius:12px;
  width:min(440px,94vw);box-shadow:0 18px 50px var(--shade-35);padding:18px;
  display:flex;flex-direction:column;gap:12px}
.cb-confirm-head{font-weight:700;font-size:15px;display:flex;align-items:center;gap:8px}
.cb-mismatch-icon{color:var(--c-orange-l48);font-size:18px}
.cb-confirm-body{font-size:13px;color:var(--ink);line-height:1.55}
.cb-confirm-actions{display:flex;justify-content:flex-end;gap:8px}

/* Co-op (supplier trading) accounts — plan/supplier-cashbooks.md §9 (src/tenant/cashbook.js, coop_review.js).
   A co-op's header card sits in the cards strip and opens and closes its section cashbooks (a panel under the strip,
   below); an open co-op's header is tinted as its panel is. The header card is a bank card (Callan 12 Nov): its name,
   its account there and its balance, at a bank card's width and height; the rest is on its panel's head. */
.cb-coop{display:flex;gap:10px;flex:0 0 auto;align-items:stretch;border-radius:14px}
.cb-coop.is-open{background:var(--hover,color-mix(in srgb, var(--hue-brand) 8%, transparent));padding:4px;margin:-4px 0}
/* a bank card's full width (.cb-card's max-width), however short the supplier's name: as wide as the bank card beside it */
.cb-coop-head{width:210px}
.cb-coop-chev{flex:0 0 auto;color:var(--muted);font-size:13px;line-height:1}
/* an open supplier's cashbooks sit in a panel of their own under the strip, just above the register (Callan 4 Nov: "so it
   does not crowd out the bank accounts"), tinted as its open header card is: its cards in rows that wrap, two to a row
   on a phone; a card's ✎ form floats under it (11 Nov), so the card keeps its one place. ▴ closes it */
.cb-coop-panel{background:var(--hover,color-mix(in srgb, var(--hue-brand) 8%, transparent));border-radius:14px;padding:6px 10px 10px;margin:4px 0 10px}
/* its head: the name, "— its cashbooks", then what the supplier's card does not show — how many cashbooks, the own
   funds, how its latest statement stands (a pill) and Import summary (Callan 12 Nov); one line that wraps on a phone */
.cb-coop-panel-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;font-size:12px;color:var(--muted);margin-bottom:10px}
.cb-coop-panel-name{font-weight:700;color:var(--ink)}
.cb-coop-panel-head .cb-coop-panel-close{margin-left:auto;font-size:14px;padding:6px 10px}
.cb-coop-count,.cb-coop-funds{white-space:nowrap}
.cb-coop-panel-btn{border:1px solid var(--line);border-radius:999px;padding:1px 10px;font-family:inherit;font-size:12px;
  font-weight:600;line-height:1.5;white-space:nowrap;cursor:pointer;background:var(--surface);color:var(--ink)}
.cb-coop-panel-btn:hover{border-color:var(--brand)}
.cb-coop-panel-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.cb-coop-panel-cards .cb-card{min-width:0;max-width:none}
@media (min-width:760px){.cb-coop-panel-cards{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}}
/* the chosen card whose name is cut off grows to the right by just what its whole name needs; the others keep their size
   (Callan, 28 Nov 2026; 29 Nov: "it must open up only how much is needed"; cards.js growChosenCards marks it is-grown).
   In the strip it is as wide as its name, never wider than the screen, where a longer name wraps. A supplier's panel is a
   grid, whose cards can only take whole columns (a name 20px short took a whole column more), so while one of its cards
   is grown the panel flows (cb-flow): every other card keeps the width a grid column has (the panel's width less its
   gaps, shared by the grid's --cb-cols columns; a fiftieth of a pixel less, so a full row never adds up past the panel
   and wraps), the grown card is as wide as its name (never wider than the panel) and the cards after it move along */
.cb-card.is-grown{max-width:calc(100vw - 48px)}
.cb-coop-head.is-grown{width:auto}
.cb-card.is-grown .cb-card-name{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
.cb-coop-panel-cards.cb-flow{display:flex;flex-wrap:wrap}
.cb-coop-panel-cards.cb-flow>.cb-card{flex:0 0 calc((100% - (var(--cb-cols) - 1) * 10px) / var(--cb-cols) - .02px)}
.cb-coop-panel-cards.cb-flow>.cb-card.is-grown{flex:0 0 auto;max-width:100%}
/* a co-op cashbook's own credit limit (what is left, or how far over it owes — red), its terms and interest (plan §1,
   §9), the farmer's own funds marked as such (§12.5) */
.cb-card-limit{font-size:12px;color:var(--muted);text-align:right;white-space:nowrap}
.cb-card-limit.is-over{color:var(--bad);font-weight:700}
.cb-card-terms{font-size:12px;color:var(--muted);text-align:right;overflow-wrap:anywhere}
.cb-card-own{align-self:flex-start;font-size:12px;font-weight:600;color:var(--brand);border:1px solid var(--brand);border-radius:999px;padding:0 6px;margin-top:2px}
/* the ✎ form at the card it edits (golden rule #7): the fields one under the other, every control at the one control
   height (golden rule #9) */
.cb-limit-edit{display:flex;flex-direction:column;gap:6px;margin-top:6px;cursor:default}
.cb-limit-lbl{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--muted)}
.cb-limit-lbl .cb-in{width:100%;min-width:0;box-sizing:border-box}
.cb-limit-err{font-size:12px;color:var(--bad);overflow-wrap:anywhere}
/* an account number outside its range on the supplier import (code_ranges.js — Raymond's sheet, Callan 6 Nov), under
   its field: ⚠ amber — of its kind, not its own range, it saves; ⛔ red — another kind's range, Save stays off. In a
   map row it takes the row's whole width; in the register's create popover it keeps the rows' side padding */
.cb-range-note{font-size:12px;line-height:1.35;color:var(--warn);overflow-wrap:anywhere}
.cb-range-note.is-block,body.vt .fld>span.set-acc-range.is-block{color:var(--bad);font-weight:600}
.cb-range-note.is-hint{color:var(--muted)}      /* the category's range, said quietly under a new code (item 12) */
.cb-map-row .cb-range-note{flex:1 1 100%}
/* the same note under Settings › Chart of accounts' new code (item 12): a field caption is uppercase and faint
   (body.vt .fld>span) — the note keeps the note's own look; the refusal's "Use 1001" sits on the error's line */
/* Settings ▸ VAT & tax: ticking "Vat Registered" only enables the VAT number — nothing appears, disappears or moves
   (owner 2026-11-11). Callan, 17 Nov 2026: the tick sits beside the VAT number box, on the box's line and at its
   height, in ordinary letters (it was on the field's caption line, in the caption's capitals). */
body.vt .set-vat-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
/* the box keeps room for its example ("e.g. 4990001234" was cut at 130px on a phone): when the line is too narrow
   for the box and the tick, the tick goes under the box */
body.vt .set-vat-row>input{flex:1 1 170px;min-width:0}
body.vt .set-vat-toggle{display:inline-flex;align-items:center;gap:8px;min-height:var(--control-h,38px);
  cursor:pointer;white-space:nowrap}
body.vt .set-vat-toggle>.chk{margin:0}
/* A note under a field (.fld>.hint — Settings ▸ Chart's contra account, the AI key's "Get a key at"). vt.css:335 gives
   every span in a .fld the label's look (10.5px capitals, spaced) and .hint is the boxed help panel, so the note read
   as a second, boxed label (owner 2026-11-11, "the padding is terrible"). Under a field it is a plain grey line. */
body.vt .fld>.hint{margin:4px 0 0;padding:0;background:none;border-radius:0;font-size:12px;line-height:1.35;
  font-weight:400;text-transform:none;letter-spacing:normal;color:var(--muted)}
/* Settings ▸ Chart's bank tick: the box and its words on the line an input takes, under its label like the fields
   beside it (it floated mid-row as a .fld.inline); a ticked account's bank details follow under their own heading. */
.set-acc-bank-tick{display:flex;align-items:center;gap:8px;min-height:var(--control-h,38px);cursor:pointer}
.set-acc-bank-tick>.chk{margin:0}
.set-acc-card{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
.set-acc-card[hidden]{display:none}
.set-acc-card-head{font-weight:700;margin-bottom:8px;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
.set-acc-card-head>small{font-weight:400;color:var(--muted)}
body.vt .set-vat-row>input:disabled{opacity:.55;cursor:not-allowed}
body.vt .fld>span.set-acc-range{font-size:12px;line-height:1.35;text-transform:none;letter-spacing:normal;
  font-weight:400;color:var(--warn)}
body.vt .fld>span.set-acc-range.is-hint{color:var(--muted)}
.set-acc-err{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
/* 11 Nov 2026 sweep. A hint inside a field's label took the field caption's look (body.vt .fld>span: small CAPITALS,
   bold, spaced) — "THE OTHER SIDE TO AUTO-FILL WHEN YOU POST A JOURNAL…" read as a second label. A hint reads as a
   hint everywhere: sentence case, regular weight. */
body.vt .fld>span.hint{font-size:12px;font-weight:400;text-transform:none;letter-spacing:normal;line-height:1.4}
/* One control height in a row (golden rule #9): the reminder-day box stood 32px beside its 36px "+ Add", and the bank
   rules' add row had three 32px controls beside a 36px "+ Add rule". */
body.vt .remday-add .remday-in,
body.vt .remday-add .btn{height:var(--control-h);min-height:var(--control-h);box-sizing:border-box;margin:0}
/* Second pass, 11 Nov 2026. The hidden file input behind "Choose a file" took body.vt input{width:100%} (vt.css): it
   stayed 1px tall but became as wide as its box, 5 to 15px past the page, so Expenses scrolled sideways on a phone and
   on a tablet. It is 1px by 1px again, wherever it is used. */
body.vt input.attach-file-input{width:1px;height:1px;min-height:0;padding:0;border:0}
/* One control height in a row, the rows the second pass measured: the batch run's "add a line" row (boxes 32, + Add 36),
   a list toolbar (search 34, page size 32), the bank strip (buttons 36, Jump to 34). */
.bt-run-addadhoc>.form-control,
.bt-run-addadhoc>.btn,
body.vt .list-toolbar>.search,
body.vt .list-toolbar>select,
body.vt .list-toolbar>.per-select,
.cb-summary>.btn{height:var(--control-h);min-height:var(--control-h);box-sizing:border-box}
@media (min-width:768px){
  /* "+ Add contact" 36 beside its search box 34 (Contacts, Service items, Batch invoices). On a phone they stack. */
  body.vt .ux-list-actions>.btn,
  body.vt .ux-list-actions .ux-search{height:var(--control-h);min-height:var(--control-h);box-sizing:border-box}
}
/* ---------------------------------------------------------------------------------------------
   TABLET FIT (Andre, 11 Nov 2026: "Please go over EVERY screen on mobile / tablet check for padding and button
   overflows"). From 768px the phone block (ux.css) is off and the desktop rows apply, but up to about 1180px the page
   is narrower than those rows were made for: 768px upright, or 1024px on its side with the menu beside the page.
   Every rule in this block is for 768 to 1179px only: a phone and a desktop are untouched by construction.
   --------------------------------------------------------------------------------------------- */
@media (min-width:768px) and (max-width:1179px){
  /* Bank: the one-line strip under the cards (balance, badges, Re-run, Jump to, Fetch mail, Statements) is 903px of
     buttons that do not shrink. At 768px and at 1024px the page scrolled sideways and "Fetch mail" stood outside the
     strip. A button that does not fit goes to the next line, as a supplier account's strip already does. */
  .cb-summary{flex-wrap:wrap}
  /* Reports: a filter row broke between a label and its field ("To" ended one line and its date began the next;
     "Compare with" stood above its own list). A label stays with its field: two pairs to a line. */
  .rp-filters-col>div:has(>.rp-flabel){display:grid;grid-template-columns:repeat(4,max-content);justify-content:start;
    justify-items:start;align-items:center;gap:8px 10px}
  /* the search first, on the same line as From / To (owner 2026-11-22: "make search in same line as date inputs ? why
     waste space" · "search should be first ?") */
  .rp-filters-col>div:has(>.rp-search){grid-template-columns:minmax(160px,280px) repeat(4,max-content)}
  .rp-filters-col>div:has(>.rp-flabel)>.rp-search{grid-column:auto;justify-self:stretch}
  /* Settings: a long tick-box label stays on one line (vt.css) and ran 25px past the page at 768px. It wraps. */
  body.vt .set-stack label.fld.inline>span{white-space:normal}
  /* A claim's review (Expenses; 16 Nov 2026, P1): beside the 280px slip, its three columns of boxes were 118px wide at
     1024px — "1900 · Enter", "00 · No Tax (" cut short, and "Amount claimed *" broke over two lines, so its box stood 17px
     below Slip's total and Tax (golden rule 9). The slip goes under the boxes, as on a phone; the boxes keep the
     desktop's three columns, each about 220px. */
  body.vt .ex2-review{grid-template-columns:minmax(0,1fr)}
  /* The document editor's line: the item picker and its Description stack in the Item cell, as on a phone (the phone
     rules for .de-item-wrap are below and in ux.css). Side by side the Description was 37px wide at 768 and 42px at 1024:
     the other columns are fixed, so the Item cell is narrow (Callan, 2 Dec 2026, sweep M1: "fix all five"); stacked, 101 /
     114px. The picker is named by its data-item-pick: the phone pass's own .de-lines rule stays in the phone block. */
  body.vt .de-item-wrap{flex-direction:column}
  body.vt .de-item-wrap .de-desc{margin-top:4px}
  body.vt .de-item-wrap > span[data-item-pick]{align-self:stretch}
  /* ...and each line is a two-row card, as the UI guide draws the line editor from 640px wide (Kobus, design/DESIGN.md,
     2026-10-30: the phone's card, a two-row card from 640px, the full table from 960px). In the table every column but the
     item and the account has a fixed width, so even stacked the item read "GDS-FEE", the account "0400 — Sal" and the
     total "13420.5" at 768 and 1024px (4 Dec 2026 sweep #2). Row one: the item over its description, the total, the bin;
     row two: Qty, Price, Disc %, VAT and GL account. Each box sits under its label: the table's headings go. The VAT box
     is a fixed 7rem (its codes are short) so the account gets the rest: in the guide's two equal columns it was 113px of
     the 176px "0400 — Sales - Standard" needs at 768px. */
  body.vt .de-lines,body.vt .de-lines > tbody{display:block}
  body.vt .de-lines > thead{display:none}
  body.vt .de-lines > tbody > tr{display:grid;grid-template-columns:5rem 7rem 5rem 7rem minmax(0,1fr) auto;
    grid-template-areas:"item item item item tot x" "qty price disc vat acct acct";gap:8px 12px;align-items:start;
    padding:10px 12px;margin:0 0 8px;border:1px solid var(--line);border-radius:10px}
  body.vt .de-lines > tbody > tr > td{display:grid;gap:3px;min-width:0;width:auto;padding:0;border:0}
  body.vt .de-lines > tbody > tr > td[data-label]::before,
  body.vt .de-lines > tbody > tr > td.de-c-x::before{content:attr(data-label);font-size:11px;line-height:16px;
    text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700;text-align:left}
  body.vt .de-lines > tbody > tr > td.de-c-x::before{content:"\00a0"}   /* the bin level with the boxes, not the labels */
  body.vt .de-lines > tbody > tr > .de-c-item{grid-area:item}
  body.vt .de-lines > tbody > tr > .de-c-qty{grid-area:qty}
  body.vt .de-lines > tbody > tr > .de-c-price{grid-area:price}
  body.vt .de-lines > tbody > tr > .de-c-disc{grid-area:disc}
  body.vt .de-lines > tbody > tr > .de-c-vat{grid-area:vat}
  body.vt .de-lines > tbody > tr > .de-c-acct{grid-area:acct}
  body.vt .de-lines > tbody > tr > .de-c-total{grid-area:tot}
  body.vt .de-lines > tbody > tr > .de-c-x{grid-area:x;justify-items:end}
  /* The document's header: the left half's 6 columns gave the reference 2 of them (98px at 768px), so "QUO00003" was cut
     and "SOURCE DOCUMENT / REF" took three lines (sweep #2). On a tablet the fields take 8 columns and the notes 4: the
     customer 5, the reference 3, a date 4. ux.css's own 768px rules for these come later in the cascade, so each field is
     named with its .ct-field as well (the add-a-customer form, which has none, by its class twice). */
  body.vt .de-head-cols > .de-grid > .ct-field.de-party{grid-column:1 / span 5}
  body.vt .de-head-cols > .de-grid > .ct-field.de-ref{grid-column:6 / span 3}
  body.vt .de-head-cols > .de-grid > .ct-field.de-datef{grid-column:1 / span 4}
  body.vt .de-head-cols > .de-grid > .ct-field.de-datef:has([data-due-date]){grid-column:5 / span 4}
  body.vt .de-head-cols > .de-grid > .de-addparty.de-addparty{grid-column:1 / span 8}
  body.vt .de-head-cols > .ct-field.de-head-notes{grid-column:9 / -1}
  /* Repeating invoices: the Cadence picker in a row (recurring.js:183) got what the 1102px table left over, a 61px box,
     and "Monthly" read "Mo" at 768 and 1024px (4 Dec 2026 sweep #9). The table scrolls sideways here anyway; the box
     keeps room for its longest wording ("every 12 months", 114px) and the arrow. ux.css's phone block does the same. */
  body.vt .rec-tbl td[data-cadence-cell] > .ss{min-width:9rem}
}
/* …the financial-year arrows on a report (‹ 36px, › 32px, and of two widths), and the chart of accounts' toolbar
   (search 34, type 32, page size 32, + New account 36): each row one height */
body.vt .rp-fynav>.btn{height:var(--control-h);min-height:var(--control-h);min-width:40px;box-sizing:border-box;margin:0}
/* Settings ▸ Chart of accounts: an account is edited at its row (golden rule #7 — 11 Nov 2026: "Edit account" opened at
   the top of the page, away from the row clicked). The form is the row under the account's, the table's whole width;
   the account's own row is tinted while its form is open */
body.vt .set-coa tr.set-acc-editing > td{background:var(--hover,color-mix(in srgb, var(--hue-brand) 8%, transparent))}
body.vt .set-coa tr.set-acc-edit-row > td{padding:8px;background:var(--surface);white-space:normal;text-align:left}
body.vt .set-coa .set-acc-edit-row .set-accform{margin:0}
.cb-limit-edit-actions{display:flex;justify-content:flex-end;gap:6px}
/* A card's edit form (a cashbook's ✎, a bank card's ⚙ number, a supplier header's ✎) floats under its card (Andre,
   11 Nov 2026: "Pushing the screen down"; Callan: "will make it overlap so that everything stays in place"): the card
   keeps its size, and the strip, the other cards and the register stay where they are. position:fixed, so the strip's
   sideways scroll never clips it; cashbook.js puts it under its card (placeCardForm) and gives it the height the
   screen leaves — past that it scrolls inside itself. Under the top bar (50), over the page's sticky bars (20). The
   card it belongs to is ringed in the brand colour. */
.cb-card.is-editing{border-color:var(--brand)}
.cb-card.is-editing .cb-limit-edit{position:fixed;z-index:40;width:300px;max-width:calc(100vw - 16px);box-sizing:border-box;
  margin:0;padding:10px 12px;overflow-y:auto;background:var(--surface);border:2px solid var(--brand);border-radius:12px;
  box-shadow:0 12px 32px var(--shade-22)}
/* its buttons fill their row, edge to edge (Andre, 11 Nov 2026: "make sure the buttons are flush left /right"):
   Cancel on the left edge, Save changes on the right — in every row of the form, the clear's too */
.cb-limit-edit .cb-limit-edit-actions>.btn{flex:1 1 auto}
/* clearing an account's imported data (#108) at the foot of its ⚙ form, set apart by a rule: a governing role only */
.cb-clear-foot{display:flex;flex-direction:column;gap:6px;margin-top:4px;padding-top:6px;border-top:1px solid var(--line)}
/* "Clear imported data…" takes the form's whole width, in line with the fields and the buttons above it (Andre,
   11 Nov 2026: it "doesn't seem to belong — make it align properly": it sat to the right, its left edge on nothing) */
.cb-clear-foot>.cb-clear-open{align-self:stretch}
/* a longer label (a translation) wraps to the next line, never out of the form */
.cb-clear .cb-limit-edit-actions{flex-wrap:wrap}
.cb-clear-title{font-size:12px;font-weight:700;color:var(--bad)}
.cb-clear-list{margin:0;padding-left:16px;font-size:12px;overflow-wrap:anywhere}
/* r1108 bank — the clear's choice (this account, or everything imported), its dates, and what stays */
.cb-clear-scope,.cb-clear-dates{display:flex;gap:6px;flex-wrap:wrap}
.cb-clear-scope .btn{flex:1 1 auto}
.cb-clear-date-lbl{display:flex;flex-direction:column;gap:2px;flex:1 1 120px;font-size:12px;color:var(--muted)}
.cb-clear-hint,.cb-clear-note{font-size:12px;color:var(--muted)}
.cb-clear-stay{font-size:12px;color:var(--warn);overflow-wrap:anywhere}
/* its "Clear imported data" button is red, as the clear's title is: the tenant screens' `body.vt .btn` (vt.css) paints
   every button white and outranks this file's `.btn-danger` (4 Nov staging: white, like Cancel). This button alone —
   every other .btn-danger keeps its look */
body.vt .btn.btn-danger.cb-clear-go{background:var(--bad);border-color:var(--bad);color:var(--hue-paper)}
.cb-card-drop{border-style:dashed;color:var(--muted)}
.coop-pill{border:1px solid transparent;border-radius:999px;padding:1px 8px;font-size:12px;font-weight:700;line-height:1.5;white-space:nowrap;cursor:pointer;background:var(--hover,color-mix(in srgb, var(--hue-brand) 8%, transparent));color:var(--muted)}
.coop-pill-ok{color:var(--ok);background:color-mix(in srgb, var(--c-green-700) 10%, transparent)}
.coop-pill-held{color:var(--warn);background:color-mix(in srgb, var(--c-amber-700) 12%, transparent)}
.coop-pill:hover{border-color:currentColor}
/* the open co-op cashbook's statement does not tie to its PDF: nothing of it posts */
.cb-held-banner{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--warn-bg,color-mix(in srgb, var(--c-amber-700) 8%, transparent));
  border:1px solid var(--warn);border-left:4px solid var(--warn);border-radius:var(--radius,8px);padding:8px 12px;margin-bottom:8px;font-size:13px}
.cb-held-msg{flex:1 1 240px;min-width:0;color:var(--ink)}
/* a statement missing between two (12 Nov 2026 huddle, item 2M): said once, with its Bridge button — laid out as the
   held banner above; on the Statements screen its gap row carries the same button, a bridge row its tag, and a statement
   that ties its "Clear gap warnings" */
.cb-missing-banner{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--warn-bg,color-mix(in srgb, var(--c-amber-700) 8%, transparent));
  border:1px solid var(--warn);border-left:4px solid var(--warn);border-radius:var(--radius,8px);padding:8px 12px;margin-bottom:8px;font-size:13px}
.cb-missing-msg{flex:1 1 240px;min-width:0;color:var(--ink)}
.stmt-gap-msg{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.stmt-gap-msg > span{flex:1 1 240px;min-width:0}
.stmt-bridge-tag{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;font-size:12px;font-weight:600;
  border:1px solid var(--warn);color:var(--warn)}
/* the review: where each sub-account went, and the tie-out to the PDF (reuses .cb-stmt-overlay / -modal / -head) */
.coop-review{width:min(1040px,96vw)}
/* after "Check again": when it checked and what it found — under the head, outside the body that scrolls, so it is in
   sight however far down the review is read (coop_review.js checkedLine) */
.coop-checked{flex-shrink:0;padding:6px 16px;border-bottom:1px solid var(--line);font-size:12px;line-height:1.45;color:var(--muted)}
.coop-body{display:flex;flex-direction:column;gap:10px}
/* the body scrolls as a whole: each part keeps its own height. A .table-wrap scrolls (overflow-x:auto), so as a flex
   item it could shrink to a sliver — a review taller than the modal showed each table one row at a time */
.coop-body > *{flex-shrink:0}
.coop-h{font-size:13px;font-weight:700;margin:6px 0 0}
.coop-h .muted{font-weight:500;font-size:12px}
.coop-verdict{border-radius:8px;padding:8px 12px;font-size:13px;font-weight:600;line-height:1.45}
.coop-verdict-held{background:color-mix(in srgb, var(--c-amber-700) 10%, transparent);color:var(--warn)}
.coop-verdict-ok{background:color-mix(in srgb, var(--c-green-700) 8%, transparent);color:var(--ok)}
.coop-verdict-wait{background:var(--hover,color-mix(in srgb, var(--hue-brand) 8%, transparent));color:var(--muted)}
.coop-problems{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:3px;font-size:12.5px;color:var(--warn);line-height:1.4}
.coop-table{font-size:12.5px}
.coop-table td,.coop-table th{white-space:nowrap}
.coop-row-off td{background:color-mix(in srgb, var(--c-red-700) 6%, transparent)}
.coop-skipped td{color:var(--muted);white-space:normal}
.coop-tie{font-weight:700}
.coop-tie-ok{color:var(--ok)}
.coop-tie-off{color:var(--bad)}
.coop-made{display:inline-block;margin-left:6px;font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:0 6px}
.coop-made-new{color:var(--brand);border-color:var(--brand)}
.coop-page-link,.coop-cb-link{border:0;background:none;padding:0;color:var(--brand);cursor:pointer;font:inherit;text-decoration:underline}
.coop-note{font-size:12px;line-height:1.45}
.coop-show-all{align-self:flex-start}
/* the co-op's first statement: its opening, and where the books may already hold it (coop_review.js openingBlock). The
   choice and its button share one row at one height (golden rule #9); Undo and its confirm sit to the right. */
.coop-opening{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:8px;padding:10px 12px;font-size:13px;line-height:1.45}
.coop-opening .coop-h{margin:0}
.coop-opening-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.coop-opening-end{justify-content:flex-end}
.coop-opening-stale{color:var(--warn)}
.coop-opening-err{color:var(--bad)}
.coop-opening-msg{color:var(--ok)}
/* a later statement against the co-op's statement before it (coop_review.js carryBlock): what moved, what is missing.
   A row the co-op moved is marked as moved (brand), one that is off as off (red) */
.coop-carry{display:flex;flex-direction:column;gap:6px;font-size:13px;line-height:1.45}
.coop-carry-prev{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.coop-carry-ok{color:var(--ok)}
.coop-carry-off{color:var(--warn)}
.coop-carry-wait{color:var(--muted)}
.coop-row-moved td{background:var(--brand-faint)}
/* a later statement's difference no move explains, booked where it belongs (coop_review.js differenceBlock): the account
   and its button share one row at one height (golden rule #9); Undo and its confirm sit to the right */
.coop-diff{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:8px;padding:10px 12px}
.coop-diff-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.coop-diff-row .ss,.coop-opening-row .coop-open-pick{flex:1 1 260px;min-width:0;max-width:560px}
.coop-diff-end{justify-content:flex-end}
.coop-diff-err{color:var(--bad)}
/* a held statement read again from its PDF (coop_review.js readAgainBlock): what it does and its button, at the control
   height (golden rule #9), or why it cannot be */
.coop-ra{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:8px;padding:10px 12px;font-size:13px;line-height:1.45}
.coop-ra-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.coop-ra-err{color:var(--bad)}
/* the statement's purchase documents also on the co-op as a supplier, dated in its period (coop_review.js
   supplierDocsBlock): one whose purchase is on the statement is in the books twice */
.coop-supplier-docs{display:flex;flex-direction:column;gap:6px;border:1px solid var(--warn);border-radius:8px;padding:10px 12px;font-size:13px;line-height:1.45}
.coop-supplier-docs .coop-h{margin:0}
.coop-diff-msg{color:var(--ok)}
/* the form's link step: the sub-accounts the held statement prints */
.cb-wiz-title{font-weight:700;font-size:14px}
.coop-read-sections{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;font-size:12.5px}
.coop-read-sections li{display:flex;align-items:baseline;gap:8px;border-bottom:1px solid var(--line);padding:4px 0}
.coop-read-label{flex:1 1 auto;min-width:0}
/* the link form gives each sub-account its account (Callan, 4 Nov): the choice on a line of its own under it */
.coop-read-sections li.has-map{flex-wrap:wrap}
.coop-read-sections .coop-link-map{flex:1 1 100%;min-width:0;padding-top:2px}
body.vt .coop-link-map .cb-in,body.vt .coop-ra-row .btn,body.vt .coop-diff-row .ss-input,
body.vt .coop-diff-row .btn,body.vt .coop-opening-row .cb-in,body.vt .coop-opening-row select.cb-in,
body.vt .coop-opening-row .btn,body.vt .card-body.rule-form>.form-control,body.vt .card-body.rule-form>select,
body.vt .card-body.rule-form .ss-input,body.vt .card-body.rule-form>.btn,body.vt .cb-limit-edit .cb-in,
body.vt .cb-limit-edit .btn,body.vt .set-coa-bar>.search,body.vt .set-coa-bar>select,
body.vt .set-coa-bar>.per-select, body.vt .set-coa-bar>.btn{height:var(--control-h);min-height:var(--control-h);box-sizing:border-box;margin:0}

/* sticky summary strip */
/* live: the whole strip is ONE line on desktop (nowrap, 1200px surface); mobile wraps */
/* sticks just BELOW the top nav (not at top:0, which collided with it) and one z-layer under it,
   so the Post-to-Ledger bar stays visible while the register scrolls under the nav */
.cb-summary{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin-bottom:8px;position:sticky;top:var(--topbar-h, 62px);z-index:9}
.cb-summary>.btn,.cb-summary .confirm-inline{white-space:nowrap;flex-shrink:0}
/* A6: a supplier's account adds "Import summary" to the one-line strip, which has little room left at a 1280px window
   (cashbook.js: the gaps offer was moved off it for pushing Statements out of reach). That strip wraps when it must:
   a button that does not fit goes to a second line, never out of reach. Every other strip is unchanged. */
.cb-summary.cb-summary-wrap{flex-wrap:wrap}
/* Every account's strip wraps when it must (owner 2026-11-11, "statement button is off the screen" — a bank account
   with unallocated lines, Re-run, Jump to, Fetch mail and Statements ran past the card at a zoomed desktop). A button
   that does not fit goes to the next line; the balance never breaks inside ("R" over "-206,535.90"), and Jump to keeps
   room for its words instead of shrinking to an empty box. */
.cb-summary{flex-wrap:wrap;row-gap:8px}
.cb-summary-label,.cb-summary-value{white-space:nowrap}
.cb-summary>.cb-jump{flex:0 0 auto;min-width:9.5em}
.cb-summary-bal{display:flex;flex-direction:column}
.cb-summary-label{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}
.cb-summary-value{font-size:16px;font-weight:700}
/* live: IN / OUT / Projected are ONE inline trio — each pair never splits, and the
   group only wraps as a whole (base has no wrap; phones wrap like live's mobile rule) */
.cb-summary-staged{display:flex;gap:12px;flex:1;justify-content:center;font-size:13px}
.cb-summary-staged>span{white-space:nowrap}
.cb-fetch-mail{margin-left:auto}   /* keep the email-fetch button at the far right of the strip */
.cb-unalloc-badge{display:inline-flex;align-items:center;gap:4px;background:color-mix(in srgb, var(--c-amber-500) 12%, transparent);color:var(--c-amber-700);font-size:12px;font-weight:700;padding:4px 10px;border-radius:8px;cursor:pointer;border:1px solid transparent;white-space:nowrap}
.cb-unalloc-badge:hover{background:color-mix(in srgb, var(--c-amber-500) 20%, transparent)}
.cb-unalloc-badge.on{border-color:var(--c-amber-700)}
/* what is left to do beside the account's one status (owner 23 Nov 2026): "154 to allocate · 46 to post", each a filter */
.cb-todos{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.cb-todo{display:inline-flex;align-items:center;font-size:12px;font-weight:700;padding:4px 10px;border-radius:8px;cursor:pointer;
  border:1px solid transparent;white-space:nowrap;background:var(--surface-2);color:var(--ink)}
.cb-todo.on{border-color:var(--ink)}
.cb-todo-sep{color:var(--muted)}
/* a statement missing between two: the honest options under its message, and the bank-charge form (ADR-0007) */
.ms-options{display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex:1 1 100%}
.ms-charge-link{appearance:none;background:none;border:0;padding:0;color:var(--muted);text-decoration:underline;cursor:pointer;font-size:13px}
.ms-charge-form{flex:1 1 100%;display:flex;flex-direction:column;gap:7px;margin-top:6px;padding:8px 10px;border:1px solid var(--line);
  border-radius:8px;background:var(--surface)}
.ms-charge-head{font-size:13px;font-weight:600;color:var(--ink)}
.ms-charge-err{font-size:12.5px;color:var(--bad)}
.ms-charge-actions{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end;align-items:center}
/* a line kept as it is on the Bad data list: its chip in the register undoes it */
.cb-kept{appearance:none;border:1px solid var(--line);background:var(--surface);color:var(--muted);font-size:12px;font-weight:700;
  border-radius:999px;padding:1px 8px;cursor:pointer;white-space:nowrap}
/* mode row */
.cb-mode-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.cb-mode-toggle{display:inline-flex;border:1px solid var(--line);border-radius:999px;overflow:hidden}
.cb-mode-btn{border:0;background:var(--surface);color:var(--muted);padding:5px 16px;font-size:13px;cursor:pointer}
.cb-mode-btn.active{background:var(--brand);color:var(--hue-paper)}
.cb-mode-spacer{flex:1}
.cb-auto-search{max-width:260px}
/* panels (import / reconcile) */
.cb-panel{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:12px;margin-bottom:10px;display:grid;gap:8px}
.cb-panel-title{font-weight:600;font-size:14px}
.cb-panel-hint{font-size:12px;color:var(--muted);margin:0}
.recon-grid{display:flex;gap:14px;flex-wrap:wrap;font-size:13px}
.recon-list{border-top:1px dashed var(--line);padding-top:8px}
.recon-row{font-size:12px;padding:2px 0}
/* tabs */
.cb-tabs{display:flex;border-bottom:2px solid var(--line);margin-bottom:8px}
.cb-tab{padding:8px 18px;font-size:14px;font-weight:600;color:var(--muted);background:none;border:0;border-bottom:4px solid transparent;margin-bottom:-2px;cursor:pointer;
  transition:color .15s,border-bottom-color .15s}
/* default active state for every tab bar (scoped bars below override the colour) — bolder text so
   the selected tab is obvious, not just a thin underline (owner 2026-09-08) */
.cb-tab.active{border-bottom-color:var(--hue-brand);color:var(--ink);font-weight:800}
/* the active tab's count badge picks up the tab colour so the whole tab reads as "on" */
.cb-tab.active .cb-tab-badge{background:color-mix(in srgb, currentColor 16%, transparent);color:currentColor}
.cb-tab-dep.active{border-bottom-color:var(--ok);color:var(--ok)}
.cb-tab-pay.active{border-bottom-color:var(--bad);color:var(--bad)}
.cb-tab-badge{display:inline-block;font-size:12px;background:var(--surface-2);color:var(--muted);padding:1px 7px;border-radius:8px;margin-left:4px;font-weight:700}
/* bulk bar */
.cb-bulk-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 12px;background:var(--surface);border:1px dashed var(--line);border-radius:8px;margin-bottom:8px;font-size:13px}
.cb-bulk-sel{max-width:260px}
.btn-danger{background:var(--bad);border-color:var(--bad);color:var(--hue-paper)}
/* sortable column headers (reports List of Accounts + cashbook/journal registers) — click to sort asc/desc */
th.sort-th{cursor:pointer;user-select:none;white-space:nowrap}
th.sort-th:hover{color:var(--brand)}
th.sort-th:focus-visible,.doc-tbl tbody tr.kb-focus{outline:2px solid var(--brand);outline-offset:-2px}
th.sort-th.sort-active{color:var(--brand)}
.sort-ind{font-size:12px;opacity:.85}
/* quick-add form */
.cb-form{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px;margin-bottom:10px}
.cb-row{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.cb-in{padding:5px 8px;font-size:13px;height:32px}
select.cb-in{height:32px}
.cb-w-date{flex:0 0 130px}
.cb-w-ref{flex:0 0 90px}
.cb-w-desc{flex:2 1 140px}
.cb-w-tax{flex:0 0 150px}
.cb-w-amt{flex:0 0 100px}
.cb-w-cost{flex:0 0 70px}
.cb-add{height:32px}
.cb-gl-wrap{flex:1 1 150px;position:relative;min-width:120px;max-width:240px}
.cb-gl-wrap .cb-in{width:100%}
.cb-dest-pills{display:flex;gap:3px;flex:0 0 auto}
.cb-dest-pill{padding:3px 10px;border:1px solid var(--line);border-radius:12px;font-size:12px;font-weight:600;cursor:pointer;background:var(--surface);color:var(--muted);white-space:nowrap}
.cb-dest-pill:hover{border-color:var(--muted)}
.cb-dest-pill.active[data-dest="G"]{background:var(--brand);color:var(--hue-paper);border-color:var(--brand)}
.cb-dest-pill.active[data-dest="D"]{background:var(--ok);color:var(--hue-paper);border-color:var(--ok)}
.cb-dest-pill.active[data-dest="C"]{background:var(--bad);color:var(--hue-paper);border-color:var(--bad)}
.cb-dest-pill.active[data-dest="V"]{background:var(--c-amber-700);color:var(--hue-paper);border-color:var(--c-amber-700)}
.cb-form-options{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:6px}
.cb-vat-inline{font-size:12px;color:var(--muted)}
.cb-diesel-inline{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.cb-diesel-inline .cb-in{max-width:110px}
.alloc-rule-check{margin-left:4px;font-weight:700}
/* tables */
.table-wrap{overflow-x:auto}
.cb-table{width:100%;border-collapse:collapse;font-size:13px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
.cb-table th{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);text-align:left;padding:8px;border-bottom:1px solid var(--line)}
.cb-table th.text-right{text-align:right}
.cb-table td{padding:7px 8px;border-bottom:1px solid var(--line);vertical-align:middle}
/* Reusable switch toggle (v2 iOS-style, aboo teal) — used across the books screens */
.switch{position:relative;display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:13px;color:var(--ink);user-select:none}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch-track{width:34px;height:19px;border-radius:999px;background:var(--line);transition:background .15s;flex:0 0 auto;position:relative}
.switch-track::after{content:'';position:absolute;top:2px;left:2px;width:15px;height:15px;border-radius:50%;background:var(--hue-paper);transition:transform .15s;box-shadow:0 1px 2px var(--shade-25)}
.switch input:checked + .switch-track{background:var(--brand)}
.switch input:checked + .switch-track::after{transform:translateX(15px)}

/* Journals (§2) capture form + staged table — v2 compact density */
.jrn-form{display:flex;flex-direction:column;gap:8px}
.jrn-row{display:flex;flex-wrap:wrap;gap:8px}
.jrn-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.jrn-meta .jrn-ref{max-width:130px}
.jrn-meta .jrn-amt{max-width:120px}
.jrn-meta .jrn-tax{max-width:140px}
/* Low-chrome debit/credit columns (owner 2026-09-17: "too much real estate"): the coloured
   DEBIT/CREDIT header tags carry the side distinction, so drop the box — border, background,
   radius and padding — leaving a tight, compact stack of fields. */
.jrn-side{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:5px}
.jrn-side-hd{display:flex;align-items:center;justify-content:space-between;gap:8px}
.jrn-side-tag{font-size:12px;font-weight:800;letter-spacing:.04em;border-radius:4px;padding:2px 8px;color:var(--hue-paper)}
.jrn-dr{background:var(--ok)}
.jrn-cr{background:var(--bad)}
.jrn-dests{display:inline-flex;gap:4px}
.jrn-dest{width:24px;height:24px;border:1px solid var(--line);background:var(--surface);border-radius:50%;
  font-size:12px;font-weight:700;color:var(--muted);cursor:pointer;line-height:1}
.jrn-dest.active{background:var(--brand);border-color:var(--brand);color:var(--hue-paper)}
.jrn-hide{display:none}
.jrn-actions{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.jrn-spacer{flex:1 1 auto}
.jrn-postbar{display:flex;justify-content:flex-end;margin:10px 0}
.jrn-staged-head{display:flex;align-items:center;gap:8px;margin:2px 0 8px}
.jrn-staged-title{font-weight:700;font-size:14px}
.jrn-staged-head .btn{margin-left:auto}
.jrn-acct{font-size:12.5px}
.jrn-edit-row{background:color-mix(in srgb,var(--brand) 6%,var(--surface))}
.jrn-edit-in{padding:4px 6px;font-size:13px;height:auto;width:100%}
.jrn-edit-contra{margin-top:4px;font-size:12px}
.jrn-edit-act{white-space:nowrap;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.jrn-edit-err{font-size:12px}
.jrn-edit-btn{color:var(--brand)}
.jrn-total td{border-top:2px solid var(--line);border-bottom:none}

/* Contacts (§3) — aging cards, list toolbar, detail + edit. Cards sit as one compact row
   on desktop (5 buckets at ~130px each), stack into a 3-col grid on tablet and a 2-col
   grid on phone so an empty balance doesn't waste half the screen on air. */
.aging-cards{display:grid;grid-template-columns:repeat(5, minmax(0, 1fr));gap:8px;margin:10px 0}
.aging-card{border:1px solid var(--line);border-radius:10px;padding:8px 12px;background:var(--surface);min-width:0}
@media (max-width:900px){ .aging-cards{grid-template-columns:repeat(3, minmax(0, 1fr))} }
@media (max-width:520px){ .aging-cards{grid-template-columns:repeat(2, minmax(0, 1fr))} }
.aging-lbl,.jrn-lbl{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700}
.aging-val{font-size:15px;font-weight:700;margin-top:2px;font-variant-numeric:tabular-nums}
.aging-card-btn{cursor:pointer;text-align:left;font:inherit;transition:border-color .12s,background .12s}
.aging-card-btn:hover{border-color:var(--brand)}
.aging-card-btn.active{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 12%,var(--surface))}
.aging-card-btn.active .aging-lbl{color:var(--brand)}
.ct-toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:8px 0}
.ct-search{max-width:320px}
.ct-tabs{margin:6px 0}
.ct-section-lbl{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700;margin:14px 0 6px}
.ct-sort{display:inline-flex;align-items:center;gap:6px;text-transform:none;font-weight:600}
.ct-sort-sel{width:auto;padding:2px 6px;font-size:12px}
.ct-row .row-open{margin-left:8px}
.ct-off{opacity:.55}
.ct-new-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px}
.ct-new-actions{display:flex;align-items:center;gap:8px;margin-top:10px;flex-wrap:wrap}
/* Customer/supplier chooser in the inline +New form (issue #62) */
.ct-type-choose{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:12px}
.ct-type-lbl{font-size:13px;font-weight:600;color:var(--muted)}
.ct-type-segs{flex:0 0 auto}
.ct-type-hint{color:var(--muted);font-size:12px}
/* Team / Users screen (v2 Settings→Users parity) */
.team-new-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1.4fr;gap:8px}
.team-new-hint{display:block;color:var(--muted);font-size:12px;margin-top:8px}
.team-tbl td{vertical-align:top}
.team-who{display:flex;align-items:center;gap:6px}
.team-you{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--brand);border:1px solid var(--brand);border-radius:999px;padding:0 6px;line-height:1.5}
.team-email{font-size:12px;margin-top:2px}
.team-role-sel{min-width:160px;max-width:220px}
.team-role-fixed{font-weight:600}
.team-locked{cursor:default}
.team-link-card{border-left:3px solid var(--brand)}
.team-link-head{font-weight:700;margin-bottom:2px}
.team-link-row{display:flex;align-items:center;gap:8px;margin-top:8px}
.team-link-input{flex:1 1 auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}
.team-link-actions{margin-top:10px}
@media (max-width:720px){.team-new-grid{grid-template-columns:1fr}}
/* Per-area permissions (RBAC prototype, plan/rbac.md): one row per area — name + what the level allows,
   then the level buttons. Phone first: stacked; from 721px the buttons sit to the right of the name. */
.perm-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0 6px}
.perm-label{font-size:12px;font-weight:700;color:var(--muted);min-width:78px}
.perm-grid{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden;margin:4px 0 8px}
.perm-row{display:flex;flex-direction:column;gap:6px;padding:8px 12px;border-top:1px solid var(--line)}
.perm-row:first-child{border-top:0}
.perm-area{display:flex;flex-direction:column;gap:1px;min-width:0}
.perm-area small{font-size:12px}
.perm-levels{flex-wrap:wrap}
.perm-sum{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:4px;font-size:12.5px}
.perm-edit-row > td{background:var(--surface-2,var(--surface));padding:4px 12px 12px}
.perm-edit-actions{display:flex;justify-content:flex-end;gap:8px}
.perm-proto{border:1px dashed var(--brand);border-radius:8px;padding:6px 10px;margin:0 0 10px;font-size:12.5px;color:var(--ink)}
.perm-proto-ok{border-style:solid;border-color:var(--ok)}
@media (min-width:721px){
  .perm-row{flex-direction:row;align-items:center;justify-content:space-between;gap:12px}
  .perm-levels{flex-wrap:nowrap;justify-content:flex-end}
}
/* Contact-detail header sits flush on the page — no card / panel wrapping (owner Andre
   2026-09-17: "Get rid of the panel at the top", "Its padding too much"). Compact vertical
   rhythm; the balance still hugs the right on desktop. */
.ct-detail-head{padding:0;background:transparent;border:0;box-shadow:none;margin-bottom:12px}
.ct-detail-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ct-detail-name{font-size:20px;margin:0;display:flex;align-items:center;gap:8px}
.ct-detail-sub{font-size:12.5px;color:var(--muted);margin-top:2px}
/* VAT status of a contact (migration 300): a chip, the number, and anything to look at */
.ct-vat{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin-top:6px;font-size:12.5px}
.ct-vat-chip{font-size:12px;font-weight:600;padding:1px 8px;border-radius:999px;background:var(--surface-2,var(--line));color:var(--ink)}
.ct-vat-chip.vat-registered{background:var(--c-green-100,var(--line));color:var(--c-green-700,var(--ink))}
.ct-vat-chip.vat-not_registered{background:var(--line);color:var(--ink)}
.ct-vat-chip.vat-unknown{background:var(--c-amber-100,var(--line));color:var(--c-amber-800,var(--ink))}
.ct-vat-flag{font-size:12px;color:var(--c-amber-700,var(--bad))}
button.ct-vat-chip{border:0;cursor:pointer;min-height:24px}
.ct-vat-panel{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.ct-vat-no{display:flex;gap:6px;align-items:center;flex:1 1 220px}
.ct-vat-no .form-control{min-width:0;flex:1}
.ct-vat-quick{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px}
.ct-vat-src{font-size:12.5px}
/* the VAT chip sits on the account-number line (owner 3 Dec 2026); its panel opens on a line of its own below */
.ct-sub-vat{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin-top:2px}
.ct-sub-vat .ct-detail-sub,.ct-sub-vat .ct-vat{margin-top:0}
.ct-sub-vat .ct-vat-panel{flex-basis:100%}
.portal-notice{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin:14px 0 4px}
.portal-notice-pick{cursor:pointer}
.ct-detail-bal{text-align:right;font-size:20px;font-weight:800;font-variant-numeric:tabular-nums}
.ct-bal-lbl{display:block;font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase}
.ct-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:10px}
/* "New ▾" document dropdown in the contact action row */
.ct-new-dd{position:relative;display:inline-flex}
.ct-new-btn{display:inline-flex;align-items:center;gap:5px}
.ct-new-caret{font-size:10px;opacity:.85}
.ct-new-backdrop{position:fixed;inset:0;z-index:40}
.ct-new-menu{position:absolute;top:calc(100% + 4px);left:0;z-index:41;min-width:180px;
  background:var(--surface);border:1px solid var(--line);border-radius:10px;
  box-shadow:0 8px 24px color-mix(in srgb, var(--c-blue-l11) 14%, transparent);padding:4px;display:flex;flex-direction:column}
.ct-new-menu-head{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;
  color:var(--muted);padding:6px 10px 2px}
.ct-new-item{text-align:left;background:none;border:0;cursor:pointer;font-size:13.5px;font-weight:600;
  color:var(--ink);padding:7px 10px;border-radius:7px}
.ct-new-item:hover{background:var(--brand-faint);color:var(--brand)}
/* Hide the History-and-notes section's own "Add note" button on the contact detail —
   the header row already carries an "Add note" button that delegates through this one,
   so exposing both would be a duplicate affordance (owner Andre 2026-09-17). */
.hn-hide-addnote [data-addnote]{display:none}

/* Mobile: tighten the whole contact-detail header (owner Andre 2026-09-17: "space wasting"
   + "get rid of these panels with all the borders — not very efficient"). Drop the outer
   card panel entirely, drop the outlined-button chrome — actions read as a compact row of
   text links, with the primary Edit action alone getting the filled brand button. */
@media (max-width:767px){
  body.vt .ct-detail-head{padding:0;background:transparent;border:0;box-shadow:none}
  body.vt .ct-detail-top{gap:6px}
  body.vt .ct-detail-name{font-size:22px;margin:0}
  body.vt .ct-detail-sub{font-size:12px;margin-top:2px}
  body.vt .ct-detail-bal{text-align:left;font-size:24px;margin-top:6px;width:100%}
  body.vt .ct-bal-lbl{display:inline;font-size:12px;margin-left:6px}
  body.vt .ct-tags{margin-top:6px}
  body.vt .ct-actions{display:flex;flex-wrap:wrap;gap:14px 18px;margin-top:12px;
    padding-top:10px;border-top:1px solid var(--line)}
  body.vt .ct-actions>.btn{background:transparent;border:0;box-shadow:none;padding:0;
    font-size:14px;font-weight:600;color:var(--brand);width:auto}
  body.vt .ct-actions>.btn:hover{color:var(--ink);background:transparent}
  body.vt .ct-actions>.btn:disabled{color:var(--muted)}
  /* Primary Edit stays as a solid pill so it reads as the main action. */
  body.vt .ct-actions>.btn.btn-primary{margin-left:auto;background:var(--brand);
    color:var(--hue-paper);padding:8px 16px;border-radius:8px}
  body.vt .ct-actions>.btn.btn-primary:hover{background:var(--brand);color:var(--hue-paper);filter:brightness(1.05)}
  body.vt .ct-actions .jrn-spacer{display:none}
}
.ct-back{background:none;border:none;color:var(--brand);cursor:pointer;font-weight:600;padding:0;margin-bottom:8px;font-size:13px}
/* Tighter layout on the contacts screens — less wasted space (owner Andre 2026-09-18:
   "reduce the padding on these screens … wasting too much space"). Scoped to .ct-page so
   the rest of the tenant surface is untouched. */
body.vt .page.ct-page{padding:6px 8px 24px}
body.vt .ct-page .card{padding:6px 8px;margin-bottom:8px}
.ct-page .ct-edit-sec{margin:6px 0 4px}
.ct-edit-sec{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700;margin:12px 0 6px;border-bottom:1px solid var(--line);padding-bottom:4px}
.ct-edit-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px}
.ct-field{display:flex;flex-direction:column;gap:3px;min-width:0}
.ct-field-full{grid-column:1 / -1}
.ct-edit-grid-2{grid-template-columns:repeat(2,1fr)}
@media (max-width:640px){.ct-edit-grid-2{grid-template-columns:1fr}}
.ct-edit-disabled{margin-top:8px}

/* ── Multiple contact addresses (migration 124) ─────────────────────────────── */
.ct-addr-sec{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ct-addr-add{flex:0 0 auto}
.ct-addr-wrap{margin-top:8px}
.ct-addr-empty{font-size:13px;padding:4px 0 8px}
.ct-addr-list{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.ct-addr-card{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:var(--surface)}
.ct-addr-main{min-width:0;flex:1 1 auto}
.ct-addr-badges{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:3px}
.ct-addr-badge{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;
  border-radius:999px;padding:1px 8px}
.ct-addr-badge.billing{background:var(--brand-faint);color:var(--brand)}
.ct-addr-badge.delivery{background:color-mix(in srgb, var(--c-violet-l66) 14%, transparent);color:var(--c-violet-600)}
.ct-addr-badge.type{background:var(--line);color:var(--ink)}
.ct-addr-label{font-size:12.5px;font-weight:600;color:var(--muted)}
.ct-addr-lines{font-size:13.5px;color:var(--ink);line-height:1.4}
.ct-addr-actions{display:flex;flex-wrap:wrap;gap:10px;flex:0 0 auto;align-items:center}
.ct-addr-actions .btn-link{font-size:12.5px;font-weight:600;background:none;border:0;cursor:pointer;
  color:var(--brand);padding:0}
.ct-addr-actions .btn-link:hover{text-decoration:underline}
.ct-addr-actions .btn-link.danger{color:var(--bad)}
.ct-addr-delete{margin-left:auto;display:inline-flex;align-items:center}
/* the bin is pinned top-right on the card (ux.css .has-card-del): the actions keep clear of it, so Edit is never under it */
body.vt .ct-addr-card.has-card-del .ct-addr-actions{padding-right:30px}
.ct-addr-form{border:1px dashed var(--line);border-radius:10px;padding:12px;
  background:var(--surface-2);margin-top:6px}
.ct-addr-form-head{font-weight:700;font-size:13px;margin-bottom:8px}
.ct-addr-notes{margin-top:8px}
.ct-addr-toggles{display:flex;flex-wrap:wrap;gap:14px 24px;margin-top:10px}
.ct-addr-form-actions{display:flex;gap:8px;margin-top:12px}
@media (max-width:767px){
  .ct-addr-card{flex-direction:column;gap:8px}
  .ct-addr-actions{gap:14px}
}
.ct-notes{margin-top:8px}
.ct-note-add{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.ct-note-add > .form-control{flex:1 1 240px;min-width:0}
.ct-note-due{flex:0 0 auto;max-width:160px}
.ct-task-badge{display:inline-block;font-size:12px;font-weight:700;background:var(--brand);color:var(--hue-paper);border-radius:4px;padding:1px 6px;margin-right:4px}
.cb-row-unalloc td:first-child{box-shadow:inset 3px 0 0 var(--c-amber-700)}
.cb-row-in td:first-child{box-shadow:inset 3px 0 0 var(--ok)}
.cb-row-out td:first-child{box-shadow:inset 3px 0 0 var(--bad)}
.cb-th-sel{width:28px}
.cb-td-amt,.cb-td-date{white-space:nowrap}
.cb-dup{color:var(--c-amber-700);cursor:help}
.cb-gap{border:1px solid var(--c-amber-700);color:var(--c-amber-700);background:none;border-radius:999px;padding:1px 7px;font-size:12px;cursor:pointer;white-space:nowrap}
.cb-gap:hover{background:var(--c-amber-700);color:var(--hue-paper)}
/* the ＋ under a register line, and the row it opens (cashbook.js, Andre 9 Nov 2026): laid out as the ✎ edit's. Why it
   was refused sits in a row of its own under it (tr.cb-add-msg), so no box of the row moves (Callan, 10 Nov 2026: "error
   messages or any messages must not break the alignment") */
.cb-add-below{font-weight:700}
.cb-add-err{margin:0}
body.vt .cb-register-table tbody .cb-add-row:has(+ .cb-add-msg) > td{border-bottom:0}
body.vt .cb-register-table tbody .cb-add-msg > td{padding-top:0;border-top:0}
/* the row being added carries the brown stripe of a line not yet allocated (Andre, 10 Nov 2026: "No stripe on left";
   Callan: "make the stripe brown please when you are creating the row") — down through its message line too */
body.vt .cb-register-table tbody .cb-add-row > td:first-child,
body.vt .cb-register-table tbody .cb-add-msg > td:first-child{box-shadow:inset 3px 0 0 var(--c-amber-700)}
/* Received or Paid, never both (Andre, 10 Nov 2026): the side not used shows 0.00, greyed out, until the amount on the
   other side is cleared */
body.vt .cb-in.cb-in-off,body.vt .cb-in.cb-in-off:disabled{background:var(--surface-2);color:var(--faint);border-color:var(--line-soft);cursor:not-allowed;opacity:1}
/* a line added with a ＋ stays marked until the page is loaded again (Andre, 10 Nov 2026: "I'd highlight it until the
   next page refresh"): a tint of the theme's own brand colour, dark and light — the allocated green stripe stays */
body.vt .cb-register-table tbody tr.cb-line.cb-row-added:not(.cb-row-edit) > td{background:color-mix(in srgb, var(--brand) 16%, transparent)}
.cb-dup-ask{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.cb-dup-ask-actions{display:flex;gap:6px;flex-wrap:wrap}
.cb-dest-tag{display:inline-block;font-size:12px;font-weight:700;border-radius:4px;padding:1px 6px;color:var(--hue-paper)}
.cb-dest-g{background:var(--brand)}
.cb-dest-d{background:var(--ok)}
.cb-dest-c{background:var(--bad)}
.cb-dest-v{background:var(--c-amber-700)}
.alloc-btn{border:1px dashed var(--c-amber-700);color:var(--c-amber-700);background:none;border-radius:999px;padding:3px 10px;font-size:12px;cursor:pointer;white-space:nowrap}
.alloc-btn:hover{background:color-mix(in srgb, var(--c-amber-500) 10%, transparent)}
.alloc-btn-matched{border:1px solid var(--ok);color:var(--ok);background:none;border-radius:999px;padding:3px 10px;font-size:12px;cursor:pointer;white-space:nowrap}
.cb-gl-desc{font-size:12px;color:var(--muted);margin-left:4px}
.cb-clear-btn{border:0;background:none;color:var(--muted);cursor:pointer;font-size:12px;padding:2px 4px}
.cb-clear-btn:hover{color:var(--bad)}
.cb-flip{border:0;background:none;cursor:pointer;font-size:13px;color:var(--muted);padding:2px 5px}
.cb-flip:hover{color:var(--brand)}
/* "See this line on the statement" — locate button + source viewer modal (v2 parity) */
.cb-locate{border:0;background:none;cursor:pointer;font-size:13px;color:var(--muted);padding:2px 5px}
.cb-locate:hover{color:var(--brand)}
.cb-stmt-overlay{position:fixed;inset:0;background:var(--shade-55);z-index:500;display:flex;align-items:center;justify-content:center;padding:24px}
.cb-stmt-modal{background:var(--surface);color:var(--ink);border-radius:12px;width:min(900px,96vw);max-height:92vh;display:flex;flex-direction:column;box-shadow:0 18px 50px var(--shade-35);overflow:hidden}
.cb-stmt-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line)}
.cb-stmt-title{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:60%}
.cb-stmt-page{font-size:12px;color:var(--muted)}
.cb-stmt-nav{display:inline-flex;align-items:center;gap:8px}
.cb-stmt-pg{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);font-size:17px;line-height:1;cursor:pointer;padding:0}
.cb-stmt-pg:hover:not(:disabled){border-color:var(--brand);color:var(--brand)}
.cb-stmt-pg:disabled{opacity:.4;cursor:default}
.cb-stmt-body{padding:14px 16px;overflow:auto}
.cb-stmt-locating{padding:36px 12px;text-align:center;color:var(--muted);font-size:14px}
.cb-stmt-err{margin:8px 0}
.cb-stmt-img-wrap{position:relative;display:block;margin:0 auto;max-width:100%}
.cb-stmt-img{display:block;width:100%;height:auto;border:1px solid var(--line);border-radius:6px}
.cb-stmt-hl{position:absolute;left:0;width:100%;top:var(--hl-top,0);height:var(--hl-h,0);background:color-mix(in srgb, var(--c-red-l51) 22%, transparent);border-top:2px solid var(--bad);border-bottom:2px solid var(--bad);pointer-events:none;border-radius:2px}
.cb-stmt-noline{margin-top:10px;font-size:12.5px;color:var(--muted);text-align:center}
/* A ledger line's source document as its PDF (reports.js → docview.js), in the statement viewer's frame */
.doc-pdf-modal{height:92vh}
.doc-pdf-body{flex:1;display:flex;flex-direction:column;min-height:0;padding:0}
.doc-pdf-body .cb-stmt-locating,.doc-pdf-body .cb-stmt-err{margin:14px 16px}
.doc-pdf-body .cb-stmt-img{margin:14px auto;max-width:calc(100% - 32px)}
.doc-pdf-frame{flex:1;display:block;width:100%;min-height:0;border:0;background:var(--surface)}
.del-btn{border:0;background:none;color:var(--muted);cursor:pointer;font-size:13px;padding:2px 5px}
.del-btn:hover{color:var(--bad)}
.cb-td-act{white-space:nowrap;text-align:right}
/* register row actions moved inline into the Description cell (Balance is now the last column) */
/* 🔎 anchors LEFT in a fixed slot; edit/flip/delete (or ✓✕ / 🔒) pushed to the RIGHT edge (next to
   Received) via margin-left:auto — so the 🔎 lines up across posted, unposted and edit rows even
   though posted rows carry only the 🔎. */
.cb-row-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}
.cb-act-edit{margin-left:auto;display:inline-flex;align-items:center;gap:6px}
.cb-td-act2{text-align:right;white-space:nowrap;padding-left:8px}
/* The register above the card layout (owner 2026-11-20: "Not scaling nicely on my screen"). Between the card layout (<=1100px)
   and a wide screen the nine columns could not get narrower than ~927px — the actions cell kept every button of a
   waiting line (search, edit, flip, delete, add) on one line, about 160px on every row, and each cell had 26px of side
   padding — while the card was 819-909px wide, so Balance ran off the right edge. Here the action buttons may wrap
   onto a second line and the cells are tighter, so the register fits the card; the description gets the room. */
@media (min-width:1101px){
  body.vt .cb-register-table th,
  body.vt .cb-register-table td{padding-left:6px;padding-right:6px}
  body.vt .cb-register-table td.cb-td-act2,
  body.vt .cb-register-table th.cb-th-act{white-space:normal;min-width:88px}   /* three icons a line: 🔎 🔒 ＋ */
  body.vt .cb-register-table .cb-row-actions{flex-wrap:wrap;justify-content:flex-end;row-gap:2px;white-space:normal}
  body.vt .cb-register-table .cb-act-edit{margin-left:0;flex-wrap:wrap;justify-content:flex-end}
}
/* edit-mode confirm/cancel — far right of the row (last column) */
.cb-edit-actions{display:inline-flex;align-items:center;gap:6px;justify-content:flex-end;white-space:nowrap}
.cb-src{font-size:12px;font-weight:700;color:var(--muted)}
.cb-src-auto{background:var(--brand);color:var(--hue-paper);border-radius:4px;padding:1px 6px}
.cb-edit-pair{display:flex;gap:6px}
.cb-edit-ok{border:0;background:var(--ok);color:var(--hue-paper);border-radius:6px;padding:3px 9px;cursor:pointer}
.cb-edit-no{border:0;background:none;color:var(--muted);cursor:pointer;padding:3px 6px}
/* floating layer: typeahead + allocation popover */
.cb-float-root .cb-dropdown,.cb-float-root .alloc-pop{background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:0 6px 18px var(--shade-15)}
.cb-dropdown{min-width:320px;max-width:380px;max-height:220px;overflow-y:auto}
.cb-drop-item{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:7px 10px;cursor:pointer;border-bottom:1px solid var(--surface-2);font-size:13px}
.cb-drop-item:last-child{border-bottom:none}
.qi-drop-item.highlighted,.cb-drop-item:hover,.cb-drop-item.highlighted{background:var(--surface-2)}
/* batch: live search rows, inline line edit, per-run skip */
.bt-cust-off{opacity:.6}
.bt-line-click{cursor:pointer}
.bt-line-click:hover{background:var(--hover,color-mix(in srgb, var(--hue-brand) 6%, transparent))}
.bt-line-edit{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:6px 0;border-top:1px solid var(--line)}
.bt-line-edit .form-control{flex:1;min-width:140px}
.bt-edit-num{flex:0 0 90px !important;min-width:70px !important}
.bt-member.bt-excluded{opacity:.55;border-left:3px solid var(--line)}
.cb-drop-muted{color:var(--muted);cursor:default}
.cb-drop-new{color:var(--brand);font-weight:600}
.cb-drop-new:hover{background:var(--surface-2)}
.cb-drop-bal{font-size:12px;color:var(--muted);white-space:nowrap}
.alloc-pop{width:340px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow-y:auto;padding:10px;display:grid;gap:8px}
.alloc-pop-head{font-weight:600;font-size:13px;display:flex;align-items:center;gap:6px}
.alloc-back{border:0;background:none;cursor:pointer;font-size:14px;padding:0 4px;color:var(--brand)}
.alloc-dest-row{display:flex;gap:4px;align-items:center;flex-wrap:wrap}
.alloc-dest-label{font-size:12px;color:var(--muted)}
.alloc-sugg{display:grid;gap:2px}
.alloc-nosugg{font-size:12px;padding:2px}
.alloc-results{max-height:180px;overflow-y:auto}
.alloc-opts{display:flex;gap:14px;flex-wrap:wrap}
.alloc-opts .check-line{margin:0;font-size:12px}
/* the account made in the Allocate popup (A8): number, name, type and VAT one under the other, Save changes / Cancel on
   the right (golden rule 7), every control at the one control height (golden rule 9) */
.alloc-create-form{display:grid;gap:6px}
.alloc-create-lbl{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--muted)}
.alloc-create-lbl .cb-in{width:100%;min-width:0;box-sizing:border-box;height:var(--control-h);min-height:var(--control-h)}
.alloc-create-actions{display:flex;justify-content:flex-end;gap:6px}
.alloc-create-actions .btn{height:var(--control-h);min-height:var(--control-h);box-sizing:border-box;margin:0}
/* toast — above the screen's dialogs (.cb-stmt-overlay, 500) and the bug report button a phone puts beside it (.bug-fab,
   900): a message set while one is open (the co-op review, a statement's page) is seen, never drawn under it
   (2026-10-26). Still under the sign-out warning (.idle-overlay) and an open dropdown (.ss-list). */
/* shared app-wide notice stack (shared/notice.js) — success/failure voice + Gmail-style Undo */
/* above every dialog (the Bank screen's .cb-stmt-overlay is 500) and the bug report button: a message is never drawn under
   a dialog that is open (2026-10-26, the Bank screen's toast; it is this stack now) */
.notice-stack{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:950;
  display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;max-width:92vw}
.app-notice{pointer-events:auto;display:flex;align-items:center;gap:14px;background:var(--surface);
  color:var(--ink);border:1px solid var(--line);border-left:4px solid var(--muted);
  border-radius:var(--radius);padding:10px 16px;font-size:13px;box-shadow:var(--shadow-lg);
  animation:noticeIn .18s ease-out}   /* @keyframes noticeIn lives in vt.css (always loaded) — one copy */
.app-notice.is-ok{border-left-color:var(--ok)}
.app-notice.is-info{border-left-color:var(--info)}
.app-notice.is-warn{border-left-color:var(--warn)}
.app-notice.is-bad{border-left-color:var(--bad)}
.notice-msg{flex:1}
.notice-undo{appearance:none;background:none;border:none;cursor:pointer;font-weight:700;font-size:13px;
  color:var(--brand);padding:0;text-decoration:underline;white-space:nowrap}
.notice-undo:hover{opacity:.8}
.app-notice.is-leaving{opacity:0;transform:translateY(6px);transition:opacity .35s,transform .35s}
/* head row: title left, Auto|Manual top-right (live) + email intake row */
.cb-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.cb-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cb-intake-row{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin:2px 0 4px;flex-wrap:wrap}
.cb-intake-addr{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:2px 8px;color:var(--ink)}
.cb-actions-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
/* card icons: rules + pdf password — bottom-left (per Bank Accounts changes) */
.cb-card-icons{display:flex;gap:4px;flex:0 0 auto;margin-top:1px}
.cb-card-icon{border:0;background:none;cursor:pointer;font-size:12px;opacity:.55;padding:1px 2px;line-height:1}
.cb-card-icon:hover{opacity:1}
.cb-pwd-icon{position:static;opacity:1}
/* live toggle switches (Inc. Ref no / Keep Description) */
.cb-switch{display:inline-flex;align-items:center;gap:7px;font-size:13px;cursor:pointer;color:var(--muted)}
.cb-switch input{position:absolute;opacity:0;width:0;height:0}
.cb-slider{width:32px;height:18px;background:var(--line);border-radius:999px;position:relative;transition:background .15s;flex:0 0 auto}
.cb-slider::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;background:var(--hue-paper);border-radius:50%;transition:left .15s}
.cb-switch input:checked + .cb-slider{background:var(--brand)}
.cb-switch input:checked + .cb-slider::after{left:16px}
/* auto toolbar + anomaly banner + source badges + AI chip */
.cb-auto-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:8px}
.cb-date-filter{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--muted);white-space:nowrap}
.cb-date-filter .cb-date-in{width:auto;font-size:13px}
/* Align every control in the register filter toolbar to ONE height. The add-account row already
   forces this (see .cb-addform ~L761) because .cb-in is 32px while the sleek-date wrapper and
   body.vt selects render taller; the register toolbar was simply missed, so the From/To date
   fields sat taller than the search box (owner 2026-09-19: "date inputs do not align properly").
   Two classes deep so this out-ranks .cb-in / .form-control on both pointer types. */
.cb-auto-toolbar .cb-auto-search,
.cb-auto-toolbar .cb-date-in,
.cb-auto-toolbar .cb-date-in .sleek-date-in{
  height:32px;min-height:32px;padding-top:0;padding-bottom:0;line-height:normal;
  box-sizing:border-box;font-size:13px}
/* The <sleek-date> ELEMENT must match the INPUT height (both 32px, the app-wide control height):
   its calendar button is absolutely positioned at top:50% of the ELEMENT, so if the element stayed
   32px while the input was taller the icon centred too high (owner: "the icons are messed up").
   All three controls (search, both date fields) now share the one height. */
@media (pointer: coarse){
  .cb-auto-toolbar .cb-auto-search,
  .cb-auto-toolbar .cb-date-in,
  .cb-auto-toolbar .cb-date-in .sleek-date-in{height:40px;min-height:40px;font-size:15px}
}
.cb-outby{background:color-mix(in srgb, var(--c-amber-500) 12%, transparent);color:var(--c-amber-700);border-radius:8px;padding:4px 10px;font-size:12px;font-weight:600}
.cb-src-manual{background:var(--surface-2);color:var(--muted);border-radius:4px;padding:1px 6px}
.cb-src-auto{background:var(--c-indigo-l68);color:var(--hue-paper)}
/* ask bar (live: full-width above the title) + answer panel + banner helper */
.cb-ask-wrap{margin-bottom:6px}
.cb-ask-row{display:flex;gap:8px;align-items:center}
.cb-ask-input{flex:1;height:38px;border-radius:10px}
.cb-ask-send{height:38px;width:44px;border:0;border-radius:10px;background:var(--brand);color:var(--hue-paper);font-size:15px;cursor:pointer;flex:0 0 auto}
.cb-ask-send:disabled{opacity:.6}
.cb-ask-answer{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 34px 10px 12px;margin-top:8px}
.cb-ask-close{position:absolute;top:8px;right:8px;border:0;background:none;color:var(--muted);cursor:pointer;font-size:13px}
.cb-ask-text{font-size:13px;line-height:1.5;white-space:pre-wrap}
.cb-ask-chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.cb-ask-help{border:0;border-radius:8px;background:var(--brand);color:var(--hue-paper);font-size:12px;font-weight:600;padding:5px 12px;cursor:pointer;white-space:nowrap}
.cb-dest-tag.cb-dest-g{background:none;color:var(--muted);border:1px solid var(--line)}
.cb-alloc-line{display:inline-flex;align-items:center;gap:6px;margin-top:3px;flex-wrap:wrap}
/* a supplier move's Account box (12 Nov 2026, item 6): its search as wide as a line's account, never wider than the row */
.cb-move-acct{max-width:100%}
.cb-move-acct .ss{flex:1 1 240px;min-width:0;max-width:360px}
.cb-settlement{margin-top:3px;max-width:100%}
.cb-settlement summary{display:list-item;width:fit-content;cursor:pointer;min-height:32px;box-sizing:border-box}
.cb-settlement summary:focus-visible{outline:2px solid var(--brand);outline-offset:3px}
.cb-settlement-body{overflow-x:auto;margin-top:8px}
.cb-settlement-body p{margin:4px 0 8px}
.cb-settlement-table{width:100%;font-size:13px;border-collapse:collapse}
.cb-settlement-table caption{caption-side:top;text-align:left;font-weight:600;margin-bottom:6px;color:var(--ink)}
.cb-table .cb-settlement-table th,.cb-table .cb-settlement-table td{padding:8px 12px;white-space:nowrap;vertical-align:top;border-bottom:1px solid var(--line)}
.cb-settlement-table tfoot{font-weight:600}
/* Reference payments describe the whole voucher; contain their wider table inside the bank row. */
.cb-reference-vouchers{min-width:24rem;max-width:100%;white-space:normal}
.cb-reference-vouchers-label{margin:4px 0}
.cb-reference-voucher summary{max-width:100%;white-space:normal;overflow-wrap:anywhere}
body.vt .cb-register-table tbody tr.cb-line:not(.cb-row-edit) .cb-reference-payments td:first-child{box-shadow:none}
.cb-reference-voucher .cb-settlement-body{overflow-x:visible}
.cb-reference-payment-scroll{overflow-x:auto;max-width:100%}
.cb-reference-scroll-hint{display:none}
.cb-reference-payments{min-width:26rem}
.cb-reference-payments :is(th,td){word-break:normal;overflow-wrap:normal}
.cb-reference-payments :is(th,td):nth-last-child(-n+3),.cb-settlement-table th:last-child,
.cb-settlement-table td:last-child,
body.vt .cb-register-table .cb-line .cb-settlement .cb-source-journal-table :is(th,td):nth-last-child(-n+2){text-align:right;white-space:nowrap}
.cb-reference-payments th:nth-last-child(-n+3){white-space:normal}
@media(max-width:760px){.cb-reference-vouchers{min-width:0;width:min(26rem,calc(100vw - 80px))}.cb-reference-scroll-hint{display:block}}
/* A source voucher shows the whole journal: both monetary columns stay together. */
.cb-source-journal-table{min-width:520px;table-layout:auto}
.cb-source-journal-link{margin:0 6px 6px 0}
body.vt .cb-register-table .cb-line .cb-settlement .cb-source-journal-table td:nth-child(2){white-space:normal}
/* Keep date, bank amount and row actions beside the start of an expanded batch. */
body.vt .cb-register-table > tbody > tr.cb-line:has(.cb-settlement[open]) > td{vertical-align:top}
/* The narrow register's descendant card rules must not turn this nested breakdown
   into a grid or hide its column headings. Limit the reset to settlement details. */
body.vt .cb-register-table .cb-settlement-table thead{display:table-header-group}
body.vt .cb-register-table .cb-settlement-table tbody{display:table-row-group}
body.vt .cb-register-table .cb-line .cb-settlement .cb-settlement-table td{display:table-cell;padding:6px;border-bottom:1px solid var(--line);vertical-align:top}
body.vt .cb-register-table .cb-line .cb-settlement .cb-settlement-table td:nth-child(2){white-space:nowrap;word-break:normal;overflow-wrap:normal}
.cb-ai-chip{border:1px solid var(--c-indigo-l68);color:var(--ink);background:none;border-radius:999px;padding:2px 9px;font-size:12px;cursor:pointer;white-space:nowrap}
.cb-ai-chip:hover{background:color-mix(in srgb, var(--c-indigo-l68) 12%, transparent)}
.cb-ai-tag{background:var(--c-indigo-l68);color:var(--hue-paper);border-radius:4px;padding:0 4px;font-size:12px;font-weight:700}
/* a LEARNED suggestion — from how this company booked the same merchant + branch (the evidence "✓ 38/38"
   in the tag, the reason on hover) — reads as the confident green of "ok", not the AI purple of a guess */
.cb-learned-chip{border-color:var(--ok)}
.cb-rule-chip{border-color:var(--warn);color:var(--warn)}
.cb-learned-chip:hover{background:color-mix(in srgb, var(--ok) 12%, transparent)}
.cb-learned-chip .cb-ai-tag{background:var(--ok)}
/* a line a rule was not applied to (the AI said it is another payee's line, or the AI did not check it): the reason, in "attention" amber */
.cb-rule-note{color:var(--warn);font-size:12px;line-height:1.35}
/* a payment between two of the company's own accounts: the clearing account it is booked through ("via 9850"; the API's
   transfer_routes) and, when one needs the user (bank_transfer_checks), what is wrong and how to put it right */
.cb-via-tag{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:4px;padding:0 4px;white-space:nowrap}
/* a co-op line that moved money to an account at the co-op the books do not keep (the API's moved_to), until posted */
.cb-moved-note,.cb-transfer-note{color:var(--warn);font-size:12px;line-height:1.35;margin-top:2px}
.cb-show-transfers{color:var(--warn)}

/* ── bank-import preview (the live /bank-import panel, in-page) ─────────── */
.cb-prev-controls{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.cb-prev-controls select{max-width:340px}
.cb-stagelist{margin-top:10px;padding:10px 12px;border:1px dashed var(--line);border-radius:8px;
  color:var(--muted);font-size:12.5px;display:grid;gap:3px}
.cb-stage-run{color:var(--ink);font-weight:600}
.cb-prev-head{margin-top:10px;padding:9px 12px;border:1px solid var(--line);
  border-radius:8px;background:var(--surface-2, var(--surface))}
.cb-prev-head-main{display:flex;gap:10px;flex-wrap:wrap;align-items:baseline}
.cb-prev-head-sub{color:var(--muted);font-size:12px;margin-top:2px}
.cb-prev-acct{color:var(--ink);font-weight:600}
.cb-prev-new{background:var(--c-green-600);color:var(--hue-paper);border-radius:4px;padding:0 5px;font-size:12px;font-weight:700}
.cb-prev-warn{color:var(--c-amber-700)}
.cb-prev-counts{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:10px 0 4px;font-size:12.5px}
.cb-prev-counts .cb-w-ref{max-width:150px}
.cb-ai-accept{border-color:var(--c-indigo-l68);color:var(--c-indigo-l68)}
.cb-prev-tocol{font-size:12px;color:var(--muted);white-space:nowrap}
.cb-prev-foot{display:flex;gap:8px;align-items:center;margin-top:10px}
.cb-stage-item{padding-left:4px}
.cb-stage-done{color:var(--c-green-600)}
.cb-stage-current{color:var(--ink);font-weight:600}
.cb-stage-cancel{margin-left:10px}
/* several imports at once: a heading + one boxed row per job so no drop looks cancelled */
.cb-stage-multi{color:var(--ink);font-weight:700;font-size:12.5px}
.cb-stage-job{display:grid;gap:3px}
.cb-stage-job-multi{padding:7px 9px;border:1px solid var(--line);border-radius:7px;
  background:var(--surface-2, var(--surface))}
.cb-stage-job-multi + .cb-stage-job-multi{margin-top:2px}
.cb-stage-label{font-weight:700;color:var(--ink);max-width:240px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:bottom}
.cb-imports-list{margin-top:10px;border:1px solid var(--line);border-radius:8px;padding:8px 10px}
.cb-imports-head{display:flex;align-items:center;margin-bottom:4px}
.cb-import-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:5px 0;
  border-top:1px dashed var(--line);font-size:12.5px}
.cb-import-row .cb-w-ref{max-width:120px}
/* a failed extraction is surfaced loudly on its row — never a silent "0 transactions" */
.cb-import-failed{background:var(--warn-bg,color-mix(in srgb, var(--c-amber-700) 8%, transparent));border-radius:6px;padding-left:6px;padding-right:6px}
.cb-import-err{color:var(--warn);font-weight:600}
.cb-ai-form{margin-top:10px;padding:10px 12px;border:1px solid var(--line);border-radius:8px}
.cb-ai-form .cb-row{display:flex;gap:8px;flex-wrap:wrap}
.cb-ai-form .cb-in{max-width:240px}

/* ── sleek-date — smart date input (live sleek-date.js parity) ─────────────── */
sleek-date{position:relative;display:block;min-width:0}
/* The calendar button centres on the ELEMENT (top:50%), so the element MUST be the same height as
   its input everywhere, or the icon floats. `.cb-in` pins the <sleek-date> element to a fixed
   32px, but the input can be taller (touch min-height, a filter row), so let the element follow
   the input height instead (owner 2026-09-19: "the calendar icons are still out"). The input is a
   block so the element wraps it exactly with no inline descender gap. */
sleek-date.cb-in,sleek-date.cb-date-in,sleek-date.cb-wiz-opening-date,sleek-date.cb-w-date{
  height:auto;min-height:0;padding:0}   /* padding belongs on the INPUT, not the wrapper — otherwise
  the element's 8px side padding insets the input but not the absolute calendar icon, so the icon
  rolls over the input's right border (owner 2026-09-19: "icon is rolling over the right line") */
sleek-date .sleek-date-in{width:100%;padding-right:26px;box-sizing:border-box;display:block}
.sleek-date-cal-btn{position:absolute;right:3px;top:50%;transform:translateY(-50%);background:none;
  border:none;cursor:pointer;color:var(--muted);padding:2px;border-radius:4px;
  display:flex;align-items:center;justify-content:center;z-index:1}
.sleek-cal{position:absolute;top:100%;left:0;z-index:400;background:var(--surface);
  border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px var(--shade-18);
  padding:8px;width:240px;margin-top:4px}
.sleek-cal-hdr{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;gap:4px}
/* the month and the year as lists between ‹ and › (Lloyd via Callan, 4 Dec 2026: "change all the date pickers to easily
   go to years and months"). One class deeper than vt.css's body.vt select, which makes every list 100% wide, 32px tall and
   padded 10px; the arrow is the browser's own. */
.sleek-cal .sleek-cal-month,.sleek-cal .sleek-cal-year{height:28px;min-height:28px;box-sizing:border-box;width:auto;
  padding:0 2px 0 6px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);
  font-size:13px;font-weight:600;cursor:pointer}
.sleek-cal .sleek-cal-month{flex:1 1 auto;min-width:0}
.sleek-cal .sleek-cal-year{flex:0 0 auto}
/* ...on a Settings tab too (Forex's rate date): ux.css pins every list in a .set-stack to the control height and draws the
   app's own arrow with 28px kept for it (body.vt .set-stack select, two classes and two elements: above the rule here) */
body.vt .set-stack .sleek-cal .sleek-cal-month,body.vt .set-stack .sleek-cal .sleek-cal-year{height:28px;padding-right:2px;
  appearance:auto;-webkit-appearance:auto;background-image:none}
/* ...and a period's "Whole month" under its From calendar, on the right (src/shared/sleekdate.js, data-date-range) */
.sleek-cal-foot{display:flex;justify-content:flex-end;margin-top:6px;padding-top:6px;border-top:1px solid var(--line)}
.sleek-cal-nav{background:none;border:none;cursor:pointer;font-size:19px;color:var(--muted);
  padding:0 6px;line-height:1;border-radius:4px}
.sleek-cal-nav:hover,.sleek-date-cal-btn:hover{color:var(--hue-brand);background:var(--surface-2)}
.sleek-cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px}
.sleek-cal-dh{font-size:12px;color:var(--muted);text-align:center;padding:2px 0;font-weight:600}
.sleek-cal-day{font-size:12px;text-align:center;padding:5px 0;border-radius:4px;cursor:pointer;color:var(--ink)}
.sleek-cal-day:hover{background:var(--surface-2)}
.sleek-cal-blank{cursor:default}
.sleek-cal-blank:hover{background:none}
.sleek-cal-today{font-weight:700;color:var(--hue-brand)}
.sleek-cal-sel{background:var(--hue-brand) !important;color:var(--c-cyan-l9) !important;font-weight:700}
.sleek-cal-out{color:var(--muted);opacity:.35;cursor:not-allowed}
.sleek-cal-out:hover{background:none}
.sleek-date-error{border-color:var(--bad) !important}

/* ── coverage-audit parity additions (fix-all pass) ───────────────────────── */
/* control-account tags on popover rows (live [D]/[C]/[S]/[V]) */
.cb-ctl-tag{display:inline-block;min-width:14px;text-align:center;border-radius:3px;padding:0 3px;font-size:12px;font-weight:700;color:var(--hue-paper);vertical-align:1px}
.cb-ctl-d{background:var(--c-green-700)}
.cb-ctl-c{background:var(--c-red-700)}
.cb-ctl-s{background:var(--c-gray-500)}
.cb-ctl-v{background:var(--c-amber-700)}
/* archived contacts: dimmed with a Disabled tag but selectable (live) */
.cb-contact-off{opacity:.55;border-left:2px solid var(--bad)}
.cb-off-tag{font-size:12px;font-weight:700;color:var(--bad);border:1px solid var(--bad);border-radius:3px;padding:0 3px;vertical-align:1px}
/* preview match-tier badges (live colour-coded provenance) */
.cb-match-badge{border-radius:4px;padding:0 4px;font-size:12px;font-weight:700;color:var(--hue-paper);background:var(--c-gray-500);white-space:nowrap}
.cb-badge-contact{background:var(--c-green-700)}
.cb-badge-exact{background:var(--c-cyan-700)}
.cb-badge-starts_with{background:var(--c-sky-700)}
.cb-badge-fuzzy{background:var(--c-violet-600)}
.cb-badge-manual{background:var(--c-gray-500)}
.cb-badge-ai{background:var(--c-indigo-l68)}
/* per-row source-file badge when several imports are loaded (live) */
.cb-file-badge{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:3px;padding:0 3px;white-space:nowrap}
/* preview D/P totals footer (live table footers) */
.cb-prev-total td{border-top:2px solid var(--line);padding-top:6px}
/* drag-drop upload zone (live drop highlight) */
.cb-dropzone{border:1px dashed transparent;border-radius:8px;transition:border-color .15s, background .15s}
.cb-drag-over{border-color:var(--hue-brand);background:var(--surface-2)}
/* stalled-job retry panel (live "Retry Import" after 3 quiet minutes) */
.cb-stage-stall{margin-top:8px;padding:8px;border:1px solid var(--bad);border-radius:6px;font-size:12px;display:flex;align-items:center;gap:8px;color:var(--ink)}

/* ── number/table utilities on tenant (.page) screens ─────────────────────────
   The .mono/.text-right/.fw-700 helpers were scoped to .cb-page only; the tenant
   books screens (journals, contacts, documents) render inside .page, so scope the
   same helpers to any .cb-table cell — right-aligns money columns everywhere. */
.cb-table .mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums}
.cb-table td.text-right{text-align:right}
.cb-table .fw-700{font-weight:700}
.cb-table .muted{color:var(--muted)}

/* ── Documents / Invoicing (§4) ───────────────────────────────────────────────*/
.doc-table .doc-row{cursor:pointer}
.doc-table .doc-row:hover{background:var(--surface-2)}
.doc-badge{display:inline-block;min-width:34px;text-align:center;border-radius:4px;padding:1px 5px;font-size:12px;font-weight:700;color:var(--hue-paper);background:var(--c-gray-500);letter-spacing:.02em}
.doc-inv{background:var(--c-cyan-700)}.doc-quo{background:var(--c-gray-500)}.doc-ord{background:var(--c-sky-700)}
.doc-crn{background:var(--c-amber-700)}.doc-pord{background:var(--c-violet-600)}.doc-grv{background:var(--c-green-700)}.doc-rts{background:var(--c-red-700)}
.doc-status{display:inline-block;border-radius:999px;padding:1px 9px;font-size:12px;font-weight:700;text-transform:capitalize;border:1px solid var(--line);color:var(--muted)}
.doc-draft{color:var(--c-amber-700);border-color:var(--c-amber-700)}
.doc-posted,.doc-issued{color:var(--c-green-700);border-color:var(--c-green-700)}
/* +New — a menu anchored to the button (owner 2026-08-24: list from the button, not on the page) */
.doc-new-wrap{position:relative;display:inline-flex}
.doc-new-scrim{position:fixed;inset:0;z-index:59}
.doc-new-drop{position:absolute;top:calc(100% + 6px);right:0;z-index:60;min-width:210px;
  background:var(--surface);border:1px solid var(--line);border-radius:8px;
  box-shadow:0 10px 28px var(--shade-16);padding:6px;display:flex;flex-direction:column;gap:2px}
.doc-new-item{display:block;width:100%;text-align:left;padding:8px 12px;border:0;background:none;
  color:var(--ink);font-size:.85rem;font-weight:500;border-radius:6px;cursor:pointer;white-space:nowrap}
.doc-new-item:hover{background:var(--brand-faint);color:var(--brand)}
.doc-filter{max-width:180px}
/* Mobile: the documents list table becomes a card per row (owner 2026-11-10: "cards not grid") —
   Number + type and Status on the first line, Customer + Total on the second, date under, actions
   right-aligned at the bottom. No more horizontal scroll. */
@media (max-width:767px){
  /* Strip the table-wrap frame on mobile (its border sat just outside each card's border, reading as
     a faint double line — owner 2026-11-10); only the individual cards carry a border. */
  body.vt .tbl-wrap:has(.doc-list){overflow:visible;border:0;background:transparent;border-radius:0;padding:0}
  body.vt .doc-list,body.vt .doc-list tbody{display:block}
  body.vt .doc-list thead{display:none}
  body.vt .doc-list tr{display:grid;grid-template-columns:1fr auto;align-items:start;column-gap:10px;row-gap:3px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:8px;background:var(--surface)}
  body.vt .doc-list td{display:block;border:0;padding:0}
  body.vt .doc-list td:nth-child(1){grid-column:1;grid-row:1;font-weight:700}
  body.vt .doc-list td:nth-child(4){grid-column:2;grid-row:1;justify-self:end}
  body.vt .doc-list td:nth-child(3){grid-column:1;grid-row:2}
  body.vt .doc-list td:nth-child(5){grid-column:2;grid-row:2;justify-self:end;font-weight:700}
  body.vt .doc-list td:nth-child(2){grid-column:1;grid-row:3;font-size:12px;color:var(--muted)}
  body.vt .doc-list td:nth-child(6){grid-column:2;grid-row:3;display:flex;flex-wrap:nowrap;gap:6px;justify-content:flex-end;align-self:end}   /* on the date's line, not a row of their own (2026-11-22: "Card view is dismal") */
  body.vt .doc-list .doc-type-sub{display:block;font-weight:500}
  /* the list-total tfoot is redundant on mobile — each card already shows its amount */
  body.vt .doc-list tfoot{display:none}
  /* Clean whole-card hover (owner 2026-11-10: "hover is weird") — tint the whole card and keep cells
     transparent so there's no per-cell grey banding. */
  body.vt .doc-list tr.clickable:hover{background:var(--surface-2);border-color:var(--brand)}
  /* Force every cell transparent (the framework's .list tr:hover td paints a darker band otherwise)
     so only the card tints as one piece — owner 2026-11-10 "ugly background on the labels on hover". */
  body.vt .doc-list tr.clickable td,
  body.vt .doc-list tr.clickable:hover td{background:transparent !important}
}
/* Icon-only row actions (Clone / Repeat) — square, centred, glyph not text (owner 2026-11-10). */
.doc-act-ico{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px}
.doc-act-ico svg{display:block}
@media (max-width:767px){
  /* Filter pills size to their content and wrap left-aligned — ux.css stretches them (flex:1 1 auto)
     so the last row's two pills balloon to fill, looking uneven (owner 2026-11-10). */
  body.vt .doc-toolbar > .segs{justify-content:flex-start;gap:6px}
  body.vt .doc-toolbar > .segs > .seg{flex:0 0 auto;justify-content:center}
}
.doc-ed-head{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.doc-ed-back{margin-bottom:2px}
.doc-ed-back .doc-back{padding-left:0}
.doc-ed-form{display:flex;flex-direction:column;gap:12px}
.doc-customer{min-width:240px;flex:1 1 240px;max-width:360px}
.doc-addline{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:10px;border:1px dashed var(--line);border-radius:8px;background:var(--surface-2)}
.doc-addline .doc-desc{flex:2 1 200px;min-width:160px}
.doc-addline .doc-qty,.doc-addline .doc-price,.doc-addline .doc-disc{flex:0 0 88px;width:88px}
.doc-addline .doc-vat{flex:0 0 100px;width:100px}
.doc-addline .doc-gl{flex:1 1 200px;min-width:160px}
.doc-addbtn{flex:0 0 auto}
.doc-lines{margin-top:2px}
.doc-totals{display:flex;flex-direction:column;gap:4px;align-items:flex-end;font-size:13px;padding-top:4px}
.doc-totals>div{display:flex;gap:24px;min-width:220px;justify-content:space-between}
.doc-totals>div>span:first-child{color:var(--muted)}
.doc-total-grand{font-weight:700;font-size:15px;border-top:1px solid var(--line);padding-top:6px;margin-top:2px;color:var(--ink)}
.doc-ed-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:12px}
.doc-posted-note{color:var(--ok);font-weight:600;font-size:13px}
/* inline-editable line grid (v2 parity) */
.doc-lines th{white-space:nowrap}
.doc-lines td{vertical-align:top;padding:4px 6px}
.doc-cell-desc,.doc-cell-num,.doc-cell-sel,.doc-cell-gl{padding:4px 6px;font-size:13px;height:auto}
.doc-cell-item{min-width:220px}
.doc-cell-desc{width:100%}
.doc-cell-item .doc-cell-sel{margin-bottom:3px;width:100%}
.doc-cell-num{width:78px;text-align:right}
.doc-cell-sel{min-width:78px}
.doc-cell-gl{min-width:150px;max-width:220px}
.doc-addrow{margin:8px 0 2px}
.doc-srcref{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:1px 9px}
/* print (Print button = browser save-as-PDF; reuses the on-screen doc) */
.doc-print-head{display:none}
.doc-print-co{font-size:20px;font-weight:700}
.doc-print-meta{font-size:13px;color:var(--c-grey-333);margin-top:2px}
@media print{
  .drawer,.app-bar,.scrim,.bottom-nav,.tabbar,.doc-noprint,.rp-noprint{display:none !important}
  .main{margin:0 !important}.content{padding:0 !important}
  .doc-print-head{display:block;margin-bottom:12px}
  .rp-printhead{display:block;font-size:18px;font-weight:700;margin-bottom:12px;color:var(--c-black)}
  .card{border:none !important;box-shadow:none !important}
  .doc-lines td input,.doc-lines td select{border:none !important;padding:2px !important;-webkit-appearance:none;appearance:none;background:none}
}

/* ── Reports (§5) ─────────────────────────────────────────────────────────────*/
.num-neg{color:var(--bad)}
.rp-group{margin-bottom:18px}
.rp-group-lbl{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700;margin:0 0 8px}
.rp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.rp-card{border:1px solid var(--line);border-radius:10px;padding:14px;background:var(--surface);cursor:pointer;transition:border-color .12s,box-shadow .12s}
.rp-card:hover{border-color:var(--hue-brand);box-shadow:0 1px 8px var(--shade-06)}
.rp-card-name{font-weight:700;font-size:15px;color:var(--ink);display:flex;align-items:center;justify-content:space-between;gap:6px}
.rp-card-desc{font-size:12.5px;color:var(--muted);margin-top:5px;line-height:1.35}
.rp-soon{opacity:.6;cursor:default}
.rp-soon:hover{border-color:var(--line);box-shadow:none}
.rp-soon-tag{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:0 7px}
.rp-filters{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:4px 0 14px}
.rp-flabel{font-size:12px;color:var(--muted);font-weight:600}
.rp-search{max-width:280px}
.rp-acct{min-width:280px;max-width:420px}
/* a report's tabs stand 14px off the table they switch (Callan, 2 Dec 2026: "add padding plesae" — at 0 the table's top
   edge lay on the tabs' 2px line, one 3px line: the Bank Reconciliation's Matched / Bank only / Ledger only and the VAT
   report's All / Documents / Entries); 14px as the VAT201 Return / By Tax Code switch (25 Nov, "fix the padding there") */
.cb-tabs.rp-party{margin-bottom:14px}
.rp-table td,.rp-table th{padding:6px 10px}
.rp-table .rp-section td{background:var(--surface-2);font-weight:700;text-transform:uppercase;font-size:12px;letter-spacing:.03em;color:var(--muted);padding-top:9px}
.rp-table .rp-subtotal td{border-top:1px solid var(--line)}
.rp-table .rp-total td{border-top:2px solid var(--ink);font-size:14px}
.rp-note{margin-top:10px;font-size:13px;font-weight:600}
.rp-ok{color:var(--ok)}
.rp-bad{color:var(--bad)}
.rp-gl-head{font-size:13px;font-weight:600;color:var(--ink);margin-bottom:8px}
.rp-actions{display:flex;gap:8px;align-items:center}
.rp-printhead{display:none}
.rp-recon-summary{max-width:420px;margin:6px 0 18px;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.rp-recon-summary>div{display:flex;justify-content:space-between;gap:16px;padding:10px 14px;font-size:14px;border-bottom:1px solid var(--line)}
.rp-recon-summary>div:last-child{border-bottom:none}
.rp-recon-summary span:first-child{color:var(--muted)}
.rp-recon-diff{font-weight:700;background:var(--surface-2)}
.rp-recon-diff.rp-ok span:last-child{color:var(--ok)}
.rp-recon-diff.rp-bad span:last-child{color:var(--bad)}

/* ── Dashboard (§6) ───────────────────────────────────────────────────────────*/
.dash{display:flex;flex-direction:column;gap:16px}
.dash-ai{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dash-ai-input{flex:1 1 320px;min-width:200px}
.dash-ai-wrap{display:flex;flex-direction:column;gap:10px;margin-bottom:4px}
.dash-ai-out{display:flex;flex-direction:column;gap:8px}
.dash-ai-bar{display:flex;align-items:center;justify-content:space-between;gap:8px}
.dash-ai-count,.dash-ai-note{font-size:12px;color:var(--muted)}
.dash-ai-clear{background:transparent;border:none;color:var(--muted);font-size:12px;cursor:pointer;padding:2px 4px;text-decoration:underline}
.dash-ai-clear:hover{color:var(--bad)}
.dash-ai-scroll{display:flex;flex-direction:column;gap:8px;max-height:340px;overflow-y:auto;padding-right:4px}
.dash-ai-msg{display:flex;flex-direction:column;gap:6px;max-width:100%}
.dash-ai-user{align-items:flex-end}
.dash-ai-assistant,.dash-ai-error{align-items:flex-start}
.dash-ai-bubble{padding:8px 12px;border-radius:12px;font-size:14px;line-height:1.45;white-space:pre-wrap;max-width:85%;word-wrap:break-word}
.dash-ai-user .dash-ai-bubble{background:var(--hue-brand);color:var(--c-cyan-l9b);border-bottom-right-radius:4px}
.dash-ai-assistant .dash-ai-bubble{background:color-mix(in srgb, var(--c-grey-808080) 15%, transparent);color:var(--ink);border-bottom-left-radius:4px}
.dash-ai-error .dash-ai-bubble{background:color-mix(in srgb, var(--c-red-700) 12%, transparent);color:var(--bad)}
.dash-ai-typing{letter-spacing:3px;opacity:.6}
.dash-ai-sug{display:flex;flex-wrap:wrap;gap:6px}
.dash-ai-chip{background:transparent;border:1px solid var(--line);color:var(--ink);border-radius:999px;padding:5px 12px;font-size:13px;cursor:pointer}
.dash-ai-chip:hover{border-color:var(--hue-brand);color:var(--hue-brand)}
.dash-ai-card{max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:10px;padding:6px 8px;background:var(--surface)}
.dash-ai-card table{width:100%}
.dash-ai-card-h{font-weight:600;font-size:14px;padding:2px 4px 6px}
.dash-ai-aging{display:flex;flex-wrap:wrap;gap:10px;font-size:13px;padding:2px 4px}
.dash-ai-aging strong{margin-left:auto}
.dash-ai-empty{color:var(--muted);font-size:13px;font-style:italic}
.cb-recon-ai{border-left:3px solid var(--hue-brand);background:color-mix(in srgb, var(--c-grey-808080) 8%, transparent);padding:8px 12px;border-radius:6px;font-size:13px;line-height:1.45;margin:8px 0;white-space:pre-wrap}
.dash-attention{display:flex;align-items:center;gap:12px;background:var(--warn-bg,color-mix(in srgb, var(--c-amber-700) 10%, transparent));border:1px solid var(--warn);border-radius:10px;padding:10px 14px;cursor:pointer;font-size:14px;color:var(--ink)}
.dash-att-badge{background:var(--warn);color:var(--hue-paper);font-weight:700;border-radius:999px;padding:2px 10px;font-size:13px}
.dash-att-go{margin-left:auto;color:var(--warn);font-weight:600}
.dash-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.dash-kpi{border:1px solid var(--line);border-radius:10px;padding:12px 14px;background:var(--surface)}
.dash-kpi-lbl{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700}
.dash-kpi-val{font-size:22px;font-weight:700;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums;color:var(--ink);margin-top:4px}
.dash-kpi-sub{font-size:12px;color:var(--muted);margin-top:2px}
.dash-panels{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px}
.dash-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.dash-panel-title{font-size:15px;font-weight:700;color:var(--ink);margin:0}
.dash-pnl{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.dash-pnl-title{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700;margin-bottom:6px}
.dash-pnl-row{display:flex;justify-content:space-between;font-size:13px;padding:3px 0}
.dash-pnl-row>span:first-child{color:var(--muted)}
.dash-pnl-net{border-top:1px solid var(--line);margin-top:4px;padding-top:6px;font-weight:700}
.dash-pnl-net>span:first-child{color:var(--ink)}
/* P&L this-year-vs-last-year: the figure + a small delta chip on one line (dashboard redesign 2026-09-19) */
.dash-pnl-fig{display:inline-flex;align-items:baseline;gap:8px;white-space:nowrap}
.dash-delta{font-size:12px;font-weight:700;letter-spacing:.01em}
.dash-delta.good{color:var(--good,var(--c-green-600))}
.dash-delta.bad{color:var(--bad)}
.dash-delta.flat{color:var(--muted)}
/* Turnover + VAT quick-read bars (built in JS, widths stamped imperatively) */
.dash-bars-title{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700;margin:14px 0 6px}
.dash-bars{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.dash-bar-row{display:grid;grid-template-columns:minmax(90px,34%) 1fr auto;align-items:center;gap:10px;font-size:13px}
.dash-bar-label{color:var(--muted)}
.dash-bar-track{position:relative;height:12px;background:var(--line);border-radius:6px;overflow:hidden}
.dash-bar-fill{display:block;height:100%;width:0;border-radius:6px;background:var(--brand)}
.dash-bar-fill.bar-muted{background:var(--muted)}
.dash-bar-fill.bar-warn{background:var(--warn)}
.dash-bar-fill.neg{background:var(--bad)}
.dash-bar-val{font-weight:700;color:var(--ink);text-align:right}
/* Setup guide — Xero-style onboarding checklist (dashboard) */
.setup-guide{margin-bottom:16px}
.setup-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.setup-count{color:var(--muted);font-size:13px}
.setup-head .setup-hide{margin-left:auto}
.setup-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin-top:12px}
.setup-card{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:12px 14px;text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:6px}
.setup-card:hover{border-color:var(--brand)}
.setup-card.done{opacity:.62}
.setup-card-title{font-weight:600;color:var(--brand);display:flex;align-items:center;gap:6px}
.setup-card-desc{color:var(--muted);font-size:12.5px;line-height:1.45;flex:1}
.setup-meter{height:5px;border-radius:3px;background:var(--line);overflow:hidden}
.setup-meter>i{display:block;height:100%;background:var(--brand);border-radius:3px}
.setup-card.done .setup-meter>i{background:var(--ok)}
.setup-pct{font-size:12px;color:var(--muted)}
.setup-showbtn-host{display:inline-flex}
/* Document scan (OCR) — dropzone + dashboard chooser */
.scan-card{display:flex;flex-direction:column;gap:8px}
.dropzone{border:2px dashed var(--line);border-radius:12px;padding:22px 16px;text-align:center;color:var(--muted);cursor:pointer}
.dropzone.over{border-color:var(--brand);color:var(--brand);background:var(--surface-2)}
.dropzone-title{font-weight:600;color:var(--ink);margin-bottom:4px}
.scan-status,.dropzone-hint{font-size:12.5px}
.scan-result{font-size:12.5px;color:var(--ok);background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:8px 10px}
.scan-note{font-size:12px;margin-top:8px}
.scan-segs{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0 12px}
.scan-seg{font-family:inherit;font-size:12.5px;font-weight:650;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:999px;padding:5px 12px;cursor:pointer}
.scan-seg:hover{border-color:var(--brand)}
.scan-seg.on{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.scan-chooser{margin-top:16px}
/* Bill-screen dropzone: give it a little breathing room under the page head */
.doc-page .scan-card{margin-bottom:14px}
/* Column chart (Sales by month) — imperative div bars, heights stamped after build */
.chart-scroll{overflow-x:auto;overflow-y:hidden;padding-bottom:2px}
.chart-col-plot{display:flex;align-items:flex-end;gap:8px;min-width:min-content;padding:6px 2px 0}
.chart-col-item{flex:1 1 0;min-width:64px;display:flex;flex-direction:column;gap:4px}
.chart-col-track{height:150px;display:flex;flex-direction:column;justify-content:flex-end;gap:3px}
.chart-col-value{flex:0 0 auto;font-size:12px;line-height:1.1;color:var(--muted);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chart-col-bar{flex:0 0 auto;min-height:3px;border-radius:5px 5px 2px 2px;background:var(--brand)}
.chart-col-bar-zero{background:var(--line)}
.chart-col-bar[role="button"]{cursor:pointer}
.chart-col-bar[role="button"]:hover{filter:brightness(1.12)}
.chart-col-label{font-size:12px;color:var(--muted);text-align:center;white-space:nowrap}
.chart-empty{color:var(--muted);font-size:12px;padding:10px 0}
/* Needs-Attention inline triage (Wave B) */
.dash-tri{border-color:var(--warn)}
.dash-tri-count{display:inline-block;background:var(--warn);color:var(--hue-paper);font-size:13px;font-weight:700;border-radius:999px;padding:1px 9px;margin-left:6px;vertical-align:1px}
.dash-tri-list{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.dash-tri-card{border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:var(--surface);transition:opacity .12s}
.dash-tri-card.is-busy{opacity:.5;pointer-events:none}
.dash-tri-top{display:flex;justify-content:space-between;gap:12px;align-items:baseline}
.dash-tri-meta{font-size:12px;color:var(--muted)}
.dash-tri-amt{font-weight:700;font-size:14px}
.dash-tri-desc{font-size:14px;color:var(--ink);margin:3px 0 8px;font-weight:600}
.dash-tri-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.dash-tri-gl{min-width:210px;flex:1 1 210px;max-width:360px}
.dash-tri-btn{padding:5px 12px;font-size:13px}
.dash-tri-btn.active{border-color:var(--hue-brand);color:var(--hue-brand)}
.dash-tri-con{margin-top:8px}
.dash-tri-con select{min-width:260px;max-width:400px}
.dash-tri-more{font-size:12.5px;margin-top:10px}
.dash-tri-more .btn-link{padding:0;font-size:12.5px;vertical-align:baseline}

/* ── Dashboard "Bank inbox" — cross-account unallocated-lines worklist (seamless flow) ── */
.bank-inbox-groups{display:flex;flex-direction:column;gap:14px;margin-top:8px}
.bank-inbox-group{display:flex;flex-direction:column;gap:8px}
.bank-inbox-grp-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.bank-inbox-acct{font-weight:700;font-size:14px;color:var(--ink)}
.bank-inbox-grp-head .dash-tri-count{margin-left:0}
/* One shared FIXED column layout across every account's table so the columns line up strictly across
   accounts (owner 2026-09-17). Long ref/description WRAP to a second line instead of widening a column. */
/* The fixed columns leave the description the rest: they add to 624px, so on the dashboard's ~820px card the description
   keeps ~200px (2 Dec 2026: they added to 770px and squeezed it to one letter a line — "why does this look terrible").
   Narrower than that, the Source badge column goes (the ✎ edit still shows it) before the description gives way. */
.bank-inbox-groups{container-type:inline-size}
.bank-inbox-table{table-layout:fixed;width:100%}
.bank-inbox-table col.bic-sel{width:36px}
.bank-inbox-table col.bic-date{width:88px}
/* while a row is edited (✎): its date box shows the whole date beside its calendar icon — the register's column grows
   the same way while it edits (its table is not fixed) */
.bank-inbox-table:has(tr.bank-inbox-edit-row) col.bic-date{width:144px}
.bank-inbox-table col.bic-ref{width:64px}
.bank-inbox-table col.bic-act{width:96px}
.bank-inbox-table col.bic-amt{width:100px}
.bank-inbox-table col.bic-src{width:72px}
.bank-inbox-table col.bic-bal{width:104px}
@container (max-width: 760px){
  .bank-inbox-table col.bic-src{width:0}
  .bank-inbox-table th:nth-child(7),.bank-inbox-table td.cb-td-source{padding:0;font-size:0;border:0;overflow:hidden}
}
.bank-inbox-table.cb-table td.cb-td-ref,.bank-inbox-table.cb-table td.cb-td-desc{white-space:normal;word-break:break-word;overflow-wrap:anywhere}
/* 🔎 slot is always reserved (hidden when a line has no statement image) so ✎ ⇄ ✕ land at the SAME
   x on every row and every account — one continuous action column (owner 2026-09-17). */
.bank-inbox-table .cb-locate-off{visibility:hidden;pointer-events:none}
/* the Auto/Manual source badge never wraps mid-word (owner 2026-09-17) */
.bank-inbox-table .cb-src{display:inline-block;white-space:nowrap}
.bank-inbox-flag{display:inline-flex;align-items:center;gap:3px;font-size:12px;font-weight:700;
  color:var(--warn);background:color-mix(in srgb, var(--c-amber-700) 10%, transparent);border-radius:6px;padding:1px 6px}
.bank-inbox-more{margin-top:2px}
.bank-inbox-ok{margin:0 0 8px}
/* account selector strip — mirrors the cashbook Bank Accounts cards; one account shown at a time */
.bank-inbox-cards{margin:2px 0 12px}
.bank-inbox-card{min-width:130px;max-width:200px;gap:4px}
.bank-inbox-card .cb-card-badge{background:var(--warn)}
.bank-inbox-card.active .cb-card-badge{background:var(--brand)}
/* allocated-row success — v2 bank_import parity (green faint + ✓, hold, THEN the row drops).
   fixed green matches the sibling .dash-tri-done / .alloc-pill-rule success styling below. */
.bank-inbox-ok-row{border-color:var(--c-teal-l30);background:color-mix(in srgb, var(--c-teal-l30) 10%, transparent);animation:bank-inbox-ok .5s ease-out}
@keyframes bank-inbox-ok{0%{background:color-mix(in srgb, var(--c-teal-l30) 30%, transparent)}100%{background:color-mix(in srgb, var(--c-teal-l30) 10%, transparent)}}
.bank-inbox-ok-tick{display:inline-flex;align-items:center;gap:4px;font-weight:800;font-size:12.5px;color:var(--c-teal-l30)}

/* ── Settings (§7) ────────────────────────────────────────────────────────────*/
.set-tabs{margin-bottom:14px}
.set-card{max-width:780px}
/* Settings ▸ API Keys & MCP (owner 2026-10-05 "fix the margins"): its plain .card sections lost their
   inset to ux.css's card reset (body.vt .card{padding:0}), so headings and fields sat on the border.
   Margins only — give those cards their inset back and a gap below the section note. No other change. */
body.vt .set-apikeys > .card,
body.vt .set-apikeys > .company-mcp-keys > .card,
body.vt .set-key-pair > .set-pair-col > .card{padding:var(--ux-card-pad-form)}
body.vt .set-apikeys > .set-section + .card,
body.vt .set-apikeys > .company-mcp-keys > .set-section + .card,
body.vt .set-key-pair > .set-pair-col > .set-section + .card{margin-top:12px}
/* AI provider key | Online payments (Callan, 17 Nov 2026): each column's card fills the column, and the two cards end
   level (a column is a flex column; the card grows to the taller one) */
.set-key-pair{margin-top:24px}
.set-key-pair > .set-pair-col{display:flex;flex-direction:column;min-width:0}
.set-key-pair > .set-pair-col > .set-section{margin:0}
.set-key-pair > .set-pair-col > .card{max-width:none;flex:1 1 auto;display:flex;flex-direction:column}
/* both cards' buttons on one line: the form fills its card and its buttons go to the card's bottom */
.set-key-pair > .set-pair-col > .card > .set-form{flex:1 1 auto}
.set-key-pair > .set-pair-col > .card > .set-form > .set-actions{margin-top:auto}
/* The company-MCP status line (loading / load error) takes no room while it has nothing to say. */
.company-mcp-keys > [data-company-mcp-status]:empty{display:none}
.company-mcp-keys > .tbl-wrap{margin-top:12px}
.set-form{display:flex;flex-direction:column;gap:14px}
.set-row{display:flex;flex-direction:column;gap:4px}
.set-lbl{font-size:12px;font-weight:600;color:var(--muted)}
.set-grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.set-toggles{display:flex;flex-direction:column;gap:10px;padding-top:2px}
.set-actions{display:flex;align-items:center;gap:12px;padding-top:14px}   /* no line above (Callan, 17 Nov 2026) */
.set-actions.set-actions-right{justify-content:flex-end}   /* AI key + PayFast: their buttons on the right (Callan, 17 Nov 2026) */
.set-note{font-size:13px;color:var(--ok);font-weight:600}
.set-form-title{font-size:14px;font-weight:700;color:var(--ink)}
/* API Keys tab: AI-provider section header/badge + key row + threshold slider (staging parity) */
.set-section{margin:6px 0 2px}
.set-section:not(:first-child){margin-top:24px}   /* no divider line above a section (Callan, 17 Nov 2026: "remove line") */
.set-section-title{font-size:15px;font-weight:800;color:var(--ink);margin:0}
/* a section title with its one action on the right (＋ New company MCP key, ＋ New MCP key) — owner 2026-11-23 */
.set-section.set-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.set-section.set-section-head > .btn[hidden]{display:none}
.set-profile-pointer{margin-top:12px;font-size:13px}
/* a permission the user's role on the chosen company does not allow: shown, not tickable (My profile) */
.mcp-scope.is-off{opacity:.55;cursor:not-allowed}
.mcp-scope.is-off:hover{border-color:var(--line)}
.my-mcp-role-note{font-size:13px;margin:2px 0 6px}
/* My profile — Your details and Change password side by side, their boxes one under the other (the rules after these) */
.profile-page{max-width:none}   /* the full width, as every other screen (owner 2026-11-23) */
/* My profile opened outside a company (/profile from Your companies — no company shell, no body.vt): its cards and
   grids need their own padding and columns (owner 2026-11-23: the labels sat on the card's edge) */
body:not(.vt) .profile-page .card{padding:16px 18px;border-radius:var(--radius)}
body:not(.vt) .profile-page .card > h3{margin:0 0 12px;font-size:16px}
body:not(.vt) .profile-page .grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
body:not(.vt) .profile-page .fld{display:flex;flex-direction:column;gap:4px;font-size:13px}
@media (max-width:560px){body:not(.vt) .profile-page .grid2{grid-template-columns:1fr}}
.profile-card{margin-bottom:14px}
.profile-page .set-card{max-width:none}   /* Settings' 780px cap is not the profile's */
/* Your details and Change password: two cards side by side, each card's boxes one under the other (Callan 1 Dec 2026:
   "put underneatch each other" — Name and Email; "same and then mvoe change password next to your details on the right";
   then "revert the email change, keep them separate and split the cards"). Where two cards of 360px do not fit (a phone,
   a narrow tablet) they stand one under the other, 14px apart, as the cards below them. */
.profile-page .profile-top{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:14px;margin-bottom:14px}
.profile-page .profile-top > .profile-card{min-width:0;margin:0}
.profile-page .profile-top .grid2.profile-stack{grid-template-columns:minmax(0,1fr)}
/* Show passwords next to Save changes (Callan 1 Dec 2026: "move next to save changes"): one row on the right */
.profile-pw-foot{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}
.profile-page .profile-pw-foot > .form-actions{margin:0}
.profile-mcp{margin-top:8px}
.profile-mcp > .card{margin-bottom:12px}
form[data-my-mcp-form][hidden], form[data-company-mcp-form][hidden]{display:none}
/* my name in the app bar opens My profile: it looks like the name it was, and says it can be pressed */
.user-name-link{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer;text-align:left}
.user-name-link:hover,.user-name-link:focus-visible{text-decoration:underline;color:var(--ink)}
.set-section-note{font-size:13px;color:var(--muted);margin:4px 0 0;line-height:1.5;max-width:780px}
.set-key-row{display:flex;gap:8px;align-items:stretch}
.set-key-row .form-control{flex:1 1 auto}
/* AI-key action buttons (Change key / Disable AI / Enable AI / Show / Cancel) — equal width AND the
   same height as the key input (32px), so they don't sit "thicker" than the field next to them. */
.set-key-row .set-key-act{flex:0 0 auto;min-width:112px;height:32px;display:inline-flex;
  align-items:center;justify-content:center;text-align:center;line-height:1}
.set-range{width:100%;accent-color:var(--hue-brand,var(--brand))}
.set-badge{display:inline-block;font-size:12px;font-weight:700;padding:1px 8px;border-radius:10px;margin-left:8px;vertical-align:1px}
.set-badge-ok{background:var(--brand-faint);color:var(--ok)}
.set-badge-warn{background:var(--c-amber-100);color:var(--warn)}
.set-hr{border:none;border-top:1px solid var(--line);margin:16px 0 4px}
.set-stack{display:flex;flex-direction:column;gap:16px}
/* Settings ▸ Company details (Callan, 17 Nov 2026, "A B / C D … to save space"): two small cards share a row on a wide
   screen, one card to a row on a phone or a tablet. A card keeps its own 16px bottom margin, so the row gap is 0 and the
   space under each card is the same as in the one-card stack above. Both cards in a row take the row's height. A long
   tick-box label straight in a card wraps inside its half-width card (vt.css keeps it on one line); Ledger display's
   label sits in a .grid2 column that widens to it, so it keeps its one line. */
.set-pair{display:grid;grid-template-columns:minmax(0,1fr);column-gap:16px;row-gap:0}
@media (min-width:1024px){.set-pair{grid-template-columns:repeat(2,minmax(0,1fr))}}
body.vt .set-pair .card>label.fld.inline>span{white-space:normal}
/* Callan, 17 Nov 2026 "align the stuff inside the cards to the left": a tick and Support access's button start at the
   card's left edge, under its heading (ux.css puts a tick at the card's end, form-actions put a button at the right). */
body.vt .set-stack .set-pair .card>label.fld.inline{align-self:flex-start}
body.vt .set-pair .card .form-actions{justify-content:flex-start}
/* Callan, 17 Nov 2026: Save Changes is a plain button under the cards, not a full-width card of its own; then
   "align right" — it sits at the right edge of the cards. */
body.vt .set-save-bar>.form-actions{justify-content:flex-end;margin:0;padding:0;border:0}   /* right (Callan, 17 Nov) */
.set-help{font-size:12.5px;color:var(--muted);margin:0;line-height:1.5}
.fx-add{display:flex;flex-direction:column;gap:14px;margin-bottom:16px}   /* 16px between Add rate and the rates table (it was 0 — Callan, 17 Nov 2026) */
.fx-rates{width:100%;border-collapse:collapse;font-size:13px}
.fx-rates th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:700;padding:6px 8px;border-bottom:1px solid var(--line)}
.fx-rates td{padding:6px 8px;border-bottom:1px solid var(--line);color:var(--ink)}
.fx-rates .fx-num{text-align:right;font-variant-numeric:tabular-nums}
.fx-scope{display:inline-block;font-size:12px;font-weight:600;padding:1px 8px;border-radius:10px;background:var(--brand-fainter);color:var(--muted)}
.fx-scope-own{background:var(--brand-faint);color:var(--hue-brand);font-weight:700}
.fx-reval{margin-top:2px}
.set-coa-bar{margin-bottom:10px}
.set-typef{max-width:190px}
.set-coa .set-stmt{display:inline-block;font-size:12px;font-weight:700;border-radius:3px;padding:0 4px;margin-left:4px;vertical-align:1px;color:var(--hue-paper)}
.set-coa .set-BS{background:var(--c-sky-700)}
.set-coa .set-IS{background:var(--c-violet-600)}
.set-acts{white-space:nowrap;display:flex;align-items:center;gap:6px;justify-content:flex-end}
.btn-icon{border:1px solid var(--line);background:var(--surface);border-radius:6px;cursor:pointer;font-size:13px;padding:2px 7px;color:var(--ink)}
.btn-icon:hover{border-color:var(--hue-brand)}
.set-coa-count{font-size:12px;color:var(--muted);margin-top:8px}

/* Branding tab (§7 Settings → Branding) */
.bt-color-row{display:flex;align-items:center;gap:8px}
.bt-swatch{width:44px;height:38px;padding:2px;border:1px solid var(--line);border-radius:6px;background:var(--surface);cursor:pointer;flex:0 0 auto}
.bt-hex{flex:1 1 auto}
.bt-area{min-height:70px;resize:vertical;font-family:inherit}
.bt-logo-prev{max-height:64px;max-width:220px;margin-top:8px;border:1px solid var(--line);border-radius:6px;padding:6px;background:var(--surface);object-fit:contain}
.bt-remit-title{border-top:1px solid var(--line);padding-top:14px;margin-top:2px}

/* API Keys tab (§7 Settings → API Keys) */
.ak-secret{border:1px solid var(--hue-brand);background:var(--accent-weak,color-mix(in srgb, var(--hue-brand) 8%, transparent));border-radius:8px;padding:12px 14px;margin-bottom:14px}
.ak-secret-title{font-size:13px;font-weight:600;color:var(--ink);margin-bottom:8px}
.ak-secret-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ak-secret-code{flex:1 1 auto;min-width:220px;font-family:monospace;font-size:13px;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:8px 10px;color:var(--ink);word-break:break-all;user-select:all}
.ak-copy{flex:0 0 auto}
.ak-env{display:inline-block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;border-radius:3px;padding:1px 6px;color:var(--hue-paper)}
.ak-env-live{background:var(--c-sky-700)}
.ak-env-test{background:var(--c-yellow-700)}
.ak-st-active{color:var(--ok);font-weight:600;font-size:12px}
.ak-st-revoked{color:var(--muted);font-weight:600;font-size:12px}
.ak-revoked{opacity:.55}
/* MCP key permission checklist */
.mcp-scopes{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));grid-auto-rows:1fr;gap:6px;margin-top:6px}   /* every row the tallest tile's height: all tiles one size (Callan, 17 Nov 2026) */
/* a permission tile (Callan, 17 Nov 2026 "everything must align in the blocks"): the box and the code on the first
   line, the words under the code — every tile starts its box, code and words at the same place */
.mcp-scope{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:8px;row-gap:2px;align-items:center;align-content:start;
  padding:8px 10px;border:1px solid var(--line);border-radius:8px;cursor:pointer;background:var(--surface)}
.mcp-scope:hover{border-color:var(--hue-brand)}
.mcp-scope input{margin:0;grid-column:1;grid-row:1}
.mcp-scope-code{font-family:monospace;font-size:12px;font-weight:700;color:var(--ink);grid-column:2;grid-row:1}
.mcp-scope-lbl{font-size:12px;color:var(--muted);grid-column:2;grid-row:2;line-height:1.35}
.mcp-connect .ak-secret-row{margin-top:8px}
.mcp-setup-title{margin-top:12px}
.mcp-json{white-space:pre;overflow-x:auto;margin:0}
@media (max-width:560px){.mcp-scopes{grid-template-columns:1fr}}

/* Communications tab (§7 Settings → Communications) */
.cm-subtabs{margin-bottom:14px}
.cm-body{min-height:120px}
/* Branding, comms and reminders share one tab — separate the comms block from the branding form's
   Save button above it so they don't collide (owner 2026-09-15 "buttons are squished together"). */
/* a block after another on Branding & Comms: the cards' own 16px space, no divider line (Callan, 17 Nov 2026: "why are
   these random lines here?") */
.set-comms-block{margin-top:16px}
/* Branding & Comms' sub-tabs (Email templates | Sent log) hide the pane that is not chosen. The class had no rule, so
   both tables showed, one on top of the other with no space (Callan, 17 Nov 2026, "padding"). */
/* Email templates | Sent log on one line with + New template at its right (Callan, 17 Nov 2026) */
.set-comms-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:16px}
body.vt .set-comms-head>.cm-subtabs{margin:0}
.inv-hidden{display:none!important}
/* API Keys ▸ company MCP key: the source-dates tick (it sat on the permissions box with 0px above it) shares the Create
   button's line — tick left, button right (Callan, 17 Nov 2026) */
.set-mcp-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:12px}
body.vt .set-mcp-foot>.fld.inline{align-self:center;min-height:0}
body.vt .set-mcp-foot>.form-actions{margin:0;padding:0;border:0}   /* a hiding utility: beats .btn's own display (+ New template hides) */
.cm-tokens{font-size:12px}
.cm-subj{max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cm-kind{display:inline-block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;border-radius:3px;padding:1px 6px;background:var(--chip-bg,color-mix(in srgb, var(--hue-brand) 12%, transparent));color:var(--hue-brand)}
.cm-sys{opacity:.72}
.cm-st{display:inline-block;font-size:12px;font-weight:700;border-radius:3px;padding:1px 7px}
.cm-st-queued{background:var(--c-indigo-100);color:var(--c-indigo-800)}
.cm-st-sending{background:var(--c-amber-100);color:var(--c-amber-800)}
.cm-st-sent{background:var(--c-green-100);color:var(--c-green-800)}
.cm-st-failed,.cm-st-bounced{background:var(--c-red-100);color:var(--c-red-800)}

/* Import tab (§7 Settings → Import) */
.imp-textarea{min-height:130px;font-family:monospace;font-size:13px;resize:vertical;white-space:pre}
.imp-or{text-align:center;color:var(--muted);font-size:12px;margin:2px 0}
.imp-filebtn{display:inline-block;cursor:pointer;position:relative;overflow:hidden}
.imp-file{position:absolute;left:0;top:0;opacity:0;width:100%;height:100%;cursor:pointer}
.imp-maps{display:grid;grid-template-columns:1fr 1fr;gap:10px 14px}
.imp-map{display:flex;flex-direction:column;gap:4px}
.imp-deftype-row{max-width:360px}
.imp-preview{margin-top:6px}
.imp-preview .cb-table th,.imp-preview .cb-table td{white-space:nowrap;max-width:180px;overflow:hidden;text-overflow:ellipsis}
.imp-result{font-size:15px;font-weight:600;color:var(--ok)}
.imp-errs{margin:6px 0 0;padding-left:18px;color:var(--bad);font-size:13px}

/* Email-a-document panel (§4 Documents → ✉ Email) */
.doc-email-panel{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}
.doc-email-row{display:flex;align-items:center;gap:8px;margin-top:6px;flex-wrap:wrap}
.doc-email-row .form-control{flex:1 1 auto;max-width:340px}
.doc-email-note{margin-top:8px;font-size:13px;font-weight:600;color:var(--ink)}

/* Service items — categories + items over the new pricing model (plan/pricing-redesign.md).
   Two sub-tabs, each with a toolbar + list + slide-out form. */
.inv-page{display:flex;flex-direction:column;gap:14px}
.inv-subtabs{margin-bottom:8px;border-bottom:1px solid var(--line);display:flex;gap:2px}
.inv-subtabs .cb-tab{display:inline-flex;align-items:center;gap:6px;padding:9px 14px;background:transparent;border:none;border-bottom:2px solid transparent;color:var(--muted);font-size:14px;font-weight:600;cursor:pointer}
.inv-subtabs .cb-tab.active,.cb-tabs.rp-party .cb-tab.active,.set-tabs .cb-tab.active{border-bottom-color:var(--hue-brand);color:var(--ink)}
.inv-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.inv-ccy-filter{display:flex;align-items:center;gap:8px;margin:0}
.inv-ccy-filter span{font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.02em}
.inv-ccy-filter select{padding:6px 10px;font-size:13px;min-width:120px}

/* List rows — clickable, each shows its per-currency prices inline. On mobile the row
   stacks (name + sub on top, prices row + delete below) so long names don't fight the
   price chips for width. */
.inv-list{display:flex;flex-direction:column;gap:6px}
.inv-row{display:flex;align-items:center;gap:14px;padding:12px 14px;background:var(--surface);border:1px solid var(--line);border-radius:10px;cursor:pointer;transition:background .12s,border-color .12s}
.inv-row:hover{background:var(--hover,var(--c-gray-50));border-color:var(--hue-brand)}
.inv-row-main{flex:1;min-width:0}
.inv-row-name{font-size:14px;font-weight:600;color:var(--ink)}
.inv-row-sub{font-size:12px;margin-top:2px}
.inv-row-prices{display:flex;flex-wrap:wrap;gap:4px;max-width:55%;justify-content:flex-end}
@media (max-width:767px){
  .inv-row{flex-direction:column;align-items:stretch;gap:10px;padding:12px}
  .inv-row-main{width:100%}
  .inv-row-name{white-space:normal}
  .inv-row-prices{max-width:100%;justify-content:flex-start;margin-top:2px}
  .inv-row .btn-row-del{align-self:flex-end;margin-top:-40px}
}

/* Form panel — appears in place of the list once a row / Add is clicked */
.inv-form{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:18px 20px;display:flex;flex-direction:column;gap:14px}
.inv-form-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:10px;border-bottom:1px solid var(--line)}
.inv-form .grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.inv-form .fld{display:flex;flex-direction:column;gap:4px}
.inv-form .fld>span{font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.02em}

/* Prices grid inside the form — currency chip, rate, unit, tax, remove */
.inv-prices{display:flex;flex-direction:column;gap:8px;padding:14px;background:var(--muted-bg,var(--c-gray-50));border:1px solid var(--line);border-radius:10px}
.inv-prices-head{display:flex;align-items:baseline;justify-content:space-between;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;color:var(--ink)}
.inv-price-header{display:grid;grid-template-columns:110px 140px 120px 1fr;gap:8px;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:0 4px}
.inv-price-row{display:grid;grid-template-columns:110px 140px 120px 1fr;gap:8px;align-items:center}
.inv-prices.no-tax .inv-price-header,.inv-prices.no-tax .inv-price-row{grid-template-columns:110px 1fr 140px}
.inv-price-row.is-override .form-control{border-color:var(--c-amber-400);background:var(--c-amber-50)}
.inv-price-ccy{font-size:13px;display:flex;align-items:center;gap:4px}
.inv-price-tag{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;padding:3px 8px;border-radius:999px}
.inv-price-tag.inherit{background:var(--c-emerald-50);color:var(--c-emerald-700)}
.inv-price-tag.override{background:var(--c-amber-100);color:var(--c-amber-800)}

/* Mobile: the 4-column grid doesn't fit at 375px. Stack each row as
     [ Currency label + BASE ]
     [ Rate                   Unit  ]
     [ Tax (full width)              ]
   and stack the section head (title + hint) so they don't overlap. */
@media (max-width: 720px){
  .inv-prices{padding:10px}
  .inv-prices-head{flex-direction:column;align-items:flex-start;gap:4px}
  .inv-price-header{display:none}
  .inv-price-row{grid-template-columns:1fr 1fr;grid-auto-flow:row dense;row-gap:6px;column-gap:8px;padding:8px 0;border-bottom:1px solid var(--line)}
  .inv-price-row:last-child{border-bottom:0}
  .inv-price-ccy{grid-column:1 / -1;font-size:14px}
  .inv-price-row input[type="text"],
  .inv-price-row input[inputmode="decimal"]{grid-column:1 / 2}
  .inv-price-row input:not([type="text"]):not([inputmode="decimal"]){grid-column:2 / 3}
  .inv-price-row select{grid-column:1 / -1}
  .inv-prices.no-tax .inv-price-row{grid-template-columns:1fr 1fr}
}


/* Quick Invoice (§4 A6) — rapid line capture */
.doc-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.qi-sub{margin:2px 0 0;font-size:12px}
.qi-daterow{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.qi-daterow .muted{font-size:12px}
.qi-date{max-width:180px}
.qi-entry{padding:14px}
.qi-fields{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.qi-f{display:flex;flex-direction:column;gap:4px;position:relative;min-width:0}
.qi-f label{font-size:12px;font-weight:600;color:var(--muted);display:flex;justify-content:space-between;gap:8px}
.qi-f-item,.qi-f-cust{flex:2 1 190px}
.qi-f-qty{flex:0 0 74px}
.qi-f-price{flex:0 0 104px}
.qi-f-disc{flex:0 0 74px}
.qi-f-add{flex:0 0 auto}
.qi-add{min-width:64px}
.qi-newlink{color:var(--hue-brand);cursor:pointer;font-weight:600;font-size:12px}
.qi-newlink:hover{text-decoration:underline}
.qi-desc{margin-top:10px}
.qi-upper{text-transform:uppercase}
.qi-err{margin-top:10px}
.qi-note{margin-top:10px;color:var(--hue-brand);font-size:13px;font-weight:600}
/* search dropdowns */
.qi-drop{position:absolute;left:0;right:0;top:100%;margin-top:2px;background:var(--surface);
  border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 18px var(--shade-12);
  max-height:230px;overflow-y:auto;z-index:60}
.qi-drop-item{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 11px;cursor:pointer;
  border-bottom:1px solid var(--line);font-size:13px}
.qi-drop-item:last-child{border-bottom:none}
.qi-drop-item:hover{background:var(--hover,color-mix(in srgb, var(--hue-brand) 8%, transparent))}
.qi-drop-code{font-size:12px;margin-left:auto}
.qi-drop-price{font-size:12px}
.qi-drop-new{color:var(--hue-brand);font-weight:700}
/* batch tables */
.qi-batch{padding:14px;margin-top:14px}
.qi-batch-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.qi-batch-head h3{margin:0;font-size:15px}
.qi-pill{display:inline-block;font-size:12px;font-weight:700;border-radius:999px;padding:2px 10px;color:var(--hue-paper)}
.qi-pill-warn{background:var(--c-amber-600)}
.qi-pill-info{background:var(--c-sky-700)}
.qi-table td,.qi-table th{padding:7px 9px}
.qi-row:hover{background:var(--hover,color-mix(in srgb, var(--hue-brand) 6%, transparent))}
.qi-edit-row td{padding:3px 6px;vertical-align:middle}
.qi-ein{padding:5px 7px;font-size:13px}
.qi-enum{width:74px;text-align:right;font-family:var(--mono,monospace)}
.qi-acts{white-space:nowrap;display:flex;gap:5px;justify-content:flex-end}
.qi-ok{color:var(--hue-paper);background:var(--hue-brand);border-color:var(--hue-brand)}
.qi-del:hover{border-color:var(--bad);color:var(--bad)}
.qi-batch-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.qi-empty{padding:26px 16px;text-align:center;margin-top:14px}
/* inline new-record forms */
.qi-newform{padding:14px;margin-top:12px;border:1px solid var(--hue-brand)}
.qi-newform-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.qi-newform-head h3{margin:0;font-size:14px}
.qi-newform-body{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
@media (max-width:640px){
  .qi-fields .qi-f{flex:1 1 100%}
  .qi-f-qty,.qi-f-price,.qi-f-disc{flex:1 1 45%}
  .hide-sm{display:none !important}
}

/* Contacts → Documents tab (a contact's own documents) */
.ct-doc-row,.qi-row{cursor:pointer;transition:background .12s}
.ct-doc-row:hover{background:var(--hover,color-mix(in srgb, var(--hue-brand) 6%, transparent))}
.ct-doc-st{display:inline-block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;
  border-radius:999px;padding:1px 8px;color:var(--hue-paper)}
.ct-doc-st-draft{background:var(--c-slate-500)}
.ct-doc-st-issued{background:var(--c-sky-700)}
.ct-doc-st-posted{background:var(--c-teal-l30)}
.ct-doc-st-void{background:var(--c-red-700)}

/* Contact tags (chips) */
.ct-tags{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px}
.ct-tag{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;
  background:var(--hover,color-mix(in srgb, var(--hue-brand) 12%, transparent));color:var(--ink);border:1px solid var(--line);
  border-radius:999px;padding:2px 6px 2px 10px}
.ct-tag-x{border:none;background:transparent;color:var(--muted);cursor:pointer;font-size:12px;
  line-height:1;padding:0 2px;border-radius:50%}
.ct-tag-x:hover{color:var(--bad);background:var(--line)}
.ct-tag-addform{display:inline-flex;margin:0}
.ct-tag-input{border:1px dashed var(--line);background:transparent;border-radius:999px;
  padding:2px 10px;font-size:12px;color:var(--ink);width:96px;outline:none}
.ct-tag-input:focus{border-style:solid;border-color:var(--hue-brand);width:130px}

/* Batch Invoicing (§9 A6b) */
.bt-card{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer}
.bt-name{font-weight:600}
.bt-sub{font-size:12px;margin-top:2px}
.bt-go{color:var(--muted);font-size:20px}
.bt-newform{padding:14px;margin-bottom:14px}
.bt-newform-body{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.bt-addmember,.bt-addline{padding:14px;margin-top:14px}
.bt-tagrow{display:flex;gap:8px}
.bt-runrate,.qi-f-runrate{flex:0 0 150px;display:flex;flex-direction:column;gap:4px}
.bt-members{display:flex;flex-direction:column;gap:2px;margin-top:10px}
/* Member cards are a single-select list: click one to edit its lines in the grid below. The SELECTED
   card gets a clear brand treatment — left accent bar, brand border, tinted fill, lift + brand name —
   because the old `.active` class had no styling at all, so a click gave no feedback (owner 2026-09-09).
   Tokens only (works in admin app.css :root AND tenant body.vt). */
.bt-member{cursor:pointer;border-left:3px solid transparent;
  transition:border-color .15s,background .15s,box-shadow .15s}
.bt-member:hover:not(.active):not(.bt-excluded){border-left-color:var(--line);
  background:color-mix(in srgb,var(--ink) 4%,transparent)}
.bt-member:focus-visible,.chart-col-bar:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.bt-member.active{border-color:var(--brand);border-left-color:var(--brand);
  background:color-mix(in srgb,var(--brand) 12%,transparent);
  box-shadow:0 2px 10px color-mix(in srgb,var(--brand) 20%,transparent)}
.bt-member.active .bt-member-name{color:var(--brand)}
.bt-member-editing{color:var(--brand);font-weight:600}
.bt-member.bt-paused{opacity:.6}
.bt-member-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.bt-member-name{font-weight:600;display:flex;align-items:center;gap:8px}
.bt-member-code{font-size:12px;font-weight:400}
.bt-pausetag{font-size:12px;font-weight:700;text-transform:uppercase;background:var(--c-amber-600);color:var(--hue-paper);border-radius:999px;padding:1px 7px}
.bt-member-act{display:flex;align-items:center;gap:8px}
.bt-member-total{font-weight:600}
/* Member row right side: a right-aligned amount column sitting in front of a fixed-width actions
   block, so every member's amount lines up — and the grand-total row below (same amount width + an
   equal actions-width spacer) lines up under them, so the column visibly sums. */
.bt-member-right{display:flex;align-items:center;gap:14px}
.bt-member-right .bt-member-amt{width:104px;text-align:right;font-weight:600;font-variant-numeric:tabular-nums;color:var(--ink)}
.bt-member-right .bt-member-act{width:76px;justify-content:flex-end;gap:4px}
.bt-pause-btn svg{display:block}
.bt-members-total{display:flex;align-items:center;gap:14px;margin-top:6px;padding:16px 14px 2px 17px;border-top:1px solid var(--line);font-weight:700}
.bt-members-total-lbl{flex:1}
.bt-members-total-amt{width:104px;text-align:right;font-variant-numeric:tabular-nums}
.bt-members-total-actspace{width:76px}
/* Member list filter: a search field + A–Z pills; the list below is paginated (10/page). */
.bt-mem-filterbar{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;margin:12px 0 6px}
.bt-az-lead{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
/* The A–Z jump sits in a single tinted rail so the letters read as one control, not loose chips. */
.bt-az-pills{display:flex;flex-wrap:wrap;gap:2px;padding:3px;background:var(--surface-2,var(--surface));border:1px solid var(--line);border-radius:10px}
.bt-az-pill{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;padding:0 7px;border:0;background:transparent;color:var(--muted);border-radius:7px;font-size:12px;font-weight:600;cursor:pointer;line-height:1;transition:background .12s,color .12s}
.bt-az-pill:hover{background:var(--line);color:var(--ink)}
.bt-az-pill.on{background:var(--brand);color:var(--brand-ink);font-weight:700;box-shadow:0 1px 2px var(--shade-12)}
.bt-wontbill{color:var(--warn);font-size:12.5px;margin-top:2px}
/* Editor: members list stacked ABOVE a FULL-WIDTH line grid. The grid needs the whole width for its
   Item / Description / Qty / Price / Tax / Account / Kind / Period columns — exactly like the
   documents editor. An earlier side-by-side split squeezed the grid to ~60% and cut inputs off and
   clipped the dropdowns, so members now sit in a compact band on top and the grid spans full width. */
.bt-editor-cols{display:grid;grid-template-columns:1fr;gap:14px;margin-top:14px}
.bt-editor-cols .bt-addmember,.bt-editor-cols .bt-addline{margin-top:0}
/* The members card now spans full width because each selected member expands its OWN line grid
   INLINE (golden rule #7); the grid needs the whole width for its 9 columns, so no max-width cap. */
/* Multi-select bulk-action bar + per-member checkbox */
.bt-bulkbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:12px;padding:8px 12px;border-radius:10px;
  background:color-mix(in srgb,var(--brand) 10%,transparent);border:1px solid var(--brand)}
.bt-bulk-n{font-weight:700;margin-right:2px}
.bt-bulk-warn{font-weight:600;color:var(--bad)}
.bt-member-lead{display:flex;align-items:center;gap:9px;min-width:0}
.bt-member-check{display:inline-flex;align-items:center;margin:0;cursor:pointer}
.bt-member-check input{width:16px;height:16px;cursor:pointer}
.bt-lines{margin-top:8px;display:flex;flex-direction:column;gap:4px}
.bt-line{display:flex;align-items:center;gap:10px;padding:4px 0;border-top:1px solid var(--line)}
.bt-line-desc{flex:1;min-width:0}
.bt-line-when{font-size:12px;color:var(--muted);margin-left:6px}
.bt-line-qty{color:var(--muted);font-size:12px}
.bt-line-amt{font-weight:600;min-width:80px;text-align:right}
.bt-noline{font-size:12px;margin-top:6px}
.bt-empty{margin-top:14px}
/* Suggest from invoices (batch_suggest.js) */
.bt-suggest{padding:14px 16px;margin-bottom:12px}
.bt-suggest-head h3{margin:0 0 4px}
.bt-suggest-head p{margin:0 0 10px;font-size:13px}
.bt-suggest-note{font-size:13px;padding:8px 10px;border-radius:8px;background:var(--surface-2,var(--surface));border:1px solid var(--line);margin-bottom:10px}
.bt-suggest-list{display:flex;flex-direction:column;border-top:1px solid var(--line)}
.bt-suggest-row{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}
.bt-suggest-row.is-done{opacity:.6}
.bt-suggest-pick{display:flex;gap:10px;align-items:flex-start;flex:1 1 280px;cursor:pointer}
.bt-suggest-pick input{margin-top:3px}
.bt-suggest-main{display:flex;flex-direction:column}
.bt-suggest-flag{color:var(--warn);font-weight:600}
.bt-suggest-members{list-style:none;margin:2px 0 0 26px;padding:0;flex-basis:100%;display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:4px 16px;font-size:13px}
.bt-suggest-members li{display:flex;gap:8px;align-items:baseline;min-width:0}
.bt-suggest-members li>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bt-suggest-members li>span{flex:0 0 auto}
.bt-suggest-members li>span:first-child{flex:0 1 auto}
.bt-suggest-members .bt-suggest-flag{font-size:12px;white-space:nowrap}
.bt-suggest-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.bt-suggest-done{font-size:13px;padding:8px 10px;border-radius:8px;border:1px solid var(--line);color:var(--ok);margin-bottom:10px}
.bt-del:hover{border-color:var(--bad);color:var(--bad)}
.bt-run-row{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.bt-run-hint{font-size:12px}
.bt-link{color:var(--hue-brand);cursor:pointer;font-weight:700}
.bt-link:hover{text-decoration:underline}
/* Batch run page (v2 batch/run.twig) */
.bt-runpage .bt-runhead{margin-bottom:12px}
.bt-run-bank{min-width:200px}
.bt-run-spacer{flex:1 1 auto}
.bt-run-notes{font-size:12px;margin-top:8px}
.bt-run-summary{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:12px}
.bt-run-lines{background:var(--muted)}
.bt-run-total{background:var(--brand);font-size:13px}   /* the estimated total — the headline figure of the run */
.bt-run-actions{flex-wrap:wrap;gap:8px}
.bt-run-pills{margin:2px 0 10px}
.bt-run-line{flex-wrap:wrap}
.bt-run-desc{flex:1 1 220px;min-width:160px}
.bt-run-removed{opacity:.65;font-size:13px;justify-content:space-between;flex-wrap:wrap}
.bt-run-adhoc{background:var(--hover,color-mix(in srgb, var(--hue-brand) 6%, transparent));border-radius:8px;padding:6px 8px}
.bt-adhoc-tag{font-size:12px;font-weight:700;text-transform:uppercase;color:var(--hue-brand);white-space:nowrap}
.bt-keep{font-size:12px;white-space:nowrap;display:flex;align-items:center;gap:4px;cursor:pointer}
.bt-debit-badge{font-size:12px;font-weight:700;background:var(--hue-brand);color:var(--hue-paper);border-radius:999px;padding:1px 8px;white-space:nowrap}
.bt-run-addadhoc{display:flex;align-items:center;gap:10px;margin-top:8px;font-size:12px}
.bt-complete{margin-top:6px}
.bt-complete-title{font-size:18px;font-weight:700;color:var(--good,var(--c-green-600));margin-bottom:10px}
.bt-complete-grid{display:flex;flex-direction:column;gap:6px;max-width:420px}
.bt-complete-row{display:flex;justify-content:space-between;gap:12px;font-size:14px;border-bottom:1px solid var(--line);padding-bottom:6px}
.bt-complete-errs{margin-top:10px;display:flex;flex-direction:column;gap:4px}
.bt-complete-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.bt-complete-actions-right{justify-content:flex-end;align-items:center}   /* golden rule: right-aligned run-export/return actions, uniform .btn height */
/* Assets screen */
.as-head-actions{display:flex;gap:8px;flex-wrap:wrap}
.as-toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:8px}
.as-search{flex:1 1 220px;min-width:180px}
.as-catsel{flex:0 1 220px}
.as-pills{margin:2px 0 10px}
.as-table tbody tr.as-row{cursor:pointer}
.as-table tbody tr.as-row:hover{background:var(--hover,color-mix(in srgb, var(--hue-brand) 6%, transparent))}
.as-row-act{white-space:nowrap}
.as-dispose{display:inline-flex;gap:6px;align-items:center;flex-wrap:wrap}
.as-d-in{width:150px;display:inline-block}
.as-form{max-width:900px;margin-bottom:14px}
.as-form-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.as-notes{margin-top:10px}
.as-sched{margin-top:16px}
.as-cat-code{font-size:12px}
.as-cat-act{white-space:nowrap;display:flex;gap:6px;align-items:center}
.as-cat-formtitle{margin-top:14px}
.as-depr-result{margin-top:12px}
.as-depr-done{margin-top:10px;padding:10px 12px;background:var(--hover,color-mix(in srgb, var(--hue-brand) 10%, transparent));border-radius:8px;font-size:13px;font-weight:600}
.as-disp-note{margin-top:10px}
.as-toast{position:sticky;top:0;z-index:5;margin-bottom:10px;padding:8px 12px;background:var(--brand);color:var(--hue-deep);border-radius:8px;font-weight:600;font-size:13px}
.bt-runs{padding:14px;margin-top:14px}
.bt-runs-head h3{margin:0 0 8px;font-size:15px}
.bt-run-st{display:inline-block;font-size:12px;font-weight:700;text-transform:uppercase;border-radius:999px;padding:1px 8px;color:var(--hue-paper)}
.bt-run-st-completed{background:var(--c-teal-l30)}
.bt-run-st-running{background:var(--c-sky-700)}
.bt-run-st-failed{background:var(--c-red-700)}
.bt-run-st-draft{background:var(--c-slate-500)}

/* v2-parity sweep: outstanding-import review flags on the account cards */
.cb-card-review{outline:2px solid var(--bad);outline-offset:1px}
/* status ribbon along the card's bottom edge — flows below the balance so it never overlaps it
   or the icons (was absolute bottom-left → collided with both) */
.cb-review-flag,.cb-imp-badge{display:block;margin:8px -12px -10px;padding:4px 10px;
  border-radius:0 0 10px 10px;font-size:12px;font-weight:700;color:var(--hue-paper);text-align:center;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.cb-review-flag{background:var(--bad)}
/* per-card statement-import badge (several cards can import at once) */
.cb-imp-badge{background:var(--hue-brand)}
.cb-card{position:relative}
/* review: work one account's import at a time */
.cb-prev-accts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0}
.cb-prev-accts .cb-panel-hint{margin:0}
/* the SELECTED statement-sort chip must read at a glance: filled accent, bold, a soft ring
   and a lift so "you are on OVK / All" is unmistakable (owner 2026-09-08). */
.chip-btn.chip-on{background:var(--hue-brand);border-color:var(--hue-brand);
  color:var(--hue-paper);font-weight:800;box-shadow:0 0 0 3px color-mix(in srgb, var(--hue-brand) 28%, transparent)}
.chip-btn.chip-on:hover{border-color:var(--hue-brand)}
/* AI answer: persistent clickable solutions */
.cb-ask-solutions{margin-top:10px;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.cb-sol-head{font-size:12px;color:var(--muted);font-weight:600}
.cb-sol-pill{display:inline-flex;align-items:center;gap:6px;max-width:100%;text-align:left;
  border:1px solid var(--line);background:var(--surface);color:var(--ink);
  border-radius:8px;padding:5px 10px;font-size:13px;cursor:pointer;transition:border-color .12s}
.cb-sol-pill:hover{border-color:var(--hue-brand)}
.cb-sol-allocate{border-left:3px solid var(--hue-brand)}
.cb-sol-add{border-left:3px solid var(--c-teal-l30)}
.cb-sol-edit{border-left:3px solid var(--c-amber-600)}
.cb-sol-delete{border-left:3px solid var(--bad)}
.cb-sol-done{opacity:.55;text-decoration:line-through;cursor:default}
.cb-sol-done:hover{border-color:var(--line)}
.page-back{margin-bottom:4px}

/* dashboard Needs-Attention — v2 triage cards */
.dash-tri-io{font-size:12px;font-weight:800;letter-spacing:.04em;border-radius:4px;padding:1px 7px;color:var(--hue-paper)}
.dash-tri-io.io-in{background:var(--c-teal-l30)}
.dash-tri-io.io-out{background:var(--bad)}
.dash-tri-xcount{font-weight:700;font-size:12px;color:var(--muted)}
.dash-tri-banks{font-size:12px;color:var(--muted);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-tri-top{display:flex;align-items:center;gap:8px}
.dash-tri-pills{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:8px}
/* Bank inbox: the GL search sits FIRST (left) at a FIXED width so every row's search is the
   same size whether or not an AI suggestion chip follows it (owner 2026-09-16). */
.bank-inbox-gl-search{flex:0 1 340px;max-width:100%}
/* Bank inbox dest tabs (General · Debtors · Creditors · VAT, v2 parity) — a wrapping row of the
   shared .cb-dest-pill above each line's General GL picker. Only shown when >1 dest exists. */
.bank-inbox-dest-row{display:flex;gap:4px;flex-wrap:wrap;margin:8px 0 0}
.alloc-pill-sug{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);
  background:var(--surface);color:var(--ink);border-radius:8px;padding:4px 10px;
  font-size:13px;cursor:pointer;text-align:left;max-width:100%}
.alloc-pill-sug:hover{border-color:var(--hue-brand)}
.alloc-pill-rule{border-color:var(--c-teal-l30);background:color-mix(in srgb, var(--c-teal-l30) 7%, transparent)}
.alloc-pill-more{border-style:dashed;color:var(--muted)}
.dash-tri-busy{font-size:12px;color:var(--muted)}
.dash-tri-done{display:flex;align-items:center;justify-content:space-between;gap:10px;
  border-color:var(--c-teal-l30);background:color-mix(in srgb, var(--c-teal-l30) 8%, transparent);animation:tri-done-in .25s ease}
.dash-tri-done-msg{font-weight:600;color:var(--c-teal-l30);font-size:13px}
@keyframes tri-done-in{from{opacity:.4;transform:translateY(-2px)}to{opacity:1;transform:none}}
.dash-alldone{padding:14px 16px;border:1px solid var(--c-teal-l30);border-radius:10px;background:color-mix(in srgb, var(--c-teal-l30) 8%, transparent);
  font-weight:700;color:var(--c-teal-l30);margin-bottom:12px}

/* contacts: collapsible Recently added + onboarding + statement doc links */
.ct-rec-toggle{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:1px solid var(--line);
  background:var(--surface);color:var(--ink);border-radius:10px;padding:9px 12px;font-size:13px;
  font-weight:700;cursor:pointer;margin:10px 0 6px}
.ct-rec-caret{display:inline-block;transition:transform .15s;font-weight:700;color:var(--muted)}
.ct-rec-caret.open{transform:rotate(90deg)}
.ct-rec-count{color:var(--muted);font-weight:600}
.ct-rec-preview{color:var(--muted);font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ct-rec-list{margin-bottom:8px}
.ct-onboard{margin-top:10px;padding:12px;border:1px dashed var(--hue-brand);border-radius:10px}
.ct-onboard-title{font-weight:700;margin-bottom:4px}
.ct-onboard-linkrow,.ct-onboard-emailrow{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}
.ct-onboard-linkrow .form-control,.ct-onboard-emailrow .form-control{flex:1;min-width:220px}
.ct-stmt-ref{border:none;background:none;padding:0;font:inherit;color:var(--hue-brand);
  cursor:pointer;text-decoration:underline}
/* documents: drafts card + notes */
.doc-draft-badge{font-size:12px;font-weight:800;background:var(--c-amber-600);color:var(--hue-paper);border-radius:999px;padding:1px 8px;margin-left:6px}
.doc-notes{margin-top:10px}
.doc-notes-text{white-space:pre-wrap;font-size:13px;color:var(--ink);border-left:3px solid var(--line);padding:4px 10px;margin-top:4px}
/* public onboarding portal */
.portal-page{max-width:760px;margin:0 auto;padding:26px 16px}
.portal-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:22px}
.portal-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin-top:14px}
.portal-actions{display:flex;align-items:center;gap:10px;margin-top:16px}
/* the onboarding page in groups (owner 3 Dec 2026): each a heading over its fields; addresses and people as cards */
.portal-lead{font-size:16px;font-weight:600;margin:6px 0 4px;line-height:1.4}
.portal-intro{margin:0 0 4px;font-size:13.5px;line-height:1.5;color:var(--muted)}
.portal-group{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}
.portal-group-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.portal-group-title{font-size:15px;font-weight:700;margin:0}
.portal-group .portal-grid{margin-top:10px}
.portal-item{margin-top:10px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.portal-item .portal-grid{margin-top:8px}
.portal-item-head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px}
.portal-item-head .ct-field{flex:0 1 240px}
.portal-item-foot{display:flex;justify-content:flex-end;margin-top:8px}
.portal-wide{grid-column:1 / -1}
/* bank details two a row, as on the contact Edit; one column on a phone */
.portal-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media (max-width:560px){.portal-grid-2{grid-template-columns:1fr}}
.portal-intl-toggle{margin-top:10px;background:none;border:0;padding:0;color:var(--brand);font-weight:600;cursor:pointer}
.portal-ticks{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin-top:10px}
.portal-tick{display:inline-flex;align-items:center;gap:6px;font-size:13.5px;min-height:32px;cursor:pointer}
.portal-card .cell-sub{font-size:13px;line-height:1.45;margin:4px 0 0}

/* reports — v2 parity views */
.rp-filters-col{display:flex;flex-direction:row;flex-wrap:wrap;align-items:flex-end;gap:6px 16px;margin:4px 0 14px}
/* the report's filters and its "As at:" / "Quick range:" buttons share ONE line (owner 2026-11-23, Trial Balance: "This
   should be on the same line"); they wrap only when the line is full. The TB's Balances / Movements switch keeps its own
   line above them, and the buttons sit on the same baseline as the boxes. */
.rp-filters-col > .rp-quick{min-height:36px}
/* ends a line of the filters on purpose (the Age Analysis' Debtors / Active tabs keep their own line) */
.rp-filters-col > .rp-break{flex:0 0 100%;height:0}
.rp-filters-col .rp-filters{margin:0}
/* Trial Balance: Balances (as at) ⇄ Movements (from – to) toggle + the window hint line */
.rp-filters-col .rp-tb-mode{margin:0 0 2px;align-self:flex-start;flex-wrap:wrap;flex:0 0 100%}
/* size each toggle button to its label on ONE line (the shared flex:1 squeezed "Movements (from – to)"
   onto two lines); on a narrow phone the pair wraps to a second row instead of overflowing */
.rp-tb-mode .login-kind-btn{flex:0 0 auto;white-space:nowrap;padding:9px 20px}
.rp-tb-window{margin:2px 0 10px;font-size:13px}
.rp-quick{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.rp-quick-lbl{font-size:12px;color:var(--muted)}
.rp-quick .btn-sm,.rp-fynav .btn-sm{padding:3px 10px;font-size:12.5px}
.rp-fywrap{display:flex;flex-direction:column;gap:4px}
.rp-fynav{display:flex;align-items:center;gap:6px}
.rp-fyyear{font-size:15px;font-weight:700;min-width:52px;text-align:center}
.rp-asat-ro{font-size:14px;color:var(--muted);padding:6px 0}
.rp-cards{display:flex;gap:10px;flex-wrap:wrap;margin:4px 0 14px}
.rp-kpi{border:1px solid var(--line);border-radius:10px;padding:10px 16px;background:var(--surface);display:flex;flex-direction:column;gap:2px;min-width:130px}
.rp-kpi-lbl{font-size:12px;color:var(--muted);font-weight:600}
.rp-kpi-val{font-size:16px;font-weight:700}
.rp-ok-t{color:var(--ok)}
.rp-bad-t{color:var(--bad)}
.rp-warn-t{color:var(--warn)}
.rp-dim{color:var(--muted);font-size:12.5px}
.rp-bbf td{background:var(--surface-2)}
.rp-badge{display:inline-block;font-size:12px;font-weight:700;border-radius:999px;padding:0 7px;margin-left:5px;vertical-align:1px}
.rp-badge-bank{background:color-mix(in srgb, var(--c-blue-600) 12%, transparent);color:var(--c-blue-600)}
.rp-badge-debtor{background:color-mix(in srgb, var(--c-green-700) 12%, transparent);color:var(--ok)}
.rp-badge-creditor{background:color-mix(in srgb, var(--c-red-700) 10%, transparent);color:var(--bad)}
.rp-badge-vat{background:color-mix(in srgb, var(--c-amber-700) 12%, transparent);color:var(--warn)}
.rp-badge-off{background:var(--shade-08);color:var(--muted)}
/* age analysis */
.rp-age-cards .rp-age-kpi{cursor:pointer;transition:border-color .12s}
.rp-age-kpi:hover{border-color:var(--hue-brand)}
.rp-age-on{border-color:var(--hue-brand);box-shadow:0 0 0 1px var(--hue-brand)}
.rp-age-filterlbl{font-size:12.5px;color:var(--muted);margin:-6px 0 10px}
.rp-age-clear{font-size:12.5px;padding:0}
.rp-age-row{cursor:pointer}
.rp-age-row:hover td{background:var(--surface-2)}
/* income statement — the ruled three-column statement, as wide as the page (Callan, 25 Nov 2026: "make the report
   landscape") */
.rp-is{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:20px 26px}
.rp-is-head{display:flex;justify-content:space-between;border-bottom:2px solid var(--ink);padding-bottom:10px;margin-bottom:16px}
.rp-is-company{font-size:16px;font-weight:700}
.rp-is-title{font-size:12.5px;color:var(--muted);margin-top:2px}
.rp-is-sec{margin-bottom:14px}
.rp-is-sectitle{font-size:12px;font-weight:700;letter-spacing:.05em;color:var(--muted);margin-bottom:4px}
.rp-is-line{display:grid;grid-template-columns:1fr 140px 140px;gap:8px;padding:2px 0;font-size:13.5px;align-items:baseline}
.rp-is-label{padding-left:12px}
.rp-is-sub .rp-is-label,.rp-is-final .rp-is-label{padding-left:0}
.rp-is-amt,.rp-is-total{text-align:right}
/* The Income Statement's filters as one grey panel (Callan, 25 Nov 2026 — option 2 of five, "do number 2"), where every
   report has its filters: on top, not in the report's card ("keep it like the other reports but with the ui like it
   is now"). Labels on the left (the Approvals cards' style), the quick range in use filled, the comparison beside To
   ("bring the no comparison across"). The Trial Balance's filters use the same panel ("put trial balance ui in a card
   as well"), two lines ("keep the trial balance card slim"): Balances ⇄ Movements (its two buttons as tall as a box)
   with the dates, then the quick buttons; so does the Balance Sheet's (the year, the date, the month ends, Compare
   with, the movements' from date; then the quick dates) and the Age Analysis's (Debtors ⇄ Creditors, Active /
   Disabled / All, From and As at, each label held to its box; then the quick dates — no line of copy), and the
   General Ledger's (Single account ⇄ Account range, the account or From to To account, the year, From to To), the
   Transaction Listing's (the search, then From to To), the VAT Report's (From to To), the Bank Statement's and Bank
   Reconciliation's (the account, then From to To) and the Cost Code Report's (the cost code, then From to To), each
   then the quick ranges; the List of Accounts' is one line (Search and its box). Each From to To is one pair
   (.rp-pair, like a label and its box): a narrower screen moves it to the next line whole. Every first line is
   captioned Period ("then for all the reports change the top copy header in the slim card to period"), every second
   line Quick range ("on all the cards change quick date to quick range").
   Phone first: each label above its boxes; from 768px the labels make a column on the left, each level with the
   first line of its boxes. */
.rp-panel{background:var(--surface-2);border-radius:10px;padding:10px 12px;margin:4px 0 14px;display:flex;
  flex-direction:column;gap:10px}
.rp-prow{display:flex;flex-direction:column;gap:6px;min-width:0}
.rp-pcap{font-size:10.5px;letter-spacing:.11em;color:var(--faint);font-weight:700;text-transform:uppercase;line-height:1.2}
.rp-pctl{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;min-width:0}
.rp-pctl.rp-chips{gap:6px}
.rp-pctl > .rp-fynav{flex:0 0 100%}
.rp-pctl > sleek-date{flex:1 1 120px;min-width:0}
.rp-pto{font-size:13px;color:var(--muted)}
.rp-pctl > .rp-sel{flex:1 1 100%;width:auto;min-width:0}
.rp-pctl > .login-kind{margin:0;flex:1 1 100%;flex-wrap:nowrap;gap:4px}
.rp-pctl > .rp-pair{display:flex;align-items:center;gap:8px;flex:1 1 200px;min-width:0}
.rp-pair > .rp-flabel{margin:0;font-size:13px;font-weight:400;white-space:nowrap}
.rp-pair > sleek-date{flex:1 1 120px;min-width:0}
.rp-pctl > .rp-bs-from{display:flex;flex:1 1 120px;min-width:0}
.rp-pctl > .rp-bs-from[hidden]{display:none}
.rp-bs-from > sleek-date{flex:1 1 auto;min-width:0}
/* the General Ledger's, the two bank reports' and the Cost Code Report's boxes: the single account (or the cost code)
   fills a phone's line; the range's From and To are a pair (like From to To: kept on one line, moved to the next line
   whole) */
.rp-pctl > .rp-acct{flex:1 1 100%;min-width:0;max-width:none}
.rp-pair > .rp-glpick{flex:1 1 120px;min-width:0;max-width:none}
/* the Transaction Listing's search: a phone's whole line, then its own width */
.rp-pctl > .rp-search{flex:1 1 100%;min-width:0;max-width:none}
.rp-chip{height:32px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font:inherit;
  font-size:12.5px;font-weight:600;color:var(--ink);cursor:pointer;white-space:nowrap}
.rp-chip:hover{border-color:var(--brand)}
.rp-chip:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.rp-chip.on{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
@media (min-width:768px){
  .rp-panel{padding:12px 14px}
  .rp-prow{flex-direction:row;align-items:flex-start;gap:10px}
  .rp-pcap{flex:0 0 92px;min-height:var(--control-h);display:flex;align-items:center}
  .rp-prow-chips > .rp-pcap{min-height:28px}
  .rp-pctl{flex:1 1 auto}
  .rp-pctl > .rp-fynav{flex:0 0 auto}
  .rp-pctl > sleek-date{flex:0 0 156px}
  .rp-pctl > .rp-sel{flex:0 0 auto;min-width:210px}
  .rp-pctl > .login-kind{flex:0 0 auto}
  .rp-pctl > .rp-pair{flex:0 0 auto}
  .rp-pair > sleek-date{flex:0 0 156px}
  .rp-pctl > .rp-bs-from{flex:0 0 156px}
  .rp-pctl > .rp-acct{flex:0 0 280px}
  .rp-pair > .rp-glpick{flex:0 0 200px}
  .rp-pctl > .rp-search{flex:0 0 280px}
  .rp-pctl .login-kind-btn{flex:0 0 auto;white-space:nowrap;height:var(--control-h);padding:0 16px}
  .rp-chip{height:28px}
}
.rp-underline{border-top:1px solid var(--ink)}
.rp-dblunderline{border-top:1px solid var(--ink);border-bottom:3px double var(--ink)}
/* balance sheet — two-column layout */
.rp-bs-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:stretch}
/* its totals stay at the top while the two columns scroll under them (Callan, 25 Nov 2026: "this must stay at the top
   please similar to trial balance" — there only the table scrolls, so its cards never move); the page colour behind
   them hides a line passing under the gaps */
[data-screen-body] .rp-cards:has(+ .rp-bs-cols){position:sticky;top:0;z-index:2;margin:0;padding:4px 0 14px;background:var(--bg)}
@media (max-width: 860px){.rp-bs-cols{grid-template-columns:1fr}}
.rp-bs-side{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);overflow:hidden;display:flex;flex-direction:column}
.rp-bs-sidehead{font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:10px 14px;background:var(--surface-2)}
.rp-bs-group{padding:6px 0}
.rp-bs-grouphead{display:flex;justify-content:space-between;gap:10px;padding:6px 14px;font-size:12.5px;font-weight:700;color:var(--muted);background:var(--surface-2)}
.rp-bs-row{display:grid;grid-template-columns:86px 1fr auto;gap:8px;padding:4px 14px;font-size:13.5px;align-items:baseline}
.rp-bs-code{color:var(--muted);font-size:12.5px}
.rp-bs-amt{text-align:right}
.rp-bs-total{display:flex;justify-content:space-between;gap:10px;padding:10px 14px;font-weight:700;font-size:14px;background:var(--brand);color:var(--hue-deep);margin-top:auto}
.rp-bs-subtotal{display:flex;justify-content:space-between;gap:10px;padding:7px 14px;font-weight:600;font-size:13px;border-top:1px solid var(--line)}
.rp-bs-retained{background:color-mix(in srgb, var(--c-amber-700) 7%, transparent);border-top:1px dashed var(--line)}
.rp-bs-retained .rp-bs-desc{font-style:italic}
.rp-bs-empty{padding:14px}
/* GL range mode */
.rp-glpick{max-width:230px}
/* GL account-range: account after account in ONE shared table body; this row is an account's heading */
.rp-gl-grouprow td{background:var(--surface-2);font-weight:700;font-size:13px;
  padding-top:9px;padding-bottom:9px;border-top:2px solid var(--line)}
.rp-table tbody > .rp-gl-grouprow:first-child td{border-top:none}
/* reconciliation + vat tabs */
.rp-vat-tabs{margin-top:16px}
.rp-count{display:inline-block;min-width:20px;text-align:center;font-size:12px;font-weight:700;border-radius:999px;padding:0 6px;background:var(--shade-08);margin-left:4px}
.rp-count-warn{background:color-mix(in srgb, var(--c-amber-700) 15%, transparent);color:var(--warn)}
.rp-count-info{background:color-mix(in srgb, var(--c-blue-600) 13%, transparent);color:var(--c-blue-600)}
.rp-match{display:inline-block;font-size:12px;font-weight:700;border-radius:999px;padding:1px 8px}
.rp-match-exact{background:color-mix(in srgb, var(--c-green-700) 12%, transparent);color:var(--ok)}
.rp-match-amount{background:color-mix(in srgb, var(--c-amber-700) 12%, transparent);color:var(--warn)}
.rp-tabnote{font-size:12.5px;color:var(--muted);margin:6px 0 8px}
/* r1108 reports — Raymond's report items (2026-11-08). Phone first; wider screens below. */
/* 6 · General Ledger by account range: a thick rule under each account's subtotal ends the account before the
   next one starts — the theme's ink on screen, black on paper. rp-total too: (0,3,2) out-ranks vt.css
   body.vt tbody tr:last-child td{border-bottom:none} (0,2,4) — one tbody now, so the LAST account's subtotal is its last row */
.rp-table tr.rp-total.rp-gl-subtotal td{border-bottom:3px solid var(--ink)}
@media print{.rp-table tr.rp-total.rp-gl-subtotal td{border-bottom-color:var(--c-black)}}
/* 9 · the ledger's search, and its "12 of 340 lines" */
.rp-gls{margin:0 0 10px}
.rp-gls-count{font-size:12.5px;color:var(--muted);margin:0 0 8px}
/* a search that finds nothing names the accounts it means that have no entries (item 7, 11 Nov 2026) */
.rp-gl-quiet{margin-top:6px}
/* "No entries…" / "No lines match…" over one account's ledger: the card keeps the 14px the Trial Balance's cards leave
   above its grid — its dashed box sat on the card's top edge (Callan, 25 Nov 2026: "padding") */
.muted-block.rp-gl-none{margin-bottom:14px}
/* 7 · Balance Sheet as at / compare with; 8 · Age Analysis as at. Every control in the row is one height. */
.rp-bs-filters .form-control,.rp-age-filters .form-control{height:var(--control-h);box-sizing:border-box}
.rp-bs-filters > .rp-fywrap{flex:1 1 100%}
.rp-sel{width:100%;min-width:0}
.rp-cmp .rp-cmp-group td{font-weight:600;color:var(--muted)}
.rp-age-asat{margin:0 0 10px;font-size:13px}
/* 10 · Bank Reconciliation summary: bank statement and ledger, the reconciling items, what is unexplained */
.rp-rs{display:flex;flex-direction:column;gap:12px;margin:4px 0 16px}
.rp-rs-cards{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
/* the Income Statement panel, the Balance Sheet's two sides and these: the 12px corner of every report tile and table
   (var(--radius-lg)); they were 10px (Callan, 2 Dec 2026, work list R3 "the same borders": "yes") */
.rp-rs-card,.rp-rs-items{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);padding:10px 14px}
.rp-rs-title{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin:0 0 4px}
.rp-rs-sub{font-size:12px;color:var(--muted);margin:0 0 6px}
.rp-rs-line{display:flex;align-items:baseline;gap:8px;padding:3px 0;font-size:13.5px}
.rp-rs-line > .mono{margin-left:auto;white-space:nowrap}
.rp-rs-close{border-top:1px solid var(--line);margin-top:4px;padding-top:6px;font-weight:700}
.rp-rs-check{font-size:12.5px;margin-top:6px}
.rp-rs-group > summary{cursor:pointer;list-style:none}
.rp-rs-group > summary::-webkit-details-marker{display:none}
.rp-rs-caret{flex:0 0 10px;transition:transform .12s}
.rp-rs-group[open] > summary .rp-rs-caret{transform:rotate(90deg)}
.rp-rs-group .table-wrap{margin:4px 0 8px}
.rp-rs-unexp{border-top:2px solid var(--ink);margin-top:6px;padding-top:8px;font-weight:700;font-size:14.5px}
@media (min-width:768px){
  .rp-gls-in{max-width:360px}
  .rp-bs-filters > .rp-fywrap{flex:0 0 auto}
  /* body.vt select{width:100%} (vt.css) outranked a bare .rp-sel, so on a desktop "Compare with" took a line of its own,
     the page's whole width (Callan, 11 Nov 2026: "why is the comparison bar width so long"). It is as wide as its words. */
  body.vt select.rp-sel{width:auto;min-width:190px;flex:0 0 auto}
  .rp-rs-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* VAT201 return — laid out like the accountant's return: a white document, the field number in bold,
   plain figures, light rules (South Africa, owner 2026-10-07) */
/* the VAT201 Return / By Tax Code switch: 14px above the return. Three classes, so it beats .cb-tabs.rp-party{margin-bottom:0}
   — as .v201-views alone it lost, and the card sat on the tabs' line (Callan, 25 Nov 2026: "fix the padding there") */
.cb-tabs.rp-party.v201-views{margin-bottom:14px}
/* By Tax Code: the groups (Output VAT, Input VAT, Zero-rated / Exempt …) are a table each, and each sized its columns
   from its own words, so Excl. / VAT / Incl. stood in a different place in every group (Callan, 2 Dec 2026: "the two
   EXCL. are not directly above each other" → "yes"). One set of column widths for every group table; Description takes
   the rest; never narrower than its amounts need (a phone scrolls it sideways, as before) */
.rp-table.rp-vat-group{table-layout:fixed;width:100%;min-width:840px}
.rp-table.rp-vat-group > thead > tr > th:nth-child(1),.rp-table.rp-vat-group > thead > tr > th:nth-child(6){width:9%}
.rp-table.rp-vat-group > thead > tr > th:nth-child(3),.rp-table.rp-vat-group > thead > tr > th:nth-child(4),
.rp-table.rp-vat-group > thead > tr > th:nth-child(5){width:17%}
.v201{display:flex;flex-direction:column;gap:18px}
.v201-paper{background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:28px 32px;max-width:980px;box-shadow:0 1px 3px var(--shade-04)}
.v201-paper-wide{max-width:none}
.v201-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px 20px;flex-wrap:wrap}
.v201-title{font-size:26px;font-weight:700;line-height:1.2;color:var(--ink)}
.v201-title-sm{font-size:20px}
.v201-top-right{display:flex;align-items:center;gap:14px}
.v201-meta{font-size:13px;color:var(--muted)}
.v201-status{font-size:13px;font-weight:600;border-radius:6px;padding:6px 18px}
.v201-status-draft{background:var(--surface-2);color:var(--ink)}
.v201-status-filed{background:color-mix(in srgb, var(--c-green-700) 18%, transparent);color:var(--ok)}
.v201-co{font-size:17px;font-weight:700;color:var(--ink);margin-top:14px}
.v201-period{font-size:16px;color:var(--ink);margin-top:2px}
.v201-vatno{font-size:13px;color:var(--ink);margin-top:14px}
.v201-owing{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:20px 0 6px;
  padding:13px 14px;background:var(--surface-2);font-size:17px;font-weight:700;color:var(--ink)}
.v201-warn{margin:8px 0}
.v201-fields,.v201-tx{width:100%;border-collapse:collapse}
/* the fields' one column header — "SARS Reference" over the numbers (Andre 2026-10-08). The tenant skin
   (vt.css: body.vt thead th) styles it like every table header; only the amount's side is set here. Each
   group's label then leads its rows, where the label used to sit above its own table */
.v201-fields thead th.v201-num{text-align:right}
.v201-fields .v201-grp th{font-size:15px;font-weight:700;text-align:left;color:var(--ink);padding:22px 10px 2px}
.v201-fields td{padding:11px 10px;border-bottom:1px solid var(--line);font-size:14px;color:var(--ink);vertical-align:top}
.v201-fields .v201-fno{width:52px;white-space:nowrap}
/* the field number as the SARS form prints it: a small blue box holding just the number (owner 2026-10-08) */
.v201-fbox{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:22px;padding:0 5px;
  border-radius:4px;background:color-mix(in srgb,var(--info) 16%,transparent);color:var(--info);
  font-size:12px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;vertical-align:middle}
.v201-sec .v201-fbox{margin-right:10px}
.v201-num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.v201-fields .v201-total td,.v201-tx .v201-total td{font-weight:700}
.v201-tx th{font-size:12px;font-weight:700;text-align:left;color:var(--ink);padding:12px 8px 8px;border-bottom:2px solid var(--ink);white-space:nowrap}
.v201-tx th.v201-num{text-align:right}
.v201-tx td{font-size:13px;padding:9px 8px;border-bottom:1px solid var(--line);color:var(--ink);vertical-align:top}
.v201-tx .v201-sec td{font-weight:700;padding-top:16px}
.v201-tx .v201-total td{border-bottom:none}
.v201-date{white-space:nowrap}
.v201-rate{color:var(--muted)}
.v201-tag{display:inline-block;margin-left:6px;font-size:12px;font-weight:600;border-radius:999px;padding:0 8px;
  background:var(--surface-2);color:var(--muted)}
.v201-tag-warn{background:color-mix(in srgb, var(--c-amber-700) 12%, transparent);color:var(--warn)}
@media (max-width:640px){.v201-paper{padding:18px 14px}.v201-title{font-size:22px}}
/* a VAT line opens its ledger entry; the ledger then highlights that entry (the drill's target) */
.v201-tx tr.v201-drill{cursor:pointer}
.v201-tx tr.v201-drill:hover td{background:var(--surface-2)}
.rp-table tr.rp-gl-hl td{background:var(--brand-faint)}
.rp-table tr.rp-gl-hl td:first-child{box-shadow:inset 3px 0 0 var(--brand)}
/* back on the VAT Report from the ledger: the line you opened stays marked, like the ledger's */
.v201-tx tr.v201-hl td{background:var(--brand-faint)}
.v201-tx tr.v201-hl td:first-child{box-shadow:inset 3px 0 0 var(--brand)}

/* ============================================================================
   V2 TENANT SKIN (2026-08-23) — v2's layout, metrics and typography with aboo
   colours. Frame rules are scoped to .t-shell (the tenant layout root) so the
   admin console keeps its own chrome; control/table/type metrics apply where
   the shared classes are used. Reference: sleek-app-v2 src/public/css/sleek.css.
   ========================================================================== */

/* ---- v2 type scale ---- */
.page-title{font-size:1.75rem;font-weight:600;line-height:1.25;letter-spacing:-.01em}
@media (max-width:767px){.page-title{font-size:1.5rem}}
h2{font-size:1.25rem;font-weight:600}
h3{font-size:1.1rem;font-weight:600}

/* ---- t-shell frame: v2 .app layout with aboo colours ---- */
.t-shell{--drawer-w:200px}
.t-shell .drawer{background:var(--surface);color:var(--ink);border-right:1px solid var(--line);
  display:flex;flex-direction:column}
:root[data-theme="dark"] .t-shell .drawer{background:var(--surface)}
.t-shell .nav-list{flex:1;padding:1rem .5rem 0;display:flex;flex-direction:column;gap:.25rem}
.t-shell .nav-item{flex:0 0 auto;flex-direction:row;justify-content:flex-start;gap:.5rem;
  padding:.6rem .75rem;border-radius:var(--radius);color:var(--muted);font-size:.875rem;font-weight:500}
.t-shell .nav-item:hover{background:none;color:var(--brand)}
.t-shell .nav-item.active{background:none;color:var(--brand);font-weight:600}
.t-shell .nav-ico{width:20px;font-size:15px;opacity:.95}
.t-nav-foot{padding:1rem .9rem 1.1rem;border-top:1px solid var(--line);margin-top:auto}
.t-nav-quote{font-size:12px;font-style:italic;color:var(--muted);line-height:1.45}
.t-nav-quote-by{margin-top:4px;font-style:normal;font-size:12px}
.t-nav-version{margin-top:10px;font-size:12px;color:var(--muted);opacity:.8}

/* header band — v2 .app-header (primary band) in aboo brand ink */
.t-shell .app-bar.t-header{background:var(--brand-ink);border-bottom:none;color:var(--hue-paper);
  height:auto;min-height:var(--bar-h);padding:.65rem 1rem}
.t-header-brand{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.t-logo{font-weight:700;font-size:1.25rem;letter-spacing:-.02em;color:var(--hue-paper);display:flex;align-items:center;gap:8px}
.t-logo .brand-dot{width:12px;height:12px;box-shadow:0 0 0 3px color-mix(in srgb, var(--hue-brand) 30%, transparent)}
.t-co-name{appearance:none;border:0;background:none;color:var(--hue-paper);opacity:.92;font-size:.875rem;
  padding:0;text-align:left;cursor:pointer;display:flex;align-items:center;gap:5px;max-width:100%;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.t-co-name:hover{opacity:1;text-decoration:underline}
.t-co-caret{font-size:.7em;opacity:.7}
.t-shell .t-header .user-name{color:var(--c-cyan-l90)}
/* The header toggles are var(--surface) CHIPS, so their glyph must contrast with the chip, not the
   dark band. #fff made the monochrome 🏛 white-on-white (invisible) in light mode — the 🌙/☀ are
   colour emoji so they showed regardless (owner 2026-08-26). var(--ink) is visible in both themes. */
.t-shell .t-header .theme-toggle{color:var(--ink)}
.t-shell .t-header .btn-outline.t-signout{border-color:var(--sheen-35);color:var(--hue-paper);background:transparent}
.t-shell .t-header .btn-outline.t-signout:hover{background:var(--sheen-12);border-color:var(--hue-paper);color:var(--hue-paper)}
.t-shell .t-header .confirm-q{color:var(--hue-paper)}

/* the global chat bar — v2 .sleek-chat-bar (sticky under the header) */
.sleek-chat-bar{background:var(--surface);border-bottom:1px solid var(--line);
  padding:.5rem 1rem;position:sticky;top:0;z-index:90;box-shadow:0 1px 3px var(--shade-05)}
.sleek-chat-row{display:flex;align-items:center;gap:.5rem;max-width:1200px;margin:0 auto}
.sleek-chat-input{flex:1;height:34px;padding:.3rem .75rem;border:1px solid var(--line);
  border-radius:var(--radius);font-size:.8rem;font-family:inherit;background:var(--bg);color:var(--ink)}
.sleek-chat-input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-faint);background:var(--surface)}
.sleek-chat-input::placeholder{color:var(--muted);opacity:.75}
.sleek-chat-send{width:34px;height:34px;border-radius:50%;border:0;background:var(--brand);
  color:var(--hue-deep);font-size:14px;cursor:pointer;flex:0 0 auto;display:flex;align-items:center;justify-content:center}
.sleek-chat-send:hover{filter:brightness(.94)}
.sleek-chat-send:disabled{opacity:.5;cursor:default}
.sleek-chat-panel{background:var(--surface);border-bottom:1px solid var(--line);padding:.6rem 1rem .8rem}
.sleek-chat-panel .dash-ai-scroll{max-width:1200px;margin:0 auto}
.sleek-chat-panel .dash-ai-sugs,.sleek-chat-panel .dash-ai-clear{max-width:1200px;margin:6px auto 0;display:block}
.dash-ai-sugs{display:flex;gap:6px;flex-wrap:wrap}
.dash-ai-sug{border:1px solid var(--line);background:var(--surface);border-radius:999px;
  padding:3px 12px;font-size:12.5px;cursor:pointer;color:var(--ink)}
.dash-ai-sug:hover{border-color:var(--brand);color:var(--brand)}
.dash-ai-text{font-size:13.5px;line-height:1.5}
.dash-ai-typing{color:var(--muted);font-style:italic}

/* content gutter — v2 .app-body: centred 1200px */
.t-shell .content{padding:1rem;flex:1}
.t-shell .page{max-width:1200px;margin:0 auto}
@media (min-width:768px){.t-shell .content{padding:1.5rem}}
.t-shell .page-head.with-action{position:static;background:none;padding:0;margin:2px 0 14px}

/* ---- v2 buttons (metrics; aboo colours) ---- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.5rem 1rem;border:1px solid transparent;border-radius:var(--radius);
  font-size:.875rem;font-weight:500;line-height:1.3;cursor:pointer;transition:all .2s}
.btn-sm{padding:.35rem .75rem;font-size:.8rem;border-radius:var(--radius);min-height:32px}
.btn-lg{padding:.75rem 1.5rem;font-size:1rem}
.btn-primary{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
.btn-primary:hover{background:var(--brand-hover,var(--brand));filter:var(--brand-hover-filter,brightness(.94))}
.btn-light{background:var(--surface);border-color:var(--line);color:var(--ink)}
.btn-light:hover{background:var(--brand-fainter);border-color:var(--brand);color:var(--brand)}
.btn-outline{background:transparent;border:1px solid var(--line);color:var(--brand)}
.btn-outline:hover{background:var(--brand-faint);border-color:var(--brand);color:var(--brand)}
.btn-link{border:0;background:none;color:var(--brand);padding:2px 4px;font-size:.875rem;cursor:pointer}

/* ---- v2 form controls (metrics; aboo colours) ---- */
.form-control{height:32px;padding:.3rem .5rem;font-size:.8rem;line-height:1.4;
  border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--ink);
  transition:border-color .2s}
textarea.form-control{height:auto;min-height:64px}
.form-control:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-faint)}
select.form-control,select.cb-in{appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232E575E' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .4rem center;padding-right:1.6rem;cursor:pointer}
label{font-size:.875rem;font-weight:500}

/* ---- v2 tables (th uppercase band, hover tint) ---- */
.cb-table,.rp-table{font-size:.875rem;border-radius:var(--radius-lg);overflow:hidden}
.cb-table th,.rp-table th{font-size:.75rem;font-weight:600;text-transform:uppercase;
  letter-spacing:.05em;color:var(--muted);padding:.5rem .75rem}
.cb-table td,.rp-table td{padding:.5rem .75rem}
.cb-table tbody tr:hover td,.rp-table tbody tr:hover td{background:var(--brand-fainter)}

/* ---- v2 cards ---- */
.row-card,.kpi,.rp-card,.rp-kpi,.cb-card,.dash-tri-card{border-radius:var(--radius-lg);box-shadow:var(--shadow)}
.row-card:hover,.rp-card:hover{box-shadow:var(--shadow-lg)}

/* ---- v2 badges ---- */
.badge,.rp-badge,.cb-off-tag{padding:.15rem .5rem;border-radius:10px;font-size:12px;font-weight:600}

/* print: hide the frame chrome */
@media print{
  .t-shell .drawer,.t-shell .t-header,.sleek-chat-bar,.sleek-chat-panel,.bottom-nav{display:none!important}
  .t-shell .main{margin-left:0}
}

/* v2 reports landing: flat grid of centred icon cards (index.twig) */
.rp-grid-v2{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.rp-card-v2{text-align:center;padding:1.4rem 1rem 1.2rem}
.rp-card-ico{font-size:26px;color:var(--brand);margin-bottom:10px;line-height:1}
.rp-card-v2 .rp-card-name{display:block;font-size:.95rem;font-weight:600}
.rp-card-v2 .rp-card-desc{font-size:12px;margin-top:6px}

/* v2 contacts header: title + inline "+ New", type tabs right */
.ct-head-left{display:flex;align-items:center;gap:12px}
.ct-new-btn{margin-top:2px}

/* the bank screen's contextual ask bar wears the SAME v2 chat-strip look (t-shell) */
.t-shell .cb-ask-wrap{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:.5rem .75rem;margin:0 0 14px;box-shadow:0 1px 3px var(--shade-05)}
.t-shell .cb-ask-input{height:34px;border-radius:var(--radius);background:var(--bg);font-size:.8rem}
.t-shell .cb-ask-input:focus{background:var(--surface)}
.t-shell .cb-ask-send{height:34px;width:34px;border-radius:50%;background:var(--brand);color:var(--hue-deep);font-size:14px}

/* alignment fixes (2026-08-23 audit): amounts never wrap; the Add-tag button stays one line */
.cb-table td.mono,.rp-table td.mono,.cb-table td.text-right,.rp-table td.text-right{white-space:nowrap}
.bt-tagrow .btn{white-space:nowrap;flex:0 0 auto;height:32px;padding-top:.3rem;padding-bottom:.3rem}
.bt-tagrow select{flex:1;min-width:0}

/* v2 sticky chrome: the header band stays pinned, the chat bar sticks just under it */
.t-shell{--t-head-h:74px}
.t-shell .app-bar.t-header{position:sticky;top:0;z-index:100;height:var(--t-head-h)}
.t-shell .sleek-chat-bar{top:var(--t-head-h)}

/* settings → Translations tab (v2 parity: per-key editor, overridden rows highlighted) */
.set-trans-bar{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;margin:10px 0}
.set-trans-lbl{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.set-trans-lbl .form-control{min-width:160px}
.set-trans-search{flex:1;min-width:220px}
.set-trans-count{font-size:12px;white-space:nowrap;padding-bottom:8px}
.set-trans-wrap{max-height:62vh;overflow:auto}
.set-trans-table thead th{position:sticky;top:0;background:var(--surface);z-index:1}
.set-trans-table td{vertical-align:middle}
.set-trans-key{font-size:12px;word-break:break-all;max-width:180px}
.set-trans-val{min-width:180px}
.set-trans-over td{background:color-mix(in srgb, var(--hue-brand) 8%, transparent)}
.set-trans-act{white-space:nowrap;text-align:center}
.set-note{margin:6px 0;font-size:12px;color:var(--c-teal-700)}

/* Company Details — FY start day+month pair */
.set-fy-row{display:flex;gap:8px}
.set-fy-row .set-fy-day{max-width:90px;flex:0 0 auto}
.set-fy-row select{flex:1}
/* #26 active-currency checklist (Settings ▸ Ledger display) */
/* #26 Currencies card (v2-parity Settings table): toggle the currencies the company uses */
.cur-card .cur-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
.cur-table{width:100%;margin-top:10px}
.cur-table td,.cur-table th{vertical-align:middle}
.cur-table .cur-sym{color:var(--muted)}
.cur-table td.ta-r,.cur-table th.ta-r{text-align:right}
.cur-pill{display:inline-flex;align-items:center;justify-content:center;min-width:80px;border:1px solid var(--line);border-radius:999px;padding:5px 14px;font-size:12px;font-weight:600;line-height:1;background:var(--surface);color:var(--muted)}
.cur-pill.toggle{cursor:pointer;transition:border-color .12s,color .12s}
.cur-pill.toggle:hover{border-color:var(--ok);color:var(--ok)}
.cur-pill.toggle.active{color:var(--ok);border-color:var(--ok)}
.cur-pill.base{color:var(--ok);border-color:var(--ok);background:color-mix(in srgb, var(--ok) 14%, transparent);cursor:default}
.cur-tag{display:inline-flex;align-items:center;border-radius:999px;padding:2px 10px;font-size:12px;font-weight:600;letter-spacing:.02em}
.cur-tag.base{color:var(--ok);background:color-mix(in srgb, var(--ok) 14%, transparent)}
.cur-note{margin-top:8px}
/* #1 document editor: re-denominate entry hint next to the locked currency field */
.cur-hint{display:block;margin-top:4px;font-size:12px;line-height:1.35;color:var(--muted);max-width:42ch}
/* document editor: a purchase document on a co-op's supplier contact dated from the co-op's statements on */
.de-coop-warn{margin-top:6px;font-size:12.5px;line-height:1.4;color:var(--warn);max-width:72ch}

/* Governance — financial-year lock cards */
.gov-list{display:flex;flex-direction:column;gap:10px;max-width:860px}
.gov-card.gov-locked{border-left:3px solid var(--bad)}
.gov-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.gov-year{display:flex;align-items:center;gap:8px;min-width:150px}
.gov-fy{font-weight:700;font-size:15px}
.gov-lock{font-size:16px}
.gov-lock-red{filter:hue-rotate(310deg) saturate(3)}
.gov-badge{font-size:12px;font-weight:700;color:var(--accent);border:1px solid var(--accent);border-radius:999px;padding:1px 8px}
/* partly-locked year: some periods locked but the year isn't fully locked (usually a leftover from a
   financial-year relabel) — surfaced amber so the owner can spot it and Unlock to clear (2026-08-26) */
.gov-card.gov-partial{border-left:3px solid var(--c-amber-500)}
.gov-lock-partial{filter:sepia(1) saturate(5) hue-rotate(3deg)}
.gov-badge-warn{color:var(--c-amber-700);border-color:var(--c-amber-500);background:color-mix(in srgb, var(--c-amber-500) 14%, transparent)}
:root[data-theme="dark"] .gov-badge-warn{color:var(--c-amber-400)}
.gov-range{color:var(--muted);font-size:12.5px}
.gov-counts{font-size:12.5px}
.gov-act{margin-left:auto;display:flex;align-items:center;gap:8px}
.gov-arm{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.gov-reason-in{min-width:230px}
.gov-lockinfo{display:flex;align-items:center;gap:10px}
.gov-reason{font-size:12.5px;font-style:italic}
.gov-note{background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:8px;padding:9px 13px;margin-bottom:12px;font-size:13px}
/* locked-year / locked-return indicator pill (red, unmistakable) */
.gov-badge-locked{color:var(--bad);border-color:var(--bad);background:color-mix(in srgb, var(--c-red-l51) 10%, transparent)}
:root[data-theme="dark"] .gov-badge-locked{color:var(--c-red-400)}
.gov-close-opt{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted)}
.gov-close-opt input{margin:0}
/* VAT returns tab */
.gov-tabs{margin-bottom:14px}
.gov-vat{display:flex;flex-direction:column;gap:14px;max-width:860px}
.gov-vat-h{margin:0 0 2px}
.gov-vat-period{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin:10px 0}
.gov-vat-lbl{display:flex;flex-direction:column;gap:4px;font-size:12.5px;color:var(--muted)}
.gov-vat-lbl input{min-width:150px}
.gov-vat-hint{font-size:13px}
.gov-vat-totals{display:flex;gap:22px;flex-wrap:wrap;margin:8px 0}
.gov-vat-fig{display:flex;flex-direction:column;gap:2px;font-size:13px}
.gov-vat-fig .mono{font-size:15px;font-weight:700}
.gov-vat-net .mono{color:var(--accent)}
.gov-vat-adj strong{font-size:13px}
.gov-vat-adjlist{margin:6px 0 0;padding-left:18px;font-size:12.5px}
.gov-vat-adjlist li{margin:2px 0}
.gov-vat-file{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.gov-vat-ref{min-width:230px}
.page-sub{color:var(--muted);font-size:13px;margin-top:4px;max-width:640px}
.t-gov-btn{font-size:15px}
/* row locks (journals + bank register). Only a row in a LOCKED financial year shows a lock now —
   a merely-posted row shows nothing (owner 2026-08-26). The lock is unmistakable: a bright-red ring
   around the padlock, with a help cursor so the "…see Financial Years" tooltip is discoverable. */
.row-lock{font-size:13px;cursor:default}
.row-lock-red{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;
  border-radius:50%;border:2px solid var(--c-rose-600);background:color-mix(in srgb, var(--c-rose-600) 15%, transparent);
  font-size:13px;line-height:1;cursor:help}
.row-lock-grey{opacity:.55}   /* retained for any legacy caller; registers no longer emit it */

/* Register — the statement forever */
.cb-row-posted{opacity:.78}
.cb-row-posted:hover{opacity:1}
/* An allocated line — allocated, or posted — carries a GREEN stripe on its left edge, in the same place as the brown
   stripe of an unallocated line (Andre, 9 Nov 2026). The row itself keeps its own colour. --ok is the theme's own
   green (vt.css: dark and light), so the stripe follows the 🌙 toggle. Phone cards: ux.css PHONE block. */
body.vt .cb-register-table tbody tr.cb-line.cb-row-alloc:not(.cb-row-edit) td:first-child{box-shadow:inset 3px 0 0 var(--ok)}
/* Opening-balance anchor row at the oldest end of the register — every running balance builds on it */
.cb-row-opening{background:var(--brand-faint);border-top:2px solid var(--line)}
.cb-row-opening td{font-style:italic;color:var(--muted)}
.cb-row-opening .cb-td-desc b{font-style:normal;color:var(--ink)}
/* A balance the co-op moved between its sub-accounts, or a difference booked for its statement (a journal, no line on
   any statement): a row of its own. Its "Co-op" source stays on one line (it broke at the hyphen in a narrow column). */
.cb-row-move{background:var(--brand-faint)}
.cb-row-move .cb-td-desc b{color:var(--ink)}
.cb-src-coop{background:var(--surface-2);color:var(--ink);border-radius:4px;padding:1px 6px;white-space:nowrap}
/* "Posted · N" divider between unposted (staged) rows and posted rows in the registers (v2 parity) */
.cb-postsep-td{background:var(--surface-2);color:var(--muted);
  font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:6px 10px;
  border-top:1px solid var(--line)}
.cb-table tbody tr.cb-postsep:hover td{background:var(--surface-2)}
.cb-reg-end{text-align:center;padding:10px 0 16px;font-size:12.5px}
.cb-recon{font-size:12.5px;font-weight:700;border-radius:999px;padding:3px 10px;white-space:nowrap}
.cb-recon-ok{color:var(--ok);border:1px solid currentColor}
.cb-recon-off{color:var(--warn);border:1px solid currentColor}
.cb-card-cur{font-weight:700;color:var(--accent);margin-left:4px}
/* Allocation rules — flush search bar over the list */
.rule-search-bar{margin:0 0 10px}
.rule-search-bar .form-control{width:100%}
/* r1108 bank — the rules' sort beside the search, and each rule's two dates */
.rule-search-bar{display:flex;gap:8px;flex-wrap:wrap}
.rule-search-bar input.form-control{flex:1 1 220px;width:auto}
.rule-search-bar .rule-sort{flex:0 1 200px;width:auto}
.rule-dates{display:block;font-size:12px}
/* Dashboard drill-through — every bank figure is one click from its account */
.dash-kpi-link,.dash-row-link{cursor:pointer}
.dash-kpi-link:hover{border-color:var(--accent)}
.dash-row-link:hover td{background:var(--surface-2)}
.dash-row-go{color:var(--accent);font-weight:700}
/* "‹ Back to dashboard" — shown only on a screen reached directly from the dashboard */
.dash-back{display:inline-block;margin:0 0 12px;padding:4px 8px;font-weight:600}
.dash-back:hover{text-decoration:underline}
/* Journals — the register forever */
.jrn-reg{margin-top:26px}
.jrn-chip-staged{font-size:12px;font-weight:700;color:var(--accent);border:1px solid currentColor;border-radius:999px;padding:2px 8px;white-space:nowrap}
/* Admin platform grids (companies) */
.adm-grid td{vertical-align:middle}
.adm-owner-mail{display:block;font-size:12px}
/* W9: clickable rows, filter chips + the company detail drawer */
.adm-row{cursor:pointer}
.adm-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 14px}
.adm-chip-demo{margin-left:auto}
.adm-chip-gap{width:1px;align-self:stretch;background:var(--line);margin:2px 6px}
.adm-detail-owner{padding:0 0 12px;border-bottom:1px solid var(--line);margin-bottom:12px}
.adm-detail-kv{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.adm-kv-row{display:flex;justify-content:space-between;gap:16px;align-items:baseline}
.adm-kv-k{color:var(--muted);font-size:13px}
.adm-kv-v{font-weight:600;text-align:right}
/* VAT-flag teeth in the cashbook: hide tax UI when the company is not VAT registered */
.cb-hide{display:none}

/* ===== Version badge + release notes — styled exactly like live v2 (Andre 2026-09-02) =====
   v2 (sleek.scss .version-badge): monospace, muted at 60% opacity, hover → 100% + primary;
   sidebar variant = last nav row with a top border (desktop), inline variant next to the
   wordmark (mobile). One deviation: v2's 0.6rem ≈ 9.6px is below our 12px a11y floor, so the
   size is 12px — everything else matches. The modal mirrors v2's changelog modal (560px card,
   blurred overlay, primary version headings with separators, whole history scrollable). */
.ver-badge{appearance:none;border:0;background:none;padding:0;cursor:pointer;
  font-family:"SF Mono",Monaco,Consolas,monospace;font-size:12px;letter-spacing:.02em;
  color:var(--muted);opacity:.6;transition:opacity .15s}
.ver-badge:hover{opacity:1;color:var(--brand)}
/* admin drawer foot — the "What's new" badge sits at the bottom of the dark brand-ink sidebar;
   its default --muted colour is for the light tenant drawer, so lighten it here for legibility. */
.drawer-foot{margin-top:auto;padding:12px 18px 16px;border-top:1px solid var(--sheen-08)}
.drawer-foot .ver-badge{color:var(--c-cyan-l86);opacity:.6}
.t-nav-version{margin-top:10px;padding:.4rem 0 0;border-top:1px solid var(--line)}
.ver-inline{margin-left:6px;vertical-align:middle}
.ver-inline .ver-badge{color:var(--hue-paper);opacity:.5}
.ver-inline .ver-badge:hover,.drawer-foot .ver-badge:hover{opacity:1;color:var(--hue-paper)}
@media (min-width:1024px){.ver-inline{display:none}}
.home-version{margin-top:14px;text-align:center}
.ver-modal{max-width:560px;width:92vw;max-height:80vh;display:flex;flex-direction:column}
.ver-overlay{backdrop-filter:blur(2px)}
.ver-running{font-size:12px;color:var(--muted);margin-bottom:8px}
.ver-scroll{overflow-y:auto;min-height:0}
.ver-rel{margin-bottom:14px}
.ver-rel-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;
  border-bottom:1px solid var(--line);padding-bottom:6px;margin-bottom:8px}
.ver-rel-no{font-weight:700;color:var(--brand);font-size:14px}
.ver-rel-title{font-weight:600;color:var(--ink);font-size:13px}
.ver-rel-date{color:var(--muted);font-size:12px;margin-left:auto}
.ver-rel-notes{margin:8px 0 0;padding-left:18px;color:var(--ink);font-size:13px;line-height:1.6}
.ver-rel-notes li{margin-bottom:4px}

/* ===== Admin: Migrations health tab ===== */
.mig-verdict{border-radius:var(--radius);padding:10px 14px;margin-bottom:12px;font-size:13px;font-weight:600}
.mig-verdict-ok{background:color-mix(in srgb, var(--c-green-700) 12%, transparent);color:var(--ok)}
.mig-verdict-bad{background:color-mix(in srgb, var(--c-red-l47) 12%, transparent);color:var(--bad)}
.mig-counts{display:flex;gap:16px;flex-wrap:wrap;margin-bottom:10px;font-size:13px;color:var(--muted)}
.mig-count b{color:var(--ink)}
.mig-count-bad b{color:var(--bad)}
.mig-pill{display:inline-block;font-size:12px;font-weight:600;border-radius:10px;padding:2px 9px;white-space:nowrap}
.mig-ok{background:color-mix(in srgb, var(--c-green-700) 14%, transparent);color:var(--ok)}
.mig-fail{background:color-mix(in srgb, var(--c-red-l47) 16%, transparent);color:var(--bad)}
.mig-warn{background:color-mix(in srgb, var(--c-amber-700) 14%, transparent);color:var(--warn)}
.mig-skip{background:color-mix(in srgb, var(--c-grey-787878) 14%, transparent);color:var(--muted)}
.mig-verdict-warn{background:color-mix(in srgb, var(--c-amber-700) 12%, transparent);color:var(--warn)}
.mig-row-bad td{background:color-mix(in srgb, var(--c-red-l47) 6%, transparent)}
.mig-orphan{color:var(--muted);font-size:12px}
.mig-table td{font-size:13px}
/* ========================================================================
   Documents (Sales & Purchases) — invoiceTest port. Uses brand tokens only
   (--surface/--ink/--line/--muted/--bad/--brand…) so dark mode is automatic.
   ======================================================================== */
/* nav section headers */
.nav-section{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);
  padding:14px 16px 4px;font-weight:600}
/* list page */
.doc-page{max-width:1100px}
.doc-strip{display:flex;gap:12px;margin:8px 0 14px;flex-wrap:wrap}
.doc-strip-card{flex:1 1 160px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);padding:10px 14px}
.doc-strip-card.ds-bad{border-color:var(--bad)}
.ds-lbl{font-size:12px;color:var(--muted)}
.ds-val{font-size:20px;font-weight:700;color:var(--ink);margin-top:2px}
.ds-bad .ds-val{color:var(--bad)}
/* A5: money-strip buckets are real <button>s (keyboard-accessible click-to-filter chips) — same
   clickable-card affordance as contacts.js's .aging-card-btn (border-on-hover, brand-tinted when
   the bucket's tab is active; the overdue bucket keeps its red ds-bad cue even while active). */
.doc-strip-card-btn{cursor:pointer;text-align:left;font:inherit;
  transition:border-color .12s,background .12s}
.doc-strip-card-btn:hover{border-color:var(--brand)}
.doc-strip-card-btn:focus-visible,.switch input:focus-visible + .switch-track{outline:2px solid var(--brand);outline-offset:2px}
.doc-strip-card-btn.active{border-color:var(--brand);
  background:color-mix(in srgb,var(--brand) 12%,var(--surface))}
.doc-strip-card-btn.active .ds-lbl{color:var(--brand)}
.doc-strip-card-btn.ds-bad.active{border-color:var(--bad);
  background:color-mix(in srgb,var(--bad) 12%,var(--surface))}
.doc-strip-card-btn.ds-bad.active .ds-lbl{color:var(--bad)}
.doc-toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:10px}
.doc-search{flex:1 1 260px;min-width:200px}
.doc-sort{flex:0 0 auto;width:auto}
.doc-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px;border-bottom:1px solid var(--line);padding-bottom:2px}
.doc-tab{background:none;border:0;border-bottom:2px solid transparent;padding:7px 12px;
  font-size:13px;color:var(--muted);cursor:pointer;display:flex;align-items:center;gap:6px}
.doc-tab:hover{color:var(--ink)}
.doc-tab.active{color:var(--brand);border-bottom-color:var(--brand);font-weight:600}
.doc-tab-n{font-size:12px;background:var(--brand-faint);color:var(--brand-ink);
  border-radius:9px;padding:1px 7px;min-width:18px;text-align:center}
.doc-tab.active .doc-tab-n{background:var(--brand);color:var(--hue-paper)}
/* Hub tab strip — a pill row that switches sub-screens at the top of a hub (Documents' type
   families grouped Debtors/Creditors; Notifications' Approvals/Expenses). Sits ABOVE each
   sub-screen's own underline tabs (.doc-tabs) so the two levels read as distinct. Scrolls
   sideways on a phone (mobile-first). */
.hub-tabs{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:0 0 14px;
  padding-bottom:12px;border-bottom:1px solid var(--line)}
.hub-tab-grp{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.hub-tab-cap{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);
  font-weight:600;margin-right:2px}
.hub-tab{background:var(--surface);border:1px solid var(--line);border-radius:999px;
  padding:6px 14px;font-size:13px;color:var(--ink);cursor:pointer;white-space:nowrap;
  display:inline-flex;align-items:center;gap:7px}
.hub-tab:hover{border-color:var(--brand);color:var(--brand)}
.hub-tab.active{background:var(--brand);border-color:var(--brand);color:var(--hue-paper);font-weight:600}
.hub-tab-n{font-size:12px;background:var(--brand-faint);color:var(--brand-ink);
  border-radius:9px;padding:1px 7px;min-width:18px;text-align:center}
.hub-tab.active .hub-tab-n{background:var(--hue-paper);color:var(--brand)}
/* Notification count DOTS — Approvals GREEN / Expenses RED, count centred (owner 2026-09-06).
   Shared by the app-bar shortcuts and the Notifications hub-tab counters so both read the same. */
.notif-dot{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;
  padding:0 6px;border-radius:999px;font-size:12px;font-weight:800;color:var(--hue-paper);line-height:1}
.notif-dot.appr{background:var(--ok)}
.notif-dot.exp{background:var(--bad)}
/* keep the dot's own colour on an active (brand-filled) tab — don't invert it to white-on-white */
.hub-tab.active .notif-dot{color:var(--brand);background:var(--hue-paper)}   /* readable on the active (green) tab, 2026-11-22 */
@media (max-width:640px){
  .hub-tabs{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;gap:6px 12px}
  .hub-tab-grp{flex-wrap:nowrap}
}
/* ── Documents ARROW RIBBON type-tabs (owner 2026-09-09) ──────────────────────────────────────────
   The 7 document families as one connected stepper of right-pointing rounded chevrons; a single brand
   block slides to the family you pick. DELIBERATELY separate from .hub-tab (which is shared with the
   Approvals/Expenses hub in tshell.js and stays a pill). Colours are the SAME tokens the old pills used
   — --brand fill + #fff text active, --surface idle, --ink label, --muted captions — so it reads
   identical to before in both themes and every white-label. The slide is a transform/width/clip-path
   transition; the arrows are pure CSS clip-path. --pt (14px) must match RIB_CLIP in documents.js. */
.doc-tabhead{display:flex;align-items:center;gap:12px;flex-wrap:nowrap;margin:0 0 10px}
.doc-tabhead .doctabs{flex:0 0 auto;margin:0 0 0 auto;min-width:340px;overflow:visible;padding:0}
.doc-tabhead .doctabs::-webkit-scrollbar{display:none;height:0}
.doc-tabhead .doctabs-caps{display:none}
.doc-tabhead .doc-newbtn,.doc-tabhead .doc-search-inline{flex:0 0 auto}
.doc-tabhead .doc-search-inline{flex:1 1 200px;min-width:100px;max-width:360px}

/* Search inputs get a magnifying-glass icon on the left so it's obviously a search
   (owner Andre 2026-09-17: "fix the search — must indicate that it is a search").
   Higher specificity than the `body.vt input { background: ... }` rule in vt.css so
   the shorthand doesn't wipe out `background-image`. */
body.vt input.search,body.vt input.doc-search-inline,input.search,input.doc-search-inline{
  background-image:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;background-position:10px center !important;padding-left:34px !important}

/* Mobile: stack the toolbar (search full-width on top, add button full-width below, then
   segs row scrolling horizontally). Fields align left-edge to left-edge, right-edge to
   right-edge — no more the search + add + tabs fighting on one line. */
@media (max-width:767px){
  .doc-tabhead{flex-direction:column;align-items:stretch;gap:8px;margin:0 0 10px}
  .doc-tabhead>*{flex:0 0 auto;width:100%;height:auto;margin:0;max-width:100%;min-width:0;box-sizing:border-box}
  /* Explicitly reset the flex-basis on the search + newbtn — desktop sets flex-basis:200px
     which becomes a 200px HEIGHT in this column-flex parent (search input turns into a slab). */
  .doc-tabhead .doc-search-inline{order:1;flex:0 0 auto;width:100%;max-width:100%;height:34px}
  .doc-tabhead .doc-newbtn{order:2;flex:0 0 auto;text-align:center;justify-content:center;width:100%}
  .doc-tabhead .doctabs,.doc-tabhead .segs{order:3;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;display:flex;gap:6px;padding:0}
  .doc-tabhead .doctabs::-webkit-scrollbar,.doc-tabhead .segs::-webkit-scrollbar{display:none}
  .doc-tabhead .segs .seg,.doc-tabhead .doctabs .doctab{flex:0 0 auto;white-space:nowrap}
}

/* Balance cell — one line per side (they owe / you owe), colour-coded so the money
   direction reads at a glance: green when the money is coming IN (customer owes us),
   red when it's going OUT (we owe a supplier). */
.ct-bal-line{font-size:13px;line-height:1.35}
.ct-bal-line b{font-variant-numeric:tabular-nums;margin-left:4px}
.ct-bal-us,.ct-bal-them{color:var(--bad)}
.ct-bal-credit{color:var(--ok)}

/* Quick-action chips inside the contact card — tap to dial / tap to email. On desktop
   they render inline under the code line (owner Andre 2026-09-17: "Where is the email /
   telephone / contact on this screen?"). On mobile they stretch card-edge to card-edge
   as a stacked column so long emails don't truncate. */
.ct-quick-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.ct-quick{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:8px;font-size:12.5px;font-weight:600;text-decoration:none;background:var(--brand-faint);color:var(--brand);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ct-quick:hover{background:color-mix(in srgb, var(--c-teal-l35b) 20%, transparent)}

/* The contact NAME + role pill are both clickable → contact detail (owner Andre 2026-09-17:
   "Contact pills should be clickable and go to the contacts full detail"). */
.ct-name-link{cursor:pointer;color:var(--ink)}
.ct-name-link:hover{color:var(--brand);text-decoration:underline}
.tag-link{cursor:pointer;background:none;border:none;padding:0;font:inherit;color:inherit;letter-spacing:inherit}
.tag-link:hover{filter:brightness(1.08);text-decoration:underline}
/* Role pill sits on the line UNDER the name, BEFORE the account no (owner Andre 2026-09-18:
   "move the Supplier / Customer tag to be before the Account No on the next line"). */
.ct-sub-row{display:flex;align-items:center;gap:8px;margin-top:3px;flex-wrap:wrap}
.ct-sub-row .contact-tags,.ct-sub-row .cell-sub{margin-top:0}

/* Onboarding toggle inside the Add contact form — sits below the name/email row, on by
   default. The sub-hint switches copy based on whether an email address is present. */
.ct-onboard-toggle{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:10px;font-size:13px;color:var(--ink)}
.ct-onboard-toggle .muted{flex-basis:100%;font-size:12px;color:var(--muted)}

/* Mobile contacts table → card layout. Columns are now [1] Contact, [2] Balance, [3] Actions.
   Contact person / Terms / Tax / VAT are all gone from the list — they belong on the detail
   screen. Each row becomes a stacked card with tap-to-call and tap-to-email chips. */
@media (max-width:767px){
  /* Kill the outer .tbl-wrap chrome — the cards ARE the container on mobile. */
  .ct-list-wrap,body.vt .tbl-wrap:has(.ct-list){border:0;background:transparent;overflow:visible;border-radius:0}
  .ct-list{border:0;background:transparent}
  .ct-list thead{display:none}
  .ct-list tbody{display:flex;flex-direction:column;gap:8px}
  /* Straight vertical stack — simpler than a grid area map: name row (with actions floating
     right), then pills below name aligned left, then code + balance, then the full-width
     quick-action chips at the bottom. */
  .ct-list tr{display:block;position:relative;padding:12px 14px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
  .ct-list tr>td{display:block;border:0;padding:0;text-align:left}
  .ct-list td:nth-child(1){padding-right:70px}    /* leave room for actions in the top-right */
  .ct-list td:nth-child(1) b{display:block;font-size:15px;font-weight:600;color:var(--ink)}
  .ct-list td:nth-child(1) .contact-tags{display:flex;gap:6px;margin-top:4px;justify-content:flex-start}
  .ct-list td:nth-child(1) .cell-sub{display:block;margin-top:4px;color:var(--muted);font-size:12px}
  .ct-list td:nth-child(2){margin-top:6px;font-size:13px}
  .ct-list td:nth-child(3){position:absolute;top:12px;right:14px;padding:0;text-align:right}
  .ct-list .ct-quick-actions{display:flex;flex-direction:column;gap:6px;margin-top:8px;width:100%}
  .ct-list .ct-quick{width:100%;box-sizing:border-box}
}
.doctabs{margin:0 0 14px;overflow-x:auto;overflow-y:hidden;padding:4px 0}
.doctabs::-webkit-scrollbar{height:6px}
.doctabs::-webkit-scrollbar-thumb{background:var(--line);border-radius:6px}
.doctabs-inner{width:max-content;min-width:100%}
.doctabs-caps{position:relative;height:15px;margin-bottom:5px}
.doctabs-caps:not(.ready) .doctabs-cap{visibility:hidden}   /* hide until JS aligns them (no flash) */
.doctabs-cap{position:absolute;top:0;font-size:12px;text-transform:uppercase;letter-spacing:.04em;
  color:var(--muted);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.doctabs-ribbon{position:relative;isolation:isolate;display:flex;align-items:center;width:max-content;
  --pt:14px;--rh:40px}
.doctabs-ind{position:absolute;left:0;top:0;height:var(--rh);width:0;transform:translateX(0);z-index:0;
  pointer-events:none;background:var(--brand);
  transition:transform .42s cubic-bezier(.52,.02,.16,1),width .42s cubic-bezier(.52,.02,.16,1),
    clip-path .42s cubic-bezier(.52,.02,.16,1)}
.doctabs-ind.no-anim{transition:none}
.doctab{position:relative;height:var(--rh);border:0;background:transparent;cursor:pointer;
  font-family:inherit;font-size:13px;font-weight:500;color:var(--ink);white-space:nowrap;
  display:inline-flex;align-items:center;padding:0 16px 0 26px;transition:color .28s ease}
.doctab-lbl{position:relative;z-index:1}
.doctab::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--surface);transition:background .28s ease,filter .28s ease}
.doctab.cl-left{padding-left:18px}
.doctab.cl-right{padding-right:22px}
.doctab + .doctab{margin-left:-13px}
.doctab.cl-left::before{clip-path:polygon(0 0, calc(100% - var(--pt)) 0, 100% 38%, 100% 62%, calc(100% - var(--pt)) 100%, 0 100%, 0 62%, 0 38%)}
.doctab.cl-full::before{clip-path:polygon(0 0, calc(100% - var(--pt)) 0, 100% 38%, 100% 62%, calc(100% - var(--pt)) 100%, 0 100%, var(--pt) 62%, var(--pt) 38%)}
.doctab.cl-right::before{clip-path:polygon(0 0, 100% 0, 100% 38%, 100% 62%, 100% 100%, 0 100%, var(--pt) 62%, var(--pt) 38%)}
.doctab:hover:not(.active){color:var(--brand)}
.doctab:hover:not(.active)::before{filter:brightness(.96)}
.doctab.active{color:var(--hue-paper);font-weight:600}
.doctab.active::before{background:var(--brand)}   /* static fallback when JS can't measure (jsdom / detached) */
.doctab:focus-visible{outline:2px solid var(--brand);outline-offset:1px;border-radius:6px}
/* #28 (Callan 2026-09-14): Debtors LEFT, Creditors RIGHT. On a wide hub the ribbon fills the row so
   the Creditors run (`.doctab-split` = its first tab) is pushed to the right edge; on narrow screens
   the ribbon stays max-content and scrolls as one continuous run (no split). */
@media (min-width:760px){
  .doctabs-inner,.doctabs-ribbon{width:100%}
  .doctab.doctab-split{margin-left:auto}
}
@media (max-width:640px){
  .doctabs-ribbon{--rh:38px}
  .doctab{font-size:12.5px}
}
@media (prefers-reduced-motion:reduce){
  .doctabs-ind{transition:none}
}
/* list rows */
.doc-list .doc-row{display:grid;grid-template-columns:120px 1fr 110px 130px 150px 18px;
  align-items:center;gap:10px}
.doc-c-no{font-size:13px;font-weight:600}
.doc-c-contact{display:flex;flex-direction:column;min-width:0}
.doc-c-contact .row-sub{font-size:12px;color:var(--muted)}
.doc-c-date{font-size:13px;color:var(--muted)}
.doc-c-total{text-align:right;font-weight:600;display:flex;flex-direction:column}
.doc-c-total .row-sub{font-size:12px;color:var(--muted);font-weight:400}
@media(max-width:720px){.doc-list .doc-row{grid-template-columns:1fr auto;grid-auto-rows:min-content}
  .doc-c-date,.doc-c-status{display:none}}
/* status pills */
.st-pill{display:inline-block;font-size:12px;font-weight:600;border-radius:10px;padding:2px 9px;
  white-space:nowrap}
.st-draft{background:var(--line);color:var(--ink)}
.st-issued{background:var(--brand);color:var(--brand-ink)}
.st-posted{background:var(--c-blue-l94);color:var(--c-blue-l40)}
.st-partial{background:var(--c-amber-l92);color:var(--c-orange-l27)}
.st-overdue{background:var(--c-red-l93);color:var(--bad)}
.st-paid{background:var(--c-green-l92);color:var(--c-green-l29)}
.st-void,.st-cancelled{background:var(--line);color:var(--muted);text-decoration:line-through}
:root[data-theme=dark] .st-posted{background:var(--c-blue-l22);color:var(--c-blue-l80)}
:root[data-theme=dark] .st-partial{background:var(--c-amber-l16);color:var(--c-orange-l69)}
:root[data-theme=dark] .st-overdue{background:var(--c-red-l19);color:var(--c-red-l78)}
:root[data-theme=dark] .st-paid{background:var(--c-green-l17);color:var(--c-green-l68)}
/* empty state */
.doc-empty{text-align:center;padding:48px 20px;color:var(--muted)}
.doc-empty-ico{font-size:36px;opacity:.6}
.doc-empty-title{font-size:16px;margin:8px 0 14px;color:var(--ink)}
/* detail two-column */
.detail-cols{display:grid;grid-template-columns:1fr 320px;gap:20px;align-items:start}
.detail-main{min-width:0}
.detail-side{position:sticky;top:12px;display:flex;flex-direction:column;gap:14px}
@media(max-width:900px){.detail-cols{grid-template-columns:1fr}.detail-side{position:static}}
.doc-detail-head{align-items:flex-start}
.doc-detail-headmain{display:flex;flex-direction:column;gap:2px}
/* banners */
.doc-banner{border-radius:var(--radius);padding:10px 14px;margin-bottom:12px;font-size:13px;
  display:flex;align-items:center;gap:8px}
/* A8: list-screen dashboard-KPI focus deep-link banner (documents.js) — same .doc-banner
   chassis as document_detail.js's draft/overdue/paid banners above, brand-tinted like
   doc-banner-draft (a neutral "you're viewing a subset" cue, not a warning). */
.doc-focus-banner,.doc-banner-draft{background:var(--brand-faint);color:var(--brand-ink)}
.doc-banner-bad{background:var(--c-red-l93);color:var(--bad)}
.doc-banner-void{background:var(--line);color:var(--muted)}
.doc-banner-confirm{background:var(--c-amber-l92);color:var(--c-orange-l27)}
/* paper */
.doc-paper{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:26px 28px}
.doc-paper-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:20px}
.doc-paper-co{font-size:18px;font-weight:700;color:var(--ink)}
.doc-paper-meta{text-align:right}
.doc-paper-type{font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.doc-paper-no{font-size:18px;font-weight:700;color:var(--brand)}
.doc-paper-parties{display:flex;justify-content:space-between;gap:20px;margin-bottom:18px;flex-wrap:wrap}
.doc-paper-lbl{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-right:4px}
.doc-paper-party{font-size:15px;font-weight:600;color:var(--ink);margin-top:2px}
.doc-paper-dates{font-size:13px;color:var(--ink);text-align:right;line-height:1.7}
.doc-lines-tbl{width:100%;border-collapse:collapse;margin:10px 0}
.doc-lines-tbl th{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);
  text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)}
.doc-lines-tbl td{padding:8px;border-bottom:1px solid var(--line);font-size:13px;vertical-align:top}
.doc-lines-tbl .r{text-align:right}
.doc-line-acct{display:block;font-size:12px;color:var(--muted)}
.doc-totals{margin-top:14px;margin-left:auto;width:260px}
.doc-total-row{display:flex;justify-content:space-between;padding:4px 0;font-size:13px;color:var(--ink)}
.doc-total-grand{border-top:2px solid var(--line);margin-top:4px;padding-top:8px;font-size:16px;font-weight:700}
.doc-paper-notes{margin-top:18px;padding-top:12px;border-top:1px solid var(--line);font-size:13px;color:var(--ink)}
/* rail cards */
.rail-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px}
.rail-card-title{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:10px}
.bal-rows{display:flex;flex-direction:column;gap:6px}
.bal-row{display:flex;justify-content:space-between;font-size:13px;color:var(--ink)}
.bal-out{border-top:1px solid var(--line);margin-top:4px;padding-top:8px;font-weight:700;font-size:15px}
.bal-payments{margin:12px 0;border-top:1px dashed var(--line);padding-top:10px;display:flex;flex-direction:column;gap:6px}
.bal-pay{display:flex;justify-content:space-between;font-size:12px;gap:8px}
.bal-pay-main{display:flex;flex-direction:column;color:var(--ink)}
.bal-pay-amt{display:flex;align-items:center;gap:6px;color:var(--ink);white-space:nowrap}
.bal-pay-x{border:0;background:none;color:var(--muted);cursor:pointer;font-size:12px}
.bal-pay-x:hover{color:var(--bad)}
.btn-block{display:block;width:100%;margin-top:12px}
/* pay form */
.pay-form{margin-top:12px;border-top:1px solid var(--line);padding-top:12px}
.pay-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.pay-f{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--muted)}
.pay-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
.pay-hint{font-size:12px;color:var(--muted);margin-top:8px;line-height:1.4}
.pay-adjust{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.rc-summary{display:flex;justify-content:flex-end;gap:24px;margin-top:10px;font-size:14px}
.rc-summary b{color:var(--ink)}
.rc-summary .rc-bad{color:var(--bad)}
.rc-alloc-in{max-width:140px;text-align:right;margin-left:auto}
.rc-alloc thead th.r,.rc-alloc td.r{text-align:right}
.rail-related{font-size:13px;color:var(--ink)}
/* editor */
.doc-editor{position:relative}
.autosave-note{position:absolute;right:0;top:-30px;font-size:12px;color:var(--ok)}
.edit-head-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
.ed-f{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
@media(max-width:820px){.edit-head-grid{grid-template-columns:1fr 1fr}}
.doc-edit-tbl{width:100%;border-collapse:collapse}
.doc-edit-tbl th{font-size:12px;text-transform:uppercase;color:var(--muted);text-align:left;
  padding:4px 6px;border-bottom:1px solid var(--line)}
.doc-edit-tbl th.r{text-align:right}
.doc-edit-tbl td{padding:3px 4px;vertical-align:middle}
/* Batch line grid: trim the tenant body.vt 8px control padding to 4px inside the fixed 32px
   height so descenders (the "g" in "Recurring") aren't clipped — `.doc-edit-tbl` out-specifies
   `body.vt input,body.vt select`. vertical-align:middle above centres every cell so the
   remove-✕ lines up with the row's inputs. */
.doc-edit-tbl .form-control,.doc-edit-tbl .ss-input{padding-top:4px;padding-bottom:4px;line-height:1.3}.edln-acct,.edln-item{min-width:150px}.edln-tax{min-width:110px}
.edln-n input,.edln-d input{width:90px}
.edln-del{border:0;background:none;color:var(--muted);cursor:pointer;font-size:14px;padding:6px}
.edln-del:hover{color:var(--bad)}
.ed-addline{margin:8px 0 4px}
.edit-foot{display:grid;grid-template-columns:1fr 300px;gap:20px;margin-top:16px;align-items:start}
.ed-notes{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.edit-totals{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px 16px}
@media(max-width:820px){.edit-foot{grid-template-columns:1fr}}
.edit-err{margin-top:12px}
.edit-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:18px;border-top:1px solid var(--line);padding-top:14px}
/* actions menu (floatroot) — its items one under the other: on the tenant screens vt.css makes it a flex box
   (body.vt .actions-menu{display:inline-flex}), which would set them side by side */
.actions-menu{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);flex-direction:column;
  box-shadow:var(--shadow-lg);min-width:180px;padding:6px;z-index:60}
.actions-item{display:block;width:100%;text-align:left;background:none;border:0;padding:8px 12px;
  font-size:13px;color:var(--ink);cursor:pointer;border-radius:6px}
.actions-item:hover{background:var(--brand-faint)}
.actions-item.danger{color:var(--bad)}
.actions-item:disabled{color:var(--muted);cursor:default}
.actions-sep{height:1px;background:var(--line);margin:4px 0}

/* ===== Document detail additions (detail-page port wave 2026-09-02) ===== */
.doc-pay-rows{display:flex;flex-direction:column;gap:4px;margin-top:6px;font-size:13px}
.banner-reason{margin:0 8px;width:220px;max-width:100%}
.lifec{display:flex;flex-wrap:wrap;gap:14px;margin-top:8px;font-size:12px;color:var(--muted)}
.lifec-step{display:flex;align-items:center;gap:4px}
.lifec-step.done{color:var(--ink)}
.lifec-step.now{font-weight:700;color:var(--brand)}
.lifec-step small{color:var(--muted);font-weight:400;margin-left:2px}
.investigate{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}
.investigate-summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--ink);display:flex;align-items:center;gap:6px}
.investigate-summary:hover{color:var(--brand)}
.jrn-table{width:100%;border-collapse:collapse;margin-top:8px}
.jrn-table th{font-size:12px;text-transform:uppercase;color:var(--muted);text-align:left;padding:4px 8px;border-bottom:1px solid var(--line)}
.jrn-table td{padding:4px 8px;font-size:13px;border-bottom:1px solid var(--line)}
.jrn-table tfoot td{font-weight:700;border-top:2px solid var(--line);border-bottom:none}
.jrn-table .r{text-align:right}
.jrn-bal{margin-top:6px;font-size:12px;font-weight:600}
.jrn-bal-ok{color:var(--ok)}
.jrn-bal-bad{color:var(--bad)}
.hist-card{margin-top:14px}
.grid-count{font-size:12px;background:var(--brand-faint);color:var(--brand-ink);border-radius:999px;padding:1px 7px;margin-left:6px}
/* History and notes (documents-parity sweep Wave C2) — mirrors .investigate's foot-of-paper
   look for visual cohesion with the "Investigate accounting" section right above it. */
.hn-card{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}
.hn-head{display:flex;align-items:center;gap:12px}
.hn-toggle{display:inline-flex;align-items:center;gap:6px;cursor:pointer;user-select:none;font-size:13px;font-weight:600;color:var(--ink)}
.hn-toggle:hover{color:var(--brand)}
.hn-chev{color:var(--muted);font-size:12px;width:10px}
.hn-head .btn{margin-left:auto}
.hn-compose{margin-top:12px}
.hn-compose textarea{width:100%;box-sizing:border-box}
.hn-followup{display:flex;flex-direction:column;gap:4px;margin-top:8px;max-width:220px;font-size:12.5px}
.hn-followup sleek-date{max-width:200px}
.hn-toolbar{margin-top:10px}
.hn-table{margin-top:8px}
.hn-table th.srt{cursor:pointer}
.hn-table th.srt:hover{color:var(--brand)}
.hn-date{white-space:nowrap}
.hn-action{font-weight:600}
.hn-action.hn-bad{color:var(--bad)}
.hn-action.hn-ok{color:var(--ok)}
.hn-intro{margin:10px 0 2px;font-size:12.5px;color:var(--muted)}
.send-check{flex-direction:row;align-items:center;gap:6px}
.send-check input{margin:0}
/* C4 — live email preview in the compose-send modal. Emails are light-themed HTML, so the preview
   surface stays white in dark mode too (matches what the recipient actually sees). */
.mailc-hint{display:block;font-size:12px;color:var(--muted);margin-top:3px}
.mailc-preview-label{font-size:12px;color:var(--muted);margin:10px 0 4px}
.mailc-preview{max-height:240px;overflow:auto;border:1px solid var(--line);border-radius:8px;
  background:var(--hue-paper);color:var(--c-slate-800);padding:12px 14px}
.mailc-subj{font-weight:700;font-size:13px;color:var(--c-slate-900);margin-bottom:8px;
  padding-bottom:8px;border-bottom:1px solid var(--c-slate-200)}
.mailc-msg{font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.mailc-muted{color:var(--c-slate-400)}
.mailc-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.mailc-chip{font-size:12px;background:var(--c-slate-100);color:var(--c-slate-700);border:1px solid var(--c-slate-200);
  border-radius:6px;padding:2px 8px}
/* C5 — customer share-link card (in the document detail rail) */
.share-body{display:flex;flex-direction:column;gap:8px}
.share-input{font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.share-actions{display:flex;gap:8px}
.share-actions .btn{flex:1}
.share-status,.share-hint{font-size:12.5px}
.share-stat.share-ok{color:var(--ok)}
.share-stat.share-bad{color:var(--bad)}
.share-stat.share-muted{color:var(--muted)}
.doc-banner-warn{background:color-mix(in srgb, var(--c-amber-700) 12%, transparent);color:var(--warn)}
.doc-banner-paid{background:color-mix(in srgb, var(--c-green-700) 12%, transparent);color:var(--ok)}
.doc-banner-info{background:var(--brand-fainter);color:var(--brand-ink,var(--ink));display:flex;align-items:center;gap:8px}

/* ============================================================
   Documents LIST — power-kit additions (documents.js list-UX pass).
   ============================================================ */
.doc-toolbar{position:relative}
.doc-toolbar-btns{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.doc-colpop{position:absolute;top:100%;right:0;margin-top:4px;min-width:200px}
.doc-colpop-item{display:flex;align-items:center;gap:8px;padding:6px 8px;font-size:13px;cursor:pointer;border-radius:6px}
.doc-colpop-item:hover{background:var(--brand-faint)}
.doc-colpop-foot{border-top:1px solid var(--line);margin-top:4px;padding-top:6px;text-align:right}
/* Documents LIST — advanced filters panel (A1: date range+basis, amount range, contact). */
.doc-filters-toggle.active,.doc-toolbar-btns .btn.active{background:var(--brand);color:var(--hue-paper);border-color:var(--brand)}
.doc-filters-panel{display:flex;gap:18px;flex-wrap:wrap;align-items:flex-end;width:100%;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:12px 14px;margin:2px 0 12px}
.doc-filter-field{display:flex;flex-direction:column;gap:4px;min-width:0}
.doc-filter-lbl{font-size:12px;color:var(--muted);font-weight:600}
.doc-filter-basis{display:flex;gap:4px;margin-bottom:2px}
.doc-basis-btn{background:none;border:1px solid var(--line);border-radius:999px;padding:2px 10px;
  font-size:12px;color:var(--muted);cursor:pointer}
.doc-basis-btn.active{background:var(--brand);border-color:var(--brand);color:var(--hue-paper);font-weight:600}
.doc-filter-range{display:flex;align-items:center;gap:6px}
.doc-filter-date,.doc-filter-amt{width:150px}
.doc-filter-contact{width:200px}
.doc-filter-sep{color:var(--muted);font-size:12px}
.doc-filter-actions{margin-left:auto;display:flex;align-items:flex-end}
@media(max-width:720px){
  .doc-filters-panel{flex-direction:column;align-items:stretch}
  .doc-filter-date,.doc-filter-amt,.doc-filter-contact{width:100%}
  .doc-filter-actions{margin-left:0}
}
.doc-view-chips{display:flex;gap:6px;flex-wrap:wrap;margin:-4px 0 12px}
.doc-view-chip{display:inline-flex;align-items:center;gap:4px;border:1px dashed var(--line);
  border-radius:14px;padding:3px 6px 3px 10px;font-size:12.5px;background:var(--surface)}
.doc-view-chip.active{border-color:var(--brand);border-style:solid}
.doc-view-btn{appearance:none;border:0;background:none;color:var(--ink);font-size:12.5px;
  font-weight:600;cursor:pointer;padding:2px 0}
.doc-view-chip.active .doc-view-btn{color:var(--brand)}
.doc-view-x{appearance:none;border:0;background:none;color:var(--muted);cursor:pointer;
  font-size:12px;padding:2px 6px;line-height:1;border-radius:999px}
.doc-view-x:hover{color:var(--bad);background:color-mix(in srgb, var(--c-red-700) 10%, transparent)}
/* The remove-view ✕ shows faintly on every saved-view chip so it's discoverable (not only on the
   active one), brightens on hover/focus, and stays fully visible on touch where there is no hover. */
.seg-view .doc-view-x{opacity:.5;margin-left:1px;transition:opacity .12s,color .12s,background .12s}
.seg-view:hover .doc-view-x,.seg-view:focus-within .doc-view-x,.seg-view.on .doc-view-x{opacity:1}
@media (hover:none){.seg-view .doc-view-x{opacity:1}}
.doc-view-save{cursor:pointer;color:var(--muted)}
.doc-view-save:hover{color:var(--brand);border-color:var(--brand)}
.doc-tbl-scroll{max-height:calc(100vh - 320px);overflow:auto;border-radius:var(--radius);
  border:1px solid var(--line)}
.doc-tbl{border:0;border-radius:0}
.doc-tbl thead th{position:sticky;top:0;background:var(--surface);z-index:5}
/* NOTE: never display:flex on a <td> — it stops being a table-cell, no longer stretches to the
   row height, and its bottom border drifts off the row line (owner-reported misaligned rules). */
.doc-td-actions{text-align:right;white-space:nowrap;vertical-align:middle}
.doc-td-actions .btn,.doc-td-actions .btn-row-del,.doc-td-actions .confirm-inline{vertical-align:middle}
.doc-td-actions>*+*{margin-left:6px}
.clickable{cursor:pointer}
.row-sub.sub-bad{color:var(--bad)}
.row-sub.sub-warn{color:var(--warn)}
/* A6: Sent/Viewed micro-line under a list row's status pill (ported from invoiceTest's sentLine).
   12px = the a11y floor, same as .row-sub above. */
.sent-line{font-size:12px;color:var(--muted);margin-top:3px;white-space:nowrap;cursor:default}
.sent-line.sl-ok{color:var(--ok)}
.sent-line.sl-warn{color:var(--warn)}
.sent-line.sl-bad{color:var(--bad);font-weight:650}
.doc-bulk-bar{margin-top:8px}
.doc-empty-sub{font-size:13px;color:var(--muted);margin:-6px 0 14px;max-width:360px;
  margin-left:auto;margin-right:auto}
.peek-overlay{position:fixed;inset:0;background:color-mix(in srgb, var(--c-slate-900) 45%, transparent);z-index:110;
  display:flex;justify-content:flex-end}
.peek-panel{width:100%;max-width:430px;background:var(--surface);color:var(--ink);
  height:100%;overflow-y:auto;padding:20px 22px;box-shadow:-8px 0 30px var(--shade-25);
  animation:peek-in .18s ease}
@keyframes peek-in{from{transform:translateX(24px);opacity:.4}to{transform:none;opacity:1}}
@media (prefers-reduced-motion: reduce){.peek-panel{animation:none}}
.peek-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px}
.peek-title{font-size:17px;font-weight:700;margin-right:8px}
.peek-x{appearance:none;border:0;background:none;font-size:18px;color:var(--muted);cursor:pointer;
  line-height:1;padding:4px}
.peek-sub{font-size:13px;color:var(--muted);margin-bottom:16px}
.peek-meta{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);padding:12px 0;margin-bottom:16px}
.peek-row{display:flex;justify-content:space-between;font-size:13px}
.peek-lbl{color:var(--muted)}
.peek-val{font-weight:600;color:var(--ink)}
/* C3 — the peek activity timeline (source parity). Vertical list, icon · label/sub · when. */
.peek-events{margin:0 0 16px}
.peek-ev{display:flex;gap:10px;padding:8px 2px;border-top:1px solid var(--line);font-size:12.5px}
.peek-ev:first-child{border-top:none}
.peek-ev-ico{flex:0 0 20px;text-align:center}
.peek-ev-body{flex:1 1 auto;min-width:0}
.peek-ev-label,.hn-followup>span{font-weight:600;color:var(--ink)}
.peek-ev-sub{color:var(--muted);margin-top:1px;overflow-wrap:anywhere}
.peek-ev-when{flex:0 0 auto;color:var(--muted);font-size:12px;white-space:nowrap}
.peek-ev-bad .peek-ev-label{color:var(--bad)}
.peek-events-empty{color:var(--muted);font-size:12.5px;padding:8px 2px;margin-bottom:12px}
.peek-foot{display:flex;flex-direction:column;gap:8px}
.kb-sheet-row{display:flex;justify-content:space-between;align-items:center;gap:12px;
  padding:7px 0;border-bottom:1px solid var(--line);font-size:13px}
.kb-sheet-row:last-child{border-bottom:0}
.kb-key{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--bg);
  border:1px solid var(--line);border-radius:6px;padding:2px 9px;font-weight:600;font-size:12.5px}
.doc-page.dense .doc-tbl th{padding:5px 8px}
.doc-page.dense .doc-tbl td{padding:5px 8px;font-size:12px}
.doc-page.dense .doc-tbl-scroll{max-height:calc(100vh - 260px)}
@media(max-width:720px){
  .doc-tbl-scroll{max-height:none;border:0}
  .doc-tbl thead{display:none}
  .doc-tbl,.doc-tbl tbody,.doc-tbl tr{display:block;width:100%}
  .doc-tbl tr{border:1px solid var(--line);border-radius:var(--radius);margin-bottom:8px;
    padding:8px 12px;background:var(--surface)}
  .doc-tbl td{display:flex;justify-content:space-between;align-items:center;gap:10px;
    padding:5px 0;border:0;min-height:32px}
  .doc-tbl td[data-label]::before{content:attr(data-label);font-size:12px;
    text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:600}
  .doc-tbl td.cb-th-sel,.doc-tbl td.doc-td-actions{justify-content:flex-end}
  .doc-tbl .cb-th-sel input[type=checkbox]{width:20px;height:20px}
  .doc-bulk-bar{position:sticky;bottom:0;z-index:15;box-shadow:0 -2px 10px var(--shade-10)}
  .peek-panel{max-width:100%}
}

/* ===== Document editor additions (editor port wave 2026-09-02) ===== */
.ctc-filter{font-size:12px}
.edln-move:hover{color:var(--brand)}
/* Normal table-cell (NOT display:flex — a flex td doesn't stretch to the row height, so the ✕
   floated to the row top). vertical-align:middle on .doc-edit-tbl td now centres it. */
.edln-x{text-align:center;white-space:nowrap}
.doc-numprev{margin:-8px 0 12px}
/* .mono/.text-right were scoped to .cb-page/.cb-table only — Documents tables never got them,
   so money rendered left-aligned & proportional there. Additive widening: */
.doc-page .mono,.doc-edit-tbl .mono,.doc-lines-tbl .mono,.bug-detail .mono{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums}
.doc-edit-tbl td.text-right, .doc-lines-tbl td.text-right{text-align:right}
@media(max-width:820px){
  .doc-edit-tbl thead{display:none}
  .doc-edit-tbl, .doc-edit-tbl tbody, .doc-edit-tbl tr, .doc-edit-tbl td{display:block;width:100%}
  .doc-edit-tbl tr{border:1px solid var(--line);border-radius:var(--radius);padding:8px;margin-bottom:10px}
  .doc-edit-tbl td{padding:4px 0}
  .doc-edit-tbl td[data-th]::before{content:attr(data-th);display:block;font-size:12px;
    text-transform:uppercase;color:var(--muted);margin-bottom:2px}
  .edln-n input, .edln-d input{width:100%}
  .edln-x{text-align:left;margin-top:4px}
  .edit-totals{position:sticky;bottom:0;z-index:5;box-shadow:0 -4px 10px var(--shade-08)}
}

/* ===== Bug reporting: tenant widget + admin triage (wave 2026-09-02) ===== */
.bug-fab{position:fixed;right:20px;bottom:20px;width:44px;height:44px;border-radius:50%;
  background:var(--bad);color:var(--hue-paper);border:0;font-size:20px;line-height:1;cursor:pointer;
  box-shadow:0 4px 14px var(--shade-25);z-index:900}
.bug-fab:hover{filter:brightness(.94)}
.bug-top{color:var(--bad)}
.bug-top:hover{color:var(--bad);filter:brightness(.92)}
@media (max-width:768px){
  /* above the company app's bottom menu: its height is vt.css --mobile-nav-h (72.5px; it was taken as 60px, so the bug
     sat 2.5px on the menu — Callan, 2 Dec 2026: "yes fix the phone menu overlap too"); 60px where it is not set */
  .bug-fab{display:inline-flex;align-items:center;justify-content:center;right:12px;
    bottom:calc(var(--mobile-nav-h, 60px) + env(safe-area-inset-bottom, 0px) + 10px);width:34px;height:34px;
    border-radius:8px;font-size:16px;box-shadow:0 3px 10px var(--shade-22);z-index:900}
  /* The document editor also pins a bottom action bar (Save/Confirm) in that corner — lift the bug
     above it so it stays "at the bottom above the menu" without covering the buttons. One rule,
     scoped to the editor via :has(.de-page), so every other screen keeps it just above the menu. */
  body.vt:has(.de-page) .bug-fab{bottom:calc(var(--mobile-nav-h, 60px) + env(safe-area-inset-bottom, 0px) + 112px)}
}
/* a tablet up to 900px still shows the company app's bottom menu, and from 769px the bug kept its desktop place (bottom
   20px) ON it: measured at 820 x 1180 (an iPad Air), its foot at 1160, the menu's top at 1108 (Callan, 2 Dec 2026: "check
   that everything is correct on mobile and tablet"). Only its place moves (above the menu; in the editor above its pinned
   bar, as on a phone); its size stays the desktop one */
@media (min-width:769px) and (max-width:900px){
  body.vt .bug-fab{bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 10px)}
  body.vt:has(.de-page) .bug-fab{bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 112px)}
}
.bug-fab-inline{background:none;border:0;color:var(--hue-paper);opacity:.85;font-size:16px;line-height:1;
  cursor:pointer;padding:6px;min-width:32px;min-height:32px}
.bug-fab-inline:hover{opacity:1}
@media (min-width:769px){ .bug-fab-inline{display:none} }
.bug-thumb{display:block;max-width:100%;border:1px solid var(--line);border-radius:var(--radius);margin:0 0 12px}
.bug-thumb-none{font-size:12.5px;color:var(--muted);margin:0 0 12px}
.bug-success{font-size:14px;font-weight:600;color:var(--ok);padding:16px 0;text-align:center}
.bug-pill{display:inline-block;font-size:12px;font-weight:600;border-radius:10px;padding:2px 9px;white-space:nowrap}
.bug-pri-low{background:color-mix(in srgb, var(--hue-rail) 12%, transparent);color:var(--muted)}
.bug-pri-normal{background:color-mix(in srgb, var(--hue-deep) 8%, transparent);color:var(--ink)}
.bug-pri-high{background:color-mix(in srgb, var(--c-amber-700) 14%, transparent);color:var(--warn)}
.bug-pri-urgent{background:color-mix(in srgb, var(--c-red-700) 14%, transparent);color:var(--bad)}
.bug-st-open{background:color-mix(in srgb, var(--c-amber-700) 14%, transparent);color:var(--warn)}
.bug-st-progress{background:var(--brand-faint);color:var(--brand-ink)}
.bug-st-closed{background:color-mix(in srgb, var(--c-green-700) 14%, transparent);color:var(--ok)}
.bug-row{cursor:pointer}
.bug-row:hover{background:var(--surface-2)}
.bug-cam{margin-left:6px}
.bug-desc{white-space:pre-wrap}
.bug-shot-wrap{margin:0 0 16px}
.bug-shot-thumb{max-width:320px;max-height:220px;border:1px solid var(--line);border-radius:var(--radius);
  cursor:zoom-in;display:block}
.bug-console-pre{font-size:12.5px;background:var(--surface-2);border:1px solid var(--line);
  border-radius:var(--radius);padding:10px 12px;max-height:220px;overflow:auto;white-space:pre-wrap;word-break:break-word}
.bug-comment{border-bottom:1px solid var(--line);padding:8px 0}
.bug-comment:last-child{border-bottom:0}
.bug-comment-head{display:flex;gap:8px;align-items:baseline;font-size:13px}
.bug-comment-body{font-size:13.5px;margin-top:2px;white-space:pre-wrap}
.bug-zoom{position:fixed;inset:0;background:color-mix(in srgb, var(--c-slate-900) 85%, transparent);display:flex;align-items:center;
  justify-content:center;z-index:1000;cursor:zoom-out;padding:24px}
.bug-zoom-img{max-width:95vw;max-height:95vh;border-radius:6px;box-shadow:var(--shadow-lg)}

/* == Billing console (admin/billing.js) — subs list, detail panel, tiers catalogue ============= */
.bl-tabs{margin-bottom:14px}
.bl-detail-badges{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:6px 0 12px}
.bl-ends{border:1px solid var(--warn);color:var(--warn);background:transparent}
.bl-actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 18px}
.bl-section{margin-top:18px}
.bl-section-title{font-size:14px;font-weight:700;color:var(--muted);text-transform:uppercase;
  letter-spacing:.04em;margin:0 0 8px}
/* cancel-mode radio cards (period end vs immediate) */
.bl-radio-group{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.bl-radio-card{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;cursor:pointer;
  border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.bl-radio-card.active{border-color:var(--hue-brand);
  box-shadow:0 0 0 1px var(--hue-brand) inset}
.bl-radio-card input[type="radio"]{margin-top:3px}
.bl-radio-card-body{display:flex;flex-direction:column;gap:2px}
.bl-radio-card-title{font-size:14px;font-weight:600;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.bl-radio-card-sub{font-size:12.5px;color:var(--muted)}
/* tiers catalogue */
.bl-tier-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.bl-tier-card{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);
  padding:14px;display:flex;flex-direction:column;gap:8px}
.bl-tier-head{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:15px}
.bl-tier-code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.03em}
.bl-tier-price{font-size:14px;font-weight:600}
.bl-tier-desc{font-size:12.5px;color:var(--muted)}
.bl-tier-actions{display:flex;gap:8px;margin-top:auto}
.bl-tier-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
@media (max-width:560px){ .bl-tier-form-grid{grid-template-columns:1fr} }

/* == Support-access impersonation (shared/impersonate.js) ====================================== */
:root{ --imp-h:37px }
.impersonate-banner{position:fixed;top:0;left:0;right:0;z-index:120;height:var(--imp-h);
  display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:nowrap;
  background:var(--c-amber-200);color:var(--hue-deep);padding:0 16px;font-size:13px;font-weight:600;
  box-shadow:0 2px 6px var(--shade-15)}
:root[data-theme="dark"] .impersonate-banner{background:var(--c-amber-700);color:var(--c-orange-50)}
.imp-banner-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.imp-banner-text b{font-weight:700}
.imp-exit-btn{flex:0 0 auto;background:color-mix(in srgb, var(--hue-deep) 12%, transparent);border:1px solid color-mix(in srgb, var(--hue-deep) 35%, transparent);color:inherit}
:root[data-theme="dark"] .imp-exit-btn{background:var(--shade-22);border-color:var(--shade-40)}
/* while a grant is live the whole frame drops below the banner: flow content via padding, the
   fixed drawer + sticky app bar via their own top offsets (both shells share these classes) */
.layout.imp-on{padding-top:var(--imp-h)}
.layout.imp-on .drawer{top:var(--imp-h);height:calc(100% - var(--imp-h))}
.layout.imp-on .app-bar{top:var(--imp-h)}

/* == admin/users.js — sortable users table ===================================================== */
.user-table tbody tr{cursor:pointer}
.user-table tbody tr:hover{background:var(--brand-faint)}
tr.user-row.row-hl{animation:rowflash 1.8s ease-out}

/* == admin/user_detail.js — identity + support-access cards ==================================== */
.id-sub{font-size:12px;font-weight:500;word-break:break-all}
.imp-active-list{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.imp-active-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;
  padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.imp-control-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}
.imp-control-row .form-control{flex:1 1 220px}

/* == tenant/settings.js — Support access code ================================================== */
.support-code-box{border:1px solid var(--hue-brand);
  background:var(--accent-weak,color-mix(in srgb, var(--hue-brand) 8%, transparent));border-radius:8px;padding:16px;
  margin-bottom:12px;text-align:center}
.support-code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:28px;
  font-weight:700;letter-spacing:.25em;color:var(--ink);user-select:all}
.support-code-expiry{font-size:12px;color:var(--muted);margin-top:8px}

/* == Batch invoicing — recurrence + friendly tokens (tenant/batches.js additions) ============== */
.bt-token-chips{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.bt-token-select{width:auto;max-width:100%;font-size:12px}
/* Notes token pills (owner 2026-09-19): clickable chips that insert [MONTH]/[YEAR] at the caret
   in the notes textarea (see insertToken). Replaces the old "+ Insert a token…" select. Notes are
   still stored/rendered as PLAIN TEXT with token substitution, so this is presentation-only. */
.bt-token-pills{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:6px}
.bt-token-pills-lead{font-size:12px;color:var(--muted)}
.bt-token-pill{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;
  line-height:1;padding:5px 9px;border-radius:999px;cursor:pointer;
  border:1px solid var(--brand);background:var(--brand-faint,color-mix(in srgb,var(--brand) 12%,transparent));
  color:var(--ink);transition:background .12s,color .12s}
.bt-token-pill:hover{background:var(--brand);color:var(--c-cyan-l9)}
.bt-token-preview{margin-top:4px;font-size:12.5px}
.bt-token-preview-lead{font-weight:600;color:var(--ink)}
/* Keep the date + end-mode (+ optional until-date / after-N) on ONE line. flex-wrap:wrap stacked
   them when 130+130 didn't fit the cell → every row grew to ~90px and threw the ✕ + dividers out.
   nowrap + non-shrinking controls keep the row a single ~40px line; the cell (and the h-scroll
   table) widen to fit when the "Until…/After…" control appears. */
.bt-period-row{display:flex;gap:6px;align-items:center;flex-wrap:nowrap}
.bt-period-row .form-control{width:120px;flex:0 0 auto}
.bt-period-row sleek-date{width:122px;flex:0 0 auto}
.edln-kind{min-width:120px}
.edln-period{min-width:252px}
.edln.bt-line-retired{opacity:.5}
.edln.bt-line-retired td{text-decoration:line-through;text-decoration-color:var(--muted)}
.edln.bt-line-retired input,.edln.bt-line-retired select{text-decoration:line-through;color:var(--muted)}
/* S17: "After N runs" end mode + run history + next-run estimate */
.bt-period-row .bt-runs-n{width:76px}
.bt-runs-used{white-space:nowrap}
.bt-runs-done{color:var(--bad)}
.bt-next-est{margin:-6px 0 10px}
.bt-runs{margin-top:12px}
.bt-run-docs td{padding:6px 10px;background:color-mix(in srgb, var(--hue-brand) 5%, transparent)}
.bt-run-doclist{display:flex;flex-direction:column;gap:2px;align-items:flex-start}
.bt-run-doc{padding:2px 0}

/* ── batch line editor: INLINE inside the selected member card (golden rule #7) + uniform control
   height & baseline (golden rule #9) + date-popup clipping fix (owner 2026-09-19) ─────────────── */
/* One shared control height for every control that shares a row. Scoped in USE to the batch line
   rows below (never applied to global .form-control/.btn — too risky app-wide). */
:root{--control-h:34px}
/* The line grid, expanded in place under the member's head/summary. */
.bt-member-lines{margin-top:12px;border-top:1px solid var(--line);padding-top:12px;cursor:default}
.bt-member-lines .doc-edit-tbl{width:100%}
.bt-member-lines .ed-addline{margin:10px 0 2px}
.bt-line-tokens{margin:2px 0 12px}
/* Template schedule: next-run date + auto-run toggle in the details form (owner 2026-09-19). A
   comfortable two-column row that stacks on narrow screens; the date input rides .form-control so
   it shares the form's control height. */
.bt-schedule{display:flex;flex-wrap:wrap;gap:16px 28px;align-items:flex-start}
.bt-sched-date{min-width:200px}
.bt-sched-date input[type=date]{max-width:220px}
.bt-sched-auto{display:flex;flex-direction:column;gap:4px}
.bt-sched-freq{min-width:180px}
.bt-sched-freq select{max-width:220px}
.bt-sched-cur-val{font-weight:600;line-height:var(--control-h,38px)}
.bt-sched-hint{color:var(--muted);font-size:12px;max-width:340px}
@media(max-width:560px){.bt-schedule{flex-direction:column;gap:14px}}
/* Date-picker popup fix: <sleek-date> appends its .sleek-cal calendar INSIDE itself (position:
   absolute) rather than portalling to <body>, so any scroll ancestor whose overflow != visible
   clips it. The global .table-wrap sets overflow-x:auto, which per spec forces overflow-y to auto
   as well — that hid the Period calendar. We (a) scope the batch grid wrap to overflow:visible so
   the popup escapes, and (b) give the line table `table-layout:fixed;width:100%` so it NEVER
   exceeds its container — with no horizontal overflow there is nothing for an ancestor to clip
   (and no ragged right edge / page scroll), so the date popup shows in full. The searchSelect
   popups are already safe (position:fixed, body-appended). */
.edit-lines.bt-lines-wrap{overflow:visible}
.edln-period-cell .sleek-cal{z-index:500}
/* Fixed layout keeps every line within the card width; inputs are width:100% so they fill each
   cell. Item/Description/Tax/Account get the readable share; Qty/Price stay compact; the ✕ is a
   thin fixed column. On wide screens the columns spread proportionally; they never overflow. */
.bt-line-tbl{table-layout:fixed;width:100%}
.bt-line-tbl th.edln-item{width:16%}
.bt-line-tbl th.edln-desc{width:20%}
.bt-line-tbl th.edln-n{width:8%}
.bt-line-tbl th.edln-tax{width:13%}
.bt-line-tbl th.edln-acct{width:18%}
.bt-line-tbl th.edln-kind{width:10%}
.bt-line-tbl th.edln-x{width:5%}
/* Fixed columns only contain the table if the controls can shrink into them: inputs, selects and
   searchSelect wrappers fill their cell and may shrink below their intrinsic min-width. */
.bt-line-tbl td .form-control,.bt-line-tbl td .ss,.bt-line-tbl td .ss-input,
.bt-line-tbl td select,.bt-line-tbl td sleek-date{width:100%;min-width:0}
/* Comfortable cell spacing (decent, not excessive — golden rule): more breathing than the dense
   documents grid, with clear vertical separation between the two rows of one line and between lines. */
.bt-member-lines .doc-edit-tbl td{padding:6px 8px}
.edln-main > td{padding-top:12px}
.edln-period-row > td{padding-top:2px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.edln-period-cell{padding-left:18px}   /* subtle indent → the period reads as this line's 2nd row */
/* Second-row period controls, each with a small inline From / Until label above it. */
.bt-period-row{display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap}
.bt-period-fld{display:flex;flex-direction:column;gap:3px;margin:0}
.bt-period-lbl{font-size:12px;color:var(--muted);white-space:nowrap}
.bt-period-row sleek-date{width:150px;flex:0 0 auto}
/* Kind now lives on the line's second row (next to the period), freeing the main row's width. */
.bt-period-wrap{display:flex;gap:14px 28px;align-items:flex-end;flex-wrap:wrap}
.bt-kind-sel{width:150px}
.bt-period-row .bt-endmode{width:160px;flex:0 0 auto}
.bt-period-row .bt-runs-n{width:96px;flex:0 0 auto}
/* Uniform control height + one vertical baseline across every control in a batch line row: the
   text inputs, number steppers, native <select>s, the searchSelect .ss-input and the <sleek-date>
   inner input all pin to --control-h with border-box sizing so none renders taller/shorter. */
.edln .form-control,.edln .ss-input,.edln select,.edln .btn,
.edln sleek-date .sleek-date-in,
.bt-period-row .form-control,.bt-period-row .ss-input,.bt-period-row select,
.bt-period-row sleek-date .sleek-date-in{height:var(--control-h);box-sizing:border-box}
.edln td{vertical-align:middle}
/* Mobile (≤820px, card-per-cell): pull the period row up under its line's fields so the two rows
   still read as one line rather than two separate bordered cards. */
@media(max-width:820px){
  .bt-member-lines .edln-period-row > td{border-bottom:0;padding-top:4px}
  .bt-member-lines .edln-period-cell{padding-left:0}
  .bt-member-lines .bt-period-row sleek-date,
  .bt-member-lines .bt-period-row .bt-endmode,
  .bt-member-lines .bt-period-row .bt-runs-n{width:100%}
}

/* == public customer document page (/d/{token}) — public_doc.js ================================ */
.pd-page{max-width:860px;margin:0 auto;padding:18px 12px 40px}
.pd-wrap{display:flex;flex-direction:column;gap:12px}
.pd-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg,12px);padding:18px}
.pd-loading{color:var(--muted);text-align:center;padding:42px 18px;font-size:14px}
.pd-invalid{text-align:center;padding:44px 18px}
.pd-invalid-icon{font-size:34px;margin-bottom:10px}
.pd-invalid-title{font-size:19px;margin:0 0 8px;color:var(--ink)}
.pd-invalid-sub{font-size:13px;color:var(--muted);margin:0 0 4px}
/* slim action bar */
.pd-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg,12px);padding:12px 16px}
.pd-org-name{font-weight:700;font-size:15px;color:var(--ink)}
.pd-doc-id{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pd-doc-no{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.pd-bar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pd-pill{display:inline-block;font-size:12px;font-weight:700;letter-spacing:.04em;border-radius:999px;padding:2px 10px}
.pd-pill-paid{background:color-mix(in srgb, var(--c-green-700) 14%, transparent);color:var(--ok)}
.pd-pill-draft{background:var(--line);color:var(--muted)}
/* banners */
.pd-banner{border-radius:var(--radius,8px);padding:10px 14px;font-size:13px}
.pd-banner-ok{background:color-mix(in srgb, var(--c-green-700) 12%, transparent);color:var(--ok)}
.pd-banner-bad{background:color-mix(in srgb, var(--c-red-700) 10%, transparent);color:var(--bad)}
.pd-banner-void{background:var(--line);color:var(--muted)}
/* approve / decline card */
.pd-decide-title{font-weight:700;font-size:15px;color:var(--ink);margin-bottom:2px}
.pd-decide-sub{font-size:13px;color:var(--muted);margin-bottom:12px}
.pd-field{display:block;margin-bottom:10px}
.pd-lbl{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.03em}
.pd-field .pd-lbl{display:block;margin-bottom:4px}
.pd-err{font-size:13px;color:var(--bad);margin:6px 0}
/* public invoice — "Amount to pay now" card (partial payment) */
.pd-pay-card{border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin:10px 0;background:var(--surface-2)}
.pd-pay-title{font-weight:700;color:var(--ink);margin-bottom:8px}
.pd-pay-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pd-pay-lbl{font-size:13px;color:var(--muted)}
.pd-pay-input{max-width:180px;text-align:right}
.pd-pay-hint{font-size:12.5px;color:var(--muted);margin-top:8px}
.pd-pay-err{margin-top:8px}
.pd-decide-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:4px;flex-wrap:wrap}
/* the paper */
.pd-paper{padding:22px}
.pd-paper-head{display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:18px}
.pd-org-co{font-weight:700;font-size:17px;color:var(--ink);margin-bottom:4px}
.pd-org-line{font-size:13px;color:var(--muted);line-height:1.5}
.pd-meta{text-align:right;min-width:180px}
.pd-meta-type{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.pd-meta-no{font-size:17px;font-weight:700;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;margin-bottom:6px}
.pd-meta-row{font-size:13px;color:var(--ink)}
.pd-meta-row .pd-lbl{margin-right:6px}
.pd-billto{margin-bottom:14px}
.pd-billto-name{font-weight:600;font-size:14px;color:var(--ink)}
/* lines table — scrolls inside its own wrapper on phones, never the page body */
.pd-tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:4px 0}
.pd-lines{width:100%;border-collapse:collapse;min-width:520px}
.pd-lines th{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);text-align:left;padding:8px;border-bottom:2px solid var(--line)}
.pd-lines td{font-size:13px;padding:9px 8px;border-bottom:1px solid var(--line);vertical-align:top}
.pd-lines .r,body.vt .cb-register-table .cb-line .cb-settlement .cb-settlement-table td:last-child{text-align:right;white-space:nowrap}
/* totals */
.pd-totals{margin-top:14px;margin-left:auto;width:280px;max-width:100%;display:flex;flex-direction:column;gap:5px}
.pd-tot-row{display:flex;justify-content:space-between;gap:24px;font-size:13px}
.pd-tot-row>span:first-child{color:var(--muted)}
.pd-tot-grand{font-size:14px;font-weight:600;border-top:1px solid var(--line);padding-top:6px}
.pd-tot-grand>span:first-child{color:var(--ink)}
.pd-tot-balance{font-size:15px;font-weight:700}
.pd-tot-balance>span:first-child{color:var(--ink)}
/* how to pay */
.pd-paybox-title{font-weight:700;font-size:14px;color:var(--ink);margin-bottom:8px}
.pd-pay-rows{display:flex;flex-direction:column;gap:5px}
.pd-pay-row{display:flex;gap:14px;font-size:13px;align-items:baseline}
.pd-pay-row .pd-lbl{min-width:110px}
.pd-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.pd-pay-note{font-size:12px;color:var(--muted);margin-top:10px}
/* footer */
.pd-foot{text-align:center;font-size:12px;color:var(--muted);margin-top:6px}
.pd-foot-brand{font-weight:700}
/* phones: stack the paper head, full-width actions */
@media (max-width:560px){
  .pd-page{padding:10px 8px 32px}
  .pd-paper{padding:16px 14px}
  .pd-paper-head{flex-direction:column;gap:10px}
  .pd-meta{text-align:left;min-width:0}
  .pd-bar-actions,.pd-totals{width:100%}
  .pd-bar-actions .btn{flex:1;text-align:center}
}

/* == Approvals (queue screen + editor submit + detail approval banner) ========================= */
.apv-toolbar{display:flex;justify-content:flex-end;margin-bottom:10px}
.apv-tbl .apv-td-actions{text-align:right;white-space:nowrap;width:1%}
.apv-type{display:inline-block;font-size:12px;font-weight:700;background:var(--brand-faint);
  color:var(--brand-ink);border-radius:6px;padding:1px 6px;margin-right:6px}
.apv-st{display:inline-block;font-size:12px;font-weight:600;border-radius:10px;padding:2px 9px;white-space:nowrap}
.apv-st-pending{background:var(--c-amber-l92);color:var(--c-orange-l27)}
.apv-st-approved{background:var(--c-green-l92);color:var(--c-green-l29)}
.apv-st-rejected{background:var(--c-red-l93);color:var(--bad)}
.apv-st-withdrawn{background:var(--line);color:var(--muted)}
:root[data-theme=dark] .apv-st-pending{background:var(--c-amber-l16);color:var(--c-orange-l69)}
:root[data-theme=dark] .apv-st-approved{background:var(--c-green-l17);color:var(--c-green-l68)}
:root[data-theme=dark] .apv-st-rejected{background:var(--c-red-l19);color:var(--c-red-l78)}
.apv-row-actions,.apv-reject{display:inline-flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.apv-reject .form-control{width:220px;min-width:150px;font-size:13px}
.apv-reason-sub,.apv-row-err{white-space:normal;text-align:right;max-width:280px;margin-top:4px;margin-left:auto}
.apv-banner{flex-wrap:wrap}
.apv-banner .apv-banner-msg{flex:1 1 260px}
.apv-banner .apv-reason-input{flex:1 1 180px;width:auto;min-width:150px;font-size:13px}
.apv-banner-err{flex-basis:100%;font-size:12px;color:var(--bad)}

/* == Global search / Ctrl+K palette (documents parity sweep A7) =============================
   Reuses .modal-overlay/.modal-card/.modal-wide (see openBulkPaymentModal in documents.js for
   the same plain-DOM technique) — these rules only add the palette's own input/results chrome.
   All colours ride the existing brand tokens, so light/dark need no extra overrides here. */
.gsearch-card{padding:0;max-width:580px;width:100%;overflow:hidden;display:flex;flex-direction:column;max-height:74vh}
.gsearch-inputrow{display:flex;align-items:center;gap:8px;padding:14px 16px;border-bottom:1px solid var(--line)}
.gsearch-input{flex:1;border:none;background:transparent;color:var(--ink);font-size:16px;padding:4px 0;height:auto;border-radius:0}
.gsearch-input:focus{outline:none;box-shadow:none}
.gsearch-hint{padding:0 16px 12px;font-size:12px;color:var(--muted)}
.gsearch-results{flex:1;min-height:0;overflow-y:auto;padding:6px}
.gsearch-group{margin:4px 0}
.gsearch-group-title{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;
  color:var(--muted);padding:8px 10px 4px}
.gsearch-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;
  border-radius:8px;cursor:pointer}
.gsearch-row:hover{background:var(--bg)}
.gsearch-row.kb-focus{background:var(--brand-faint)}
.gsearch-row-main{font-size:14px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gsearch-row-sub{font-size:12px;color:var(--muted);white-space:nowrap;flex:0 0 auto}
@media (max-width:560px){
  .gsearch-row{flex-direction:column;align-items:flex-start;gap:2px}
  .gsearch-row-sub{white-space:normal}
}

/* == Attachments (shared card — documents parity sweep C1: doc + contact attachments) ========== */
.attach-card{margin-top:14px}
.attach-drop{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1.5px dashed var(--line);
  border-radius:var(--radius);padding:14px;margin-bottom:12px;transition:border-color .15s,background-color .15s}
.attach-drop.is-dragover{border-color:var(--brand);background:var(--brand-faint)}
.attach-drop-hint{font-size:13px;color:var(--muted)}
/* visually-hidden but still focusable/AT-reachable — the real <button> beside it drives the click */
.attach-file-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0}
.attach-empty{padding:18px 0}

/* ── Recurring invoices (documents parity Wave E1 — recurring.js) ── */
.head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.rec-tbl td{vertical-align:top}
.rec-notes{font-size:12px;color:var(--muted);margin-top:2px;max-width:22rem}
.rec-sub{font-size:12px;color:var(--muted);margin-top:2px}
.rec-type{font-size:12px;font-weight:600;color:var(--brand-ink);background:var(--brand-faint);
  border-radius:8px;padding:2px 8px;white-space:nowrap}
.rec-actions{white-space:nowrap}
.rec-actions .btn{margin-left:4px}
.rec-row.rec-ended{opacity:.72}
/* create/edit modal */
.rec-modal{max-width:760px}
.rec-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:6px}
.rec-f-wide{grid-column:1 / -1}
.rec-lines-h{font-size:14px;margin:12px 0 6px;color:var(--ink)}
.rec-lines-tbl th,.rec-lines-tbl td{padding:4px 6px}
.rec-lines-tbl .form-control{min-width:0}
.rec-lines-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px}
.rec-est{font-size:13px;color:var(--muted)}
.rec-est b{color:var(--ink)}
@media(max-width:640px){.rec-grid{grid-template-columns:1fr}}
/* reminders settings (X2 — settings.js Reminders tab) */
.rem-run-summary{font-size:13px;color:var(--ink);background:var(--brand-faint);border-radius:var(--radius);padding:10px 12px}
.rem-run-skip{font-size:12px;color:var(--muted);margin-top:4px}
/* reminder rail card (X2b — document_detail.js) */
.rem-state{font-size:13px;color:var(--ink);margin-bottom:8px}
.rem-state.rem-muted{color:var(--muted)}
.rem-hint{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.4}
/* muted row indicator (X2b — documents.js list) */
.doc-muted-flag{font-size:12px;color:var(--muted);white-space:nowrap}
/* inline new-contact quick-add (F1 — document_editor.js) */
.ed-f-lbl{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ed-newcontact{background:none;border:0;color:var(--brand);font-size:12px;font-weight:600;cursor:pointer;padding:0}
.ed-newcontact:hover{text-decoration:underline}
.nc-modal{max-width:440px}
/* saved document templates (F3 — document_editor.js) */
.ed-line-tools{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.tpl-modal{max-width:520px}
.tpl-list{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;max-height:340px;overflow:auto}
.tpl-row{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--line);border-radius:8px}
.tpl-name{flex:1;font-size:13px;color:var(--ink)}
.tpl-del{color:var(--bad)}
.tpl-empty{font-size:13px;color:var(--muted);padding:8px 0}
.tpl-savenew{border-top:1px solid var(--line);padding-top:12px;display:flex;gap:8px;align-items:flex-end}
.tpl-savenew .pay-f{flex:1}

/* ---------- search-selector (shared/searchselect.js) base skin ----------
   vt.css styles .ss under body.vt for the tenant app; the company picker / onboarding form strips
   body.vt (aboo-skinned), so the popup needs this base. The inputs there ride .form-control (the
   screens pass className) — only the .ss wrapper and the body-appended popup are skinned here.
   Under body.vt the vt.css rules out-rank these, so the tenant app is unaffected. */
.ss{position:relative;display:block}
/* a searchable box hidden by its screen (.cb-hide, [hidden]) stays hidden: .ss's own display must not win (owner 22 Nov:
   the register's tax box showed on a company not registered for VAT) */
.ss.cb-hide,.ss[hidden],body.vt .ss.cb-hide,body.vt .ss[hidden]{display:none}
.ss-input{cursor:text;padding-right:24px}
/* dropdown chevron (owner 2026-09-14: "dropdowns need a visible chevron") — a non-interactive
   glyph pinned to the right of the box; pointer-events:none so a click still opens the popup. */
.ss-caret{position:absolute;top:0;right:9px;height:100%;display:flex;align-items:center;
  cursor:pointer;color:var(--muted);font-size:12px;line-height:1}
.ss-list{position:fixed;z-index:1300;margin:0;padding:4px;list-style:none;max-height:264px;overflow-y:auto;overflow-x:hidden;
  background:var(--surface);border:1px solid var(--hue-brand);border-radius:8px;box-shadow:0 12px 34px var(--shade-25)}
.ss-opt{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:7px 10px;border-radius:6px;
  font-size:13.5px;color:var(--ink);cursor:pointer}
.ss-opt .ss-lab{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ss-opt .ss-sub{color:var(--muted);font-size:12px;flex-shrink:0;white-space:nowrap}
.ss-opt.active{background:var(--hue-brand);color:var(--c-cyan-l10b)}
.ss-opt.sel:not(.active){background:color-mix(in srgb, var(--hue-brand) 14%, transparent)}
.ss-opt.is-empty{color:var(--muted);cursor:default;justify-content:flex-start}

/* ── Journals rework (Andre 2026-09-17): projected per-account balance + one clean inline editor ──
   Appended (never edits the protected "basics"/.btn-row-del blocks near the top). */
/* The projected new balance shown under each debit/credit account name. A number → right-aligned +
   tabular (the "basics" gate), muted and small so the account name still leads the cell. */
.jrn-acct .jrn-acct-name{display:block}
.jrn-multi-line{display:flex;justify-content:space-between;gap:10px;line-height:1.5}
.jrn-multi-line .jrn-acct-name{display:inline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jrn-multi-amt{color:var(--muted);font-size:12px;flex-shrink:0}
.jrn-proj{display:block;margin-top:2px;font-size:12px;color:var(--muted);text-align:left;
  font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}
/* money direction: debit leg = money entering (green), credit leg = money exiting (red).
   .jrn-proj already sets color, so these carry higher specificity to win regardless of order. */
.jrn-proj.t-in,.jrn-proj.t-out{color:var(--ok)}
/* the account cells carry a second line (the projected balance), so cb-table's default
   vertical-align:middle would drop DATE/description/ref/amount to the row's centre. Top-align
   every display-row cell so all first lines sit on ONE horizontal line with the account name.
   The inline edit row keeps its own middle alignment. */
.jrn-table tbody tr:not(.jrn-edit-row) > td{vertical-align:top}
/* ONE clean inline edit row on a SINGLE line, aligned to the display columns. Editable GL pickers
   for both legs; the two descriptions and the amount+tax sit side-by-side (never stacked). */
.jrn-edit-row td{vertical-align:middle}
.jrn-edit-date{max-width:140px}
.jrn-edit-in{width:100%;padding:5px 7px;font-size:13px;height:auto}
.jrn-edit-inline{display:flex;gap:5px;align-items:center;min-width:0}
.jrn-edit-inline .jrn-edit-in{flex:1 1 0;min-width:0}
/* amount + tax share the AMOUNT column: right-aligned as a group so the amount sits UNDER the
   right-aligned "Amount" header, with the compact tax tucked to its left. */
.jrn-edit-amtcell{justify-content:flex-end}
.jrn-edit-inline .jrn-edit-amt{flex:0 0 84px}
.jrn-edit-inline .jrn-edit-tax{flex:0 0 96px}
.jrn-edit-fixed{color:var(--muted);font-size:12.5px}
/* Actions cell: keep it a NORMAL table-cell so vertical-align centres the ✓/✕ pair on the input
   centreline — a display:flex <td> (the shared .jrn-edit-act default) top-aligned them. The pair is
   a nowrap inline-flex so ✓ and ✕ stay side-by-side. */
.jrn-edit-row td.jrn-edit-act{display:table-cell;vertical-align:middle;text-align:right;white-space:nowrap}
.jrn-edit-btns{display:inline-flex;gap:6px;flex-wrap:nowrap;align-items:center;vertical-align:middle}
.jrn-edit-act .jrn-edit-err{display:block;text-align:right;margin-top:2px}
.jrn-edit-ok{color:var(--ok)}
.jrn-edit-cancel{color:var(--muted)}
/* Capture-form tax picker (searchSelect) — sized like the other meta fields, hidden until VAT-on. */
.jrn-meta .jrn-tax-cell{flex:0 1 180px;max-width:180px;min-width:0}
.jrn-tax-cell .ss{width:100%}

/* ── Invoice branding + remittance (Feature 1.2 / 1.3) ───────────────────────────────────────
   Logo upload (dropzone) + a per-company brand-colour accent on documents, plus the country-aware
   remittance block. The accent is passed as the --doc-accent custom property on the document root
   (set as a token in markup, consumed ONLY via these classes — no hard-coded colours in markup).
   It is used for rules/borders + bold headings, so it stays legible in light and dark. */

/* logo upload control — Settings → Branding */
.bt-logo-drop{margin-top:4px;padding:16px}
.bt-logo-drop.over{border-color:var(--brand);color:var(--brand);background:var(--surface-2)}
.bt-logo-file{display:none}
.bt-logo-prev-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px}
.bt-logo-url{width:100%;margin-top:8px}
/* Uploaded logo previews INSIDE the drop box, scaled proportionally (owner 2026-09-19:
   "after uploading the logo put it in the upload box so you can see things properly"). */
.bt-logo-drop-img{display:block;max-width:100%;max-height:120px;margin:0 auto 8px;object-fit:contain}
.bt-logo-actions{display:flex;justify-content:flex-start;margin-top:8px}

/* logo on the document paper (on-screen detail + public page) */
.doc-paper-logo{display:block;max-height:52px;max-width:240px;object-fit:contain;margin-bottom:8px}
.pd-org-logo{display:block;max-height:56px;max-width:240px;object-fit:contain;margin-bottom:10px}

/* brand-colour accent — on-screen document detail */
.doc-paper-branded .doc-paper-head{border-bottom:2px solid var(--doc-accent,var(--brand));padding-bottom:12px}
.doc-paper-branded .doc-paper-type{color:var(--doc-accent,var(--brand))}
.doc-paper-branded .doc-lines-tbl thead th{border-bottom:2px solid var(--doc-accent,var(--brand))}
.doc-paper-branded .doc-total-grand{border-top-color:var(--doc-accent,var(--brand));color:var(--doc-accent,var(--brand))}
.doc-paper-branded .doc-paybox{border-left:3px solid var(--doc-accent,var(--brand));padding-left:12px}

/* brand-colour accent — public / shared document */
.pd-branded .pd-paper-head{border-bottom:2px solid var(--doc-accent,var(--brand));padding-bottom:12px}
.pd-branded .pd-meta-type{color:var(--doc-accent,var(--brand))}
.pd-branded .pd-lines thead th{border-bottom:2px solid var(--doc-accent,var(--brand))}
.pd-branded .pd-tot-grand{border-top-color:var(--doc-accent,var(--brand))}
.pd-branded .pd-paybox-title{color:var(--doc-accent,var(--brand))}
.pd-branded .pd-paybox{border-left:3px solid var(--doc-accent,var(--brand))}

/* ── Universal document editor (quotes/invoices/… + purchases) ─────────────────────────────── */
.de-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:2px 0 8px}
.de-head .ct-back{flex:0 0 auto}
/* DESKTOP EXCEPTION: document editor header actions (owner 2026-11-10) — the editor header's actions sit right on desktop.
   A deliberate desktop rule, outside the phone-only block; test/mobile.test.js checks it on its own. */
.de-head-actions{margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
/* END DESKTOP EXCEPTION */
/* A document's everyday actions are square icons at the control height (plan/document-actions-as-icons.md). */
.de-icon-btn{width:var(--control-h);height:var(--control-h);min-width:var(--control-h);padding:0 !important;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.de-title{font-size:22px;margin:0}
.de-card{margin-bottom:10px}
.de-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 12px}
/* Never let a picker/input push a grid track wider than the card (mobile overflow guard). */
.de-grid,.de-grid>*,.de-addparty-form,.de-addparty-form .de-grid>*{min-width:0}
.de-page .ss,.de-page .ss-input,.de-page .form-control{box-sizing:border-box;max-width:100%}
/* ONE uniform metric for every single-line control in the editor — text inputs, searchSelects,
   and <sleek-date> — so selects, date boxes and inputs all share the same height/padding/margin
   (owner Andre 2026-09-18: "everything uniform"). Textareas keep their own height. */
.de-page .form-control,.de-page .ss-input,.de-page .sleek-date-in{height:38px;box-sizing:border-box;padding:0 10px;margin:0;font-size:14px}
.de-page textarea.form-control{height:auto;padding:8px 10px}
.de-page .ss-input{padding-right:26px}   /* room for the caret */
/* Customer + reference sit side by side on desktop (2-col grid), stack on mobile. */
.de-ccy{font-weight:700;padding-top:4px}
.de-lines-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.de-lines-hint{font-size:12px}
.de-lines-wrap{overflow-x:auto}
.de-lines{width:100%;border-collapse:collapse}
body.vt .de-lines thead th{font-size:11px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700;text-align:left;padding:4px 6px;border-bottom:1px solid var(--line);background:transparent}
body.vt .de-lines td{padding:4px 6px;vertical-align:middle}
/* First column gets a small consistent left inset (header + cell aligned). */
body.vt .de-lines th:first-child,body.vt .de-lines td:first-child{padding-left:4px}
.de-lines .de-c-qty,.de-lines .de-c-price,.de-lines .de-c-disc,.de-lines .de-c-total{text-align:right}
.de-lines .de-c-qty{width:58px}
.de-lines .de-c-price{width:94px}
.de-lines .de-c-disc{width:70px}
.de-lines .de-c-total{width:100px}
.de-lines th.de-c-total{padding-right:6px}
/* Numeric + total inputs fill their column, right-aligned. Heights/padding from the uniform rule. */
.de-lines .de-c-qty .form-control,.de-lines .de-c-price .form-control,.de-lines .de-c-disc .form-control,.de-lines .de-c-total .form-control{width:100%;text-align:right}
.de-lines .de-c-vat{width:92px}
.de-lines .de-c-x{width:30px;text-align:center}
.de-item-wrap{display:flex;gap:6px;align-items:flex-start}
.de-item-wrap .ss{flex:1 1 55%;min-width:0}
.de-item-wrap .de-desc{flex:1 1 45%;margin-top:0}
.de-desc{font-size:12.5px}
@media (max-width:767px){body.vt .de-item-wrap{flex-direction:column}body.vt .de-item-wrap .de-desc{margin-top:4px}}
.btn-row-del{background:none;border:0;color:var(--muted);cursor:pointer;padding:4px}
.btn-row-del:hover{color:var(--bad)}
.de-addline{margin-top:8px}
.de-foot{display:grid;grid-template-columns:1fr 300px;gap:10px;align-items:start}
.de-totals{align-self:start}
.de-tot-row{display:flex;justify-content:space-between;padding:3px 0;font-size:14px}
.de-tot-grand{border-top:1px solid var(--line);margin-top:4px;padding-top:8px;font-size:16px;font-weight:800}
.de-actions{display:flex;align-items:center;gap:8px;margin-top:10px}
.de-row-more,.de-ftot,.de-grand-foot{display:none}
.de-send-toggle{display:inline-flex;align-items:center;gap:8px;font-size:13px;margin-right:8px;white-space:nowrap}
/* Repeat (recurring) — a compact control inset in the editor's header card (owner: "use this space",
   condense the inputs). The toggle shows; turning it on reveals a tight row of fields + two switches. */
.de-recurring{margin-top:8px;padding-top:8px;border-top:1px dashed var(--line)}
.de-rec-toggle{font-size:13px;font-weight:600}
.de-rec-fields{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 14px;margin-top:8px}
.de-rec-f{display:flex;flex-direction:column;gap:3px;min-width:0}
.de-rec-f .jrn-lbl{font-size:11px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700}
.de-rec-ev{display:flex;gap:6px}
.de-recurring input[data-rec-every]{width:56px}
.de-recurring select[data-rec-unit]{width:108px}
.de-rec-f sleek-date{display:block;width:150px}
.de-rec-sw{font-size:13px;align-self:flex-end;padding-bottom:8px;white-space:nowrap;margin-left:2px}
.de-rec-hint{flex:1 1 100%;font-size:12px;margin-top:2px}
@media (max-width:767px){body.vt .de-rec-f,body.vt .de-rec-f sleek-date{width:100%}body.vt .de-rec-every{flex:1 1 100%}}
/* Posted document: locked — pickers/line rows non-interactive. Only the lines' bins: the attachments card's bins stay live,
   as its upload does — a file can still be added to or deleted from a confirmed document (POST attachments/{id}/delete has
   no status check; Callan 1 Dec 2026: "delete does not work" — this rule reached every bin in the editor). */
.de-readonly .ss,.de-readonly .de-lines .btn-row-del,.de-readonly .sleek-date-cal-btn{pointer-events:none;opacity:.75}
.de-attach-head{font-weight:700;font-size:13px;margin-bottom:8px}
.de-attach-btn{display:inline-flex;align-items:center;cursor:pointer}
.de-attach-list{display:flex;flex-direction:column;gap:4px;margin:8px 0}
.de-attach-row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;padding:4px 8px;border:1px solid var(--line);border-radius:6px}
.de-attach-row .btn-link.danger{background:none;border:0;cursor:pointer;color:var(--bad);font-weight:600;font-size:12.5px}
.de-attach-hint{font-size:12px}
/* Compact the shared attachmentsCard when embedded in the editor — no nested card chrome, a slim
   drop strip (owner Andre 2026-09-18: "attachments area is way too bulky"). */
.de-attach{padding:8px 12px}
.de-attach .attach-card{border:0;background:transparent;margin:0;padding:0;box-shadow:none}
.de-attach .attach-card .card-body{padding:0}
.de-attach .attach-drop{padding:6px 10px;min-height:0}
/* The drop strip already says "drag files / choose" — drop the redundant empty box. */
.de-attach .attach-empty{display:none}
.de-attach .muted-block{padding:6px 10px}
.de-attach .rail-card-title{margin:0 0 4px;font-size:13px}
.de-attach .row-list{margin-top:6px}
.de-addparty{grid-column:1 / -1;margin-top:2px}
.de-addparty-form{border:1px dashed var(--brand);border-radius:10px;padding:12px;background:var(--surface-2)}
.de-addparty-head{font-weight:700;font-size:13px;margin-bottom:8px}
.de-addparty-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:10px}
.de-addparty-actions .row-err{margin-right:auto}

/* Mobile: header one column, and each line becomes a labeled card. */
@media (max-width:767px){
  /* Header card: Customer + Source ref full-width; Issued + Valid until pair up side by side;
     Currency row removed (owner 2026-11-10: "currency not needed to display" — amounts already
     carry the R symbol). A shorter header gives the pinned-header layout more room for the lines. */
  body.vt .de-grid{grid-template-columns:1fr 1fr}
  body.vt .de-party,body.vt .de-ref,body.vt .de-addparty{grid-column:1 / -1}
  body.vt .de-datef{grid-column:auto}
  body.vt .de-grid>label.ct-field:has(.de-ccy){display:none}
  body.vt .de-foot{grid-template-columns:1fr}
  body.vt .de-lines,body.vt .de-lines tbody{display:block}
  body.vt .de-lines thead{display:none}
  body.vt .de-lines tr{display:block;border:1px solid var(--line);border-radius:10px;padding:8px;margin-bottom:8px;position:relative}
  body.vt .de-lines td{display:flex;align-items:center;gap:8px;padding:4px 0;border:0}
  body.vt .de-lines td[hidden]{display:none}
  body.vt .de-lines td::before{content:attr(data-label);flex:0 0 84px;font-size:11px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700;text-align:right}
  body.vt .de-lines .de-c-item{display:block}
  body.vt .de-lines .de-c-item::before{display:block;margin-bottom:4px;text-align:left}
  body.vt .de-lines .de-c-qty,body.vt .de-lines .de-c-price,body.vt .de-lines .de-c-disc,body.vt .de-lines .de-c-vat,body.vt .de-lines .de-c-acct,body.vt .de-lines .de-c-total{width:auto}
  body.vt .de-lines .de-c-x{position:static;display:flex;justify-content:flex-end;padding:6px 0 0;margin-top:4px;border-top:1px solid var(--line)}
  body.vt .de-lines .de-c-x::before{display:none}
  body.vt .de-lines .de-c-x .btn-row-del{display:inline-flex;align-items:center;gap:6px;color:var(--bad);font-weight:600;font-size:13px}
  body.vt .de-lines .form-control{flex:1 1 auto;min-width:0}
  /* Mobile line cards fold the secondary fields away (owner 2026-11-10: Disc/VAT/Account/Total waste
     space) — Item/Qty/Price show by default, "More" reveals the rest per row. */
  body.vt .de-lines .de-c-disc,body.vt .de-lines .de-c-vat,body.vt .de-lines .de-c-acct,body.vt .de-lines .de-c-total{display:none}
  body.vt .de-lines tr.de-row-open .de-c-disc,body.vt .de-lines tr.de-row-open .de-c-vat:not([hidden]),body.vt .de-lines tr.de-row-open .de-c-acct:not([hidden]),body.vt .de-lines tr.de-row-open .de-c-total{display:flex}
  body.vt .de-lines .de-c-x{justify-content:space-between}
  body.vt .de-row-more{display:inline-flex;align-items:center;gap:4px;background:none;border:0;color:var(--brand);font-weight:600;font-size:13px;cursor:pointer;padding:2px 4px;margin-left:-4px;border-radius:6px;outline:none}
  body.vt .de-row-more:focus{outline:none}
  body.vt .de-row-more:focus-visible{box-shadow:0 0 0 2px var(--brand-faint)}
  body.vt .de-row-more:active{color:var(--brand-ink)}
  /* Posted / read-only lines read as a finalized document, not an editable form (owner 2026-11-10:
     "lines could be better") — strip the input chrome and the dropdown carets so each line is plain
     text, and drop the editing hint that only applies while drafting. */
  body.vt .de-readonly .de-lines-hint{display:none}
  body.vt .de-readonly .de-lines .form-control,
  body.vt .de-readonly .de-lines .ss-input{border:0;background:transparent;box-shadow:none;padding:2px 0;height:auto;min-height:0;font-size:14px;opacity:1;color:var(--ink);-webkit-text-fill-color:var(--ink)}
  body.vt .de-readonly .de-lines .ss-caret{display:none}
  body.vt .de-readonly .de-lines .de-desc{font-weight:600}
  body.vt .de-readonly .de-lines tr{background:var(--surface)}
  body.vt .de-readonly .de-lines .btn-row-del{display:none}
  body.vt .de-readonly .de-lines .de-c-x{justify-content:flex-start;border-top:0;padding-top:0}
  /* Compact read-only line (owner 2026-11-10: "still wasted space") — item name as a single bold
     title, qty/price as small inline chips on one wrapped row, tight padding, no label→value spread
     and no duplicated description. */
  body.vt .de-readonly .de-lines tr{padding:10px 12px}
  body.vt .de-readonly .de-lines .de-desc{display:none}
  body.vt .de-readonly .de-lines .de-c-item{display:block;width:100%;margin-bottom:2px}
  body.vt .de-readonly .de-lines .de-c-item::before{display:none}
  body.vt .de-readonly .de-lines .de-item-wrap .ss-input{font-weight:700;font-size:15px;padding:0}
  body.vt .de-readonly .de-lines td{display:inline-flex;align-items:baseline;width:auto;gap:5px;padding:1px 0;margin:2px 16px 0 0;border:0}
  body.vt .de-readonly .de-lines td::before{flex:0 0 auto;width:auto;text-align:left;font-size:10px;text-transform:uppercase}
  body.vt .de-readonly .de-lines .text-right{text-align:left}
  body.vt .de-readonly .de-lines .form-control,
  body.vt .de-readonly .de-lines .ss-input{width:auto;min-width:0;flex:0 0 auto}
  body.vt .de-readonly .de-lines .de-c-x{width:100%;margin:6px 0 0}
  /* ...but the item's name is the line's title and takes the card's width, and the account takes a line of its own: at
     their own size the name stopped at 190px ("GDS-FEED50 — Game fe", 289px needed) and the account at 168px of the 176px
     "0400 — Sales - Standard" needs (4 Dec 2026 sweep #13) */
  body.vt .de-readonly .de-lines .de-item-wrap .ss-input{width:100%}
  body.vt .de-readonly .de-lines .de-c-acct{display:flex;width:100%;margin-right:0}
  body.vt .de-readonly .de-lines .de-c-acct .ss-input{width:100%}
  /* Keep context fixed while lines scroll (owner 2026-11-10): top nav + the title row pin to the
     top, a bottom bar with the running total + Save/Confirm pins to the bottom, always in view. */
  /* Compact one-line document header on mobile: "< Sales  New Invoice" on one line, smaller, less
     wasted space. (Sticky pinning was reverted — it broke the scroll; revisit as a flex layout.) */
  body.vt .page.ct-page.de-page{padding:10px 0 0 !important}   /* beats ux.css's 12px !important side inset */
  body.vt .de-page .ct-back{margin:0;padding:3px 10px;font-size:13px;min-height:0;gap:4px}
  body.vt .de-head{margin:0 0 6px;padding:0;flex-wrap:wrap;gap:6px 8px;align-items:center}
  /* the cards keep the screen's width, but the title row's buttons stood on its very edges (Back at 0, "Create Credit
     Note" ending at the screen's right edge; 4 Dec 2026 sweep #13): the row keeps the 12px every other screen keeps */
  body.vt .de-page > .de-head{padding-left:12px;padding-right:12px}
  body.vt .de-title{font-size:16px;white-space:nowrap;flex:0 1 auto}
  /* Create Credit Note / Clone / Repeat overflowed the right edge (owner 2026-11-10) — drop them to
     their own full-width row under the title and let them wrap instead of clipping. */
  body.vt .de-head-actions{flex:0 1 auto;margin-left:auto;flex-wrap:wrap;justify-content:flex-end;gap:6px}
  body.vt .de-head-actions .btn:not(.de-icon-btn){font-size:12px;padding:5px 10px;min-height:0;white-space:nowrap}
  body.vt .de-actions .de-send-toggle{flex:1 1 100%;margin:0}
  /* Fixed header / scrolling items / fixed footer (owner 2026-11-10): the editor fills the space
     between the top nav and the bottom tab bar; the title row pins at the top, Save/Confirm + the
     running total pin at the bottom, and .de-scroll scrolls. The customer card scrolls with the lines
     (Callan 2026-11-20: pinned, it left the lines 123px on a 375x667 phone). */
  body.vt .page.de-page{display:flex;flex-direction:column;height:calc(100dvh - var(--topbar-h,58px) - 74px);min-height:0;overflow:hidden}
  body.vt .de-page [data-editor]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
  body.vt .de-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}
  body.vt .de-head,body.vt .de-head-card{flex:0 0 auto}
  body.vt .de-head-card{margin-bottom:8px}
  body.vt .de-actions{flex:0 0 auto;margin:6px 0 0;padding:8px 12px;border-top:1px solid var(--line);background:var(--surface)}
  body.vt .de-ftot{display:flex;flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end;align-items:baseline;gap:2px 16px;margin:0;padding:6px 12px 2px;font-size:13px}
  body.vt .de-ftot-row b{margin-left:4px;font-weight:700}
  body.vt .de-ftot-grand{font-weight:800;font-size:15px}
  body.vt .de-foot .de-totals{display:none}   /* duplicated by the pinned .de-ftot strip in the footer */
}

/* Sales & Purchases document list — search + family tabs toolbar (contacts-landing parity). */
.doc-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.doc-toolbar .search{flex:1 1 240px;max-width:360px}
.doc-list tr.clickable{cursor:pointer}
.doc-list tr.clickable:hover{background:var(--hover,var(--shade-03))}
/* Same horizontal padding on every cell so the footer total lines up under the Total column. */
.doc-list th,.doc-list td{padding-left:8px;padding-right:8px}
.doc-list tfoot .doc-list-total td{font-weight:800;border-top:2px solid var(--line);padding-top:10px;padding-bottom:6px}
.doc-type-sub{display:block;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.02em}

/* Statements & Reconciliation grid (src/tenant/statements.js) — reuses .cb-table for the frame,
   .cb-recon/-ok/-off for the Ties badge, .t-in/.t-out for money colour, .alert-warn for the gap. */
.stmt-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.stmt-table{min-width:680px}
.stmt-table td{padding:4px 8px}
.stmt-table td.stmt-2line{line-height:1.2;padding-top:4px;padding-bottom:4px}
.stmt-table td.stmt-2line .stmt-led{font-size:13px;margin-top:1px}
.stmt-table td.stmt-td-period .stmt-date{font-size:13px;line-height:1.2}
.stmt-table td.stmt-td-period .stmt-txns{display:inline-block;margin-top:1px}
.stmt-table .stmt-ref-input{width:5.5rem;padding:3px 6px;font-size:12.5px;font-weight:700}
/* Ref cell: the BS tag input + its "⬇ PDF" (download the original imported file) side by side on
   ONE control height (golden rule #9). Three classes so it outranks the tenant `body.vt .btn`. The
   button is deliberately not .btn-sm: that class's later min-height:32px would undercut the 44px
   touch minimum the input beside it gets on (pointer: coarse), splitting the row's heights. */
.stmt-table .stmt-ref-cell{display:flex;align-items:center;gap:6px}
.stmt-table .stmt-ref-cell .stmt-ref-input,
.stmt-table .stmt-ref-cell .stmt-dl{height:var(--control-h);box-sizing:border-box;margin:0}
.stmt-table .stmt-ref-cell .stmt-dl{padding:0 9px;font-size:12.5px;font-weight:650;line-height:1;
  white-space:nowrap;flex:0 0 auto}
.stmt-table .stmt-ref-cell .stmt-dl:disabled{opacity:.55;cursor:progress}
.stmt-table td.stmt-num{white-space:nowrap}
.stmt-table .stmt-txns{font-size:12px;margin-left:4px}
.stmt-table .stmt-computed{font-size:12px}
.stmt-table td.stmt-ledger .stmt-ledger-tie{margin-left:6px}
.stmt-table td.stmt-ledger .cb-recon{padding:1px 6px;font-size:12px}
.stmt-table tr.stmt-row-off td{background:color-mix(in srgb, var(--c-amber-700) 6%, transparent)}
.stmt-table tr.stmt-gap-banner td{padding:6px 8px;background:transparent}
.stmt-table tr.stmt-gap-banner:hover td{background:transparent}
/* A supplier statement that does not show this sub-account (item 7, 12 Nov 2026): its tag + period, muted, no figures */
.stmt-table tr.stmt-row-not-on td{color:var(--muted)}
.stmt-table .stmt-ref-text{display:inline-block;padding:3px 6px;font-size:12.5px;font-weight:700}
/* Statements where the table is wider than the screen (a phone, a narrow window: .stmt-scroll scrolls it sideways —
   14 Nov 2026): what spans the table's width stays in the part that shows, never a swipe away — the missing
   statement's words with its Bridge button, and, drawn again in rows of their own that show only then, a statement's
   "Clear gap warnings" and a supplier statement's "Not on this statement". .stmt-scroll is the box that is measured.
   The table clips its rounded corners with overflow:clip, not .cb-table's hidden: hidden makes the table itself the
   box a sticky message holds to, so the message went with the swipe (measured at 390px). */
.stmt-scroll{container-type:inline-size}
.stmt-table.cb-table{overflow:clip}
.stmt-table tr.stmt-gap-banner .stmt-gap-msg,.stmt-table .stmt-wide-msg{position:sticky;left:8px;box-sizing:border-box;max-width:calc(100cqw - 16px)}
.stmt-table tr.stmt-wide-row{display:none}
.stmt-table tr.stmt-wide-row td,.stmt-table tr.stmt-wide-row:hover td{padding:0 8px 6px;background:transparent}
.stmt-table .stmt-wide-msg.stmt-not-on,.stmt-table td.stmt-not-on{font-size:13px;font-style:italic}
@container (max-width:880px){
  .stmt-table tr.stmt-wide-row{display:table-row}
  .stmt-table td.stmt-not-on > span{display:none}
}

/* Bad-data shortlist — suspect lines with one-click "fix pills" (owner 2026-09-21) */
.stmt-bad{border:1px solid var(--warn);border-radius:10px;background:color-mix(in srgb, var(--warn) 7%, var(--surface));
  padding:10px 12px;margin:0 0 14px}
.stmt-bad-hd{font-weight:800;color:var(--warn);margin-bottom:8px;display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.stmt-bad-sub{font-size:12.5px;font-weight:500}
.stmt-bad-list{display:flex;flex-direction:column;gap:8px}
.stmt-bad-row{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:8px 10px}
.stmt-bad-line{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;font-size:13.5px}
.stmt-bad-ref{font-weight:800}
.stmt-bad-descr{color:var(--ink);flex:1 1 140px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stmt-bad-amt{font-weight:700}
.stmt-bad-amt.t-in{color:var(--ok)} .stmt-bad-amt.t-out{color:var(--bad)}
.stmt-bad-posted{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;
  color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:1px 7px}
.stmt-bad-reason{font-size:12.5px;color:var(--muted);margin:3px 0 7px}
.stmt-bad-pills{display:flex;gap:7px;flex-wrap:wrap}
.stmt-bad-edit{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.stmt-bad-dateinput{width:11rem}
/* bad data (owner 23 Nov 2026): Fix all N dates in the header, Remove asks with a reason, Keep as is */
.stmt-bad-fixall{margin-left:auto}
.stmt-bad-hd .confirm-inline{margin-left:auto;font-weight:600;color:var(--ink);flex-wrap:wrap}
.stmt-bad-remove .confirm-inline{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.stmt-bad-reason-input{flex:1 1 14rem;min-width:0}
.stmt-bad-remove-err{font-size:12.5px;color:var(--bad);margin-top:5px}
/* the picture of a bad-data line (its band as printed), opened inline under it */
.stmt-bad-pic{appearance:none;border:1px solid var(--line);background:var(--surface);border-radius:8px;cursor:pointer;
  min-width:2.25rem;min-height:2.25rem;font-size:15px;line-height:1}
.stmt-bad-pic.on{border-color:var(--brand,var(--ink))}
.stmt-bad-snap{margin:2px 0 8px;border:1px solid var(--line);border-radius:8px;overflow:auto;max-height:60vh;background:var(--surface)}
.stmt-bad-snap-img{display:block;width:100%;height:auto}
.stmt-bad-snap-note{font-size:12.5px;padding:5px 8px}
/* pills — compact action chips */
.pill{appearance:none;cursor:pointer;font-size:12.5px;font-weight:700;border-radius:999px;
  padding:5px 12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);white-space:nowrap}
.pill:hover{border-color:var(--brand)}
.pill:disabled{opacity:.5;cursor:not-allowed}
.pill-primary{background:var(--brand);border-color:var(--brand);color:var(--hue-paper)}
.pill-ok{background:var(--ok);border-color:var(--ok);color:var(--brand-ink)}   /* "✓ It's right": green is good */
.pill-ghost{background:transparent}
.pill-danger-ghost{color:var(--bad);border-color:color-mix(in srgb, var(--bad) 40%, var(--line))}
.pill-danger{background:var(--bad);border-color:var(--bad);color:var(--hue-paper)}

/* VAT re-stamp offer after a default-code change (Settings → CoA) */
.set-restamp-offer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.set-restamp-actions{display:flex;gap:8px;flex:0 0 auto}

/* Register reconciliation strip — opening → book → statement → reconciled, always visible so the
   user can SEE the account ties (opening balance is a journal, not a listed line) */
.cb-recon-strip{display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;padding:8px 12px;margin:0 0 8px;
  border-radius:8px;font-size:13px;background:color-mix(in srgb, var(--brand) 8%, transparent);
  border:1px solid var(--line);color:var(--ink)}
.cb-recon-cell{display:flex;flex-direction:column;line-height:1.2}
.cb-recon-cell label{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.cb-recon-cell small{font-size:12px;color:var(--muted)}
.cb-recon-arrow{color:var(--muted);font-size:15px}
.cb-recon-strip .cb-recon{margin-left:auto}
.rp-table .rp-group-hd td{background:var(--surface-2);border-top:2px solid var(--line);padding:7px 8px;font-weight:700}
.rp-table tr.rp-drill{cursor:pointer}
.rp-table tr.rp-drill:hover td{background:var(--surface-2)}
.rp-is-line.rp-drill,.rp-bs-row.rp-drill{cursor:pointer}
.rp-is-line.rp-drill:hover,.rp-bs-row.rp-drill:hover{background:var(--surface-2)}
/* Sales accounting memos: a read-only list with company-formatted amounts. */
.sales-memos-tabs { flex-wrap: wrap; }
.sales-memos-tabs a { text-decoration: none; }
.sales-memos-help { margin: 1rem 0; }
.sales-memos-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin: 1rem 0; }
.sales-memos-filters label { display: flex; flex-direction: column; gap: .3rem; }
/* Shared pager's horizontal 130px flex-basis becomes height inside these column labels. */
.sales-memos-filters .per-select { flex: 0 0 38px; }
.sales-memos-filters .form-control { height: 38px; box-sizing: border-box; }
.sales-memos-search { flex: 1 1 16rem; }
.sales-memos-filters sleek-date { width: 10rem; }
.sales-memos-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; padding: .75rem 0; }
.sales-memos-list td:nth-child(1), .sales-memos-list td:nth-child(4) { white-space: nowrap; }
.sales-memos-list td:nth-child(2), .sales-memos-list td:nth-child(3) { overflow-wrap: anywhere; }
.sales-memos-detail-list td:first-child { white-space: normal; overflow-wrap: anywhere; }
.sales-memos-detail-list td:nth-child(3) { white-space: nowrap; }
.sales-memos-list a:focus-visible { outline: 2px solid var(--hue-brand); outline-offset: 3px; }
@media (max-width: 600px) {
  .sales-memos-filters label { flex: 1 1 9rem; }
  .sales-memos-filters sleek-date { width: 100%; }
  .sales-memos-search { flex-basis: 100% !important; }
}

/* ───────────────────────── PWA install (src/shared/pwa-install.js) ─────────────────────────
   One "Install aboo" banner for every device + an iOS Add-to-Home-Screen sheet + a new-version
   toast. All hidden by default; the module toggles `.show`. The banner clears the mobile
   bottom-nav (z 45) and the iPhone home indicator. Colours are brand tokens → dark mode is free. */
.pwa-banner{
  position:fixed; left:50%; bottom:16px; z-index:60;
  transform:translateX(-50%) translateY(150%);
  width:min(520px, calc(100vw - 24px));
  display:flex; align-items:center; gap:12px; padding:12px 14px;
  background:var(--surface); color:var(--ink);
  border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  opacity:0; pointer-events:none; transition:transform .28s ease, opacity .28s ease;
}
.pwa-banner-icon{ flex:0 0 auto; border-radius:10px; }
.pwa-banner-text{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px; }
.pwa-banner-text strong{ font-size:14px; }
.pwa-banner-text span{ font-size:12px; color:var(--muted); line-height:1.3; }
.pwa-banner-actions{ flex:0 0 auto; display:flex; align-items:center; gap:6px; }

.pwa-ios-sheet{
  position:fixed; inset:0; z-index:10001; display:flex; align-items:center; justify-content:center;
  background:color-mix(in srgb, var(--c-cyan-l6) 55%, transparent); opacity:0; pointer-events:none; transition:opacity .2s ease;
}
.pwa-ios-sheet.show{ opacity:1; pointer-events:auto; }
.pwa-ios-card{
  width:min(440px, calc(100vw - 20px));
  background:var(--surface); color:var(--ink); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  padding:18px; text-align:center; transform:translateY(16px); transition:transform .2s ease;
}
.pwa-ios-sheet.show .pwa-ios-card{ transform:translateY(0); }
.pwa-ios-card h3{ margin:8px 0 12px; font-size:16px; }
.pwa-ios-steps{ text-align:left; margin:0 0 14px; padding-left:20px; display:flex; flex-direction:column; gap:8px; }
.pwa-ios-steps li{ font-size:13px; color:var(--ink); line-height:1.4; }
.pwa-ios-glyph{ font-weight:700; color:var(--brand); }

.pwa-update-toast{
  position:fixed; left:50%; bottom:16px; z-index:61;
  transform:translateX(-50%) translateY(150%);
  display:flex; align-items:center; gap:12px; padding:10px 12px 10px 16px;
  background:var(--brand-ink); color:var(--hue-paper); border-radius:999px; box-shadow:var(--shadow-lg);
  opacity:0; pointer-events:none; transition:transform .28s ease, opacity .28s ease;
}
.pwa-update-toast.show,.pwa-banner.show{ transform:translateX(-50%) translateY(0); opacity:1; pointer-events:auto; }
.pwa-update-toast span{ font-size:13px; font-weight:600; }

/* mobile: lift the bottom-anchored chrome above the bottom nav + home indicator — in the company app its bottom menu
   (vt.css --mobile-nav-h, 72.5px: the 56px of --bottom-nav-h left these 6.5px on it — Callan, 2 Dec 2026: "yes fix the
   phone menu overlap too"); elsewhere the 56px bar, as before */
@media (max-width:767px){
  .pwa-banner{ bottom:calc(var(--mobile-nav-h, var(--bottom-nav-h)) + env(safe-area-inset-bottom,0px) + 10px); width:calc(100vw - 20px); }
  .pwa-update-toast{ bottom:calc(var(--mobile-nav-h, var(--bottom-nav-h)) + env(safe-area-inset-bottom,0px) + 10px); }
  .pwa-ios-sheet{ align-items:flex-end; }
  .pwa-ios-card{ margin-bottom:calc(10px + env(safe-area-inset-bottom,0px)); }
}
/* a tablet up to 900px still shows the company app's bottom menu (vt.css @media (max-width:900px)), and from 768px the
   notes kept their desktop place (bottom 16px) UNDER it (z 60 / 61 below the menu's 70): measured at 820 x 1180 (an iPad
   Air), their foot at 1164, the menu's top at 1108 (Callan, 2 Dec 2026: "check that everything is correct on mobile and
   tablet"). Only their place moves; their size stays the desktop one */
@media (min-width:768px) and (max-width:900px){
  body.vt .pwa-banner,body.vt .pwa-update-toast{ bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px) + 10px); }
}
/* phone (owner 2026-11-20: "this install button panel doesn't scale on mobile properly"): on one row the two
   buttons kept their full width and squeezed the text into a narrow column. Icon + text take the first row, the
   buttons share the full width of a second row. The update toast never runs wider than the screen. */
@media (max-width:560px){
  .pwa-banner{ flex-wrap:wrap; gap:10px 12px; padding:12px; }
  .pwa-banner-text{ flex:1 1 0; }
  .pwa-banner-text span{ font-size:13px; }
  .pwa-banner-actions{ flex:1 1 100%; gap:8px; }
  .pwa-banner-actions .btn{ flex:1 1 0; justify-content:center; }
  .pwa-update-toast{ max-width:calc(100vw - 20px); }
}

/* ── Expense claims + incoming invoices (invoiceTest/EXPENSE-CLAIMS-PLAN.md E4-E10). Mobile first: one column on a
   phone, the slip beside the figures from 768px. Classes: apv-* approvals inbox, ex2-* claim capture / bill status,
   nr-* not reconciled, mbx-* incoming-invoice mailboxes (Settings). Every font >= 12px. ── */
.apv-inbox{display:flex;flex-direction:column;gap:10px}
/* the notices: the new claims and the new supplier invoices in one card the width of the list (Callan 19 Nov 2026: "put
   claims and suppliers into one bar like this and then the sort just filters it"). A line: who, what for (cut with …
   when long), the amount, ›; the whole line is its button and opens what it is about. No dividers. The card sits under
   the row of filters and scrolls away with the page ("remove this from the scroll please"); its heading - the title, how
   many, Mark all read at the right - stands under the drop zone ("it can be the heading, jsut below the choose a file
   card"). The card keeps no margin under it (a .card's 16px): the first claim is the list's own 10px under it. */
.apv-notices{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
body.vt .apv-notices .apv-ncard{margin:0}
.apv-ncard .card-body{display:flex;flex-direction:column;gap:2px}
.apv-nhead{display:flex;align-items:center;gap:8px}
.apv-nhead-n{font-size:12px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.apv-nhead .btn{margin-left:auto}
/* five lines at a time (Callan 19 Nov 2026: "this must only ever show 5", then "rather than show more, if there are more
   than five it must just scroll"): every notice is in the card, and the rest scroll in those five lines' room - a line
   is 13px at 1.35 and 6px above and below it (.apv-notice); ux.css gives a phone's two-line notices their own room */
.apv-nlist{display:flex;flex-direction:column;max-height:calc(5 * (13px * 1.35 + 12px));overflow-y:auto}
.apv-nlist > .apv-notice{flex:none}
.apv-notice{display:flex;align-items:center;gap:10px;width:100%;min-height:0;margin:0;padding:6px 0;
  background:none;border:0;border-radius:0;box-shadow:none;font:inherit;font-size:13px;font-weight:400;line-height:1.35;
  color:var(--ink);text-align:left;cursor:pointer}
.apv-n-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.apv-n-what{color:var(--muted)}
.apv-n-amt{flex:none;min-width:6.2em;text-align:right;font-weight:600;font-variant-numeric:tabular-nums}
/* a line's date: the slip's or invoice's (Callan 19 Nov 2026: "must have the date"); the amount's width above keeps the
   dates of a card in one column */
.apv-n-date{flex:none;color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
.apv-notice-go{flex:none;font-size:16px;line-height:1;color:var(--muted)}
.apv-notice:hover .apv-n-text b,.apv-notice:hover .apv-notice-go{color:var(--brand)}
.apv-notice:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
/* The row of All | Claims | Supplier invoices, Newest first | Largest first, the search box, Back to top, Select all and
   Approve selected follows the scroll (Callan 19 Nov 2026: "when you are scrolling, can this follow the scroll?"); the
   notices under it scroll away with the page ("remove this from the scroll please" - they had followed it since "this
   should also scroll with, and put the strip above"). It stops under the top bar: under the bar and the AI-key card while
   that shows (--topbar-h, aikeycorner.js), else under the bar's own 58px (measured at 850, 1000 and 1920px wide). It has
   the page's own colour, so the notices and the claims pass under it, 8px under the row. Its margin takes back its 8px
   above, so at rest the row sits 10px under what is above it, and what is under it starts 20px under the row. On a phone
   it scrolls with the page (ux.css). */
.apv-pin{display:flex;flex-direction:column;gap:10px;position:sticky;top:var(--topbar-h, 58px);z-index:20;
  background:var(--bg);padding:8px 0;margin:-8px 0 2px}
.apv-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin:0}
/* Its left: the filters, and beside them the Newest first | Largest first switch ("put the sort switch in the pinned row
   too" - moved from beside the heading, so there is one switch) and the search box ("also add a search bar to the top
   which can search claims in the list"), as tall as the row's buttons (the shared .ux-search). Its right: Back to top,
   Select all, Approve selected; where the row is too narrow for both, they go to a second line, still on the right. */
.apv-view{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.apv-bulk{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:auto}
body.vt .apv-view .apv-find{flex:0 1 240px;width:240px;min-width:0;max-width:100%}
/* one height in the row (CLAUDE.md rule 9): the filters were 31px, the sort switch 32, the buttons 36 beside the search
   box's 34 - all are 34. On a phone they stand on lines of their own. */
@media (min-width:768px){
  body.vt .apv-toolbar .seg,body.vt .apv-toolbar .apv-sort,body.vt .apv-toolbar .btn{height:var(--control-h);
    min-height:var(--control-h);box-sizing:border-box}
}
/* Back to top (Callan 19 Nov 2026: "button here, 'back to top'") shows only while the row is pinned (approvals.js marks
   the page .is-pinned), never at the top of the page, where it has nowhere to go. Hidden, it keeps its room, so nothing in
   the row moves or wraps when it comes. */
.apv-page:not(.is-pinned) .apv-top{visibility:hidden}
.apv-pickall{display:inline-flex;align-items:center;gap:6px;font-size:13px}
.apv-item{display:grid;grid-template-columns:28px 1fr;gap:8px 10px;background:var(--surface);border:1px solid var(--line);
  border-radius:10px;padding:10px 12px}
.apv-item.is-picked{border-color:var(--brand)}
.apv-pick{grid-column:1;padding-top:2px}
.apv-media{grid-column:2;grid-row:1;min-width:0}   /* a phone: the slip beside the tick box, over the details */
.apv-figs{grid-column:1 / -1;min-width:0;display:flex;flex-direction:column;gap:12px;container-type:inline-size}
.apv-actions{display:flex;justify-content:flex-end;gap:8px}
.apv-reject{grid-column:1 / -1;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:6px}
.apv-reject .form-control{width:100%;min-width:0}   /* the older approvals screen's 220px reason box is gone */
.apv-edit-actions{display:flex;justify-content:flex-end;gap:8px}
.apv-row-err{grid-column:1 / -1}
.apv-thumb-btn{padding:0;border:1px solid var(--line);border-radius:8px;background:var(--surface);cursor:zoom-in;display:block}
.apv-thumb{display:block;width:100%;max-width:200px;max-height:200px;object-fit:contain;border-radius:8px}
.apv-nofile,.apv-noprev,.apv-loading{font-size:12px;color:var(--muted);padding:6px 0}
.apv-lines{display:flex;flex-direction:column;gap:2px;font-size:13px;max-width:420px}
.apv-ln{display:flex;justify-content:space-between;gap:10px}
/* A card's facts and its boxes (Callan 19 Nov 2026, of five looks: "go with 3 but try to incorporate the grey panels as
   well please"): label | value rows in two grey panels, no lines between - what was claimed or sent, then the boxes, the
   debit-order tick and Approve / Reject. The labels are every form's field captions (body.vt .fld>span); the label
   column is as wide in both panels (160px from a 440px half), so the values, the boxes and the buttons stand in one
   column. The boxes and the lines are as wide as a long name needs (420px; "should the dropdowns not be shorter"); the
   debit-order tick has its own row under the boxes and Approve / Reject stand alone in the panel's far corner (Callan 3
   Dec 2026: "implement but put approve and reject in the far corner"). The supplier box keeps an AI chip beside it (the
   supplier the invoice prints), under it when the row is too narrow. A narrow half - a tablet's two halves (328px at
   1024px), a phone - narrows the label column, and a long value, a box and the buttons stand under their label. One
   even gap (12px) between the parts. */
.apv-panel{background:var(--surface-2);border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:10px}
.apv-rr{display:grid;grid-template-columns:104px minmax(0,1fr);gap:4px 16px;align-items:baseline}
.apv-rk{display:block;font-size:10.5px;text-transform:uppercase;letter-spacing:.11em;color:var(--faint);font-weight:700}
.apv-rv{min-width:0;font-size:14px;color:var(--ink);overflow-wrap:anywhere}
.apv-rr.is-note .apv-rv{white-space:pre-wrap}
.apv-rr.is-files .apv-rv{display:flex;flex-wrap:wrap;gap:4px 14px}
.apv-rr.is-long,.apv-rr.is-box,.apv-rr.is-decide,.apv-rr.is-tick{grid-template-columns:minmax(0,1fr)}
.apv-rr .apv-rk:empty{display:none}
.apv-rr.is-box .apv-rv{max-width:420px}
.apv-rr.is-sup .apv-rv{max-width:none}
.apv-sup{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;min-width:0}
.apv-sup > .ss{flex:1 1 220px;max-width:420px;min-width:0}
.apv-sup-chip{flex:0 0 auto;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.apv-rr.is-decide .apv-rv{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px}
.apv-rr:has(.apv-vat:empty),.apv-rr:has(.apv-due:empty){display:none}
.apv-debit{display:inline-flex;align-items:center;gap:8px;margin-right:auto;font-size:13.5px;color:var(--ink);white-space:nowrap;cursor:pointer}
.apv-debit .chk{margin:0}
.apv-actions .btn{height:38px;min-height:38px;padding:0 18px;margin:0;box-sizing:border-box}   /* as tall as the boxes (.fld) */
.apv-file{padding:0;font-size:14px;text-align:left;overflow-wrap:anywhere}
@container (min-width:440px){
  .apv-rr,.apv-rr.is-long,.apv-rr.is-box,.apv-rr.is-decide,.apv-rr.is-tick{grid-template-columns:160px minmax(0,1fr)}
  .apv-rr .apv-rk:empty{display:block}
  .apv-rr.is-box .apv-rk{align-self:center}
  /* the supplier's label level with its box, also when the chip goes under the box */
  .apv-rr.is-sup .apv-rk{align-self:start;min-height:38px;display:flex;align-items:center}
}
/* Wide details (Callan 3 Dec 2026, of an outside review: "implement"): the short facts two to a row - Invoice date |
   Due, Received on | VAT no. - and the lines, the files, a note, a reason, a warning or a duplicate across. Narrower
   details (a laptop's, a tablet's, a phone's) keep one fact to a row. */
@container (min-width:640px){
  .apv-facts{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 24px}
  .apv-facts > .apv-rr.is-long,.apv-facts > .apv-rr.is-wide,.apv-facts > :not(.apv-rr){grid-column:1 / -1}
}
/* A computer or a tablet: two halves (Callan 19 Nov 2026: "put the information to the left and then put the
   screenshot of the pdf on the [right], it is a better use of the space"; "make this short and get the screenshot to
   take up the other half"). The details are the left half, beside the tick box, so an invoice line's amount ends in
   the middle of the card, not a screen away; the slip or invoice (a PDF as its first page) fills the right half, at
   least 420px high (as the Expenses slip viewer), whole and centred. The slip's column stops at 340px, as wide as a
   portrait slip that tall, and the details take the rest (Callan 3 Dec 2026, of an outside review: "implement" - the
   photo was 325px wide in a 661px half); never wider than the details, so a tablet keeps its two halves. Approve /
   Reject are the last row of the boxes' panel, under the boxes ("this can be moved below the accounts dropdowns"), in
   its far corner (3 Dec 2026). The page's order is the same - details, boxes, Approve / Reject, picture - so Tab goes
   as the eye does. */
@media (min-width:768px){
  .apv-item{grid-template-columns:28px minmax(0,1fr) minmax(0,min(340px,calc(50% - 24px)));align-items:start}
  .apv-pick{grid-row:1}
  .apv-figs{grid-column:2;grid-row:1}
  .apv-media{grid-column:3;grid-row:1;align-self:stretch;display:flex;flex-direction:column}
  .apv-media:has(.apv-thumb-btn){min-height:420px}
  .apv-thumb-btn{position:relative;flex:1;min-height:0}
  /* the photo takes its own shape, as large as the half allows, centred: fitted into the whole half (object-fit) its
     own corners stood square inside the round frame (Callan 1 Dec 2026: "I do not want to see one sharp edge") */
  .apv-thumb{position:absolute;inset:0;margin:auto;width:auto;height:auto;max-width:100%;max-height:100%}
  .apv-reject,.apv-row-err{grid-column:2 / -1}
}
/* A card's title (Callan 3 Dec 2026, of ten looks: "go with 1"): who is paid and how much, at a glance - the name on the
   left with its number and sender (an invoice) or what it was for (a claim) in grey under it, the amount on the right
   with its VAT under it - a claim's too, with the slip it is part of ("yes, put the vat under the total on claims too",
   3 Dec 2026); in line with the panels' text (14px in). The amount always beside the name (a phone too: the name and
   its grey line wrap). A phone: 18px; from a tablet: 21px, the tick box level with the name. A claim's VAT line not
   known yet (no account picked) takes no room. */
.apv-title{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:4px 16px;padding:0 14px}
.apv-title-who,.apv-title-amt{display:flex;flex-direction:column;gap:3px;min-width:0}
.apv-title-amt{align-items:flex-end;text-align:right}
.apv-title-name,.apv-title-big{font-size:18px;font-weight:700;line-height:1.2;color:var(--ink);letter-spacing:-.01em}
.apv-title-name{overflow-wrap:anywhere}
.apv-title-big{font-variant-numeric:tabular-nums;white-space:nowrap}
.apv-title-sub{font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.apv-title-sub:empty{display:none}
@media (min-width:768px){
  .apv-title-name,.apv-title-big{font-size:21px}
  .apv-pick{padding-top:6px}
}
.ex2-snap{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin-bottom:10px}
.ex2-snap-btn{min-height:56px;font-size:17px;font-weight:700;border-radius:12px}
.ex2-snap-sub{font-size:12.5px;color:var(--muted);text-align:center}
/* the big "Photograph a slip" (camera) button is for a phone only; a computer uploads through the drop zone's one
   "Upload a slip" button (Callan 5 Nov: "photo is only for mobile"; "we only need one upload") */
.ex2-slip-row{display:grid;grid-template-columns:1fr;gap:8px}
/* A claim's detail (Callan 5 Nov: everything the person entered, so the reviewer knows what they approve) is drawn as
   the Approvals card (Callan 3 Dec 2026, of three looks of the claim's review: "but order it better so that all the
   small things are together and that it makes sense for a user" - "implement please"; expenses.js claimView): its title
   and two grey panels, the facts (label | value) and the boxes (.apv-title, .apv-panel, .apv-rr and .apv-facts, the
   Approvals card's), with the slip beside them on a computer: at most 340px, never wider than the details. .ex2-figs is
   the details' column, the container the panels' rows measure. */
.ex2-review{display:grid;grid-template-columns:1fr;gap:12px 20px;margin:0 0 12px;align-items:start}
.ex2-figs{min-width:0;display:flex;flex-direction:column;gap:12px;container-type:inline-size}
.ex2-facts,.ex2-facts dd{margin:0}
.ex2-files{display:flex;flex-wrap:wrap;gap:4px 14px;min-width:0}
.ex2-file.is-shown{font-weight:700}
.ex2-file.is-plain{font-size:14px;overflow-wrap:anywhere}
/* The boxes panel (the review, H11/H12; the staff member's correction, W1). Its labels are the facts' (.apv-rk), in a
   column as wide as theirs - 160px from a 440px panel - so every label, value and box stands in one column; each box is
   38px, as Approvals' (.fld), and so are the buttons. A phone: the label over its box, the box across. From 440px: the
   label beside its box, each box as wide as what goes in it (where it was spent 260px, an amount 110px, the customer
   200px; the slip's date and the VAT code one size, 150px, as they stand one over the other: Callan 3 Dec 2026, "same
   size please"). From 960px: where it was spent and the expense account on one line, and the
   small boxes in one aligned block, three pairs to a row (.ex2-grid) - the slip's date, its total and the amount
   claimed; the VAT code, the VAT and a customer to rebill - its boxes in the same column as every other box, the second
   and third labels of a row 28px off the box before them, the VAT's line under the VAT boxes. Save changes, Save & approve and Cancel in the panel's far corner (in
   Andre's order, ux.css). */
.ex2-boxes .ex2-pair{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;align-items:start;min-width:0;margin:0}
.ex2-boxes .ex2-box{display:flex;flex-direction:column;align-items:stretch;gap:6px;min-width:0}
.ex2-boxes .form-control{width:100%;min-width:0;height:38px;min-height:38px;box-sizing:border-box;margin:0}
.ex2-boxes sleek-date .sleek-date-in{height:38px}
.ex2-boxes textarea.form-control{height:auto;min-height:38px}
.ex2-boxes .cb-alloc-line{margin-top:0;min-height:38px}
/* the account's buttons at the boxes' height: the bank's own pill ("+ Allocate GL Account", a chosen account, its ✕) is
   26px tall and stood among the review's 38px boxes (golden rule 9; 4 Dec 2026 sweep #18) */
.ex2-boxes .cb-alloc-line > .alloc-btn,.ex2-boxes .cb-alloc-line > .alloc-btn-matched,
.ex2-boxes .cb-alloc-line > .cb-clear-btn{min-height:38px;box-sizing:border-box;display:inline-flex;align-items:center}
.ex2-line,.ex2-grid{display:flex;flex-direction:column;gap:10px}
.ex2-boxes .ex2-rv-actions{flex-wrap:wrap}
.ex2-boxes .ex2-rv-rebill{align-items:flex-start;margin-top:0;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
.ex2-boxes .ex2-rv-rebill .chk{flex:0 0 auto;margin:1px 0 0}
.ex2-boxes .ex2-rv-actions .btn{height:38px;min-height:38px;padding:0 18px;margin:0;box-sizing:border-box}
@container (min-width:440px){
  .ex2-boxes .ex2-pair{grid-template-columns:160px minmax(0,1fr);gap:4px 16px}
  .ex2-boxes .ex2-pair > .apv-rk{min-height:38px;display:flex;align-items:center}
  .ex2-boxes .ex2-box{align-items:flex-start}
  .ex2-pair.is-spent .ex2-box > .form-control{width:260px;max-width:100%}
  .ex2-pair.is-date .ex2-box > .form-control{width:150px}
  .ex2-pair.is-money .ex2-box > .form-control{width:110px}
  .ex2-pair.is-code .ex2-box > .ss{width:150px;max-width:100%}
  .ex2-pair.is-rebill .ex2-box > .ss{width:200px;max-width:100%}
  .ex2-pair.is-text .ex2-box,.ex2-pair.is-note .ex2-box{align-items:stretch}
  .ex2-pair.is-text .ex2-box > .form-control{max-width:520px}
  .ex2-grid > .ex2-vat-hint{margin:-6px 0 0 176px}
}
@container (min-width:960px){
  .ex2-line{flex-direction:row;align-items:flex-start;gap:28px}
  .ex2-line > .ex2-pair{flex:0 0 auto}
  .ex2-line > .ex2-pair.is-account{flex:1 1 auto;grid-template-columns:auto minmax(0,1fr)}
  .ex2-grid{display:grid;grid-template-columns:160px repeat(5,max-content);gap:10px 16px;align-items:start;grid-auto-flow:row dense}
  .ex2-grid > .ex2-pair{display:contents}
  .ex2-grid > .ex2-pair:not(.is-date):not(.is-code) > .apv-rk{padding-left:12px}
  .ex2-grid > .ex2-vat-hint{grid-column:2 / -1;margin:-4px 0 0}
  /* the customer's box keeps its 200px when its on-charge tick shows: the tick's words wrap under it (they ran past the
     panel and behind the slip: Callan 3 Dec 2026, "copy is going behind the slip") */
  .ex2-grid > .ex2-pair.is-rebill > .ex2-box{width:200px}
}
.ex2-slip-view{display:flex;align-items:center;justify-content:center;min-height:120px;max-height:420px;overflow:hidden;
  background:var(--surface);border:1px solid var(--line);border-radius:10px}
.ex2-slip-view.is-empty{font-size:12.5px;color:var(--muted);padding:12px;text-align:center}
.ex2-slip-img{display:block;max-width:100%;max-height:420px;object-fit:contain}
.ex2-slip-pdf{display:block;width:100%;height:420px;border:0}
.ex2-bill{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12.5px;color:var(--muted)}
.ex2-owed{font-weight:700;color:var(--ink)}
.ex2-mine{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}
.ex2-mine > div{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px 10px;
  display:flex;flex-direction:column;gap:2px;font-size:12.5px;color:var(--muted)}
.ex2-mine b{font-size:16px;color:var(--ink)}
/* 5 Nov huddle: the staff member's one question about a read slip (H1/H2), the documents on the manual form (H8) and
   the admin's review in place at the claim (H11/H12) — tight spacing, Save changes / Cancel right-aligned (rule 7) */
/* H16: the capture card's title with the Bank Accounts' Auto | Manual switch (.cb-mode-toggle) at its right; on a
   narrow phone the switch drops under the title */
.ex2-cap-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.ex2-cap-head > .rail-card-title{margin:0}
.ex2-ask{display:flex;flex-direction:column;gap:8px;margin:4px 0 0;padding:12px;background:var(--surface);
  border:1px solid var(--line);border-radius:10px}
.ex2-ask-what{font-size:12.5px;color:var(--muted);overflow-wrap:anywhere}
.ex2-ask-q{font-size:18px;font-weight:700;color:var(--ink)}
.ex2-ask-why{font-size:12.5px;color:var(--muted);overflow-wrap:anywhere}
.ex2-ask-acts{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}
.ex2-ask-acts .btn{min-width:88px;height:var(--control-h);min-height:var(--control-h);box-sizing:border-box;margin:0}
.ex2-ask-amt{display:flex;flex-direction:column;gap:8px}
.ex2-ask-amt .fld{margin:0}
.ex2-ask-input{height:var(--control-h);box-sizing:border-box}
.ex2-docs{display:flex;flex-direction:column;gap:6px}
.ex2-doc-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.ex2-doc-list li{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px;padding:4px 8px;
  border:1px solid var(--line);border-radius:8px;min-width:0}
.ex2-doc-list li.is-open{border-color:var(--brand)}
/* the whole file name opens/hides its preview (Callan 6 Nov: "click on the entire thing") */
.ex2-doc-open{flex:1;min-width:0;align-self:stretch;text-align:left;background:none;border:0;padding:0;font:inherit;
  color:inherit;cursor:pointer;overflow-wrap:anywhere}
.ex2-doc-open:hover{color:var(--brand)}
/* attachments card, opt-in preview (claims only): the whole file name opens it in place under its row */
.attach-open{text-align:left;background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer}
.attach-open:hover b{color:var(--brand)}
.attach-row.is-open{border-color:var(--brand)}
/* Download keeps clear of the file's bin: the bin sits in the row's top-right corner (ux.css .has-card-del, 1 Dec 2026)
   and only the row's first line made room for it, but Download shares that line from 768px up — the bin lay over its
   right end (4 Dec 2026 sweep #6: 768, 1024 and 1366px; a phone puts Download on a line of its own) */
body.vt .attach-row.has-card-del > .row-actions{padding-right:32px}
.attach-preview{display:flex;align-items:center;justify-content:center;min-height:120px;max-height:520px;overflow:hidden;
  background:var(--surface);border:1px solid var(--line);border-radius:10px}
.attach-preview.is-empty{font-size:12.5px;color:var(--muted);padding:12px;text-align:center}
.attach-preview-img{display:block;max-width:100%;max-height:520px;object-fit:contain}
.attach-preview-pdf{display:block;width:100%;height:520px;border:0}
/* the attached documents shown in place: in the form before sending, and every photo/PDF in a claim (Callan 6 Nov) */
.ex2-slip-col{display:flex;flex-direction:column;gap:6px;min-width:0}
/* the 16 Nov 2026 claims review: Undo approval asks why in place at the claim (U2) — the reason, then Cancel and
   Undo approval on the right, as the review's own bar; another claim that looks like the same spend (M5); a PDF slip's
   Open button (U7) */
.ex2-undo{display:flex;flex-direction:column;gap:8px;margin:0 0 10px}
.ex2-undo .fld{margin:0}
/* 16 Nov evening (invoiceTest/EXPENSE-CLAIMS-PLAN.md): Reject asks why in place, as Undo approval does (R1); a note is
   added in place in the claim's Notes card (R2); the review's VAT box says where its VAT comes from, and a slip of mixed
   rates asks for it (V5, is-warn); the staff member's own correction keeps a note box at its own height (W1) */
.ex2-reject{display:flex;flex-direction:column;gap:8px;margin:0 0 10px}
.ex2-reject .fld{margin:0}
.ex2-reject-actions,.ex2-rv-actions,.ex2-undo-actions{display:flex;justify-content:flex-end;gap:8px}
.ex2-note-add{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.ex2-note-actions{display:flex;justify-content:flex-end}
.ex2-vat-hint{font-size:12px;line-height:1.35;color:var(--muted);margin-top:4px;white-space:normal}
.ex2-vat-hint:empty{display:none}
.ex2-vat-hint.is-warn{color:var(--bad);font-weight:600}
.ex2-fact.is-warn .apv-rv{color:var(--bad);font-weight:600;white-space:normal}
.ex2-dup{margin-left:6px}
.ex2-slip-open{align-self:flex-start}
.ex2-files-host{min-width:0}
.apv-warn{font-size:12.5px;font-weight:600;color:var(--bad)}
/* 18 Nov 2026 (Callan): a possible duplicate names the other claim, and its name opens the two side by side, in place —
   both slips and their figures, what is the same in the warning's colour — with Close and Open the other claim on the
   right; a claim opened from a notice or a link is lit up where it stands; a claim with no account yet says nothing
   about its VAT (its line is empty) */
.dup-link{display:inline;margin:0;padding:0;background:none;border:0;font:inherit;color:inherit;text-align:left;
  text-decoration:underline;text-underline-offset:2px;cursor:pointer;overflow-wrap:anywhere}
.dup-link:hover{color:var(--ink)}
.dup-link:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.dup-cmp{display:flex;flex-direction:column;gap:8px;margin-top:6px;padding:10px 12px;border:1px solid var(--line);
  border-radius:10px;font-size:13px;font-weight:400;color:var(--ink);white-space:normal}
.dup-cmp-grid{display:grid;grid-template-columns:minmax(64px,max-content) minmax(0,1fr) minmax(0,1fr);gap:6px 12px;
  align-items:start}
.dup-cmp-h{font-size:12px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}
.dup-cmp-k{font-size:12px;color:var(--muted)}
.dup-cmp-v,.ex2-doc-list li > span{min-width:0;overflow-wrap:anywhere}
.dup-cmp-v.is-same{font-weight:700;color:var(--bad)}
.dup-cmp-slip{display:flex;align-items:center;justify-content:center;min-height:72px;max-height:220px;overflow:hidden;
  border:1px solid var(--line);border-radius:8px}
.dup-cmp-slip img{display:block;max-width:100%;max-height:220px;object-fit:contain}
.dup-cmp-slip.is-empty{padding:8px;font-size:12px;color:var(--muted);text-align:center}
.dup-cmp-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}
@keyframes apvflash{0%{box-shadow:0 0 0 3px color-mix(in srgb, var(--c-teal-l46) 60%, transparent)}100%{box-shadow:0 0 0 3px color-mix(in srgb, var(--c-teal-l46) 0%, transparent)}}
.apv-item.row-hl{animation:apvflash 2s ease-out}
.expense-tbl tr.row-hl > td{animation:rowflash 2s ease-out}
.apv-vat:empty{display:none}
.ex2-rv-rebill{display:flex;align-items:center;gap:6px;margin-top:6px;font-size:12.5px;color:var(--ink)}
/* the Manual form (16 Nov 2026, P1): a field's box is 38px (vt.css, `.fld > input`), but the Document date's box sits
   inside its <sleek-date>, so it took .form-control's 32px and stood 6px short of What was it for and Amount claimed
   beside it (golden rule 9). It takes the field's 38px. */
body.vt .expense-form .fld > sleek-date .sleek-date-in{height:38px}
/* the Manual form's spacing (18 Nov 2026, Callan: "padding"): one 12px space between every part, as between the grid's
   rows — "Attach a document" stood on the note's label (0px), the grid 18px above it, the buttons 8px under the note */
body.vt .expense-form{display:flex;flex-direction:column;gap:12px}
body.vt .expense-form .grid2{margin-bottom:0}
body.vt .expense-form .expense-form-actions{margin-top:0}
@media (min-width:768px){
  .ex2-snap{flex-direction:row;align-items:center}
  .ex2-snap.ex2-snap-camera{display:none}
  .ex2-slip-row{grid-template-columns:1fr 1fr}
  .ex2-review{grid-template-columns:minmax(0,1fr) minmax(0,min(340px,calc(50% - 10px)))}
}
.nr-wrap{display:flex;flex-direction:column;gap:12px}
.nr-sec{display:flex;flex-direction:column;gap:6px}
.nr-sec-h{font-size:13px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.nr-item{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;background:var(--surface);border:1px solid var(--line);
  border-radius:10px;padding:8px 12px}
.nr-main{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:2px}
.nr-sub{font-size:12.5px;color:var(--muted)}
.nr-amt{font-weight:700;white-space:nowrap}
.nr-acts{display:flex;justify-content:flex-end;gap:8px;margin-left:auto}
.mbx-list{display:flex;flex-direction:column;gap:8px}
.mbx-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;border:1px solid var(--line);border-radius:10px;padding:8px 12px}
.mbx-main{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:2px}
.mbx-sub{font-size:12.5px;color:var(--muted);overflow-wrap:anywhere}
.mbx-err{font-size:12.5px;color:var(--bad)}
.mbx-form{display:grid;grid-template-columns:1fr;gap:8px;border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.mbx-edit-actions{display:flex;justify-content:flex-end;gap:8px}
@media (min-width:768px){ .mbx-form{grid-template-columns:1fr 1fr} .mbx-form > .mbx-wide{grid-column:1 / -1} }
.apv-drop{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
/* on the claims screens (Expenses, Approvals) every hidden file input (.attach-file-input: the approvals drop area,
   the phone camera button, the expenses drop area, a claim's attachments) stays the 1px it is meant to be: vt.css's
   `body.vt input{…;padding:8px 10px;width:100%}` outranks .attach-file-input, and an absolutely placed full-width
   input pushed those pages wider than the screen (desktop and phone). Other screens are left as they are. */
body.vt .expense-page .attach-file-input,body.vt .apv-page .attach-file-input{width:1px;padding:0;border:0}
.team-staff-opt{display:flex;align-items:center;gap:8px;font-size:13px;margin-top:6px}
/* A9: Fetch mail on the empty bank page (a company with no bank account yet) */
.cb-no-acct-mail{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin-top:10px}
.cb-no-acct-mail .cb-fetch-mail{margin-left:0}                /* the toolbar's pushes it to the right edge */

/* Banking ▸ Bank feeds (plan/bank-feeds.md): the Wise panel opens in place under the head row */
.feed-panel{margin-bottom:12px}
.feed-head h3{margin-top:0}
.feed-steps{margin:0 0 10px;padding-left:20px;color:var(--muted);font-size:13px;line-height:1.5}
.feed-connect{display:flex;gap:8px;flex-wrap:wrap}
.feed-connect>.form-control{flex:1 1 260px;min-width:0}
.feed-status{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-bottom:10px}
.feed-actions{display:flex;gap:8px;margin-left:auto;flex-wrap:wrap;align-items:center}
.feed-key{margin:0 0 10px}
.feed-key>summary{cursor:pointer;font-weight:600}
.feed-key>summary>small{font-weight:400;color:var(--muted);margin-left:6px}
.feed-key-text{margin:8px 0;font-size:12px;resize:vertical}
.feed-note{margin-top:8px;color:var(--ok);font-size:13px}
.feed-bal .feed-card{min-width:180px}
.cb-feeds-btn.on{border-color:var(--brand);color:var(--brand)}

/* a gap line's "fix from balance" (owner 2026-11-11) sits beside its gap badge; a gap line's delete asks why */
.cb-gap-fix{margin-left:4px;border:1px solid var(--brand);background:transparent;color:var(--brand);border-radius:999px;
  font-size:12px;padding:0 8px;cursor:pointer;white-space:nowrap}
.cb-gap-fix:disabled{opacity:.5}
.cb-del-why{min-width:180px;max-width:260px}

/* Import data → Sleek: the stages a company moves across in, with their counts */
.sleek-import [hidden]{display:none}
.sleek-stages{display:flex;flex-direction:column;gap:6px;margin:8px 0 10px}
.sleek-stage{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.sleek-stage-name{font-weight:600}
.sleek-stage-count{color:var(--muted);font-variant-numeric:tabular-nums;text-align:right}
.sleek-stage.is-running{border-color:var(--brand)}
.sleek-stage.is-done .sleek-stage-count{color:var(--good,var(--c-emerald-600))}
.sleek-stage.is-failed{border-color:var(--bad)}

/* Document → Email (owner 2026-11-21: "All documents need an option to email to customer as well with message"):
   in place under the head; two columns on a wide screen, one on a phone; Cancel + Send on the right */
.de-email{margin-bottom:12px}
.de-email-head{font-weight:700;margin-bottom:8px}
.de-email-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px}
.de-email-wide{grid-column:1 / -1}
.de-email-grid textarea{resize:vertical;min-height:110px}
.de-email-opts{display:flex;flex-wrap:wrap;gap:4px 18px;margin-top:6px}
.de-email-note{font-size:12px;margin-top:4px}
.de-email .row-err{margin-top:8px}
.de-email-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
@media (max-width:767px){ .de-email-grid{grid-template-columns:1fr} }

/* Bank import notice → the lines it parked, each with Show on statement (owner 2026-11-21: "we need to be able to view
   where this came from on the statement from the error feedback") */
.cb-parked{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.cb-parked-line{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}
.cb-parked-desc{flex:1 1 180px;min-width:0;overflow-wrap:anywhere}
.cb-parked-amt{white-space:nowrap}
.cb-parked-why{font-size:12px;opacity:.8;flex:1 1 100%}
.cb-parked-locate{margin-left:auto}
@media (max-width:767px){ .cb-parked-locate{margin-left:0;flex:1 1 100%} }


/* General Ledger: a cashbook line's source names its cashbook, cut with … to the column (full name on hover) */
.rp-src-cb{display:inline-block;max-width:18ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}

/* A check-line with nothing to act on (Banking → Select All when every line shown is posted): greyed, its title says why */
.check-line.is-disabled{opacity:.55;cursor:not-allowed}
.check-line.is-disabled input{cursor:not-allowed}

/* Card lists — THE one responsive table (code audit D3, owner 2026-11-22): a table in a .rwrap reads as cards when
   its room is narrow — a container query, so it follows the space the table has, not the screen. Each cell's
   data-label becomes its caption; .rc-name is the card title, .rc-acts the action row. .ak-* (Settings → API Keys &
   MCP) are the same rule under their first names. */
.rwrap, .ak-wrap{container-type:inline-size}
@container (max-width: 1000px){
  .rwrap, .ak-wrap{overflow-x:visible}
  .rcards, .rcards tbody, .rcards tr, .rcards td,
  .ak-cards, .ak-cards tbody, .ak-cards tr, .ak-cards td{display:block;width:auto}
  .rcards thead, .ak-cards thead{display:none}
  /* one panel, never two (owner 2026-11-22): the list sits in its own bordered .tbl-wrap, so a row is a section of
     that panel — a line between rows, no outline of its own — and the "No … yet." row sits plainly in it */
  .rcards tr, .ak-cards tr{border:0;border-radius:0;margin:0;padding:10px 12px;background:transparent;border-bottom:1px solid var(--line)}
  .rcards tr:last-child, .ak-cards tr:last-child{border-bottom:0}
  .rcards td, .ak-cards td{display:flex;gap:10px;align-items:baseline;border:0;padding:3px 0;text-align:left !important;white-space:normal}
  .rcards td[data-label]::before, .ak-cards td[data-label]::before{content:attr(data-label);flex:0 0 120px;font-size:10.5px;font-weight:700;
    text-transform:uppercase;letter-spacing:.08em;color:var(--faint)}
  .rcards td.rc-name, .ak-cards td.ak-name{font-weight:700;font-size:1.02em;padding-bottom:6px}
  .ak-cards td.ak-scopes{overflow-wrap:anywhere}
  .rcards td.rc-acts, .ak-cards td.ak-acts{justify-content:flex-start;flex-wrap:wrap;gap:8px;padding-top:8px;margin-top:4px;border-top:1px solid var(--line)}
  .rcards td.rc-acts:empty, .ak-cards td.ak-acts:empty{display:none}
  .rcards td[colspan], .ak-cards td[colspan]{display:block;padding:12px 4px}
  /* the asset register folded, still dense: the name on its own line, the figures side by side, the buttons at the
     line's end — three lines an asset, not nine (owner 1 Dec 2026: "still a bit bulky" · "1000 assets") */
  .rcards.fa-list tr{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 16px;padding:8px 12px}
  .rcards.fa-list td{display:inline-flex;gap:6px;padding:1px 0;width:auto}
  html body.vt .rcards.fa-list td{border:0}            /* no line under each figure */
  .rcards.fa-list td[data-label]::before{flex:none;font-size:10px;letter-spacing:.06em;text-transform:uppercase}
  .rcards.fa-list td.rc-name{flex:0 0 100%;padding-bottom:2px}
  .rcards.fa-list td.rc-acts{margin-left:auto;border-top:0;padding-top:0;margin-top:0;gap:6px}
  .rcards.fa-list td[colspan]{flex:0 0 100%}
  .rcards.fa-list tr.fa-view-row{display:block;padding:0 12px}
  .rcards.fa-list tr.fa-view-row > td{display:block;width:100%}
}
/* a success line inside a screen (Finance, Fixed Assets) — the same look as .alert-ok; it had no style at all */
.ok-note{border:1px solid var(--ok);color:var(--ok);border-radius:10px;padding:6px 12px;background:var(--surface);margin:8px 0}
.fa-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}
.fa-bar input[type=search]{flex:1 1 220px;min-width:0}
body.vt .fa-bar input[type=search]{flex:1 1 160px}
.fa-depr{display:inline-flex;gap:6px;flex-wrap:wrap}
.fin-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:12px 0}
.fin-totals .card{padding:12px 14px;display:flex;flex-direction:column;gap:4px}
.fin-totals strong{font-size:1.25em}
.fa-choice label.inline{display:flex;align-items:center;gap:8px;margin:4px 0;font-weight:400;text-transform:none;letter-spacing:0}
.fa-choice label.inline input{width:auto;flex:0 0 auto;margin:0}
/* an asset opened in place under its row (plan §20.9): its figures, the agreement that finances it, its events */
.fa-view-row > td{background:var(--surface)}
.fa-view{display:flex;flex-direction:column;gap:10px;padding:4px 0}
.fa-view-figs{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px 16px}
.fa-fig{display:flex;flex-direction:column;gap:2px;min-width:0}
.fa-fig small{color:var(--muted)}
.fa-fig span{overflow-wrap:anywhere}
.fa-view-fin{display:flex;flex-direction:column;gap:2px}
.fa-view-actions{display:flex;justify-content:flex-end;gap:8px}
.fin-asset-name{color:var(--muted);font-weight:400}
/* the Finance screen's Year end tab (plan §20.10). Its first card is one line (Callan's pick, 29 Nov 2026: look 1 of 5):
   "YEAR END [date]" on the left, the three steps on the right, every control the shared height and on one middle line;
   the card keeps the app's compact inset. A row, said outright: tina4css's .card is a column (its flex-direction), which
   stacked the date and the steps. On a phone the date fills its row and the steps take the full width under it */
.fin-ye{display:flex;flex-direction:column;gap:12px}
.fin-ye[hidden],.fin-list-wrap[hidden]{display:none}
.fin-ye-bar{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px 12px}
.fin-ye-at{display:flex;align-items:center;gap:12px;margin:0}
.fin-ye-cap{font-size:10.5px;text-transform:uppercase;letter-spacing:.11em;color:var(--faint);font-weight:700;white-space:nowrap}
.fin-ye-at>sleek-date{width:150px;flex:0 0 150px}
.fin-ye-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-left:auto;justify-content:flex-end}
body.vt .fin-ye-bar .btn{height:var(--control-h);min-height:var(--control-h);box-sizing:border-box;display:inline-flex;align-items:center;margin:0}
@media (max-width:767px){
  .fin-ye-at{flex:1 1 100%}
  .fin-ye-at>sleek-date{flex:1 1 auto;width:auto}
  .fin-ye-actions{flex:1 1 100%;margin-left:0}
  body.vt .fin-ye-bar .fin-ye-actions>.btn{flex:1 1 auto;justify-content:center}
}
/* the Fixed Assets screen's Disposals register and Move in place (plan §20.11) */
.fa-list-wrap[hidden]{display:none}
.fa-move{display:flex;flex-direction:column;gap:10px;padding:4px 0}
/* Finance's and Fixed Assets' forms keep Cancel and their main button in the shared .form-actions row, so Andre's order
   (ux.css) sets them: on Windows the main button, then Cancel; on a Mac and elsewhere, Cancel, then the main button
   (Callan, 28 Nov 2026: "keep the button order consistent with the rest of the programme"). Dispose is its form's main
   button though it is red, not the primary: it takes the primary's place in that order. The Move form keeps the gap it
   had above its buttons */
body.vt .fa-page .form-actions>.btn.bad[data-fa-dispose-save]{order:2}
html.platform-windows body.vt .fa-page .form-actions>.btn.bad[data-fa-dispose-save]{order:1}
body.vt .fa-move>.form-actions{margin-top:0}
/* "The asset is a vehicle" (New agreement, hire purchase): its box and its words on the line the input boxes take, level
   with the Financed asset box beside it, as Settings ▸ Chart's ticks are (Callan, 28 Nov 2026: "align the asset is a
   vehicle please with the input box") */
body.vt .fin-new .grid2>.fld.fin-tick{align-self:end}
/* Finance import in the background (decision 25, 25 Nov 2026): its progress, and the documents that wait for the user —
   one card each, mobile first (the counts wrap), the actions on the right */
.fin-job,.fin-wait,.fin-start{padding:12px 14px;margin:8px 0}
.fin-job-hd{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.fin-job-hd strong{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fin-job-hd .set-badge{margin-left:0}
.fin-job-counts{display:flex;flex-wrap:wrap;gap:6px 18px;margin-top:8px}
.fin-job-count{display:inline-flex;align-items:baseline;gap:6px}
.fin-job-count small{color:var(--muted)}
.fin-job-others{display:flex;flex-direction:column;gap:2px;margin-top:8px;font-size:13px}
.fin-job-other small{color:var(--muted);margin-right:6px}
.fin-wait h3{margin:0 0 6px}
.fin-wait-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:0 0 6px}
.fin-wait-head h3{margin:0}
/* each waiting document is a card of its own, its bin in that card's top-right corner (owner 1 Dec 2026: "must be top
   right") */
.fin-wait-row{padding:10px 12px;background:var(--bg);border:1px solid var(--line);border-radius:var(--radius-sm,8px)}
.fin-wait-row + .fin-wait-row{margin-top:8px}
.fin-wait-line{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.fin-wait-reason{font-size:12.5px;color:var(--muted);margin:3px 0 6px}
.fin-wait-reason.is-held,.fin-wait-reason.is-warn{color:var(--warn)}
/* the ledgers a contract's agreement opens, confirmed with it (ADR-0027 §5) */
.fin-wait-ledgers{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;font-size:12.5px;margin:0 0 6px}
.fin-wait-ledgers small{color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.fin-wait-ledger b{font-variant-numeric:tabular-nums}
/* an agreement opened in place under its row (owner 1 Dec 2026: "Open it in place"): its buttons on top, what it owes,
   its four accounts, and its Schedule, Documents and Activity tabs */
.fin-ag-row{cursor:pointer}
.fin-ag-row.is-open td{background:var(--brand-faint)}
.fin-ag-caret{color:var(--muted);display:inline-block;width:12px}
.fin-open{display:flex;flex-direction:column;gap:10px;padding:6px 2px 10px}
.fin-open-head{display:flex;justify-content:flex-end}
.fin-act-box{border:1px solid var(--brand);border-radius:var(--radius-sm,8px);padding:10px 12px;background:var(--bg)}
.fin-open-figs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 16px}
.fin-open-accounts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 16px;padding:8px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.fin-open-acct{display:flex;flex-direction:column;gap:1px;font-size:13px}
.fin-open-acct small,.fin-open-figs small{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:700}
@media (max-width:700px){.fin-open-figs{grid-template-columns:repeat(2,minmax(0,1fr))}.fin-open-accounts{grid-template-columns:1fr}}
/* an agreement's schedule as a spreadsheet (owner 1 Dec 2026: "like a spreadsheet not cards" · "a running balance"):
   gridlines, tabular figures, the heading pinned, the balance column set apart; it scrolls sideways in its own box */
.fin-sheet-wrap{overflow:auto;max-height:420px;border:1px solid var(--line);border-radius:var(--radius-sm,8px);background:var(--bg)}
.fin-sheet{border-collapse:collapse;width:100%;font-size:12.5px;font-variant-numeric:tabular-nums;white-space:nowrap}
.fin-sheet th,.fin-sheet td{border:1px solid var(--line);padding:4px 8px}
.fin-sheet thead th{position:sticky;top:0;background:var(--surface-2,var(--surface));font-weight:700;z-index:1}
.fin-sheet tfoot td{font-weight:700;background:var(--surface-2,var(--surface));position:sticky;bottom:0}
.fin-sheet-n{color:var(--muted);text-align:right;width:1%}
.fin-sheet-bal{font-weight:650;background:var(--brand-faint)}
.fin-contract-link{margin-top:3px;font-size:12.5px}
.fin-contract-link a{color:var(--brand);text-decoration:none}
.fin-contract-link a:hover{text-decoration:underline}
/* an agreement's card, split: its name, figures and buttons on the left, its documents on the right (under on a phone) */
.fin-list{display:flex;flex-direction:column;gap:10px}
.fin-ag{padding:12px 14px;margin:0}
.fin-ag-split{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:14px}
.fin-ag-main{display:flex;flex-direction:column;gap:8px;min-width:0}
.fin-ag-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.fin-ag-name{min-width:0;flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fin-ag-btns{flex:0 1 auto;flex-wrap:wrap;justify-content:flex-end}
.fin-ag-figs{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:6px 14px;font-size:13px}
.fin-ag-figs > div{display:flex;flex-direction:column;gap:1px}
.fin-ag-figs small,.fin-card-docs > small{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:700}
/* the asset register, one line per asset (owner 1 Dec 2026: "If we have 1000 assets its going to be very tedious"): its
   type with Move beside it, its buttons on the row */
.fa-list td{vertical-align:middle}
.fa-list .fa-code{font-size:12px}
.fa-list td.fa-name{min-width:220px;max-width:340px}
.fa-list td.fa-name > b{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.fa-list td.fa-name > .fa-sub{display:block;font-size:12px;margin-top:2px;white-space:nowrap}
.fa-list td.fa-fin{max-width:200px}
.fa-list td.fa-fin > *{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fa-type-fig > span{display:flex;align-items:center;gap:8px;white-space:nowrap;min-width:0}
.fa-type-fig > span > :first-child{overflow:hidden;text-overflow:ellipsis;max-width:200px}
.fa-type-fig .fa-move-btn{font-size:12px;text-decoration:underline;text-underline-offset:2px}
.fa-list .fa-fin .fin-card-doc{max-width:200px}
.fa-list .rc-acts{white-space:nowrap}
.fa-list .rc-acts .btn + .btn{margin-left:6px}
/* a form on the line under an asset: one panel the row's width, no white row behind it (owner 1 Dec 2026: "fix the
   double layered background effect" · "why does this not fill the box") */
.fa-list tr.fa-view-row, .fa-list tr.fa-view-row > td{background:transparent}
.fa-list tr.fa-view-row > td{padding:6px 0 12px}
.fa-list tr.fa-view-row > td > *{width:100%;box-sizing:border-box;margin:0}
.fa-edit-grid .fa-edit-notes{grid-column:1 / -1}
.fa-edit-grid textarea{resize:vertical;min-height:72px}
.fin-ag .fin-card-docs{border-left:1px solid var(--line);padding-left:12px}
.fin-ag .fin-act-box,.fin-ag .fin-view{margin-top:10px}
/* an agreement's ledger under its card: its four accounts, each a small grid with its balance */
@media (max-width:760px){.fin-ag-split{grid-template-columns:1fr}.fin-ag .fin-card-docs{border-left:0;padding-left:0;border-top:1px solid var(--line);padding-top:8px}
  .fin-ag-figs{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* the card's documents, on its right on a tablet or desktop, under it on a phone; a file dropped on the card is
   read and kept with it (owner 1 Dec 2026) */
.fin-card-docs{display:flex;flex-direction:column;gap:2px;font-size:12.5px;min-width:160px}
.fin-card-doc{color:var(--brand);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px;background:none;border:0;padding:0;margin:0;font:inherit;text-align:left;cursor:pointer}
.fin-card-doc:hover{text-decoration:underline}
.fin-card-drop.is-dragover{background:var(--brand-faint);outline:2px dashed var(--brand);outline-offset:-2px}
.fin-more{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding-top:6px;border-top:1px solid var(--line);margin-top:4px}
.fin-more small{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:700}
.fin-new-asset{padding:6px 0}
/* the Edit form: its accounts across the top, then the asset, then the rate row (owner 1 Dec 2026: "Fix this screen
   layout") */
.fin-edit{display:flex;flex-direction:column;gap:10px}
.fin-edit-accounts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 14px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.fin-edit-acct{display:flex;flex-direction:column;gap:1px;min-width:0;font-size:13px}
.fin-edit-acct small{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:700}
.fin-edit-acct span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fin-edit-asset{margin:0}
.fin-edit-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px 14px}
.fin-edit-row .fld{margin:0}
@media (max-width:760px){.fin-edit-accounts{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* an agreement's card buttons: Schedule, Edit — one line, wrapping on a phone */
.fin-row-btns{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}
.fin-act-through{align-self:end}
/* an agreement's documents, opened from its Actions menu: the contract first */
.fin-docs{display:flex;flex-direction:column;gap:6px;padding:6px 0}
.fin-doc{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.fin-doc > span{display:flex;gap:8px;flex-wrap:wrap;align-items:baseline}
/* what confirming a contract books, and its asset, shown first (owner 1 Dec 2026) */
.fin-wait-entries{margin:2px 0 8px;display:flex;flex-direction:column;gap:4px}
.fin-wait-entries > small,.fin-wait-asset small{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:700}
.fin-wait-asset{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin-bottom:4px}
.fin-wait-asset-cost{margin-left:auto;font-variant-numeric:tabular-nums}
.fin-wait-journal{font-size:12.5px}
.fin-wait-journal td,.fin-wait-journal th{padding:3px 8px}
.fin-wait-journal td.ta-r{font-variant-numeric:tabular-nums;white-space:nowrap}
.fin-wait-journal-head td{color:var(--muted);font-style:italic;padding-top:6px}
/* the three accounts a contract's agreement works with — loan, future finance charges, payments control — and its
   interest method, each a lookup wide enough to read (owner 1 Dec 2026: "I want to clearly see the accounts") */
.fin-wait-accounts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 14px;margin:2px 0 8px}
.fin-wait-accounts .fin-wait-acct{margin:0}
.fin-wait-accounts .fin-wait-acct .ss{width:100%}
@media (max-width:700px){.fin-wait-accounts{grid-template-columns:1fr}}
/* the interest method on a contract's card: wide enough to read every method in full (owner 1 Dec 2026: "this is not wide
   enough to read properly") */
.fin-wait-ledgers .fin-wait-method{flex:1 1 100%;max-width:340px}
.fin-wait-ledgers .fin-wait-method .ss{width:100%}
.fin-wait-actions{display:flex;justify-content:flex-end;align-items:flex-end;gap:8px;flex-wrap:wrap}
.fin-wait-actions .fld{flex:1 1 220px;margin:0}
/* a charge, a settlement, a settled agreement's Pay / Write off: in place under the agreement's row (decision 26) */
.fin-status{margin-right:auto}
.fin-act-row > td{background:var(--surface)}
.fin-act{padding:4px 0}
.fin-act .grid2 .fld{margin:0}
.fin-act-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:8px;flex-wrap:wrap}
/* a draw-down's choice (decision 21): Keep term / Keep instalment, as tall as the boxes beside it */
.fin-choice{display:flex;gap:6px;min-height:var(--control-h)}
.fin-choice > .seg{flex:1 1 0;justify-content:center}
/* a held document put right in place (decision 22): its page above its read on a phone, beside it on a desktop */
.fin-fix{display:grid;gap:10px;margin:4px 0 8px}
.fin-fix-pages{display:flex;flex-direction:column;gap:8px;max-height:60vh;overflow:auto;border:1px solid var(--line);
  border-radius:8px;background:var(--surface)}
.fin-fix-img{display:block;width:100%;height:auto}
.fin-fix-form{min-width:0}
.fin-fix-form .grid2 .fld{margin:0}
.fin-fix-lines{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.fin-fix-line{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:6px;align-items:center}
.fin-fix-line > *{min-width:0}
.fin-fix-line .form-control{width:100%;min-width:0;margin:0;height:var(--control-h);box-sizing:border-box}
.fin-fix-line > .btn-row-del{grid-column:3;grid-row:1 / span 2;align-self:center}
.fin-fix-row > .btn-row-del{grid-row:1 / span 3}
.fin-fix-add{display:flex;justify-content:flex-start;margin-top:6px}
.fin-fix-sum{margin-top:8px;font-size:12.5px;color:var(--ok, var(--muted))}
.fin-fix-sum.is-off{color:var(--warn)}
.fin-fix-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:10px}
@media (min-width:1024px){
  .fin-fix{grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);align-items:start}
  .fin-fix-pages{max-height:80vh}
  .fin-fix-line{grid-template-columns:150px 170px 130px minmax(0,1fr) auto}
  .fin-fix-row{grid-template-columns:150px repeat(4,minmax(0,1fr)) auto}
  .fin-fix-line > .btn-row-del,.fin-fix-row > .btn-row-del{grid-column:auto;grid-row:auto}
}
/* Clear imported data: the statements as tick boxes (owner 2026-11-21: "with checkboxes not with from and to") and the
   rules box — a scrolling list when there are many statements */
.cb-clear-ticks{display:flex;flex-direction:column;gap:2px;max-height:240px;overflow:auto;border:1px solid var(--line);
  border-radius:8px;padding:6px 10px;margin:6px 0 2px}
.cb-clear-ticks .check-line{margin:2px 0;align-items:baseline}
.cb-clear-st-all{font-weight:700;border-bottom:1px solid var(--line);padding-bottom:4px;margin-bottom:4px}
.cb-clear-st-name{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.cb-clear-st-lines{white-space:nowrap;font-size:12px}
.cb-clear-rules{margin-top:10px}
/* the clear open: its form widens (owner 2026-11-21: "make the modal larger" · "Its width can be larger") so each
   statement reads on one line; the ⚙ form alone keeps its 300px. placeCardForm places it by its own width. */
.cb-card.is-editing.is-clearing .cb-limit-edit{width:640px}
.cb-card.is-clearing .cb-clear-ticks{max-height:360px}
/* the clear's summary: Clears beside Keeps, one column on a phone */
.cb-clear-sum{display:grid;grid-template-columns:1fr 1fr;gap:4px 18px;margin-top:8px}
.cb-clear-sum .cb-clear-list{font-size:13px}
@media (max-width:640px){ .cb-clear-sum{grid-template-columns:1fr} }
/* the clear running: what it clears, a moving bar, the time it has taken */
.cb-clearing-what{font-weight:600;margin:6px 0 8px}
.cb-clearing-bar{position:relative;height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.cb-clearing-bar span{position:absolute;top:0;bottom:0;width:35%;border-radius:3px;background:var(--bad);
  animation:cb-clearing-move 1.4s ease-in-out infinite}
@keyframes cb-clearing-move{0%{left:-35%}100%{left:100%}}
@media (prefers-reduced-motion: reduce){ .cb-clearing-bar span{animation:none;left:0;width:100%;opacity:.5} }
.cb-clearing-time{font-size:12px;margin-top:6px;opacity:.8}
/* the clear's confirmation code: six capitals, shown large; what is typed reads the same */
.cb-clear-code{letter-spacing:.18em;font-size:1.05em;padding:1px 6px;border-radius:5px;background:var(--surface-2)}
.cb-clear-in-code{letter-spacing:.3em;text-transform:uppercase;font-size:1.05em}
.cb-clear-in-code::placeholder{letter-spacing:normal;text-transform:none}

/* Allocation rules → Apply all rules: the two head buttons side by side; the progress card */
.rules-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.rules-apply-said{font-weight:600;margin-bottom:8px}
.rules-apply.is-error .rules-apply-said{color:var(--bad)}
.rules-apply-bar{appearance:none;-webkit-appearance:none;width:100%;height:8px;border:0;border-radius:4px;background:var(--line);overflow:hidden}
.rules-apply-bar::-webkit-progress-bar{background:var(--line);border-radius:4px}
.rules-apply-bar::-webkit-progress-value{background:var(--accent, var(--c-teal-l30b));border-radius:4px;transition:width .3s}
.rules-apply-bar::-moz-progress-bar{background:var(--accent, var(--c-teal-l30b));border-radius:4px}
.rules-apply-actions{display:flex;justify-content:flex-end;margin-top:8px}

/* Editing a rule (owner 2026-11-21, its fields stood in a narrow column with the row empty beside them): the row's full
   width, the fields in one line as the add form lays them out (stem, type, scope, GL account), Save changes + Cancel on
   the right under them; one column on a phone */
.rule-card-edit{display:block}
.rule-card-edit .rule-edit-form{width:100%}
@media (min-width:760px){
  .rule-edit-form{display:grid;grid-template-columns:2fr 1fr 1fr 2fr;align-items:center}
  .rule-edit-form > .rule-edit-actions, .rule-edit-form > .rule-form-err, .rule-edit-form > .gl-create-slot{grid-column:1 / -1}
}
/* the lines the rule matches while it is edited: the five newest, with what each is booked to now */
@media (min-width:760px){ .rule-edit-form > .rule-examples{grid-column:1 / -1} }
.rule-examples{border-top:1px solid var(--line);padding-top:8px;margin-top:2px;font-size:13px}
.rule-ex-head{font-weight:600;margin-bottom:4px}
.rule-ex-table{width:100%;border-collapse:collapse}
.rule-ex-table td{padding:3px 8px 3px 0;vertical-align:baseline;border-bottom:1px solid var(--line)}
.rule-ex-table tr:last-child td{border-bottom:0}
.rule-ex-date,.rule-ex-amt{white-space:nowrap}
.rule-ex-amt{text-align:right}
.rule-ex-desc{overflow-wrap:anywhere}
.rule-ex-bank{white-space:nowrap;font-size:12px}
@media (max-width:640px){ .rule-ex-bank{display:none} }

/* One control height everywhere (owner 2026-11-22: "Height of drop down selects is not the same as inputs" · "Are we
   using a uniform component"). Golden rule 9 was pinned screen by screen; a screen nobody pinned fell back to the
   browser's heights. Every single-line control now shares --control-h: inputs, dates, selects and the searchable
   picker. Text areas, tick boxes, radios, files, ranges and multi-selects are left alone; on a touch screen the 44px
   minimum still wins (min-height beats height). */
body.vt input.form-control:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]),
body.vt select.form-control:not([multiple]):not([size]),
body.vt .ss-input{height:var(--control-h);box-sizing:border-box}
/* a bar of controls (Finance, Fixed Assets): its buttons share the height too */
.fa-bar > .btn, .fa-bar .fa-depr > .btn, .fa-bar > label.btn{height:var(--control-h);min-height:var(--control-h);
  box-sizing:border-box;margin:0;display:inline-flex;align-items:center}
.fa-bar .fa-depr{align-items:center}

/* The documents list loads a page at a time (plan/documents-list-one-call.md): its end shows how many are listed and a
   "Show more" (the next page also loads by itself as this comes into view). Its title, search and pills pin as one
   .list-head block (ux.css). */
.doc-more{display:flex;align-items:center;justify-content:center;gap:12px;padding:12px 0}
/* the reconcile badge's third state: it will match once the waiting lines are posted (bank_helpers.reconBadge) */
.cb-recon-wait{color:var(--warn);background:color-mix(in srgb, var(--c-yellow-700) 8%, transparent)}
.cb-recon-gap{white-space:normal}

/* RBAC (plan/rbac.md slice 3): an action marked data-needs="area:level" is hidden when the member's level on that
   area (body[data-p-area], set by src/shared/permissions.applyToBody) is lower. The API refuses it either way. */
body[data-p-sales="none"] [data-needs~="sales:view"],
body[data-p-sales="none"] [data-needs~="sales:create"],
body[data-p-sales="none"] [data-needs~="sales:approve"],
body[data-p-sales="view"] [data-needs~="sales:create"],
body[data-p-sales="view"] [data-needs~="sales:approve"],
body[data-p-sales="create"] [data-needs~="sales:approve"],
body[data-p-purchases="none"] [data-needs~="purchases:view"],
body[data-p-purchases="none"] [data-needs~="purchases:create"],
body[data-p-purchases="none"] [data-needs~="purchases:approve"],
body[data-p-purchases="view"] [data-needs~="purchases:create"],
body[data-p-purchases="view"] [data-needs~="purchases:approve"],
body[data-p-purchases="create"] [data-needs~="purchases:approve"],
body[data-p-payments="none"] [data-needs~="payments:view"],
body[data-p-payments="none"] [data-needs~="payments:create"],
body[data-p-payments="none"] [data-needs~="payments:approve"],
body[data-p-payments="view"] [data-needs~="payments:create"],
body[data-p-payments="view"] [data-needs~="payments:approve"],
body[data-p-payments="create"] [data-needs~="payments:approve"],
body[data-p-banking="none"] [data-needs~="banking:view"],
body[data-p-banking="none"] [data-needs~="banking:create"],
body[data-p-banking="none"] [data-needs~="banking:approve"],
body[data-p-banking="view"] [data-needs~="banking:create"],
body[data-p-banking="view"] [data-needs~="banking:approve"],
body[data-p-banking="create"] [data-needs~="banking:approve"],
body[data-p-journals="none"] [data-needs~="journals:view"],
body[data-p-journals="none"] [data-needs~="journals:create"],
body[data-p-journals="none"] [data-needs~="journals:approve"],
body[data-p-journals="view"] [data-needs~="journals:create"],
body[data-p-journals="view"] [data-needs~="journals:approve"],
body[data-p-journals="create"] [data-needs~="journals:approve"],
body[data-p-contacts="none"] [data-needs~="contacts:view"],
body[data-p-contacts="none"] [data-needs~="contacts:create"],
body[data-p-contacts="none"] [data-needs~="contacts:approve"],
body[data-p-contacts="view"] [data-needs~="contacts:create"],
body[data-p-contacts="view"] [data-needs~="contacts:approve"],
body[data-p-contacts="create"] [data-needs~="contacts:approve"],
body[data-p-inventory="none"] [data-needs~="inventory:view"],
body[data-p-inventory="none"] [data-needs~="inventory:create"],
body[data-p-inventory="none"] [data-needs~="inventory:approve"],
body[data-p-inventory="view"] [data-needs~="inventory:create"],
body[data-p-inventory="view"] [data-needs~="inventory:approve"],
body[data-p-inventory="create"] [data-needs~="inventory:approve"],
body[data-p-assets="none"] [data-needs~="assets:view"],
body[data-p-assets="none"] [data-needs~="assets:create"],
body[data-p-assets="none"] [data-needs~="assets:approve"],
body[data-p-assets="view"] [data-needs~="assets:create"],
body[data-p-assets="view"] [data-needs~="assets:approve"],
body[data-p-assets="create"] [data-needs~="assets:approve"],
body[data-p-finance="none"] [data-needs~="finance:view"],
body[data-p-finance="none"] [data-needs~="finance:create"],
body[data-p-finance="none"] [data-needs~="finance:approve"],
body[data-p-finance="view"] [data-needs~="finance:create"],
body[data-p-finance="view"] [data-needs~="finance:approve"],
body[data-p-finance="create"] [data-needs~="finance:approve"],
body[data-p-batch="none"] [data-needs~="batch:view"],
body[data-p-batch="none"] [data-needs~="batch:create"],
body[data-p-batch="none"] [data-needs~="batch:approve"],
body[data-p-batch="view"] [data-needs~="batch:create"],
body[data-p-batch="view"] [data-needs~="batch:approve"],
body[data-p-batch="create"] [data-needs~="batch:approve"],
body[data-p-recurring="none"] [data-needs~="recurring:view"],
body[data-p-recurring="none"] [data-needs~="recurring:create"],
body[data-p-recurring="none"] [data-needs~="recurring:approve"],
body[data-p-recurring="view"] [data-needs~="recurring:create"],
body[data-p-recurring="view"] [data-needs~="recurring:approve"],
body[data-p-recurring="create"] [data-needs~="recurring:approve"],
body[data-p-expenses="none"] [data-needs~="expenses:view"],
body[data-p-expenses="none"] [data-needs~="expenses:create"],
body[data-p-expenses="none"] [data-needs~="expenses:approve"],
body[data-p-expenses="view"] [data-needs~="expenses:create"],
body[data-p-expenses="view"] [data-needs~="expenses:approve"],
body[data-p-expenses="create"] [data-needs~="expenses:approve"],
body[data-p-approvals="none"] [data-needs~="approvals:view"],
body[data-p-approvals="none"] [data-needs~="approvals:create"],
body[data-p-approvals="none"] [data-needs~="approvals:approve"],
body[data-p-approvals="view"] [data-needs~="approvals:create"],
body[data-p-approvals="view"] [data-needs~="approvals:approve"],
body[data-p-approvals="create"] [data-needs~="approvals:approve"],
body[data-p-dashboard="none"] [data-needs~="dashboard:view"],
body[data-p-dashboard="none"] [data-needs~="dashboard:create"],
body[data-p-dashboard="none"] [data-needs~="dashboard:approve"],
body[data-p-dashboard="view"] [data-needs~="dashboard:create"],
body[data-p-dashboard="view"] [data-needs~="dashboard:approve"],
body[data-p-dashboard="create"] [data-needs~="dashboard:approve"],
body[data-p-reports="none"] [data-needs~="reports:view"],
body[data-p-reports="none"] [data-needs~="reports:create"],
body[data-p-reports="none"] [data-needs~="reports:approve"],
body[data-p-reports="view"] [data-needs~="reports:create"],
body[data-p-reports="view"] [data-needs~="reports:approve"],
body[data-p-reports="create"] [data-needs~="reports:approve"],
body[data-p-governance="none"] [data-needs~="governance:view"],
body[data-p-governance="none"] [data-needs~="governance:create"],
body[data-p-governance="none"] [data-needs~="governance:approve"],
body[data-p-governance="view"] [data-needs~="governance:create"],
body[data-p-governance="view"] [data-needs~="governance:approve"],
body[data-p-governance="create"] [data-needs~="governance:approve"],
body[data-p-settings="none"] [data-needs~="settings:view"],
body[data-p-settings="none"] [data-needs~="settings:create"],
body[data-p-settings="none"] [data-needs~="settings:approve"],
body[data-p-settings="view"] [data-needs~="settings:create"],
body[data-p-settings="view"] [data-needs~="settings:approve"],
body[data-p-settings="create"] [data-needs~="settings:approve"],
body[data-p-team="none"] [data-needs~="team:view"],
body[data-p-team="none"] [data-needs~="team:create"],
body[data-p-team="none"] [data-needs~="team:approve"],
body[data-p-team="view"] [data-needs~="team:create"],
body[data-p-team="view"] [data-needs~="team:approve"],
body[data-p-team="create"] [data-needs~="team:approve"],
body[data-p-keys="none"] [data-needs~="keys:view"],
body[data-p-keys="none"] [data-needs~="keys:create"],
body[data-p-keys="none"] [data-needs~="keys:approve"],
body[data-p-keys="view"] [data-needs~="keys:create"],
body[data-p-keys="view"] [data-needs~="keys:approve"],
body[data-p-keys="create"] [data-needs~="keys:approve"],
body[data-p-mcp="none"] [data-needs~="mcp:view"],
body[data-p-mcp="none"] [data-needs~="mcp:create"],
body[data-p-mcp="none"] [data-needs~="mcp:approve"],
body[data-p-mcp="view"] [data-needs~="mcp:create"],
body[data-p-mcp="view"] [data-needs~="mcp:approve"],
body[data-p-mcp="create"] [data-needs~="mcp:approve"]{display:none !important}
.perm-mcp{display:flex;gap:.5rem;align-items:flex-start;margin:.5rem 0}
/* the member's Permissions edit is the invite's card (one form, team_permissions.grantsEditor) */
.team-perm-who{margin-bottom:4px}
.perm-editor{display:block}
/* the Own level (Expenses: Own claims) sits below View */
body[data-p-sales="none"] [data-needs~="sales:own"],
body[data-p-sales="own"] [data-needs~="sales:view"],
body[data-p-sales="own"] [data-needs~="sales:create"],
body[data-p-sales="own"] [data-needs~="sales:approve"],
body[data-p-purchases="none"] [data-needs~="purchases:own"],
body[data-p-purchases="own"] [data-needs~="purchases:view"],
body[data-p-purchases="own"] [data-needs~="purchases:create"],
body[data-p-purchases="own"] [data-needs~="purchases:approve"],
body[data-p-payments="none"] [data-needs~="payments:own"],
body[data-p-payments="own"] [data-needs~="payments:view"],
body[data-p-payments="own"] [data-needs~="payments:create"],
body[data-p-payments="own"] [data-needs~="payments:approve"],
body[data-p-banking="none"] [data-needs~="banking:own"],
body[data-p-banking="own"] [data-needs~="banking:view"],
body[data-p-banking="own"] [data-needs~="banking:create"],
body[data-p-banking="own"] [data-needs~="banking:approve"],
body[data-p-journals="none"] [data-needs~="journals:own"],
body[data-p-journals="own"] [data-needs~="journals:view"],
body[data-p-journals="own"] [data-needs~="journals:create"],
body[data-p-journals="own"] [data-needs~="journals:approve"],
body[data-p-contacts="none"] [data-needs~="contacts:own"],
body[data-p-contacts="own"] [data-needs~="contacts:view"],
body[data-p-contacts="own"] [data-needs~="contacts:create"],
body[data-p-contacts="own"] [data-needs~="contacts:approve"],
body[data-p-inventory="none"] [data-needs~="inventory:own"],
body[data-p-inventory="own"] [data-needs~="inventory:view"],
body[data-p-inventory="own"] [data-needs~="inventory:create"],
body[data-p-inventory="own"] [data-needs~="inventory:approve"],
body[data-p-assets="none"] [data-needs~="assets:own"],
body[data-p-assets="own"] [data-needs~="assets:view"],
body[data-p-assets="own"] [data-needs~="assets:create"],
body[data-p-assets="own"] [data-needs~="assets:approve"],
body[data-p-finance="none"] [data-needs~="finance:own"],
body[data-p-finance="own"] [data-needs~="finance:view"],
body[data-p-finance="own"] [data-needs~="finance:create"],
body[data-p-finance="own"] [data-needs~="finance:approve"],
body[data-p-batch="none"] [data-needs~="batch:own"],
body[data-p-batch="own"] [data-needs~="batch:view"],
body[data-p-batch="own"] [data-needs~="batch:create"],
body[data-p-batch="own"] [data-needs~="batch:approve"],
body[data-p-recurring="none"] [data-needs~="recurring:own"],
body[data-p-recurring="own"] [data-needs~="recurring:view"],
body[data-p-recurring="own"] [data-needs~="recurring:create"],
body[data-p-recurring="own"] [data-needs~="recurring:approve"],
body[data-p-expenses="none"] [data-needs~="expenses:own"],
body[data-p-expenses="own"] [data-needs~="expenses:view"],
body[data-p-expenses="own"] [data-needs~="expenses:create"],
body[data-p-expenses="own"] [data-needs~="expenses:approve"],
body[data-p-approvals="none"] [data-needs~="approvals:own"],
body[data-p-approvals="own"] [data-needs~="approvals:view"],
body[data-p-approvals="own"] [data-needs~="approvals:create"],
body[data-p-approvals="own"] [data-needs~="approvals:approve"],
body[data-p-dashboard="none"] [data-needs~="dashboard:own"],
body[data-p-dashboard="own"] [data-needs~="dashboard:view"],
body[data-p-dashboard="own"] [data-needs~="dashboard:create"],
body[data-p-dashboard="own"] [data-needs~="dashboard:approve"],
body[data-p-reports="none"] [data-needs~="reports:own"],
body[data-p-reports="own"] [data-needs~="reports:view"],
body[data-p-reports="own"] [data-needs~="reports:create"],
body[data-p-reports="own"] [data-needs~="reports:approve"],
body[data-p-governance="none"] [data-needs~="governance:own"],
body[data-p-governance="own"] [data-needs~="governance:view"],
body[data-p-governance="own"] [data-needs~="governance:create"],
body[data-p-governance="own"] [data-needs~="governance:approve"],
body[data-p-settings="none"] [data-needs~="settings:own"],
body[data-p-settings="own"] [data-needs~="settings:view"],
body[data-p-settings="own"] [data-needs~="settings:create"],
body[data-p-settings="own"] [data-needs~="settings:approve"],
body[data-p-team="none"] [data-needs~="team:own"],
body[data-p-team="own"] [data-needs~="team:view"],
body[data-p-team="own"] [data-needs~="team:create"],
body[data-p-team="own"] [data-needs~="team:approve"],
body[data-p-keys="none"] [data-needs~="keys:own"],
body[data-p-keys="own"] [data-needs~="keys:view"],
body[data-p-keys="own"] [data-needs~="keys:create"],
body[data-p-keys="own"] [data-needs~="keys:approve"],
body[data-p-mcp="none"] [data-needs~="mcp:own"],
body[data-p-mcp="own"] [data-needs~="mcp:view"],
body[data-p-mcp="own"] [data-needs~="mcp:create"],
body[data-p-mcp="own"] [data-needs~="mcp:approve"]{display:none !important}

/* Team → Roles (company-defined named roles; owner 2026-11-23 "configure what I deem as 'Staff'"). Mobile first: a role
   is a stacked card row; from 720px its name, member count and actions sit on one line. Its edit opens inline under it. */
.team-roles-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:6px}
.team-roles-hint{display:block;font-size:12px;margin-top:2px}
.role-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.role-list:empty{display:none}
.role-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:8px 12px;border-top:1px solid var(--line)}
.role-row:first-child{border-top:0}
.role-row-open{background:var(--surface-2,var(--surface))}
.role-main{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1 1 100%}
.role-main small{font-size:12px}
.role-count{font-size:12.5px}
.role-actions{display:flex;align-items:center;gap:6px;margin-left:auto;flex-wrap:wrap}
.role-form{padding:8px 12px 10px;border-top:1px solid var(--line);background:var(--surface-2,var(--surface))}
.team-roles .card-body > .role-form{border:1px solid var(--line);border-radius:10px;margin-bottom:8px}
.role-move{flex-wrap:wrap}
.role-move-to{width:auto;min-width:160px}
.perm-grid.perm-ro .seg:disabled{cursor:default;opacity:1}
.perm-grid.perm-ro .seg:not(.on){opacity:.55}
.perm-role-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:6px}
@media (min-width:720px){
  .role-main{flex:1 1 auto}
}

/* Team: a role's levels folded under its one-line summary (the invite is email, names, role — owner 2026-11-23) */
.perm-role-detail{margin:6px 0 8px}
.perm-role-detail > summary{cursor:pointer;font-size:13px;color:var(--muted);padding:4px 0}
.perm-role-detail[open] > summary{margin-bottom:6px}

/* About this company (Settings) — owner 2026-11-23 */
.set-about{ margin-top:12px; }
.set-about-hint{ margin:0 0 8px; font-size:.85rem; }
.set-about-text{ width:100%; min-height:120px; resize:vertical; }
.set-about-foot{ display:flex; align-items:center; gap:10px; margin-top:8px; flex-wrap:wrap; }
.set-about-meta{ font-size:.8rem; margin-right:auto; }
.set-about-note{ font-size:.85rem; }
/* Statements: where each figure comes from — 📄 the statement, 📒 the general ledger (owner 2026-11-23) */
.stmt-table .stmt-src{font-size:12px;margin-right:4px;opacity:.75;font-family:system-ui,sans-serif}
.stmt-table td.stmt-2line .stmt-led{border-top:1px dashed var(--line);margin-top:3px;padding-top:3px}
/* chart of accounts footnote: the words and the Edit accounts button on one line, wrapping on a phone */
.chart-hint{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}

/* Native invoice matching stays in the Bank register, with complete scope and retained outcomes. */
.cb-invoice-match{margin-block:1rem;min-width:0}
.cb-invoice-match-head,.cb-invoice-match-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;justify-content:flex-start}
.cb-invoice-match-head{justify-content:space-between}
.cb-invoice-match-head h3{margin:0}
.cb-invoice-match-actions .btn{min-height:2.75rem}
.cb-invoice-match-scroll{max-width:100%;overflow:auto;margin-block:.75rem}
.cb-invoice-match-table{width:100%;border-collapse:collapse;min-width:45rem}
.cb-invoice-match-table th,.cb-invoice-match-table td{padding:.6rem;text-align:left;vertical-align:top;border-bottom:1px solid var(--line)}
.cb-invoice-match-description{display:block;font-size:.85em;overflow-wrap:anywhere}
.cb-invoice-match-money{white-space:nowrap}
.cb-invoice-match-open{margin-block:.5rem}

/* one posted journal, opened by its number (owner 2 Dec 2026, the Finance demo, item 7) */
.jv-head{display:flex;flex-wrap:wrap;gap:10px 24px;margin-bottom:12px}
.jv-head > div{display:flex;flex-direction:column;gap:2px;min-width:0}
.jv-head small{color:var(--muted)}
.jv-head .jv-desc{flex:1 1 240px}

/* a statement's Reprocess (owner 2 Dec 2026) */
.stmt-reprocessing{display:inline-flex;align-items:center;height:var(--control-h, 34px);padding:0 10px;
  border-radius:8px;font-size:.85rem;font-weight:600;color:var(--muted);background:var(--surface-2, var(--surface));white-space:nowrap}

/* an agreement's ledger accounts in Edit, and the question once one changes (owner 2 Dec 2026) */
.fin-acct-mode{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:10px}
.fin-acct-mode-ask{font-weight:600}
.fin-acct-mode small{flex-basis:100%}

/* the Fixed Asset Register: an asset's name on one line, cut with … (the whole name on hover) — owner 2 Dec 2026:
   "Fixed asset register is wasting vertical space with the asset name" */
.rp-far td.rp-far-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.rp-far td{white-space:nowrap}
/* a bill's VAT warnings in Approvals, each with what can be done (owner 3 Dec 2026, D-18) */
.apv-vat{display:flex;flex-direction:column;gap:8px;margin:4px 0}
.apv-vat-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
/* the expense claim a bank line paid: whose and what for; its slip opens in the viewer (owner 3 Dec 2026) */
.cb-claim-chip{display:inline-flex;align-items:center;gap:4px;margin-top:4px;max-width:100%;padding:2px 8px;border:1px solid var(--line);border-radius:999px;background:var(--bg);color:var(--ink);font-size:12px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Apply credit, in place under the contact's buttons (overpayments plan) */
.ct-apply-rows{display:flex;flex-direction:column;gap:6px;margin:8px 0}
.ct-apply-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto 130px;align-items:center;gap:8px}
@media (max-width:560px){.ct-apply-row{grid-template-columns:auto minmax(0,1fr) 110px}.ct-apply-row .cell-sub{display:none}}
.ct-apply-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
/* a bank line's payment details in their own row, the register's whole width (owner 3 Dec 2026: "flush to the width of
   the view port" · "its all cramped") */
.cb-table tr.cb-settlement-row > td{padding:0 12px 12px;background:var(--bg)}
.cb-table tr.cb-settlement-row .cb-settlement-body{margin-top:0}
@media (max-width:1100px){                 /* the register's lines are cards: the details row is one card-wide block */
  body.vt .cb-register-table tbody tr.cb-settlement-row{display:block}
  body.vt .cb-register-table tbody tr.cb-settlement-row > td{display:block;width:auto;max-width:100%;box-sizing:border-box}
  body.vt .cb-register-table tr.cb-settlement-row .cb-settlement-table :is(th,td){white-space:normal;padding:6px 8px}
}
/* writing an old credit off, in place under its row (D-21) */
.ct-wo{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin:4px 0 8px}
.cb-settlement-table tr.cb-settlement-diff td{color:var(--muted);font-style:italic}
/* unidentified receipts (matching plan, AC-MAT-5): the chip under the summary strip, amber once one waits over a week
   (D-31), and its list — each receipt's date, words, age and amount, the customer to choose and Identify */
.cb-unid{margin:6px 0}
.cb-unid-chip{border:1px solid var(--line);border-radius:14px;background:var(--bg);padding:4px 12px;font-size:12px;font-weight:600;cursor:pointer;min-height:32px}
.cb-unid-chip.is-late{border-color:var(--c-amber-700);color:var(--c-amber-700)}
.cb-unid-list{margin-top:6px;border:1px solid var(--line);border-radius:8px;background:var(--bg)}
.cb-unid-row{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(180px,260px) auto;gap:8px;align-items:center;padding:8px 10px;border-top:1px solid var(--line)}
.cb-unid-row:first-child{border-top:0}
.cb-unid-row.is-late .cb-unid-age{color:var(--c-amber-700);font-weight:600}
.cb-unid-what{min-width:0;overflow-wrap:anywhere}
.cb-unid-age{font-size:12px;color:var(--muted);margin-left:6px}
@media (max-width:700px){.cb-unid-row{grid-template-columns:minmax(0,1fr) auto}.cb-unid-pick{grid-column:1 / -1}}
/* a split bank line (AC-BNK-2): each part to an account — the account, its amount, its VAT, a remove */
.alloc-pay-parts{display:grid;gap:6px;margin-top:6px}
.alloc-pay-part{display:grid;grid-template-columns:104px minmax(0,1fr) auto;gap:6px;align-items:center;padding-top:6px;border-top:1px dashed var(--line)}
.alloc-pay-part > :first-child{grid-column:1 / -1}                 /* the account on its own row: the popup is narrow */

/* a finalised document's payments card (payments plan): paid / cleared / outstanding, each payment, the proofs with their
   flags, the dispute and retention forms — or a quote's stages */
.de-payments{margin:12px 0;display:grid;gap:8px;padding:12px}
.de-pay-sum{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:13px}
.de-held{font-size:13px;color:var(--c-amber-700)}
.de-pay-list,.de-proof-list{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.de-pay-row{display:flex;justify-content:space-between;gap:12px;font-size:13px;padding:4px 0;border-bottom:1px solid var(--line)}
.de-proof{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;font-size:13px}
.de-proof[data-proof-state="in_bank"]{color:var(--ok)}
.de-proof[data-proof-state="void"]{color:var(--muted);text-decoration:line-through}
.de-proof-flags{color:var(--c-amber-700);font-size:12px;flex-basis:100%}
.de-sub-head{font-size:12px;font-weight:600;color:var(--muted);margin-top:4px}
.de-proof-form{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:6px;align-items:center}
/* bills to pay (supplier-side plan): the due-by date, each bill's to-pay, disputed part and a discount about to lapse */
.run-page .page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap}
.run-due{display:grid;gap:4px;font-size:12px;font-weight:600}
.run-table tbody tr{cursor:pointer}
.run-notes{display:grid;gap:2px;font-size:12px}
.run-disputed{color:var(--c-amber-700)}
.run-discount.is-soon{color:var(--bad);font-weight:600}
.run-table td.mono,.run-table th.mono{white-space:nowrap}

/* Statements panel — what makes a statement out, each with the click that resolves it (owner 4 Dec 2026) */
.stmt-table .stmt-causes{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.stmt-table .stmt-cause{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px;
  padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);font-size:13px;white-space:normal}
.stmt-table .stmt-cause-what{flex:1 1 280px;min-width:0}
.stmt-table .stmt-cause-acts{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
/* Supplier payments: the tick column, the export card and the runs (owner 5 Dec 2026: the bank export) */
.run-table .run-pick{width:36px;text-align:center}
.run-table .run-pick input{width:20px;height:20px}
.run-inrun{color:var(--muted)}
.run-export{display:grid;gap:12px;margin-top:12px;text-align:left}
.run-export[hidden]{display:none}
.run-from{display:grid;gap:4px;font-size:12px;font-weight:600;justify-items:stretch;text-align:left}
.run-from .form-control{width:100%}
.run-export-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.run-export-sum{font-size:14px;font-weight:600}
.run-result,.run-runs{margin-top:12px}
.run-skipped{margin-top:6px}
.run-run{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--line)}
.run-run:first-of-type{border-top:0}
