/* =====================================================================
   SMV dashboard — THE THEME (prompt 18, 2026-10-06). One place for every colour, font and motion; index.html, floor.html,
   ui.css and every page script use these variables only (tools/theme-check.js fails the deploy on a hard-coded colour
   anywhere else, except the fixed money colours listed below).

   "High-tech, fast": a deep navy top bar (--nav) with an electric cyan → blue accent (--el1 → --el2, --grad) for active tabs,
   highlights and progress; a light page (--bg) so tables and numbers read in daylight on the shop floor.
   ONE company colour (--co) for SMV and AJ Machines alike: the header stripe, the company switcher, the company badges, the
   printed heads and the PDF stripe. There is no separate accent colour per company; the electric accent never changes either.
   MONEY COLOURS ARE FIXED and must never be re-themed: green received / good, amber due / warn, red overdue / bad,
   dark red escalated, purple closed-by-others, grey not due.
   ===================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(assets/fonts/inter-latin-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Noto Sans Tamil'; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/noto-sans-tamil-tamil-400-normal.woff2) format('woff2'); unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; }
@font-face { font-family: 'Noto Sans Tamil'; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/noto-sans-tamil-tamil-700-normal.woff2) format('woff2'); unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; }
:root {
  /* prompt 30B (2026-10-22): FOUR COLOUR THEMES, Admin → Appearance (Management). This :root block = "Navy Ledger", the default;
     the html[data-theme="…"] blocks below re-set the same variables for Steel Teal, Charcoal Amber and Night (dark). Every theme
     passes tools/theme-contrast.js (≥ 4.5:1: white on every solid button, the text on the page / cards / stripes, the ledger's
     debit red and credit green, the header). The MATERIAL IN green / OUT blue (--in-green / --out-blue) never change. */
  /* base */
  --bg: #F4F7FB; --card: #ffffff; --ink: #0F172A; --muted: #475569; --line: #E2E8F0; --stripe: #F5F7FA;
  --nav: #1F3A5F; --nav-2: #2A4C78; --nav-ink: #EEF3FA; --nav-muted: #B9C7DB; --nav-line: #35598A;
  /* the electric accent (--el2 = the theme's primary; the solid blue buttons take --blue below) */
  --el1: #38BDF8; --el2: #2563EB; --grad: linear-gradient(90deg, var(--el1), var(--el2)); --accent: #2563EB; --acc2: #EAF0FF; --accentB: #2563EB; --glow: 0 0 0 3px rgba(37, 99, 235, .22);
  /* the ledger (Finance → Petty cash): debit / money out, credit / money in */
  --pc-out: #B91C1C; --pc-in: #15803D;
  /* the swatches of Admin → Appearance (header, primary, in, out of each theme) */
  --th-navy-1: #1F3A5F; --th-navy-2: #2563EB; --th-navy-3: #15803D; --th-navy-4: #B91C1C; --th-navy-5: #F5F7FA;
  --th-steel-1: #134E4A; --th-steel-2: #0F766E; --th-steel-3: #047857; --th-steel-4: #BE123C; --th-steel-5: #F0FDFA;
  --th-charcoal-1: #1F2937; --th-charcoal-2: #B45309; --th-charcoal-3: #15803D; --th-charcoal-4: #B91C1C; --th-charcoal-5: #FAFAF9;
  --th-night-1: #0F172A; --th-night-2: #3B82F6; --th-night-3: #4ADE80; --th-night-4: #F87171; --th-night-5: #1E293B;
  /* the one company colour (the red of the logos), the same for SMV and AJ Machines */
  --co: #b23a36;
  /* neutrals */
  --n50: #f9fafb; --n100: #f2f4f7; --n150: #eef1f5; --n200: #e5e7eb; --n300: #d0d5dd; --n400: #98a2b3; --n500: #6b7280; --n600: #475467; --n700: #334155; --n800: #1f2937;
  /* blues (information) */
  --blue: #2563EB; --blue-d: #1D4ED8; --blue-b: #2563eb; --blue-50: #eef4ff; --blue-100: #dbe7ff; --sky-100: #e0f2fe; --sky-800: #075985; --info: #1D4ED8; --infobg: #e3f1ff;   /* --blue = the theme's primary (solid blue buttons) */
  /* MONEY — fixed, never re-themed */
  --good: #12805c; --gbg: #e7f6ef; --warn: #b54708; --bad: #c4320a; --bbg: #fdeee8; --darkred: #7f1d1d; --purple: #7e22ce; --notdue: #98a2b3;
  /* chart series (one per person / category) */
  --chart-1: #1f5fbf; --chart-2: #12805c; --chart-3: #f79009; --chart-4: #7a5af8; --chart-5: #dd2590; --chart-6: #0e9384; --chart-7: #667085;
  /* shape, depth, motion */
  /* spacing scale (prompt 20): every gap, padding and margin is one of these */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --late: #c2410c; --late-bg: #fff7ed; --late-line: #fb923c;   /* "Late" (orange): a routine ticked after its grace */
  --att-warn: #f59e0b;   /* the amber of an attention frame (before due); due / overdue uses --bad */
  /* prompt 22: the faded half of the pulse, written as rgba so the frame pulses on every browser (color-mix needs
     Chrome 111+, and on an older one the frame just sat there) */
  --att-warn-f: rgba(245, 158, 11, .22); --att-bad-f: rgba(196, 50, 10, .22);
  --navy: #1b2a4a;   /* the neutral number colour on the KPI tiles */
  --in-green: #16A34A; --in-green-d: #15803d; --out-blue: #2563EB; --out-blue-d: #1d4ed8;   /* prompt 27: MATERIAL IN / MATERIAL OUT buttons (bold white text ≥ 18 px) */
  --radius: 8px; --radius-l: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06); --shadow-l: 0 8px 28px rgba(16, 24, 40, .14); --t: 150ms;
  --font: 'Inter', 'Noto Sans Tamil', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
/* ---------- type ---------- */
body { font-family: var(--font); font-variant-numeric: tabular-nums; background: var(--bg); color: var(--ink); }
html[lang="ta"] body, body.ta { font-family: 'Noto Sans Tamil', 'Inter', system-ui, sans-serif; line-height: 1.45; }   /* Tamil letters need the room above and below */
html[lang="ta"] .pill, body.ta .pill, html[lang="ta"] button, body.ta button { line-height: 1.35; }
.n, td.n, th.n, .tile .v, .sh-num .v, .progtxt, .kn, .cnt { font-variant-numeric: tabular-nums; }
/* ---------- the top bar and the tabs: navy, electric active tab ---------- */
header { background: var(--nav); color: var(--nav-ink); border-bottom: 1px solid var(--nav-line); border-top: 4px solid var(--co); }
header h1 { color: var(--nav-ink); } header small { color: var(--nav-muted); } header .live { background: var(--el1); }
header button.ghost, header button.btn-neutral, header button.btn-info, header button.btn-nav, header button.bell { background: transparent; color: var(--nav-ink); border: 1px solid var(--nav-line); font-weight: 600; }
header button.btn-info::before { content: none; } header button:hover { border-color: var(--el1); box-shadow: var(--glow); }
header button.bell.amber { color: #ffd166; border-color: #ffd166; } header button.bell.red { color: #ff8a80; border-color: #ff8a80; }
#logos img, .tvlogos img { background: #fff; padding: 3px 6px; border-radius: var(--radius); }
.cosw { border-color: var(--nav-line); } .cosw button { background: var(--nav-2); color: var(--nav-muted); } .cosw button.on { background: var(--co); color: #fff; }
.langbar a, header .langbar a { color: var(--nav-muted); }
nav { background: var(--nav); border-bottom: 1px solid var(--nav-line); padding: 6px 16px; }
nav a { color: var(--nav-muted); border-radius: var(--radius); transition: background var(--t), color var(--t); }
nav a:hover { color: var(--nav-ink); background: var(--nav-2); }
nav a.on { background: var(--grad); color: #fff; font-weight: 700; box-shadow: var(--glow); }
nav a .nbadge { background: var(--bad); color: #fff; }
#banner { border-bottom-color: var(--bad); }
/* ---------- the loading line (api.js sets body.loading while any call runs) ---------- */
#ldbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 60; opacity: 0; transition: width .4s ease, opacity .3s; pointer-events: none; }
body.loading #ldbar { opacity: 1; width: 85%; animation: ldpulse 1.2s ease-in-out .4s infinite alternate; }
@keyframes ldpulse { from { width: 60%; } to { width: 90%; } }
/* ---------- cards, tiles, KPI numbers, chips ---------- */
.card, .tile, .kc, .sh-card, .sh-item, .sh-num, .stcard { border-radius: var(--radius-l); box-shadow: var(--shadow); }
.kc, .sh-card, .sh-item { border-radius: var(--radius); }
.tile .v:not(.good):not(.bad):not(.warn):not(.info), .sh-num:not(.good):not(.bad) .v, .progtxt { font-size: clamp(22px, 2.2vw, 36px); white-space: nowrap; font-weight: 800; letter-spacing: -.01em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile .v.good, .tile .v.bad, .tile .v.warn, .tile .v.info { font-size: clamp(22px, 2.2vw, 36px); white-space: nowrap; }
/* prompt 16 F: inside a tile grid the number follows the width of ITS OWN TILE (container units), so it can never run past the
   edge — with the gradient paint, digits past the edge were invisible ("₹3,07,90"). 12cqi keeps 12 characters inside the tile. */
.tiles > .tile { container-type: inline-size; }
.tiles > .tile .v:not(.good):not(.bad):not(.warn):not(.info), .tiles > .tile .v.good, .tiles > .tile .v.bad, .tiles > .tile .v.warn, .tiles > .tile .v.info { font-size: clamp(18px, 12cqi, 32px); }
/* ---------- no clipped text, anywhere (prompt 20; tools/ui-check.js fails the deploy on a clipped or spilled text) ---------- */
.tile, .kc, .sh-num, .sh-card, .stcard, .card { min-width: 0; }
.tile .v, .sh-num .v, .progtxt { overflow-wrap: anywhere; }   /* a number never spills past its tile: the tile grows, the number shrinks */
.tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: var(--s3); }
.tile .k { line-height: 1.35; overflow-wrap: anywhere; }
.pill { max-width: 100%; white-space: normal; line-height: 1.3; vertical-align: baseline; }   /* a long Tamil chip wraps instead of running out of its row */
.hint, .note, .empty, .t, label, p { overflow-wrap: anywhere; }
/* table cells stay on one line (dates, amounts) and the table scrolls sideways inside its .scroll box on a small screen */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
[title] { cursor: default; }   /* the full value of a shortened text is on hover */
h1, h2, h3 { overflow-wrap: anywhere; }
/* ---------- hover and press: rows and cards lift, chips show the full value ---------- */
tr.r, .chk, .kc, .sh-item { transition: background var(--t), box-shadow var(--t), transform var(--t); }
tr.r:hover, .chk:hover { background: var(--n50); }
.kc:hover, .sh-item:hover { box-shadow: var(--shadow-l); transform: translateY(-1px); }
.kc:active, .sh-item:active { transform: none; box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .kc:hover, .sh-item:hover { transform: none; } }
.pill { border-radius: 999px; } .pill.g, .pill.a, .pill.r, .pill.b, .pill.p, .pill.y { padding-left: 7px; }
.pill.o { padding-left: 7px; }
.pill.g::before, .pill.a::before, .pill.r::before, .pill.b::before, .pill.p::before, .pill.y::before, .pill.o::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: currentColor; vertical-align: 1px; }
div.sub a.on { background: var(--acc2); color: var(--accent); border-color: var(--accent); }
.prog div { background: var(--grad); } .prog.done div { background: var(--good); }
.tabs2 a.on, .kbar a.on { background: var(--acc2); color: var(--accent); }
/* ---------- buttons: flat, 8 px, glow on hover, 48 px on a tablet ---------- */
button { border-radius: var(--radius); transition: background var(--t), box-shadow var(--t), border-color var(--t), transform var(--t); box-shadow: none; }
button:hover { box-shadow: var(--glow); } button:active { transform: translateY(1px); }
button.btn-primary:hover, button.call:hover { box-shadow: 0 0 0 3px rgba(18, 128, 92, .25); } button.btn-danger:hover, button.danger:hover { box-shadow: 0 0 0 3px rgba(200, 30, 30, .25); }
button.btn-caution:hover { box-shadow: 0 0 0 3px rgba(180, 83, 9, .25); } button.btn-neutral:hover, button.ghost:hover { box-shadow: 0 0 0 3px rgba(152, 162, 179, .3); }
button:disabled:hover { box-shadow: none; transform: none; }
@media (pointer: coarse), (max-width: 1024px) { button:not(.sm):not(.dlgx):not(.btn-seg):not(.btn-nav), .btnlike { min-height: 48px; } }
/* ---------- motion ---------- */
.pane.on { animation: fadein var(--t) ease-out; } #dlg .box { animation: popin var(--t) ease-out; } #dlg.side .box { animation: slidein var(--t) ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes popin { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pane.on, #dlg .box, #dlg.side .box { animation: none; } button { transition: none; } }
/* ---------- the login page ---------- */
body:has(#pinbox:not([style*="display: none"])) { background: var(--nav); }
#pinbox { border-radius: var(--radius-l); box-shadow: var(--shadow-l); border: 0; max-width: 360px; padding: 24px; }
#pinbox h2 { font-size: 20px; } #pinbox .logos { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; } #pinbox .logos img { height: 54px; max-width: 150px; object-fit: contain; }
#pinbox .tagline { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; margin-bottom: 6px; }
/* ---------- company colour where the company matters ---------- */
.bars .s, .lchip .s { background: var(--blue); } .bars .c, .lchip .c { background: var(--navy); }   /* the Overview chart: the same colours as the tiles (sales blue, costs navy) */
.kco.smv, .kco.aj { background: var(--co); color: #fff; } .kco.bo { background: var(--n600); color: #fff; }
/* ---------- the Big screen: dark (default) or light, Admin → Settings → Theme ---------- */
#tv { background: var(--nav); color: var(--nav-ink); } #tv .tvc { background: var(--nav-2); border-radius: var(--radius-l); } #tv .tvt { color: #fff; }
#tv .tvs, #tv .tvsec, #tv .tvc .k { color: var(--nav-muted); } #tv .tvc .x { color: #cbd5e1; } #tv .tvjob { background: var(--n700); }
#tv .tvc .v:not(.good):not(.bad):not(.warn) { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
#tv .prog { background: var(--n700); } #tv .prog div { background: var(--grad); }
#tv.light { background: var(--bg); color: var(--ink); } #tv.light .tvc { background: var(--card); box-shadow: var(--shadow); } #tv.light .tvt { color: var(--ink); }
#tv.light .tvs, #tv.light .tvsec, #tv.light .tvc .k { color: var(--muted); } #tv.light .tvc .x { color: var(--n600); } #tv.light .tvjob { background: var(--n100); color: var(--ink); }
#tv.light .good { color: var(--good); } #tv.light .bad { color: var(--bad); } #tv.light .warn { color: var(--warn); } #tv.light .prog { background: var(--n150); }
#tv.light button.ghost, #tv.light button.btn-neutral { color: var(--ink); border-color: var(--n300); } #tv.light input { background: #fff; color: var(--ink); border-color: var(--n300); }
#tv.light .tvlogos img { background: transparent; }
/* ---------- print: the company colour on the acknowledgement / DC head ---------- */
@media print { #print .cohead { border-bottom: 3px solid var(--co); } }
/* ---------- attention frames (prompt 16): a soft pulsing 2 px border, 1.5 s cycle — amber before due, red when due / overdue.
   prefers-reduced-motion: a steady border instead. Nothing is resized, so nothing can clip. ---------- */
.att-warn { box-shadow: inset 0 0 0 2px var(--att-warn); animation: attw 1.5s ease-in-out infinite; }
.att-due { box-shadow: inset 0 0 0 2px var(--bad); animation: attd 1.5s ease-in-out infinite; }
@keyframes attw { 0%, 100% { box-shadow: inset 0 0 0 2px var(--att-warn); } 50% { box-shadow: inset 0 0 0 2px var(--att-warn-f); } }
@keyframes attd { 0%, 100% { box-shadow: inset 0 0 0 2px var(--bad); } 50% { box-shadow: inset 0 0 0 2px var(--att-bad-f); } }
tr.att-warn, tr.att-due { box-shadow: none; outline: 2px solid var(--att-warn); outline-offset: -2px; animation: attwo 1.5s ease-in-out infinite; }
tr.att-due { outline-color: var(--bad); animation-name: attdo; }
@keyframes attwo { 0%, 100% { outline-color: var(--att-warn); } 50% { outline-color: var(--att-warn-f); } }
@keyframes attdo { 0%, 100% { outline-color: var(--bad); } 50% { outline-color: var(--att-bad-f); } }
@media (prefers-reduced-motion: reduce) {
  /* prompt 22: nothing moves or resizes, but the colour still breathes slowly (2.6 s), so an overdue task is seen
     on a PC where Windows has switched animation effects off. */
  .att-warn { animation: attw 2.6s ease-in-out infinite; }
  .att-due { animation: attd 2.6s ease-in-out infinite; }
  tr.att-warn { animation: attwo 2.6s ease-in-out infinite; }
  tr.att-due { animation: attdo 2.6s ease-in-out infinite; }
}

/* ---------- prompt 21: lines inside a grouped task — To do / Done sections, the Result sheet, closed lines in the Done lists ---------- */
.ltab .lsec td { background: var(--n50); color: var(--n700); font-weight: 600; font-size: 13px; padding: var(--s2) var(--s3); border-left: 4px solid var(--line); }
.ltab .ldiv td { background: var(--n100); color: var(--n600); cursor: pointer; border-top: 2px solid var(--line); }
.ltab .ldiv:hover td { background: var(--n200); }
.ltab .lhl td { background: var(--blue-50); } .ltab .lhl { outline: 2px solid var(--blue); outline-offset: -2px; }
.ltab td.lbtns { white-space: nowrap; } .ltab td.lclosed { white-space: normal; min-width: 180px; } .ltab .lres { margin-top: 2px; }
.kc.kline { border-left-color: var(--good); } .kc.kline.pur { border-left-color: var(--purple); }
.ltick { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: var(--card); font-size: 12px; line-height: 18px; text-align: center; margin-right: 6px; }
.kc.kline.pur .ltick { background: var(--purple); }
.prog.kprog { height: 4px; margin: 6px 0 2px; min-width: 0; }
#rsheet { position: fixed; inset: 0; background: color-mix(in srgb, var(--nav) 62%, transparent); display: none; align-items: center; justify-content: center; z-index: 12; padding: var(--s4); }
#rsheet .box { position: relative; background: var(--card); border-radius: var(--radius-l); padding: 18px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-l); animation: popin var(--t) ease-out; }
#rsheet label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
#rsheet input, #rsheet textarea, #rsheet select { width: 100%; min-height: 48px; font-size: 16px; }
#rsheet textarea { min-height: 64px; }
#rsheet .rsseg { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--s2); }
#rsheet .rsseg.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#rsheet .rsbig { min-height: 52px; font-size: 16px; font-weight: 600; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); color: var(--ink); white-space: normal; padding: 6px 10px; }
#rsheet .rsbig.on { border-color: var(--blue); background: var(--blue-50); color: var(--blue-d); }
#rsheet .rsbig.on.yes { border-color: var(--good); background: var(--gbg); color: var(--good); }
#rsheet .rsbig.on.no { border-color: var(--bad); background: var(--bbg); color: var(--bad); }
#rsheet .rstick { display: flex; gap: 10px; align-items: center; font-size: 16px; color: var(--ink); min-height: 48px; }
#rsheet .rstick input { width: 24px; height: 24px; min-height: 24px; flex: none; }
#rsheet .acts { display: flex; gap: var(--s2); margin-top: var(--s3); } #rsheet .rsbtn { flex: 1; min-height: 48px; font-size: 16px; }
#rsheet .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@media (max-width: 520px) { #rsheet { padding: 6px; align-items: flex-end; } #rsheet .box { border-radius: 14px 14px 0 0; } #rsheet .grid2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { #rsheet .box { animation: none; } }
/* ---------- voice typing (prompt 23): the 🎤 after a notes / amount box, red and breathing while it listens ---------- */
.vcw { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 4px 0 2px; vertical-align: middle; }
.vcw .vc { min-height: 36px; min-width: 44px; padding: 2px 10px; font-size: 18px; line-height: 1; }
.vcw .vc.on { background: var(--bad); color: #fff; border-color: var(--bad); animation: vcpulse 1.2s ease-in-out infinite; }
.vcw .vcl { min-height: 28px; min-width: 34px; padding: 0 8px; font-size: 12px; }
.vcw .vc-interim { font-size: 13px; color: var(--muted); flex-basis: 100%; }
.vcw .vc-live { color: var(--bad); font-weight: 600; } .vcw .vc-gray { color: var(--muted); }
.vcw .vc-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--gbg); border-radius: 8px; padding: 4px 8px; font-size: 15px; }
.vcw.off { font-size: 12px; }
@keyframes vcpulse { 0%, 100% { box-shadow: 0 0 0 0 var(--att-bad-f); } 50% { box-shadow: 0 0 0 8px rgba(196, 50, 10, 0); } }
@media (prefers-reduced-motion: reduce) { .vcw .vc.on { animation: none; } }

/* ---------- prompt 30B: the other three themes (Admin → Appearance; html[data-theme] is set by themeApply() in cash.js) ---------- */
/* Steel Teal */
html[data-theme="steel"] {
  --nav: #134E4A; --nav-2: #1C6560; --nav-ink: #ECFDF5; --nav-muted: #A7D3CD; --nav-line: #2A7A73;
  --el1: #2DD4BF; --el2: #0F766E; --accent: #0F766E; --acc2: #D7F5F0; --accentB: #0F766E; --glow: 0 0 0 3px rgba(15, 118, 110, .22);
  --blue: #0F766E; --blue-d: #0B5F59; --info: #0B5F59; --ink: #0F172A; --stripe: #F0FDFA; --bg: #F3FAF9;
  --pc-in: #047857; --pc-out: #BE123C; --navy: #134E4A;
}
/* Charcoal Amber */
html[data-theme="charcoal"] {
  --nav: #1F2937; --nav-2: #2B3647; --nav-ink: #F3F4F6; --nav-muted: #B4BCC8; --nav-line: #3B4657;
  --el1: #F59E0B; --el2: #B45309; --accent: #B45309; --acc2: #FEF3E2; --accentB: #B45309; --glow: 0 0 0 3px rgba(180, 83, 9, .22);
  --blue: #B45309; --blue-d: #92400E; --info: #92400E; --ink: #111827; --stripe: #FAFAF9; --bg: #F5F5F4;
  --pc-in: #15803D; --pc-out: #B91C1C; --navy: #1F2937;
}
/* Night (dark): the page, cards, text and the money colours are re-set so every figure still reads at 4.5:1 on the dark cards */
html[data-theme="night"] {
  --bg: #0F172A; --card: #1E293B; --ink: #E2E8F0; --muted: #A3B1C6; --line: #334155; --stripe: #172033;
  --nav: #0B1220; --nav-2: #172033; --nav-ink: #E2E8F0; --nav-muted: #94A3B8; --nav-line: #263247;
  --el1: #7DD3FC; --el2: #60A5FA; --accent: #60A5FA; --acc2: #1E3A5F; --accentB: #60A5FA; --glow: 0 0 0 3px rgba(96, 165, 250, .28);
  --blue: #2563EB; --blue-d: #1D4ED8; --info: #93C5FD; --infobg: #1E3A5F; --blue-50: #1E3A5F; --blue-100: #1E40AF; --sky-100: #0C4A6E; --sky-800: #BAE6FD;
  --n50: #1A2436; --n100: #243044; --n150: #2A3850; --n200: #334155; --n300: #475569; --n400: #64748B; --n500: #94A3B8; --n600: #B6C2D4; --n700: #CBD5E1; --n800: #E2E8F0;
  --good: #4ADE80; --gbg: #14532D; --warn: #FBBF24; --bad: #F87171; --bbg: #450A0A; --darkred: #FCA5A5; --purple: #C084FC; --notdue: #94A3B8;
  --late: #FDBA74; --late-bg: #431407; --late-line: #F97316; --navy: #CBD5E1;
  --pc-in: #4ADE80; --pc-out: #F87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35); --shadow-l: 0 8px 28px rgba(0, 0, 0, .55);
}
html[data-theme="night"] nav a.on { color: var(--nav); }   /* dark text on the light-blue tab (white would not reach 4.5:1 there) */
html[data-theme="night"] select, html[data-theme="night"] input, html[data-theme="night"] textarea { background: var(--n100); color: var(--ink); border-color: var(--line); }
html[data-theme="night"] tr.brk td, html[data-theme="night"] .scroll .sttab tr.brk td.lotc { background: var(--bbg); }
html[data-theme="night"] #logos img, html[data-theme="night"] .tvlogos img { background: #fff; }
html[data-theme="night"] .pill:not(.g):not(.a):not(.r):not(.b):not(.p):not(.y):not(.o) { background: var(--n200); color: var(--ink); }
html[data-theme="night"] header button.ghost, html[data-theme="night"] header button.btn-neutral, html[data-theme="night"] header button.btn-nav { color: var(--nav-ink); }
html[data-theme="night"] .cosw button { background: var(--nav-2); }
html[data-theme="night"] button.btn-neutral, html[data-theme="night"] button.ghost { background: var(--n150); color: var(--ink); border-color: var(--n300); }
html[data-theme="night"] .tile .v:not(.good):not(.bad):not(.warn):not(.info), html[data-theme="night"] .sh-num:not(.good):not(.bad) .v, html[data-theme="night"] .progtxt { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--ink); }
