/* Dark mode colour tokens (generated from convert.py; Claude 2026-10-21). Light values live in each var() fallback, so this file only
   defines the DARK set. Printouts / PDFs stay light (print media below). Edit the hand-tuned part at the bottom, not the generated list. */
html[data-theme="dark"] {
  --bd-7c3aed: #5e5077;
  --bd-7eb7d0: #48626d;
  --bd-85b7eb: #425364;
  --bd-8a9ba7: #57606b;
  --bd-91b7cf: #455a68;
  --bd-97c459: #697a51;
  --bd-9bc5d8: #425863;
  --bd-9eb9c7: #445b67;
  --bd-9fd8c4: #416256;
  --bd-a6dcc8: #3f5f53;
  --bd-a78bfa: #463f5e;
  --bd-aebfca: #495059;
  --bd-afa9ec: #3e3c5a;
  --bd-b4b2a9: #4f5660;
  --bd-b5d4f4: #384654;
  --bd-b8d6e8: #3a4c57;
  --bd-b8d9ec: #394b56;
  --bd-bdc8d2: #444b54;
  --bd-c6d0d5: #424851;
  --bd-c6d0da: #41474f;
  --bd-c8dce9: #374752;
  --bd-c8def3: #35424f;
  --bd-c9c6bb: #474d56;
  --bd-c9c7bd: #464d56;
  --bd-c9c7be: #464c56;
  --bd-c9d2dc: #40464e;
  --bd-c9d3df: #384554;
  --bd-c9d7df: #384a54;
  --bd-cbd4dc: #40454e;
  --bd-cccccc: #434951;
  --bd-ccd6dc: #3f454d;
  --bd-cfdce4: #364751;
  --bd-cfe0f5: #333f4d;
  --bd-d3d1c7: #424851;
  --bd-d5dad6: #3e444c;
  --bd-d5dbe3: #3c4249;
  --bd-d6dde6: #3b4148;
  --bd-d8d6cc: #40464e;
  --bd-d9d6cc: #40464e;
  --bd-dcdad2: #3e444c;
  --bd-dddddd: #3c4149;
  --bd-e1e0d9: #3c4149;
  --bd-e1e5ea: #383d45;
  --bd-e1e6ee: #313b4a;
  --bd-e24b4a: #764f4f;
  --bd-e2c879: #696146;
  --bd-e3b04b: #75684e;
  --bd-e3b341: #786c50;
  --bd-e3e1d8: #3b4149;
  --bd-e4b4b4: #593b3b;
  --bd-e4bd3e: #796f50;
  --bd-e5e3dc: #3a4047;
  --bd-e6e4dc: #3a3f47;
  --bd-e6ecef: #363b42;
  --bd-e7c58a: #635742;
  --bd-e8b4b4: #583a3a;
  --bd-e8c48a: #635642;
  --bd-e8cf9f: #5d533e;
  --bd-e8e6df: #393e46;
  --bd-e9c48b: #625642;
  --bd-ebe9e2: #383d44;
  --bd-eceae3: #373d44;
  --bd-ecebe6: #373c43;
  --bd-ed394b: #785054;
  --bd-eeeeee: #353a41;
  --bd-ef4444: #744d4d;
  --bd-efede6: #363b42;
  --bd-f0b4ad: #573d3a;
  --bd-f0b4b4: #563939;
  --bd-f0c36d: #695d46;
  --bd-f0d9a8: #594f3b;
  --bd-f0eee7: #363b42;
  --bd-f0eee8: #363b42;
  --bd-f0efe9: #353a41;
  --bd-f0efea: #353a41;
  --bd-f1efe8: #353a41;
  --bd-f2a93b: #76664e;
  --bd-f85149: #704d4b;
  --bd-ff8a3d: #725b4c;
  --bd-ffcf33: #746b4e;
  --bd-ffffff: #2e3238;
  --bg-6ea8dc: #30597d;
  --bg-95a5a6: #525a65;
  --bg-999999: #555d68;
  --bg-9aa7b0: #4e555f;
  --bg-9fc56f: #628636;
  --bg-a0c4e3: #254663;
  --bg-a855f7: #572f7d;
  --bg-afa9ec: #27225a;
  --bg-b4b2a9: #484f58;
  --bg-c0dd97: #4f6a28;
  --bg-c8e6c9: #224a23;
  --bg-c9c6bb: #3d434a;
  --bg-c9c7be: #3c4249;
  --bg-c9efd9: #1c4a2f;
  --bg-d3d1c7: #363c43;
  --bg-d6efe2: #1a432e;
  --bg-dce2e6: #2b2f34;
  --bg-dcfce7: #163b23;
  --bg-dddddd: #2d3137;
  --bg-dfe6ef: #1d2a3a;
  --bg-dfe7ec: #212f38;
  --bg-dff4e9: #173d29;
  --bg-e0e0e0: #2b2f35;
  --bg-e0f2fe: #152a38;
  --bg-e1e0d9: #2d3137;
  --bg-e1f5ee: #173c2f;
  --bg-e2f2e9: #1a3a28;
  --bg-e3e1d8: #2d3137;
  --bg-e3f4e8: #173a21;
  --bg-e3f5ee: #163b2c;
  --bg-e4eff9: #152838;
  --bg-e4f5ed: #163a29;
  --bg-e5e4df: #2a2e34;
  --bg-e5e7eb: #272a2f;
  --bg-e5f5ea: #163921;
  --bg-e6e5df: #2a2e33;
  --bg-e6f1fb: #152636;
  --bg-e6f4ea: #183721;
  --bg-e7f3ee: #1b352a;
  --bg-e7f4ea: #193620;
  --bg-e7f6ec: #153821;
  --bg-e8e6de: #2a2d33;
  --bg-e8eef6: #162437;
  --bg-e8f0f9: #152436;
  --bg-e8f2f8: #152a37;
  --bg-e8f4fa: #142b36;
  --bg-e9eef2: #1d2932;
  --bg-eaf1f5: #192a34;
  --bg-eaf3de: #2d3e17;
  --bg-eaf4fb: #142734;
  --bg-eaf6fb: #142b34;
  --bg-ebe9e2: #282b30;
  --bg-ece7f8: #1f1537;
  --bg-eceae3: #272b30;
  --bg-ecebe5: #262a2f;
  --bg-ede9fe: #1a1434;
  --bg-edf1f3: #22252a;
  --bg-eeedfe: #151332;
  --bg-eeeeee: #23262b;
  --bg-eef0f3: #222529;
  --bg-eef1f4: #212529;
  --bg-eef2f5: #1b262e;
  --bg-eef2f7: #172331;
  --bg-eef3f8: #152433;
  --bg-eef3fb: #131f33;
  --bg-eef4fb: #132233;
  --bg-eef6e6: #273916;
  --bg-eef6ee: #193019;
  --bg-eef6ef: #19301c;
  --bg-eef8fc: #132932;
  --bg-efe6fa: #241537;
  --bg-efe7fd: #201435;
  --bg-efeee9: #24282c;
  --bg-efeefb: #161333;
  --bg-f09595: #622525;
  --bg-f0efea: #24272c;
  --bg-f0f0f0: #22252a;
  --bg-f0f5fb: #132132;
  --bg-f1efe8: #24272c;
  --bg-f1f0eb: #23262b;
  --bg-f1f0ec: #23262b;
  --bg-f1f1f1: #212529;
  --bg-f3e3e3: #391919;
  --bg-f3f2ee: #222529;
  --bg-f3f5f7: #1f2226;
  --bg-f3f6fa: #14202f;
  --bg-f3f9fd: #12242f;
  --bg-f4f3ee: #212529;
  --bg-f4f3ef: #212429;
  --bg-f4f6f9-a96: rgba(24,32,43,.96);
  --bg-f4f7fb: #121f30;
  --bg-f4f8fc: #12212f;
  --bg-f4f9fe: #12202e;
  --bg-f4fbfa: #12302c;
  --bg-f4fbfe: #12262e;
  --bg-f5f6f4: #1f2226;
  --bg-f5f8fa: #16232c;
  --bg-f5f8fb: #13212f;
  --bg-f5f9fb: #13252f;
  --bg-f5f9fd: #12202e;
  --bg-f5fafc: #12262f;
  --bg-f6f4ef: #2e291a;
  --bg-f6f5f0: #2d2a1b;
  --bg-f6f5f1: #202327;
  --bg-f6f6f4: #1f2226;
  --bg-f6f8fb: #141e2d;
  --bg-f6f9fd: #111e2e;
  --bg-f6faff: #111d2d;
  --bg-f7c1c1: #4a1c1c;
  --bg-f7f6f2: #1f2226;
  --bg-f7f9fb: #15202b;
  --bg-f7faff: #111b2c;
  --bg-f85149: #823531;
  --bg-f8d1cd: #441e1a;
  --bg-f8e4e1: #3a1b16;
  --bg-f8fafb: #172328;
  --bg-f8fbfe: #111f2c;
  --bg-f9fbfd: #111f2c;
  --bg-fac775: #6c5229;
  --bg-faeeda: #3c2e17;
  --bg-faf9f5: #2c2816;
  --bg-faf9f6: #2a2517;
  --bg-fafaf7: #1d2024;
  --bg-fafaf8: #1d1f23;
  --bg-fbe1df: #3a1816;
  --bg-fbe9e9: #351414;
  --bg-fbeedf: #3a2916;
  --bg-fbeee4: #372415;
  --bg-fbf1e6: #362615;
  --bg-fbf3f6: #30121e;
  --bg-fbf7ee: #332913;
  --bg-fbfaf7: #2b2515;
  --bg-fbfcfd: #141e28;
  --bg-fcebeb: #341414;
  --bg-fcfcfb: #1b1e21;
  --bg-fde2c4: #45311a;
  --bg-fde2e2: #371515;
  --bg-fde68a: #615525;
  --bg-fde7e5: #361714;
  --bg-fde8dc: #3a2316;
  --bg-fde8e7: #351614;
  --bg-fdecc8: #44361a;
  --bg-fdecea: #341714;
  --bg-fdecec: #331313;
  --bg-fdf0e6: #352314;
  --bg-fdf1d6: #3d3117;
  --bg-fdf3e3: #372a15;
  --bg-fdf6e9: #342914;
  --bg-fee2e2: #371515;
  --bg-ffd56b: #6e5b2a;
  --bg-ffedd5: #3c2c17;
  --bg-fff2c9: #423819;
  --bg-fff3c4: #443c1a;
  --bg-fff3d6: #3c3117;
  --bg-fff4de: #382d15;
  --bg-fff4e0: #372b15;
  --bg-fff4e5: #352714;
  --bg-fff6f6: #2d1111;
  --bg-fff7df: #382f15;
  --bg-fff7e6: #342a14;
  --bg-fff7f6: #2d1411;
  --bg-fff8e1: #372f15;
  --bg-fff8e6: #342b14;
  --bg-fff8e8: #342a14;
  --bg-fff8ec: #322613;
  --bg-fffaf0: #302612;
  --bg-fffdf6: #2d2711;
  --bg-ffffff: #191c1f;
  --fg-000000: #e9eaec;
  --fg-0066cc: #71b2f4;
  --fg-007bff: #58a2f1;
  --fg-04342c: #c1f5ed;
  --fg-075985: #97d2f1;
  --fg-0c447c: #9dc5ee;
  --fg-0d0f12: #e0e2e5;
  --fg-0f6c7a: #9ee1eb;
  --fg-0f6e56: #a5ecda;
  --fg-0f766e: #a1ece6;
  --fg-111111: #dfe1e4;
  --fg-112233: #c7d8e9;
  --fg-123d5a: #b1d2e9;
  --fg-12683f: #a9e9cb;
  --fg-14532d: #b5e8c9;
  --fg-15803d: #9ce7b8;
  --fg-163d55: #b4d3e6;
  --fg-173404: #d6f5c1;
  --fg-17415f: #afcfe6;
  --fg-176d9b: #8ec7e5;
  --fg-182d3b: #c4d7e3;
  --fg-183247: #bdd3e4;
  --fg-185fa5: #89b7e5;
  --fg-1a7f37: #9de4b2;
  --fg-1b1030: #d4c9e9;
  --fg-1d5e2c: #b0e1bc;
  --fg-1d5e33: #b0e1c1;
  --fg-1e2f3d: #c4d3df;
  --fg-1e6b35: #a9e1ba;
  --fg-1f1e1b: #d8dade;
  --fg-1f1f1d: #d7dadd;
  --fg-1f2523: #d5d7db;
  --fg-1f2937: #c9d1dd;
  --fg-1f3b57: #b5cadf;
  --fg-222222: #d5d7db;
  --fg-23466e: #a8c1dd;
  --fg-26215c: #b6b2de;
  --fg-263746: #c0ceda;
  --fg-27500a: #cdf0b4;
  --fg-295c79: #a3c6d9;
  --fg-2c2c2a: #cfd2d7;
  --fg-2e7d32: #a1d6a4;
  --fg-31556d: #abc3d4;
  --fg-31566d: #abc4d4;
  --fg-333333: #caced3;
  --fg-374151: #c0c4ca;
  --fg-3b6d11: #c5eaa6;
  --fg-3c3489: #a09bd2;
  --fg-3d3b36: #c7cacf;
  --fg-3d3c39: #c6c9cf;
  --fg-3d3d3a: #c5c9ce;
  --fg-412402: #f7dbb9;
  --fg-425763: #b8bcc3;
  --fg-444441: #c1c5cb;
  --fg-444444: #c0c4ca;
  --fg-475569: #b4b9c0;
  --fg-4a2a7a: #b8a2d9;
  --fg-4c1d95: #b192e1;
  --fg-4f6c80: #abb1b8;
  --fg-501313: #e8b6b6;
  --fg-52616f: #afb4bc;
  --fg-526773: #aeb3bb;
  --fg-536873: #aeb3bb;
  --fg-536975: #adb3ba;
  --fg-555555: #b6bbc2;
  --fg-5b6d79: #aaafb7;
  --fg-5c1a1a: #e3b1b1;
  --fg-5c3a07: #f2d6ad;
  --fg-5c6872: #abb1b8;
  --fg-5d6662: #afb4bb;
  --fg-5d6f7b: #a8aeb6;
  --fg-5e6e78: #a9afb6;
  --fg-5f3a07: #f2d4ab;
  --fg-5f5e5a: #b2b7be;
  --fg-5f6b7a: #a8aeb6;
  --fg-60727f: #a6acb4;
  --fg-61727d: #a7acb4;
  --fg-617480: #a6acb4;
  --fg-633806: #f3d1a9;
  --fg-637580: #a5abb3;
  --fg-647680: #a5abb3;
  --fg-657781: #a4aab2;
  --fg-666666: #acb1b9;
  --fg-666677: #a7adb5;
  --fg-6b7280: #a3a9b1;
  --fg-6e7e88: #9fa6ae;
  --fg-6f6890: #9fa5ae;
  --fg-704914: #e8cba5;
  --fg-713f12: #e9c5a4;
  --fg-791f1f: #e0a1a1;
  --fg-7a0d0d: #ed9e9e;
  --fg-7a1f1f: #e0a1a1;
  --fg-7a3e00: #f7ca9b;
  --fg-7a4100: #f7cc9b;
  --fg-7a4b00: #f7d49b;
  --fg-805d15: #e7cf9c;
  --fg-854f0b: #eec898;
  --fg-8a1c12: #e99d96;
  --fg-8a1f11: #eaa096;
  --fg-8a3d12: #e9b496;
  --fg-8a4b0f: #ebbf96;
  --fg-8a5a00: #f6d493;
  --fg-8e2828: #da9797;
  --fg-991b1b: #e39090;
  --fg-9a3412: #e9a58e;
  --fg-a32d2d: #d78c8c;
  --fg-a3620d: #ecc188;
  --fg-b3261e: #e08782;
  --fg-b42318: #e48881;
  --fg-b4501a: #e3a381;
  --fg-b45309: #eeaf7f;
  --fg-b84f12: #e8a57e;
  --fg-b91c1c: #e27f7f;
  --fg-ba7517: #e5b97e;
  --fg-c0392b: #d8857c;
  --fg-c62828: #da7979;
  --fg-c96a00: #f4b773;
}
/* ===== hand-tuned part (Claude 2026-10-21) ===== */
html[data-theme="dark"] {
  color-scheme: dark;
  --panel-rgb: 26, 30, 36;
  /* portal-shell.css variables */
  --bg: #0f1216; --card: #1a1e24; --line: #343b45; --ink: #e7e9ec; --muted: #a9b0b9;
  --ok: #46c38f; --warn: #e3a64f; --blue: #1a6fb0;
  --panel: #1a1e24; --fg: #e7e9ec;
  --paper: #1a1e24; --sky: #16303f; --pale: #1b2a30; --panel2: #21262d;
  /* calibrated tokens: the main surfaces and text greys of the Office pages */
  --bg-ffffff: #1a1e24; --bg-fff: #1a1e24; --bg-f7f6f2: #21262d; --bg-fbfaf7: #1e2229; --bg-fafaf8: #1e2229;
  --bg-f1efe8: #262b33; --bg-ebe9e2: #2a3039; --bg-eef0f3: #0f1216; --bg-eef3f7: #0f1216;
  --fg-2c2c2a: #e7e9ec; --fg-1f1f1d: #eceef0; --fg-444441: #cdd2d8; --fg-5f5e5a: #aab1ba; --fg-888780: #a3abb5;
  --bd-e1e0d9: #343b45; --bd-d3d1c7: #3d4551; --bd-c9c7be: #454d59; --bd-e3e1d8: #373e49;
}
html[data-theme="dark"] body { background: #0f1216; color: #e7e9ec; }
html[data-theme="dark"] a:not([class]) { color: #7db8ee; }
html[data-theme="dark"] .eyebrow, html[data-theme="dark"] .link-button { color: #7db8ee; }
html[data-theme="dark"] .topbar a, html[data-theme="dark"] .topbar button, html[data-theme="dark"] .btn.primary { color: #fff; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background-color: #12161b; color: #e7e9ec; border-color: #454d59; }
html[data-theme="dark"] ::placeholder { color: #8b939d; opacity: 1; }
html[data-theme="dark"] option { background: #1a1e24; color: #e7e9ec; }
html[data-theme="dark"] img { filter: brightness(.92); }
html[data-theme="dark"] .cc-backdrop { filter: brightness(.55); }

/* portal-shell.css classes (its colours are hard-coded; that file is shared with the customer and technician pages so it stays untouched) */
html[data-theme="dark"] .btn { background: #232931; border-color: #454d59; color: #dfe4ea; }
html[data-theme="dark"] .btn.primary { background: #1a6aa5; border-color: #1a6aa5; color: #fff; }
html[data-theme="dark"] .btn.ghost { color: #fff; }
html[data-theme="dark"] .status { background: #3a3114; border-color: #6b5a1c; color: #f0d98a; }
html[data-theme="dark"] .status.live { background: #14352a; border-color: #2c6b52; color: #8fdcb9; }
html[data-theme="dark"] .status.bad { background: #3b1a1a; border-color: #7a3333; color: #f3a5a0; }
html[data-theme="dark"] .toolbar { background: #1a1e24; border-color: #343b45; }
html[data-theme="dark"] .toolbar input, html[data-theme="dark"] .toolbar select, html[data-theme="dark"] .map-grid select, html[data-theme="dark"] .map-grid input { background: #12161b; border-color: #454d59; color: #e7e9ec; }
html[data-theme="dark"] .panel h2, html[data-theme="dark"] .panel h3 { background: #20252c; border-color: #343b45; color: #e7e9ec; }
html[data-theme="dark"] .tabs { background: #14181d; border-color: #343b45; }
html[data-theme="dark"] .tab { color: #cdd2d8; border-color: #343b45; }
html[data-theme="dark"] .tab.active { background: #1a1e24; color: #7db8ee; }
html[data-theme="dark"] .grid { background: #1a1e24; }
html[data-theme="dark"] .grid th { background: #262d36; color: #d5dae0; border-color: #3d4551; }
html[data-theme="dark"] .grid td { border-color: #313843; }
html[data-theme="dark"] .grid tbody tr:hover { background: #232a33; }
html[data-theme="dark"] .grid .link { color: #7db8ee; }
html[data-theme="dark"] .field span { border-bottom-color: #454d59; }
html[data-theme="dark"] .hot { background: #3a2a14; }
html[data-theme="dark"] .pill { background: #28313b; color: #c5d3df; }
html[data-theme="dark"] .pill.ok { background: #16372b; color: #8fdcb9; }
html[data-theme="dark"] .pill.warn { background: #3b2d14; color: #efc57c; }
html[data-theme="dark"] .time, html[data-theme="dark"] .lane-head { background: #20262e; color: #b4bcc6; border-color: #343b45; }
html[data-theme="dark"] .slot { background: #1a1e24; border-color: #343b45; }
html[data-theme="dark"] .job { background: #16303f; }
html[data-theme="dark"] .job.urgent { background: #3b1c1c; }
html[data-theme="dark"] .job.wait { background: #3a2a14; }
html[data-theme="dark"] .kpi, html[data-theme="dark"] .panel { box-shadow: none; }

/* theme switch button in the top bar */
.cc-theme-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; border-radius: 8px; padding: 4px 9px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; flex: 0 0 auto; margin-right: 6px; }
.cc-theme-btn:hover, .cc-theme-btn:focus-visible { background: rgba(255,255,255,.2); outline: none; }
@media (max-width: 600px) { .cc-theme-btn { padding: 3px 7px; } .cc-theme-btn .lbl { display: none; } }
@media print { html[data-theme="dark"] { color-scheme: light; } }


html[data-theme="dark"] .leaflet-container a { color: #0078a8; }
html[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.78); }   /* map tiles stay light but glare less */

/* technician app (owner-approved dark mode 2026-10-21): accent text on dark panels, the white Clock-in button on the blue banner */
html[data-theme="dark"] .mobile-nav button.active, html[data-theme="dark"] .mobile-nav a.active, html[data-theme="dark"] .upload-button,
html[data-theme="dark"] .diagnostic-actions button { color: #7db8ee; }
html[data-theme="dark"] .danger-text { color: #f3a5a0; }
html[data-theme="dark"] .diagnostic-form legend { color: #cfe3f1; }
html[data-theme="dark"] .clock-button:not(.pause) { background: #ffffff; color: #123d5a; }
/* ===== generated contrast fixes (autofix.py from audit.py): mid-tone backgrounds keep their colour, so their text must stay dark/light enough ===== */
html[data-theme="dark"] .db-task.appointment { color: #101418; }
html[data-theme="dark"] .db-task.install { color: #101418; }

/* ===== gui12 (2026-10-21): dark-mode contrast / missing tokens found by the full GUI pass ===== */
html[data-theme="dark"] {
  --fg-534ab7: #a9a2f2; --fg-6a4fb3: #b8a0f5;                                                  /* AI dot, PM "lapsed" chip: purple text on a dark chip */
  --sm-card: #1a1e24; --sm-ink: #e7e9ec; --sm-sub: #aab1ba; --sm-line: #343b45;   /* System map cards were white */
  --sales: #6db3ee; --pm: #f0a050; --acct: #5ccf95; --svc: #b8a0f5;      /* owner colours of Ping to Paid / Deals: light enough on the dark chips */
}
html[data-theme="dark"] .lte-table { background: #1a1e24; border-color: #343b45; color: #e7e9ec; }
html[data-theme="dark"] .lte-table small { color: #aab1ba; }
html[data-theme="dark"] .lte-table div { background: transparent; color: #b4bcc6; }
html[data-theme="dark"] .sc-publish { background: #2a2412; border-color: #343b45; color: #e7e9ec; }
html[data-theme="dark"] .sc-publish.on { background: #14352a; }
