@font-face{
  font-family:'Inter';
  font-style:normal;
  font-display:swap;
  font-weight:100 900;
  src:url('fonts/inter.woff2') format('woff2');
}
:root{
  /* The sidebar's width is draggable between these two bounds and remembered per browser. A token,
     not a literal in the grid rule, so the shell, the drag handle and the JS clamp all read ONE
     source. --sidebar-w is overwritten inline on <html> by the head script and by the drag. */
  --sidebar-w:260px;
  --sidebar-w-min:200px;
  --sidebar-w-max:294px;
  /* iOS standalone draws content UNDER the status bar and home indicator, because
     apple-mobile-web-app-status-bar-style is black-translucent. These resolve to 0 on any device
     without a notch or home indicator, so they are safe to apply unconditionally - and they only
     resolve at all because the viewport meta carries viewport-fit=cover. */
  /* Minimum comfortable touch target. Applied on COARSE pointers only, so dense desktop
     tables and toolbars keep their current density (framework section 9 / section 13). */
  --tap:44px;
  --safe-t:env(safe-area-inset-top,0px);
  --safe-r:env(safe-area-inset-right,0px);
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-l:env(safe-area-inset-left,0px);

  --bg:#06010f;
  --bg-2:#0b0418;
  --panel:rgba(255,255,255,.06);
  --panel-2:rgba(255,255,255,.09);
  --border:rgba(255,255,255,.13);
  --text:#f3f1ff;
  --soft:rgba(255,255,255,.84);
  --mute:rgba(255,255,255,.72);
  --indigo:#6366f1;
  --violet:#8b5cf6;
  --rose:#ef4444;
  --amber:#f59e0b;
  --cyan:#06b6d4;
  --lime:#10f981;
  --amount-pos:#10f981;  /* balances/totals/indicators: positive */
  --amount-neg:#ff9d9d;  /* balances/totals/indicators: negative */
  --grad:linear-gradient(120deg,#6366f1,#8b5cf6,#ef4444,#f59e0b); /* @kind color */
  /* Brand for ACTIONS: a calm 2-stop indigo→violet (no red/amber). The full --grad is
     reserved for brand moments (logo, active nav highlight) - never plain buttons. Rule:
     one primary action per view; everything else is secondary or ghost. */
  --brand:linear-gradient(135deg,#6366f1,#7c5cf0); /* @kind color */
  --brand-hover:linear-gradient(135deg,#7178f4,#8a6bf5); /* @kind color */
  --font:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  /* Surfaces / overlays - one fill scale, flipped per theme (was scattered white-overlay literals). */
  --surf-1:rgba(255,255,255,.04);      /* subtle card fills (detail/event/timeline items, public cards) */
  --surf-2:rgba(255,255,255,.06);      /* raised controls, default buttons, badges */
  --field:#332f42;       /* form field fill - visibly lighter than the panel so
                                          every input box reads as a box (user decision 2026-07-05) */
  --hover:rgba(255,255,255,.09);       /* interactive hover fill */
  --divider:rgba(255,255,255,.08);     /* hairline dividers (nav groups, table cells, panel foot) */
  --border-soft:rgba(255,255,255,.1);  /* softer card border than --border */
  /* Status hues as RGB triplets so one source feeds badges, flash, danger, etc. */
  --ok-rgb:16,249,129;
  --info-rgb:6,182,212;
  --warn-rgb:245,158,11;
  --err-rgb:239,68,68;
  --accent-rgb:139,92,246;
  --brand-rgb:99,102,241;
  /* Categorical chart palette. Ten hues that stay apart from each other on both themes and in print,
     for a chart that names more than a handful of things - the expense donut shows nine categories
     plus a catch-all. The status tokens above carry MEANING (ok, warn, err) and reusing them here
     said a category was good or bad because of where it happened to sort; these say nothing except
     "a different one". Slot 10 is deliberately grey: it is where "Everything else" lands. */
  --chart-1-rgb:99,102,241;   --chart-2-rgb:245,158,11;  --chart-3-rgb:16,185,129;
  --chart-4-rgb:14,165,233;   --chart-5-rgb:244,63,94;   --chart-6-rgb:168,85,247;
  --chart-7-rgb:20,184,166;   --chart-8-rgb:234,88,12;   --chart-9-rgb:132,204,22;
  --chart-10-rgb:148,163,184;
  /* Radii scale - replaces ad-hoc 6/7/8/10/14/999px literals. */
  --r-sm:6px; --r:8px; --r-lg:10px; --r-xl:14px; --r-pill:999px;
  /* Elevation - shadow-1 subtle raise, shadow-2 popovers/modals */
  --shadow-1:0 1px 2px rgba(0,0,0,.18);
  --shadow-2:0 12px 32px rgba(0,0,0,.45);
}
*{box-sizing:border-box}
html{overflow-x:hidden}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  background:
    radial-gradient(circle at 16% 18%,rgba(var(--brand-rgb),.24),transparent 32rem),
    radial-gradient(circle at 90% 8%,rgba(var(--err-rgb),.18),transparent 30rem),
    radial-gradient(circle at 54% 90%,rgba(var(--info-rgb),.16),transparent 34rem),
    var(--bg);
  font-family:var(--font);
  line-height:1.5;
  overflow-x:hidden;
}
a{color:inherit}
button,input,select,textarea{font:inherit;min-width:0}
img,svg{max-width:100%}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:3px solid rgba(var(--info-rgb),.82);
  outline-offset:3px;
}
.shell{
  width:min(1440px,100%);
  margin:0 auto;
  padding:calc(20px + var(--safe-t)) calc(20px + var(--safe-r)) calc(20px + var(--safe-b)) calc(20px + var(--safe-l));
  display:grid;
  grid-template-columns:var(--sidebar-w) minmax(0,1fr);
  gap:18px;
}
/* Hidden by choice on desktop: the column goes, and the topbar hamburger appears to bring it back
   (it is the same control mobile already uses, so there is one way to reopen the menu, not two). */
.shell.nav-hidden{grid-template-columns:minmax(0,1fr)}
.shell.nav-hidden>.sidebar{display:none}
.content{
  display:grid;
  gap:18px;
  align-content:start;
  min-width:0;
}
.sidebar{
  position:sticky;
  top:20px;
  height:calc(100vh - 40px);
  display:flex;
  flex-direction:column;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:rgba(6,1,15,.72);
  backdrop-filter:blur(18px);
  padding:14px;
}
.brand{
  display:flex;
  gap:12px;
  align-items:center;
  text-decoration:none;
  padding:8px;
  border-radius:var(--r);
  min-width:0;
}
.brand-mark{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:var(--r-lg);
  background:var(--grad);
  font-weight:800;
}
/* An uploaded entity logo fills the tile (clipped to its rounded shape), replacing the initials. */
.brand-mark.has-logo{background:none;overflow:hidden}
.brand-logo{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.brand strong,.brand small{display:block;overflow-wrap:anywhere}
.brand small{color:var(--mute);margin-top:2px}
/* MENU SEARCH (owner's request 04-08-2026). Sits above the menu it filters and looks like the app's
   other search boxes; results REPLACE the menu while typing - two lists of links, one filtered and
   one not, reads as the search having done nothing. */
/* ADMIN DIRECTORY (owner's request 04-08-2026): the settings area's landing page. A list of pages,
   what each covers, and the tabs behind them - readable at a glance and filterable by typing. */
.admin-dir{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
.admin-dir li{display:flex;flex-direction:column;gap:3px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surf-2)}
.admin-dir-link{font-weight:600;text-decoration:none;color:var(--text)}
.admin-dir-link:hover,.admin-dir-link:focus-visible{text-decoration:underline}
.admin-dir li small{font-size:11.5px;line-height:1.35}
.admin-dir-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.admin-dir-tab{font-size:11.5px;padding:2px 8px;border:1px solid var(--border);border-radius:999px;color:var(--soft);text-decoration:none}
.admin-dir-tab:hover,.admin-dir-tab:focus-visible{background:var(--hover);color:var(--text)}

.nav-find{padding:0 10px 8px}
.nav-find-box input{width:100%;box-sizing:border-box}
.nav-search-results{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.nav-search-results a{display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:7px 10px;border-radius:8px;color:var(--soft);text-decoration:none}
.nav-search-results a:hover,.nav-search-results a:focus-visible{background:var(--hover);color:var(--text)}
/* The area a result lives in - the point of a cross-area search is knowing where you are going. */
.nav-search-results small{flex:0 0 auto;font-size:11px}
.nav-search-empty{padding:7px 10px;font-size:12px}

.nav{
  display:grid;
  align-content:start;
  gap:4px;
  margin-top:14px;
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-width:thin;
}
.nav-title{
  display:block;
  padding:0 12px 6px;
  color:var(--cyan);
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
}
.nav-subtitle{
  margin-top:12px;
  padding-top:14px;
  border-top:1px solid var(--divider);
}
.nav a{
  padding:9px 12px;
  border-radius:var(--r);
  color:var(--soft);
  text-decoration:none;
  font-weight:700;
  min-width:0;
  overflow-wrap:anywhere;
}
.nav a:hover,.nav a.active,.nav a.soft-active{background:var(--hover);color:#fff}
.nav a.active{
  border:1px solid rgba(255,255,255,.16);
  background:linear-gradient(120deg,rgba(var(--brand-rgb),.26),rgba(var(--info-rgb),.14));
}
/* Collapsible "Settings" sub-section (native <details>): a labelled, divided group inside the nav.
   The <details> stays block-level - display:grid/flex on it breaks the native open/close. The links
   live in an inner grid so they stack like the Work links and hide when the group is collapsed. */
.nav-group{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--divider);
}
.nav-group-items{
  display:grid;
  gap:4px;
  margin-top:4px;
}
/* Author styles beat the UA "hide when closed" rule, so hide the items explicitly when
   collapsed - otherwise the grid stays painted outside the closed <details> box. */
.nav-group:not([open]) .nav-group-items{display:none}
.nav-group>summary.nav-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
  list-style:none;
  user-select:none;
  margin:0;
}
.nav-group>summary::-webkit-details-marker{display:none}
.nav-group>summary.nav-title::after{
  content:"";
  width:7px;
  height:7px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(-45deg);
  opacity:.7;
  transition:transform .15s ease;
  margin-bottom:6px;
}
.nav-group[open]>summary.nav-title::after{transform:rotate(45deg)}
.main{display:grid;gap:18px;min-width:0}
.topbar{
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:12px 14px;
  background:rgba(6,1,15,.62);
  backdrop-filter:blur(18px);
  /* Panels also create stacking contexts (backdrop-filter); without a z-index here the
     topbar's dropdowns (notifications, user menu) paint BENEATH later page sections.
     30 keeps them above content and below the mobile nav overlay (55/60). */
  position:relative;
  z-index:30;
}
.topbar-crumbs{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  margin:0 0 2px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.04em;
}
.topbar-crumbs a{color:var(--mute);text-decoration:none}
.topbar-crumbs a:hover{color:var(--text);text-decoration:underline}
.topbar-crumbs [aria-current="page"]{color:var(--cyan)}
.topbar-crumbs .crumb-sep{color:var(--mute);opacity:.55;font-weight:600}
.topbar-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.user-menu{
  position:relative;
  display:inline-block;
}
.user-menu-toggle{
  min-height:32px;
  display:flex;
  align-items:center;
  gap:6px;
  border:0;
  border-radius:var(--r-sm);
  padding:5px 8px;
  color:var(--soft);
  background:transparent;
  font-family:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.user-menu-toggle:hover,
.user-menu-toggle[aria-expanded="true"]{
  color:#fff;
  background:var(--surf-2);
}
.topbar-user{
  color:inherit;
  font-size:.8rem;
  line-height:1;
  white-space:nowrap;
  max-width:160px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-menu-caret{
  color:var(--mute);
  flex:0 0 auto;
}
.user-menu-panel{
  display:none;
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  z-index:20;
  min-width:210px;
  border:1px solid rgba(148,163,184,.24);
  border-radius:var(--r-lg);
  padding:6px;
  background:#1e293b;
  box-shadow:var(--shadow-2);
}
.user-menu-head{
  display:grid;
  gap:2px;
  padding:8px 10px 9px;
  border-bottom:1px solid #334155;
  margin-bottom:6px;
}
.user-menu-head strong{
  color:#fff;
  font-size:.8rem;
  line-height:1.2;
}
.user-menu-head span{
  color:#94a3b8;
  font-size:.75rem;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.user-menu-panel a,
.user-menu-panel button{
  width:100%;
  min-height:38px;
  display:flex;
  align-items:center;
  border:0;
  border-radius:var(--r-sm);
  padding:8px 12px;
  color:#cbd5e1;
  background:transparent;
  font:inherit;
  font-size:.8rem;
  font-weight:700;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover{
  color:#fff;
  background:#334155;
}
.user-menu-panel form{
  margin:0;
  padding-top:4px;
  border-top:1px solid #334155;
}
.user-menu-panel form button{
  color:#f87171;
}
.user-menu-panel form button:hover{
  background:#3f0f0f;
}
.auth-main{
  width:min(720px,100%);
  min-height:100vh;
  margin:0 auto;
  padding:24px;
  display:grid;
  align-content:center;
  gap:18px;
}
/* Legacy class retained for older markup if any cached view renders it. */
.user-box{
  display:none;
  gap:8px;
  margin-top:18px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--surf-1);
}
.user-box strong,.user-box small{display:block}
.user-box small{color:var(--mute)}
.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:18px;
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:22px;
  background:var(--panel);
}
.eyebrow{
  margin:0 0 8px;
  color:var(--cyan);
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
}
h1,h2{
  margin:0;
  line-height:1.05;
  letter-spacing:0;
}
h1{font-size:clamp(28px,3.2vw,42px)}
h2{font-size:24px}
.lede,.panel p{color:var(--soft);max-width:104ch}
/* Who owns a record (and who entered it, when they differ). Quieter than the lede it follows -
   it is provenance, not description - and never wrapped mid-name. */
.record-ownership{margin-top:.25rem;font-size:.875rem;color:var(--mute)}
/* States that a printed bill is our entry of a supplier's invoice, not the supplier's original.
   Must survive printing - it is the whole point of the line. */
.doc-recorded-note{margin:.35rem 0 0;font-size:.8125rem;color:var(--mute)}
/* A value that must stay on ONE line - a document reference, a code - the way dates already do
   (§12). One rule, used wherever a broken value would read as a typo. */
.nowrap{white-space:nowrap}
.record-code{
  display:inline-flex;
  gap:6px;
  align-items:center;
  margin:10px 0 0;
  color:var(--mute);
  font-size:13px;
  font-weight:800;
}
.record-code strong{
  color:var(--cyan);
  letter-spacing:0;
}
.record-link{
  color:var(--cyan);
  font-weight:800;
  text-decoration:none;
}
.record-link:hover{text-decoration:underline}
.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(112px,1fr));
  gap:6px;
}
/* ONE WORD ABOVE A GROUP OF TILES INSTEAD OF ON EVERY ONE (owner's request 04-09-2026). Three tiles
   reading "Projected income / Projected expense / Projected net" spend most of their width saying
   the same word three times, and the part that distinguishes them is the part that gets squeezed.
   The shared word moves to a caption over the grid and the tiles keep only what differs.
   Its own class rather than a heading tag: this labels a group of figures, it does not open a
   section, and using an h2/h3 here would put it in the document outline beside real sections. */
.stats-group-label{
  margin:10px 0 4px;
  font-size:.78rem;
  font-weight:800;
  color:var(--mute);
}
.stats-group-label:first-child{margin-top:0}
/* Finance dashboard synthesis (2026-07-24): hero tiles, two-column rows, spend pulse, category
   donut and label/value line lists - all reusing the stat/panel shells and colour tokens. */
/* Two tiles since net worth moved into its own panel (31-07-2026). auto-fit rather than a fixed
   count, so the row does not have to be re-tuned the next time a tile joins or leaves it. */
.dash-hero{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
/* Net worth at the head of the panel that explains it: the figure and its month movement on one
   baseline, with the trend line under them. */
.dash-networth{display:flex;flex-wrap:wrap;align-items:baseline;gap:10px;margin:0 0 2px}
.dash-networth strong{font-size:1.6rem;font-weight:800;line-height:1.2}
.dash-networth small{font-size:12px;font-weight:700}
.dash-networth .amount{display:inline}
/* A row's currency tag sits BESIDE its account name, never wrapped under it (framework §5: a label
   stays on one line). .dash-lines small is block elsewhere in this panel. */
.dash-lines li > span > small{display:inline;font-size:11px;margin-left:4px}
/* A day's header inside a dated list, and the items that hang under it. The date is stated once on
   the header with that day's net; the children indent so the grouping reads without a second
   border. */
.dash-lines li.dash-lines-group{font-weight:700;border-bottom:0;padding-bottom:2px}
.dash-lines li.dash-lines-group time{font-weight:700}
.dash-lines li.dash-lines-child{padding-left:18px}
.dash-lines li.dash-lines-child > span{display:flex;gap:6px;align-items:baseline;min-width:0}
.dash-hero .stat strong{font-size:1.35rem}
.dash-hero .stat small{white-space:nowrap}
/* money_signed()'s .amount span is display:block app-wide; inside the delta line it must sit inline
   so "▲ +€310 this month" reads as one line. */
.dash-hero .stat small .amount{display:inline}
.dash-spark{width:100%;height:36px;margin-top:4px;display:block}
/* The sparkline's own caption: a chart without a period named is a shape, not a fact. 11px matches
   .month-kpi's .stat-suffix, the app's existing size for a figure's footnote. It overrides the
   nowrap above deliberately - this one is a sentence, and on a narrow tile it must wrap rather
   than push the tile wider. */
.dash-spark-caption{display:block;font-size:11px;margin-top:2px;white-space:normal}
/* One invisible hover band per month-end, each carrying an SVG <title> with its month and figure.
   Transparent until pointed at, so the line reads clean and the whole column is the target. */
/* Behaviour hook: anything that opens the app's own tooltip. Appearance stays with the element -
   a bar keeps its chart-fill colour, a sparkline band its transparent one. */
.js-chart-tip{cursor:help;outline:none}
.dash-spark-band{fill:transparent}
.dash-spark-band:hover,.dash-spark-band:focus-visible{fill:rgba(var(--brand-rgb),.18)}
/* The floating figure for a hovered/tapped/focused band. Same shell as .row-menu-list (one look for
   anything that floats over the page); position:fixed and set from JS, so it is never clipped by a
   panel's overflow. pointer-events:none keeps it from stealing the hover that summoned it. */
.spark-tip{position:fixed;z-index:70;pointer-events:none;padding:6px 9px;background:var(--bg-2);
  border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow-2);
  color:var(--soft);font-size:12px;font-weight:700;white-space:nowrap}
.dash-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:14px 0}
/* A layout row with no panels left in it must not reserve its margin: filtering the dashboard to
   one section (ADR 0069) leaves the other rows empty, and two empty grids printed a ~140px band of
   nothing between the toolbar and the panel you asked for. :has(> *) rather than :empty because a
   PHP-rendered wrapper still contains whitespace text nodes, which :empty counts. */
.dash-cols:not(:has(> *)){display:none;margin:0}
/* Filtered to a single panel, a half-width column beside empty space reads as a broken layout -
   the one panel you asked for takes the row. */
.dash-cols:has(> :only-child) .panel{grid-column:1 / -1}
/* ...and so does a panel left ALONE ON THE LAST LINE of a two-column row: an odd count leaves it half width
   beside nothing. That was the Investments panel whenever three panels shared the balance-sheet row, and it
   is Cash on hand now whenever nothing is invested. */
.dash-cols > .panel:last-child:nth-child(odd):not(:only-child){grid-column:1 / -1}
.dash-cols .panel{margin:0;min-width:0}
/* A single-panel row: full width rather than half a two-column grid with a hole beside it. */
.dash-cols-single{grid-template-columns:1fr}
.dash-pulse-label{margin:10px 0 4px;font-size:.8rem;color:var(--mute)}
/* position:relative for the pace marker; the fill still clips to the track. */
.dash-pulse{position:relative;height:10px;border-radius:5px;background:var(--surf-2);overflow:hidden}
/* Where a typical month would stand today, so a part-month can be read against a full one. */
.dash-pulse-pace{position:absolute;top:-2px;bottom:-2px;width:2px;background:var(--text);opacity:.55;border-radius:1px}
.dash-pulse-fill{height:100%;background:rgb(var(--warn-rgb));border-radius:5px}
.dash-pulse-fill.is-over{background:rgb(var(--err-rgb))}
.dash-pulse-note{margin:4px 0 0;font-size:.8rem;color:var(--mute)}
.dash-donut-row{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
/* The donut carries the panel, so it takes the room the panel has: it grows with the column and
   stops before it dwarfs its own legend. At 96px it sat in a corner of a mostly empty card. */
.dash-donut{width:clamp(120px,26%,190px);height:auto;aspect-ratio:1;flex:0 0 auto;transform:rotate(0deg)}
.dash-donut-legend{list-style:none;margin:0;padding:0;font-size:.85rem;line-height:2;min-width:0;flex:1 1 220px}

/* The total the shares are OF - separated from the categories, not another slice. */
/* A bank group inside the cash list. The row itself is the disclosure, so it drops the flex the
   other .dash-lines rows use and lets <summary> carry the name/count/subtotal line. */
.dash-lines li.dash-bank{display:block;padding:0;border-bottom:1px solid var(--divider)}
.dash-lines li.dash-bank:last-child{border-bottom:0}
.dash-bank > details > summary{display:flex;justify-content:space-between;align-items:baseline;gap:12px;
  padding:7px 0;cursor:pointer;list-style:none}
.dash-bank > details > summary::-webkit-details-marker{display:none}
/* The marker is drawn, not native, so it can sit before the name and rotate on open. */
.dash-bank > details > summary > span::before{content:'\25B8';display:inline-block;margin-inline-end:6px;
  color:var(--mute);transition:transform .15s ease}
.dash-bank > details[open] > summary > span::before{transform:rotate(90deg)}
.dash-bank > details > ul{padding-inline-start:18px}
.dash-bank > details > ul > li:last-child{border-bottom:0}
.dash-donut-total{border-top:1px solid var(--divider);margin-top:6px;padding-top:6px}
/* Label left, amount right, on ONE line. Inline text let the amount wrap under its own label as soon
   as the legend column narrowed - which it does on paper - and a figure sitting alone on the next
   line reads as a different row entirely (framework 12: money is aligned, never adrift). */
.dash-donut-legend li{display:flex;align-items:baseline;gap:6px}
.dash-donut-legend li .dash-legend-label{min-width:0;overflow-wrap:anywhere}
.dash-donut-legend li .dash-legend-amount{margin-inline-start:auto;white-space:nowrap}
.dash-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--mute);vertical-align:baseline;margin-inline-end:2px}
.dash-dot.tone-warn{background:rgb(var(--warn-rgb))}
.dash-dot.tone-overdue,.dash-dot.tone-err{background:rgb(var(--err-rgb))}
.dash-dot.tone-info{background:rgb(var(--info-rgb))}
.dash-dot.tone-ok{background:rgb(var(--ok-rgb))}
.dash-lines{list-style:none;margin:0;padding:0;font-size:.9rem}
.dash-lines li{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:7px 0;border-bottom:1px solid var(--divider)}
.dash-lines li:last-child{border-bottom:0}
.dash-lines li > span{min-width:0}
.dash-lines strong{white-space:nowrap}
.dash-lines-foot span{font-size:.8rem}
/* Closing totals in a dash list. Both rows read as totals; only the LAST carries the foot rule, so
   the line marking the end of the list is actually at the end of it. */
.dash-lines li.dash-lines-total{font-weight:600}
.dash-lines li.dash-lines-total.dash-lines-foot{border-top:1px solid var(--divider);padding-top:7px}
.dash-lines li.dash-lines-total.dash-lines-foot span{font-size:inherit}
/* Caption over each half of "Needs your attention". The two lists count over DIFFERENT windows -
   work waiting on you runs to today or to month end, the dated list runs 14 days forward - and one
   heading over both meant neither could be checked (owner, 01-08-2026). Quieter than the date-group
   rows it sits above, so the hierarchy reads caption > date > entry. */
/* A locked field with NO pencil is a fact, not a control (ADR 0064). The control itself stays in
   the DOM - hidden - because the page's wiring reads and updates it (currency follows the paying
   account, rates autofill from it) and the submit mirror posts it. Only the presentation changes:
   the reader sees text, not a dead dropdown that looks like a broken choice. */
.locked-field.as-text select,
.locked-field.as-text input:not([type="hidden"]){display:none}
.locked-field.as-text .locked-value{display:block;padding:9px 0;font-weight:600;min-height:20px;overflow-wrap:anywhere}
.dash-lines li.dash-lines-caption{font-size:.8rem;color:var(--mute);border-bottom:0;padding:10px 0 2px;font-weight:600}
.dash-lines li.dash-lines-caption:first-child{padding-top:0}
/* Analyst layer: health gauge + sub-score bars beside the verdict lines. */
/* ONE COLUMN, TWO LABELLED PARTS (owner's report 27-09-2026): the panel sits at half width beside Net
   worth now, and its score and its observations each carry a heading instead of sharing a row with none.
   The gauge keeps the dial beside its five parts, which is the one pairing that reads at this width. */
.dash-analyst{display:block}
.dash-part{margin:4px 0 8px;font-size:.85rem;font-weight:700;color:var(--mute)}
.dash-analyst .dash-verdict{margin-top:4px}
.dash-gauge{display:grid;grid-template-columns:minmax(110px,150px) 1fr;grid-template-areas:"arc parts" "note note";
  gap:4px 16px;align-items:center;margin-bottom:14px}
.dash-gauge-arc{grid-area:arc}
.dash-gauge .dash-subscores{grid-area:parts}
.dash-gauge .dash-gauge-note{grid-area:note;text-align:left}
/* AFTER the rule it overrides - a media query adds no specificity, so placed above it lost. The dial beside its parts needs about 380px; below that they stack, dial on top. */
@media (max-width:480px){.dash-gauge{grid-template-columns:1fr;grid-template-areas:"arc" "parts" "note"}
  .dash-gauge-arc{max-width:170px}}
/* Radial health gauge: a semicircle arc whose fill and colour track the 0-100 score, number centred. */
.dash-gauge-arc{position:relative;width:100%;max-width:200px;margin:0 auto}
.dash-gauge-arc svg{display:block;width:100%;height:auto}
.dash-arc-track{stroke:var(--surf-2)}
.dash-arc-val{transition:stroke-dasharray .5s ease}
.dash-arc-val.tone-ok{stroke:rgb(var(--ok-rgb))}
.dash-arc-val.tone-warn{stroke:rgb(var(--warn-rgb))}
.dash-arc-val.tone-err{stroke:rgb(var(--err-rgb))}
/* UNKNOWN is not a bad score: while the history the score needs is still building, the dial
   stays empty and grey rather than painting an unearned amber. Same for a gated sub-bar and
   the dash that replaces the number. */
.dash-arc-val.tone-unknown{stroke:var(--surf-2)}
.dash-gauge-num strong.is-unknown{color:var(--mute);font-size:1.6rem}
.dash-subbar span.is-unknown{background:transparent}
.dash-gauge-num{position:absolute;left:0;right:0;bottom:2px;text-align:center;line-height:1}
.dash-gauge-num strong{font-size:2.1rem}
.dash-gauge-num span{font-size:.9rem;color:var(--mute);font-weight:600}
.dash-gauge-label{display:block;text-align:center;font-size:.8rem;color:var(--mute);margin:2px 0 4px}
.dash-gauge-note{display:block;text-align:center;font-size:.72rem;color:var(--mute);margin:0 0 10px;line-height:1.4}
.dash-subscores{list-style:none;margin:0;padding:0;font-size:.78rem}
.dash-subscores li{display:grid;grid-template-columns:minmax(70px,auto) 1fr auto;gap:8px;align-items:center;padding:2px 0}
.dash-subscores li > span:first-child{color:var(--mute);white-space:nowrap}
.dash-subbar{display:block;height:6px;border-radius:3px;background:var(--surf-2);overflow:hidden}
.dash-subbar > span{display:block;height:100%;border-radius:3px}
.dash-subbar > span.is-ok{background:rgb(var(--ok-rgb))}
.dash-subbar > span.is-warn{background:rgb(var(--warn-rgb))}
.dash-subbar > span.is-err{background:rgb(var(--err-rgb))}
.dash-verdict li{border-bottom:0;padding:4px 0}
.dash-verdict .amount{display:inline}
/* MoM/YoY chips + budget rows inside the This-month panel. */
.dash-chips{margin:10px 0 0;font-size:.8rem;display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline}
.dash-chip{border:1px solid var(--border-soft);border-radius:var(--r);padding:1px 7px;white-space:nowrap}
.dash-chip .amount{display:inline}
/* The budget bar's UNDER-BUDGET green. This was scoped to .dash-budget-row - the container the
   budget bars lived in inside the month panel - so when they moved onto the category rows in
   "Where it goes" (ADR 0102) the bar kept its red at 100% and lost its green below 80%, quietly
   rendering every comfortable category amber. The rule belongs to the BAR, not to one place the bar
   is used; over-budget red beside it was already unscoped, which is why only half the colouring
   survived the move. The month spend pulse never sets is-ok, so widening this reaches nothing else. */
.dash-pulse-fill.is-ok{background:rgb(var(--ok-rgb))}
.dash-cat-table .dash-pulse{display:block;min-width:70px}
/* A MINIMUM SLIVER so 0% still shows its colour. A category with a budget and nothing spent is the
   most comfortable case there is, and a zero-width fill drew an empty track - the one row whose
   colour the owner asked for showed no colour at all (20-08-2026). */
.dash-cat-table .dash-pulse-fill{display:block;min-width:4px}
/* Composition stacked bar + 30/60/90 cash bands. */
.dash-stack{display:flex;height:14px;border-radius:7px;overflow:hidden;background:var(--surf-2);margin-bottom:10px}
.dash-stack > span{display:block;height:100%}
.dash-bands{display:grid;grid-template-columns:repeat(var(--band-cols,3),minmax(0,1fr));gap:8px;margin-bottom:10px}
.dash-band{border:1px solid var(--border-soft);border-radius:var(--r);padding:6px 9px;display:flex;flex-direction:column;gap:1px;font-size:.78rem}
.dash-band strong{font-size:.9rem}
.dash-band .amount{display:inline}
@media (max-width:840px){.dash-cols{grid-template-columns:1fr}.dash-hero{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.dash-hero{grid-template-columns:1fr}.dash-bands{grid-template-columns:1fr}}

/* Health/vital tiles flag a bad value: warn (amber) for concerning, bad (red) for a real problem. */
.stat.is-warn strong{color:rgb(var(--warn-rgb))}
.stat.is-bad strong{color:rgb(var(--err-rgb))}
/* Tiles whose value is a long string (e.g. a migration filename), not a number: let it wrap and
   break inside the tile instead of overflowing the fixed-width track. */
.stat.is-text strong{white-space:normal;overflow-wrap:anywhere;line-height:1.2}
/* A badge inside a tile LABEL (the setup checklist's "Done") has to hug its text: the `.stat span`
   rule sets display:block on EVERY span in a tile, which stretched the badge into a full-width bar. */
.stat span .badge{display:inline-block;width:auto;margin-inline-start:.35em}
/* Date/text tiles carry a longer value than a bare count, so give them a wider track (they span two
   of the auto-fit columns) - there is room, and it keeps dates and filenames on one tidy line. */
.stat.is-wide{grid-column:span 2}
/* Monthly summary: 3 columns (income / expense / net) × rows for actual, committed,
   variance - wider cards so larger amounts fit. */
.month-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
/* Monthly summary top line: the three actuals (expense / income / net) on one row, each a single
   line with the label left and the amount right (beats .stat span/strong block rules). */
.month-kpi{grid-template-columns:repeat(3,minmax(0,1fr))}
.month-kpi .stat{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap}
.month-kpi .stat span{overflow-wrap:normal}
.month-kpi .stat strong{margin-top:0;text-align:right;white-space:nowrap}
/* A suffix riding inside a tile's figure line (the projected row's "+120.00" and surplus/shortfall
   verdict): inline with the number, smaller and quiet, never a second line - the strong's nowrap
   keeps the pair together (user decision 2026-07-30: one line per tile). */
.month-kpi .stat strong .stat-suffix{display:inline;font-size:11px;font-weight:700;color:var(--mute);margin:0}
/* A KPI tile can also carry a COUNT under the figure ("1 donation"). The flex row above makes every
   child a flex item, so `.stat strong + small{display:block}` no longer starts a new line and the
   count sat beside the amount and overflowed the tile - clipped to "1 d". Give it the full width so
   it drops below, where the block rule always intended it. */
.month-kpi .stat > small{flex-basis:100%;text-align:end;margin-top:.15rem}
/* Monthly "pending this month" cluster: drafts, recurring to generate, instalments, partner debts,
   transfers, depreciation. SIX tiles, so six columns - it was five, which left the last one alone on
   a second row looking like an afterthought rather than the sixth of a set. Count the tiles when one
   is added here. */
.month-indicators{grid-template-columns:repeat(6,minmax(0,1fr));margin-top:6px}
/* Six across needs the room for it. Below ~1200px the sidebar leaves about 700px of content, which
   would give each tile ~108px - too narrow for "Recurring to generate" above three amount lines - so
   they go 3 + 3 rather than six cramped columns. The <=980 rule further down takes it to two. */
@media (max-width:1200px){
  .month-indicators{grid-template-columns:repeat(3,minmax(0,1fr))}
}
.stat.indicator{padding:8px 10px}
.indicator-pair{display:flex;flex-direction:column;gap:3px;margin-top:5px}
/* .stat span{display:block} would otherwise flatten these rows - scope beats it (0,2,0). */
.indicator .ind-line{display:flex;align-items:baseline;justify-content:space-between;gap:8px;min-width:0}
.indicator .ind-line em{font-style:normal;color:var(--mute);font-size:11px;font-weight:700;overflow-wrap:anywhere}
.indicator .ind-line b{font-size:14px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
.indicator .ind-line b.muted{font-weight:700;opacity:.5}
/* Indicator tile header carrying its pending COUNT on the same line, right-aligned
   ("Drafts to confirm   12"). */
.indicator > span.with-count{display:flex;align-items:center;justify-content:space-between;gap:8px}
.indicator > span.with-count b{font-size:14px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1}
.indicator > span.with-count b.muted{opacity:.5}
.stat,.panel{
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--panel);
  backdrop-filter:blur(18px);
}
/* backdrop-filter makes each panel its own stacking context, so an in-flow dropdown (.ss-list /
   .combo-list, z-index:50) is trapped inside its panel and a LATER panel paints over it. While a
   field in the panel is focused (its list open), lift the whole panel above later sibling panels.
   Stays within the content area, below the topbar (z-index:30 in the outer context). */
.panel:focus-within{position:relative;z-index:20}
.stat{padding:8px 10px;min-width:0}
.stat span{display:block;color:var(--mute);font-size:11px;font-weight:800;line-height:1.15;overflow-wrap:anywhere}
/* The label rule above also catches money_signed()'s .amount span inside the value and
   muted its colour (0,2,0 beats 0,1,0) - restore the signed colours inside tile values. */
.stat strong .amount{display:inline;color:var(--ink);font-size:inherit;font-weight:inherit;line-height:inherit}
.stat strong .amount-pos{color:var(--amount-pos)}
.stat strong .amount-neg{color:var(--amount-neg)}
/* The class ON the figure itself, not only on a span inside it - a tile's own strong carries it. */
.stat strong.amount-pos,.statement-summary-cell strong.amount-pos{color:var(--amount-pos)}
.stat strong.amount-neg,.statement-summary-cell strong.amount-neg{color:var(--amount-neg)}
/* A MASKED FIGURE INSIDE A TILE INHERITS THE TILE'S FIGURE STYLING, all of it. `.stat span` sets
   display:block, 11px, weight 800 and the muted label colour on EVERY span in a tile - that rule is
   for the tile's LABEL - so wrapping the amount in money_sensitive()'s span rendered the amount at
   label size, in label grey, on its own line. The previous rule here fixed only the colour, and only
   when the strong carried a tone class, so a plain tile still shrank its own figure. It showed up as
   the print audit clipping ARTICLE.stat on the partner page (16-10-2026, ADR 0247); the same bug was
   latent on every tile whose amount is masked. Same shape as `.stat span .badge` above: a span that
   is not the label must opt out of the label's styling. */
.stat strong .sensitive,.stat strong .amount,
.statement-summary-cell strong .sensitive,.statement-summary-cell strong .amount{
  display:inline;font-size:inherit;font-weight:inherit;line-height:inherit;color:inherit;
}
.stat strong{display:block;margin-top:3px;font-size:18px;line-height:1.05;white-space:nowrap;font-variant-numeric:tabular-nums}
/* A FIGURE'S WORD IS A FOOTNOTE, in any tile. This existed only under .month-kpi, so the dashboard's
   projected Net tile printed "surplus" at the figure's own size and weight, inside the strong that
   makes it bold - the owner read it as the wording being messed up (17-10-2026). Same declarations
   as the .month-kpi rule, which is the app's existing size for a figure's footnote. */
.stat strong .stat-suffix{display:inline;font-size:11px;font-weight:700;color:var(--mute);margin:0}
/* A FIGURE'S WORD IS A FOOTNOTE, in any tile. This existed only under .month-kpi, so the dashboard's
   projected Net tile printed "surplus" at the figure's own size and weight, inside the strong that
   makes it bold - the owner read it as the wording being messed up (17-10-2026). Same declarations
   as the .month-kpi rule, which is the app's existing size for a figure's footnote. */
.stat-link{
  display:inline-block;
  margin-top:12px;
  color:var(--cyan);
  font-size:13px;
  font-weight:800;
  text-decoration:none;
}
/* A whole TILE that is a link (a dashboard number opening the list it counts) keeps the tile's own
   typography - the value is data, not a link label - and shows it can be opened by lifting on
   hover/focus. Recolouring every value accent-blue would make a grid of ten tiles shout (§11:
   the brand colour is an accent, not the default). */
.stat.stat-link{display:block;margin-top:0;color:inherit;font-size:inherit;font-weight:inherit}
/* A tile that OPENS something looks different at rest, not only under the pointer: in a grid where
   some tiles are links and some are plain figures, a hover-only affordance is invisible until you
   have already guessed which is which - and invisible on a touch screen entirely, where there is no
   hover at all (user request 2026-07-29). A raised surface and a chevron say "this opens"; the value
   keeps its own typography, because it is data rather than a link label. */
.stat.stat-link{background:var(--hover);border-color:var(--border-soft);position:relative;padding-inline-end:22px}
.stat.stat-link::after{
  content:"";position:absolute;inset-inline-end:9px;top:12px;width:6px;height:6px;
  border-inline-end:2px solid var(--mute);border-block-start:2px solid var(--mute);
  transform:rotate(45deg);opacity:.8;
}
[dir="rtl"] .stat.stat-link::after{transform:rotate(225deg)}
.stat.stat-link:hover,.stat.stat-link:focus-visible{background:rgba(var(--brand-rgb),.16);border-color:var(--cyan)}
.stat.stat-link:hover::after,.stat.stat-link:focus-visible::after{border-color:var(--cyan);opacity:1}
.panel{padding:18px}
.panel-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  margin-bottom:14px;
}
/* Collapsible panels (.panel.js-collapsible): a labelled toggle BAR (injected after the head) folds
   the list away - "Show N entries ▾" / "Hide entries ▴", so a hidden list is obvious. Processed
   sections can default collapsed (server adds .collapsed); state persists per panel. Empty sections
   are not made collapsible (the normal empty message shows instead). */
.panel-toggle{
  width:100%;display:flex;align-items:center;justify-content:center;gap:8px;
  padding:9px 12px;
  border:1px solid var(--border);border-radius:var(--r);
  background:var(--surf-1);color:var(--soft);cursor:pointer;
  font-family:inherit;font-weight:600;font-size:13px;
}
.panel-toggle:hover{background:var(--hover);color:var(--text)}
.panel-toggle::after{
  content:"";width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:translateY(-2px) rotate(45deg);transition:transform .15s ease;
}
.panel.js-collapsible:not(.collapsed) .panel-toggle::after{transform:translateY(2px) rotate(-135deg)}
.panel.js-collapsible:not(.collapsed) .panel-toggle{margin-bottom:14px}
.panel.js-collapsible.collapsed > .panel-head{margin-bottom:14px}
.panel.js-collapsible.collapsed > :not(.panel-head):not(.panel-toggle){display:none}
/* Tabs (sub-pages): for multi-section pages where pagination would break running totals/balances -
   organise into tabs instead of one long scroll. Active tab persists in the URL hash. */
/* Segmented control: a visible holder (filled bar) with a clearly highlighted active tab. */
/* Underline tabs: a strip with a baseline the content sits under, active tab marked by a brand
   underline (not a filled pill) so tabs read as navigation, not action buttons. */
/* Real bordered tabs: each tab is a bordered shape with rounded top corners sitting on the bar's
   baseline; the active one is accent-tinted and reads as selected. Tab titles use the accent colour
   (not body text) so a tab reads as navigation, not content. One rule drives every tab set. */
/* Spacing between a tab bar, its toolbar and the panel comes from ONE source - the container grid
   gap (.main, or .tabs which mirrors it) - never element margins, so it can't double up. */
.tabs{display:grid;gap:18px;min-width:0}
.tab-bar{display:flex;flex-wrap:wrap;gap:4px;max-width:100%;border-bottom:1px solid var(--border)}
.tab{
  appearance:none;margin-bottom:-1px;
  background:var(--surf-1);border:1px solid var(--border);border-bottom-color:transparent;
  color:rgb(var(--accent-rgb));font:inherit;font-weight:600;padding:9px 16px;cursor:pointer;
  border-radius:var(--r-sm) var(--r-sm) 0 0;text-decoration:none;
  transition:background .15s,color .15s,border-color .15s;
}
.tab:hover{background:var(--panel-2)}
/* Active tab is FILLED with the brand (same as primary buttons) + white text - the current tab is
   unmistakable, and white-on-brand is already tuned to read in both dark and light modes. */
.tab.active{color:#fff;background:var(--brand);border-color:transparent;font-weight:700}
/* An active tab-panel stacks its children (toolbar, panel/s) with the same single-source gap as
   .tabs/.main, so a filter toolbar sits OUTSIDE the list card with a consistent gap (and stacked
   panels - e.g. profile + contacts - are spaced too). */
.tab-panel{display:grid;gap:18px;min-width:0}
.tab-panel[hidden]{display:none}
.actions,.row-actions,.form-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
/* Section-head actions: one row, pinned to the panel's right edge, the same in every
   section (§7) - the title text shrinks instead of the buttons wrapping. */
/* The page head's actions hold their row, exactly as the panel head's do. Only .panel-head had
   this: on .page-head the buttons kept their default shrink, so a long lede squeezed them and
   they stacked one per line from ~1280px down - Point of sale showed it worst. The text side
   shrinks instead, which is what it is for. */
.panel-head>.actions,.page-head>.actions{flex-wrap:nowrap;flex-shrink:0;justify-content:flex-end}
.page-head>div:first-child{min-width:0}
/* Button placement (framework §11): only NAVIGATION (back/cancel links) sits at the start corner;
   every SAVE action groups together at the far end - the primary at the very end with secondary
   saves (e.g. "Save as draft") right beside it. The row is end-aligned; the nav link's
   `margin-inline-end:auto` pushes just that link to the start, keeping the save group adjacent (a
   single auto margin, so no gap splits the saves). DOM order matches this (Cancel → secondary save →
   primary) so TAB order follows the visual reading order, and the Enter-key default is the first
   submit - the safe "Save as draft" on multi-save forms. flex `order` just mirrors the DOM. On
   mobile buttons go full-width and stack. */
.form-actions{justify-content:flex-end}
/* Review screen: secondary (Back to edit) on the left, primary (Confirm) on the right. */
.form-actions.form-actions-split{justify-content:space-between}
.form-actions > a,
.form-actions > .js-cancel-dirty{order:1;margin-inline-end:auto}
.form-actions > button:not(.primary),
.form-actions > input[type="submit"]:not(.primary){order:2}
.form-actions > .primary{order:3}
/* A BUTTON WRAPPED IN A FORM keeps its place in the convention. Confirm screens must wrap each
   action in its own form (separate posts), and an unadorned <form> child lands at order 0 - BEFORE
   the order-1 cancel link - so Confirm rendered LEFT of Cancel on the review page (owner's report
   02-08-2026). The form takes the order its button would have taken. :has() is already relied on
   elsewhere (print rules, dashboard). */
.form-actions > form{order:2}
.form-actions > form:has(.primary){order:3}
.button{
  min-height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:9px 13px;
  background:var(--surf-2);
  color:var(--text);
  text-decoration:none;
  font-weight:800;
  cursor:pointer;
  text-align:center;
  max-width:100%;
  white-space:nowrap; /* a button label is one action - it never breaks into lines */
  line-height:1.2;
}
.button{transition:background .15s,border-color .15s,box-shadow .15s,transform .06s}
.button:hover{background:var(--hover)}
.button:active{transform:translateY(1px)}
.button:focus-visible{outline:2px solid rgba(var(--brand-rgb),.75);outline-offset:2px}
.button.primary:hover{filter:brightness(1.07);box-shadow:0 4px 14px rgba(var(--brand-rgb),.32)}
.button:disabled,button:disabled{opacity:.45;cursor:not-allowed}
/* A <span> carrying .button that stands in for an action not yet available - :disabled only applies
   to form controls, and the report link at the foot of the close checklist is a link, not a button.
   Same look, so "unavailable" reads the same whichever element is standing there. */
.button.is-disabled{opacity:.45;cursor:not-allowed}
/* §5 applies to fields too: a derived/locked value must READ as not-yours-to-type. */
/* A DERIVED value (calculated, never typed): dashed outline + muted ink reads as "output". */
.js-base-amount:disabled{border-style:dashed;background:transparent;color:var(--mute);opacity:1}
.button:disabled:hover,button:disabled:hover{background:var(--surf-2)}
/* Hierarchy: .primary (one per view) > default (secondary) > .ghost (tertiary). */
.button.primary{background:var(--brand);border-color:transparent;color:#fff}
.button.primary:hover{background:var(--brand-hover)}
.button.ghost{background:transparent;border-color:transparent;color:var(--soft);font-weight:700}
.button.ghost:hover{background:var(--hover)}
.button.danger{color:#ffd7d7;border-color:rgba(var(--err-rgb),.28)}
.button.ghost.danger{color:#ff9d9d}
.button.ghost.danger:hover{background:rgba(var(--err-rgb),.12)}
/* A SELECTED ghost button, for a two-state filter such as the income statement's accounting basis.
   `.active` is the class this app already uses for a chosen nav item, tab and stage step, so the
   vocabulary is reused rather than extended; the state is carried by background, colour AND weight,
   never colour alone (framework section 9). */
.button.ghost.active{background:var(--hover);color:var(--text);font-weight:800;border-color:var(--border)}
.button.small{min-height:40px;padding:8px 10px;font-size:12px}
/* Exchange-rate "Use fetched rate" sits inline beside the Source badge. */
.rate-clear-form{display:inline-block;margin-left:8px;vertical-align:middle}
.rate-clear-form .button.small{min-height:0;padding:2px 8px}

/* Row overflow menu (§11): one inline action + a "⋯" trigger that opens a fixed-position
   popover (fixed so the table's overflow can't clip it). JS in layout.php positions it. */
.row-menu{position:relative;display:inline-flex}
.row-menu-trigger{min-height:20px;min-width:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:var(--r);background:var(--surf-2);color:var(--soft);cursor:pointer;font-weight:800;font-size:18px;line-height:1;letter-spacing:1px}
.row-menu-trigger:hover,.row-menu-trigger[aria-expanded="true"]{background:var(--hover)}
/* Labeled Options trigger (§13): reads as a normal button, not the round ⋯ chip - and it is where
   the statement and print live, so it carries the accent as TEXT AND BORDER to be findable at a
   glance (user request 2026-07-30). Tinted, not filled: it is a secondary action, and §11 keeps one
   primary per view - a filled brand button here would compete with the page's own. */
.row-menu-trigger.is-options{
  min-width:0;width:auto;height:auto;border-radius:var(--r);padding:8px 12px;font-size:13px;gap:6px;
  color:rgb(var(--accent-rgb));
  font-weight:800;
  border-color:rgba(var(--accent-rgb),.42);
  background:rgba(var(--accent-rgb),.12);
}
.row-menu-trigger.is-options:hover,
.row-menu-trigger.is-options[aria-expanded="true"]{
  background:rgba(var(--accent-rgb),.2);
  border-color:rgba(var(--accent-rgb),.6);
}
/* The palette is authored dark-first, so the accent needs a darker counterpart on a light surface:
   the dark-theme violet measures 4.33:1 there, and 13px bold needs 4.5:1. Same lesson as the badge
   tones - a colour that reads on near-black is not a colour that reads on white. */
:root[data-theme="light"] .row-menu-trigger.is-options{
  color:#6d28d9;
  border-color:rgba(109,40,217,.5);
  background:rgba(109,40,217,.1);
}
:root[data-theme="light"] .row-menu-trigger.is-options:hover,
:root[data-theme="light"] .row-menu-trigger.is-options[aria-expanded="true"]{
  background:rgba(109,40,217,.18);
  border-color:rgba(109,40,217,.7);
}
.row-menu-list{position:fixed;z-index:60;min-width:172px;display:flex;flex-direction:column;gap:2px;padding:6px;background:var(--bg-2);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow-2)}
.row-menu-list form{width:100%;margin:0}
.row-menu-item{display:block;width:100%;text-align:left;padding:9px 11px;border:0;border-radius:var(--r);background:transparent;color:var(--soft);font:inherit;font-weight:700;cursor:pointer;text-decoration:none}
.row-menu-item:hover{background:var(--hover)}
.row-menu-item.danger{color:#ff9d9d}
.row-menu-item.danger:hover{background:rgba(var(--err-rgb),.14)}

/* Mail provider cards: one per sending method, the chosen one's settings beneath (21-09-2026). A card is a
   button, not a link - it switches a panel on this page and changes nothing until Save. */
.mail-cards{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:16px}
.mail-card{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:180px;padding:12px 14px;
  border:1px solid var(--border);border-radius:var(--r-lg);background:var(--bg-2);color:var(--text);
  font:inherit;text-align:left;cursor:pointer}
.mail-card:hover{background:var(--hover)}
/* The open card is the one whose settings are showing - marked with the accent, since this is a selection. */
.mail-card.is-open{border-color:rgba(var(--brand-rgb),.6);box-shadow:0 0 0 1px rgba(var(--brand-rgb),.35) inset}
.mail-card-name{font-weight:800}
.mail-card small{font-size:12px}
.mail-panel{border-top:1px solid var(--border);padding-top:14px}
/* The card row wraps at about 130px per card (the SMTP handover), so five methods still fit a phone without a
   sideways scroll. */
.mail-cards .mail-card{min-width:130px}
/* The test box: a bordered panel of its own INSIDE the section, so it reads as a step rather than a setting -
   and, being outside every fieldset, it keeps working while the settings are locked. */
.mail-test{margin:0 0 16px;background:var(--bg-2)}
/* THE ACTION ROW IS A BOX LIKE THE FIELDS ABOVE IT (owner's report 26-09-2026): the connection state and the
   buttons that change it are one thing, so they sit in their own bordered panel rather than floating loose
   under the fieldset. Same border, radius and surface tokens as a field group - it is the same kind of object. */
.mail-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;
  margin-top:12px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--r-lg);background:var(--bg-2)}
/* The state word carries its own colour - green connected, red not - because that is the one thing on this
   panel a reader looks for first. Paired with ● / ○ so it is never colour alone (framework §9). */
.mail-state{font-weight:700;margin-right:auto}
.mail-state.is-ok{color:rgb(var(--ok-rgb))}
.mail-state.is-err{color:rgb(var(--err-rgb))}
/* THE LOCK NOTE HAS TO BE NOTICED (owner's report 27-09-2026): it answers the first question a reader has -
   why is nothing on this page editable - and as a plain field note it read as a footnote and was missed.
   Amber, because it is a state that stops you doing something, not an error; the padlock carries the same
   meaning without the colour (framework §9). */
.mail-editbar{align-items:center;gap:12px}
.mail-lock{display:inline-flex;align-items:center;gap:.4em;padding:4px 10px;
  border:1px solid rgba(var(--warn-rgb),.38);border-radius:var(--r-pill);
  background:rgba(var(--warn-rgb),.14);color:#ffefbf;font-size:12px;font-weight:700}
:root[data-theme="light"] .mail-lock{color:#8a5800}
/* The reminder ladder: its five boxes on one line, wrapping rather than stretching the label's row. */
.check-row{display:flex;flex-wrap:wrap;gap:4px 14px}
.check-row .inline-check{min-height:32px}
/* A redirect URI is copied character by character into a provider console, so it is set in a mono face - a
   proportional l/1/I costs somebody an afternoon. */
input.is-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.inline-form{display:inline}
/* Modal dialog (native <dialog>): centered card + dimmed backdrop. */
dialog.modal{border:1px solid var(--border);border-radius:var(--r-xl);background:var(--bg-2);color:var(--text);padding:0;max-width:min(440px,92vw);width:100%;box-shadow:var(--shadow-2);max-height:calc(100dvh - var(--safe-t) - var(--safe-b) - 32px);margin-top:calc(var(--safe-t) + 16px);margin-bottom:calc(var(--safe-b) + 16px)}
/* Wide variant for content-bearing modals (the review-before-post dry run with its Dr/Cr table).
   The fetched panels keep their own .panel chrome; the modal scrolls if they run long. */
dialog.modal.modal-wide{max-width:min(720px,94vw)}
dialog.modal.modal-wide .js-preview-body{overflow-y:auto}
/* A table inside a modal never forces the page-table minimum. tables carry min-width:760px so a
   data table keeps its columns readable on a wide page - but a modal is NARROWER than that, so every
   table in one overflowed and had to be scrolled sideways to read. This rule existed for the
   .modal-wide preview only; the review overlay next to it had the same problem and no rule, so the
   transfer review's "Resulting posting" could not be read without scrolling (user report
   2026-07-29). One rule for every modal instead of one per overlay. */
dialog.modal table{min-width:0}
/* THE REVALUATION REVIEW NEEDS ROOM (owner's report 20-09-2026): it carries six money columns for every
   balance, which at the 720px preview width wrapped every heading and still had to be scrolled sideways. The
   panel declares itself with .fx-review rather than the dialog being widened for every review - an entry's
   review is a field grid and reads better narrow. Figures and account names stay on one line (framework §12);
   below the phone breakpoint the table stacks into cards, where wrapping is correct. */
dialog.modal.modal-wide:has(.fx-review){max-width:min(1080px,96vw)}
.fx-review table{width:100%}
@media (min-width:720px){
  .fx-review td,.fx-review th{white-space:nowrap}
}
/* Wider modal for the review-in-place overlay (carries the transfer summary + its posting). */
dialog.modal.modal-lg{max-width:min(880px,94vw)}
dialog.modal.modal-lg .review-body .panel{border:none;background:transparent;padding:0}
dialog.modal.modal-lg .review-body .panel-head{margin-bottom:12px}
dialog.modal::backdrop{background:rgba(2,1,10,.64)}
.modal-card{padding:20px;display:flex;flex-direction:column;gap:12px}
.modal-card h2{margin:0;font-size:18px}
.modal-sub{margin:0;color:var(--soft);font-weight:700}
.modal-card textarea{width:100%}
/* Type-to-confirm (data-confirm-phrase): the field stacks under the message like any other labelled
   input, and the label carries the phrase to type. Hidden by [hidden] until a confirm asks for one. */
#confirm-phrase-wrap{display:flex;flex-direction:column;gap:6px}
#confirm-phrase-wrap[hidden]{display:none}
#confirm-phrase{width:100%}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:4px}
/* Stepped-flow actions: secondary/back on the LEFT, primary on the RIGHT (opposite corners). */
.modal-actions-split{justify-content:space-between}
.flash{
  border:1px solid rgba(var(--ok-rgb),.3);
  background:rgba(var(--ok-rgb),.1);
  color:#c7ffdf;
  border-radius:var(--r);
  padding:12px 14px;
}
/* Error variant - a form-level message (e.g. failed review validation) as a full-width banner. */
.flash-error{
  border-color:rgba(var(--err-rgb),.4);
  background:rgba(var(--err-rgb),.12);
  color:#ffd9d9;
}
:root[data-theme="light"] .flash-error{color:#b4232a}
/* Warning variant - a message that is not an error and not reassurance: something legitimate that the reader
   should notice before acting (a revaluation dated outside the year close). Uses the status tokens, like every
   other tone in this stylesheet, so a theme change carries it. */
.flash-warn{
  border-color:rgba(var(--warn-rgb),.4);
  background:rgba(var(--warn-rgb),.12);
  color:#ffe9c2;
}
:root[data-theme="light"] .flash-warn{color:#8a5200}
/* Login-page "why you were signed out" banners. Security alert reuses the error tone; the neutral
   variant is a quiet note. */
.auth-alert{margin:0 0 16px;text-align:left;padding:12px 14px;border:1px solid var(--border);border-radius:var(--r-lg)}
.auth-alert.flash-error{display:flex;flex-direction:column;gap:6px}
.auth-alert strong{font-weight:800}
.auth-note{background:var(--surf-1);color:var(--soft);font-size:.9rem}
.action-link{
  display:grid;
  gap:8px;
}
.action-link span{
  font-size:12px;
  font-weight:800;
  letter-spacing:.06em;
}
.action-link code{overflow-wrap:anywhere}
.form-note{
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:12px;
  color:var(--soft);
  background:var(--surf-1);
}
/* Toned variants of the same note, for a finding that needs to read as a finding (a member locked
   out, a reset link that expired unused). Existing status tokens only - the shared note keeps its
   shape and only its tone changes, so nothing needs a bespoke callout. */
.form-note.tone-warn{border-color:rgba(var(--warn-rgb),.48);background:rgba(var(--warn-rgb),.10)}
.form-note.tone-err{border-color:rgba(var(--err-rgb),.48);background:rgba(var(--err-rgb),.10)}
.form-note.tone-ok{border-color:rgba(var(--ok-rgb),.45);background:rgba(var(--ok-rgb),.09)}
.timeline-note-form{
  display:grid;
  gap:12px;
  margin-bottom:18px;
}
.timeline{
  display:grid;
  gap:10px;
}
.timeline-item{
  border:1px solid var(--border-soft);
  border-radius:var(--r);
  padding:12px;
  background:var(--surf-1);
}
.timeline-item p{margin:8px 0 0}
.timeline-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  color:var(--mute);
  font-size:12px;
  font-weight:800;
}
.stage-pipeline{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.stage-step{
  min-height:40px;
  border:1px solid var(--border);
  border-radius:var(--r-pill);
  padding:7px 11px;
  background:var(--surf-2);
  color:var(--soft);
  font-weight:800;
  cursor:pointer;
}
.stage-step:hover{background:var(--hover);color:#fff}
.stage-step.active{
  color:#fff;
  border-color:transparent;
  background:var(--grad);
}
.stage-settings-table input{
  min-width:120px;
}
.stage-settings-table .compact-input{
  width:90px;
  min-width:90px;
}
.inline-check{
  display:flex;
  align-items:center;
  grid-template-columns:none;
  gap:8px;
  min-height:42px;
}
.inline-check input{
  width:18px;
  min-height:18px;
  accent-color:var(--lime);
}
.share-field{
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:14px;
}
.share-field legend{
  padding:0 6px;
  font-weight:900;
}
.share-field p{
  margin:0 0 12px;
  color:var(--mute);
}
.check-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:8px;
}
.check-inline{
  display:flex;
  align-items:center;
  gap:8px;
}
/* Lowest price / best quote in the RFQ comparison matrix. */
.cell-best{
  background:var(--ok-bg,rgba(34,197,94,.12));
  font-weight:600;
}
.stage-create-form{
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid var(--divider);
}
.email-template-list{
  display:grid;
  gap:8px;
}
.template-editor{
  border:1px solid var(--border-soft);
  border-radius:var(--r-lg);
  background:var(--surf-1);
}
.template-editor>summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
}
.template-editor>summary::-webkit-details-marker{display:none}
.template-editor>summary::after{content:"▾";color:var(--mute);flex:0 0 auto;font-size:12px}
.template-editor[open]>summary::after{content:"▴"}
.template-editor>summary:hover{color:var(--text)}
.template-editor-title{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  flex-wrap:wrap;
}
.template-editor-title strong{font-size:15px}
.template-editor-body{
  display:grid;
  gap:12px;
  padding:4px 14px 14px;
}
/* A closed <details> child with an explicit display can leak open in some browsers - force it shut. */
.template-editor:not([open]) .template-editor-body{display:none}
/* Template category groups (collapsed by default) - scan a few headers instead of every template. */
.template-group>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;padding:10px 2px;font-weight:500;font-size:15px}
.template-group>summary::-webkit-details-marker{display:none}
.template-group>summary::after{content:"▾";color:var(--mute);margin-left:auto;font-size:12px}
.template-group[open]>summary::after{content:"▴"}
.template-group>summary:hover{color:var(--text)}
.template-group-count{color:var(--mute);font-weight:400;font-size:13px}
.template-group-body{display:grid;gap:8px;padding:0 0 10px 12px}
.template-group:not([open]) .template-group-body{display:none}
.auth-card{
  width:min(560px,100%);
  margin:8vh auto;
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:26px;
  background:var(--panel);
  backdrop-filter:blur(18px);
}
.public-portfolio-body{
  min-height:100vh;
}
.public-portfolio{
  width:min(1120px,100%);
  margin:0 auto;
  padding:24px;
  display:grid;
  gap:18px;
}
.public-hero{
  min-height:56vh;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:24px;
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:32px;
  background:
    linear-gradient(120deg,rgba(6,1,15,.2),rgba(6,1,15,.7)),
    radial-gradient(circle at 78% 20%,rgba(var(--ok-rgb),.2),transparent 24rem),
    var(--panel);
  backdrop-filter:blur(18px);
}
.public-hero h1{
  max-width:780px;
  font-size:clamp(34px,6vw,64px);
}
.public-headline{
  max-width:760px;
  color:var(--soft);
  font-size:22px;
  font-weight:700;
}
.public-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}
.public-meta span{
  display:inline-flex;
  border:1px solid var(--border);
  border-radius:var(--r-pill);
  padding:5px 9px;
  color:var(--soft);
  font-size:12px;
  font-weight:800;
}
.public-contact{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}
.public-section{
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:24px;
  background:var(--surf-2);
  backdrop-filter:blur(18px);
}
.public-section > p{
  color:var(--soft);
  max-width:820px;
}
.public-section-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:center;
  margin-bottom:14px;
}
.public-project-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.public-card{
  border:1px solid var(--border-soft);
  border-radius:var(--r);
  padding:16px;
  background:var(--surf-1);
}
.public-card h3{
  margin:10px 0 6px;
  font-size:21px;
  line-height:1.15;
}
.public-card,.public-section,.panel,.stat,.page-head,.topbar,.auth-card,.timeline-item,.template-editor{
  min-width:0;
}
.public-card p,.panel p,.lede,.empty,.muted,td,th,label,code{
  overflow-wrap:anywhere;
}
.public-card p{
  color:var(--soft);
}
.public-card-subtitle{
  margin:0;
  color:#fff;
  font-weight:800;
}
.public-project-card{
  display:grid;
  gap:14px;
}
.public-project-card img{
  width:100%;
  aspect-ratio:16 / 9;
  object-fit:cover;
  border-radius:var(--r);
  border:1px solid var(--border-soft);
  background:var(--surf-2);
}
.public-skill-list{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.public-skill{
  display:grid;
  gap:3px;
  border:1px solid var(--border-soft);
  border-radius:var(--r);
  padding:12px;
  background:var(--surf-1);
}
.public-skill span,.public-skill small{
  color:var(--mute);
  font-size:12px;
  font-weight:800;
}
.public-timeline{
  display:grid;
  gap:12px;
}
.login-form{
  display:grid;
  gap:14px;
  margin-top:22px;
}
.empty{color:var(--mute)}
.table-wrap{overflow:auto}
/* Dashboard "recent" widgets: a quiet right-aligned footer linking to the full lists. */
.panel-foot{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:14px;margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}
.panel-foot a{color:var(--soft);font-weight:700;font-size:13px;text-decoration:none}
.panel-foot a:hover{color:var(--text)}
/* Report account trees: indent leaves by depth; parent rows (with a subtotal) read as headers. */
.coa-acct{display:inline-block;padding-left:calc(var(--coa-depth, 0) * 18px)}
/* THE GUIDE LINE (owner's request 20-09-2026): indentation alone leaves the eye counting pixels across a wide
   row, so a nested account draws the elbow that joins it to its parent - the same shape a file tree uses. Depth 0
   has no parent to join, so :not([style*="--coa-depth:0"]) keeps the root rows clean. Drawn with the border token
   like every other rule, and a branch row reads bolder because it heads the rows beneath it as well as being one. */
.coa-acct{position:relative}
.coa-acct:not([style*="--coa-depth:0"])::before{content:"";position:absolute;left:calc(var(--coa-depth, 0) * 18px - 12px);
  top:0;bottom:50%;width:1px;background:var(--border)}
.coa-acct:not([style*="--coa-depth:0"])::after{content:"";position:absolute;left:calc(var(--coa-depth, 0) * 18px - 12px);
  top:50%;width:8px;height:1px;background:var(--border)}
.coa-acct.is-branch{font-weight:800}
/* On a phone a table stacks into labelled cards, where an indent inside a 360px card buys nothing and the elbow
   would point at empty space. */
@media (max-width:719px){
  .coa-acct{padding-left:0}
  .coa-acct::before,.coa-acct::after{display:none}
}
.coa-group-row td{font-weight:700}
/* Shared pagination control (list pages): size selector + status + page links. */
.pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}
.pagination-size{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.pagination-show{display:inline-flex;align-items:center;gap:6px;color:var(--mute);font-size:13px;margin:0}
.pagination-show select{width:auto;min-height:34px;padding:4px 26px 4px 8px}
.pagination-status{color:var(--mute);font-size:13px}
.pagination-nav{display:flex;flex-wrap:wrap;gap:4px}
.pagination-nav .button.small{min-width:36px;justify-content:center}
.pagination-nav [aria-disabled="true"]{opacity:.45;cursor:not-allowed}
.pagination-nav [aria-current="page"]{pointer-events:none}
.check-col{width:1%;white-space:nowrap;text-align:center}
.check-col input{cursor:pointer;width:16px;height:16px}
/* The .row-actions class also styles button groups (display:flex, line ~492). On a table cell that
   flex would drop it out of the row - and on the empty header cell it broke the header's bottom
   border after the last column. Force both header and body action cells back to table-cell. */
th.row-actions,td.row-actions{display:table-cell;white-space:nowrap}
/* Grouped section tables (monthly review): clear column heads, a group header row that
   carries the group name + its subtotal, and a section-net footer. */
td.num{text-align:right;white-space:nowrap}
th.num{text-align:right}
thead th{vertical-align:middle;border-top:1px solid var(--border);border-bottom:1px solid var(--border);font-size:11px;font-weight:800;color:var(--mute);padding:10px 12px 8px}
.col-date{white-space:nowrap}
/* A tile's second line: the same figure in the base currency, labelled so it is not mistaken for a
   stray number. Its own row beneath the primary amount, muted, and never wrapped mid-value. */
.stat strong + small,.statement-summary-cell strong + small{display:block;margin-top:.15rem;white-space:nowrap;font-weight:400}
.stat strong + small .amount,.statement-summary-cell strong + small .amount{display:inline}
/* Currency tick list on the exchange-rates page: wraps into columns, one per line on mobile. */
.currency-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:.35rem 1rem;margin:.5rem 0}
.currency-pick .check-inline{display:flex;align-items:center;gap:.5rem}
/* A currency and how it is priced are ONE item, so a multi-column grid cannot deal them into
   different columns and leave the option orphaned between two currencies. */
.currency-choice{display:block}
/* The pricing option is subordinate to the currency above it: indented to the box it belongs to,
   quieter, and only there once that currency is actually ticked - :has() so it follows the box
   live, with no script. Asking how to price a currency you do not work in is not a question. */
.currency-choice .currency-priced{margin-inline-start:1.6rem;font-size:12px}
.currency-choice:not(:has(> label > input[name="currency[]"]:checked)) .currency-priced{display:none}
/* A reference code is an identifier - never break one across lines, same rule as a date. */
.col-ref{white-space:nowrap}
.record-link{white-space:nowrap} /* a reference code is one token - never breaks (screen; print wraps via stmt rules) */
.col-wrap{white-space:normal;word-break:break-word;max-width:34ch}
table.grouped{min-width:0}
tbody td{padding-top:4px;padding-bottom:4px}
table.grouped thead th{font-size:11px;font-weight:800;color:var(--mute);border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:10px 12px 8px}
thead th{white-space:nowrap}
table.grouped tr.group-row th{background:var(--panel);text-align:left;font-size:13px;font-weight:800;color:var(--text);padding:9px 12px;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
table.grouped tr.group-row .group-sub{color:var(--mute);font-weight:700}
tr.empty-row td{color:var(--mute);font-style:italic}
table.grouped tfoot td{border-top:2px solid var(--border);font-weight:800;font-size:14px;padding-top:12px}
/* A totals row's LABEL cell - it names the row instead of holding a figure, so it right-aligns
   against the amounts it totals. This replaced a style="text-align:right" written into the review
   template: a hardcoded declaration (§1) that the mobile stack then had no way to undo. */
td.total-label{text-align:end}
.section-net{font-weight:800}
.section-net.pos,.amount-pos{color:var(--amount-pos)}
.section-net.neg,.amount-neg{color:var(--amount-neg)}
/* HIDE AMOUNTS (ADR 0067): one rule for every balance and total, driven by a single root flag the
   pre-paint script sets, so a masked session never flashes the real figures on load.
   FIXED WIDTH on purpose - masking in place would leave the figure's own width behind, and a wide
   blur next to a narrow one still tells the room whether you are up or down by a factor of a
   thousand. Every masked figure is the same five dots. The value stays in the markup: this is a
   shoulder-surfing shield, not a permission boundary. */
/* MASKING IS OPT-IN, NOT OPT-OUT (owner's report 04-09-2026). This rule used to be
   `:root[data-amounts="hidden"] .sensitive`, which covered EVERY figure on the page and then
   un-covered the two cases that should not be. The consequence was invisible until someone met it:
   a figure in a panel with no eye of its own could not be revealed at all, because only a keyed
   section ever receives [data-amounts-show] - so the owner had to switch the MASTER eye off to read
   the "Waiting in other areas" tiles on the dashboard, which have no eye and never had one.
   Scoped to keyed sections instead: a figure is masked only where there is an eye that can bring it
   back. A panel without one states its figures, and the master eye covers what it can uncover. */
:root[data-amounts="hidden"] [data-mask-key]:not([data-amounts-show]) .sensitive{
  display:inline-block;
  width:5ch;
  overflow:hidden;
  /* nowrap is load-bearing, not tidiness: the real figure is still in the box, and at 5ch wide it
     WRAPS - a two-line invisible value made the span 48px tall, pushed the dots to the top of it
     and stretched the table row. Measured in the browser; without this the mask looks broken. */
  white-space:nowrap;
  color:transparent;
  vertical-align:baseline;
  position:relative;
  user-select:none;
  -webkit-user-select:none;
}
:root[data-amounts="hidden"] [data-mask-key]:not([data-amounts-show]) .sensitive::before{
  content:"•••••";
  position:absolute;
  inset:0;
  color:var(--mute);
  letter-spacing:.06em;
}
/* The tone colours would repaint the dots green or red - which restates the very thing the mask
   hides (whether you are above or below zero). Masked figures are all one neutral tone. */
:root[data-amounts="hidden"] [data-mask-key]:not([data-amounts-show]) .sensitive.amount-pos::before,
:root[data-amounts="hidden"] [data-mask-key]:not([data-amounts-show]) .sensitive.amount-neg::before{color:var(--mute)}
/* inline-flex, like the bell beside it: as a plain block-level flex the button stretched to the
   whole topbar-actions column on a phone (116px against the bell's 37px) and pushed the bell onto
   its own line. Icon-only controls in this bar are square. */
/* A DOCUMENT IS NEVER MASKED (owner's decision 04-08-2026). A statement, a receipt, a report you
   OPEN to read is a document - the eye hides figures on the working screens, and a statement with
   dots where its balances belong is not a statement, on screen any more than on paper. Every such
   view carries .statement-doc / .statement-body already, so this is one rule rather than a list. */
:root[data-amounts="hidden"] .statement-doc .sensitive,
:root[data-amounts="hidden"] .statement-body .sensitive,
.statement-body :root[data-amounts="hidden"] .sensitive{
  display:inline;width:auto;overflow:visible;white-space:normal;color:inherit;position:static;user-select:auto;
}
:root[data-amounts="hidden"] .statement-doc .sensitive::before,
:root[data-amounts="hidden"] .statement-body .sensitive::before{content:none}
:root[data-amounts="hidden"] .statement-doc .sensitive.amount-pos{color:var(--amount-pos)}
:root[data-amounts="hidden"] .statement-doc .sensitive.amount-neg{color:var(--amount-neg)}

/* PER-SECTION opt-out: a panel the owner has chosen to keep visible states its figures even while
   the master eye is on. Set by script from the stored preference, so the selector is a plain
   attribute rather than anything the server had to guess. */
:root[data-amounts="hidden"] [data-amounts-show] .sensitive{
  display:inline;width:auto;overflow:visible;white-space:normal;color:inherit;position:static;user-select:auto;
}
:root[data-amounts="hidden"] [data-amounts-show] .sensitive::before{content:none}
:root[data-amounts="hidden"] [data-amounts-show] .sensitive.amount-pos{color:var(--amount-pos)}
:root[data-amounts="hidden"] [data-amounts-show] .sensitive.amount-neg{color:var(--amount-neg)}
/* The section eye reads as pressed when that section follows the master eye. */
/* Sits in the heading it controls. The heading becomes a wrapping flex row ONLY where the eye is
   present (:has), so the button is a real flex item with a gap instead of an inline element whose
   margin hangs past the content box - that margin was a 7px overflow on a 375px screen, which the
   mobile audit failed on. Scoped, so every other panel head is untouched. */
.panel-head h2:has(.mask-section-eye){display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;min-width:0}
.mask-section-eye{opacity:.55;flex:0 0 auto;vertical-align:middle;padding:.15rem .35rem;min-height:0}
.mask-section-eye[aria-pressed="true"]{opacity:1;color:var(--brand)}
.amounts-eye{display:inline-flex;align-items:center;justify-content:center}
.amounts-eye .eye-off{display:none}
:root[data-amounts="hidden"] .amounts-eye .eye-on{display:none}
:root[data-amounts="hidden"] .amounts-eye .eye-off{display:inline}
.check-list{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-direction:column;gap:8px}
.check-list li{display:flex;gap:10px;align-items:flex-start;color:var(--soft)}
.check-list .ck{flex:0 0 auto;font-weight:800}
.check-list .ck.ok{color:var(--lime)}
.check-list .ck.no{color:#ffb27a}
table{
  width:100%;
  border-collapse:collapse;
  min-width:760px;
}
th,td{
  padding:12px;
  border-bottom:1px solid var(--divider);
  text-align:left;
  vertical-align:middle;
  overflow-wrap:break-word;
}
th{
  color:var(--mute);
  font-size:12px;
  letter-spacing:.06em;
}
/* A wide list (a dozen columns) that must fit its panel with the side menu open: tighter gutters.
   Opt-in per table, so ordinary lists keep their breathing room. */
.table-dense th,.table-dense td{padding:10px 6px}
.table-dense td{font-size:13px}
.table-dense th{letter-spacing:0}
.table-dense th .col-sort{gap:3px}
/* A NUMBER COLUMN SIZED TO ITS NUMBER (owner, 11-09-2026): "100.00%" needs little room, but a
   100%-wide table shares its spare width across every column and gave Commit % the most. width:1%
   shrinks it to its content; the spare room goes to the name. */
th.col-tight,td.col-tight{width:1%;white-space:nowrap}
/* Last paid, coloured by recency (last_paid_cell): the amount tokens, so it follows the theme. */
.date-recent{color:var(--amount-pos);white-space:nowrap}
.date-late{color:var(--amount-neg);white-space:nowrap}
.badge{
  display:inline-flex;
  align-items:center;
  /* A badge that mixes an ELEMENT with text - "<span>EUR 6,500.00</span> overdue" on the dashboard,
     an icon before its label - is a flex container, and a flex container DROPS the whitespace-only
     text node between two items. The markup's space is real and still reads correctly in the
     source; it simply never rendered, so the figure ran into its word: "EUR 6,500.00overdue".
     gap restores it for every such badge at once. A badge holding only text is a single flex item
     and gap has nothing to sit between, so plain badges are untouched. */
  gap:.35em;
  min-height:26px;
  border:1px solid var(--border);
  border-radius:var(--r-pill);
  padding:4px 8px;
  color:var(--soft);
  font-size:12px;
  font-weight:800;
  line-height:1.15;
  background:var(--surf-2);
}
/* A draft's blank reference placeholder in a page-head h1: the "—" sits on the text baseline while
   the Draft badge box is taller, which reads misaligned - centre both on the same midline. */
.ref-blank{display:inline-block;vertical-align:middle}
.ref-blank + .badge{vertical-align:middle}
/* A partner's PRIMARY role among several - a brand-tinted badge so the main role reads first. */
.badge-role-primary{
  border-color:rgba(var(--brand-rgb),.5);
  background:rgba(var(--brand-rgb),.18);
  color:var(--text);
}
.badge-status-paid,
.badge-status-active,
.badge-status-accepted,
.badge-status-completed,
.badge-status-resolved,
.badge-status-won,
.badge-status-shortlisted,
.badge-status-offer,
.badge-status-featured,
.badge-stage-offer,
.badge-signin-success,
.badge-signin-recovery-code-used,
.badge-signin-reset-requested,
.badge-priority-low{
  color:#c8ffe1;
  border-color:rgba(var(--ok-rgb),.34);
  background:rgba(var(--ok-rgb),.14);
}
.badge-status-interesting,
.badge-status-in-progress,
.badge-status-sent,
.badge-status-applied,
.badge-stage-applied,
.badge-stage-screening,
.badge-event-email,
.badge-event-call,
.badge-event-note,
.badge-event-admin-notification,
.badge-type-application,
.badge-type-opportunity,
.badge-type-course{
  color:#c7f5ff;
  border-color:rgba(var(--info-rgb),.36);
  background:rgba(var(--info-rgb),.14);
}
.badge-status-partial,
.badge-status-waiting,
.badge-priority-medium,
.badge-status-planned,
.badge-status-proposed,
.badge-status-researching,
.badge-status-invited,
.badge-stage-draft,
.badge-signin-form-expired,
.badge-signin-no-such-account,
.badge-signin-reset-no-match,
.badge-signin-reset-account-not-active,
.badge-event-task,
.badge-event-field-changed,
.badge-event-password-reset-generated,
.badge-event-invite-generated{
  color:#ffefbf;
  border-color:rgba(var(--warn-rgb),.38);
  background:rgba(var(--warn-rgb),.15);
}
.badge-priority-high,
.badge-status-new,
.badge-event-interview,
.badge-event-follow-up,
.badge-event-deadline,
.badge-event-reminder,
.badge-event-request,
.badge-status-due{
  color:#ffe0c2;
  border-color:rgba(var(--warn-rgb),.48);
  background:rgba(var(--warn-rgb),.2);
}
.badge-status-overdue,
.badge-priority-urgent,
.badge-status-rejected,
.badge-status-dropped,
.badge-status-inactive,
.badge-status-dismissed,
.badge-status-closed,
.badge-status-lost,
.badge-stage-rejected,
.badge-signin-bad-password,
.badge-signin-locked-out,
.badge-signin-2fa-failed,
.badge-signin-reset-email-failed,
.badge-status-failed,
.badge-event-error{
  color:#ffd7d7;
  border-color:rgba(var(--err-rgb),.42);
  background:rgba(var(--err-rgb),.15);
}
.badge-status-archived,
.badge-status-paused,
.badge-status-withdrawn,
.badge-stage-withdrawn,
.badge-status-skipped,
.badge-role-admin,
.badge-role-owner,
.badge-role-user,
.badge-rate-triangulated{
  color:#ded9ff;
  border-color:rgba(var(--accent-rgb),.34);
  background:rgba(var(--accent-rgb),.14);
}
/* Exchange-rate source badges: fetched (ok) / manual (info) already covered by the groups above;
   these add the two rate-specific values. */
.badge-rate-fetched{color:#c8ffe1;border-color:rgba(var(--ok-rgb),.34);background:rgba(var(--ok-rgb),.14)}
.badge-rate-manual{color:#c7f5ff;border-color:rgba(var(--info-rgb),.36);background:rgba(var(--info-rgb),.14)}
.badge-rate-needs-manual{color:#ffefbf;border-color:rgba(var(--warn-rgb),.38);background:rgba(var(--warn-rgb),.15)}
/* GL/ledger account-type badges (asset/liability/equity/income/expense); other 'type' values fall
   back to the neutral base .badge. */
.badge-acct-asset{color:#c8ffe1;border-color:rgba(var(--ok-rgb),.34);background:rgba(var(--ok-rgb),.14)}
.badge-acct-income{color:#c7f5ff;border-color:rgba(var(--info-rgb),.36);background:rgba(var(--info-rgb),.14)}
.badge-acct-expense{color:#ffefbf;border-color:rgba(var(--warn-rgb),.38);background:rgba(var(--warn-rgb),.15)}
.badge-acct-liability{color:#ffd7d7;border-color:rgba(var(--err-rgb),.42);background:rgba(var(--err-rgb),.15)}
.badge-acct-equity{color:#ded9ff;border-color:rgba(var(--accent-rgb),.34);background:rgba(var(--accent-rgb),.14)}
/* MAIL SENDING-METHOD BADGES, as the sibling CRM colours them (owner's request 26-09-2026). The tone answers
   "is this what is sending my mail", which is what a reader scans the card row for:
     in use     -> green   the method carrying mail right now
     fallback   -> orange  standing by, and a use of it is a fault worth noticing
     ready      -> red     set up and NOT sending: red means "not in use", not "broken"
     incomplete -> red     the same answer - it cannot send as it stands
     empty      -> grey    nothing entered, nothing to say
   DECLARED HERE, WITH THE OTHER FAMILIES, and that placement is the fix: these rules first sat above .badge,
   which sets color and background of its own - so at equal specificity the later generic rule won and every
   tone came out grey (owner's report 26-09-2026). Each badge still carries its own word, so the colour is
   never the only signal (framework §9). */
.badge-mail-in-use{color:#c8ffe1;border-color:rgba(var(--ok-rgb),.34);background:rgba(var(--ok-rgb),.16)}
.badge-mail-fallback{color:#ffefbf;border-color:rgba(var(--warn-rgb),.38);background:rgba(var(--warn-rgb),.18)}
.badge-mail-ready{color:#ffd7d7;border-color:rgba(var(--err-rgb),.42);background:rgba(var(--err-rgb),.16)}
.badge-mail-incomplete{color:#ffd7d7;border-color:rgba(var(--err-rgb),.42);background:rgba(var(--err-rgb),.16)}
.badge-mail-empty{color:var(--muted);border-color:var(--border);background:var(--hover)}
/* A badge that navigates (e.g. GL account -> its bank account). */
a.badge.badge-link{cursor:pointer;text-decoration:none}
a.badge.badge-link:hover{border-color:rgba(var(--accent-rgb),.5)}
.muted{
  display:block;
  color:var(--mute);
  margin-top:4px;
  font-size:12px;
}
/* .muted is a BLOCK by default, which is right where it explains the thing above it. On a totals row
   the breakdown belongs on the same line as the total it explains, so this modifier keeps it inline
   (owner's request 25-08-2026). Same colour and size - only the flow changes. */
.muted.is-inline{display:inline;margin-top:0}
/* A ROLLED-UP FIGURE reads quieter than a posted one, and that is ALL it changes: `.muted` is a
   display:block note-under-a-figure and would take a table cell out of its column. */
.is-rollup{color:var(--mute)}
.field-note{
  display:block;
  color:var(--mute);
  margin-top:2px;
  font-size:12px;
  font-weight:400;
}
/* A FIELD'S OWN ERROR, beside the field rather than in a flash band at the top (framework
   section 5: inline, specific, near the field; never silently fail). Shared, not site-only: the
   public pages have no flash band at all, and any form here can use it. Paired with
   [aria-invalid] on the control, so the state is not colour alone (section 9). */
.field-error{display:block;margin-top:3px;font-size:12px;font-weight:500;color:rgb(var(--err-rgb))}
.field input[aria-invalid="true"],.field select[aria-invalid="true"],.field textarea[aria-invalid="true"],
.st-field input[aria-invalid="true"],.st-field select[aria-invalid="true"],.st-field textarea[aria-invalid="true"]{
  border-color:rgb(var(--err-rgb))}
.base-amount-hint{display:block;margin-top:6px;font-size:13px;font-weight:800;color:var(--soft)}
.base-amount-hint:empty{display:none}
/* Field help: a "?" after a label opens a floating bubble with on-demand help. */
.field-help{position:relative;display:inline-flex;vertical-align:middle;margin-left:4px}
.field-help-btn{
  width:16px;height:16px;flex:none;padding:0;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--border);border-radius:var(--r-pill);
  background:var(--surf-2);color:var(--mute);
  font:800 11px/1 var(--font);cursor:pointer;
}
.field-help-btn:hover{color:var(--text);border-color:var(--border-soft)}
.field-help-btn[aria-expanded="true"]{color:var(--cyan);border-color:var(--cyan)}
.help-bubble{
  position:absolute;z-index:50;top:24px;left:0;
  width:min(300px,78vw);
  padding:10px 12px;
  background:var(--bg-2);border:1px solid var(--border);
  border-radius:var(--r);box-shadow:var(--shadow-2);
  color:var(--text);font:400 13px/1.6 var(--font);
  text-align:left;white-space:normal;cursor:default;
}
/* Hangs from the right when opening leftwards would run off the page - set by the layout script,
   which measures the bubble rather than guessing from where its icon sits. */
.help-bubble.flip-left{left:auto;right:0}
.help-bubble strong{display:block;margin-bottom:4px;font-weight:800}
.help-bubble .help-b{display:block;position:relative;padding-left:14px;margin-top:6px}
.help-bubble .help-b::before{content:"\2022";position:absolute;left:3px;color:var(--mute)}
.help-bubble .help-note{display:block;margin-top:8px;color:var(--mute)}
tr.row-inactive td{opacity:.55}
tr.row-inactive td.row-actions{opacity:1}
.coa-group{border:1px solid var(--border);border-radius:var(--r);background:var(--panel);overflow:hidden}
.coa-group>summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:13px 16px;cursor:pointer;list-style:none;font-weight:800}
.coa-group>summary::-webkit-details-marker{display:none}
.coa-group>summary::before{content:"\25B8";font-size:11px;color:var(--mute);transition:transform .15s ease}
.coa-group[open]>summary::before{transform:rotate(90deg)}
.coa-group>summary:hover{background:var(--panel-2)}
.coa-root-code{color:var(--mute);font-variant-numeric:tabular-nums}
/* min-content, not 0: the group name is a single word ("Expenses", "Liabilities"), so a flex
   basis of 0 squeezed the box to ~24px and the word - which has nothing to wrap at - spilled
   straight out of it on a phone. Holding the longest word makes the summary WRAP instead. */
.coa-root-name{flex:1 1 auto;min-width:min-content}
.coa-root-count{color:var(--mute);font-size:12px;font-weight:600;white-space:nowrap}
.coa-group .table-wrap{margin:0;border-top:1px solid var(--border)}
.coa-group>.empty{padding:13px 16px;margin:0}
/* A level-3 account sits indented under its sub-account, with a tree connector, so the hierarchy reads. */
.coa-row-child td.coa-name-cell{padding-left:30px;position:relative}
.coa-tree-mark{position:absolute;left:11px;color:var(--mute);font-size:13px;line-height:1}
.locked-field{display:flex;gap:8px;align-items:center}
.locked-field>select,.locked-field>input,.locked-field>textarea{flex:1;min-width:0}
/* A locked field's control + pencil must stay clickable even inside a checkbox label, whose
   pointer-events the "click only the control" rule (pointer:fine, below) zeroes out. */
.locked-field,.locked-field *{pointer-events:auto}
/* A locked boolean keeps the checkbox + its pencil inline (not a full-width flex column) at natural
   size - in the generic settings form and the bespoke organisation forms alike. */
.locked-field:has(> input[type="checkbox"]){display:inline-flex;flex:none}
.locked-field>input[type="checkbox"]{flex:none}
.lock-edit{flex:none;width:38px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:var(--r);background:var(--panel);color:var(--mute);cursor:pointer}
.lock-edit:hover{color:var(--text)}
.more-options{grid-column:1 / -1;border-top:1px solid var(--border);padding-top:6px}
.more-options>summary{cursor:pointer;list-style:none;font-weight:800;color:var(--mute);padding:8px 0;display:inline-flex;align-items:center;gap:8px}
.more-options>summary::-webkit-details-marker{display:none}
.more-options>summary::before{content:"\25B8";font-size:11px;transition:transform .15s ease}
.more-options[open]>summary::before{transform:rotate(90deg)}
.more-options>.form-grid{margin-top:12px}
.month-switcher{display:grid;grid-template-columns:1fr auto 1fr;align-items:stretch;gap:10px;margin-bottom:18px}
/* Quick-add bar: one inline draft-entry form per group (Expenses / Income) on the monthly view.
   Labels sit ABOVE their field (the app-wide label grid), so the required * and ? help mirror the
   full entry form. Fields bottom-align so the inputs and the Add button share a baseline. Wraps to
   stacked on mobile. */
.quick-add{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 10px;margin:0;padding:12px;border:1px solid var(--border);border-radius:var(--r-lg);background:var(--bg-2)}
.quick-add label{margin:0}
.quick-add .quick-add-cat{flex:1 1 200px}
.quick-add .quick-add-amount{flex:0 1 150px}
.quick-add .quick-add-details{flex:1 1 200px}
.quick-add select,.quick-add input{width:100%}
/* The add form lives in a full-width row at the foot of its group; the cell just frames it. */
.quick-add-row > td{padding:8px;background:var(--bg)}
@media (max-width:680px){
  .quick-add{flex-direction:column;align-items:stretch}
  .quick-add label,.quick-add .quick-add-cat,.quick-add .quick-add-amount,.quick-add .quick-add-details{flex:1 1 auto}
  .quick-add button{width:100%}
}

.month-nav{display:flex;flex-direction:column;justify-content:center;gap:3px;padding:12px 16px;border:1px solid var(--border);border-radius:var(--r);background:var(--panel);color:var(--mute);text-decoration:none}
/* THE SAME HOVER A CLICKABLE TILE HAS (owner's request 25-08-2026). Previous/Next are tiles that
   open something, exactly like .stat-link, and they were the only ones answering a hover with a
   quieter effect than the tiles beside them - so they read as less clickable than they are. Same
   brand tint, same cyan border, and focus-visible included so a keyboard sees what a mouse does. */
.month-nav:hover,.month-nav:focus-visible{color:var(--text);background:rgba(var(--brand-rgb),.16);border-color:var(--cyan)}
/* At the edge of the books there is nowhere to go: the arrow keeps its shape so the row does not
   reflow, and LOOKS disabled (framework §5 - a disabled control must look disabled). It is a <span>,
   so it is already unclickable and unfocusable; this is the visual half of that. */
.month-nav.is-disabled{opacity:.45;cursor:not-allowed}
.month-nav.is-disabled:hover,.month-nav.is-disabled:focus-visible{color:var(--mute);background:var(--panel);border-color:var(--border)}
.month-nav.next{align-items:flex-end;text-align:right}
.month-nav-dir{font-size:11px;font-weight:800}
.month-nav-label{font-size:14px;font-weight:800}
/* The centre of the switcher IS the month/year jump - a violet-accented card holding the two
   selects and a Go, so there is one control instead of a static label above a separate jump row. */
/* THE MONTH YOU ARE ON, SAID IN COLOUR (owner's request 25-08-2026). It sat between Previous and
   Next in the same quiet panel tone, so the one tile that is not a link looked like the two that
   are. Cyan because the app already answers [aria-current="page"] in cyan (see .topbar-crumbs), and
   this form carries that attribute - a third accent for the same idea is how a palette drifts.
   The border was violet; it is cyan now so the tile speaks with one colour rather than two. */
.month-current{display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 14px;border:1px solid var(--cyan);border-radius:var(--r);background:rgba(var(--brand-rgb),.16);margin:0}
.month-current select{color:var(--cyan)}
.month-current label{margin:0;min-width:0}
.month-current select{min-width:0;font-weight:800}
.month-current .button{flex:0 0 auto}
@media (max-width:560px){
  /* THREE COLUMNS DO NOT FIT A PHONE (fixed 04-09-2026). The switcher kept `1fr auto 1fr` all the
     way down, and the centre cell holds two selects and a Go - so it claimed ~196px of 375 and left
     the arrows about 70px each. "August 2026" and "Nothing later" then broke over three lines apiece
     and the navigator stood 150px tall, on the densest page in the app.
     Shrinking the type (the rules below) treated the symptom; the constraint is the column count. So
     the month picker takes a full-width row of its own and the two arrows share the row beneath it -
     each then has half the width for a label that was never going to fit a third of it. */
  .month-switcher{grid-template-columns:1fr 1fr}
  .month-current{grid-column:1 / -1;order:-1}
  .month-current{padding:6px 8px;gap:6px;flex-wrap:wrap}
  .month-nav{padding:10px 12px}
  .month-nav-label{font-size:12px}
  .month-nav-dir{font-size:10px}
}
/* Required marker (user decision 2026-07-05, framework §5): ANY label whose control is
   required gets a red asterisk automatically - one CSS rule, no per-field markup, so no
   form can forget it. Works for plain inputs, selects, textareas, the date picker and
   comboboxes (the real control keeps the required attribute inside the label). */
.form-grid label:has([required]) > span:first-child::after,
.form-grid label:has([data-required]) > span:first-child::after,
label:has(> [required]) > span:first-child::after,
label:has([data-required]) > span:first-child::after{
  content:" *";
  color:rgb(var(--err-rgb));
  font-weight:800;
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:14px 16px;
  align-items:start; /* cells size to content + top-align, so inputs line up across a row even
                        when one field carries a note or a longer label underneath */
}
/* Field span on a 12-col grid. Default is half-width; short fields auto-size to a compact
   span by their control type (via :has) so small values don't get long boxes - this covers
   bespoke and config-driven forms with no per-field markup. .field-* are explicit escape
   hatches; .wide / a textarea span the full row. Collapses to one column on small screens. */
.form-grid > label{grid-column:span 6}
.form-grid > label:has(.js-money),
.form-grid > label:has(.js-base-amount),
.form-grid > label:has(.js-currency-select),
.form-grid > label:has(.js-pay-via),
.form-grid > label:has(.date-picker),
.form-grid > label:has(input[type="number"]){grid-column:span 3}
.form-grid > label:has(textarea),
.form-grid > .wide{grid-column:1 / -1}
/* A FORM'S BUTTON ROW AND ITS NOTES SPAN THE GRID, whatever class the page remembered to add (owner's walk 15-10-2026).
   Only label and .wide children had a column rule, so a .form-actions without .wide fell into the grid's 1/12 track:
   every action button on the CRM record pages rendered 61px wide with its label spilling out of it. One rule here
   rather than a .wide sprinkled on each page - the trap is in the grid, so the fix is too. */
.form-grid > .form-actions,
.form-grid > .form-note{grid-column:1 / -1}
/* A ONE-FIELD ACTION FORM: the field and its button on one line (CRM record panels - assign, change status,
   dismiss, move stage, owner, reschedule). On the grid the button took a row of its own at the far edge, so
   the panel read as loose fields and stray buttons. Still .form-grid, so the searchable select and the
   required marker apply; flex lays it out and wraps on a narrow screen. Stacked forms get air between them. */
.form-grid.action-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 14px;margin-top:16px}
.form-grid.action-form > label{flex:1 1 240px;max-width:420px;min-width:0}
.form-grid.action-form > label.wide{max-width:none;flex-basis:320px}
.form-grid.action-form > .form-actions{flex:0 0 auto;margin:0}
/* BLOCKS IN A PANEL NEVER TOUCH (owner's walk 15-10-2026). A form placed after a detail grid, a table or another
   form inherited no margin, so the timeline's "Add a note", the reschedule form and the schedule-activity form sat
   flush against what came before them. */
.panel > .form-grid + .form-grid,
.panel > .table-wrap + .form-grid,
.panel > .detail-grid + form{margin-top:16px}
/* Explicit widths OUTRANK the :has() auto-sizing (label.field-* ties :has specificity,
   later source order wins) - a declared width is a decision, not a hint. */
.form-grid > label.field-sm,.form-grid > .field-sm{grid-column:span 3}
.form-grid > label.field-md,.form-grid > .field-md{grid-column:span 4}
.form-grid > label.field-lg,.form-grid > .field-lg{grid-column:span 6}
.form-grid > .field-xl{grid-column:span 8}
/* Grouped form sections (fieldsets) read as soft rounded cards, not the browser's square groove. */
.panel fieldset{
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  background:var(--surf-1);
  padding:14px 16px;
  margin:0;
  min-width:0;
}
.panel fieldset > legend{
  padding:0 8px;
  font-size:12px;
  font-weight:800;
  color:var(--mute);
}
/* Monthly-view group box: wraps related sections (Income & expenses, Bank transfers) in one
   labelled box like the transfer form's field groups. Inner panels go flat so it reads as a
   single box holding subsections, not boxes nested in a box. */
.month-group{
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  background:var(--surf-1);
  padding:6px 16px 14px;
  margin:0 0 18px;
  min-width:0;
}
.month-group > legend{
  padding:0 8px;
  font-size:12px;
  font-weight:800;
  color:var(--mute);
}
.month-group > .panel{
  background:none;
  border:0;
  border-radius:0;
  box-shadow:none;
  backdrop-filter:none;
  padding:10px 0;
  margin:0;
}
.month-group > .panel + .panel{border-top:1px solid var(--border)}
/* Schedule End date/Repeats pair, revealed by the "Set an end…" toggle - its own compact flex row. */
.js-end-fields{display:flex;flex-wrap:wrap;gap:14px 16px;align-items:start;margin-top:10px}
.js-end-fields > label{flex:0 1 200px;min-width:0}
.js-end-toggle{align-self:start;margin-top:2px}
/* A group of related fields kept together on their own line (e.g. the money block:
   Amount · Currency · [Exchange rate] · Amount in base). Flexbox so widths can differ and
   still fill the row with no gaps: fields grow equally by default; .field-narrow (the rate)
   is slimmer and .field-wide (amount in base) grows more so its note fits on one line.
   Wraps on small screens. */
.form-grid > .field-row{
  grid-column:1 / -1;
  display:flex;
  flex-wrap:wrap;
  gap:14px 16px;
  align-items:start;
}
.field-row > label{flex:1 1 150px;min-width:0}
/* THE SETTLEMENT ROW: two narrow fields and one wide one (owner's request 02-09-2026). "Amount you
   pay" and "Paid via" hold a figure and a word; the account beside them holds "GLE11101 - Everyday
   current" and was being clipped while its two neighbours sat half empty - three equal thirds is the
   flex default, not a decision anyone made.

   A GRID, not flex bases, so the two narrow fields are EXACTLY as wide as a date or money field
   elsewhere on the form rather than approximately: the form is 12 columns and a date picker spans 3,
   so these span 3 and the account takes the remaining 6. A percentage would have come out ~12px
   wider, which reads as "nearly the same" - the thing the owner would notice. Same gap as the form
   grid, so the row sits in the same rhythm. */
.field-row.settle-row{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px 16px}
.field-row.settle-row > label{grid-column:span 3}
.field-row.settle-row > label:last-child{grid-column:span 6}
/* Inside a flex field-row the grid span classes don't apply - map the sm width to a compact,
   content-sized flex basis (e.g. the Type picker beside Category on the recurring forms). */
.field-row > label.field-sm{flex:0 1 10rem}
.detail-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
/* Preview groups: the fields in a group box sit on ONE line, sharing the width, and wrap only when
   the row gets too narrow (mobile). Used by the posting-preview screens. */
.preview-line{display:flex;gap:12px;flex-wrap:wrap}
.preview-line > .detail-item{flex:1 1 140px;min-width:0}
/* The date shown inline with a panel title. */
.panel-head .head-meta{color:var(--mute);font-size:13px;font-weight:700;white-space:nowrap}
.detail-item{
  display:grid;
  gap:6px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--surf-1);
  min-width:0;
}
.detail-item.wide{grid-column:1/-1}
/* INLINE label and value, on ONE line - for values that are only a date, an amount or a status.
   Stacking "Disbursed" above "13-09-2025" spends two lines on eleven characters, and a section of
   them reads as a form rather than a record (owner's review of the loan document, 04-11-2026).
   One shared modifier, so the next page that wants it opts in rather than writing its own rule.
   Both sides are held to one line: the label never wraps (framework §5) and neither does the value,
   which is what keeps a date from breaking across two lines (§12). Long prose keeps .wide. */
.detail-item.inline{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
}
.detail-item.inline > span{white-space:nowrap}
.detail-item.inline > strong{white-space:nowrap;text-align:end;overflow-wrap:normal}
/* A group inside a detail grid spans the row: .preview-line lays its fields out on one line, and a
   .detail-group is the view's echo of the form's fieldset (same soft card as .panel fieldset). Both
   are grid CHILDREN, so without this they collapse into one of the two columns - the same trap the
   form grid documents for its own non-label children. */
.detail-grid > .preview-line,
.detail-grid > .detail-group{grid-column:1/-1}
.detail-group{border:1px solid var(--border);border-radius:var(--r);padding:12px 14px;margin:0}
/* THE PIPELINE BOARD (CRM, ADR 0195). One column per open stage, cards inside. Mobile-first: columns stack to one,
   then flow into as many 240px columns as fit, so a phone reads it top to bottom and a desktop reads it across. Cards
   reuse the surface and border tokens - nothing here is a colour of its own. */
.pipeline{display:grid;grid-template-columns:1fr;gap:10px;align-items:start}
@media(min-width:680px){.pipeline{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}}
.pipeline-col{background:var(--surf-1);border:1px solid var(--border-soft);border-radius:var(--r);padding:10px;min-width:0}
.pipeline-col > header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px;margin-bottom:8px}
.pipeline-col > header strong{font-size:14px}
.pipeline-card{background:var(--surf-2);border:1px solid var(--border-soft);border-radius:var(--r);padding:8px 10px;margin-top:8px;min-width:0}
.pipeline-card h3{margin:0 0 2px;font-size:14px;overflow-wrap:anywhere}
.pipeline-card .muted{display:block;font-size:12px}
.pipeline-card form{margin-top:6px}
.pipeline-card select{width:100%}

.detail-group > legend{padding:0 6px;color:var(--mute);font-size:12px;font-weight:700;text-transform:none}
/* Bare label/value detail rows (POS receipt + shift, appointment view): the label sits on its own
   line above the value, muted - without this the two inline spans render mashed ("CustomerJordan
   Ellis"), worst on mobile. Distinct from the bordered .detail-item card. */
.detail-label{display:block;color:var(--mute);font-size:.8rem;margin-bottom:1px}
/* Document header meta (invoice/RFQ: the number + date opposite the issuer). Aligns to the end edge
   (right in LTR, left in RTL) beside the issuer on desktop; on mobile the header stacks, so it aligns
   to the start edge to sit under the issuer instead of floating off to the side. */
.doc-head-meta{text-align:end}
/* Compact variant: small boxes sized to their content (an arrangement's terms), packing several per
   row instead of two big cards. Auto-fill so short values don't stretch into oversized boxes. */
.detail-grid.compact{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:8px}
.detail-grid.compact .detail-item{padding:7px 10px;gap:2px}
.detail-grid.compact .detail-item span{font-size:11px}
.detail-grid.compact .detail-item strong{font-size:13px;line-height:1.3}
/* Plan terms: reference (compact) + partner (fills the line) on row 1, then the four short terms on
   row 2. Four equal columns; the partner cell spans the three after the reference. */
.detail-grid.plan-terms{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.detail-grid.plan-terms .detail-item{padding:7px 10px;gap:2px}
.detail-grid.plan-terms .detail-item span{font-size:11px}
.detail-grid.plan-terms .detail-item strong{font-size:13px;line-height:1.3}
.detail-grid.plan-terms .col-partner{grid-column:span 3}
.detail-item span{
  color:var(--mute);
  font-size:12px;
  font-weight:800;
}
.detail-item strong{
  color:var(--soft);
  font-size:14px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.event-list{
  display:grid;
  gap:10px;
}
.event-item{
  display:grid;
  gap:6px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--surf-1);
}
.event-item div{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.event-item strong{color:var(--soft)}
.event-item span{color:var(--cyan);font-size:13px;font-weight:800}
.event-item p{margin:0}
.setup-steps{
  display:grid;
  gap:10px;
  margin:0;
  padding:0;
  list-style:none;
}
.setup-steps li{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  padding:12px;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--surf-1);
}
.setup-steps li > div{min-width:0}
.setup-steps strong{color:var(--soft);display:block}
.setup-steps p{margin:4px 0 0;color:var(--mute);font-size:13px}
.setup-steps .step-done{color:var(--lime);font-weight:800;font-size:13px}
.setup-steps .step-wait{color:var(--mute);font-size:13px}
.rate-cell{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
/* What the provider says, under a rate an override is winning on (walkthrough 19-09-2026). Quiet: the
   comparison is information and a deliberate override is the normal case on these books. .is-warn tones the
   drift figure when the override has moved far from the market, using the status token like every other tone. */
.rate-compare{margin:4px 0 0;font-size:12px;color:var(--muted);display:flex;gap:6px;flex-wrap:wrap;align-items:baseline}
.rate-drift{font-weight:800;white-space:nowrap}
.rate-compare.is-warn .rate-drift{color:rgb(var(--warn-rgb))}
/* An explicit display (.button / .rate-edit-form / label{display:grid}) would otherwise
   defeat [hidden]; enforce the HTML semantic globally. */
[hidden]{display:none !important}
/* .filter-toolbar RIDES ON THE SAME RULES (owner's report 06-09-2026). It is a class three pages use
   for a small GET filter - the revaluation's "As at", a reconciliation's date range, an entity group's
   search - and it had NO layout of its own at all. Unstyled, its <label> was a block: the caption sat
   on one line, the date field spanned the full width beneath it, and the button dropped to a third
   line. Aliased rather than given a second implementation of the same idea, so both kinds of toolbar
   keep one row on a desktop, one column on a phone, and one set of field widths. */
.list-toolbar,.filter-toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
/* Its label is a plain <label> rather than .list-toolbar-field, so it needs the same shape. */
.filter-toolbar label{display:flex;align-items:center;gap:8px;margin:0}
.filter-toolbar label > span{color:var(--mute);font-size:12px;font-weight:800;white-space:nowrap}
/* A DATE FIELD IS AS WIDE AS A DATE. The shared picker is display:block, so in a flex row it took
   whatever space was going - 205px for "31-08-2026". 150px is the width the rate editor already uses
   for the same control, so the two agree. The 44px of padding the picker reserves for its calendar
   button is inside that. */
.filter-toolbar .date-picker{width:150px}
.list-toolbar-label{color:var(--mute);font-size:12px;font-weight:800}
.list-toolbar-field{display:flex;align-items:center;gap:8px;margin:0}
.list-toolbar-field > span{color:var(--mute);font-size:12px;font-weight:800;white-space:nowrap}
.list-toolbar select,.filter-toolbar select{width:auto;min-width:130px}
/* One-row budget: dropdowns and dates take fixed slices, search flexes into the rest,
   the button never wraps to its own line. */
.list-toolbar .combo,.list-toolbar .ss{flex:0 1 190px;min-width:140px}
/* Currency values are 3-letter codes - a narrow combo keeps the toolbar on one row so the Clear
   button fits without wrapping. */
.list-toolbar-field:has([name="currency"]) .combo{flex:0 1 110px;min-width:88px}
/* A dropdown of single short words (Active / Ended / All) - filter_toolbar()'s 'narrow' flag. */
.list-toolbar-field.is-narrow .combo,.list-toolbar-field.is-narrow .ss{flex:0 1 90px;min-width:80px}
/* A toolbar of four short dropdowns needs the search box to give way before the button wraps: it
   starts smaller and still grows into any room left (the pledges toolbar, 1280px with the menu open). */
.list-toolbar:has(.is-narrow) .list-toolbar-search{flex-basis:110px;min-width:100px}
/* A DATE FILTER IS AS WIDE AS A DATE (the pledges' Last date paid, 11-09-2026) - the shared picker is a
   block and otherwise took 200px of a toolbar that has none to spare. The calendar button is inside. */
.list-toolbar .list-toolbar-field .date-picker{width:134px;flex:0 0 134px}
/* A planned line break (filter_toolbar 'wrap_before'): invisible while the whole toolbar fits on one
   row, a full-width break when it does not. Measured against the toolbar itself (a container query),
   so it answers "does it fit HERE" - with or without the side menu - not the window width. */
.list-toolbar{container-type:inline-size}
.list-toolbar-break{display:none}
@container (max-width:1150px){.list-toolbar-break{display:block;flex-basis:100%;height:0}}
.list-toolbar input[type=search]{width:auto;flex:1 1 150px;min-width:130px;max-width:340px}
/* Clearable search box: an × sits inside the box once a term is searched; suppress the browser's
   own native clear widget so there's only one. */
.list-toolbar-search{position:relative;display:flex;align-items:center;flex:1 1 150px;min-width:130px;max-width:340px}
.list-toolbar-search input[type=search]{flex:1;width:100%;min-width:0;max-width:none;padding-right:30px}
.search-clear{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:var(--mute);text-decoration:none;font-size:15px;font-weight:700;line-height:1}
.search-clear:hover{background:var(--panel-2);color:var(--text)}
input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none}
/* NOT THE PICKER'S OWN OVERLAY. .js-date-native is an absolutely-positioned input pinned to the
   right of the shared date picker - 1x1 and invisible on a desktop, stretched to the whole field on
   a touch device so a tap opens the OS picker. It is a HIT AREA, not a field. Sized to 126px by this
   rule it covered most of the box and drew its own calendar glyph beside the styled one: two icons
   in one date field (measured at 375px, 06-09-2026, caused by aliasing .filter-toolbar onto these
   rules). This width is for a bare date input in a toolbar, which is what the shared filter_toolbar()
   helper renders; the picker sizes itself. */
.list-toolbar input[type=date]:not(.js-date-native),
.filter-toolbar input[type=date]:not(.js-date-native){width:126px;min-width:0}
/* A readonly field that a pencil button unlocks for editing (e.g. a bank account's opening balance). */
.field-lock{display:flex;gap:8px;align-items:stretch}
.field-lock input{flex:1 1 auto;min-width:0}
.field-lock-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:40px;background:transparent;border:1px solid var(--border);border-radius:var(--r-lg);color:var(--mute);cursor:pointer}
.field-lock-toggle:hover{color:var(--text);border-color:var(--cyan)}
/* Plain-text email preview (partner notification review). */
.email-preview{white-space:pre-wrap;word-break:break-word;font:13px/1.6 ui-monospace,"SF Mono",Menlo,Consolas,monospace;background:var(--panel);border:1px solid var(--border);border-radius:var(--r-lg);padding:14px 16px;margin:0 0 16px;color:var(--soft);overflow-x:auto}
.rate-edit{
  display:inline-flex;align-items:center;justify-content:center;
  width:26px;height:26px;padding:0;
  border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--panel);color:var(--mute);cursor:pointer;
}
.rate-edit:hover{color:var(--text);border-color:rgba(255,255,255,.24)}
.rate-edit:focus-visible{outline:none;border-color:var(--cyan);box-shadow:0 0 0 3px rgba(var(--info-rgb),.12)}
.rate-edit-form{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.rate-edit-form input[name=rate]{width:140px}
/* The rate's effective date sits beside it in the inline editor; the shared picker is used so
   dates read and parse the same here as everywhere else (§12). */
.rate-edit-form .rate-date-field .date-picker{width:150px}
.date-picker{
  position:relative;
  display:block;
}
.date-picker .js-date-display{
  padding-right:44px;
}
.date-picker .js-date-native{
  position:absolute;
  right:0;
  bottom:0;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
/* Touch devices: the native date input covers the whole field so a TAP opens the OS date picker
   directly (a button → showPicker() is unreliable on iOS PWAs). It's transparent, so the formatted
   dd-mm-yyyy text shows through beneath it. */
@media (pointer: coarse){
  .date-picker .js-date-native{
    inset:0;
    width:100%;
    height:100%;
    pointer-events:auto;
    z-index:2;
    cursor:pointer;
    -webkit-appearance:none;
    appearance:none;
    /* iOS won't open the picker for an opacity:0 input, so keep it RENDERED (opacity 1) but make it
       invisible via transparent text/background/border - the dd-mm-yyyy text shows through beneath. */
    opacity:1;
    background:transparent;
    border:0;
    color:transparent;
  }
  .date-picker .js-date-native::-webkit-date-and-time-value{color:transparent}
  /* Keep the locked (readonly) date field un-tappable so a computed End date can't be changed. */
  .js-locked .date-picker .js-date-native{pointer-events:none;z-index:0}
}
.date-picker-button{
  position:absolute;
  right:6px;
  top:50%;
  width:32px;
  height:32px;
  min-height:32px;
  transform:translateY(-50%);
  border:0;
  border-left:1px solid var(--border);
  background:transparent;
  color:var(--cyan);
  cursor:pointer;
}
.date-picker-button::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:15px;
  height:14px;
  transform:translate(-50%,-45%);
  border:2px solid currentColor;
  border-radius:3px;
}
.date-picker-button::after{
  content:"";
  position:absolute;
  left:50%;
  top:9px;
  width:11px;
  height:2px;
  transform:translateX(-50%);
  background:currentColor;
  box-shadow:-4px -3px 0 -1px currentColor,4px -3px 0 -1px currentColor;
}
.date-picker-button:hover{color:var(--soft)}
.date-picker-button:focus-visible{
  outline:2px solid var(--cyan);
  outline-offset:2px;
  border-radius:var(--r-sm);
}
label{display:grid;gap:7px;color:var(--mute);font-size:12px;font-weight:800}
label span{letter-spacing:.05em}
/* A field label always sits on ONE line (framework §5): the label text, its (optional) hint and the
   ? help icon never wrap onto a second line - a field is widened to fit its label instead of letting
   the label break. Covers both the label caption (label > span) and standalone group captions
   (.field-label, e.g. "Lines", "Requested items"). The ? help bubble is absolutely positioned and
   white-space:normal, so its own text still wraps normally. Checkbox/radio label text is exempt (it
   can be a longer sentence next to the box) - those live in .check-field / .check-inline / .role-row. */
label > span:first-child,
.field-label{white-space:nowrap}
/* .muted is display:block globally, which would push a label's "(optional)" hint onto its own line
   despite the nowrap - inside a label caption it stays inline on the same single line. */
label > span:first-child .muted,
label > span:first-child small{display:inline;margin-top:0}
label small{color:var(--mute);font-weight:600;line-height:1.4;text-transform:none;letter-spacing:0}
.check-field{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:42px;
  padding:10px 0;
}
/* Partner categories (roles): a tidy list of role rows - each a checkbox + a "Primary" radio. */
.role-grid{display:flex;flex-direction:column;gap:8px;margin-top:6px;max-width:520px}
.role-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 12px;border:1px solid var(--border);border-radius:var(--r);background:var(--surf-1)}
.role-row .role-name{margin:0;flex:1 1 auto}
.role-primary{display:inline-flex;align-items:center;gap:6px;color:var(--mute);font-size:12px;font-weight:600;white-space:nowrap}
.role-primary input{width:16px;min-height:16px;accent-color:var(--lime)}
/* Primary only matters for a ticked role - dim it until the role is selected. */
.role-row:has(.role-name input:not(:checked)) .role-primary{opacity:.4}
.check-field input{width:18px;min-height:18px;accent-color:var(--lime)}
/* Form controls, app-wide: comfortable size, brand-green tick, clear keyboard focus. */
input[type="checkbox"],input[type="radio"]{width:17px;height:17px;accent-color:var(--lime);cursor:pointer}
input[type="checkbox"]:focus-visible,input[type="radio"]:focus-visible{outline:2px solid rgba(var(--brand-rgb),.75);outline-offset:2px}
/* A selectable row (packages, partner roles) lifts on hover and highlights when ticked. */
.role-row{transition:border-color .15s,background .15s}
.role-row:hover{border-color:var(--soft)}
.role-row:has(> input[type="checkbox"]:checked),.role-row:has(> .role-name > input[type="checkbox"]:checked){border-color:rgba(var(--ok-rgb),.45);background:rgba(var(--ok-rgb),.08)}
/* A checkbox/radio toggles ONLY when its own control is clicked with a MOUSE - not the label text or
   the surrounding row (user preference 2026-07-07). The label stays associated (screen readers +
   keyboard Space still work); pointer-events just narrows the mouse hit area to the control, while the
   inline help button stays clickable. On touch devices the whole label stays tappable (an 18px target
   is too small for a finger). */
@media (pointer: fine){
  .check-field,label:has(> input[type="checkbox"]),label:has(> input[type="radio"]){pointer-events:none}
  .check-field > input,.check-field .field-help-btn,
  label:has(> input[type="checkbox"]) > input,label:has(> input[type="radio"]) > input{pointer-events:auto}
}
/* When a checkbox shares a grid row with a taller field (e.g. Active beside Details), centre it
   vertically rather than letting it float at the top. Harmless when it's alone on its row. */
.form-grid > label.check-field{align-self:center}
input,select,textarea{
  width:100%;
  min-height:42px;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--field);
  color:var(--text);
  padding:10px 11px;
  outline:none;
}
textarea{resize:vertical}
/* Auto-growing textarea: starts one line, grows to fit its content (JS sets the height). */
textarea.js-autogrow{resize:none;overflow:hidden}
/* Inline "(optional)" marker that stays on the label line (unlike .muted, which is block). */
.field-optional{font-weight:600;color:var(--mute);font-size:11px;letter-spacing:0}
/* Searchable select (combobox): a filter input over a floating option list. */
.combo{position:relative}
.combo-input{width:100%}
.combo-list{
  position:absolute;z-index:50;top:calc(100% + 4px);left:0;right:0;
  margin:0;padding:4px;list-style:none;max-height:240px;overflow:auto;
  background:var(--bg-2);border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow-2);
}
.combo-option,.combo-empty{padding:8px 10px;border-radius:var(--r-sm);font-size:14px}
.combo-option{cursor:pointer}
.combo-option:hover,.combo-option.active{background:var(--hover)}
.combo-empty{color:var(--mute);cursor:default}
/* Searchable native <select> (enhanced in place - the real select stays the source of truth,
   visually hidden, while this overlay provides type-to-filter). */
.ss{position:relative;flex:1 1 auto;min-width:0}
.locked-field>.ss{flex:1}
.ss-native{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}
.ss-input{width:100%}
.ss-disabled .ss-input{opacity:.6;cursor:not-allowed;background:var(--surf-1)}
/* Dropdown chevron so a searchable combobox still reads as a "choose from a list" field (like a
   native select) - masked SVG takes the muted token colour, adapting to dark/light. Text clears it
   via padding-right. Hidden while a combo is locked/disabled (nothing to drop down yet). */
.combo::after,.ss::after{
  content:"";position:absolute;right:11px;top:50%;width:11px;height:7px;
  transform:translateY(-50%);pointer-events:none;background-color:var(--mute);
  -webkit-mask:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  mask:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
}
.combo-input,.ss-input{padding-right:30px}
.ss-disabled::after{display:none}
.ss-list{
  position:absolute;z-index:50;top:calc(100% + 4px);left:0;right:0;
  margin:0;padding:4px;list-style:none;max-height:240px;overflow:auto;
  background:var(--bg-2);border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow-2);
}
.ss-option{padding:8px 10px;border-radius:var(--r-sm);font-size:14px;cursor:pointer}
.ss-option:hover,.ss-option.active{background:var(--hover)}
/* Touch devices: comfortable tap targets for the searchable-dropdown rows, the "?" help and
   the row "⋯" trigger (kept compact on mouse/pointer-fine devices). */
@media (pointer:coarse){
  .combo-option,.combo-empty,.ss-option,.row-menu-item{min-height:var(--tap);display:flex;align-items:center}
  .field-help-btn{width:24px;height:24px;font-size:13px}
  /* These sat below the target the block itself already used: the row overflow trigger at 36px,
     the pencil that unlocks a locked field at 38x40, and small buttons at 40px. */
  .row-menu-trigger{min-height:var(--tap);min-width:var(--tap)}
  .lock-edit{width:var(--tap);min-height:var(--tap)}
  .button.small{min-height:var(--tap)}
  .check-field{min-height:var(--tap)}
  /* A checkbox/radio itself, not just its row - the label is tappable, the control should be too. */
  input[type="checkbox"],input[type="radio"]{min-width:22px;min-height:22px}
}
/* Native selects: force the field fill over any UA dark-scheme painting. */
select{background-color:var(--field)}
/* iOS paints a grey box over any tapped element. Suppress it and give tappable things their own
   pressed state, so the feedback is intentional rather than a UA artefact - or missing. */
html{-webkit-tap-highlight-color:transparent}
.button:active,.row-menu-item:active,.row-menu-trigger:active,.lock-edit:active,
.combo-option:active,.ss-option:active,.month-nav:active,.record-link:active{
  filter:brightness(.92);
}
input:focus,select:focus,textarea:focus{border-color:var(--cyan);box-shadow:0 0 0 3px rgba(var(--info-rgb),.12)}
input:disabled,select:disabled,textarea:disabled{opacity:.6;cursor:not-allowed;background:var(--surf-1)}
/* A locked (readonly) rate field reads the same as a locked currency field - it still
   submits its value, the pencil unlocks it for a manual override. */
input.js-rate[readonly]{opacity:.6;cursor:not-allowed;background:var(--surf-1)}
/* The derived (system-computed) half of a linked pair - e.g. End date ↔ Repeats - reads as locked. */
.js-locked input{opacity:.6;cursor:not-allowed;background:var(--surf-1)}
.js-locked .date-picker-button{opacity:.6;cursor:not-allowed}
.inline-amount{max-width:130px;min-height:36px;padding:6px 9px;display:inline-block;text-align:right}
.wide{grid-column:1 / -1}
code{
  padding:2px 6px;
  border-radius:var(--r-sm);
  background:var(--hover);
}
/* App shell: the sidebar is a fixed column on desktop and an off-canvas drawer on mobile
   (toggled by the topbar hamburger). The Career/Finance toggle lives at the sidebar top. */
.topbar-lead{display:flex;align-items:center;gap:12px;min-width:0}
.nav-toggle{
  display:none;align-items:center;justify-content:center;
  width:40px;height:40px;flex:0 0 auto;
  border:1px solid var(--border);border-radius:var(--r);
  background:var(--surf-1);color:var(--text);cursor:pointer;
}
.nav-toggle:hover{background:var(--hover)}
.sidebar .module-toggle{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:14px}
.sidebar .module-toggle .button{width:100%;justify-content:center}
.sidebar .admin-zone{display:inline-flex;align-items:center;gap:7px;margin-top:14px;padding:7px 11px;border:1px solid var(--border);border-radius:var(--r);background:var(--surf-2);color:var(--soft);font-size:12px;font-weight:700}
.sidebar .admin-zone svg{color:rgb(var(--brand-rgb));flex:0 0 auto}
/* DRAG HANDLE. Sits on the sidebar's inline-end edge, inside the gap, so it never overlaps
   content. Keyboard-operable (it is a real button in the tab order): arrows nudge, Home resets. */
.sidebar{position:sticky}
.sidebar-resize{
  position:absolute;top:0;bottom:0;inset-inline-end:-10px;
  width:10px;border:0;padding:0;background:none;
  cursor:col-resize;touch-action:none;
  display:block;
}
.sidebar-resize::before{
  content:"";position:absolute;top:50%;inset-inline-end:3px;
  width:3px;height:38px;transform:translateY(-50%);
  border-radius:999px;background:var(--border);
  transition:background .15s ease,height .15s ease;
}
.sidebar-resize:hover::before,.sidebar-resize:focus-visible::before{background:rgb(var(--brand-rgb));height:64px}
.sidebar-resize:focus-visible{outline:2px solid rgb(var(--brand-rgb));outline-offset:2px;border-radius:var(--r)}
/* While dragging, kill text selection and pointer noise across the whole page. */
body.is-resizing-nav{user-select:none;cursor:col-resize}
body.is-resizing-nav iframe{pointer-events:none}
/* The hide control lives with the menu it hides. */
.sidebar-hide{
  display:inline-flex;align-items:center;justify-content:center;
  width:28px;height:28px;flex:0 0 auto;margin-inline-start:auto;
  border:1px solid var(--border);border-radius:var(--r);
  background:var(--surf-1);color:var(--soft);cursor:pointer;
}
.sidebar-hide:hover{background:var(--hover);color:var(--text)}
.nav-backdrop{display:none}

@media (min-width:981px){
  .shell.nav-hidden .nav-toggle{display:inline-flex}
}
@media (max-width:980px){
  /* Below this the sidebar is an off-canvas drawer at a fixed width: dragging a drawer's edge
     means nothing, and "hidden" is its normal resting state. */
  .sidebar-resize,.sidebar-hide{display:none}
  .shell.nav-hidden{grid-template-columns:1fr}
  .shell.nav-hidden>.sidebar{display:flex}
  .shell{grid-template-columns:1fr;padding:calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l))}
  .nav-toggle{display:inline-flex}
  .sidebar{
    position:fixed;top:0;left:0;bottom:0;
    width:min(280px,84vw);height:100%;
    padding-top:var(--safe-t);padding-bottom:var(--safe-b);padding-left:var(--safe-l);
    border:0;border-right:1px solid var(--border);border-radius:0;
    z-index:60;overflow-y:auto;
    transform:translateX(-100%);transition:transform .22s ease;
    box-shadow:var(--shadow-2);
  }
  .shell.nav-open .sidebar{transform:translateX(0)}
  .nav-backdrop{
    display:block;position:fixed;inset:0;z-index:55;
    background:rgba(2,0,8,.55);backdrop-filter:blur(2px);
    opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;
  }
  .shell.nav-open .nav-backdrop{opacity:1;visibility:visible}
  .nav{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:repeat(auto-fit,minmax(90px,1fr))}
  .month-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .month-indicators{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:680px){
  /* Keep the safe-area insets from the >980px rule: a flat pad here would slide the topbar under
     the iOS status bar / notch in standalone PWA mode (status bar is black-translucent). */
  .shell{padding:calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l));gap:12px}
  .content,.main,.tabs,.tab-panel{gap:12px}
  .sidebar{padding:calc(10px + var(--safe-t)) 10px 10px calc(10px + var(--safe-l))}
  .brand{padding:6px}
  .brand-mark{width:36px;height:36px;border-radius:var(--r);flex:0 0 auto}
  .nav{gap:5px;margin-top:12px}
  .nav a{padding:10px;font-size:13px}
  .nav-title{padding:0 10px 4px}
  .auth-main{padding:14px;align-content:start}
  .auth-card{margin:2vh auto;padding:18px}
  .panel,.page-head,.topbar,.public-section{padding:14px}
  .public-portfolio{padding:12px;gap:12px}
  .actions,.form-actions{justify-content:flex-start;width:100%}
  .panel-head>.actions,.page-head>.actions{flex-wrap:wrap;justify-content:flex-start}
  /* A submit button is usually wrapped in its own <form> (it needs a POST and a CSRF token), and
     that form - not the button - is the flex item. It shrinks to fit, so width:100% on the button
     inside measured 100% of 93px: the PRIMARY action rendered as a small pill in the corner while
     the plain Cancel link beside it ran the full width (§11 - the primary must not be the quietest
     control on the screen). The wrapper has to stretch before the button can. */
  .panel-head>.actions form,.form-actions form,.actions form{width:100%}
  .actions .button,.form-actions .button,.form-actions a{width:100%}
  h1{font-size:30px;line-height:1.08}
  h2{font-size:21px}
  .lede{font-size:14px}
  .stat{padding:9px}
  .stat strong{font-size:17px}
  .button{width:100%}
  /* An icon-only control is square at every width - the full-width rule above is for real buttons
     in a form or a panel head. Without this the topbar eye ate the whole actions column on a phone,
     and the per-section eye (which sits INSIDE a heading) stretched its panel head past the
     viewport - the mobile audit caught the second one the moment it shipped. */
  .amounts-eye,.mask-section-eye{width:auto}
  .button.small{min-height:40px}
  .public-hero{min-height:auto;align-items:flex-start;flex-direction:column;padding:18px}
  .public-hero h1{font-size:clamp(34px,10vw,48px)}
  .public-headline{font-size:18px}
  .public-contact{justify-content:flex-start}
  .public-contact .button{width:auto}
  .public-project-grid,.public-skill-list{grid-template-columns:1fr}
  .page-head,.panel-head{align-items:flex-start;flex-direction:column}
  .panel-head .button,.page-head .button{width:100%}
  /* ...except the per-section eye, which is an icon and not an action. A `width:auto` exemption for
     it exists nine lines above, but `.panel-head .button` is MORE specific and won wherever the eye
     actually lives - every dashboard eye was a full-width button with a 14px icon centred in it.
     Equal specificity is not enough either: this has to sit AFTER the rule it beats. */
  .panel-head .mask-section-eye,.page-head .mask-section-eye{width:auto}
  .nav,.stats-grid,.form-grid,.detail-grid{grid-template-columns:1fr}
  .detail-grid.plan-terms{grid-template-columns:1fr}
  .detail-grid.plan-terms .col-partner{grid-column:auto}
  /* Kill the desktop span rules (field-sm/md/lg + the :has() auto-sizing): an item spanning 3 of a
     1-column grid forces implicit extra columns, which squeezed fields side by side OUT of the
     form's order (Paid via beside Amount) at ~half width. !important because the span rules carry
     higher specificity; this is the terminal mobile override. One column, full width, DOM order. */
  .form-grid > *{grid-column:1 / -1 !important}
  /* A one-field action form on a phone: the field takes the row and its button sits under it at the right, the way
     every other form's button row does, instead of wrapping to the left edge on its own. */
  .form-grid.action-form > label,
  .form-grid.action-form > label.wide{flex-basis:100%;max-width:none}
  .form-grid.action-form > .form-actions{flex-basis:100%;justify-content:flex-end}
  /* ...AND THE FIELDS FILL THE LINE THEY ARE GIVEN (owner's check at 375px, 02-09-2026).
     flex-direction:column turns the row's CROSS axis horizontal, so the desktop `align-items:start`
     - which is right when the fields sit side by side - made every field shrink to its own content
     width instead. Measured on the recurring cost form: a 333px row holding a 191px Category and a
     243px "Paid from" whose account name was clipped, with 90px of empty space beside it.
     stretch is the flex default; it has to be said again here because the row rule set it. */
  .form-grid > .field-row{flex-direction:column;align-items:stretch}
  /* The settlement row is a GRID, so the flex rule above cannot reach it: one column, and the spans
     reset with it. An item spanning 3 of a one-column grid forces implicit extra columns - the same
     trap the note above this block describes, which is how it produced 71px fields on a phone. */
  .form-grid > .field-row.settle-row{grid-template-columns:1fr}
  .form-grid > .field-row.settle-row > label{grid-column:1 / -1}
  .field-row > label{flex-basis:auto}
  .field-row > label.field-sm{flex-basis:auto}
  /* Help bubble: on narrow screens anchor it to the field (not the inline "?") so it spans the
     field width and can't clip the screen edge. */
  .form-grid label:has(.field-help){position:relative}
  .form-grid label:has(.field-help) .field-help{position:static}
  .form-grid label:has(.field-help) .help-bubble{left:0;right:0;width:auto}
  .stage-pipeline{display:grid;grid-template-columns:1fr;gap:8px}
  .stage-pipeline form,.stage-step{width:100%}
  .template-editor-head{flex-direction:column}
  .template-editor .inline-check{width:100%}
  .table-wrap{overflow:visible}
  table{min-width:0}
  /* tfoot IS in this list. Left out, it kept display:table-footer-group while the table around it
     became a block, so the browser wrapped it in an anonymous table box that shrank to its content:
     a debit/credit total row rendered as a ~180px column stranded on the left edge instead of a
     full-width row. Measured on the transaction review page at 375px. */
  table,thead,tbody,tfoot,tr,th,td{display:block}
  thead{display:none}
  /* ...EXCEPT A HEADER ROW CARRYING A BULK TOGGLE. Hiding the whole thead is right for column
     captions - each cell names itself through data-label once it stacks - but a "tick them all"
     control is not a caption, and deleting it on a phone removes it exactly where a list of cards
     most needs one. Only its own cell survives; the captions beside it stay hidden. */
  thead:has(.fx-all-cell){display:block}
  thead:has(.fx-all-cell) tr{display:block;border:0;background:none;margin:0 0 10px}
  thead:has(.fx-all-cell) th:not(.fx-all-cell){display:none}
  /* width:auto for the SAME reason td.check-col needs it below: .check-col is width:1% on a desktop,
     a table shrink-to-fit trick, and it keeps applying once the cell is a stacked block - measured
     at 3px holding 52px of label and box. The note on td.check-col spells this out; this is a th,
     so it was not covered by it. */
  thead .fx-all-cell{display:flex;align-items:center;gap:10px;width:auto;padding:0 0 6px;border:0;text-align:start}
  tr{
    border:1px solid var(--border-soft);
    border-radius:var(--r);
    margin-bottom:10px;
    background:var(--surf-1);
    overflow:hidden;
  }
  td{
    display:grid;
    grid-template-columns:minmax(100px,42%) minmax(0,1fr);
    align-items:start;
    gap:14px;
    border-bottom:1px solid var(--divider);
    padding:10px;
    min-width:0;
  }
  td:last-child{border-bottom:0}
  td::before{
    content:attr(data-label);
    color:var(--mute);
    font-size:12px;
    font-weight:800;
    min-width:0;
  }
  td.check-col:empty,td.row-actions:empty,td.num:empty{display:none}
  /* A TOTALS FOOTER WRITTEN WITH <th> STACKS LIKE ONE WRITTEN WITH <td> (NGO reports walk,
     18-10-2026). Every stacking rule above keys on td, so a tfoot built from th kept a row of bare
     blocks under stacked cards: on the NGO Loans totals that was six empty boxes and three
     unlabelled figures, measured at 375px.
     SCOPED TO A CELL THAT NAMES ITS COLUMN. A footer whose first cell is the word "Total" uses that
     cell as the row's heading and wants no label gutter beside it - the same reason td.total-label
     below is a plain block - so the grid applies only where a data-label was written, and the six
     label-led footers elsewhere in the app are untouched. */
  tfoot th[data-label]{display:grid;grid-template-columns:minmax(100px,42%) minmax(0,1fr);
    align-items:start;gap:14px;border-bottom:1px solid var(--divider);padding:10px;min-width:0;
    text-align:start}
  tfoot th[data-label]:last-child{border-bottom:0}
  tfoot th[data-label]::before{content:attr(data-label);color:var(--mute);font-size:12px;
    font-weight:800;min-width:0}
  tfoot th[data-label]:empty{display:none}
  /* width:auto undoes the desktop .check-col{width:1%} - a TABLE sizing trick (shrink to fit)
     that keeps applying once the cell is a stacked flex row, where 1% of the row is ~20px.
     The label and the tick box are deliberately non-shrinking below, so they spilled out of
     it: 111px of content in a 20px box, measured at 375px. */
  td.check-col{display:flex;align-items:center;gap:10px;width:auto}
  /* The cell becomes a flex row on mobile - its data-label sits beside the box. Without
     flex:none the input is a shrinkable flex item and the label squeezes it to ZERO WIDTH,
     so the tick box was invisible and untappable on a phone: measured 0x42 at 375px.
     Sized up from the desktop 16px as well, since this is a touch target (§9). */
  td.check-col::before{flex:0 0 auto}
  /* A BADGE HUGS ITS TEXT. Stacked, a cell is a grid - and a badge is a grid ITEM, which blockifies
     its inline-flex and then stretches to the column. A status pill rendered 311px wide across the
     whole cell, which reads as a banner rather than a badge; measured on the partner page. */
  td .badge{justify-self:start;width:fit-content}

  /* FILTERS GO FULL WIDTH ON A PHONE (§4). The toolbar had no mobile rule at all - only flex-wrap
     to fall back on - so every control kept its desktop width and landed where it fell: a 240px
     Status pushed in behind a 38px "Filters" caption, a 230px Type below it at a different left
     edge, a 340px search and a 359px button. Five controls, four widths, two left edges. Stacked,
     they share one edge and one width, and each label sits over the field it names. */
  .list-toolbar,.filter-toolbar{flex-direction:column;align-items:stretch}
  /* ...and every flex-BASIS in this toolbar was written for a row, where it sizes width. Turning
     the container into a column turns the main axis vertical, so those bases became HEIGHTS: the
     search box's flex:1 1 150px rendered a 150px-tall box with a 46px input floating in the middle
     of it, and a combo's 190px basis would do the same. Reset to auto so each control is as tall as
     its content and only the width stretches. */
  .list-toolbar-field,.list-toolbar-search,.list-toolbar .combo,.list-toolbar .ss,
  .filter-toolbar label,.filter-toolbar .date-picker{flex:0 0 auto}
  .list-toolbar-field{display:grid;grid-template-columns:1fr;gap:4px}
  .list-toolbar-field > span{text-align:start}
  .list-toolbar-search{max-width:none}
  /* :not(.js-date-native) for the same reason as the desktop rule above - width:auto on the picker's
     overlay is shrink-to-fit, and it OUTRANKS the picker's own touch rule (a class+attribute selector
     beats two classes), so on a phone it would uncover the native calendar indicator in every list
     toolbar carrying a date. Found by the gate, in a rule written the same day. */
  .list-toolbar input[type=search],
  .list-toolbar input[type=date]:not(.js-date-native){max-width:none;width:auto}
  .list-toolbar .button,.filter-toolbar .button{width:100%}
  td.check-col input{flex:0 0 auto}
  /* One touch size for EVERY table checkbox on mobile, not just the selection column. The
     contribution-import rows put theirs in a plain grid cell, which never had the shrink bug
     but did stay at the 16px desktop size - so the same phone showed two different targets. */
  td input[type="checkbox"]{width:22px;height:22px}
  td.row-actions{
    display:grid;
    grid-template-columns:1fr;
    align-items:stretch;
    justify-content:stretch;
  }
  td.row-actions::before{grid-column:1}
  td.row-actions .button,td.row-actions form,td.row-actions button,td form .button{width:100%}
  .row-menu-trigger{min-height:40px;min-width:40px}
  td form{width:100%}
  /* Stacked, the totals label has no data-label to sit beside and no figure to align to: it reads
     as the row's own heading, at the start edge like every other label on the page. */
  td.total-label{display:block;text-align:start}
  /* Document totals footers (invoice / POS receipt / RFQ): a row is a "label ... amount" pair, the
     label spanning via colspan and exactly one amount after it. The generic cell-stacking above gave
     each an empty data-label gutter and split the pair onto stacked half-width boxes. Render the pair
     as one clean right-aligned line instead. Scoped to a single-amount colspan row via
     :not(:has(td.num + td.num)), so multi-amount closing rows (statement debit/credit/balance) and
     multi-column footers (aging report) keep the default stacking. */
  tfoot tr:has(td[colspan]):not(:has(td.num + td.num)){display:flex;justify-content:space-between;
    align-items:baseline;gap:12px;background:none;border:0;border-bottom:1px solid var(--divider);
    border-radius:0;margin:0}
  tfoot tr:has(td[colspan]):not(:has(td.num + td.num)) td{display:block;border:0;padding:7px 10px;min-width:0}
  tfoot tr:has(td[colspan]):not(:has(td.num + td.num)) td::before{display:none}
  tfoot tr:has(td[colspan]):not(:has(td.num + td.num)) td[colspan]{text-align:left}
  tfoot tr:has(td[colspan]):not(:has(td.num + td.num)) td.num{text-align:right;white-space:nowrap}
  /* Stacked document header: the number/date block sits under the issuer, aligned to the start edge
     instead of floating to the far side of a narrow screen. */
  .doc-head-meta{text-align:start}
}
@media (max-width:420px){
  .shell{padding:calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) calc(8px + var(--safe-b)) calc(8px + var(--safe-l))}
  .nav a{font-size:12px;padding:9px}
  .panel,.page-head,.topbar,.public-section,.auth-card{padding:12px}
  h1{font-size:27px}
  .public-hero h1{font-size:34px}
  td{grid-template-columns:1fr;gap:6px}
  td::before{display:block}
  .public-meta span{width:100%;justify-content:center}
}

/* ============================================================================
   Light theme for ManagerDS / Bawtag app
   ----------------------------------------------------------------------------
   PASTE THIS BLOCK AT THE END of design-system/styles.css
   (and mirror it into public/assets/app.css - they are the same file deployed).

   Activated by  <html data-theme="light">.  Absence of the attribute, or
   data-theme="dark", keeps the shipped dark theme - no change to current
   behaviour. See repo-patch/README.md for the toggle button + no-flash script.

   How it works: the shipped CSS bakes tokens dark in :root and hardcodes white
   overlays (rgba(255,255,255,.0x)) and near-black surfaces in many rules. This
   block (a) redefines the tokens for light and (b) re-states every hardcoded
   color with a dark-on-light equivalent.
   ============================================================================ */

:root[data-theme="light"]{
  --bg:#f3f1fa;
  --bg-2:#ffffff;
  --panel:rgba(20,16,48,.04);
  --panel-2:rgba(20,16,48,.07);
  --border:rgba(20,16,48,.12);
  --text:#191430;
  --soft:rgba(25,20,48,.80);
  --mute:rgba(25,20,48,.56);
  --amount-pos:#15803d;  /* darker green/red for legibility on the light surface */
  --amount-neg:#dc2626;
  /* accent hues (indigo/violet/cyan/amber/rose/lime) read on light - unchanged */
  /* Surface scale flips dark-on-light; most per-rule light overrides below become redundant. */
  --surf-1:rgba(20,16,48,.035);
  --surf-2:rgba(20,16,48,.05);
  --field:#ffffff;                     /* light theme: white fields on the soft grey surface */
  --hover:rgba(20,16,48,.09);
  --divider:rgba(20,16,48,.08);
  --border-soft:rgba(20,16,48,.1);
  /* Softer elevation on the light base */
  --shadow-1:0 1px 2px rgba(20,16,48,.1);
  --shadow-2:0 12px 32px rgba(20,16,48,.18);
}

/* Body backdrop: same colored glows, lower alpha so they read on a light base */
:root[data-theme="light"] body{
  background:
    radial-gradient(circle at 16% 18%,rgba(var(--brand-rgb),.14),transparent 32rem),
    radial-gradient(circle at 90% 8%,rgba(var(--accent-rgb),.10),transparent 30rem),
    radial-gradient(circle at 54% 90%,rgba(var(--info-rgb),.10),transparent 34rem),
    var(--bg);
}

/* Frosted shells that hardcode a near-black fill */
:root[data-theme="light"] .sidebar{background:rgba(255,255,255,.70)}
:root[data-theme="light"] .topbar{background:rgba(255,255,255,.62)}

/* Sidebar nav */
:root[data-theme="light"] .nav a:hover,
:root[data-theme="light"] .nav a.active,
:root[data-theme="light"] .nav a.soft-active{background:rgba(20,16,48,.06);color:var(--text)}
:root[data-theme="light"] .nav a.active{
  border-color:rgba(var(--brand-rgb),.28);
  background:linear-gradient(120deg,rgba(var(--brand-rgb),.16),rgba(var(--info-rgb),.10));
}

/* Topbar user menu trigger (the menu popover itself stays dark slate - fine) */
:root[data-theme="light"] .user-menu-toggle:hover,
:root[data-theme="light"] .user-menu-toggle[aria-expanded="true"]{color:var(--text);background:rgba(20,16,48,.06)}

/* Buttons - keep .primary (brand gradient) and .ghost (transparent) intact */
:root[data-theme="light"] .button:not(.primary):not(.ghost){background:rgba(20,16,48,.05)}
:root[data-theme="light"] .button:not(.primary):not(.ghost):hover{background:rgba(20,16,48,.09)}
:root[data-theme="light"] .button:disabled:hover,
:root[data-theme="light"] button:disabled:hover{background:rgba(20,16,48,.05)}
:root[data-theme="light"] .button.ghost:hover{background:rgba(20,16,48,.06)}
:root[data-theme="light"] .button.danger{color:#b3261e}
:root[data-theme="light"] .button.ghost.danger{color:#c0352c}

/* Row overflow menu */
:root[data-theme="light"] .row-menu-trigger{background:rgba(20,16,48,.05)}
:root[data-theme="light"] .row-menu-trigger:hover,
:root[data-theme="light"] .row-menu-trigger[aria-expanded="true"]{background:rgba(20,16,48,.10)}
:root[data-theme="light"] .row-menu-item:hover{background:rgba(20,16,48,.07)}

/* Flash / notices */
:root[data-theme="light"] .flash{color:#0a7d4a}

/* Misc card-ish surfaces with white overlays */
:root[data-theme="light"] .setup-steps li{background:rgba(20,16,48,.035)}

/* Pipeline stage chips */
:root[data-theme="light"] .stage-step{background:rgba(20,16,48,.05)}
:root[data-theme="light"] .stage-step:hover{background:rgba(20,16,48,.09);color:var(--text)}

/* Public portfolio surfaces */
:root[data-theme="light"] .public-hero{
  background:
    linear-gradient(120deg,rgba(255,255,255,.45),rgba(255,255,255,.82)),
    radial-gradient(circle at 78% 20%,rgba(16,185,129,.18),transparent 24rem),
    var(--panel);
}
:root[data-theme="light"] .public-card-subtitle{color:var(--text)}
:root[data-theme="light"] .public-project-card img{border-color:rgba(20,16,48,.10);background:rgba(20,16,48,.05)}

/* Badges: readable text on each colored variant (surfaces flip via tokens).
   EVERY tone defined above with pale text needs its counterpart here. Six did not have one - among
   them "overdue" - so on a light background, and therefore on PAPER, they rendered near-white text
   on a pale tint: a badge that printed as an empty coloured pill. Found 2026-07-28 on the dashboard,
   where "concentrated" appeared as a blank lozenge. qa.php now compares the two lists. */
:root[data-theme="light"] .badge-status-paid,
:root[data-theme="light"] .badge-status-active,
:root[data-theme="light"] .badge-status-completed,
:root[data-theme="light"] .badge-status-resolved,
:root[data-theme="light"] .badge-status-won,
:root[data-theme="light"] .badge-status-shortlisted,
:root[data-theme="light"] .badge-status-offer,
:root[data-theme="light"] .badge-status-featured,
:root[data-theme="light"] .badge-signin-recovery-code-used,
:root[data-theme="light"] .badge-stage-offer,
:root[data-theme="light"] .badge-status-accepted,
:root[data-theme="light"] .badge-signin-success,
:root[data-theme="light"] .badge-signin-reset-requested,
:root[data-theme="light"] .badge-rate-fetched,
:root[data-theme="light"] .badge-acct-asset,
:root[data-theme="light"] .badge-mail-in-use,
:root[data-theme="light"] .badge-priority-low{color:#0a7d4a}
:root[data-theme="light"] .badge-status-interesting,
:root[data-theme="light"] .badge-status-in-progress,
:root[data-theme="light"] .badge-status-applied,
:root[data-theme="light"] .badge-stage-applied,
:root[data-theme="light"] .badge-stage-screening,
:root[data-theme="light"] .badge-event-email,
:root[data-theme="light"] .badge-event-call,
:root[data-theme="light"] .badge-event-note,
:root[data-theme="light"] .badge-event-admin-notification,
:root[data-theme="light"] .badge-type-application,
:root[data-theme="light"] .badge-type-opportunity,
:root[data-theme="light"] .badge-status-sent,
:root[data-theme="light"] .badge-rate-manual,
:root[data-theme="light"] .badge-acct-income,
:root[data-theme="light"] .badge-type-course{color:#0b6e85}
:root[data-theme="light"] .badge-priority-medium,
:root[data-theme="light"] .badge-status-planned,
:root[data-theme="light"] .badge-status-proposed,
:root[data-theme="light"] .badge-status-researching,
:root[data-theme="light"] .badge-status-invited,
:root[data-theme="light"] .badge-stage-draft,
:root[data-theme="light"] .badge-event-task,
:root[data-theme="light"] .badge-event-field-changed,
:root[data-theme="light"] .badge-event-password-reset-generated,
:root[data-theme="light"] .badge-event-invite-generated,
:root[data-theme="light"] .badge-status-partial,
:root[data-theme="light"] .badge-status-waiting,
:root[data-theme="light"] .badge-signin-form-expired,
:root[data-theme="light"] .badge-signin-no-such-account,
:root[data-theme="light"] .badge-signin-reset-no-match,
:root[data-theme="light"] .badge-signin-reset-account-not-active,
:root[data-theme="light"] .badge-rate-needs-manual,
:root[data-theme="light"] .badge-mail-fallback,
:root[data-theme="light"] .badge-acct-expense{color:#8a5800}
:root[data-theme="light"] .badge-priority-high,
:root[data-theme="light"] .badge-status-new,
:root[data-theme="light"] .badge-event-interview,
:root[data-theme="light"] .badge-event-follow-up,
:root[data-theme="light"] .badge-event-deadline,
:root[data-theme="light"] .badge-event-reminder,
:root[data-theme="light"] .badge-event-request,
:root[data-theme="light"] .badge-status-due{color:#9a4510}
:root[data-theme="light"] .badge-status-rejected,
:root[data-theme="light"] .badge-status-dropped,
:root[data-theme="light"] .badge-status-inactive,
:root[data-theme="light"] .badge-status-dismissed,
:root[data-theme="light"] .badge-status-closed,
:root[data-theme="light"] .badge-status-lost,
:root[data-theme="light"] .badge-stage-rejected,
:root[data-theme="light"] .badge-status-failed,
:root[data-theme="light"] .badge-event-error,
:root[data-theme="light"] .badge-status-overdue,
:root[data-theme="light"] .badge-priority-urgent,
:root[data-theme="light"] .badge-signin-bad-password,
:root[data-theme="light"] .badge-signin-locked-out,
:root[data-theme="light"] .badge-signin-2fa-failed,
:root[data-theme="light"] .badge-signin-reset-email-failed,
:root[data-theme="light"] .badge-mail-ready,
:root[data-theme="light"] .badge-mail-incomplete,
:root[data-theme="light"] .badge-acct-liability{color:#b3261e}
:root[data-theme="light"] .badge-status-archived,
:root[data-theme="light"] .badge-status-paused,
:root[data-theme="light"] .badge-status-withdrawn,
:root[data-theme="light"] .badge-stage-withdrawn,
:root[data-theme="light"] .badge-status-skipped,
:root[data-theme="light"] .badge-role-admin,
:root[data-theme="light"] .badge-role-owner,
:root[data-theme="light"] .badge-rate-triangulated,
:root[data-theme="light"] .badge-acct-equity,
:root[data-theme="light"] .badge-role-user{color:#5b3fb8}

/* Inline code */

/* Mobile nav hamburger */

/* Rate inline-edit */
:root[data-theme="light"] .rate-edit:hover{border-color:rgba(20,16,48,.24)}

/* Inputs */
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea{background:#ffffff}
:root[data-theme="light"] input:disabled,
:root[data-theme="light"] select:disabled,
:root[data-theme="light"] textarea:disabled,
:root[data-theme="light"] input.js-rate[readonly]{background:rgba(20,16,48,.04)}

/* Modal backdrop */
:root[data-theme="light"] dialog.modal::backdrop{background:rgba(20,16,48,.34)}

/* Mobile stacked-table card rows (≤680px) re-use white overlays - fix them too */
@media (max-width:680px){
  :root[data-theme="light"] tr{border-color:rgba(20,16,48,.10);background:rgba(20,16,48,.035)}
  :root[data-theme="light"] td{border-bottom-color:rgba(20,16,48,.07)}
}

/* ============================================================================
   PRINT - print/save-as-PDF the document, not the app chrome. Always on white with
   black text (dark theme prints terribly), flat (no blur/shadow), full width. Hide
   navigation, toolbars, pagination, action buttons and other interactive bits; mark
   anything else page-specific with [data-no-print]. A .js-print button calls print().
   ============================================================================ */
.print-header{display:none}
/* Public partner statement of account - a standalone letterheaded document (screen + print). */
.statement-body{background:var(--bg)}
.statement-doc{max-width:900px;margin:0 auto;padding:28px 24px;display:flex;flex-direction:column;gap:16px}
.statement-masthead{border-bottom:2px solid var(--border);padding-bottom:12px}
/* Three columns so the logo sits in the true centre regardless of the side widths. */
.statement-masthead-top{display:grid;grid-template-columns:1fr auto 1fr;gap:20px;align-items:start}
.statement-from{min-width:0}
.statement-logo-wrap{grid-column:2;justify-self:center;align-self:start;padding-top:2px}
.statement-masthead-top > .statement-title{grid-column:3}
/* Full-width identity line under the top row: entity contact + reg/tax on one wrapping line. */
.statement-issuer-contact{margin:12px 0 0;padding-top:10px;border-top:1px solid var(--divider);color:var(--mute);font-size:.82rem;display:flex;flex-wrap:wrap;gap:4px 8px;align-items:baseline}
.statement-issuer-contact .statement-sep{color:var(--border-soft)}
.statement-org{font-size:1.35rem;font-weight:800;margin:0}
/* The seller block at the top of a counter receipt - the same letterhead pieces as every other
   document, separated from the sale details below it. */
.doc-seller{margin:0 0 14px;padding-bottom:12px;border-bottom:1px solid var(--divider)}
.statement-org-line{margin:2px 0 0;color:var(--mute);font-size:.85rem}
.statement-title{text-align:right;flex:0 0 auto}
.statement-title h1{font-size:1.25rem;margin:0}
.statement-title p{margin:2px 0 0;font-size:.85rem}
.statement-parties{display:flex;flex-direction:column;gap:8px}
/* Partner block gets 2/3, balance 1/3 - so even a long address stays within its column. */
.statement-parties-top{display:grid;grid-template-columns:2fr 1fr;gap:24px;align-items:start}
.statement-to{min-width:0}
.statement-partner-contact{margin-top:6px;padding-top:6px;font-size:.72rem;gap:2px 6px}
.statement-label{font-size:.8rem;font-weight:700;color:var(--mute);margin:0 0 4px}
.statement-party-name{font-size:1.05rem;font-weight:700;margin:0}
/* Balance box: two lines - the status tag on top, the amount under it. */
.statement-headline{text-align:right}
.statement-headline > p{margin:0}
.statement-balance{font-size:1.6rem;font-weight:800;margin:4px 0 0}
/* One equal column per tile, however many the document has: the statement and receipt run 4,
   the monthly/aging/asset documents 3. A hard repeat(4,1fr) left the 3-tile documents with a
   dead quarter-width column on screen AND on paper. */
.statement-summary{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:1px;background:var(--border-soft);border:1px solid var(--border-soft);border-radius:var(--r-lg);overflow:hidden}
.statement-summary-cell{background:var(--surf-1);padding:7px 14px;display:flex;flex-direction:column;gap:2px}
.statement-summary-cell span{font-size:.8rem;color:var(--mute)}
.statement-summary-cell strong{font-size:1.05rem}
.statement-summary-cell.is-closing{background:rgba(var(--brand-rgb),.08)}
/* A summary cell holding a PHRASE rather than a figure takes two tracks (owner's request 13-09-2026:
   the fund name on a receipt wrapped to three lines while Date and Amount sat in half-empty boxes).
   The row is grid-auto-flow:column, so a span simply claims one more implicit track. */
.statement-summary-cell.is-wide{grid-column:span 2}
/* Financial report sections as bordered cards: each statement (income & expense, income statement,
   balance sheet, cash flow) reads as its own block instead of one continuous stack. */
.statement-lines{border:1px solid var(--border-soft);border-radius:var(--r-lg);background:var(--surf-1);padding:12px 16px 14px;margin:16px 0}
.statement-lines > .statement-section-title{padding-bottom:8px;border-bottom:1px solid var(--divider);margin-bottom:12px}
/* A section whose table runs to the document's edges - no card, so a wide table keeps the full width
   of the letterhead above it (the pledges report's ten columns). */
.statement-lines.is-flush{border:0;background:none;padding:0;border-radius:0}
.statement-section-title{font-size:1rem;margin:0 0 8px}
/* A SUB-HEADING INSIDE A SECTION heads the list under it, so it takes its space ABOVE and sits
   tight on its own table - and it carries no section divider, which belongs to the section's own
   title. The overriding rule above is `.statement-lines > .statement-section-title`, one class more
   specific than a lone class, so this must match it to win. */
.statement-lines > .statement-section-title.statement-subsection-title{border-bottom:0;padding-bottom:0;margin:20px 0 6px}
/* A SECTION TITLE WRAPS; ITS DATES DO NOT (fixed 03-09-2026). This was `white-space:nowrap` on the
   whole heading, which made "Income & expense analysis 01-01-2026 to 03-09-2026" one unbreakable
   line - 448px inside a 325px card at 375px, so the period ran off the edge and was CUT, not
   scrolled. The nowrap was there to keep a date from splitting across two lines (§12), but each date
   already carries that itself on .doc-tag, and .doc-tag-group already wraps - so the outer rule was
   both redundant and the only thing stopping the heading breaking where it safely can: between the
   title and its dates. */
.statement-tx-title{white-space:normal}
.statement-tx-title .muted{display:inline;font-weight:400;font-size:.85rem}
.statement-table tfoot .statement-closing-row td{border-top:2px solid var(--border);font-weight:700}
.statement-bf td{color:var(--mute)}
.statement-foot{border-top:1px solid var(--divider);padding-top:12px;font-size:.8rem}
/* Footer as one line: disclaimer on the start edge, "Generated on" pushed to the far edge.
   justify-content:space-between + RTL flips the edges automatically (LTR right / AR left). */
.statement-foot,.statement-footnote{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 24px}
.statement-foot .foot-note,.statement-footnote .foot-note{flex:1 1 60%;min-width:0}
.foot-generated{flex:0 0 auto;white-space:nowrap}
.statement-actions{margin-top:4px}
.statement-logo{max-height:56px;max-width:200px;object-fit:contain;margin:0 0 10px;display:block}
.statement-balance-note{margin:6px 0 0;font-size:.82rem;color:var(--mute)}
/* "How to pay": a compact box with an orange left edge; bank details inline like a contact line. */
/* "How to pay" as a fieldset: the label rides the top border like the form field groups. */
.statement-payment{border:1px solid var(--border-soft);border-left:3px solid rgba(var(--warn-rgb),.8);border-radius:var(--r-lg);background:var(--surf-1);padding:2px 12px 8px;margin:0;min-width:0}
.statement-payment > legend{padding:0 6px;font-size:.72rem;font-weight:800;letter-spacing:.02em;color:var(--text);white-space:nowrap}
.statement-payment > legend .muted{font-weight:600;display:inline}
.statement-bank-inline{border-top:0;margin:0;padding-top:0;font-size:.8rem}
.statement-payment .statement-bank-inline + .statement-bank-inline{margin-top:3px}
/* Letterhead meta chips: each date/time is its own labelled tag, so a reader knows
   which value is which; the value itself stays one LTR unit. */
.doc-meta-tags{display:flex;gap:5px;align-items:baseline;justify-content:flex-end;flex-wrap:wrap;margin:2px 0}
.doc-tag{display:inline-flex;gap:5px;align-items:baseline;border:1px solid var(--border-soft);border-radius:var(--r);padding:1px 7px;white-space:nowrap}
.doc-tag small{color:var(--mute);font-size:.68rem;font-weight:700}
.doc-tag-value{direction:ltr;unicode-bidi:isolate;font-variant-numeric:tabular-nums}
/* A period range: two date chips with a word separator between, so the range split can't be
   mistaken for the intra-date hyphens. LTR-wrapped so from->to order holds on RTL documents. */
.doc-tag-group{display:inline-flex;gap:5px;align-items:baseline;flex-wrap:wrap}
.doc-tag-sep{color:var(--mute);font-size:.72rem}
/* A range in a section heading: chips sit at label size, not the heading's, so they read as a
   quiet date range beside the title rather than competing with it. */
.statement-section-title .doc-tag-group{font-size:.8rem;font-weight:400}
/* Aging summary reuses the pay-box shell with an informational (not call-to-action) edge. */
.statement-aging{border-left-color:rgba(var(--info-rgb),.45)}
/* The transactions box: same shell, brand-toned edge - the document's core content. */
.statement-transactions{border-left-color:rgba(var(--brand-rgb),.5)}
.statement-transactions .table-wrap{margin:2px 0 0}
/* Statement tables: bold column headers over a strong rule line (user decision 2026-07-18). */
.statement-table thead th{font-weight:800;border-bottom:2px solid var(--border)}
/* A group heading inside a document table (the pledges report's frequency groups): the label and the
   group's own totals on one row, set apart from the rows under it without a second table. */
.statement-table tr.statement-group-row td{font-weight:700;background:var(--surf-2);border-top:1px solid var(--border)}
/* The group's name and count read as one line ("Monthly · 55 active pledges"). */
.statement-table tr.statement-group-row td:first-child{white-space:nowrap !important}
/* TEN COLUMNS ON A DOCUMENT PAGE, ON SCREEN (pledges report, 11-09-2026). Print already shrinks the
   commitments ledger to fit the sheet; on screen the same table at body size was 1000px in an 818px
   document and scrolled sideways. A step smaller with tighter gutters keeps it whole. */
/* Same specificity as the print rule for .stmt-commitments and EARLIER in the file, so on paper
   that rule's 7.5pt still wins - not @media screen, which print_audit's measurement cannot see. */
.stmt-pledges td{font-size:12px}
/* The report prints names MASKED to initials ("A... H..."), short enough to keep on one line - split,
   each initial stacked on its own line and read as three different people. Behind ("1 M, 10 D") is one
   value and must not break either. */
.stmt-pledges td.col-party,.stmt-pledges td.col-behind{white-space:nowrap}
.stmt-pledges th,.stmt-pledges td{padding-inline:5px}
.statement-aging .table-wrap{margin:2px 0 0}
.statement-payment-body{margin:4px 0 0;font-size:.82rem;white-space:pre-line}
.statement-generated{font-size:.75rem;margin-top:6px}
@media (max-width:640px){.statement-summary{grid-auto-flow:row;grid-template-columns:repeat(2,1fr)}.statement-title,.statement-headline{text-align:left}
  .statement-masthead-top{grid-template-columns:1fr}.statement-logo-wrap{justify-self:start}.statement-masthead-top > .statement-title{grid-column:1}
  .statement-parties-top{grid-template-columns:1fr}}
/* Statement print refinements: full-bleed page with printer margins, keep the summary 4-up. */
@media print{
  /* No @page here: the app-wide print block below sets margin:12mm, and a later unnamed @page
     wins - the 14mm this block used to declare had never once applied. One margin, stated once. */
  .statement-doc{max-width:none;padding:0;gap:14px}
  /* Force the tiles back onto one row per document (the ≤640 rule stacks them into 2 columns, so
     printing from a phone would otherwise print the phone layout), one equal column per tile. */
  .statement-summary{grid-auto-flow:column !important;grid-auto-columns:1fr !important;grid-template-columns:none !important}
  /* The closing tile's screen highlight is a TRANSLUCENT brand tint, so it composites over
     whatever is behind it - which is the grid's own background, reset to #bbb for print. That
     turned the document's most important figure into a muddy grey block. Opaque token instead. */
  .statement-summary-cell.is-closing{background:var(--surf-2)}
  .statement-masthead{border-bottom:2px solid #000}
  .statement-table tr{break-inside:avoid}
}

@media print{
  /* A PRINTED figure is never masked (ADR 0067). The eye hides balances from the room you are
     sitting in; a statement or report printed with dots where its totals belong is not a document.
     Reset every masking property, or the fixed-width inline-block survives into the PDF. */
  :root[data-amounts="hidden"] .sensitive{
    display:inline;width:auto;overflow:visible;color:inherit;position:static;user-select:auto;
  }
  :root[data-amounts="hidden"] .sensitive::before{content:none}
  :root[data-amounts="hidden"] .sensitive.amount-pos{color:var(--amount-pos)}
  :root[data-amounts="hidden"] .sensitive.amount-neg{color:var(--amount-neg)}
}

@media print{
  /* A table spanning printed pages repeats its tfoot on EVERY page by default - section
     totals must print exactly once, at the end of the table. */
  tfoot{display:table-row-group}
  /* Row action menus are interactive chrome - meaningless on paper. */
  .row-menu,.row-actions .button{display:none !important}
  :root,:root[data-theme="light"]{
    --bg:#fff;--bg-2:#fff;--text:#000;--soft:#1a1a1a;--mute:#444;
    --border:#999;--border-soft:#bbb;--divider:#bbb;
    --panel:#fff;--panel-2:#f4f4f4;--surf-1:#f7f7f7;--surf-2:#f1f1f1;--hover:#eee;
    --amount-pos:#0a6b2f;--amount-neg:#b3261e;
  }
  html,body{background:#fff !important;color:#000}
  /* Compact print typography so section descriptions fit on one line like the wide desktop view
     (the print page is much narrower) and headings aren't oversized on paper. */
  body{font-size:10pt}
  h1{font-size:18pt}
  h2{font-size:13pt}
  h3{font-size:11pt}
  .lede,.panel p,.muted,.empty,p{font-size:10pt}
  .eyebrow{font-size:8.5pt}
  .sidebar,.nav-backdrop,.nav-toggle,.topbar-actions,.topbar-crumbs,.month-switcher,
  .list-toolbar,.pagination,.row-menu,.actions,.form-actions,.field-help,.tab-bar,
  .combo-list,.ss-list,.panel-toggle,.module-toggle,.brand,button,.button,[data-no-print]{
    display:none !important;
  }
  /* Inputs keep their DARK-theme fill on paper - the light-theme rules are keyed on
     :root[data-theme="light"], which a printed page does not carry. The tax report printed its
     provision and return forms as near-black boxes with near-black text inside (2026-07-28). The
     controls themselves are meaningless on paper, but their VALUES are not - a date already chosen,
     a note already typed - so they print as a plain outlined field rather than being hidden. */
  input,textarea,select{
    background:#fff !important;color:#000 !important;border:1px solid #999 !important;
    box-shadow:none !important;
  }
  ::placeholder{color:#777 !important}
  .shell{display:block;width:auto;margin:0;padding:0;gap:0}
  .content,.main{display:block;gap:0}
  .topbar{display:none !important}
  .panel,.stat,.public-card,.public-section,.timeline-item,.template-editor,.detail-item,.event-item{
    border:1px solid #bbb !important;background:#fff !important;backdrop-filter:none !important;box-shadow:none !important;
    break-inside:avoid;
  }
  /* RECORD DETAILS PRINT AS LINES, NOT CARDS (owner's request 01-08-2026: "the details of the
     recurring entry is taking a whole page while it can be in couple lines").

     On screen a field is a bordered card with the label stacked above the value - roomy, scannable,
     and right for a screen you can scroll. On paper it is pure waste: thirteen fields became a full
     page of boxes, most of them holding "—".

     So for print the card becomes a ROW - label and value on one line, a hairline between them,
     three across instead of two. Same fields, same order, about a sixth of the height. The borders
     go because a grid of boxes is chrome; a printed record wants a list. */
  /* NOT INSIDE A DOCUMENT. This compact row is right for an internal record sheet and wrong for
     something a customer receives: on the invoice it turned the "Billed to" block into a
     right-aligned label/value pair with the email orphaned on its own line. A document's fields are
     an ADDRESS BLOCK - name under label, stacked - which is what the card layout already gave them.
     Caught by reading the printed invoice, not by the audit, which reported "ok": it measures fit
     and content, and this was neither too wide nor missing. */
  /* THE SAME TWO COLUMNS THE SCREEN SHOWS (owner's review 03-09-2026: "the fields are not in the
     correct order and length"). This forced THREE columns on paper while .detail-grid is two
     everywhere else, so the printed page was not the page you pressed Print on - and the extra
     column made every full-width child (a money row, a .wide Notes) break the flow harder, leaving
     single fields marooned beside two empty columns with underlines at three different lengths.
     Two columns, as on screen: fields land where the reader saw them, and each value's rule is the
     same length as its neighbour's. Field order is never rearranged to close a gap - a view mirrors
     its form exactly (§5), so a gap is better than a reshuffle. */
  .panel:not(.doc-flow):not(.document) .detail-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:0 14px !important}
  .panel:not(.doc-flow):not(.document) .detail-item{
    display:flex !important;
    align-items:baseline;
    justify-content:space-between;
    /* WRAPS RATHER THAN CLIPS. A long value - an email, an address - cannot share a third of the
       paper with its label, and without this it overflowed the column and Chrome simply cut it off:
       the partner page reported "clipped: DIV.detail-item" on the first run of this layout. Wrapped,
       the value drops to its own line and the row grows; still far shorter than the card it
       replaced. */
    flex-wrap:wrap;
    gap:8px !important;
    padding:2px 0 !important;
    border:0 !important;
    border-bottom:1px solid #ddd !important;
    border-radius:0 !important;
    background:transparent !important;
  }
  .panel:not(.doc-flow):not(.document) .detail-item.wide{grid-column:1/-1}
  /* The LABEL may wrap on paper. nowrap keeps a label on one line on SCREEN, where the framework's
     answer is to widen the field - but a third of a sheet cannot be widened, so "Amount sent in base
     currency" simply overflowed its column and Chrome clipped it (caught on the transfer view, a
     page the audit could not see until it swept hand-written views too). A label is not a date or a
     reference; it may take two lines. */
  .panel:not(.doc-flow):not(.document) .detail-item > span{color:#555;font-size:8.5pt}
  .panel:not(.doc-flow):not(.document) .detail-item > strong{font-size:9pt;text-align:right;min-width:0;max-width:100%;overflow-wrap:anywhere}
  /* A preview line already sits horizontally; leaving it as flex-between would space its own
     label/value pairs apart across the full width. */
  .preview-line > .detail-item{display:flex !important}

  /* KPI tiles: the screen auto-fit grid resolves to one cramped row on paper (9 tiles at ~90px),
     clipping the figures. Fixed roomy columns instead - three per row so every value prints in full,
     and the tile content can wrap rather than overflow. */
  /* FOUR TILES MUST NOT PRINT AS THREE PLUS AN ORPHAN. This was pinned at exactly three columns, so
     a party's four summary tiles came out 3 + 1, the last one stranded at a third of the width on a
     line of its own. Sized from the tile instead: at ~184mm of printable width, a 42mm minimum
     gives four columns when there are four to place and three when there are three, and a final
     short row stretches to fill rather than leaving a gap. */
  .stats-grid{grid-template-columns:repeat(auto-fit,minmax(42mm,1fr)) !important;gap:8px !important}
  .stat{padding:8px 10px}
  .stat strong{white-space:normal;overflow-wrap:anywhere}
  /* A TILE CARRYING A BREAKDOWN NEEDS MORE THAN 42mm (owner's report 20-11-2026, ADR 0299 addendum
     5). 42mm is sized for a tile that holds a label and a figure. The monthly cash tiles hold a
     name, a reference, a figure, and three label/figure lines - and a foreign account prints its
     base equivalent beside every one of them. At 42mm "Expected in" came out as "Expect ed in" and
     the base figure as "€2, 073. 73": letters stacked vertically, which is what the owner saw.
     58mm gives three per row at ~184mm of printable width, which is the same three-up the monthly
     rows already use on screen. Keyed on .month-kpi so the 42mm auto-fit above still governs the
     plain count tiles, where it is right. */
  .stats-grid.month-kpi{grid-template-columns:repeat(auto-fit,minmax(58mm,1fr)) !important}
  /* A FIGURE IS ONE TOKEN. The same rule the app already holds for a date and a reference - a split
     number reads as damage, and worse, as a different number. overflow-wrap:anywhere above is there
     so a long figure cannot overflow its tile; it must break BETWEEN the figure and the base
     equivalent beside it, never inside either. */
  .stat strong b,.stat strong small,.indicator .ind-line b,.indicator .ind-line small{white-space:nowrap}
  /* ...AND A LABEL BREAKS AT A SPACE, NEVER MID-WORD. It may take two lines (the detail-item note
     above says so); it may not be cut into syllables. */
  .indicator .ind-line em{overflow-wrap:normal;word-break:normal}
  .stat.stat-link{border-color:#666 !important;padding-inline-end:22px}
  .stat.stat-link::after{border-color:#666;opacity:1}
  /* Statement section cards: white fill + grey border like the panels, but they must be free to
     flow across pages - a tall section forced onto the next page as one block leaves the previous
     page half empty. Rows still avoid breaking (rule above), so nothing splits mid-line. A little
     extra vertical room between sections so the groups read apart even where a border meets a page
     edge. */
  .statement-lines{
    border:1px solid #bbb !important;background:#fff !important;backdrop-filter:none !important;box-shadow:none !important;
    break-inside:auto;margin:0 0 18px;
  }
  .statement-lines.is-flush{border:0 !important;background:none !important}
  .panel{padding:10px 12px;margin-bottom:10px}
  /* SCREEN BREATHING ROOM IS WASTED PAPER. The layout grids keep their 18px screen gaps in print,
     which on the party view put a finger's width of blank between a section's description and its
     own table, three times a page. Paper is the scarce surface, so the gaps come down to the panel
     spacing already set above. */
  .tab-panel,.content,.main,.stack{gap:10px !important}
  .panel-head{margin-bottom:6px}
  .panel-head p{margin:2px 0 0}
  /* A full-page document rendered as a single panel (the invoice/bill, the RFQ printable): let it
     flow across pages instead of the .panel break-inside:avoid pushing a long items list whole to the
     next page. Rows still avoid breaking and the header repeats, so it paginates cleanly. */
  .panel.doc-flow,.panel.document{break-inside:auto}
  /* A PANEL HOLDING A TABLE FLOWS. break-inside:avoid above is right for a small card - a three-line
     panel split across a page boundary reads as damage. It is wrong for a report: each statement was
     pushed whole onto its own sheet, so the reports index printed six pages that were half blank,
     and the balance sheet ended two-thirds of the way down page three (measured 01-08-2026).
     A panel whose content is a TABLE is by definition the tall kind, and it already paginates
     properly - thead repeats per page, tfoot does not, and a row never splits. */
  .panel:has(table){break-inside:auto}
  /* The tab name, borrowed onto its panel for paper (layout.php). Reads as the section title it is. */
  .print-tab-title{font-size:13pt;font-weight:800;margin:0 0 6px}
  /* A REFERENCE AND A DATE NEVER WRAP. "TRX-1-2026-0009" broke across two lines on the partner page;
     a split reference reads as two, and the house rule already says a date must stay whole. */
  .record-link,td time,th time,.col-date{white-space:nowrap}
  /* Date FILTERS print as text, not as controls. The partner statement showed its period as two
     rounded input boxes on a document a customer receives. */
  .date-picker input.js-date-display,.filter-toolbar input{
    border:0 !important;background:transparent !important;padding:0 !important;
    width:auto !important;min-width:0 !important;font:inherit !important;color:inherit !important;
  }
  .date-picker-button{display:none !important}
  /* Monthly-view groups (Income & expenses, Bank transfers): the fieldset IS the card and its inner
     panels are borderless on screen. The .panel print rule above forces a border back onto those
     inner panels, drawing a second border inside the group's border. Restore the screen intent - the
     group is the one card, inner panels divide with a hairline - and let the group flow across pages
     instead of jumping whole to the next one (which left the first page half empty). */
  .month-group{border:1px solid #bbb !important;background:#fff !important;break-inside:auto}
  .month-group > .panel{border:0 !important;background:none !important;box-shadow:none !important;break-inside:auto}
  .month-group > .panel + .panel{border-top:1px solid #bbb !important}
  a{color:#000;text-decoration:none}
  /* Collapsed sections print in full - you print everything, not the folded view. */
  .panel.js-collapsible.collapsed > :not(.panel-head):not(.panel-toggle){display:block !important}
  .panel-toggle{display:none !important}
  /* YOU PRINT THE TAB YOU ARE LOOKING AT (owner, 02-09-2026: "I print the screen view but in a
     printable version where it shows only the data and not the buttons").
     This used to force EVERY tab's panel visible - the reasoning being that a printed record should
     be complete (an arrangement's schedule AND its transactions). On a party with real history that
     produced a 27-page sheet, wider than the paper, of panels the reader never asked for; and it
     made the Print button do something other than print what is on screen, which is the one thing a
     Print button promises. A reader who wants another tab prints it from that tab.
     Note there was already a comment further down claiming this exact behaviour with no rule under
     it - the intent existed, the rule had gone. ADR 0127. */
  .tab-panel[hidden]{display:none !important}
  /* Fit tables to the portrait page: no scroll viewport, smaller text, wrap long values, and
     drop the interactive checkbox/row-action columns so the real columns aren't pushed off.
     Force a real table even when printing from a phone - the ≤680 rules stack rows into cards
     ("prints what's on screen"), so override the whole display chain + the data-label pseudo. */
  .table-wrap{overflow:visible !important}
  /* table-layout:auto proportions columns by content and collapses hidden/empty ones (so the
     dropped checkbox/action columns don't leave gaps); cells wrap (overflow-wrap below) so wide
     lists fit instead of running off the edge. */
  /* THE screen min-width (760px ≈ 201mm) is WIDER than a portrait page (~184mm printable);
     min-width beats max-width in CSS, so without this reset every printed table hangs off
     the right edge - the instalments Amount column was the visible casualty. */
  table{display:table !important;width:100% !important;min-width:0 !important;border-collapse:collapse;table-layout:auto !important}
  thead{display:table-header-group !important} /* real header row, repeated per printed page */
  tbody{display:table-row-group !important}
  tr{display:table-row !important}
  /* break-word, NOT anywhere: `anywhere` lets a column shrink to one character when the table is
     tight, so auto layout squeezed the Type column and printed "Sponsor / ship" - a word cut in
     half reads as a broken document exactly like a split date does. `break-word` keeps a word
     whole unless it genuinely cannot fit on a line by itself. */
  th,td{display:table-cell !important;font-size:8.5pt;padding:3px 4px;white-space:normal;overflow-wrap:break-word;vertical-align:top}
  td::before,th::before{display:none !important} /* drop the mobile "data-label" prefixes */
  /* A WIDE TABLE SHRINKS ITS TYPE RATHER THAN LOSING A COLUMN. With every single value nowrap, a
     table's minimum width is set by its column count, and past about eight columns that minimum is
     wider than portrait A4 - so Chrome clipped the last column at the page edge and the party's
     commitments ledger printed its Status as "Up to da" with the badge sliced in half. Nothing
     reported it: the cells were not overflowing, the PAGE was.
     Keyed on the table's actual shape rather than on a class, because the tables that need it are
     exactly the ones nobody classed - the party view's three ledgers are bare <table> elements, so
     every .stmt-table rule written for this problem missed them entirely. */
  table:has(> thead > tr > th:nth-child(8)) th,
  table:has(> thead > tr > th:nth-child(8)) td{font-size:7.5pt;padding:2px 3px}
  table:has(> thead > tr > th:nth-child(10)) th,
  table:has(> thead > tr > th:nth-child(10)) td{font-size:7pt;padding:2px}
  table:has(> thead > tr > th:nth-child(8)) .badge{font-size:7pt;padding:0 3px}
  /* A DATE, A CODE AND A STATUS ARE SINGLE VALUES - THEY DO NOT WRAP (owner's review 02-09-2026).
     This previously read "dates and reference codes may wrap, so an auto-layout table can ALWAYS
     compress to the page width", trading the firm's own rule (§12: a split date reads as broken)
     for a guarantee that nothing overflows. The party statement printed "01-09-202 / 6" and a
     status of "Up to / date", which is the exact outcome the rule exists to prevent.
     The trade was also unnecessary: a date at 8.5pt is ~13mm, and no table is too wide because of
     its date column - free text is what overruns. So the single values are nowrap AND sized to
     their content (width:1% under auto layout shrinks a column to its widest cell), which hands
     every remaining millimetre to the free-text column that actually needed it. The audit measures
     overflow on real paper, so this is proven rather than hoped. */
  td.num,th.num{white-space:nowrap}
  td.col-date,th.col-date,td.col-ref,th.col-ref,time{white-space:nowrap !important}
  /* PROTECT THE VALUE, NOT THE COLUMN. The rules above can only defend a cell somebody remembered
     to class - and the partner ledger classes one of its two date columns and neither of its
     reference columns, so its codes printed as "TRX-1-2026- / 0009". Every reference in the app is
     rendered by record_ref_link() as a.record-link (ADR 0072), so one rule keyed on the VALUE
     covers every table at once, including the ones whose columns carry no class at all. Dates are
     already safe by construction: format_date_display() joins them with a non-breaking hyphen. */
  a.record-link{white-space:nowrap !important;overflow-wrap:normal !important}
  /* width:1% shrinks a column to its content under AUTO layout - but .stmt-table is FIXED, where
     1% is taken literally and the nowrap date then overflows its own cell. So the shrink is scoped
     away from the fixed ledgers, which get a width a date actually fits in instead. */
  table:not(.stmt-table) td.col-date,table:not(.stmt-table) th.col-date,
  table:not(.stmt-table) td.col-ref,table:not(.stmt-table) th.col-ref{width:1%}
  /* Sized in ch (character widths), not in % of the paper. A percentage is a guess against a page
     width that changes with margins and scale, and 12% came out ~0.5mm short of a date - which
     under fixed layout clips rather than grows. 11ch is what "dd-mm-yyyy" IS, plus the cell padding;
     fixed layout honours it exactly and gives every remaining millimetre to the free-text column. */
  /* A status is one token even when it is two words ("Up to date", "Part paid"). */
  .badge{white-space:nowrap !important}
  table{max-width:100% !important}
  /* Badge text is authored PALE, for the dark theme. The light-theme override is keyed on
     :root[data-theme="light"], which print does not carry - the attribute is set by the theme
     toggle, and a printed page may have none - so the pale colour survived onto white paper and a
     badge came out as an empty coloured pill. On paper the tint and border carry the meaning; the
     text just has to be readable, so it is black, for every tone at once. */
  .badge{font-size:7.5pt;padding:1px 5px;min-height:auto;border:1px solid #999;color:#000 !important}
  .check-col,.row-actions{display:none !important}
  /* Wide statement ledgers (8-col partner/bank ledgers). These were FIXED layout, which splits the
     width evenly among columns that carry no explicit width - so the Reference column got the same
     share as Status and broke its codes in half, and every fix was a percentage guessed against a
     paper width that changes with margins and scale.
     AUTO layout instead (02-09-2026), which is only correct now that the single values above are
     nowrap: auto sizes each column to its content, so Date and Reference take exactly what they
     need and the free-text column absorbs the rest. Verified by print_audit against real PDFs -
     every ledger that clipped under the guessed percentages prints whole under this.
     Still width:100% of the real container - NEVER a hard mm cap: 180mm overshot the printable
     width (page margins + panel padding) and silently clipped the right-most column (the
     instalments Amount printed as 'Am'). 100% cannot overflow by construction. */
  .stmt-table{table-layout:auto !important;width:100% !important;max-width:none !important}
  /* The actions column doesn't print: its cells AND header carry .row-actions (hidden
     above), and its <col> collapses so fixed layout gives the width back to real data. */
  .stmt-table col.col-actions{width:0 !important}
  /* A record code is an identifier: it must not wrap mid-code any more than a date may (§12).
     Its own width under fixed layout, so adding it didn't squeeze the free-text Details column. */
  .stmt-table .col-ref{white-space:nowrap !important}
  /* (The bank statement's per-column percentages are gone with fixed layout: auto sizing gives
     Details the remaining width by construction, which is all the tuning was reaching for.) */
  /* (removed 02-09-2026: re-broke the dates the rule above exists to keep whole) */
  .stmt-table a:not(.record-link){white-space:normal;overflow-wrap:break-word}
  /* Report statement tables (income statement, balance sheet, cash flow, project/fund P&L, the aging
     buckets) have only a label column + narrow money columns - no long free-text column like the
     bank/partner ledgers, which keep fixed layout. The wide-ledger fixed rule above split these into
     equal columns, wrapping a long name ("Utilities - electricity, gas, water & internet" / a partner
     company name) while the row still had room. Auto layout instead: the money columns shrink to their
     content and the label column takes all the space that's left. */
  .stmt-report{table-layout:auto !important}
  .stmt-report td.num,.stmt-report th.num{width:1%;white-space:nowrap !important}
  /* The party statement's commitments ledger is 8 columns on a portrait page (it keeps fixed layout -
     auto would overrun), so its longer money headers ("Committed", "Outstanding", "Per repeat") wrap
     in an equal column. Nowrap them a touch smaller so each header sits on one line; fixed layout
     means a header slightly wider than its column can't push the table off the page. */
  /* NINE COLUMNS ON PORTRAIT PAPER. With every single value nowrap (dates, codes, money, statuses)
     this table's minimum width is fixed, and at 8.5pt that minimum is wider than the page - so the
     last column ran off the sheet and "Up to date" printed as "Up to da". Headers were already
     dropped to 7.5pt for the same reason; the body has to come with them, or the widest cell in
     each column still sets the width. */
  .stmt-commitments th,.stmt-commitments td,.stmt-commitments th.num{white-space:nowrap !important;font-size:7.5pt}
  /* THE PLEDGES REPORT PRINTS LANDSCAPE (owner's decision 11-09-2026; its @page is in its own head).
     A fixed-share portrait table fitted the page but, on the owner's printer, crushed values into
     their neighbours - text over text. Landscape gives the eleven columns 273mm, so every value sits
     whole on one line at a readable size, the table sized by its content. */
  .stmt-pledges th,.stmt-pledges th.num{font-size:7.5pt !important;letter-spacing:0}
  .stmt-pledges td{font-size:8.5pt !important;white-space:nowrap !important}
  .stmt-pledges th,.stmt-pledges td{padding-inline:6px !important}

  /* Standalone public statement: drop its 860px <main> cap + inline side padding and fit the page. */
  body>main{max-width:185mm !important;padding:0 !important;margin:0 auto !important}
  /* A landscape document (the pledges report) takes the landscape page's width, not portrait's 185mm. */
  body>main.doc-landscape{max-width:273mm !important}
  tr,article{break-inside:avoid}
  h1,h2,h3{break-after:avoid}
  /* A SECTION HEADING DOES NOT END A PAGE. The party view printed the "Commitments" heading and its
     one-line description at the foot of page 1 with the table itself starting on page 2 - the
     reader turns the page to find out what they were just promised. The heading block keeps at
     least the start of its own content with it. */
  .panel-head{break-after:avoid;break-inside:avoid}
  .panel > .panel-head + *{break-before:avoid}
  /* Our own header at the top of the document (brand · account · printed date). Turn the
     browser's own headers/footers off in the print dialog to avoid the duplicate date/URL. */
  @page{margin:12mm}
  .print-header{display:flex !important;justify-content:space-between;gap:16px;margin:0 0 10px;padding-bottom:6px;border-bottom:1px solid #bbb;font-size:9pt;color:#555}
  /* Per-section print (.js-print-section): the JS marks the target section (.print-target) and its
     ancestor path (.print-anc). At each level, hide the siblings that aren't on that path - so only
     the chosen section's subtree prints, and it paginates normally. The brand header is kept. */
  body.print-section .print-anc > *:not(.print-anc):not(.print-target):not(.print-header){display:none !important}
  /* A page that carries its own LETTERHEAD is a document: it already says who issued it, what it is
     and when. The app's own two identity blocks are then noise on paper - the screen page-head
     repeats the reference and status as a second heading, and the print-header puts the operating
     user's name ("Account: Sam Rivers") on a sheet that goes to a customer. Both go, on any page
     with a letterhead, stated once here rather than as a data-no-print attribute each document view
     has to remember (three did, the POS receipt did not, and it printed both). A page WITHOUT a
     letterhead - a journal entry, the monthly view - keeps them: there they are the only heading. */
  body:has(.statement-masthead, .doc-seller, .doc-head-meta) .page-head,
  body:has(.statement-masthead, .doc-seller, .doc-head-meta) .print-header{display:none !important}
}

/* ── Server-side SVG charts (P3.1) - tokens only ── */
.chart{width:100%;height:auto;display:block}
.chart-grid{stroke:var(--border);stroke-width:1}
.chart-text{fill:var(--mute);font-size:11px}
/* svg_bar_chart() turns each series KEY into a chart-fill-<key> class, so a series with no rule
   below inherits the SVG default - solid black bars and an invisible legend swatch, which is how
   the Business and NGO charts shipped. This fallback keeps a new series legible until it is given
   its own colour; it sits first so every specific rule below still wins (equal specificity). */
[class*="chart-fill-"]{fill:var(--soft);opacity:.85}
.chart-fill-income{fill:var(--amount-pos);opacity:.85}
.chart-fill-expense{fill:var(--amount-neg);opacity:.85}
/* Business: money in vs money out, so it reads like the finance chart above. */
.chart-fill-sales{fill:var(--amount-pos);opacity:.85}
.chart-fill-purchases{fill:var(--amount-neg);opacity:.85}
/* NGO: donations and contributions are BOTH money in, so they are two categories rather than a
   positive and a negative - the same two colours the donut leads with. */
.chart-fill-donations{fill:var(--indigo);opacity:.85}
.chart-fill-contributions{fill:var(--violet);opacity:.85}
.chart-line{fill:none;stroke:var(--indigo);stroke-width:2.5;stroke-linejoin:round}
.chart-dot{fill:var(--indigo)}
/* The NET line over the income/expense bars, and the zero it crosses. Deliberately not one of the
   two bar colours - it is a different KIND of quantity, a difference rather than a level, and
   borrowing income's green would read as a third income series. */
.chart-net{fill:none;stroke:var(--indigo);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.chart-net-dot{fill:var(--indigo)}
/* Zero is drawn only once it has moved off the floor - see svg_bar_chart. Heavier than a gridline
   and dashed, because a month that crosses it changed sign, which no gridline means. */
.chart-zero{stroke:var(--mute);stroke-width:1.5;stroke-dasharray:4 3}
.chart-donut-wrap{display:flex;gap:1.2rem;align-items:center;flex-wrap:wrap}
.chart-donut{max-width:200px;flex:0 0 auto}
.chart-slice{fill:none;stroke-width:26}
.chart-slice-0{stroke:var(--indigo)}.chart-slice-1{stroke:var(--violet)}
.chart-slice-2{stroke:var(--cyan)}.chart-slice-3{stroke:var(--amber)}
.chart-slice-4{stroke:var(--lime)}.chart-slice-5{stroke:var(--rose)}
.chart-slice-6{stroke:var(--soft)}.chart-slice-7{stroke:var(--mute)}
span.chart-swatch.chart-slice-0{background:var(--indigo)}span.chart-swatch.chart-slice-1{background:var(--violet)}
span.chart-swatch.chart-slice-2{background:var(--cyan)}span.chart-swatch.chart-slice-3{background:var(--amber)}
span.chart-swatch.chart-slice-4{background:var(--lime)}span.chart-swatch.chart-slice-5{background:var(--rose)}
span.chart-swatch.chart-slice-6{background:var(--soft)}span.chart-swatch.chart-slice-7{background:var(--mute)}
.chart-legend{display:flex;gap:1rem;flex-wrap:wrap;margin-top:.5rem}
.chart-legend-stack{flex-direction:column;gap:.35rem;margin-top:0}
.chart-legend-item{display:inline-flex;gap:.45em;align-items:center;color:var(--soft);font-size:.85rem}
.chart-legend-value{color:var(--mute)}
.chart-swatch{width:.75em;height:.75em;border-radius:3px;display:inline-block}
/* A LINE series gets a line in the legend, not a block - a block promises a third bar. */
.chart-swatch.chart-swatch-line{width:1.1em;height:0;border-radius:0;border-top:2.5px solid var(--indigo);
  background:none;vertical-align:middle}
/* Same fallback-then-specific order as the bar fills above: a legend swatch with no colour of its
   own is transparent, which reads as a missing legend rather than a series. */
.chart-swatch[class*="chart-fill-"]{background:var(--soft)}
.chart-swatch.chart-fill-income{background:var(--amount-pos)}
.chart-swatch.chart-fill-expense{background:var(--amount-neg)}
.chart-swatch.chart-fill-sales{background:var(--amount-pos)}
.chart-swatch.chart-fill-purchases{background:var(--amount-neg)}
.chart-swatch.chart-fill-donations{background:var(--indigo)}
.chart-swatch.chart-fill-contributions{background:var(--violet)}
/* ── Topbar notifications (P3.2) ── */
.notice-menu{position:relative}
.notice-menu summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:.35em;position:relative}
.notice-menu summary::-webkit-details-marker{display:none}
.notice-count{position:absolute;top:-6px;right:-8px;background:var(--rose);color:#fff;border-radius:999px;font-size:.62rem;line-height:1;padding:.22em .45em;min-width:1.5em;text-align:center}
.notice-panel{position:absolute;right:0;top:calc(100% + .5rem);width:min(340px,86vw);background:var(--bg-2);border:1px solid var(--border);border-radius:12px;box-shadow:0 18px 40px rgba(0,0,0,.45);padding:.5rem;z-index:60;display:flex;flex-direction:column;gap:.25rem}
.notice-item{display:flex;flex-direction:column;gap:.15rem;padding:.55rem .6rem;border-radius:8px;text-decoration:none;color:var(--text)}
.notice-item:hover{background:var(--panel-2)}
.notice-item span{color:var(--mute);font-size:.82rem}
.notice-item time{color:var(--mute);font-size:.72rem}
.notice-empty{color:var(--mute);padding:.6rem;margin:0;font-size:.85rem}
.notice-readall{border-top:1px solid var(--border);padding-top:.4rem;margin-top:.2rem;display:flex;justify-content:flex-end}
/* Bell dropdown: a "Needs attention" section header, an attention row with a count pill, and a
   footer link into the full center. Tone accents reuse the status rgb tokens. */
.notice-head{margin:.3rem .3rem .1rem;font-size:.68rem;font-weight:800;letter-spacing:.04em;text-transform:none;color:var(--mute)}
.notice-attention{border-left:3px solid rgba(var(--info-rgb),.7)}
.notice-attention strong{display:flex;align-items:center;gap:.4em}
.notice-pill{background:rgba(var(--info-rgb),.18);color:var(--text);border-radius:999px;font-size:.72rem;font-weight:700;padding:.05em .5em;min-width:1.6em;text-align:center}
.notice-seeall{display:block;text-align:center;border-top:1px solid var(--border);margin-top:.3rem;padding-top:.5rem;color:var(--brand);font-size:.82rem;text-decoration:none;font-weight:600}
.notice-seeall:hover{text-decoration:underline}
/* Notifications center: live attention cards. Each is a count + title + summary, tone-accented. */
.attention-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.attention-card{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--border);border-left-width:4px;border-radius:var(--r-lg);background:var(--surf-1);text-decoration:none;color:var(--text)}
.attention-card:hover{background:var(--panel-2)}
.attention-count{font-size:1.5rem;font-weight:800;line-height:1;min-width:1.4em;text-align:center}
.attention-body{display:flex;flex-direction:column;gap:.2rem;min-width:0}
.attention-body strong{font-size:.95rem}
.attention-body span{color:var(--mute);font-size:.82rem}
/* Tone accents shared by the cards, bell rows and the type badge. */
.tone-err{border-left-color:rgba(var(--err-rgb),.75)}
.tone-warn{border-left-color:rgba(var(--warn-rgb),.8)}
.tone-ok{border-left-color:rgba(var(--ok-rgb),.7)}
.tone-info{border-left-color:rgba(var(--info-rgb),.7)}
.attention-card.tone-err .attention-count{color:rgb(var(--err-rgb))}
.attention-card.tone-warn .attention-count{color:rgb(var(--warn-rgb))}
.attention-card.tone-ok .attention-count{color:rgb(var(--ok-rgb))}
.attention-card.tone-info .attention-count{color:rgb(var(--info-rgb))}
.badge.tone-err{background:rgba(var(--err-rgb),.14);border-color:rgba(var(--err-rgb),.4)}
.badge.tone-warn{background:rgba(var(--warn-rgb),.14);border-color:rgba(var(--warn-rgb),.4)}
.badge.tone-ok{background:rgba(var(--ok-rgb),.14);border-color:rgba(var(--ok-rgb),.4)}
.badge.tone-info{background:rgba(var(--info-rgb),.14);border-color:rgba(var(--info-rgb),.4)}
small.block{display:block}
/* Notification feed: a vertical list (not a table) - each item is a leading type icon + title/
   snippet/relative-time, with a tone-coloured left edge and an unread dot. Time-bucketed by
   Today / Yesterday / Earlier headers. Reuses the shared .tone-* left-edge colours + .row-menu. */
.notif-feed{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.notif-group-head{font-size:.78rem;font-weight:700;letter-spacing:.02em;color:var(--mute);padding:12px 2px 2px}
/* Inline tax-return settle control (account + date + button) - wraps on narrow screens. */
.tax-settle-form{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-bottom:4px}
.tax-settle-form select{max-width:14rem}
.notif-group-head:first-child{padding-top:2px}
.notif-item{display:flex;align-items:stretch;gap:4px;border:1px solid var(--border-soft);border-left-width:3px;border-radius:var(--r-md);background:var(--surf-1);transition:background .15s}
.notif-item:hover{background:var(--panel-2)}
.notif-item.is-unread{background:rgba(var(--brand-rgb),.06)}
.notif-item.is-unread:hover{background:rgba(var(--brand-rgb),.1)}
.notif-open{display:flex;gap:12px;align-items:flex-start;flex:1;min-width:0;padding:12px 6px 12px 12px;text-decoration:none;color:var(--text)}
.notif-icon{flex:none;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:var(--r-sm);background:var(--surf-2);color:var(--mute)}
.notif-item.tone-err .notif-icon{color:rgb(var(--err-rgb));background:rgba(var(--err-rgb),.12)}
.notif-item.tone-warn .notif-icon{color:rgb(var(--warn-rgb));background:rgba(var(--warn-rgb),.12)}
.notif-item.tone-ok .notif-icon{color:rgb(var(--ok-rgb));background:rgba(var(--ok-rgb),.12)}
.notif-item.tone-info .notif-icon{color:rgb(var(--info-rgb));background:rgba(var(--info-rgb),.12)}
.notif-body{display:flex;flex-direction:column;gap:.15rem;min-width:0}
.notif-title{display:flex;align-items:center;gap:8px;font-weight:600;font-size:.92rem}
.notif-item.is-unread .notif-title{font-weight:700}
.notif-dot{flex:none;width:8px;height:8px;border-radius:50%;background:rgb(var(--brand-rgb))}
.notif-snippet{color:var(--soft);font-size:.84rem;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.notif-meta{color:var(--mute);font-size:.76rem;margin-top:.1rem;white-space:nowrap}
/* Dates and datetimes never wrap onto two lines - a split date reads as broken (design framework
   §12). The datetime helper already glues its space; this covers the semantic <time> element. */
time{white-space:nowrap}
/* Maker-checker approval inbox: a proposal per card with a field-level diff and decide buttons. */
.approval-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.approval-item{border:1px solid var(--border-soft);border-radius:var(--r-lg);background:var(--surf-1);padding:14px 16px;display:flex;flex-direction:column;gap:8px}
.approval-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.approval-meta{font-size:.82rem;margin:0}
.approval-diff-note{margin:0;font-size:.88rem}
.approval-diff{width:100%;font-size:.86rem}
.approval-diff th{text-align:left;font-weight:600;color:var(--mute)}
.approval-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:2px}
.approval-actions .inline-form{display:inline}
.notif-snoozed{color:rgb(var(--warn-rgb))}
.notif-item .row-menu{align-self:center;padding-right:6px}
/* The unread/dismissed counter beside a status tab. */
.tab-count{display:inline-flex;align-items:center;justify-content:center;min-width:1.4em;height:1.4em;padding:0 .35em;margin-left:.15em;border-radius:999px;background:rgba(var(--brand-rgb),.22);color:inherit;font-size:.72rem;font-weight:700;vertical-align:middle}
.tab.active .tab-count{background:rgba(255,255,255,.25)}
/* A read-only value shown where an input would sit in a form grid (e.g. lifecycle-driven status). */
.static-field{display:flex;align-items:center;min-height:40px}
/* Draws the eye to a count that still needs the user to act (e.g. the monthly "To confirm" tile). */
.needs-action{color:rgb(var(--warn-rgb))}
/* Reports breakdown: a category table on the left, a filled donut (with the section name in its
   centre) on the right; stacks on narrow screens. */
.report-breakdown{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,240px);gap:24px;align-items:center}
.report-breakdown .table-wrap{overflow-x:auto}
.report-breakdown table{min-width:0}
.report-breakdown-donut{display:flex;justify-content:center}
.chart-donut-solid{max-width:230px;width:100%;height:auto}
.donut-center{fill:var(--text);font-size:15px;font-weight:800}
@media (max-width:680px){.report-breakdown{grid-template-columns:1fr}}
/* THE BALANCE SHEET'S TILES ARE AN EQUATION (ADR 0071). Assets = Liabilities + Equity, with the
   operators between the tiles, so the reader sees the sheet foot instead of being handed three
   figures and left to do the arithmetic. The grid is auto-fit like every other stats row; the
   operator columns are content-width, so nothing has to be re-tuned if a tile changes size. */
.stats-equation{grid-template-columns:repeat(auto-fit,minmax(112px,1fr));align-items:stretch}
.stats-op{display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:800;color:var(--muted);flex:0 0 auto}
/* On a phone the tiles stack, so an operator between them has to read down the column, not across. */
@media (max-width:520px){.stats-equation{grid-template-columns:1fr}.stats-op{padding:2px 0}}
/* The integrity verdict. QUIET when it agrees - it agrees essentially always, and a loud green badge
   is one people stop reading - and unmistakable when it does not. Never colour alone: each state
   carries its own mark (§9). */
.integrity-line{display:flex;align-items:baseline;gap:8px;margin:10px 0 0;font-size:13px}
.integrity-line.is-ok{color:var(--muted)}
.integrity-line.is-off{color:rgb(var(--err-rgb))}
/* A FIGURE THAT SHOULD NOT BE: a cash-drawer variance, a count that does not reconcile. One
   token class, so no screen reaches for an inline colour - and never colour alone, the sign is
   in the figure itself. */
.num.is-off{color:rgb(var(--err-rgb))}
/* A form that needs air above it, without an inline style. */
.form-spaced{margin-top:1rem}
.integrity-mark{flex:0 0 auto;font-weight:800}
.integrity-line.is-ok .integrity-mark{color:rgb(var(--ok-rgb))}
/* Income & expense analysis: sub-headings inside the one shared panel. */
.report-breakdown-title{margin:18px 0 8px;font-size:14px;font-weight:800}
.report-breakdown-title:first-of-type{margin-top:2px}
/* Compact Reports filter bar: a single wrapping row (period preset + dates + as-of + update),
   labels small and stacked, instead of the tall 6-col form grid. */
.report-filter-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px}
.report-filter-form > label,.report-custom-dates > label{display:flex;flex-direction:column;gap:4px;min-width:0;margin:0}
.report-filter-form > label > span,.report-custom-dates > label > span{font-size:11px;font-weight:800;color:var(--mute)}
.report-custom-dates{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px}
.report-custom-dates.is-hidden{display:none}
.report-scope-note{margin-top:8px;font-size:12px}
/* Right-aligned Print + Export toolbar for tabs without a panel-head to host them (Aging, Cash). */
.report-tab-tools{display:flex;justify-content:flex-end;gap:8px;margin:0 0 4px}
/* Cash projection header row: horizon pills (30/60/90) on the left, Print/Export on the right. */
.report-tab-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 6px}
.report-tab-head .report-tab-tools{margin:0}
.horizon-seg{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.horizon-seg .button{padding:6px 12px}
/* Admin entities: identity cell (logo + name), logo manager, and the invite form divider. */
.entity-cell{display:inline-flex;align-items:center;gap:.6em}
.entity-cell small{display:block}
.entity-mark{width:34px;height:34px;overflow:hidden;flex:0 0 auto}
.entity-mark img{width:100%;height:100%;object-fit:cover}
.entity-mark.lg{width:64px;height:64px}
.entity-logo-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.entity-logo-upload{display:flex;align-items:center;gap:.5em;flex-wrap:wrap}
.entity-invite{margin-top:14px;border-top:1px solid var(--border);padding-top:14px}
tr.is-unread td{font-weight:500}
tr.is-unread .record-link{font-weight:700}
/* RTL (P3.7): Arabic locale flips the document direction. Layout is mostly flex/grid so it
   mirrors automatically; these overrides catch the physical-side properties. */
[dir="rtl"] body{text-align:right}
[dir="rtl"] .sidebar{border-right:0;border-left:1px solid var(--border)}
[dir="rtl"] .nav a{text-align:right}
[dir="rtl"] .topbar-crumbs .crumb-sep{transform:scaleX(-1);display:inline-block}
[dir="rtl"] .form-actions{justify-content:flex-start}
/* DATA SURFACES STAY LTR (design rule, user decision 2026-07-05, framework §14):
   chrome (nav, headings, prose) mirrors for RTL locales, but tables, lists, pagination,
   charts and printed documents keep the SAME layout as every language - same column
   order, same alignment (§12: numbers right) - only their labels translate. Value
   tokens (amounts, codes, dates) are bidi-isolated so surrounding RTL text can never
   reorder them, and user-entered values self-determine direction (display as typed). */
[dir="rtl"] .table-wrap{direction:ltr}
[dir="rtl"] table{direction:ltr}
[dir="rtl"] table th, [dir="rtl"] table td{text-align:left}
[dir="rtl"] table th.num, [dir="rtl"] table td.num{text-align:right}
[dir="rtl"] .pagination, [dir="rtl"] .chart-wrap, [dir="rtl"] svg{direction:ltr}
[dir="rtl"] table td{unicode-bidi:plaintext}
[dir="rtl"] .stat strong, [dir="rtl"] .detail-item strong{unicode-bidi:plaintext}
/* A document letterhead is DATA (§14): an address, a phone number, an entity's own name. In an RTL
   paragraph a line STARTING with digits gets reordered - "1015 CJ Amsterdam, Netherlands" printed
   as "CJ Amsterdam, Netherlands 1015", moving the postcode to the end of the address. plaintext
   sets each line's direction from its OWN first strong character, so a Latin address reads LTR and
   an Arabic one reads RTL, without hard-coding either. */
/* The letterhead keeps its LTR geometry in EVERY language (user decision 2026-07-18):
   entity name + address stay LEFT, logo in the middle, the statement title block RIGHT -
   only the title block's TEXT runs RTL for Arabic. */
[dir="rtl"] .statement-masthead-top{direction:ltr}
[dir="rtl"] .statement-from{direction:ltr;text-align:left}
[dir="rtl"] .statement-title{direction:rtl}
/* In RTL flex-end flips to the visual LEFT - re-anchor the chip rows at the title's right edge. */
[dir="rtl"] .statement-title .doc-meta-tags{justify-content:flex-start}
[dir="rtl"] .statement-org, [dir="rtl"] .statement-org-line,
[dir="rtl"] .statement-party-name, [dir="rtl"] .statement-issuer-contact span,
[dir="rtl"] .statement-summary-cell strong{unicode-bidi:plaintext}
[dir="rtl"] .amount, [dir="rtl"] .record-link, [dir="rtl"] .num{direction:ltr;unicode-bidi:isolate}
/* Form values are data too: numeric, date, email and code inputs read LTR internally. */
[dir="rtl"] input[type="number"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="url"],
[dir="rtl"] input[type="date"], [dir="rtl"] input[inputmode="numeric"], [dir="rtl"] input[inputmode="decimal"],
[dir="rtl"] .js-date-display{direction:ltr;text-align:left}

/* --- RTL chrome fixes (walkthrough 2026-07-19) -----------------------------------------------
   Found by rendering real pages in Arabic, not by reading CSS. Chrome mirrors (§14), so anything
   anchored to a physical edge has to flip with it - a panel pinned right:0 hangs off the LEFT of
   the screen once the topbar moves.

   Deliberately NOT flipped: the nav-group and panel-toggle carets (border-right + rotate draws a
   DOWN chevron - direction-neutral), tables and pagination (§14 keeps data surfaces LTR), and the
   date-picker button inside date inputs, which stay LTR internally. */

/* Dropdown panels: measured at left:-139px and left:-54px in Arabic - both hung off-screen. */
[dir="rtl"] .notice-panel, [dir="rtl"] .user-menu-panel{right:auto;left:0}
/* Menu items are chrome copy, so they read from the right like every other label. */
[dir="rtl"] .user-menu-panel a, [dir="rtl"] .user-menu-panel button,
[dir="rtl"] .row-menu-item{text-align:right}
/* The help bubble opens from the field's reading-start edge. */
[dir="rtl"] .help-bubble{left:auto;right:0;text-align:right}
/* Gaps that sit AFTER their element in reading order. */
[dir="rtl"] .field-help{margin-left:0;margin-right:4px}
[dir="rtl"] .tab-count{margin-left:0;margin-right:.15em}
[dir="rtl"] .rate-clear-form{margin-left:0;margin-right:8px}
[dir="rtl"] .notif-item .row-menu{padding-right:0;padding-left:6px}
/* Tone accent edge belongs on the side the eye starts from. */
[dir="rtl"] .attention-card{border-left-width:1px;border-right-width:4px}
[dir="rtl"] .tone-err{border-left-color:var(--border);border-right-color:rgba(var(--err-rgb),.75)}
[dir="rtl"] .tone-ok{border-left-color:var(--border);border-right-color:rgba(var(--ok-rgb),.7)}
[dir="rtl"] .tone-warn{border-left-color:var(--border);border-right-color:rgba(var(--warn-rgb),.8)}
[dir="rtl"] .tone-info{border-left-color:var(--border);border-right-color:rgba(var(--info-rgb),.7)}

/* Screen-reader-only labels (a11y): visually removed, still announced. */
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Per-subsection create action on grouped feeds: one aligned actions COLUMN (under
   Details), so buttons line up regardless of title length; primary small - the same
   look as every section-head action (§11). */
.group-row .group-row-action-cell{padding-top:6px;padding-bottom:6px}
.group-row .group-row-action-cell .button{margin:0}

/* Walkthrough: recycle bin + account/security polish (§1 no inline styles). */
.recycle-actions{display:flex;gap:var(--space-2,.5rem);justify-content:flex-end;flex-wrap:wrap}
.recycle-actions form{display:inline}
.twofa-key{font-size:1.05rem;letter-spacing:.12em}
/* Recovery codes in their one-and-only appearance. Monospace and generously spaced because these get
   copied by hand as often as by button, and a misread character is a code that never works. */
.recovery-codes{
  margin:0 0 14px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:var(--r);
  background:var(--surf-1);
  color:var(--text);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:1rem;
  line-height:1.9;
  letter-spacing:.08em;
  white-space:pre;
  overflow-x:auto;
  user-select:all;
}
.recovery-ack{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:4px 0 14px;
  color:var(--soft);
  font-size:14px;
  cursor:pointer;
}
.recovery-ack input{margin-top:2px;flex:0 0 auto}
/* Printing the recovery modal prints the CODES, not the page behind them. The script re-parents the
   dialog to <body> on open precisely so this selector can reach it - nested, it hid its own
   ancestors and printed a blank sheet. The buttons and the acknowledgement are screen furniture.

   SCOPED TO THE DIALOG BEING OPEN. Unscoped, this sat inside a plain @media print and so hid every
   direct child of <body> on EVERY page in the app - printing anything produced a blank sheet, which
   is exactly what it was written to prevent (owner's report 01-08-2026: "white empty page" printing
   a recurring entry). :has() is already relied on by the print rules below. */
@media print{
  body:has(#recovery-dialog[open]) > *:not(#recovery-dialog){display:none !important}
  #recovery-dialog{position:static;display:block;border:0;box-shadow:none;max-width:none;margin:0}
  #recovery-dialog::backdrop{display:none}
  #recovery-dialog .modal-actions,#recovery-dialog .recovery-ack{display:none !important}
  .recovery-codes{border:1px solid #000;color:#000;background:#fff}
}
/* The setup QR. The white plate is NOT decoration and must not follow the theme: a scanner needs
   dark-on-light with a light quiet zone around it, so the code keeps its own background in dark mode
   and in print. Sized in ch-independent units and capped so it never overflows a narrow phone. */
.twofa-qr{
  display:inline-block;
  margin:4px 0 12px;
  padding:0;
  border-radius:var(--r);
  background:#fff;
  line-height:0;
}
.twofa-qr svg{width:100%;max-width:260px;height:auto;display:block}
.passkey-add-fields{margin-top:.6em}
.js-passkey-add-error{color:var(--err,#ff9d9d)}

/* Notifications preferences grid (account tab). */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.notif-grid th.notif-ch,.notif-grid td.notif-ch{text-align:center;width:6.5rem}
.notif-grid .notif-group-row th{background:var(--bg-hover,rgba(127,127,127,.08));font-weight:600;text-align:left;padding-top:.7rem}
.notif-grid td strong{display:block}
.notif-desc{display:block;font-size:.85em;margin-top:.15rem}
.notif-check{display:inline-flex;align-items:center;justify-content:center;margin:0}
.notif-check input{margin:0}
.notif-push-error{color:var(--err,#ff9d9d)}
@media (max-width:640px){
  .notif-grid th.notif-ch{width:auto}
  .notif-grid td.notif-ch{width:auto;text-align:right}
}

/* Clickable column-header sorting on generic engine lists (Date / Due date / Amount). Hardcoded
   module order is the default; ?sort/?dir override it. */
th .col-sort{color:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer;border-radius:5px;padding:2px 5px;margin:-2px -5px;transition:background .12s,color .12s}
th .col-sort:hover{color:var(--text);background:var(--panel-2)}
th.num .col-sort{justify-content:flex-end}
.sort-ind{font-size:.95em;opacity:.6;line-height:1}
.col-sort:hover .sort-ind{opacity:.9}
.col-sort.is-sorted{color:var(--text)}
.col-sort.is-sorted .sort-ind{opacity:1;color:var(--indigo)}
/* Mobile sort control (the header row is hidden when the table stacks into cards). */
.list-sort-mobile{display:none}
@media (max-width:640px){
  .list-sort-mobile{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin:0 0 12px}
  .list-sort-mobile .list-sort-field{display:flex;flex-direction:column;gap:4px}
  .list-sort-mobile .list-sort-field span{font-size:12px;color:var(--mute)}
  .list-sort-mobile select{min-width:150px}
}

/* Read-only (viewer role) safety net: the backend denies every write route for viewers, and the
   common action buttons are gated server-side. This hides any residual write control - links to
   write routes, POST action forms, and bulk-selection checkboxes - so a viewer's UI is truly
   read-only everywhere, even on inline row/detail actions that aren't individually gated. */
.shell[data-viewer] a[href*="/new?"],
.shell[data-viewer] a[href$="/new"],
.shell[data-viewer] a[href*="/edit/"],
.shell[data-viewer] a[href*="/reverse/"],
.shell[data-viewer] a[href*="/dispose/"],
.shell[data-viewer] a[href*="/delete/"],
.shell[data-viewer] a[href*="/toggle/"],
.shell[data-viewer] a[href*="/correct/"],
.shell[data-viewer] a[href*="/convert/"],
.shell[data-viewer] a[href*="/review/"],
.shell[data-viewer] a[href*="/dispose"],
.shell[data-viewer] form[action*="/new"],
.shell[data-viewer] form[action*="/edit"],
.shell[data-viewer] form[action*="/store"],
.shell[data-viewer] form[action*="/update"],
.shell[data-viewer] form[action*="/delete"],
.shell[data-viewer] form[action*="/reverse"],
.shell[data-viewer] form[action*="/dispose"],
.shell[data-viewer] form[action*="/toggle"],
.shell[data-viewer] form[action*="/archive"],
.shell[data-viewer] form[action*="/correct"],
.shell[data-viewer] form[action*="/collections"],
.shell[data-viewer] form[action*="/recalc"],
.shell[data-viewer] form[action*="/notify"],
.shell[data-viewer] form[action*="/convert"],
.shell[data-viewer] form[action*="/send"],
.shell[data-viewer] form[action*="/accept"],
.shell[data-viewer] form[action*="/cancel"],
.shell[data-viewer] form[action*="/stage"],
.shell[data-viewer] form[action*="/post"],
.shell[data-viewer] form[action*="/generate"],
.shell[data-viewer] form[action*="/close"],
.shell[data-viewer] form[action*="/skip"],
.shell[data-viewer] form[action*="/discard"],
.shell[data-viewer] form[action*="/depreciate"],
.shell[data-viewer] .row-menu,
.shell[data-viewer] .check-col,
.shell[data-viewer] .js-check-all,
.shell[data-viewer] .js-row-check,
.shell[data-viewer] .js-bulk-submit,
.shell[data-viewer] .timeline-add {
  display: none !important;
}
/* A labelled sub-heading inside a form-grid, spanning the full width to group related fields. */
.form-section-label{grid-column:1/-1;margin:8px 0 0;font-size:.8rem;font-weight:700;color:var(--mute);text-transform:none}

/* ---------------------------------------------------------------------------------------------
   The combined public landing page (manager.bawtag.com, and finance./partners. on their own tab).
   PURE-CSS TABS: a radio per tab, then labels and panels that a sibling selector switches. The page
   is the front door for people who are not signed in, so it must work with scripting off entirely -
   the active tab is chosen server-side from the host and rendered as the checked radio.
   --------------------------------------------------------------------------------------------- */
.landing-body{margin:0}
.landing-wrap{max-width:960px;margin:0 auto;padding:48px 20px 64px}
.landing-head{margin-bottom:28px}
.landing-head h1{margin:.2em 0}
.landing-tab-input{position:absolute;opacity:0;pointer-events:none}
.landing-tab-bar{display:flex;flex-wrap:wrap;gap:6px;border-bottom:1px solid var(--border);margin-bottom:22px}
.landing-tab{padding:10px 16px;border-radius:var(--r) var(--r) 0 0;cursor:pointer;font-weight:700;
  color:var(--mute);border:1px solid transparent;border-bottom:0;white-space:nowrap}
.landing-tab:hover{color:var(--soft);background:var(--hover)}
/* Keyboard: the label is focusable, so the ring has to be visible on it (framework §9). */
.landing-tab:focus-visible{outline:2px solid rgb(var(--brand-rgb));outline-offset:-2px}
.landing-panel{display:none}
.landing-features{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin:22px 0}
.landing-features article{padding:16px;border:1px solid var(--border);border-radius:var(--r-lg);background:var(--bg-2)}
.landing-features h3{margin:0 0 6px;font-size:1rem}
.landing-features p{margin:0;color:var(--soft)}
.landing-actions{margin-top:26px}
.landing-foot{margin-top:48px;padding-top:18px;border-top:1px solid var(--border)}
/* One pair per tab: the checked radio lights its label and reveals its panel. Written out rather
   than generated, because the tab set is fixed and four explicit rules read better than a loop. */
#lt-finance:checked  ~ .landing-tab-bar label[for="lt-finance"],
#lt-business:checked ~ .landing-tab-bar label[for="lt-business"],
#lt-ngo:checked      ~ .landing-tab-bar label[for="lt-ngo"],
#lt-partners:checked ~ .landing-tab-bar label[for="lt-partners"]{
  color:var(--text);background:var(--bg-2);border-color:var(--border)}
#lt-finance:checked  ~ #lp-finance,
#lt-business:checked ~ #lp-business,
#lt-ngo:checked      ~ #lp-ngo,
#lt-partners:checked ~ #lp-partners{display:block}
/* On a phone the four tabs wrap to two rows and leave the last one orphaned under three - it works,
   but it reads as an afterthought rather than a set. A 2x2 grid keeps all four visible and evenly
   weighted, with no horizontal swipe to discover (checked on the live page at 375px, 31-07-2026). */
@media (max-width:430px){
  .landing-tab-bar{display:grid;grid-template-columns:1fr 1fr;gap:4px}
  .landing-tab{text-align:center;padding:11px 8px;border-radius:var(--r)}
}

/* Inline list collapser (more_toggle()): a worded, counted button that folds a list's tail. Quiet -
   it is a disclosure, not an action competing with the row it sits under. */
.inline-more{
  appearance:none;background:none;border:0;padding:2px 0;
  color:var(--cyan);font:600 13px/1.4 var(--font);cursor:pointer;text-align:left;
}
.inline-more:hover{text-decoration:underline}
.inline-more:focus-visible{outline:2px solid var(--cyan);outline-offset:2px;border-radius:var(--r)}

/* An action on a column header - the way to change what the column shows, where the column is
   (20-08-2026). Sized down and set apart so it reads as a control, not as part of the heading. */
th .th-action{margin-inline-start:8px;font-size:.78rem;font-weight:400}

/* A tile whose label and figure share one line (20-08-2026): three projected tiles stacked over
   three actual ones was a lot of height for six numbers. The label takes the room it needs and the
   figure sits hard right, so a column of these still reads down the amounts. */
.stat-inline .stat-inline-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.stat-inline .stat-inline-head > span{color:var(--muted);font-size:.82rem}
.stat-inline .stat-inline-head > strong{font-size:1.05rem}

/* The batch-result modal's body: sections of records, each row a reference and what it needs.
   Scrolls inside the card rather than growing the dialog past the viewport - a sweep of forty
   drafts is a long list and the Close button has to stay reachable. */
.result-report{max-height:min(52vh,420px);overflow-y:auto;margin:8px 0 4px}
.result-report h3{margin:14px 0 6px;font-size:13px;font-weight:800;color:var(--text)}
.result-report h3:first-child{margin-top:0}
.result-report-list{list-style:none;margin:0;padding:0}
.result-report-list li{padding:5px 0;border-bottom:1px solid var(--border);font-size:14px}
.result-report-list li:last-child{border-bottom:0}

/* A GROUPED LIST'S HEADING ROW (owner's request 08-09-2026). One table, one header row, and the
   group name on a row between the rows it heads - the shape the chart of accounts reads in. The
   whole row is the control, so the button fills it and carries its own focus ring. */
.group-row td{background:var(--bg-hover);padding:0}
.group-toggle{display:flex;align-items:center;gap:.5rem;width:100%;padding:.55rem .75rem;
  background:none;border:0;color:var(--text-primary);font:inherit;font-weight:600;text-align:start;cursor:pointer}
.group-toggle:hover{background:var(--bg-hover)}
.group-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.group-chevron{display:inline-block;transition:transform .15s ease;color:var(--text-secondary)}
.group-count{margin-inline-start:auto;color:var(--text-secondary);font-weight:400;font-size:12px}
/* The group's total closes the heading row, after the count. Tabular figures so totals line up
   down a column of groups, and it never wraps away from its own heading. */
/* A TILE WHOSE WORK IS LATE carries a coloured EDGE, never a filled background: a page of red
   panels reads as a broken screen rather than as work to do, and the figures inside must stay
   readable. The edge is paired with a counted chip in the markup - colour never states anything on
   its own (§9). */
.stat.is-overdue{border-inline-start:3px solid rgb(var(--err-rgb))}
.stat.is-short{border-inline-start:3px solid rgb(var(--err-rgb))}
.stat.is-due{border-inline-start:3px solid rgb(var(--warn-rgb))}
.stat.is-overdue .badge,.stat.is-due .badge{margin-inline-start:.4rem}
.group-total{color:var(--text-primary);font-weight:600;font-size:13px;white-space:nowrap;
  font-variant-numeric:tabular-nums}
.group-row .group-name{display:inline-block;padding:.55rem .75rem;font-weight:600}
