/* Lighthouse Back Office — Modern, Segoe UI, navy/gold financial style */
:root {
  --navy: #16233b;
  --navy-2: #1e2f4f;
  --gold: #c9a227;
  --gold-soft: #f4ecd4;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c2530;
  --muted: #5E6875;
  --line: #e3e7ee;
  --green: #1e7d46;
  --red: #b23a3a;
  /* Amber words, and a badge filled with amber. The words were #b07d10, 3.6:1 on white (review of #145): #8a6210 reads at
     4.5:1 or more on every light page, card, inset panel and tint of the accent (Meadow's and Portal's tints take a shade
     darker, below). A badge keeps the old amber as its fill, with dark ink on it (5.0:1). */
  --amber: #8a6210;
  --amber-fill: #b07d10;
  /* The ink on a badge or a chip filled with amber, red or green (the accent's is --on-gold, prefs.css). White on the dark
     theme's light red, green and amber read at 1.5 to 2.9:1; there it is dark. */
  --on-amber: #1c1607;
  --on-red: #fff;
  --on-green: #fff;
  --bg-soft: #f6f8fa;   /* subtle inset panels (guide boxes, sign-off blocks) */
  --panel: #f6f7f9;
  --mut: #6b7686;
}
/* dark theme */
/* The Lighthouse palette — near-black, gold beam, mint highlight. Francis chose it from the
   dashboard panel and asked for it everywhere, so the whole app wears it rather than one screen.
   Only the variables change: every dark-mode rule below was already written against them. */
html[data-theme="dark"] {
  --navy: #111722; --navy-2: #8fb2ff; --gold: #E8B03F; --gold-soft: #2A2210;
  --bg: #0B0F14; --card: #111722; --text: #E5EAF2; --muted: #8B99AD; --line: #1F2937;
  --green: #5EEAD4; --red: #F0716A; --amber: #E8B03F;
  --amber-fill: var(--amber); --on-red: #1c1607; --on-green: #1c1607;
}
html[data-theme="dark"] body { background: var(--bg); }
html[data-theme="dark"] th { background: #151D2B; }
html[data-theme="dark"] .card table tr:hover td,
html[data-theme="dark"] .kpi:hover { background: #151D2B; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background: #0D131C; color: var(--text); border-color: #243040; }
html[data-theme="dark"] tr.total td { background: #2a2410; }
/* dark mode: --navy is a SURFACE colour here, so text roles that borrow it must use light ink.
   (Fixes unreadable headings/values/ghost buttons in dark, Aurora and Beacon.) */
html[data-theme="dark"] h1, html[data-theme="dark"] h2 { color: var(--text); }
html[data-theme="dark"] .kpi .value { color: var(--text); }
html[data-theme="dark"] .btn.ghost { color: var(--text); border-color: var(--line); }
html[data-theme="dark"] .btn.ghost:hover { background: var(--card); color: var(--text); }
html[data-theme="dark"] .tab:hover { color: var(--text); }
html[data-theme="dark"] { --bg-soft:#151D2B; --panel:#111722; --mut:#8B99AD; }
html[data-theme="dark"] table tr:hover td { background: #151D2B; }
html[data-theme="dark"] table.reg tbody tr:hover td { background: #151D2B; }
html[data-theme="dark"] .tab { background: #151D2B; }
html[data-theme="dark"] .badge.conditional, html[data-theme="dark"] .badge.unmatched { background:#3a2f10; color:#e9c25c; }
html[data-theme="dark"] .badge.firm { background:#152a4a; color:#8fb2ff; }
html[data-theme="dark"] .badge.cancelled { background:#3a1720; color:#ff9d97; }
html[data-theme="dark"] .badge.excluded { background:#242c3a; color:#94a1b6; }
html[data-theme="dark"] .error-box { background:#3a1720; color:#ff9d97; }
html[data-theme="dark"] .ok-box { background:#123020; color:#57c98a; }
html[data-theme="dark"] .rpt-badge.red { background:#3a1720; color:#ff9d97; }
/* financial statements stay as white "paper" sheets in dark mode — print-first documents
   whose inks are deliberately hardcoded dark */
html[data-theme="dark"] .statement { background: #fff; }
html[data-theme="dark"] .statement tr:hover td { background: #f6f8fb; }
html[data-theme="dark"] .statement th, html[data-theme="dark"] .statement tr.colhead th { background: none; color: #5a6472; }
html[data-theme="dark"] .statement tr.total td, html[data-theme="dark"] .statement tr.grand td { background: #f4ecd4; color: #17233a; }
html[data-theme="dark"] .statement td { color: #23272e; }
html[data-theme="dark"] .statement table { background: transparent; }
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}

/* ================= LAYOUTS (structure only) — html[data-layout] =================
   modern · compact · executive · topnav · rail · rightbar
   Colours come from PALETTES below, so layout + palette are independent. */

/* COMPACT — dense, data-packed. Narrow sidebar, tight tables/cards. */
html[data-layout="compact"] .sidebar { width: 190px; }
html[data-layout="compact"] .main { padding: 14px 20px; max-width: 1200px; }
html[data-layout="compact"] h1 { font-size: 18px; }
html[data-layout="compact"] h2 { font-size: 13px; margin: 12px 0 6px; }
html[data-layout="compact"] .card { padding: 9px 12px; margin-bottom: 11px; border-radius: 4px; }
html[data-layout="compact"] .kpi { padding: 7px 10px; }
html[data-layout="compact"] .kpi .value { font-size: 16px; }
html[data-layout="compact"] .kpis { gap: 8px; --kpi-min: 135px; }
html[data-layout="compact"] th { padding: 4px 8px; font-size: 12px; }
html[data-layout="compact"] td { padding: 3px 8px; font-size: 12px; }
html[data-layout="compact"] .nav a { padding: 7px 20px; font-size: 13px; }
html[data-layout="compact"] .topbar { padding: 5px 10px; }

/* EXECUTIVE — airy, oversized headings & KPIs, rounded cards, serif titles. */
html[data-layout="executive"] .main { max-width: 1160px; padding: 30px 40px; }
html[data-layout="executive"] h1 { font-size: 26px; font-family: Georgia, "Aptos Display", serif; }
html[data-layout="executive"] h2 { font-size: 16px; font-family: Georgia, "Aptos Display", serif; }
html[data-layout="executive"] .card { border-radius: 16px; padding: 22px 24px; }
html[data-layout="executive"] .kpis { gap: 18px; }
html[data-layout="executive"] .kpi { border-radius: 16px; padding: 20px 18px; }
html[data-layout="executive"] .kpi .value { font-size: 27px; }
html[data-layout="executive"] .kpi .label { font-size: 12px; letter-spacing: 1px; }

/* TOPNAV — navigation on a horizontal top bar; no left sidebar; full-width. */
html[data-layout="topnav"] .shell { flex-direction: column; }
html[data-layout="topnav"] .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 0 8px; }
html[data-layout="topnav"] .brand { padding: 8px 14px 8px 6px; border: 0; }
html[data-layout="topnav"] .brand .sub { display: none; }
html[data-layout="topnav"] .nav { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0; flex: 1; overflow: visible; }
html[data-layout="topnav"] .nav .sep, html[data-layout="topnav"] .nav .hint { display: none; }
html[data-layout="topnav"] .nav a { border-left: 0; border-radius: 8px 8px 0 0; padding: 12px; white-space: nowrap; }
html[data-layout="topnav"] .nav a.active { background: var(--gold); color: var(--on-gold); font-weight: 600; }
html[data-layout="topnav"] .nav a .ic { margin-right: 4px; }
html[data-layout="topnav"] .userbox { border: 0; padding: 8px 14px; white-space: nowrap; }
html[data-layout="topnav"] .main { border-top: 3px solid var(--gold); max-width: none; }

/* RAIL — slim icon-only left rail. */
html[data-layout="rail"] .sidebar { width: 62px; }
html[data-layout="rail"] .sidebar .lbl, html[data-layout="rail"] .nav .sep, html[data-layout="rail"] .nav .hint,
html[data-layout="rail"] .brand .sub, html[data-layout="rail"] .brand .logo-full, html[data-layout="rail"] .userbox .lbl { display: none; }
html[data-layout="rail"] .brand .logo-mini { display: inline; color: var(--gold); }
html[data-layout="rail"] .brand { padding: 16px 10px; text-align: center; }
html[data-layout="rail"] .nav a { text-align: center; padding: 12px 0; }
html[data-layout="rail"] .nav a .ic { margin: 0; width: auto; font-size: 17px; }
html[data-layout="rail"] .userbox { text-align: center; padding: 12px 4px; }

/* OPEN BOOK — the books open like a real ledger: spine tabs, paper pages, and on list screens
   a two-page master-detail split (row click loads the record into the right page — see foot.ejs). */
/* the desk: warm parchment behind the floating book (light theme only) */
html[data-layout="openbook"], html[data-layout="openbook"] body { background: var(--bg-soft); }
html[data-theme="dark"][data-layout="openbook"], html[data-theme="dark"][data-layout="openbook"] body { background: var(--bg); }
/* the desk sits a shade under the page so the book reads as paper on a surface */
html[data-layout="openbook"] .main { box-shadow: 0 14px 38px rgba(20, 30, 44, .14), 0 0 0 1px var(--line); }
/* slim icon spine; hover it and the full menu flies out over the page. The ☰ button pins the
   full classic menu instead (html.ob-nav-full) — every spine rule is scoped :not(.ob-nav-full). */
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar { width: 58px; transition: width .16s ease, margin-right .16s ease; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover, html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:focus-within {
  width: 232px; margin-right: -174px; z-index: 120; box-shadow: 14px 0 44px rgba(10, 18, 30, .38);
}
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .lbl, html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:focus-within .lbl,
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .userbox .lbl { display: inline; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .nav .sep, html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .nav .hint,
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .brand .sub { display: block; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .brand .logo-full { display: inline; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .brand .logo-mini { display: none; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .brand { text-align: left; padding: 12px 16px 10px; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .nav a { text-align: left; padding: 10px 14px; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .nav a .ic { margin-right: 8px; width: 20px; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar:hover .userbox { text-align: left; padding: 12px 16px; }
html[data-layout="openbook"]:not(.ob-nav-full) .sidebar .lbl, html[data-layout="openbook"]:not(.ob-nav-full) .nav .sep,
html[data-layout="openbook"]:not(.ob-nav-full) .nav .hint, html[data-layout="openbook"]:not(.ob-nav-full) .brand .sub,
html[data-layout="openbook"]:not(.ob-nav-full) .brand .logo-full, html[data-layout="openbook"]:not(.ob-nav-full) .userbox .lbl { display: none; }
html[data-layout="openbook"]:not(.ob-nav-full) .brand .logo-mini { display: inline; color: var(--gold); }
html[data-layout="openbook"]:not(.ob-nav-full) .brand { padding: 14px 8px; text-align: center; }
html[data-layout="openbook"]:not(.ob-nav-full) .nav a { text-align: center; padding: 11px 0; margin: 2px 0 2px 6px; border-left: 0; border-radius: 0 10px 10px 0; }
html[data-layout="openbook"]:not(.ob-nav-full) .nav a .ic { margin: 0; width: auto; font-size: 16px; }
html[data-layout="openbook"]:not(.ob-nav-full) .nav a.active { background: var(--gold); padding-right: 8px; }
html[data-layout="openbook"]:not(.ob-nav-full) .userbox { text-align: center; padding: 12px 4px; }
/* the book itself, centered on the desk */
html[data-layout="openbook"] .main {
  background: var(--card); max-width: 1640px; margin: 16px auto 26px; padding: 24px 30px;
  border: 1px solid var(--line); border-radius: 8px 18px 18px 8px;
  box-shadow: 0 18px 44px rgba(20, 30, 44, .18);
}
html[data-layout="openbook"] .topbar { max-width: 1640px; margin: 10px auto 0; border-radius: 12px; row-gap: 4px; }
html[data-layout="openbook"] .tb-search { flex: 0 1 300px; }
/* the left page keeps its own horizontal scroll instead of clipping columns */
html[data-layout="openbook"] .bk-left { overflow-x: auto; }
html[data-layout="openbook"] .bk-left table { font-size: 13px; }
html[data-layout="openbook"] .bk-left th, html[data-layout="openbook"] .bk-left td { padding: 6px 7px; }
html[data-layout="openbook"] .bk-left th { font-size: 12px; letter-spacing: .3px; }
html[data-layout="openbook"] .bk-left .page-head h1 { font-size: 21px; }
html[data-layout="openbook"] .bk-left .filters, html[data-layout="openbook"] .bk-left .tabs { gap: 5px; }
html[data-layout="openbook"] .bk-left .btn { font-size: 13px; padding: 6px 10px; }
/* the right page fills the visible book height */
html[data-layout="openbook"] .bk-right iframe { height: calc(100vh - 220px); min-height: 620px; }
/* an embedded record fits its page instead of scrolling sideways: tighter type, tighter
   spacing, and every wide control allowed to shrink. */
html.embed { font-size: 13px; }
html.embed .main { padding: 8px 12px !important; }
html.embed h1 { font-size: 19px; }
html.embed h2 { font-size: 14px; }
html.embed .card { padding: 10px 12px; margin-bottom: 9px; }
html.embed table { font-size: 13px; width: 100%; table-layout: auto; }
html.embed th, html.embed td { padding: 5px 6px; }
html.embed input, html.embed select, html.embed textarea { max-width: 100%; min-width: 0; font-size: 13px; padding: 5px 7px; }
html.embed .filters > div, html.embed .grid > div { min-width: 0 !important; }
html.embed .grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
html.embed .kpis { gap: 8px !important; --kpi-min: calc(50% - 8px); }
html.embed .btn { padding: 5px 10px; font-size: 13px; }
html.embed .tabbar { gap: 4px; }
html.embed .tab { padding: 4px 9px; font-size: 12px; }
html.embed .page-head { flex-wrap: wrap; gap: 6px; }
html.embed * { max-width: 100%; }

/* an embedded record renders on white paper, never on the desk colour */
html.embed, html.embed body { background: var(--card) !important; }
/* the two-page split (built by foot.ejs on list screens) */
html[data-layout="openbook"] .bk-split { display: grid; grid-template-columns: minmax(0, 1fr); position: relative; }
html[data-layout="openbook"] .bk-split::before {
  content: ""; position: absolute; left: 0; right: 0; top: auto; bottom: auto; height: 0; width: auto; transform: none;
  background: linear-gradient(90deg, transparent, rgba(30,40,55,.10) 46%, rgba(30,40,55,.20) 50%, rgba(30,40,55,.10) 54%, transparent);
  pointer-events: none;
}
html[data-layout="openbook"] .bk-left { padding-right: 0; min-width: 0; }
html[data-layout="openbook"] .bk-right { padding: 14px 0 0; margin-top: 12px; border-top: 2px solid var(--line); min-width: 0; display: flex; flex-direction: column; }
html[data-layout="openbook"] .bk-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
html[data-layout="openbook"] .bk-right iframe { width: 100%; flex: 1; min-height: 520px; border: 0; background: transparent; }
html[data-layout="openbook"] tr.bk-sel td { background: var(--gold-soft) !important; }
html[data-layout="openbook"] tr.bk-sel td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
@media (max-width: 1000px){ html[data-layout="openbook"] .bk-split { grid-template-columns: 1fr; } html[data-layout="openbook"] .bk-split::before { display:none; } html[data-layout="openbook"] .bk-right { padding-left: 0; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; } }
/* embed mode — a page rendered inside the right page of the book (chrome hidden) */
html.embed .sidebar, html.embed .topbar, html.embed .userbox { display: none !important; }
html.embed .main { padding: 6px 10px !important; margin: 0 !important; max-width: none !important; border: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 0 !important; }

/* RIGHTBAR — sidebar on the RIGHT side. */
html[data-layout="rightbar"] .shell { flex-direction: row-reverse; }
html[data-layout="rightbar"] .sidebar { border-left: 1px solid rgba(255,255,255,.06); }
html[data-layout="rightbar"] .nav a { border-left: 0; border-right: 3px solid transparent; }
html[data-layout="rightbar"] .nav a.active { border-left-color: transparent; border-right-color: var(--gold); }

/* ================= PALETTES (colour only) — html[data-palette], light mode only ================= */
html:not([data-theme="dark"])[data-palette="teal"] { --navy:#123b39; --gold:#0d9488; --gold-soft:#d5f0ec; --bg:#eef6f4; }
html:not([data-theme="dark"])[data-palette="amber"] { --navy:#2b3a4a; --gold:#e07a1f; --gold-soft:#fbe7d1; --bg:#eef1f4; }
html:not([data-theme="dark"])[data-palette="forest"] { --navy:#1e3a2f; --gold:#3f7d4f; --gold-soft:#dcecdd; --bg:#eef4ef; }
html:not([data-theme="dark"])[data-palette="burgundy"] { --navy:#3a1e28; --gold:#a8324a; --gold-soft:#f2dde2; --bg:#f5eef0; }
html:not([data-theme="dark"])[data-palette="indigo"] { --navy:#1b1f3b; --gold:#6d5cff; --gold-soft:#e7e3ff; --bg:#eef0fb; }
/* --- Theme Gallery palettes (1 = navy default) --- */
html:not([data-theme="dark"])[data-palette="fresh"]  { --navy:#123329; --navy-2:#1c4a3a; --gold:#0e9f7e; --gold-soft:#dcf1ea; --bg:#f4f8f6; }
html:not([data-theme="dark"])[data-palette="slate"]  { --navy:#273244; --navy-2:#33415a; --gold:#2f6feb; --gold-soft:#e5edfb; --bg:#eef1f6; }
html:not([data-theme="dark"])[data-palette="meadow"] { --navy:#264430; --navy-2:#315540; --gold:#2f6b3e; --gold-soft:#dfeada; --bg:#f6f4ea; }
/* Meadow's and Portal's tints of the accent are the two darkest light ones: the house amber words read at 4.4:1 on them,
   this shade at 4.7:1 (a Needs-attention chip on a deal is amber on the tint). */
html:not([data-theme="dark"]):is([data-palette="meadow"], [data-palette="portal"]) { --amber: #845e0f; }
/* Aurora — a dark, glassy identity; rides on dark mode with a cyan accent. --navy-2 is the colour of every link, and in the
   dark theme a light one (as every other palette's is): it was #141a3a, a surface's colour, so each link, a tenant's
   name on Tenants, "The lease PDF", read at 1.0 to 1.1:1 on the card (review of #145's follow-ups). */
html[data-theme="dark"][data-palette="aurora"] { --navy:#0a0e24; --navy-2:#7fd4f5; --gold:#39e0cf; --gold-soft:#123040; --bg:#0d1230; --card:#141a2e; --line:#252c4a; }
/* 'navy' is the built-in default — no override needed */

/* 6 · PEIAGENTS Portal — matches peiagents.com/agent-portal: warm paper, brass gold, night blue,
   Fraunces serif headings + Hanken Grotesk body + DM Mono figures. Opt-in; classic stays default. */
html:not([data-theme="dark"])[data-palette="portal"] {
  --navy:#1C3A4B; --navy-2:#26495B; --gold:#C69214; --gold-soft:#F3E7C6; --bg:#EFEDE6;
  --card:#FBFAF6; --line:#E0DDD5; --text:#2B2D30; --muted:#5F6266;
}
html:not([data-theme="dark"])[data-palette="portal"] body {
  font-family: "Hanken Grotesk", "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
}
html:not([data-theme="dark"])[data-palette="portal"] h1,
html:not([data-theme="dark"])[data-palette="portal"] h2,
html:not([data-theme="dark"])[data-palette="portal"] .rpt-name,
html:not([data-theme="dark"])[data-palette="portal"] .login-card h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: .1px;
}
html:not([data-theme="dark"])[data-palette="portal"] .card,
html:not([data-theme="dark"])[data-palette="portal"] .kpi,
html:not([data-theme="dark"])[data-palette="portal"] .rpt-card { border-radius: 12px; }
html:not([data-theme="dark"])[data-palette="portal"] .btn,
html:not([data-theme="dark"])[data-palette="portal"] .tb-btn,
html:not([data-theme="dark"])[data-palette="portal"] .tb-search input { border-radius: 9px; }
html:not([data-theme="dark"])[data-palette="portal"] .kpi .value,
html:not([data-theme="dark"])[data-palette="portal"] .num {
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
html:not([data-theme="dark"])[data-palette="portal"] .kpi .label {
  text-transform: uppercase; letter-spacing: .08em; font-size: 12px;
}
html:not([data-theme="dark"])[data-palette="portal"] .btn.gold {
  background: linear-gradient(135deg, #C69214, #F0B01E); border-color: #C69214;
  color: #241d07; font-weight: 700;
}
html:not([data-theme="dark"])[data-palette="portal"] .topbar { background: var(--card); }

/* 7 · Beacon — matches dashboard.ftventures.ca: near-black, mint accent, gold CTAs,
   Nunito/Inter type, mono figures. Dark identity (auto-switches to dark mode). */
/* --navy-2, the links, a light mint as the dark theme's links are: #101828 read at 1.0 to 1.1:1 on the card */
html[data-theme="dark"][data-palette="beacon"] {
  --navy:#06080f; --navy-2:#7fe6d0; --gold:#2dd4bf; --gold-soft:#0d2a26; --bg:#0a0e15;
  --card:#11161f; --line:#1f2735; --text:#eef3fc; --muted:#92a1bf;
  --green:#5ee6a8; --amber:#e9c25c;
}
html[data-theme="dark"][data-palette="beacon"] body {
  font-family: "Nunito", "Inter", "Segoe UI", -apple-system, Arial, sans-serif;
}
html[data-theme="dark"][data-palette="beacon"] h1,
html[data-theme="dark"][data-palette="beacon"] h2,
html[data-theme="dark"][data-palette="beacon"] .rpt-name {
  font-family: "Nunito", "Inter", sans-serif; font-weight: 800; color: var(--text);
}
html[data-theme="dark"][data-palette="beacon"] .card,
html[data-theme="dark"][data-palette="beacon"] .kpi,
html[data-theme="dark"][data-palette="beacon"] .rpt-card { border-radius: 14px; }
html[data-theme="dark"][data-palette="beacon"] .btn,
html[data-theme="dark"][data-palette="beacon"] .tb-btn,
html[data-theme="dark"][data-palette="beacon"] .tb-search input { border-radius: 10px; }
html[data-theme="dark"][data-palette="beacon"] .kpi .value,
html[data-theme="dark"][data-palette="beacon"] .num {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
html[data-theme="dark"][data-palette="beacon"] .kpi .label {
  text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--muted);
}
html[data-theme="dark"][data-palette="beacon"] .btn.gold {
  background: linear-gradient(135deg, #e9c25c, #c9a227); border-color: #c9a227;
  color: #1c1607; font-weight: 800;
}
html[data-theme="dark"][data-palette="beacon"] .sep {
  text-transform: uppercase; letter-spacing: .12em;
}

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px; row-gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; margin: -6px 0 18px; }
.tb-btn { background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 7px 10px; color: var(--text); text-decoration: none; }
.tb-btn:hover { border-color: var(--gold); color: var(--gold); }
.tb-search { flex: 0 1 460px; min-width: 170px; margin: 0; }
.tb-search input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 13px; }
.tb-spacer { flex: 1; }
.tb-user { text-align: right; line-height: 1.15; }
/* company workspace switcher (PEIAGENTS vs FT Ventures) */
.tb-co-switch { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
/* 📚 Set of books, next to the company (views/partials/head.ejs) */
.tb-books { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tb-books select { font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 8px; max-width: 230px; cursor: pointer; }
.tb-co-btn { font-size: 12px; padding: 5px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tb-co-btn:hover { color: var(--text); }
.tb-co-btn.sel { background: var(--navy); color: #fff; }
.tb-co-btn.sel:hover { color: #fff; }
/* narrow windows: let the topbar wrap instead of forcing the page to scroll sideways */
@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .tb-search { flex: 1 1 160px; min-width: 120px; }
  .tb-co-btn { padding: 5px 7px; }
}
/* training / help side drawer */
.help-drawer { position: fixed; top: 0; right: 0; width: 360px; max-width: 92vw; height: 100vh; z-index: 200;
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(0,0,0,.18);
  transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; }
.help-drawer.open { transform: translateX(0); }
.help-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--navy); color: #fff; }
.help-head a { color: var(--gold); }
.help-x { background: none; border: 0; color: #fff; font-size: 15px; cursor: pointer; }
/* Something wrong? in the drawer's own head (views/partials/foot.ejs): in reach whatever the drawer covers */
.help-prob { display: inline-flex; align-items: center; gap: 4px; background: transparent; border: 1px solid rgba(255,255,255,.4); color: #fff;
  border-radius: 7px; font: inherit; font-size: 12px; font-weight: 700; padding: 3px 8px; cursor: pointer; margin-right: 6px; }
.help-prob:hover { border-color: var(--gold); color: var(--gold); }
.help-prob-ic { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.help-body { padding: 12px 14px; overflow-y: auto; }
.help-body #helpSearch { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.help-item { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.help-item:hover { border-color: var(--gold); background: var(--gold-soft); }
.help-step { font-size: 14px; line-height: 1.5; padding: 8px 0; }
.help-tip { background: var(--gold-soft); border-radius: 6px; padding: 8px 10px; font-size: 12px; color: #7a5c00; }
/* What the words typed could mean, asked back: in the drawer (.help-q, .help-sec), and on the Help page
   and in search results (.hs-*, partials/help-suggest.ejs). A choice is a sentence, so it wraps. */
.help-q { margin: 2px 2px 8px; font-size: 14px; }
.help-sec { margin: 14px 2px 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
a.help-item { display: block; color: inherit; text-decoration: none; }
.hs-ask { border-left: 3px solid var(--gold); }
.hs-q { margin: 0 0 9px; font-size: 15px; font-weight: 700; }
.hs-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-choices .btn { white-space: normal; line-height: 1.3; padding-top: 5px; padding-bottom: 5px; text-align: left; justify-content: flex-start; max-width: 100%; }
.hs-note { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--muted); }
.hp-find { display: flex; flex-direction: column; gap: 6px; }
.hp-find label { font-weight: 700; font-size: 14px; }
.hp-row { display: flex; gap: 8px; }
.hp-row input { flex: 1 1 auto; min-width: 0; }
.tb-bell { position: relative; }
/* The bell's count: red while something is red, amber when nothing is (foot.ejs), each with the ink chosen for it. White
   on the dark theme's light red read at 2.9:1, and on its amber at 2.0:1 (review of #145). */
.bell-badge { position: absolute; top: -6px; right: -6px; background: var(--red); color: var(--on-red); border-radius: 10px;
  font-size: 12px; font-weight: 700; padding: 0 5px; min-width: 16px; text-align: center; line-height: 16px; }
.bell-badge.amber { background: var(--amber-fill); color: var(--on-amber); }
.bell-panel { display: none; position: absolute; right: 0; top: 40px; width: 340px; max-height: 440px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 50; }
.bell-panel.open { display: block; }
.bell-head { padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.bell-item { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.bell-item a { color: var(--text); } .bell-item a:hover { color: var(--gold); }
.bell-item.red { border-left: 3px solid var(--red); } .bell-item.yellow { border-left: 3px solid var(--amber); }
/* topbar Reports menu — Sage-style, always one click away */
.tb-reports { position: relative; }
.tb-rep-btn { width: auto !important; padding: 0 12px !important; font-size: 13px; font-weight: 600; white-space: nowrap; }
.rep-panel { display: none; position: absolute; left: 0; top: 40px; width: 260px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 50; padding-bottom: 4px; }
.rep-panel.open { display: block; }
.rep-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.rep-panel > a { display: block; padding: 8px 12px; font-size: 13px; color: var(--text); text-decoration: none; }
.rep-panel > a:hover { background: var(--gold-soft); color: var(--text); }
.rep-foot { border-top: 1px solid var(--line); margin-top: 4px; }
.rep-foot a { display: block; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--gold); text-decoration: none; }
@media (max-width: 760px) { .tb-rep-btn .rep-lbl { display: none; } }
.tb-name { display: block; font-weight: 600; font-size: 13px; color: var(--text); }
.tb-role { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.nav a .ic { display: inline-block; width: 20px; text-align: center; margin-right: 8px; }
.brand .logo-mini { display: none; }
/* sidebar "something new" count badge */
.nav-badge { display: inline-block; min-width: 17px; height: 17px; line-height: 17px; padding: 0 5px; margin-left: 6px;
  font-size: 12px; font-weight: 700; text-align: center; color: var(--on-gold); background: var(--gold); border-radius: 999px; vertical-align: middle; }
.nav a.active .nav-badge { background: #fff; color: var(--navy); }
.nav-collapsed .nav-badge { position: absolute; margin: 0; transform: translate(6px,-10px); min-width: 15px; height: 15px; line-height: 15px; font-size: 12px; }
.nav-collapsed .nav a { position: relative; }
.brand-logo { display: block; width: 190px; max-width: 100%; height: auto; margin: 0 auto 4px; }
.nav-collapsed .brand-logo, html[data-layout="rail"] .brand-logo { width: 46px; margin: 0 auto 8px; }

/* collapsed sidebar → icons only */
.nav-collapsed .sidebar { width: 60px; }
.nav-collapsed .sidebar .lbl, .nav-collapsed .nav .sep, .nav-collapsed .nav .hint,
.nav-collapsed .brand .sub, .nav-collapsed .brand .logo-full { display: none; }
.nav-collapsed .brand .logo-mini { display: inline; color: var(--gold); }
.nav-collapsed .nav a { text-align: center; padding: 11px 0; }
.nav-collapsed .nav a .ic { margin: 0; width: auto; font-size: 16px; }
.nav-collapsed .brand { padding: 18px 10px; text-align: center; }
.nav-collapsed .userbox { text-align: center; padding: 12px 6px; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { color: var(--gold); }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: var(--navy); color: #dde4ef; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 12px 16px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand .logo { font-size: 17px; font-weight: 600; color: #fff; letter-spacing: .3px; }
/* The lockup replaces type, so it is sized by height and lets its own aspect set the width.
   vertical-align keeps it on the baseline the text sat on. */
.brand .logo-img { height: 23px; width: auto; max-width: 100%; vertical-align: middle; }
html[data-layout="compact"] .brand .logo-img, html[data-layout="desk"] .brand .logo-img { height: 20px; }
html[data-layout="clarity"] .brand .logo-img { height: 26px; }
.brand .logo span { color: var(--gold); }
.brand .sub { font-size: 12px; color: #4F5B70; margin-top: 3px; letter-spacing: .5px; text-transform: uppercase; }
.nav { padding: 12px 0; flex: 1; overflow-y: auto; }
.nav a {
  display: block; padding: 10px 20px; color: #c3ccdd; font-size: 13px; border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: rgba(201,162,39,.12); border-left-color: var(--gold); color: #fff; }
.nav .sep { margin: 10px 20px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #5A6B84; }
.nav .hint { float: right; font-size: 12px; color: #5A6B84; background: rgba(255,255,255,.06); border-radius: 4px; padding: 1px 6px; }
/* FT Ventures Inc. — visually a different company, not just another PEIAGENTS section */
.ftv-nav-group { margin-top: 6px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,.14); background: rgba(13,148,136,.06); }
.ftv-nav-group .sep-ftv { color: #5fd0c4; }
.ftv-nav-group a { border-left-color: transparent; }
.ftv-nav-group a:hover { background: rgba(13,148,136,.12); }
.ftv-nav-group a.active { background: rgba(13,148,136,.18); border-left-color: #0d9488; color: #fff; }
.userbox { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; color: #4F5B70; }
.userbox a { color: var(--gold); }

/* Centred rather than pinned to the left. On a wide screen the content sat against one edge with a
   gutter on the other, which is what "not centered" meant. */
.main { flex: 1; padding: 26px 32px; max-width: 1280px; margin-inline: auto; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
h1 { font-size: 21px; font-weight: 600; margin: 0; color: var(--navy); }
h2 { font-size: 15px; font-weight: 600; color: var(--navy); margin: 16px 0 8px; }

/* Cards & KPIs — tighter, tidier defaults (less whitespace) */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; margin-bottom: 12px; }
/* A row of tiles that does not divide evenly used to leave a grey shelf on the right: CSS grid
   keeps the empty tracks, so ten tiles across six columns orphaned four and showed the page behind
   the rest. Flex wrapping lets the last row's tiles grow into the space instead, so a row of
   figures always reaches both margins whatever the count. --kpi-min is the smallest a tile gets
   before the row wraps; each layout sets its own. */
.kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; --kpi-min: 160px; }
.kpis > .kpi { flex: 1 1 var(--kpi-min); min-width: 0; }
/* The figures are the reason the screen exists, so they are set like it. A hairline of colour along
   the top edge gives a row of tiles a rhythm and carries meaning where there is meaning to carry:
   gold ordinarily, green when the number is good, red when it is not. Everything else stays quiet,
   because a ledger should be calm. */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 15px 14px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), rgba(201,162,39,.22)); }
.kpi:has(.value.pos)::before { background: linear-gradient(90deg, var(--green), rgba(30,125,70,.18)); }
.kpi:has(.value.neg)::before { background: linear-gradient(90deg, var(--red), rgba(178,58,58,.18)); }
.kpi .label { font-size: 12px; text-transform: uppercase; letter-spacing: .085em; color: var(--muted);
  font-weight: 600; }
.kpi .value { font-size: 25px; font-weight: 700; color: var(--navy); margin-top: 4px;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
/* Francis: "centre these KPI too, make them clickable everywhere possible" and "add some info to
   let the user know what it is, how it is calculated — not just there. Add help and ! everywhere,
   or mouse over."

   A figure with no explanation invites the wrong reading, and a figure that is the answer to a
   question should take you to the working. Three things, defined once so every screen gets them:
   the tile centres, a tile wrapped in a link behaves like a tile rather than a link, and a small ⓘ
   carries the explanation on hover without spending a line of the layout on it. */
.kpi { text-align: center; }
.kpi .label { display: flex; align-items: center; justify-content: center; gap: 5px; }
a.kpi, .kpi a.kpi-link { display: block; text-decoration: none; color: inherit; }
a.kpi:hover, .kpi a.kpi-link:hover { border-color: var(--gold); }
a.kpi:hover .value { color: var(--navy); }
/* --navy is a surface in the dark theme: a figure under the pointer turned dark on the dark card, 1.1:1 */
html[data-theme="dark"] a.kpi:hover .value { color: var(--text); }
.kpi .why { display: inline-flex; align-items: center; justify-content: center; width: 17px;
  height: 17px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; font-weight: 700; cursor: help; line-height: 1; flex: none; }
.kpi .why:hover { border-color: var(--gold); color: var(--navy); }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
/* The row arrives rather than appearing, once, on the way in. */
.kpis > .kpi { animation: kpi-in .42s cubic-bezier(.2,.7,.3,1) both; }
.kpis > .kpi:nth-child(1) { animation-delay: .02s } .kpis > .kpi:nth-child(2) { animation-delay: .06s }
.kpis > .kpi:nth-child(3) { animation-delay: .10s } .kpis > .kpi:nth-child(4) { animation-delay: .14s }
.kpis > .kpi:nth-child(5) { animation-delay: .18s } .kpis > .kpi:nth-child(6) { animation-delay: .22s }
@keyframes kpi-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kpis > .kpi { animation: none; } }
/* clickable KPI/summary tiles */
a.kpi { text-decoration: none; display: block; transition: box-shadow .15s, transform .12s, border-color .12s; }
a.kpi:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); transform: translateY(-1px); border-color: var(--gold); }

/* One-line filter bar (all controls inline, not stacked) */
.filterbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filterbar input, .filterbar select, .filterbar button { width: auto; margin: 0; }
.filterbar select { min-width: 110px; }
.filterbar .grow { flex: 1; min-width: 170px; }
.kpi .value.pos { color: var(--green); } .kpi .value.neg { color: var(--red); }

/* Tables */
/* Table widths are the browser's business, and three attempts at improving on it were each worse
   than the last. Left alone. */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
/* Rounded corners without turning the table into its own scroll box: `hidden` does that, and a pinned
   header inside a scroll box is measured from the table instead of the window, so it was pushed down
   over the rows. `clip` cuts the corners the same way and creates no scroll box (10 Sep 2026). */
@supports (overflow: clip) {
  table { overflow: clip; }
  /* Many screens round a card's corners with an inline overflow:hidden, which makes the card a scroll
     box and stops anything inside it pinning to the window. Clip does the rounding without that. */
  .card[style*="overflow:hidden"], .card[style*="overflow: hidden"] { overflow: clip !important; }
}
.card table { border: 0; }
/* One table, everywhere. Every screen had grown its own — .reg, .ca-t, .bo-t, .pv-t, .cx-t, .tf-t —
   with its own padding and its own row height, so the platform read as six products. This is the
   house table: tight rows the way a spreadsheet is tight, middles aligned rather than tops (top
   alignment is what made rows look ragged and loose), and figures on tabular numerals so columns
   line up down the page. Anything that needs to be roomier says so, rather than every table
   choosing for itself. */
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
     padding: 5px 9px; border-bottom: 2px solid var(--line); background: #fafbfc; font-weight: 600;
     white-space: nowrap; }
td { padding: 4px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px;
     line-height: 1.4; }
/* Table widths are the browser's business.

   Three attempts at improving on it, each worse than the last: nowrap made every wide table run off
   the screen; a scroller to catch that put a wrapper round every table on every page; making the
   scroll visible added a bar, a shadow and a line of instructions. The last of those scrolled whole
   building blocks sideways on Properties & Units and cost Francis an evening thinking he had lost
   his portfolio. All of it is out. The only rule left is a ceiling on genuinely long text. */
/* Long free text is capped so one column of notes cannot own the table. Everything else is left to
   the browser, which was doing a better job than any of my three attempts to improve on it. */
td.wrap, th.wrap, td.note, td.notes, td.long { max-width: 420px; }
tr:last-child td { border-bottom: 0; }
/* Figures line up: right, tight, and on tabular numerals. */
td.num, th.num, td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* A control inside a cell must not make the row taller than the rows around it. */
td .btn.sm, td .btn.xs, td .btn { min-height: 24px; padding: 0 9px; font-size: 12px; }
td input, td select { padding: 3px 6px; font-size: 12px; }
/* Wide tables scroll inside their own box instead of running off the page. That used to be done by
   letting every card scroll sideways, which made every card a scroll box: anything pinned inside it,
   the list's search bar and the table's header, was then measured from the top of the card rather than
   the window, and landed on the column headings and the first row. Francis: "make sure ALL the tables
   are showing well, some still overlap" (10 Sep 2026). Now only a table that is actually too wide gets
   a scroll box of its own (wrapWide in views/partials/foot.ejs), and cards stay out of the way. */
.card { overflow-x: visible; }
/* A long list's header pins just under its search bar; the offset is set on the table at runtime. */
table.lk-pin thead th { position: sticky !important; top: var(--lk-stick, 54px) !important; z-index: 5;
  background: var(--card); box-shadow: inset 0 -1px 0 var(--line); }
/* The scrollbar should not sit on top of the last row. */

/* Banding, the way a ledger and every spreadsheet since has banded. It is what lets the eye carry a
   figure across a wide row without losing the line, and it is most of what makes Quicken feel dense
   without being small. The density here comes from row height, never from shrinking the type. */
tbody tr:nth-child(even) td { background: rgba(15,27,45,.022); }
html[data-theme="dark"] tbody tr:nth-child(even) td { background: rgba(255,255,255,.028); }
/* A hairline between columns, so a wide table reads as columns rather than as drifting words. */
th + th, td + td { border-left: 1px solid rgba(15,27,45,.05); }
html[data-theme="dark"] th + th, html[data-theme="dark"] td + td { border-left-color: rgba(255,255,255,.05); }
/* The banding must never win over a hover or a total. */
tbody tr:hover td { background: #eef4ff; }
html[data-theme="dark"] tbody tr:hover td { background: #151D2B; }
/* extra-compact tables (audit, long ledgers) */
table.dense th { padding: 4px 8px; font-size: 12px; }
table.dense td { padding: 3px 8px; font-size: 12px; }
/* consistent interactive hover on every table (matches the Register) */
table tr:hover td { background: #f5f8ff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* A section's screens side by side, at the top of each (views/partials/section-tabs.ejs, src/lib/sections.js): Trades and
   its paperwork, To do and its lists. A row of tabs, the open one underlined in gold; on a phone it scrolls on its own
   rather than pushing the page sideways. */
.sec-tabs { display: flex; gap: 2px; margin: 0 0 14px; border-bottom: 2px solid var(--line); overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.sec-tab { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px 7px; margin-bottom: -2px; white-space: nowrap;
  border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.sec-tab:hover { color: var(--text); }
.sec-tab.on { color: var(--text); border-bottom-color: var(--gold); }
.sec-tab .nav-badge { margin-left: 2px; }
.sec-tab .sec-ic { font-size: 13px; opacity: .8; }
.sec-tab.on .sec-ic { opacity: 1; }
/* the tab's icon as the menu draws it (sectionTabIcons in public/looks.js), in the colour of the tab's words */
.sec-ic .tic.tic-svg { display: inline-flex; align-items: center; }
.sec-ic .tic.tic-svg svg { width: 15px; height: 15px; display: block; }
@media print { .sec-tabs { display: none; } }
/* On a phone the tabs wrap onto a second row rather than running past the screen: since 22 Oct 2026 a section holds up to
   eight (src/lib/sections.js), more than a 390 px strip shows. */
@media (max-width: 640px) { .sec-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 2px; } .sec-tab { padding: 8px 10px 7px; } }

/* All settings (/all-settings) and All of BF (/all): every setting, or every page, on one page with a box that finds one as
   you type (views/all-settings.ejs, views/all.ejs, public/allpages.js). The box stays in reach while the page scrolls. */
.allp-find { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 6px 0;
  position: sticky; top: var(--lk-stick, 0px); z-index: 5; background: var(--bg); }
.allp-find input { flex: 1; max-width: 560px; font-size: 16px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--text); }
.allp-find input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
.allp-count { font-size: 13px; white-space: nowrap; }
.allp-none { margin-bottom: 14px; }
.allp-group { margin: 0 0 22px; }
.allp-gh { font-size: 16px; margin: 0 0 2px; }
.allp-gb { margin: 0 0 10px; font-size: 13px; }
/* All settings: each group's settings as cards; the whole card opens it, its own parts open where they say */
.allp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.allp-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  transition: border-color .12s, box-shadow .12s; }
.allp-card:hover, .allp-card:focus-within { border-color: var(--gold); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.allp-card .allp-main { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text); text-decoration: none; }
.allp-card .allp-main::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
.allp-ic { font-size: 18px; width: 24px; text-align: center; flex: none; }
.allp-blurb { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.4; }
.allp-parts { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 13px; }
.allp-parts a { text-decoration: none; }
.allp-parts a:hover { text-decoration: underline; }
/* All of BF: the menu's groups side by side, each a card of its lines; a line that stands for several pages lists them under it */
.allp-cols { columns: 3 300px; column-gap: 14px; }
.allp-cols .allp-group { break-inside: avoid; display: inline-block; width: 100%; box-sizing: border-box; margin: 0 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.allp-cols .allp-gh { margin-bottom: 6px; }
.allp-row { padding: 6px 0; border-top: 1px solid var(--line); }
.allp-gh + .allp-row { border-top: 0; }
.allp-row > .allp-main { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.allp-row > .allp-main:hover .allp-name { text-decoration: underline; }
.allp-row .nav-badge { margin-left: 2px; }
.allp-ext { font-size: 12px; color: var(--muted); }
.allp-sub { display: flex; flex-wrap: wrap; gap: 5px 6px; margin: 5px 0 2px 32px; }
.allp-sub a { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--panel); color: var(--text);
  text-decoration: none; border: 1px solid var(--line); }
.allp-sub a:hover { border-color: var(--gold); }
.allp-subh { flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.allp-off { display: none !important; }
@media (max-width: 560px) { .allp-sub { margin-left: 0; } .allp-find { flex-wrap: wrap; } }
@media print { .allp-find, .allp-none { display: none; } }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 600; border-top: 2px solid var(--navy); background: var(--gold-soft); }
tr.total:hover td { background: var(--gold-soft); }

/* Register-style table — shared class so every screen can adopt the same dense, readable look */
table.reg td, table.reg th { padding: 5px 8px; font-size: 13px; border-bottom: 1px solid var(--line); }
table.reg th { font-size: 12px; }
table.reg tbody tr:hover td { background: #f5f8ff; }
/* Keep column headers visible on long report tables instead of scrolling them away — sits just under the sticky topbar */
/* 54px was the height of the one topbar this app had when the rule was written. Layouts since
   then are taller, and in the pane layouts the content scrolls in its own box — where an offset
   measured from the window pushes the pinned header down INTO the table, so it sits on top of the
   second row. The offset is measured at runtime (looks.js sets --lk-stick), and a table inside its
   own scrollport is pinned at its own top. */
table.reg thead th { position: sticky; top: var(--lk-stick, 54px); z-index: 5; background: var(--card); box-shadow: inset 0 -1px 0 var(--line); }
table.reg.reg-inpane thead th { top: 0; }
/* A table inside its own sideways scroller pins its heading to that box, not the window: the window's offset there pushed the heading down over the
   rows, below an empty table's only line (FT Ventures Bank Import, 23 Oct 2026). */
:is(.tbl-scroll, div[style*="overflow-x:auto"], div[style*="overflow-x: auto"]) > table.reg thead th { top: 0; }
/* Inside a wrapper that clips but does not scroll vertically there is nothing to pin against, and
   pinning anyway lands the header on the first row. */
table.reg.reg-nostick thead th { position: static; }
@media print { table.reg thead th { position: static; } }

/* Collapsible report section (native <details>/<summary> — keyboard- and screen-reader-accessible with no extra JS) */
.rpt-collapse { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.rpt-collapse > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; background: var(--bg);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rpt-collapse > summary::-webkit-details-marker { display: none; }
.rpt-collapse > summary .chev { transition: transform .15s; color: var(--muted); font-size: 12px; }
.rpt-collapse[open] > summary .chev { transform: rotate(90deg); }
.rpt-collapse > summary:hover { background: var(--gold-soft); }
.rpt-collapse > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.rpt-collapse .rpt-collapse-body { padding: 10px 14px 14px; }
.rpt-collapse-sub { font-weight: 400; color: var(--muted); font-size: 12px; }
@media print {
  /* printing should show every section in full, regardless of what's collapsed on screen */
  .rpt-collapse, .rpt-collapse .rpt-collapse-body { display: block !important; }
}
/* quiet inline-edit fields inside register-style tables */
table.reg td.cell input, table.reg td.cell select,
.cell-edit { border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 3px 6px; font-size: 13px; transition: border-color .12s, background .12s; }
table.reg td.cell input:hover, table.reg td.cell select:hover, .cell-edit:hover { border-color: #cbd5e1; }
table.reg td.cell input:focus, table.reg td.cell select:focus, .cell-edit:focus { border-color: var(--gold); background: var(--card); outline: none; }

/* ---- Explain: where a number came from ---------------------------------------------------------
   A figure that can explain itself carries a faint dotted underline on its label, so it is
   discoverable without shouting. The panel itself is one element reused across the page. */
[data-x] { cursor: help; }
[data-x][data-x-href] { cursor: pointer; }
[data-x] > .l, [data-x] > .label { text-decoration: underline dotted rgba(15,27,45,.28); text-underline-offset: 2px; }
/* A term the glossary recognised — a column header that can explain itself. */
th.xp-term, .xp-term { text-decoration: underline dotted rgba(15,27,45,.3); text-underline-offset: 3px; }
html[data-theme="dark"] th.xp-term, html[data-theme="dark"] .xp-term { text-decoration-color: rgba(255,255,255,.3); }
th.xp-term:hover { color: var(--gold); }
html[data-theme="dark"] [data-x] > .l, html[data-theme="dark"] [data-x] > .label { text-decoration-color: rgba(255,255,255,.28); }
[data-x]:hover { border-color: var(--gold) !important; }
.xp-pop { position: absolute; z-index: 300; max-width: 330px; pointer-events: auto;
  background: var(--navy, #1F3A5F); color: #fff; border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 12px 34px rgba(12,20,32,.32); font-size: 12px; line-height: 1.45;
  opacity: 0; visibility: hidden; transform: translateY(3px); transition: opacity .12s, transform .12s; }
.xp-pop.on { opacity: 1; visibility: visible; transform: none; }
.xp-pop::after { content: ""; position: absolute; left: 50%; margin-left: -6px; border: 6px solid transparent;
  border-top-color: var(--navy, #1F3A5F); bottom: -12px; }
.xp-pop.below::after { bottom: auto; top: -12px; border-top-color: transparent; border-bottom-color: var(--navy, #1F3A5F); }
.xp-pop .xp-t { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.xp-pop .xp-c { opacity: .95; }
.xp-pop .xp-f { margin-top: 5px; font-size: 12px; opacity: .72; }
.xp-pop .xp-f span { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; opacity: .8; }
.xp-pop .xp-n { margin-top: 5px; font-size: 12px; opacity: .8; font-style: italic; }
.xp-pop .xp-go { margin-top: 6px; font-size: 12px; color: var(--gold, #C69214); font-weight: 700; }
@media print { .xp-pop { display: none !important; } }

/* Status badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.conditional { background: #fdf3d7; color: var(--amber); }
.badge.firm { background: #e2ecfb; color: #2456a6; }
.badge.closed { background: #ddf1e4; color: var(--green); }
.badge.cancelled { background: #f6dede; color: var(--red); }
.badge.unmatched { background: #fdf3d7; color: var(--amber); }
.badge.matched, .badge.posted { background: #ddf1e4; color: var(--green); }
.badge.excluded { background: #eceef1; color: var(--muted); }

/* Tabs */
/* Tabs read as the same small pills used for list filters — compact, not a heavy tab bar. */
.tabbar { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.tab {
  padding: 5px 12px; font-size: 13px; font-weight: 600; letter-spacing: 0;
  color: var(--navy); background: transparent; border: 1px solid #ccd3dd; border-radius: 7px;
}
.tab:hover { background: var(--gold-soft); color: var(--navy); border-color: var(--gold); }
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.tab.active:hover { background: var(--navy-2); color: #fff; }
html[data-theme="dark"] .tab { color: var(--text); border-color: var(--line); }
html[data-theme="dark"] .tab.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }

/* Forms */
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #ccd3dd; border-radius: 7px;
  font-family: inherit; font-size: 13px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(201,162,39,.35); border-color: var(--gold); }
.form-actions { grid-column: 1 / -1; margin-top: 6px; }

/* One height, whether it is a <button> or an <a>. They were different sizes side by side because a
   link and a button do not agree about line-height and box sizing, and padding alone cannot settle
   it. A fixed line-height, border-box, and centring the content settles it for good. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-sizing: border-box; min-height: 36px; padding: 0 16px; line-height: 1;
  border-radius: 7px; border: 1px solid transparent; cursor: pointer; vertical-align: middle;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; font-family: inherit;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--navy-2); color: #fff; }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #b8931f; }
.btn.ghost { background: transparent; color: var(--navy); border-color: #ccd3dd; }
.btn.sm { min-height: 28px; padding: 0 11px; font-size: 13px; }
.btn.xs { min-height: 24px; padding: 0 8px; font-size: 12px; }
.btn.danger { background: var(--red); }
/* The card of reports at the foot of a screen (views/partials/section-reports.ejs): each link is its name and a line
   saying what it answers, side by side, and a .btn never wraps, so on a phone the widest ran off the screen, the lease
   page's "🔗 Between the Companies" 49 px past a 390 px one. Where there is room it is still one line, 28 px tall, as
   before; where there is not, the line goes under the name, and wraps if it must, within the screen. */
.btn.sr-link { max-width: 100%; flex-wrap: wrap; row-gap: 0; white-space: normal; justify-content: flex-start;
  text-align: left; padding-top: 3px; padding-bottom: 3px; }
/* An icon (src/icons.js): a stroke in the colour of its text, sized in em. It never shrinks in a row of flex items,
   and sits on the line of the text beside it. Only the drawn icon: `ic` is also the class of the menu's own
   <span class="ic">📄</span> on every page, which this would move 3 px down and make each menu line 3 px taller in the
   layouts with the menu down the side (review of 24 Sep 2026). */
svg.ic { flex: none; vertical-align: -0.25em; }

/* sidebar quick-find + collapsible sections (wired in foot.ejs) */
.nav-find { padding: 8px 12px 2px; }
.nav-find input { width: 100%; padding: 6px 10px; font-size: 13px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #dbe3f0; }
.nav-find input::placeholder { color: #8e9bb2; }
/* the full search under the box: other screens, and a line that searches everything (foot.ejs) */
.nav-find-more a { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; margin-top: 4px; border-radius: 7px; color: #e6ecf5; text-decoration: none; font-size: 13px; background: rgba(255,255,255,.06); }
.nav-find-more a:hover, .nav-find-more a:focus { background: rgba(255,255,255,.14); color: #fff; }
.nav-find-more .nfm-sec { font-size: 12px; color: #a9b6cb; }
.nav-find-more .nfm-all { display: block; width: 100%; margin-top: 6px; padding: 7px 10px; border-radius: 7px; border: 1px dashed rgba(255,255,255,.3); background: transparent; color: #e6ecf5; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.nav-find-more .nfm-all:hover { border-color: var(--gold); }
.nav-find input:focus { outline: none; border-color: var(--gold); background: rgba(255,255,255,.12); }
.sep-toggle { cursor: pointer; user-select: none; position: relative; padding-right: 26px; }
.sep-toggle::after { content: "▾"; position: absolute; right: 14px; font-size: 12px; opacity: .65; transition: transform .15s; }
.sep-toggle.closed::after { transform: rotate(-90deg); }
.sep-toggle:hover { color: var(--gold); }
.nav-group.collapsed { display: none; }
.nav-collapsed .nav-find, html[data-layout="rail"] .nav-find { display: none; }
html[data-layout="openbook"]:not(.ob-nav-full) .nav-find { display: none; }

/* click-to-sort headers (wired globally in foot.ejs) */
th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 16px !important; }
th.sortable:hover { color: var(--gold); }
th.sortable::after { content: "⇅"; position: absolute; right: 5px; opacity: .28; font-size: 12px; }
th.sortable[data-sort="asc"]::after { content: "▲"; opacity: .95; color: var(--gold); }
th.sortable[data-sort="desc"]::after { content: "▼"; opacity: .95; color: var(--gold); }
th.sortable:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.filters { display: flex; gap: 10px; align-items: end; margin-bottom: 16px; flex-wrap: wrap; }
.filters > div { min-width: 140px; }

/* Quicken-style quick date/period presets — sits above the From/To (or Month/Year) inputs */
.date-presets { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; margin-bottom: 2px; }
.date-presets button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px;
  padding: 4px 11px; font-size: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.date-presets button:hover { border-color: var(--gold); }
.date-presets button:active, .date-presets button.sel { background: var(--gold); color: #1a1a1a; border-color: var(--gold); }
/* A whole month in one pick, between the presets and From/To (partials/date-range-filter). */
.month-pick { margin: 6px 0 2px; }
.month-pick-row { display: flex; gap: 6px; align-items: center; }
.month-pick-row select { width: auto; flex: 0 1 230px; min-width: 150px; }
.month-pick button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px;
  padding: 3px 12px; font-size: 16px; line-height: 1.2; cursor: pointer; }
.month-pick button:hover:not(:disabled) { border-color: var(--gold); }
.month-pick button:disabled { opacity: .35; cursor: default; }
/* Transaction Detail's filter column, kept short (Francis, 23 Sep: "The 2 checkboxes take a lot of
   space"): From and To side by side, the options and Run on one line, the explanations one click away. */
.td-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; align-items: end; }
.td-dates > .date-presets, .td-dates > .month-pick { grid-column: 1 / -1; }
.td-dates input[type="date"] { width: 100%; }
.td-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 12px; }
.td-opts label { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 400; cursor: pointer; }
.td-opts label input { width: auto; margin: 0; }
.td-opts .btn { margin-left: auto; }
.td-help { margin-top: 8px; font-size: 12px; color: var(--muted); max-width: 420px; }
.td-help summary { cursor: pointer; }
.td-help p { margin: 6px 0 0; line-height: 1.5; }
/* Agent Billing: record a payment, and the opening balances screen. */
.ab-pay { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.ab-pay label { font-size: 13px; }
.ab-pay-inv { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }
.ab-pay-inv label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 0; }
.ab-pay-inv input { width: auto; margin: 0; }
.op-tie { margin: 10px 0 12px; font-size: 13px; line-height: 1.6; }
.op-link { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.op-link input { width: 80px; }
/* Roadmap: what 📋 Copy for Claude copies, one click away. */
.rm-copied { margin: 0 0 10px; font-size: 13px; }
.rm-copied summary { cursor: pointer; color: var(--muted); }
.rm-copied textarea { width: 100%; margin-top: 6px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Bank Import: the filter over the list of imports. */
.imp-filter { align-items: flex-end; margin-bottom: 10px; }
.imp-filter select { max-width: 280px; }
.imp-count { font-size: 13px; padding-bottom: 8px; }
.imp-hide { min-width: 0 !important; padding-bottom: 8px; }
.imp-hide label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; margin: 0; }
.imp-hide input[type=checkbox] { width: auto; margin: 0; }
/* Rent Roll: a month paid in part (src/rent-receipt.js). */
.rr-part { font-size: 12px; font-weight: 700; color: #a2520d; white-space: nowrap; }
html[data-theme="dark"] .rr-part { color: #f0b06a; }
.muted { color: var(--muted); font-size: 13px; }
.error-box { background: #f6dede; color: var(--red); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
/* Something to set up, not something that went wrong (the full review of 23 Oct 2026: setup notes in the same red as errors read as failures). Amber, from the kit. */
.setup-box { background: #FFF4E5; color: #6B3A0E; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.setup-box::before { content: '⚙ '; }
/* A button that takes something away looks it, wherever it is (the kit: Do it · Something else · Take something away). By where its form posts, so no
   page has to remember a class. */
form[action$="/remove"] .btn.ghost, form[action$="/delete"] .btn.ghost, form[action*="/void"] .btn.ghost, form[action$="/unpost"] .btn.ghost {
  color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
form[action$="/remove"] .btn.ghost:hover, form[action$="/delete"] .btn.ghost:hover, form[action*="/void"] .btn.ghost:hover, form[action$="/unpost"] .btn.ghost:hover {
  background: color-mix(in srgb, var(--red) 10%, transparent); }
html[data-theme="dark"] .setup-box { background: #33240f; color: #f2c37a; }
.ok-box { background: #ddf1e4; color: var(--green); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.login-card { background: #fff; border-radius: 12px; padding: 36px 34px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card h1 { font-size: 19px; margin-bottom: 2px; }
.login-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: .8px; }
.login-card input { margin-bottom: 12px; }
.login-card .btn { width: 100%; margin-top: 6px; }

/* ================= FINANCIAL STATEMENTS (accounting-software look) =================
   Applied to formal reports (P&L, Balance Sheet, Trial Balance, HST, A/R Aging…).
   White "paper", centered masthead, indented account groups, subtotal rules,
   double-underline grand totals, tabular figures. Aptos per house style. */
.statement {
  background: #fff; color: #1a1a1a; max-width: 940px; margin: 0 auto;
  padding: 26px 34px 34px; border: 1px solid var(--line); border-radius: 8px;
  font-family: "Aptos", "Aptos Display", "Segoe UI", -apple-system, Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
html[data-theme="dark"] .statement { background: #f8f9fb; }
.stmt-head { text-align: center; padding-bottom: 14px; margin-bottom: 6px; }
.stmt-head .co { font-family: "Aptos Display","Aptos","Segoe UI",sans-serif; font-size: 21px; font-weight: 700; color: #17233a; letter-spacing: .2px; }
.stmt-head .ttl { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; margin-top: 4px; color: #2a333f; }
.stmt-head .per { font-size: 12px; color: #5a6472; margin-top: 3px; }
.stmt-head .basis { font-size: 12px; color: #8a94a3; margin-top: 2px; text-transform: uppercase; letter-spacing: .6px; }
.statement table { width: 100%; border-collapse: collapse; font-size: 13px; }
.statement thead th, .statement tr.colhead th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  color: #5a6472; font-weight: 600; padding: 6px 10px; border-bottom: 1.5px solid #3a4759; background: none;
}
.statement th.num, .statement td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement td { padding: 3.5px 10px; border: 0; color: #23272e; }
.statement tr.section td { font-weight: 700; color: #17233a; padding-top: 12px; font-size: 13px; }
.statement td.acct { padding-left: 26px; }             /* account under a header */
.statement td.acct.lvl2 { padding-left: 42px; }        /* sub-account */
.statement tr.sub td { border-top: 1px solid #b9c1cc; font-weight: 700; color: #17233a; }
.statement tr.sub td.lbl { font-weight: 700; }
.statement tr.spacer td { height: 8px; padding: 0; }
.statement tr.grand td {
  border-top: 1.5px solid #17233a; border-bottom: 3px double #17233a;
  font-weight: 800; color: #17233a; font-size: 13px; padding-top: 6px; padding-bottom: 6px;
}
.statement tr:hover td { background: #f6f8fb; }
.statement .neg { color: #b23a3a; }
.stmt-actions { max-width: 940px; margin: 0 auto 10px; display: flex; justify-content: flex-end; gap: 6px; }
@media print {
  .statement { border: 0; box-shadow: none; max-width: none; padding: 0; }
  .stmt-actions { display: none !important; }
}

/* ================= REPORTS HUB (QuickBooks-style cards) ================= */
.rpt-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.rpt-search { flex: 1; min-width: 220px; position: relative; }
.rpt-search input { width: 100%; padding: 7px 10px 7px 30px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; background: var(--card); color: var(--text); }
.rpt-search::before { content: "🔎"; position: absolute; left: 10px; top: 7px; opacity: .55; font-size: 12px; }
.rpt-sec { margin: 14px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.rpt-sec h2 { margin: 0; font-size: 13px; }
.rpt-sec .hint { font-size: 12px; color: var(--muted); }
/* A grid row is as tall as its tallest card, so one long description used to stretch every card
   beside it and leave the rest half empty. Each card is now its own height, and a description is
   capped at three lines with the full text on hover — which is what made the hub compact. */
.rpt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 8px; align-items: start; }
.rpt-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px 8px; display: flex; flex-direction: column; transition: box-shadow .12s, border-color .12s; }
.rpt-card:hover { box-shadow: 0 4px 14px rgba(16,24,40,.09); border-color: #c9cfda; }
.rpt-card .rpt-name { font-weight: 650; font-size: 13px; color: var(--text); padding-right: 22px; line-height: 1.3; }
.rpt-card .rpt-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rpt-card .rpt-foot { display: flex; align-items: center; justify-content: flex-end; margin-top: 6px; gap: 8px; }
.rpt-card .btn { padding: 3px 9px; font-size: 12px; }
.rpt-star { position: absolute; top: 10px; right: 10px; cursor: pointer; font-size: 16px; line-height: 1; color: #c7ccd6; background: none; border: 0; padding: 2px; }
.rpt-star.on { color: var(--gold); }
.rpt-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.rpt-badge.red { background: #fbe6e6; color: #a23030; }
.rpt-badge.amber { background: #fbf0d8; color: #8a6412; }
.rpt-badge.green { background: #e2f3e8; color: #1e7d46; }
.rpt-badge.blue { background: #e5edfb; color: #24487e; }
html[data-theme="dark"] .rpt-badge.red { background:#3a1f1f; color:#e2736e; }
html[data-theme="dark"] .rpt-badge.amber { background:#332a12; color:#d8b53f; }
html[data-theme="dark"] .rpt-badge.green { background:#123020; color:#57c98a; }
html[data-theme="dark"] .rpt-badge.blue { background:#16233f; color:#8fb2ff; }
.rpt-empty { color: var(--muted); font-size: 13px; padding: 10px 2px; }
.rpt-card.hidden, .rpt-sec.hidden { display: none; }
.rpt-time { font-size: 12px; color: var(--muted); margin-right: 6px; }

/* "Ask BrokerFlow" — plain-English guided reports (EasyAnswer-style) */
.ez-panel { padding: 0; overflow: hidden; }
.ez-row { display: flex; align-items: center; gap: 8px; padding: 7px 12px; flex-wrap: wrap; }
.ez-row + .ez-row { border-top: 1px solid var(--line); }
.ez-icon { width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; flex: none; }
.ez-icon.green { background: #1e7d46; } .ez-icon.blue { background: #24487e; }
.ez-icon.amber { background: #97711a; } .ez-icon.purple { background: #6b46c1; }
.ez-icon.navy { background: var(--navy); } .ez-icon.red { background: #a23030; }
.ez-text { flex: 1; min-width: 210px; font-size: 12px; }
.ez-text select { display: inline-block; width: auto; margin: 0 3px; padding: 3px 6px; font-size: 12px; }
.ez-row .btn { flex: none; padding: 4px 11px; font-size: 12px; }

/* Dense list view for the reports hub — the "accounting style" default */
#catalogTable .rpt-collapse table.reg th, #catalogTable .rpt-collapse table.reg td { padding: 4px 10px; font-size: 12px; }
#catalogTable .rpt-collapse table.reg th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
#catalogTable .rpt-collapse table.reg .btn { padding: 3px 10px; font-size: 12px; }

@media print {
  .sidebar, .filters, .btn, .no-print { display: none !important; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; }
}

/* ---- a collapsed menu opens when you reach for it -------------------------------------------------
   Collapsed to icons, the menu is a column of pictures with no words, and the only way back is a
   button somebody has to know about. Hovering it opens it over the page — no click, no layout shift,
   and it closes again when the mouse leaves. The pinned state is untouched, so the button still does
   what it always did. */
@media (hover: hover) and (min-width: 900px) {
  .nav-collapsed .sidebar {
    transition: width .14s ease;
    z-index: 80;
  }
  .nav-collapsed .sidebar:hover { width: 232px; box-shadow: 6px 0 24px rgba(8,12,20,.28); }
  .nav-collapsed .sidebar:hover .lbl,
  .nav-collapsed .sidebar:hover .nav .sep { display: block; }
  .nav-collapsed .sidebar:hover .nav a { text-align: left; padding: 10px 14px; }
  .nav-collapsed .sidebar:hover .nav a .ic { margin-right: 9px; width: 20px; }
  .nav-collapsed .sidebar:hover .brand .logo-full { display: inline; }
  .nav-collapsed .sidebar:hover .brand .logo-mini { display: none; }
}


/* --------------------------------------------------------------------------
   ONE ROW HEIGHT — Francis, 10 Aug 2026: "can you make all the tables same height".
   Screens grew their own padding over time, so the budget's rows stood at 47px while a
   register's stood at 24px and the same book looked like two products. Every data row is
   the same height everywhere; .dense stays tighter on purpose, for the screens that show
   hundreds of rows, and is itself consistent. Inputs inside a cell no longer stretch it.
   -------------------------------------------------------------------------- */
table td, table th { padding: 6px 10px; line-height: 1.35; }
table tbody tr { height: 34px; }
table.dense td, table.dense th { padding: 4px 8px; }
table.dense tbody tr { height: 26px; }
table.reg td, table.reg th { padding: 6px 10px; }
table.reg tbody tr { height: 34px; }
/* a control in a cell should sit inside the row, not set the row's height */
table td input:not([type=checkbox]):not([type=radio]), table td select, table td .btn.sm {
  height: 26px; padding-top: 2px; padding-bottom: 2px; line-height: 1.2;
}
table td textarea { min-height: 26px; }

/* ================= ONE TABLE, EVERYWHERE =========================================
   Screens that grew their own table class are pulled onto the house density above,
   so a row is the same height in the Chart of Accounts, the Vendors list, the buyout
   and the corporation dashboards. Each keeps its own layout; only the metrics agree. */
.reg th, .ca-t th, .bo-t th, .pv-t th, .cx-t th, .tf-t th, .td-t th, .ev-t th,
.reg td, .ca-t td, .bo-t td, .pv-t td, .cx-t td, .tf-t td, .td-t td, .ev-t td {
  padding: 4px 9px; font-size: 13px; line-height: 1.45; vertical-align: middle;
}
.reg th, .ca-t th, .bo-t th, .pv-t th, .cx-t th, .tf-t th, .td-t th, .ev-t th {
  font-size: 12px; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
}
.reg td.n, .ca-t td.n, .bo-t td.n, .pv-t td.n, .cx-t td.n, .tf-t td.n, .ev-t td.n,
.reg td.num, .ca-t td.num, .bo-t td.num {
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* The badge rows on Trades in Progress and the like: many small pills wrapping over three lines is
   what "very busy" meant. Smaller, tighter, and they sit on one line where they fit. */
.flagrow, .flags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.flag, .pill, .badge-flag { font-size: 12px; padding: 2px 7px; border-radius: 999px; line-height: 1.4; }

/* ================= ONE LIST ROW INSIDE EVERY WIDGET ==============================
   The dashboard had two list widgets side by side that agreed on nothing: different
   padding, different marker, different type size, one with a button column and one
   without. Two tables, two views, as Francis put it. This is the row they both use.

 A grid rather than a flex row, because flex lets each row size its own columns: the marker sat in
   a slightly different place on every line, the buttons did not line up down the list, and the rule
   under a row stopped wherever the content did. Three fixed columns line everything up by
   construction, and the rule spans all three. */
.dw-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: start;
  padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.45; }
.dw-row:last-child { border-bottom: 0; }
.dw-row .dw-mark { text-align: center; line-height: 1.5; font-size: 12px; }
.dw-row .dw-main { min-width: 0; }
.dw-row .dw-main a { text-decoration: none; }
.dw-row .dw-main a:hover { text-decoration: underline; }
.dw-row .dw-act { flex: none; margin: 0; }
.dw-row .dw-act .btn { min-height: 24px; padding: 0 9px; font-size: 12px; }
.dw-row .dw-note { font-size: 12px; color: var(--muted); }
.dw-foot { font-size: 12px; color: var(--muted); margin: 7px 0 0; }

/* The arranger's parking box: clearly not a section of the menu. */
.ma-sec.ma-hidden { border-style: dashed; opacity: .82; }
.ma-sec.ma-hidden .ma-head { background: transparent; cursor: default; }
.ma-sec.ma-hidden .ma-item { opacity: .7; }


/* ---- Legibility pass, 20 Aug 2026 --------------------------------------------------------------
   The outside review measured fourteen distinct type sizes on one screen with text down to 9px, and
   a secondary grey at 3.4:1 against its background where AA asks for 4.5. Nothing here is
   decorative: navigation labels, table metadata and help text are what somebody reads all day.
   The floor is now 12px, secondary text 13px, and the muted greys pass AA on their own palette.

   Money is set in tabular figures so columns align on the decimal without hand-tuned widths, which
   is the difference between a table you can scan and one you have to read. */
.num, td.num, th.num, .value, .ctl-v, .kpi .value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* A visible focus ring everywhere, not only where a component happened to define one. Keyboard
   users cannot use what they cannot locate. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--gold, #C9A227);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Touch targets. The review found navigation items around 32x27px relying on hover titles, which
   is neither reachable on a phone nor discoverable without a mouse. */
@media (pointer: coarse) {
  .nav a, .btn, .tab, .dw-sz, .dw-x { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Long bank descriptions wrap instead of forcing a table wider than the window. */
td { overflow-wrap: anywhere; }

/* ---- Type scale, 21 Aug 2026 ---------------------------------------------------------------------
   From the navigation and visual design review. Its point, which is right: the inconsistency came
   from four half-pixel variants rather than from the typeface, and the fix is a small allowed set
   with each role given a distinct job. Those are gone; this gives the roles their sizes.

   Allowed: 12, 13, 14, 15, 16, 20, 24, 28. Nothing else, and nothing below 12 — enforced by
   scripts/type-floor.js on every deploy.

   Deliberately not changing the typeface in the same week as the navigation. */
:root {
  --t-nav:      15px;  --t-nav-lh:     22px;   /* the six-item primary bar */
  --t-util:     14px;  --t-util-lh:    20px;   /* company, search, account */
  --t-sub:      14px;  --t-sub-lh:     20px;   /* page-local navigation */
  --t-h1:       28px;  --t-h1-lh:      34px;
  --t-h2:       20px;  --t-h2-lh:      28px;
  --t-h3:       16px;  --t-h3-lh:      24px;
  --t-body:     15px;  --t-body-lh:    23px;
  --t-th:       12px;  --t-th-lh:      16px;
  --t-td:       14px;  --t-td-lh:      20px;
  --t-money:    24px;  --t-money-lh:   30px;
  --t-label:    12px;  --t-label-lh:   16px;
  --t-help:     13px;  --t-help-lh:    20px;
  --t-control:  14px;  --t-control-lh: 20px;
}

body { font-size: var(--t-body); line-height: var(--t-body-lh); }

h1 { font-size: var(--t-h1); line-height: var(--t-h1-lh); font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: var(--t-h2); line-height: var(--t-h2-lh); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--t-h3); line-height: var(--t-h3-lh); font-weight: 600; letter-spacing: 0; }

th { font-size: var(--t-th); line-height: var(--t-th-lh); font-weight: 600; letter-spacing: .04em; }
td { font-size: var(--t-td); line-height: var(--t-td-lh); }
/* Figures carry a touch more weight than the words beside them, and align on the decimal. */
td.num, th.num { font-variant-numeric: tabular-nums; }
td.num { font-weight: 500; }

.kpi .value, .ctl-v { font-size: var(--t-money); line-height: var(--t-money-lh); font-weight: 700;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi .label, .ctl-k { font-size: var(--t-label); line-height: var(--t-label-lh); font-weight: 600;
  letter-spacing: .04em; }

.muted { font-size: var(--t-help); line-height: var(--t-help-lh); }
button, .btn, input, select, textarea {
  font-size: var(--t-control); line-height: var(--t-control-lh);
}
.btn { font-weight: 600; }


/* Her layout: a bar across the top and the page beneath it, with none of the sidebar's gutter.
   The shell is a grid built for a sidebar that is not there, so the column it reserved has to go
   or every page sits in the right-hand two thirds of the screen. */
.shell.personal-shell { display: block; }
.shell.personal-shell > .main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }


/* A figure you can actually read, on hover.
   Francis: "these are useless if we can't have mouse over to view numbers." The bars carried title
   attributes, but a native tooltip takes a second to appear, shows one bar at a time, and cannot be
   styled — so a chart of twelve months answered "how much?" twelve slow times. This shows both
   figures for the month at once, immediately, above the column. */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -8px);
  background: var(--navy, #1d2b3a); color: #fff; font-size: 12px; line-height: 1.5;
  padding: 7px 10px; border-radius: 8px; white-space: pre; z-index: 30; pointer-events: none;
  box-shadow: 0 6px 20px rgba(16,24,40,.22); font-variant-numeric: tabular-nums;
}
[data-tip]:hover::before {
  content: ""; position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -2px);
  border: 6px solid transparent; border-top-color: var(--navy, #1d2b3a); z-index: 30; pointer-events: none;
}
/* The column has to be hoverable across its whole height, not only where the bar happens to reach,
   or short months are unhoverable — which is precisely when you want to know the number. */
.cols > div, .kp-bars .m { cursor: default; }
tr:target { background: rgba(180,140,40,.16); transition: background 1.2s; }

/* ---- Which company am I in? A colour, on every page. -------------------------------------------
   Francis flagged reading PEIAGENTS' trust report while standing in Maison Maritime House as a
   security issue, and was right (server.js, requirePeiagents). Text says which books are open;
   colour is what the eye checks without reading. So each company owns a hue, carried by
   <html data-company>, which head.ejs already sets on every page: a band across the very top of the
   window, the company you are in inside the switcher, and the company name under the mark. It is
   drawn by CSS alone, so no layout rebuild can lose it, and it stays off the printed page. */
/* --co-ink is the ink on the colour, where it fills the company button: white read at 3.1:1 on the brokerage's gold (review
   of #145), and at 3.0 to 4.2:1 on the grey, the green, the teal, the purple and the rose. Each takes the ink that reads at
   4.5:1 or more on it: white on the navy and the slate, the house's dark ink on the gold, the green, the teal and the
   grey, and black on the purple and the rose, where neither white nor the dark ink reaches 4.5:1 (4.3:1 and 4.4:1 at best). */
html { --co: #8a97ab; --co-ink: #1c1607; }
html[data-company="peiagents"] { --co: #b48c28; --co-ink: #1c1607; }   /* the brokerage: its own gold */
html[data-company="ftv"]       { --co: #1f3a5f; --co-ink: #fff; }      /* FT Ventures: navy */
html[data-company="fmt"]       { --co: #2f9e6f; --co-ink: #1c1607; }   /* FMT Portfolio: green */
html[data-company="mmh"]       { --co: #a05fd0; --co-ink: #000; }      /* Maison Maritime House: purple */
html[data-company="garago"]    { --co: #0d9488; --co-ink: #1c1607; }   /* GARAGO: teal */
html[data-company="sme"]       { --co: #5b6b7f; --co-ink: #fff; }      /* the small-business edition: slate */
html[data-edition="personal"]  { --co: #c25d7a; --co-ink: #000; }      /* My Money: rose, whatever company it hangs off */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: 5px; background: var(--co); z-index: 10000; pointer-events: none; }
.tb-co-btn.sel, .tb-co-btn.sel:hover { background: var(--co); color: var(--co-ink); }
.brand .sub { border-left: 3px solid var(--co); padding-left: 7px; }
@media print { body::before { display: none; } }

/* ---- The accounts rail in the sidebar (layouts that keep one): what is in the bank, on every screen. */
.acct-rail { margin: 6px 10px 10px; padding: 6px 0 4px; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
.acct-rail[hidden] { display: none; }
.acct-rail .ar-head { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #8a97ab; margin: 0 4px 4px; }
.acct-rail .ar-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 4px 6px; align-items: center; padding: 3px 4px; border-radius: 6px;
  color: #c9d1dc; text-decoration: none; font-size: 12px; line-height: 1.25; }
.acct-rail .ar-row:hover { background: rgba(255,255,255,.08); color: #fff; }
.acct-rail .ar-ic { font-size: 13px; text-align: center; }
.acct-rail .ar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-rail .ar-bal { font-variant-numeric: tabular-nums; font-weight: 700; color: #fff; }
.acct-rail .ar-rev { grid-column: 3; justify-self: end; min-width: 16px; padding: 0 5px; border-radius: 8px; background: var(--amber-fill); color: var(--on-amber); font-size: 12px; font-weight: 700; line-height: 15px; text-align: center; }
.nav-collapsed .acct-rail, html[data-layout="rail"] .acct-rail, html[data-layout="openbook"]:not(.ob-nav-full) .acct-rail { display: none; }
.acct-rail .ar-more { grid-template-columns: 1fr; color: #8a97ab; font-size: 12px; }

/* ---- The one list (dashboard): the six counts as its heading, one row per thing that needs you. */
.ol-head { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ol-chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 12px; color: var(--text); background: var(--bg); }
.ol-chip .ol-k { color: var(--muted); }
.ol-chip .ol-v { font-weight: 700; }
.ol-chip.ol-ok { border-color: #b9dcc5; background: #e8f5ec; color: #1a5b31; }
.ol-chip.ol-warn { border-color: #e6d29a; background: #fff8e4; color: #6b551a; }
.ol-chip.ol-bad { border-color: #e7bebe; background: #fdecea; color: #8e2b2b; }
.dw-row.flag-green .dw-mark { color: var(--green, #2e7d32); }
.dw-row.flag-todo .dw-mark { color: var(--amber, #b07d10); }
.dw-row.flag-step .dw-mark, .dw-row.flag-question .dw-mark { color: var(--muted); }

/* ---- Account codes on demand (Arrange the menu → Account codes). The code stays in the markup; a
   person who does not read codes does not see them, and one click brings them back. */
html[data-codes="off"] .acct-code { display: none; }

/* ---- The three numbers (dashboard): cash now, cash in thirteen weeks, what blocks filing. */
.tn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tn { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); text-decoration: none; color: var(--text); }
.tn:hover { border-color: var(--gold, #b48c28); }
.tn-l { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tn-v { font-size: 26px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tn-v.neg, .tn-v.bad { color: #8e2b2b; }
.tn-v.ok { color: #1a5b31; }
/* The card is dark in the dark theme: these fixed inks read at 2.2 to 2.4:1 there, in every palette, on the three
   figures Home opens with (review of #85). The theme's own red and green read at 6:1 or more. */
html[data-theme="dark"] .tn-v.neg, html[data-theme="dark"] .tn-v.bad { color: var(--red, #F0716A); }
html[data-theme="dark"] .tn-v.ok { color: var(--green, #5EEAD4); }
.tn-s { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
@media (max-width: 720px) { .tn-grid { grid-template-columns: 1fr; } }

/* ---- Wide tables scroll inside their box (tables.js wraps them), never the page ---------------- */
.tbl-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
/* A scroll box whose scrollbar is always there. A phone's or a Mac's overlay scrollbar hides until it is touched, so a table wider than
   its box looked cut off, with columns missing and nothing to say they were a swipe away. Styling the bar makes the browser draw it.
   The hint under it (.sx-hint) is shown by the page only when the table really is wider than the box. */
.tbl-scroll.sx { border: 1px solid var(--line); border-radius: 10px; scrollbar-width: auto; scrollbar-color: var(--muted) var(--panel); }
.tbl-scroll.sx::-webkit-scrollbar { height: 12px; }
.tbl-scroll.sx::-webkit-scrollbar-track { background: var(--panel); border-radius: 0 0 10px 10px; }
.tbl-scroll.sx::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 6px; border: 2px solid var(--panel); }
.tbl-scroll.sx th { white-space: normal; }
.sx-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.paper-text { display: none; }

/* ---- On paper --------------------------------------------------------------------------------
   Francis, 22 Sep 2026: "check ALL tables, print, etc..." Printed from the dark theme, every page
   came out dark, with the navigation, the filter forms and the help drawer on the sheet, and the
   wide reports cut off at the right edge (scripts/layout-sweep.js measures all of it). One block,
   for every page: the light palette, nothing but the content, and tables that fit the sheet. */
@media print {
  html, html[data-theme="dark"] {
    --navy: #16233b; --navy-2: #1e2f4f; --gold: #8a6d1a; --gold-soft: #f4ecd4; --bg: #fff; --card: #fff;
    --text: #111; --muted: #4a5561; --line: #c9d0da; --green: #1e7d46; --red: #b23a3a; --amber: #8a6210;
    --bg-soft: #fff; --co: #888;
  }
  /* Ink on paper, whatever the theme drew: the dark theme paints rows and headings in fixed
     colours, not variables, so every colour is reset here and the few that carry meaning put back. */
  *, *::before, *::after { color: #111 !important; background: transparent !important; box-shadow: none !important;
    text-shadow: none !important; border-color: #c9d0da !important; }
  html, body, .card, .kpi, .statement { background: #fff !important; }
  th, html[data-theme="dark"] th { background: #f1f3f6 !important; }
  .muted, .k, .cl-note, .cl-why, .cl-in, small, .sub { color: #555 !important; }
  .badge, .pill, .chip { border: 1px solid #888 !important; }
  .flag-red, .neg, .bad, .red, .cl-amt.out, .cm-it.out .cm-amt, .cm-wk .out, .cm-tot .out { color: #b23a3a !important; }
  .flag-green, .ok, .green, .cl-amt.in, .cm-it.in .cm-amt, .cm-wk .in, .cm-tot .in { color: #1e7d46 !important; }
  /* A control inside a table prints as its text (tables.js writes the text beside it). */
  td select, td input:not([type="checkbox"]):not([type="radio"]), td textarea { display: none !important; }
  .paper-text { display: inline !important; }
  /* Nothing that navigates, filters, floats or asks: the content alone. */
  .lk-sleek-wrap, .lk-sleek, .lk-topbar, .lk-qrail, .lk-ribbon, .lk-ribbon-editor, .topbar, .sidebar, .acct-rail,
  .help-drawer, .txn-drawer, .xp-pop, .toast, .pal-wrap, form[method="get"], .rpt-toolbar, .chips, .reg-add,
  .btn, button, .no-print { display: none !important; }
  .main { padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; }
  .card { box-shadow: none !important; border: 1px solid #c9d0da; background: #fff !important; break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
  /* Tables on the sheet, not past it: a scroll box shows all of it, a heading may wrap, and a
     header row repeats on every page. A table wider than the sheet is scaled to it (tables.js
     sets --print-fit and turns the sheet landscape when one needs it). */
  .tbl-scroll, [style*="overflow-x"], [style*="overflow:auto"], [style*="overflow: auto"] { overflow: visible !important; }
  table { max-width: 100% !important; }
  th { position: static !important; white-space: normal !important; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  table[data-print-fit] { zoom: var(--print-fit, 1); }
}

/* ---- On a phone ----------------------------------------------------------------------------------
   Measured by scripts/layout-sweep.js at 390 px: a fixed-layout table squeezed its columns to 20 px
   (Jan, Feb… in the rent grid, the inputs on agent billing), a select with a 420 px floor pushed
   the report sideways, a header written in one line was cut. Below 720 px a table takes its own
   width and scrolls inside its card, a control is never wider than the screen, a header may wrap. */
@media (max-width: 720px) {
  table { table-layout: auto !important; }
  th { white-space: normal !important; }
  select, input:not([type="checkbox"]):not([type="radio"]), textarea { max-width: 100%; min-width: 0 !important; box-sizing: border-box; }
}
/* A fixed-layout table cannot widen a column for its heading, so the heading wraps instead of being cut. */
table[style*="table-layout:fixed"] th, table[style*="table-layout: fixed"] th { white-space: normal; }

/* Bank Import tables keep a file name, a date, an amount and an account number whole.
   "td { overflow-wrap: anywhere }" above lets a long bank description wrap; in a narrow column it
   also broke "download-transactions.csv" every four letters, a date at its hyphen and 1500.00 as
   "1500.0 / 0", and squeezed the account picker to "— Skip t". These tables break only between
   words, and when that makes one wider than the screen it scrolls inside its card, as tables.js
   does for any wide table. Measured by scripts/layout-sweep.js as SPLIT. */
.whole-words td { overflow-wrap: break-word; }
.whole-words select { max-width: none; }

/* ================= REPORT TABLE SYSTEM ==========================================
   Reports share one reading rhythm: compact controls, a clear heading row, quiet
   banding to carry the eye across, and totals that are easy to find. The route on
   <body> scopes this to report pages, so working tables elsewhere keep their own
   behaviour. Figures, links, filters, exports and print markup are untouched. */
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .page-head {
  margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  align-items: center;
}
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .page-head h1 {
  margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.015em;
}
/* Figures can be long currency values on dashboards and working lists as well as reports.
   Give every KPI enough room to remain whole; the flex row wraps into balanced rows before
   a value can be clipped or a summary is squeezed into an unreadable stack. */
body .kpis { --kpi-min: 220px; }
/* On a wide screen, common KPI counts divide into complete rows instead of leaving one
   stretched orphan card underneath. Narrow screens still use the ordinary responsive wrap. */
@media (min-width: 1200px) {
  .kpis:has(> .kpi:nth-child(6):last-child) > .kpi { flex-basis: calc(33.333% - 7px); }
  .kpis:has(> .kpi:nth-child(7):last-child) > .kpi,
  .kpis:has(> .kpi:nth-child(8):last-child) > .kpi { flex-basis: calc(25% - 8px); }
  .kpis:has(> .kpi:nth-child(9):last-child) > .kpi,
  .kpis:has(> .kpi:nth-child(10):last-child) > .kpi { flex-basis: calc(20% - 8px); }
}
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) form.card[method="get"] {
  padding: 10px 12px; margin-bottom: 12px; border-color: color-mix(in srgb, var(--line) 78%, var(--navy));
  box-shadow: none;
}
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) form.card[method="get"] label {
  font-size: 12px; color: var(--muted);
}
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) form.card[method="get"] :is(input, select) {
  margin-top: 3px;
}
table.reg:not(.rg) {
  border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: 9px;
  box-shadow: 0 1px 2px rgba(16,24,40,.035);
}
table.reg:not(.rg) thead th,
table.reg:not(.rg) > tbody:first-child > tr:first-child > th {
  color: var(--text); background: color-mix(in srgb, var(--bg) 72%, var(--card));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, var(--navy));
  font-weight: 700;
}
table.reg:not(.rg) tbody tr:nth-child(even):not(.total) td {
  background: color-mix(in srgb, var(--bg) 48%, transparent);
}
table.reg:not(.rg) tbody tr:hover td {
  background: color-mix(in srgb, var(--gold-soft) 55%, var(--card));
}
table.reg:not(.rg) tbody td:first-child {
  font-weight: 500;
}
table.reg:not(.rg) tr.total td {
  border-top: 2px solid var(--navy); background: var(--gold-soft); font-weight: 750;
}
.table-tools { display: flex; justify-content: flex-end; align-items: center; min-height: 27px; margin: 0 0 5px; }
.table-tools .btn { min-height: 25px; padding: 2px 9px; font-size: 12px; }
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .statement {
  max-width: 1040px; padding: 22px 30px 30px; border-top: 3px solid var(--gold);
  box-shadow: 0 2px 8px rgba(16,24,40,.055);
}
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .stmt-actions { max-width: 1040px; }
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .statement tr.section td {
  padding: 7px 10px; background: #eef1f5; border-top: 1px solid #d7dde6;
  border-bottom: 1px solid #d7dde6; text-transform: uppercase; letter-spacing: .045em;
}
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .statement tr.sub td {
  padding-top: 6px; padding-bottom: 6px;
}
body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .statement tr.grand td {
  background: #f7f0dc; padding-top: 8px; padding-bottom: 8px;
}
@media (max-width: 720px) {
  body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .page-head { align-items: flex-start; }
  body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .statement { padding: 14px 10px 20px; }
  body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) form.card[method="get"] { padding: 9px; }
}
@media print {
  body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .page-head { border: 0; }
  table.reg:not(.rg),
  body:is([data-page*="/reports"], [data-page^="/ftv/report-"]) .statement { border-top-color: #333; box-shadow: none; }
}

/* The kind of file an import came from, beside its name: PDF or CSV. */
.badge.kind { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); padding: 0 7px; margin-left: 4px; letter-spacing: .3px; }

/* Before anything goes in (views/partials/import-check.ejs): what a file would leave out because the
   same money is already in from the other kind of file. The whole-file notice leads, amber like
   every other caution in the books; below 720 px each line stacks, so Keep stays in reach. */
.ic-intro p { margin: 0 0 6px; }
.ic-intro p:last-child { margin-bottom: 0; }
.ic-acct { margin: 14px 0 18px; }
.ic-acct-name { margin: 0 0 8px; font-size: 16px; }
.ic-whole, .ic-note { border-left: 3px solid var(--amber); margin-bottom: 10px; }
.ic-say { font-weight: 600; margin: 12px 0 6px; }
.ic-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.ic-list { margin: 0; }
.ic-list th.ic-k, .ic-list td.ic-k { width: 1%; white-space: nowrap; }
.ic-keep { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ic-keep input { width: auto; margin: 0; }
.ic-lbl { display: none; }
.ic-pair { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0; background: var(--bg-soft); }
.ic-pair p { margin: 0 0 6px; }
.ic-pair ul { margin: 0; padding-left: 18px; }
.ic-pair li { margin: 2px 0; }
.ic-foot p { margin: 0 0 8px; }
.ic-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* A date or an amount in these lists stays whole ("nowrap" has no rule of its own in this sheet). */
.ic-list .nowrap, .lo-list .nowrap { white-space: nowrap; }
.lo-list td.lo-act { white-space: nowrap; width: 1%; }
@media (max-width: 720px) {
  /* Out of table layout altogether: "table.reg tbody tr { height: 34px }" is a floor for a table
     row but a ceiling for a grid, and the second line of each row ran into the next. */
  table.reg.ic-list, table.reg.ic-list tbody { display: block; }
  table.reg.ic-list thead { display: none; }
  table.reg.ic-list tbody tr { display: grid; height: auto; grid-template-columns: auto 1fr auto; grid-template-areas: "keep new amt" "keep old old";
    column-gap: 10px; row-gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
  table.reg.ic-list tbody tr:last-child { border-bottom: 0; }
  .ic-list tbody td { border: 0 !important; padding: 0 !important; }
  .ic-list td.ic-k { grid-area: keep; width: auto; align-self: start; }
  .ic-list td.ic-new { grid-area: new; }
  .ic-list td.ic-amt { grid-area: amt; }
  .ic-list td.ic-old { grid-area: old; color: var(--muted); }
  .ic-lbl { display: inline; }
  .ic-actions .btn { flex: 1 1 auto; text-align: center; }
  /* The lines left out, on a review page: the same stacking, Bring back on a line of its own. */
  table.reg.lo-list, table.reg.lo-list tbody { display: block; }
  table.reg.lo-list thead { display: none; }
  table.reg.lo-list tbody tr { display: grid; height: auto; grid-template-columns: auto 1fr auto; grid-template-areas: "date desc amt" "old old old" "act act act";
    column-gap: 10px; row-gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
  table.reg.lo-list tbody tr:last-child { border-bottom: 0; }
  .lo-list tbody td { border: 0 !important; padding: 0 !important; }
  .lo-list td.lo-date { grid-area: date; }
  .lo-list td.lo-desc { grid-area: desc; }
  .lo-list td.lo-amt { grid-area: amt; }
  .lo-list td.lo-old { grid-area: old; color: var(--muted); }
  .lo-list td.lo-act { grid-area: act; width: auto; }
}

/* Dashboard | BrokerFlow switch at the top of the menu — the dashboard carries the same one (Francis, 5 Oct 2026). */
.app-switch { display: grid; grid-template-columns: 1fr 1fr; margin: 10px 16px 2px; padding: 3px; border-radius: 8px; background: rgba(0,0,0,.28); }
.app-switch a, .app-switch span { text-align: center; padding: 6px 4px; border-radius: 6px; font-size: 12.5px; color: #c3ccdd; text-decoration: none; }
.app-switch span { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.app-switch a:hover { color: #fff; background: rgba(255,255,255,.05); }
html[data-layout="rail"] .app-switch, html[data-layout="openbook"]:not(.ob-nav-full) .app-switch { display: none; }

/* Tenant Portal: a lease that looks like the same tenant, with its one-click Connect (views/ftv/portal.ejs) */
.pt-looks { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12px; background: var(--gold-soft);
  border-left: 3px solid var(--gold); padding: 4px 8px; border-radius: 6px; white-space: normal; max-width: 420px; }
/* Tenant Portal: the welcome letter, read before it is sent (views/ftv/portal-welcome.ejs) */
.pw-letter { max-width: 720px; }
.pw-meta { font-size: 13px; padding: 2px 0; }
.pw-meta .muted { display: inline-block; min-width: 64px; }
.pw-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.55; }
.pw-actions { max-width: 720px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pw-send { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pw-tick { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.pw-tick input { width: auto; margin: 0; }

/* Tenant Portal: messages start fresh, automatic receipts (views/ftv/portal.ejs) */
.pt-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.pt-switches h3 { margin: 0 0 4px; font-size: 15px; }
.pt-switches p { font-size: 13px; margin: 0 0 8px; }
@media (max-width: 700px) { .pt-switches { grid-template-columns: 1fr; } }

/* Tenant Portal: Connect them all (views/ftv/portal.ejs) */
.pt-connect-all h3 { margin: 0 0 4px; font-size: 15px; }
.pt-connect-all p { font-size: 13px; margin: 0 0 8px; }
.pt-ca-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.pt-ca-row input { width: auto; margin: 3px 0 0; }
.pt-connect-all .btn { margin-top: 10px; }
/* Message Center (views/ftv/messages.ejs, message.ejs) */
.mc-tabs { display: flex; gap: 6px; margin: 10px 0 12px; border-bottom: 2px solid var(--line); }
.mc-tab { padding: 8px 14px 6px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none; }
.mc-tab.on { color: var(--text); border-bottom-color: var(--gold); }
.mc-filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.mc-filter select, .mc-filter input { width: auto; }
.mc-list tr.mc-unread td { background: var(--gold-soft); }
.mc-new { display: inline-block; background: var(--gold); color: var(--on-gold); border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.mc-urgent { display: inline-block; background: #b3261e; color: #fff; border-radius: 6px; padding: 0 6px; font-size: 12px; font-weight: 700; }
.mc-dir.from { color: #1e7a44; font-weight: 600; } .mc-dir.to { color: var(--muted); }
.mc-thread { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.mc-say { padding: 10px 12px; border-radius: 10px; max-width: 85%; }
.mc-say.them { background: var(--bg); border: 1px solid var(--line); align-self: flex-start; }
.mc-say.us { background: var(--gold-soft); align-self: flex-end; }
.mc-say .who { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.mc-say .body { white-space: pre-wrap; font-size: 14px; }
.mc-answer { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.mc-tick { display: flex; gap: 6px; align-items: center; } .mc-tick input { width: auto; margin: 0; }

/* Portal info (views/ftv/portal-info.ejs): one tenant's portal, how they hear from us changed for them */
.pi-card h2 { margin-top: 0; }
.pi-say { max-width: 70ch; }
.pi-note { font-size: 12px; }
.pi-link { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pi-link input { flex: 1 1 280px; max-width: 480px; font-size: 13px; }
.pi-reach { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.pi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pi-reach fieldset { border: 1px solid var(--line, #e3e7ee); border-radius: 10px; padding: 6px 12px 8px; margin: 0; }
.pi-reach legend { font-size: 12px; font-weight: 600; padding: 0 4px; }
.pi-tick { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 4px 0; }
.pi-tick input { width: auto; }
.pi-inline { display: inline; }
.pi-what td { vertical-align: top; }
.pi-bad { color: var(--red); }
@media (max-width: 560px) { .pi-row { grid-template-columns: 1fr; } }
/* Payouts tied from the General Ledger (views/payments/list.ejs, src/lib/payout-ties.js) */
.pt-tie { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.pt-tie select, .pt-tie input { width: auto; }

/* Favorites (public/navfav.js): the star on a menu line, a sub-menu line or a tab. Hollow, it shows under the pointer or the
   keyboard; gold, the screen is a favorite and the star stays. The section above Home keeps a hairline under it. */
.fav-star { margin-left: auto; padding: 0 2px 0 8px; font-size: 14px; line-height: 1; color: currentColor; opacity: 0; cursor: pointer; transition: opacity .12s; }
.sec-tab .fav-star, .sl-sub-link .fav-star { margin-left: 4px; padding: 0 0 0 2px; }
a:hover > .fav-star, a:focus-within > .fav-star, .fav-star:focus { opacity: .55; }
.fav-star:hover, .fav-star:focus { opacity: 1 !important; color: var(--gold); outline: none; }
.fav-star:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-radius: 3px; }
.fav-star.on { opacity: .9; color: var(--gold); }
.fav-star.busy { opacity: .3; pointer-events: none; }
@media (hover: none) { .fav-star { opacity: .45; } .fav-star.on { opacity: .9; } }
.nav a.fav-empty .lbl { font-style: italic; opacity: .8; }

/* The Reports sections: one dropdown with every report, grouped (no sideways scrolling) */
.sec-dd { display: block; border-bottom: 2px solid var(--line); overflow: visible; position: relative; padding-bottom: 8px; }
.sec-drop > summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; }
.sec-drop > summary::-webkit-details-marker { display: none; }
.sec-drop > summary small { color: var(--muted, #6b7480); font-size: 12px; margin-left: 6px; }
.sec-drop[open] > summary { border-color: #18364a; }
.sec-panel { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% - 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 14px 16px; columns: 4 210px; column-gap: 22px; max-width: 1100px; }
.sec-pg { break-inside: avoid; margin-bottom: 12px; }
.sec-ph { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b7480); padding: 2px 6px 4px; }
.sec-pi { display: block; padding: 5px 8px; border-radius: 6px; color: inherit; text-decoration: none; font-size: 14px; }
.sec-pi:hover { background: #f1f4f8; }
.sec-pi.on { background: #18364a; color: #fff; }
@media print { .sec-dd { display: none; } }

/* Dark mode for the screens that set their own light backgrounds inline (24 Oct 2026, the kit's last pass: 83 screens wrote background:#fff or a pale
   note colour into a style attribute, and stayed white in dark mode). A white panel takes the card's colour; a pale amber, red, green or blue note takes
   a dark tint of the same colour, and its words the page's. Printed documents are drawn without the theme and keep their paper. */
@media screen {
  html[data-theme="dark"] :is([style*="background:#fff;"], [style$="background:#fff"], [style*="background: #fff;"], [style$="background: #fff"], [style*="background:#fff "], [style*="background:#ffffff"], [style*="background: #ffffff"], [style*="background:white"], [style*="background: white"], [style*="background:#fafbfc"], [style*="background:#f8fafc"], [style*="background:#f9fafb"], [style*="background:#f5f8ff"], [style*="background:#f3f5f8"], [style*="background:#f6f8fb"]) {
  background: var(--card) !important; color: var(--text); border-color: var(--line);
}
  html[data-theme="dark"] :is([style*="background:#fdf2e6"], [style*="background:#fdf3d7"], [style*="background:#fff8e4"], [style*="background:#fff8e6"], [style*="background:#fbf0d6"], [style*="background:#fff6dd"], [style*="background:#fff4e5"], [style*="background:#FFF4E5"], [style*="background:#fef3c7"], [style*="background:#fffbeb"]) {
  background: #2E2210 !important; color: var(--text) !important; border-color: #5A4417 !important;
}
  html[data-theme="dark"] :is([style*="background:#fdecea"], [style*="background:#fcefee"], [style*="background:#fdeceb"], [style*="background:#fee2e2"], [style*="background:#fef2f2"], [style*="background:#FDECEA"]) {
  background: #3A1F1C !important; color: var(--text) !important; border-color: #6B2E27 !important;
}
  html[data-theme="dark"] :is([style*="background:#e8f5e9"], [style*="background:#ecfdf5"], [style*="background:#f0fdf4"], [style*="background:#e7f6ec"], [style*="background:#eef8f0"]) {
  background: #152C20 !important; color: var(--text) !important; border-color: #234A35 !important;
}
  html[data-theme="dark"] :is([style*="background:#eef4ff"], [style*="background:#eff6ff"], [style*="background:#e8f0fe"], [style*="background:#eaf1fe"], [style*="background:#f0f6ff"]) {
  background: #13213D !important; color: var(--text) !important; border-color: #22304A !important;
}
  /* Words written in the theme's navy (the kit's first pass put var(--navy) where five hard-coded shades were): in dark mode the navy is the page's own
     dark, so they read in the page's words colour; a navy fill keeps its navy. */
  html[data-theme="dark"] :is([style^="color:var(--navy"], [style^="color: var(--navy"], [style*=";color:var(--navy"], [style*="; color:var(--navy"], [style*="; color: var(--navy"], [style*=";color: var(--navy"]) { color: var(--text) !important; }
}

/* A page's words in both languages (public/lang.js): the interface language's shows, the other is hidden. */
html:not([data-lang="fr"]) .l-fr { display: none !important; }
html[data-lang="fr"] .l-en { display: none !important; }
