/* Champion HQ application frame. Tokens only; light is the default, dark is a stored preference; density on one --h token.
   Corners: 6px controls, 10px sheets, lozenge status chips; nothing round. Grid 8px; global bar 48; rail 256 (76 folded);
   inspector 320; status bar 24; grid rows 36. Champion Trades' own navy (#143C5D) and orange (#D97757), never Trade Handy's. */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 300 800; font-display: swap; src: url('fonts/archivo-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/source-sans-3-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/source-sans-3-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/source-sans-3-latin-600-normal.woff2') format('woff2'); }

:root, .ug-light {
  --paper: #ffffff; --paper-ink: #1c2430; --pv-canvas: #ebe4d6; /* page view: white paper on a paperbark desk (design law, 15 Nov 2026: never grey) */
  /* brand */
  --poseidon: #143c5d; --ink-950: #081322; --ink-800: #132743; --ink-700: #1c3657; --ink-600: #2a4a73; --ink-300: #93a6bf; --ink-200: #c3cfdd;
  --accent: #d97757; --accent-2: #c4643f;
  /* surfaces and text (light) */
  /* the Champion family palette (Sean, 8 Nov 2026; education-builder docs/BRAND.md): Paper ground, white cards, Paper 2 tiles, Stone hairlines */
  /* day is paperbark light (design law, Sean 15 Nov 2026: "sandy paperbark … not too yellow, not too grey … light, calm and clean") */
  --ground: #f7f2e9; --sheet: #ffffff; --sheet-2: #efe8db; --chrome: #ffffff; --rail: #f1ebdf;
  --text: #141f2b; --text-2: #4f5d6e; --text-3: #6b7684; --hair: #e4dccd; --hair-2: #d6ccb9; --heading: var(--poseidon);
  --shadow-1: 0 1px 2px rgba(20,60,93,.06), 0 1px 1px rgba(20,60,93,.04); --shadow-2: 0 2px 6px rgba(20,60,93,.08), 0 8px 24px rgba(20,60,93,.07); --shadow-3: 0 12px 40px rgba(20,60,93,.18);
  --ok: #23874f; --ok-bg: #eaf8f0; --ok-line: #3dbb74; /* one fresh green for paid / done / accepted, matched to the bright orange (Sean, 1 Nov 2026) */ --warn: #b48a0e; --warn-bg: #f5f7fa; --gold: #b48a0e; --paperbark: var(--gold); /* gold, never brown, olive, mustard or a yellow wash: a due time, a warning word, a notice's edge (Sean, 8 Nov 2026: "never brown!! use gold") */ --danger: #8c3a2e; --danger-bg: #f7e8e4; --info: #143c5d; --info-bg: #e8f1fb; --neutral: #46525e; --neutral-bg: #e9e4db; --on-bg: var(--poseidon); --on-line: var(--poseidon); --purple: #5b2a86; --purple-bg: #f3e8ff;
  --current: var(--poseidon); --focus: var(--ink-600); /* the place you are and what is picked: navy; orange only for main buttons (Sean, 15 Nov 2026) */
  /* geometry */
  --g: 8px; --ctl: 32px; --ctl-sm: 28px; --h: var(--ctl); --pill-h: 24px; --r-pill: 6px; --touch: 40px; --row: 36px; --gbar: calc(48px + env(safe-area-inset-top, 0px)); --rail-w: 256px; --rail-fold: 76px; --insp-w: 320px; --sbar: calc(24px + env(safe-area-inset-bottom, 0px)); --r-ctl: 6px; --r-sheet: 10px;
  /* type */
  --f-ui: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; --f-read: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* the Office stylesheet's names, re-pointed so every existing page follows the theme */
  --navy: var(--poseidon); --navy-2: var(--ink-700); --deep: var(--ink-950); --or: var(--accent); --or-2: var(--accent-2);
  --ink: var(--text); --muted: var(--text-2); --line: var(--hair); --line-2: var(--hair-2); --bg: var(--ground); --card: var(--sheet);
  --bad: var(--danger); --r: var(--r-sheet); --shadow: var(--shadow-1); --card-2: var(--sheet-2); --card-hover: var(--sheet-2); --tint-warn: var(--warn-bg);
  color-scheme: light;
}
:root[data-theme="dark"], .ug-dark {
  --pv-canvas: #23282f; /* the paper stays white in dark mode, as in Preview */
  /* dark is Poseidon itself (8 Nov 2026): navy page, Deep Poseidon cards, Poseidon tiles, off-white text */
  --ground: #143c5d; --sheet: #0f2e4a; --sheet-2: #1b476b; --chrome: #0f2e4a; --rail: #0f2e4a;
  --text: #e9eef4; --text-2: #a9bacb; --text-3: #8fa3b8; --hair: #2b5a80; --hair-2: #34628a; --heading: #f4f7fa; /* family hairlines on navy (8 Nov 2026): Hairline #2B5A80, Hairline 2 #34628A */
  --shadow-1: 0 1px 2px rgba(0,0,0,.35); --shadow-2: 0 2px 8px rgba(0,0,0,.45), 0 10px 30px rgba(0,0,0,.35); --shadow-3: 0 14px 44px rgba(0,0,0,.6);
  --ok: #5fd597; --ok-bg: #123a2a; --ok-line: #5fd597; --warn: #e8c44a; --warn-bg: #2a3444; --gold: #e8c44a; --paperbark: var(--gold); /* gold on navy, never brown or beige (Sean, 8 Nov 2026: "use gold") */ --danger: #d2695b; --danger-bg: #40201a; --info: #9fc4ea; --info-bg: #0f2e4a; --neutral: #b7c5d6; --neutral-bg: #1b476b; --on-bg: #25557f; --on-line: #9fc4ea; --purple: #cdb0f2; --purple-bg: #2b1d40;
  --focus: #9fc4ea; --current: #9fc4ea;
  color-scheme: dark;
}
:root[data-density="compact"] { --ctl: 28px; --ctl-sm: 24px; --row: 32px; }
:root[data-density="roomy"] { --ctl: 36px; --ctl-sm: 32px; --row: 40px; }
/* touch (a phone, an iPad, any coarse pointer): every control is 44px (31 Oct 2026, was 40px), every field 16px so iOS never zooms (30 Oct 2026) */
@media (max-width: 900px), (pointer: coarse) {
  :root, :root[data-density="compact"], :root[data-density="roomy"] { --ctl: 44px; --ctl-sm: 44px; --touch: 44px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
}

html { scrollbar-gutter: stable; }
body { font: 15px/1.45 var(--f-read); color: var(--text); background: var(--ground); }
h1, h2, h3, h4, .btn, button, label, .tab, .rail, .gbar, .pbar, .sbar, .f > label, th { font-family: var(--f-ui); }
h1 { font-weight: 600; letter-spacing: -.01em; } h2 { font-weight: 600; }
#main h1, #main h2, .pbar h1 { color: var(--heading); } /* headings Poseidon on paper, off-white on navy (8 Nov 2026) */
.tnum, td.r, .stat b, .money { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- the frame */
.app { height: 100%; display: grid; grid-template-rows: var(--gbar) 1fr var(--sbar); grid-template-columns: var(--rail-w) 1fr; grid-template-areas: "gbar gbar" "rail work" "sbar sbar"; background: var(--ground); }
.app[data-rail="icons"] { grid-template-columns: var(--rail-fold) 1fr; }
.gbar { grid-area: gbar; display: flex; align-items: center; gap: var(--g); box-sizing: border-box; padding: env(safe-area-inset-top, 0px) 12px 0 10px; background: var(--poseidon); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.gbar .mark { display: flex; align-items: center; gap: 10px; height: 48px; color: #fff; text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.gbar .mark img { width: 26px; height: 26px; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }   /* same as the website editor's (Sean, 31 Oct 2026) */
.gbar .crumb { display: flex; align-items: center; gap: 4px; font-size: 13px; margin-left: 10px; min-width: 0; }
.gbar .crumb a { color: var(--ink-200); text-decoration: none; padding: 4px 6px; border-radius: var(--r-ctl); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .gbar .crumb a:hover { background: rgba(255,255,255,.1); color: #fff; } }
.gbar .crumb .here { color: #fff; font-weight: 600; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gbar .crumb .sep { color: var(--ink-300); }
.gbar .grow { flex: 1; }
.gbar .ksearch { display: flex; align-items: center; gap: 8px; height: 32px; min-width: 260px; padding: 0 10px; border-radius: var(--r-ctl); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: var(--ink-200); font-size: 13px; cursor: text; }
@media (hover: hover) and (pointer: fine) { .gbar .ksearch:hover { background: rgba(255,255,255,.15); color: #fff; } }
.gbar .ksearch kbd { margin-left: auto; font: 11px var(--f-ui); color: var(--ink-300); border: 1px solid rgba(255,255,255,.25); border-radius: 4px; padding: 1px 5px; }
.gbar .ib { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-ctl); background: transparent; border: 0; color: var(--ink-200); position: relative; }
@media (hover: hover) and (pointer: fine) { .gbar .ib:hover { background: rgba(255,255,255,.12); color: #fff; } }
.gbar .ib .n { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 5px; background: var(--danger); color: #fff; font: 600 10px/16px var(--f-ui); text-align: center; }
.gbar .acct { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 6px; border-radius: var(--r-ctl); background: transparent; border: 0; color: #fff; font: 500 13px var(--f-ui); }
@media (hover: hover) and (pointer: fine) { .gbar .acct:hover { background: rgba(255,255,255,.12); } }
.gbar .acct .av { width: 24px; height: 24px; border-radius: 6px; background: var(--poseidon); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); font: 700 11px/24px var(--f-ui); text-align: center; }

.rail { grid-area: rail; display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid var(--hair); overflow: hidden; }
.rail .scroll { flex: 1; overflow: auto; padding: 8px 8px 8px; }
.rail .sect { margin: 10px 8px 4px; font: 600 11px/16px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.rail a.row { display: flex; align-items: center; gap: 10px; height: var(--row); padding: 0 10px; margin: 1px 0; border-radius: var(--r-ctl); color: var(--text); text-decoration: none; font: 500 14px var(--f-ui); position: relative; white-space: nowrap; }
.rail a.row .ic { color: var(--text-2); flex: none; }
@media (hover: hover) and (pointer: fine) { .rail a.row:hover { background: var(--sheet); } }
.rail a.row.on { background: var(--sheet); box-shadow: var(--shadow-1); color: var(--info); }
.rail a.row.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--current); }
.rail a.row.on .ic { color: var(--info); }
.rail a.row .n { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 5px; background: var(--hair); color: var(--text-2); font: 600 11px/18px var(--f-ui); text-align: center; }
.rail a.row .n.warn { background: var(--warn-bg); color: var(--warn); }
.rail a.row .n.bad { background: var(--danger-bg); color: var(--danger); }
.rail .foot { border-top: 1px solid var(--hair); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.rail .ent { display: flex; align-items: center; gap: 10px; height: var(--h); padding: 0 10px; border-radius: var(--r-ctl); border: 1px solid var(--hair); background: var(--sheet); color: var(--text); font: 500 13px var(--f-ui); text-align: left; width: 100%; }
@media (hover: hover) and (pointer: fine) { .rail .ent:hover { border-color: var(--hair-2); } }
.rail .ent .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.rail .ent small { display: block; color: var(--text-3); font-weight: 400; font-size: 11px; }
.rail .ent .ic { margin-left: auto; color: var(--text-3); }
.rail .fold { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border: 0; background: transparent; color: var(--text-3); border-radius: var(--r-ctl); font: 500 12px var(--f-ui); }
@media (hover: hover) and (pointer: fine) { .rail .fold:hover { background: var(--sheet); color: var(--text); } }
.app[data-rail="icons"] .rail .sect, .app[data-rail="icons"] .rail a.row span.t, .app[data-rail="icons"] .rail a.row .n, .app[data-rail="icons"] .rail .ent .t, .app[data-rail="icons"] .rail .ent .ic, .app[data-rail="icons"] .rail .fold .t { display: none; }
.app[data-rail="icons"] .rail a.row { justify-content: center; padding: 0; }
.app[data-rail="icons"] .rail .ent { justify-content: center; padding: 0; }
.app[data-rail="icons"] .rail .fold { justify-content: center; }

.work { grid-area: work; display: grid; grid-template-rows: auto auto 1fr; grid-template-columns: 1fr auto; grid-template-areas: "pbar pbar" "stabs stabs" "main insp"; min-width: 0; min-height: 0; }
/* the pages of one menu row, as tabs above the page (hq/ui/menu11.mjs, 13 Nov 2026); one line, it scrolls sideways on a phone */
.stabs { grid-area: stabs; display: flex; align-items: stretch; gap: 2px; padding: 0 16px; background: var(--chrome); border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; min-width: 0; } .stabs::-webkit-scrollbar { display: none; }
.stab { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 38px; padding: 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-2, var(--text)); text-decoration: none; font: 500 13px/1 var(--f-ui); white-space: nowrap; }
.stab.on { color: var(--heading); border-bottom-color: var(--heading); font-weight: 600; }
.stab .n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font: 600 11px/16px var(--f-ui); text-align: center; } .stab .n.bad { background: var(--danger-bg); color: var(--danger); }
@media (hover: hover) { .stab:hover { color: var(--heading); background: var(--bg-2, rgba(0,0,0,.04)); } }
.more-page { display: flex; flex-direction: column; gap: 18px; } .more-page .pm-tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } .more-page .pm-tile .s { white-space: normal; overflow: visible; } .more-kind h2 { margin: 0 0 8px; font: 600 13px/1.2 var(--f-ui); letter-spacing: .02em; color: var(--text-2, var(--text)); }
@media print { .stabs { display: none !important; } }
.pbar { grid-area: pbar; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 20px; background: var(--chrome); border-bottom: 1px solid var(--hair); }
.pbar .plate { width: 32px; height: 32px; border-radius: var(--r-ctl); background: var(--info-bg); color: var(--info); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pbar h1 { margin: 0; font: 600 18px/24px var(--f-ui); color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .sub { color: var(--text-2); font-size: 13px; white-space: nowrap; }
.pbar .grow { flex: 1; }
.pbar .ribbon { display: flex; align-items: center; gap: 6px; }
.pbar .ribbon .btn { gap: 6px; }
main#main { grid-area: main; overflow: auto; min-width: 0; min-height: 0; }
.insp { grid-area: insp; width: var(--insp-w); border-left: 1px solid var(--hair); background: var(--sheet); overflow: auto; }
.insp[hidden] { display: none; }
.sbar { grid-area: sbar; display: flex; align-items: flex-start; box-sizing: border-box; gap: 16px; padding: 0 12px env(safe-area-inset-bottom, 0px); background: var(--chrome); border-top: 1px solid var(--hair); font: 500 11px/24px var(--f-ui); color: var(--text-2); white-space: nowrap; overflow: hidden; }
.sbar .grow { flex: 1; }
.sbar .lamp { display: inline-flex; align-items: center; gap: 5px; }
.sbar .lamp i { width: 8px; height: 8px; border-radius: 2px; background: var(--ok); display: inline-block; }
.sbar .lamp.warn i { background: var(--warn); } .sbar .lamp.bad i { background: var(--danger); }

/* pages inside the frame: the page's own h1 moves into the program bar */
main#main .page { max-width: none; padding: 20px 20px 80px; }
main#main h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* the title lives in the program bar */
.panel, .stat, .thread, .dlg { border-radius: var(--r-sheet); box-shadow: var(--shadow-1); border: 1px solid var(--hair); background: var(--sheet); }
.btn, input, select, textarea { border-radius: var(--r-ctl) !important; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ink-950); }
@media (hover: hover) and (pointer: fine) { .btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); } }
/* touch (iPhone, iPad): hover colours are for a mouse only (iOS keeps :hover after a tap, which left the darker orange on the
   button); a press gives a brief dip instead and the button keeps the true accent #D97757 (1 Nov 2026) */
.btn:active { transform: translateY(1px); } .btn.primary:active { filter: brightness(.94); }
.btn.dark { background: var(--on-bg); color: #fff; border-color: var(--on-bg); }
input, select, textarea { background: var(--sheet); color: var(--text); border: 1px solid var(--hair-2); }
textarea { min-height: calc(var(--ctl) * 2); }
table.list th { color: var(--text-2); font: 600 11px/16px var(--f-ui); letter-spacing: .05em; text-transform: uppercase; }
table.list td { height: var(--row); }
@media (hover: hover) and (pointer: fine) { table.list tbody tr:hover { background: var(--sheet-2); } }
.hint, .muted { color: var(--text-2); }
/* a notice (Sean, 8 Nov 2026: the yellow banners looked bad): warm paper with one amber edge, plain text; yellow stays for money in */
.warnbox { background: var(--warn-bg); color: var(--text); border: 1px solid var(--hair); border-left: 3px solid var(--warn); border-radius: var(--r-ctl); }
.okbox { background: var(--ok-bg); border-radius: var(--r-ctl); }

/* dark: inside the work area the Office's navy is a text colour, so it turns light; chrome keeps the real navy */
:root[data-theme="dark"] main#main, :root[data-theme="dark"] .insp, :root[data-theme="dark"] .dlg { --navy: #cfe0f2; --deep: #e6edf5; }
/* dark: the books pages follow the theme; the total row keeps a real navy */
:root[data-theme="dark"] .list tr.grand td { background: var(--ink-700); color: #fff; }
:root[data-theme="dark"] .grid-table th.sorted .arrow, :root[data-theme="dark"] .rec-kind { color: var(--info); }
:root[data-theme="dark"] .bk[style*="color"] { color: var(--text) !important; } /* the entity chips' own colour (navy) is too dark on dark */
:root[data-theme="dark"] main#main h2[style*="color"] { color: var(--text) !important; }
:root[data-theme="dark"] .warnbox.muted { background: var(--sheet-2); border-color: var(--hair-2); color: var(--text-2); }
:root[data-theme="dark"] .drop.over { background: var(--sheet-2); } @media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .drop:hover { background: var(--sheet-2); } }
:root[data-theme="dark"] .ed-form fieldset.lockset input, :root[data-theme="dark"] .ed-form fieldset.lockset textarea, :root[data-theme="dark"] .ed-form fieldset.lockset select { background: var(--sheet-2); }
.gbar .drawer { display: none; }
.gbar .ksearch span.t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* icons: masked so they take the text colour */
.ic { display: inline-block; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--svg) center / contain no-repeat; mask: var(--svg) center / contain no-repeat; flex: none; }
.ic.sm { width: 14px; height: 14px; } .ic.lg { width: 22px; height: 22px; }

/* ⌘K palette */
.kpal { position: fixed; inset: 0; background: rgba(8,19,34,.45); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 60; }
.kpal .box { width: min(680px, 92vw); background: var(--sheet); border-radius: var(--r-sheet); box-shadow: var(--shadow-3); border: 1px solid var(--hair); overflow: hidden; }
.kpal input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--hair); padding: 0 16px 0 44px; font: 16px var(--f-read); background: var(--sheet) var(--svg) 14px center / 20px no-repeat; border-radius: 0 !important; }
.kpal .list { max-height: 56vh; overflow: auto; padding: 6px; }
.kpal .sect { padding: 10px 10px 4px; font: 600 11px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.kpal .it { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: var(--r-ctl); cursor: pointer; }
.kpal .it .ic { color: var(--text-2); }
.kpal .it .t { font: 500 14px var(--f-ui); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpal .it .s { color: var(--text-2); font-size: 12px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.kpal .it.on { background: var(--sheet-2); } @media (hover: hover) and (pointer: fine) { .kpal .it:hover { background: var(--sheet-2); } } .kpal .it.on { box-shadow: inset 3px 0 0 var(--current); }
.kpal .foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--hair); color: var(--text-3); font: 11px var(--f-ui); }
.kpal kbd { border: 1px solid var(--hair-2); border-radius: 4px; padding: 0 5px; font: 11px var(--f-ui); }

/* entity switcher overlay */
.swm { position: absolute; left: 8px; bottom: 56px; width: calc(var(--rail-w) - 16px); background: var(--sheet); border: 1px solid var(--hair); border-radius: var(--r-sheet); box-shadow: var(--shadow-3); padding: 6px; z-index: 50; }
.swm .it { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: var(--r-ctl); color: var(--text); text-decoration: none; font: 500 13px var(--f-ui); }
@media (hover: hover) and (pointer: fine) { .swm .it:hover { background: var(--sheet-2); } } .swm .it.on { background: var(--sheet-2); box-shadow: inset 3px 0 0 var(--current); }
.swm .it .dot { width: 10px; height: 10px; border-radius: 3px; }
.swm .it small { color: var(--text-3); margin-left: auto; font-weight: 400; }

/* toasts: bottom-right, non-blocking */
.toast { position: fixed; right: 16px; bottom: 40px; left: auto; top: auto; transform: none; max-width: 420px; background: var(--ink-800); color: #fff; border-radius: var(--r-ctl); box-shadow: var(--shadow-3); padding: 10px 14px; font: 500 13px/1.4 var(--f-ui); z-index: 70; }
.toast.bad { background: var(--danger); }
.toast .toast-act { margin-left: 12px; background: #fff; color: var(--ink-800); border-color: #fff; }

/* phone and narrow windows: rail becomes a drawer */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "gbar" "work" "sbar"; }
  .rail { position: fixed; top: var(--gbar); bottom: var(--sbar); left: 0; width: var(--rail-w); z-index: 40; transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility 0s .18s; } /* shut: no shadow leaking onto the page, nothing to tab to */
  .app[data-drawer="open"] .rail { transform: none; visibility: visible; box-shadow: var(--shadow-3); transition-delay: 0s; }
  .gbar .ksearch { min-width: 0; flex: 1; }
  .gbar .drawer { display: inline-flex; }
  .gbar .mark span.t { display: none; }
  .gbar .crumb { display: none; }
  .insp { position: fixed; right: 0; top: var(--gbar); bottom: var(--sbar); z-index: 40; box-shadow: var(--shadow-3); }
  main#main .page { padding: 14px 12px 80px; }
  .pbar { flex-wrap: wrap; padding: 8px 12px; min-height: 0; }
  .pbar h1 { font-size: 17px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; gap: 10px; }
  .stat b { font-size: 22px; }
}
@media (max-width: 600px) { .insp { width: 100%; left: 0; } }
/* inline editing in the Properties pane */
.ied { font: inherit; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--r-ctl); padding: 3px 6px; margin: -3px -6px; width: calc(100% + 12px); min-width: 0; }
@media (hover: hover) and (pointer: fine) { .ied:hover { border-color: var(--hair-2); background: var(--sheet-2); } }
.ied:focus { border-color: var(--focus); background: var(--sheet); box-shadow: 0 0 0 3px rgba(42, 74, 115, .14); }
textarea.ied { resize: vertical; white-space: pre-wrap; }
.ikv.one { grid-template-columns: 1fr !important; } .ikv.one > b { display: none; }
.ied:disabled { opacity: .6; }
/* printing any screen (⌘P in the Mac app, macos/main.swift printPage): A4, no app chrome, light paper, clean breaks.
   The record screens also print as A4 PDFs in the owning business's branding (Print buttons, group/print.mjs). */
@media print {
  @page { size: A4; margin: 12mm; }
  :root { color-scheme: light; }
  .gbar, .rail, .sbar, .pbar .ribbon, .cside, .insp, #toast, .toast, .op-status, .ws-tabs, .ws-next-acts, .ws-pane-acts, .mats-head, .btn, button { display: none !important; }
  .app, main#main, .page { display: block !important; overflow: visible !important; height: auto !important; max-width: none !important; background: #fff !important; color: #141f2b !important; }
  .ws-card, .panel, article, section, tr { break-inside: avoid; page-break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; color: #143C5D; font-family: 'Archivo', var(--f-ui), sans-serif; font-weight: 700; }
  a { color: inherit; text-decoration: none; }
}

/* ---- the grid */
.grid:focus { outline: 2px solid transparent; } .grid:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--r-ctl); }
.dangerbox { background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); border-radius: var(--r-ctl); padding: 10px 12px; }
.grid-bar { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.grid-bar input[type="search"] { min-width: 240px; }
.grid-views { margin-bottom: 8px; }
.grid-views .tab .xv { margin-left: 6px; color: var(--text-3); } @media (hover: hover) and (pointer: fine) { .grid-views .tab .xv:hover { color: var(--danger); } }
.grid-wrap { overflow: auto; border-radius: var(--r-sheet); }
/* a list a little too wide for its space keeps its table: the words wrap, the figures stay on one line (grid.mjs adds .tight) */
.grid-wrap.tight td { white-space: normal; overflow-wrap: break-word; } .grid-wrap.tight td.r, .grid-wrap.tight th.r, .grid-wrap.tight td .chip, .grid-wrap.tight td .pill { white-space: nowrap; overflow-wrap: normal; } .grid-wrap.tight td { max-width: 320px; } .grid-wrap.tight td.nw, .grid-wrap.tight th { white-space: nowrap; overflow-wrap: normal; }
/* a list that does not fit its space: each row a card, no sideways scroll (hq/ui/grid.mjs adds .stack when the columns overflow) */
.grid-wrap.stack { overflow: visible; }
.grid-wrap.stack table, .grid-wrap.stack tbody { display: block; width: 100%; }
.grid-wrap.stack thead { display: none; }
.grid-wrap.stack tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 8px 18px; padding: 12px 14px; border-top: 1px solid var(--hair); }
.grid-wrap.stack tr:first-child { border-top: 0; }
.grid-wrap.stack td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.grid-wrap.stack td::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1px; }
.grid-wrap.stack td:first-child { grid-column: 1 / -1; font-weight: 700; font-size: 15px; } .grid-wrap.stack td:first-child::before { content: none; }
.grid-wrap.stack td.r { text-align: left; } .grid-wrap.stack td:empty { display: none; }
.grid-wrap.stack td.empty { display: block; } .grid-wrap.stack td.empty::before { content: none; }
.grid-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; background: var(--sheet); border: 1px solid var(--hair); border-radius: var(--r-sheet); overflow: hidden; box-shadow: var(--shadow-1); }
/* no position: sticky on the headings (14 Nov 2026): their scroll box (.grid-wrap) never scrolls up or down, so it never held
   them, but it put them on a layer of their own that Chrome sometimes drew half a pixel to the side (LINES, CATEGORY, EXCL. GST
   on Receipts "changing" in npm run lock with no code changed) */
.grid-table th { background: var(--sheet-2); text-align: left; padding: 0 12px; height: 36px; border-bottom: 1px solid var(--hair); cursor: pointer; user-select: none; white-space: nowrap; }
.grid-table th.r { text-align: right; }
.grid-table th .arrow { margin-left: 6px; font-size: 9px; color: var(--text-3); opacity: 0; } .grid-table th:hover .arrow { opacity: .6; } .grid-table th.sorted .arrow { opacity: 1; color: var(--poseidon); }
.grid-table td { padding: 0 12px; height: var(--row); border-bottom: 1px solid var(--hair); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.grid-table td.r { text-align: right; }
.grid-table tbody tr { cursor: default; } @media (hover: hover) and (pointer: fine) { .grid-table tbody tr:hover { background: var(--sheet-2); } }
.grid-table tbody tr.sel { background: var(--info-bg); box-shadow: inset 3px 0 0 var(--current); }
:root[data-theme="dark"] .grid-table tbody tr.sel { background: #1d3650; }
.grid-table td.empty { text-align: center; color: var(--text-2); height: 80px; white-space: normal; }
.grid-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.grid-foot .pager { display: inline-flex; align-items: center; gap: 6px; }
.lede { margin: 0 0 8px; }

/* ---- inspector */
.insp-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--hair); font: 600 14px var(--f-ui); }
.insp-head .ib { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: var(--r-ctl); color: var(--text-2); } @media (hover: hover) and (pointer: fine) { .insp-head .ib:hover { background: var(--sheet-2); color: var(--text); } }
.insp-body { padding: 14px 16px 40px; font-size: 14px; }
.insp-body h3 { margin: 16px 0 6px; font: 600 11px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.insp-body .title { font: 600 18px/24px var(--f-ui); margin: 0 0 4px; }
.insp-body .kv { grid-template-columns: 110px 1fr; }
.insp-body .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.insp-body .acts .btn { gap: 6px; }
.insp-body .tot { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.insp-body .tot b { font-weight: 600; }

/* ---- context menu */
.cmenu { position: fixed; z-index: 80; min-width: 220px; padding: 6px; background: var(--sheet); border: 1px solid var(--hair); border-radius: var(--r-sheet); box-shadow: var(--shadow-3); }
.cmenu .it { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; background: transparent; border-radius: var(--r-ctl); color: var(--text); font: 500 13px var(--f-ui); text-align: left; }
@media (hover: hover) and (pointer: fine) { .cmenu .it:hover { background: var(--sheet-2); } } .cmenu .it.danger { color: var(--danger); }
.cmenu .rule { height: 1px; background: var(--hair); margin: 6px 4px; }

/* ---- settings as sections */
.set-grid { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.set-rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.set-rail a.row { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-ctl); color: var(--text); text-decoration: none; font: 500 13px var(--f-ui); }
.set-rail a.row .ic { color: var(--text-2); } @media (hover: hover) and (pointer: fine) { .set-rail a.row:hover { background: var(--sheet); } } .set-rail a.row.on { background: var(--sheet); box-shadow: var(--shadow-1), inset 3px 0 0 var(--current); color: var(--info); } .set-rail a.row.on .ic { color: var(--info); }
.set-panel { max-width: 860px; }
.set-page { max-width: 1240px; }
.set-toggle { display: none; }
@media (max-width: 900px) {
  .set-grid { grid-template-columns: 1fr; }
  .set-rail { position: static; padding: 4px; margin-top: 6px; background: var(--sheet); border: 1px solid var(--hair); border-radius: var(--r-sheet); box-shadow: var(--shadow-1); }
  .set-rail:not(.open) { display: none; }
  .set-toggle { display: flex; width: 100%; justify-content: flex-start; gap: 8px; font-weight: 600; }
  .set-toggle .t { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
  .set-rail a.row { height: auto; min-height: 40px; }
}

/* ---- Ask attachments */
.thread.drop { outline: 2px dashed var(--current); outline-offset: -4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chipf { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 1px solid var(--hair-2); border-radius: var(--r-ctl); background: var(--sheet); font-size: 12px; }
.chipf .x { border: 0; background: transparent; color: var(--text-3); font-size: 14px; padding: 0 2px; } @media (hover: hover) and (pointer: fine) { .chipf .x:hover { color: var(--danger); } }
.msg.claude a { color: var(--ink-600); } :root[data-theme="dark"] .msg.claude a { color: var(--info); }

/* ---- Workshop */
.wsbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border: 1px solid var(--hair); border-radius: var(--r-ctl); background: var(--sheet-2); font-size: 13px; }
.diff pre, pre.cmd { margin: 4px 0; padding: 6px 8px; border-radius: 4px; font: 12px/1.4 ui-monospace, Menlo, monospace; white-space: pre-wrap; max-height: 220px; overflow: auto; }
.diff .del { background: var(--danger-bg); color: var(--danger); } .diff .add, pre.add { background: var(--ok-bg); color: var(--ok); } pre.cmd { background: var(--ink-950); color: #e6edf5; }

/* ---- scanner */
.scanpal .box { width: min(560px, 94vw); }
.scanhead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--hair); font: 600 14px var(--f-ui); }
.scanhead .ib { width: 30px; height: 30px; border: 0; background: transparent; border-radius: var(--r-ctl); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.scanvid { position: relative; background: #000; aspect-ratio: 4 / 3; } .scanvid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanvid::after { content: ''; position: absolute; inset: 0; background: #1baf7a; opacity: 0; pointer-events: none; }
.scanvid.flash::after { animation: scanflash .45s ease-out; } .scanvid.flash .scanframe { border-color: #1baf7a; }
@keyframes scanflash { 0% { opacity: .55; } 100% { opacity: 0; } }
.scansig { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--hair-2); } .scansig[hidden] { display: none; }
.scanpal .hint.ok { color: #1baf7a; font-weight: 600; }
.scanframe { position: absolute; inset: 14% 18%; border: 2px solid rgba(255,255,255,.85); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); pointer-events: none; }
.scanbar { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; } .scanbar input { width: 100%; }
.scanpal .hint.bad { color: var(--danger); font-weight: 600; }
/* scanning with the other device (scanlink.mjs): the link line over the picture, the asking panel, the offer bar */
.scanhand { white-space: nowrap; }
.scanlinkst { padding: 8px 14px; font: 600 13px/1.35 var(--f-ui); color: var(--text-2); background: var(--sheet-2); border-bottom: 1px solid var(--hair-2); } .scanlinkst[hidden] { display: none; }
.scanlinkst.ok { color: var(--ok); background: var(--ok-bg); } .scanlinkst.bad { color: var(--danger); background: var(--danger-bg); }
.scanask { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 18px 14px; text-align: center; }
.scanask .bar { align-self: stretch; display: flex; gap: 8px; margin-top: 6px; }
.scanask-pic { width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; background: var(--neutral-bg); color: var(--text-2); transition: background .2s, color .2s; }
.scanask-pic .ic { width: 36px; height: 36px; } .scanask-pic.on { background: var(--ok-bg); color: var(--ok); }
.scanask-st { font: 600 14px/1.4 var(--f-ui); color: var(--text); max-width: 40ch; } .scanask-st.ok { color: var(--ok); } .scanask-st.bad { color: var(--danger); }
.scanpal .box.flash { animation: scanaskflash .6s ease-out; }
@keyframes scanaskflash { 0% { box-shadow: 0 0 0 6px #1baf7a, var(--shadow-3); } 100% { box-shadow: 0 0 0 0 rgba(27,175,122,0), var(--shadow-3); } }
.scanoffer { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--sheet); color: var(--text); border: 1px solid var(--hair); border-left: 4px solid var(--poseidon); border-radius: var(--r-sheet); box-shadow: var(--shadow-3); z-index: 65; font: 14px/1.35 var(--f-ui); }
.scanoffer { flex-wrap: wrap; } .scanoffer .grow { flex: 1 1 180px; min-width: 0; } .scanoffer b { display: block; } .scanoffer > .ic { align-self: flex-start; margin-top: 2px; } .scanoffer-btns { display: flex; gap: 8px; margin-left: auto; }

/* ---- plotter */
.plot-wrap { background: var(--sheet); border: 1px solid var(--hair); border-radius: var(--r-sheet); box-shadow: var(--shadow-1); overflow: hidden; margin-top: 12px; }
.plot-wrap.drop { outline: 2px dashed var(--current); outline-offset: -4px; }
.plot-canvas { display: block; width: 100%; }
/* back / forward beside the breadcrumb */
.gbar .navhist { display: inline-flex; gap: 2px; margin-left: 8px; }
.gbar .navhist .ib { width: 28px; height: 28px; }
/* phone width (375 px, audit C9): the account button always stays in view; the less important top-bar items go first
   (the mark, Forward, the bell; the search shrinks to its icon); wide tables scroll inside their own box, never the page */
@media (max-width: 480px) {
  .gbar { gap: 2px; padding-left: 6px; padding-right: 6px; overflow: hidden; }
  .gbar .mark, .gbar .navhist .ib + .ib, .gbar a.ib[href*="/obligations"], .gbar a.ib[href*="/ask"] { display: none !important; }
  .gbar .navhist { margin-left: 0; }
  .gbar .ksearch { flex: 0 1 auto; min-width: 36px; padding: 0 8px; }
  .gbar .acct { flex: none; padding: 0 4px; }
  .gbar .acct .ic { display: none; }
  .gbar > * { flex-shrink: 0; }
  .gbar .grow { flex: 1 1 0; min-width: 0; }
  /* bigger to press on a phone, icons only, no ring (Sean, 15 Nov 2026: "the search icon … a faint circle around it … make the
     icon slightly bigger … the go back navigation arrow … slightly bigger, not too much") */
  .gbar .ib, .gbar .navhist .ib { width: 40px; height: 40px; }
  .app .gbar .ib .ic, .app .gbar .ib .ic.sm, .app .gbar .navhist .ib .ic { width: 22px; height: 22px; }
  .gbar .ksearch { min-width: 40px; height: 40px; padding: 0 9px; border: 0; background: transparent; box-shadow: none; }
  .app .gbar .ksearch .ic { width: 22px; height: 22px; }
}
@media (max-width: 640px) {
  main#main table.list, main#main table.report, main#main table.lines { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  main#main .page { overflow-x: hidden; }
}
:root[data-theme="dark"] .verified { color: var(--ok); } :root[data-theme="dark"] .unverified { color: var(--warn); }

/* controls gallery: the other theme in a box of its own */
.ug-dark { --ink: var(--text); --muted: var(--text-2); --line: var(--hair); --line-2: var(--hair-2); --bg: var(--ground); --card: var(--sheet); --card-2: var(--sheet-2); --card-hover: var(--sheet-2); --bad: var(--danger); --navy: #cfe0f2; --deep: #e6edf5; --tint-warn: var(--warn-bg); }
.ug-light { --navy: var(--poseidon); --deep: var(--ink-950); }
.ug-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 16px; align-items: start; }
.ug-pane { padding: 14px; border: 1px solid var(--hair); border-radius: var(--r-sheet); background: var(--ground); color: var(--text); }
.ug-pane h2 { margin: 0 0 10px; font: 600 14px var(--f-ui); color: var(--text-2); }
.ug-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hair); }
.ug-k { font: 600 11px var(--f-ui); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.ug-v { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
@media (max-width: 520px) { .ug-row { grid-template-columns: 1fr; } }

/* ---- The phone layout (hq/ui/phone.mjs, 6 Nov 2026): a bar at the bottom, one "+" button, the Menu's tiles.
   Phone widths only; the desktop, the Mac app and the iPad keep the rail. "Phone layout: Classic" (data-phone unset)
   leaves the phone exactly as it was. */
.pnav, .pfab { display: none; }
.pm-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pm-search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--hair-2); border-radius: 12px; background: var(--sheet); color: var(--text-3); font: inherit; text-align: left; }
.pm-ent { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--hair-2); border-radius: 12px; background: var(--sheet); color: var(--text); font: 600 14px/1 var(--f-ui); }
.pm-ent .dot, .pm-row .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pm-tile { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; align-items: center; min-width: 0; padding: 10px 12px; border: 1px solid var(--hair); border-radius: 14px; background: var(--sheet); box-shadow: var(--shadow-1); color: var(--text); text-decoration: none; }
.pm-tile .pm-ic { grid-row: 1 / span 2; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ground); color: var(--info); }
.pm-tile b { display: block; font: 600 15px/1.25 var(--f-ui); color: var(--info); }
.pm-tile .s { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-tile .n, .pm-row .n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font: 600 11px/18px var(--f-ui); text-align: center; }
.pm-tile .n { position: absolute; top: 10px; right: 10px; }
.pm-row .n.bad { background: var(--danger-bg); color: var(--danger); }
.pm-rows { display: flex; flex-direction: column; border: 1px solid var(--hair); border-radius: 14px; background: var(--sheet); overflow: hidden; }
.pm-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; color: var(--text); text-decoration: none; border-top: 1px solid var(--hair); font: 500 15px/1.2 var(--f-ui); }
.pm-row:first-child { border-top: 0; } .pm-row .t { flex: 1; min-width: 0; } .pm-row.on { color: var(--info); font-weight: 600; }
.pm-row > .ic:first-child { color: var(--info); } .pm-row > .ic.sm:last-child { color: var(--text-3); }
.pm-back { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 10px; color: var(--info); font-weight: 600; text-decoration: none; min-height: 32px; }
.pm-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.psheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(8,19,34,.4); }
.ps-card { width: min(520px, 100%); padding: 8px 14px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; background: var(--sheet); box-shadow: var(--shadow-3); animation: ps-up .18s ease; }
@keyframes ps-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ps-card { animation: none; } }
.ps-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--hair-2); margin: 2px auto 6px; }
.ps-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; } .ps-h b { font: 600 17px/1 var(--f-ui); color: var(--info); }
.ps-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; }
.ps-i { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: transparent; color: var(--text); font: 600 12px/1.2 var(--f-ui); }
.ps-ic { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--hair); background: var(--ground); color: var(--info); }
.ps-ic .ic { width: 24px; height: 24px; } .ps-i.hot .ps-ic { background: color-mix(in srgb, var(--current) 14%, var(--sheet)); border-color: color-mix(in srgb, var(--current) 40%, var(--sheet)); color: var(--accent); }
@media (max-width: 700px) {
  .app[data-phone="on"] { --sbar: 0px; --pnav: calc(58px + 8px + env(safe-area-inset-bottom, 0px)); }
  .app[data-phone="on"] .sbar { display: none; }
  .app[data-phone="on"] .pbar .ribbon .web-btn { display: none; } /* the website editor is in Menu on a phone */
  .app[data-phone="on"] .gbar .drawer { display: none; }
  .app[data-phone="on"] main#main .page { padding-bottom: calc(var(--pnav) + 84px); }
  .app[data-phone="on"] .pnav { display: flex; position: fixed; z-index: 36; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); height: 58px; padding: 0 4px; border: 1px solid var(--hair); border-radius: 22px; background: color-mix(in srgb, var(--sheet) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow-3); }
  .pnav .pn { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-2); text-decoration: none; font: 600 10.5px/1 var(--f-ui); -webkit-tap-highlight-color: transparent; }
  .pnav .pn .ic { width: 22px; height: 22px; } .pnav .pn.on { color: var(--info); }
  .pnav .pn .n { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font: 700 10px/16px var(--f-ui); text-align: center; }
  .app[data-phone="on"] .pfab { display: flex; align-items: center; justify-content: center; position: fixed; z-index: 35; right: 16px; bottom: calc(var(--pnav) + 12px); width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 45%, transparent); }
  .pfab .ic { width: 26px; height: 26px; }
  .app[data-phone="on"][data-drawer="open"] .pfab, .app[data-phone="on"][data-side="open"] .pfab { display: none; }
  body:has(.app[data-phone="on"]) .toast { right: 12px; left: 12px; max-width: none; bottom: calc(58px + 24px + env(safe-area-inset-bottom, 0px)); }
  .pm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Design law (Sean, 15 Nov 2026, "All of it"): the menu's groups a little apart; night with a soft sheen, never glare */
.rail a.row[data-row="clients"], .rail a.row[data-row="logistics"], .rail a.row[data-row="receipts"], .rail a.row[data-row="more"] { margin-top: 13px; }
.rail a.row[data-row="clients"]::after, .rail a.row[data-row="logistics"]::after, .rail a.row[data-row="receipts"]::after, .rail a.row[data-row="more"]::after { content: ''; position: absolute; left: 10px; right: 10px; top: -8px; height: 1px; background: var(--hair); pointer-events: none; }
.app[data-rail="icons"] .rail a.row[data-row]::after { left: 14px; right: 14px; }
:root[data-theme="dark"] body { background: radial-gradient(1200px 600px at 20% -10%, #1b4a72 0%, transparent 60%), var(--ground); background-attachment: fixed; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .panel, :root[data-theme="dark"] .dlg, :root[data-theme="dark"] .tile { background-image: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,0) 42%); box-shadow: inset 0 1px 0 rgba(255,255,255,.07), var(--shadow-1); }
:root[data-theme="dark"] .btn { background-image: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)); }
:root[data-theme="dark"] .btn.primary { background-image: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0)); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 10px rgba(217,119,87,.18); }
:root[data-theme="dark"] .gbar .acct .av { background: #25557f; }

/* The side menu's folding groups (15 Nov 2026): every page findable under the main rows */
.rail .rgrp { margin-top: 2px; }
.rail .rgrp:first-of-type { margin-top: 13px; border-top: 1px solid var(--hair); padding-top: 6px; }
.rail .rgrp-h { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 10px; border: 0; background: none; color: var(--text-2); font: 600 12px var(--f-ui); letter-spacing: .02em; text-transform: uppercase; cursor: pointer; border-radius: var(--r-ctl); text-align: left; }
@media (hover: hover) and (pointer: fine) { .rail .rgrp-h:hover { background: var(--sheet-2); color: var(--text); } }
.rail .rgrp-h .ic { transition: transform .15s ease; } .rail .rgrp.open > .rgrp-h .ic { transform: rotate(90deg); }
.rail .rgrp-b { display: none; } .rail .rgrp.open > .rgrp-b { display: block; }
.rail a.row.sub { height: 32px; font-size: 13.5px; padding-left: 18px; }
.app[data-rail="icons"] .rail .rgrp-h .t { display: none; } .app[data-rail="icons"] .rail .rgrp-h { justify-content: center; padding: 0; }
.app[data-rail="icons"] .rail a.row.sub { padding-left: 0; }
@media (prefers-reduced-motion: reduce) { .rail .rgrp-h .ic { transition: none; } }
