/* =========================================================
   Dark theme — generated companion to style.css
   Light mode uses the var() fallbacks in the source, so it is
   byte-for-byte unchanged. This file only supplies the dark
   counterpart for each colour the app actually uses.
   ========================================================= */

html[data-theme="dark"] {
  color-scheme: dark;

  /* ---- hand-tuned core palette (overrides the derived values below) ---- */
  --c-bg: #0f131a;
  --c-surface: #171d26;
  --c-border: #2a3341;
  --c-border-strong: #3a4557;
  --c-text: #e6eaf2;
  --c-text-muted: #9aa4b6;
  --c-text-soft: #7a8497;
  --c-primary: #2a66cf;
  --c-primary-d: #3f80e8;
  --c-primary-l: #16243a;
  --c-on-primary: #ffffff;
  --c-accent: #e8944a;
  --c-gray: #9aa4b6;
  --c-gray-bg: #212936;
  --c-success: #4ade80;
  --c-success-bg: #12291d;
  --c-danger: #f87171;
  --c-danger-bg: #2f1b1e;
  --c-warn: #fbbf24;
  --c-warn-bg: #2e2616;
  --c-info: #60a5fa;
  --c-info-bg: #16243a;
  --c-violet: #a78bfa;
  --c-teal: #2dd4bf;
  --c-amber: #fbbf24;
  --c-pink: #f472b6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow:    0 8px 26px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.6);

  /* ---- surface role: backgrounds, borders, shadows (298 colours) ---- */
  --x-059669: #058f64;
  --x-065f46: #076a4e;
  --x-0a5a2b: #0b6530;
  --x-0d9488: #0c8d81;
  --x-0e7490: #0d6e89;
  --x-0ea5a5: #0d9d9d;
  --x-0ea5e9: #1d5e7c;
  --x-101828: #203050;
  --x-10b981: #0fb07b;
  --x-111111: #dee0e3;
  --x-111827: #22304e;
  --x-1250b8: #114caf;
  --x-12805c: #117a57;
  --x-137333: #126d30;
  --x-14276a: #132565;
  --x-155799: #145391;
  --x-155f2c: #145c2b;
  --x-15803d: #147a3a;
  --x-166534: #156031;
  --x-18632e: #175e2c;
  --x-1863dc: #1d417c;
  --x-1a1a1a: #dee0e3;
  --x-1a1f2e: #293048;
  --x-1a2233: #26324a;
  --x-1a2433: #26344a;
  --x-1a3477: #193171;
  --x-1a44a0: #194198;
  --x-1b449b: #1a4193;
  --x-1c6b3a: #1b6637;
  --x-1c8a4a: #1b8346;
  --x-1d3854: #1d3853;
  --x-1d4ed8: #1d367c;
  --x-1e3a8a: #1d3783;
  --x-1e40af: #1d3da6;
  --x-1e7a3a: #1d7437;
  --x-1f3b8b: #1d3884;
  --x-1f7a3a: #1d7437;
  --x-2151b7: #1f4dae;
  --x-222222: #dee0e3;
  --x-22c55e: #1d7c40;
  --x-2563eb: #1d3b7c;
  --x-2a9b5e: #289359;
  --x-2d3a52: #2b374e;
  --x-2dd4bf: #1d7c70;
  --x-333333: #dee0e3;
  --x-333344: #303041;
  --x-34d399: #1d7c59;
  --x-35c3a7: #217867;
  --x-374151: #343e4d;
  --x-3b82f6: #1d417c;
  --x-42506b: #3f4c66;
  --x-444444: #dee0e3;
  --x-4a3500: #705000;
  --x-4a5568: #465163;
  --x-4b5563: #47515e;
  --x-4bbfc4: #267073;
  --x-4ca9f0: #1d537c;
  --x-4d5566: #495161;
  --x-4f46e5: #221d7c;
  --x-4f73d3: #1f387a;
  --x-4f8bff: #1d3d7c;
  --x-54607a: #505b74;
  --x-555555: #b3b7bd;
  --x-5a6b82: #56667c;
  --x-5b2a98: #562890;
  --x-5b6478: #565f72;
  --x-5b6677: #566171;
  --x-5b6b7f: #566679;
  --x-5c2b2b: #572929;
  --x-60a5fa: #1d487c;
  --x-65a30d: #609b0c;
  --x-666666: #b3b7bd;
  --x-667085: #424957;
  --x-6b4f00: #705300;
  --x-6b7280: #959ba7;
  --x-6b7488: #939aaa;
  --x-6b7691: #414858;
  --x-6d28d9: #421d7c;
  --x-6d5ae6: #2a1d7c;
  --x-6d5efc: #261d7c;
  --x-777777: #979da5;
  --x-78350f: #72320e;
  --x-7c2d12: #762b11;
  --x-7c3aed: #401d7c;
  --x-7f1d1d: #791c1c;
  --x-842029: #7d1e27;
  --x-888888: #979da5;
  --x-8a1f1f: #831d1d;
  --x-8a5500: #835100;
  --x-8a5a00: #835600;
  --x-8a5d00: #835800;
  --x-8a6500: #836000;
  --x-8a93a6: #424957;
  --x-8a97a8: #414b58;
  --x-8a97ab: #404a59;
  --x-8b5cf6: #3a1d7c;
  --x-8b7bf0: #2a1d7c;
  --x-8b95a8: #424957;
  --x-8e44ad: #5a2b6e;
  --x-92400e: #8b3d0d;
  --x-94a3b8: #3d4a5c;
  --x-971823: #8f1721;
  --x-98a4b6: #3f4a5a;
  --x-991b1b: #911a1a;
  --x-999999: #979da5;
  --x-9a3412: #923111;
  --x-9aa3b2: #424a57;
  --x-9aa6b8: #3f4a5a;
  --x-9ca3af: #38404d;
  --x-9db4d8: #2c456d;
  --x-a4500f: #9c4c0e;
  --x-a7f3d0: #254d3b;
  --x-a8001f: #a0001d;
  --x-aaaaaa: #38414d;
  --x-aebfd8: #25364d;
  --x-b0b5be: #383f4d;
  --x-b3261e: #aa241d;
  --x-b3ffb3: #254d25;
  --x-b42318: #ab2117;
  --x-b45309: #ab4f09;
  --x-b61f2a: #ad1d28;
  --x-b6bdcc: #2f3644;
  --x-b6c0cf: #2e3745;
  --x-b7791f: #ae731d;
  --x-b7e0c2: #254d30;
  --x-b8860b: #af7f0a;
  --x-b91c1c: #b01b1b;
  --x-bcd0f7: #25334d;
  --x-be185d: #b51758;
  --x-bfdbfe: #25374d;
  --x-bfe3c6: #254d2d;
  --x-bfe6cd: #254d34;
  --x-c0356b: #782143;
  --x-c0392b: #7c261d;
  --x-c46a18: #ba6517;
  --x-c4790c: #ba730b;
  --x-c7ced9: #2e3744;
  --x-c8d0e8: #252f4d;
  --x-c9c1f5: #2b254d;
  --x-cbd5e0: #2b3948;
  --x-cbd5e1: #2a3849;
  --x-cccccc: #252b34;
  --x-ccccdd: #2e2e45;
  --x-cdd6e4: #28364b;
  --x-cfd6e0: #2d3746;
  --x-cfd8e6: #27354b;
  --x-cfe0ff: #212b3d;
  --x-d0d4dc: #313742;
  --x-d1d5db: #323840;
  --x-d4dae5: #2b3548;
  --x-d6c068: #786721;
  --x-d7deea: #212b3d;
  --x-d8d8d8: #252b34;
  --x-d8dee8: #2b3648;
  --x-d97706: #ce7106;
  --x-d9dde6: #2e3545;
  --x-d9ecfb: #21313d;
  --x-dbe6f7: #212c3d;
  --x-dbe6fb: #212b3d;
  --x-dc2626: #7c1d1d;
  --x-dcf2e3: #213d2a;
  --x-dcfce7: #213d2b;
  --x-dd4444: #7c1d1d;
  --x-dddddd: #252b34;
  --x-dfe3ea: #252d39;
  --x-dff5e3: #213d26;
  --x-e0645a: #7c241d;
  --x-e0e0e0: #252b34;
  --x-e2e6ee: #232b3b;
  --x-e2e8f0: #212d3d;
  --x-e3b7b7: #4d2525;
  --x-e3e3e3: #252b34;
  --x-e3e8ef: #222d3c;
  --x-e3e8f0: #212c3d;
  --x-e3eaf7: #212b3d;
  --x-e3f6ec: #213d2e;
  --x-e5e7eb: #292d35;
  --x-e5e9f0: #232c3c;
  --x-e6447d: #7c1d3e;
  --x-e67e22: #7c4a1d;
  --x-e6e8ef: #25293a;
  --x-e6e9f2: #21283d;
  --x-e6f6ec: #213d2c;
  --x-e6f6ef: #213d31;
  --x-e6f6f6: #213d3d;
  --x-e7ecfb: #21283d;
  --x-e7f6ec: #213d2a;
  --x-e8873b: #7c471d;
  --x-e8c46a: #7c611d;
  --x-e8e8e8: #252b34;
  --x-e8ecf3: #212b3d;
  --x-e8f0fe: #212b3d;
  --x-e8f4fd: #21313d;
  --x-e9eefb: #21293d;
  --x-e9f7ec: #213d27;
  --x-eaeef5: #212b3d;
  --x-ecfdf5: #213d30;
  --x-eeeeee: #191d22;
  --x-eef0f5: #232a3b;
  --x-eef0ff: #21243d;
  --x-eef1f5: #232d3b;
  --x-eef1f6: #212c3d;
  --x-eef2f8: #212c3d;
  --x-eef2ff: #21283d;
  --x-eef3fb: #212c3d;
  --x-eef3ff: #21293d;
  --x-eef4ff: #212b3d;
  --x-eef8f1: #213d2a;
  --x-ef4444: #7c1d1d;
  --x-eff6ff: #212d3d;
  --x-f0b7b7: #4d2525;
  --x-f0c36d: #7c5b1d;
  --x-f0e3b0: #4d4525;
  --x-f0f0f0: #191d22;
  --x-f0f3f9: #212a3d;
  --x-f0f9f0: #213d21;
  --x-f0faf2: #213d27;
  --x-f1edfa: #2a213d;
  --x-f1f4f9: #212c3d;
  --x-f1f5f9: #212f3d;
  --x-f2f0fd: #25213d;
  --x-f2f7ff: #212c3d;
  --x-f3f4f6: #282d36;
  --x-f3f5f8: #232d3c;
  --x-f3f5f9: #212a3d;
  --x-f3f6ff: #21283d;
  --x-f4f6f9: #212c3d;
  --x-f4f6fb: #21293d;
  --x-f4f7fb: #212d3d;
  --x-f4fbf6: #213d29;
  --x-f59e0b: #7c591d;
  --x-f5c2c7: #4d2529;
  --x-f5c451: #7c601d;
  --x-f5d9a8: #4d3f25;
  --x-f5f6f8: #272c38;
  --x-f5f6fa: #21273d;
  --x-f5f7fb: #212a3d;
  --x-f5f7ff: #21273d;
  --x-f6a609: #7c5c1d;
  --x-f6c04a: #7c5e1d;
  --x-f6f8fb: #212c3d;
  --x-f6f8fc: #212a3d;
  --x-f7f9fc: #212c3d;
  --x-f87171: #7c1d1d;
  --x-f8fafc: #212f3d;
  --x-f97316: #7c441d;
  --x-f9f9f9: #191d22;
  --x-f9fafb: #262f39;
  --x-f9faff: #21263d;
  --x-fafafa: #191d22;
  --x-fafbfc: #232f3b;
  --x-fafbfd: #212a3d;
  --x-fafbfe: #21283d;
  --x-fafbff: #21273d;
  --x-fbbf24: #7c611d;
  --x-fbe2e6: #3d2126;
  --x-fbeed5: #3d3421;
  --x-fbfbfd: #21213d;
  --x-fcd34d: #7c661d;
  --x-fce4e4: #3d2121;
  --x-fce7f3: #3d2131;
  --x-fde2e4: #3d2123;
  --x-fde3ee: #3d212d;
  --x-fde68a: #4d4525;
  --x-fde7e1: #3d2721;
  --x-fdeaea: #3d2121;
  --x-fdecc8: #3d3421;
  --x-fdecec: #3d2121;
  --x-fdf0f1: #3d2123;
  --x-fdf1e0: #3d3221;
  --x-fdf3e0: #3d3421;
  --x-fdf3f3: #3d2121;
  --x-fecaca: #3d2121;
  --x-fed7aa: #4d3b25;
  --x-fee2e2: #3d2121;
  --x-fef2f2: #3d2121;
  --x-fef3c7: #3d3821;
  --x-fef5d4: #3d3721;
  --x-ffb3b3: #4d2525;
  --x-ffd0d0: #3d2121;
  --x-ffeeee: #3d2121;
  --x-fff0f0: #3d2121;
  --x-fff4d6: #3d3621;
  --x-fff4e5: #3d3121;
  --x-fff5f4: #3d2421;
  --x-fff5f5: #3d2121;
  --x-fff7e6: #3d3421;
  --x-fff7ed: #3d3121;
  --x-fff8e1: #3d3721;
  --x-fff8e6: #3d3521;
  --x-fff8ec: #3d3321;
  --x-fff8f8: #3d2121;
  --x-fff9ec: #3d3421;
  --x-fffaef: #3d3421;
  --x-fffbe6: #3d3921;
  --x-fffceb: #3d3921;
  --x-fffcf3: #3d3621;
  --x-ffffff: #191d22;

  /* ---- text role: `color:` only. Light text stays light so white
         labels on coloured buttons are not darkened with the cards. ---- */
  --xt-059669: #72f3cb;
  --xt-065f46: #76efcd;
  --xt-0a5a2b: #7beaa9;
  --xt-0d9488: #79ece2;
  --xt-0e7490: #7ad3eb;
  --xt-0ea5a5: #78eded;
  --xt-0ea5e9: #65c3ee;
  --xt-101828: #95a9d0;
  --xt-10b981: #79ecc6;
  --xt-111111: #dfe0e1;
  --xt-111827: #97a9ce;
  --xt-1250b8: #7aa4eb;
  --xt-12805c: #7fe6c4;
  --xt-137333: #81e4a2;
  --xt-14276a: #8498e1;
  --xt-155799: #7eb3e7;
  --xt-155f2c: #87dea2;
  --xt-15803d: #81e4a6;
  --xt-166534: #86dfa8;
  --xt-18632e: #89dca1;
  --xt-1863dc: #6999e7;
  --xt-1a1a1a: #dfe0e1;
  --xt-1a1f2e: #98a5cd;
  --xt-1a2233: #98a9cd;
  --xt-1a2433: #98adcd;
  --xt-1a3477: #869fdf;
  --xt-1a44a0: #81a0e4;
  --xt-1b449b: #82a1e3;
  --xt-1c6b3a: #8adba9;
  --xt-1c8a4a: #85e0ab;
  --xt-1d3854: #91b2d4;
  --xt-1d4ed8: #6d8ce4;
  --xt-1e3a8a: #869ddf;
  --xt-1e40af: #8299e3;
  --xt-1e7a3a: #89dca2;
  --xt-1f3b8b: #879dde;
  --xt-1f7a3a: #8adba2;
  --xt-2151b7: #83a1e2;
  --xt-222222: #dfe0e1;
  --xt-22c55e: #66dd92;
  --xt-2563eb: #7fa1ed;
  --xt-2a9b5e: #8bdaaf;
  --xt-2d3a52: #98abcd;
  --xt-2dd4bf: #7fded2;
  --xt-333333: #dfe0e1;
  --xt-333344: #9898cd;
  --xt-34d399: #84debe;
  --xt-35c3a7: #7ed6c4;
  --xt-374151: #98accd;
  --xt-3b82f6: #98bbf5;
  --xt-42506b: #98aacd;
  --xt-444444: #dfe0e1;
  --xt-4a3500: #f7d06e;
  --xt-4a5568: #98abcd;
  --xt-4b5563: #98aecd;
  --xt-4bbfc4: #94d4d7;
  --xt-4ca9f0: #9ccdf2;
  --xt-4d5566: #98a9cd;
  --xt-4f46e5: #a09bec;
  --xt-4f73d3: #9cafe2;
  --xt-4f8bff: #94b7f9;
  --xt-54607a: #98a9cd;
  --xt-555555: #dfe0e1;
  --xt-5a6b82: #98aecd;
  --xt-5b2a98: #ae8bda;
  --xt-5b6478: #98a8cd;
  --xt-5b6677: #98adcd;
  --xt-5b6b7f: #98b0cd;
  --xt-5c2b2b: #cd9898;
  --xt-60a5fa: #97c2f6;
  --xt-65a30d: #bded78;
  --xt-666666: #dfe0e1;
  --xt-667085: #8398c3;
  --xt-6b4f00: #f7d36e;
  --xt-6b7280: #c7cad1;
  --xt-6b7488: #c7cad1;
  --xt-6b7691: #8fa0c9;
  --xt-6d28d9: #a37ce1;
  --xt-6d5ae6: #aca2ec;
  --xt-6d5efc: #9f96f8;
  --xt-777777: #caccce;
  --xt-78350f: #e8a47d;
  --xt-7c2d12: #e6997f;
  --xt-7c3aed: #b593f0;
  --xt-7f1d1d: #de8787;
  --xt-842029: #dc8990;
  --xt-888888: #caccce;
  --xt-8a1f1f: #de8787;
  --xt-8a5500: #f7c26e;
  --xt-8a5a00: #f7c76e;
  --xt-8a5d00: #f7ca6e;
  --xt-8a6500: #f7d26e;
  --xt-8a93a6: #b2bfda;
  --xt-8a97a8: #b3c4db;
  --xt-8a97ab: #b3c3db;
  --xt-8b5cf6: #b59af4;
  --xt-8b7bf0: #aa9fef;
  --xt-8b95a8: #b3c1db;
  --xt-8e44ad: #b584c9;
  --xt-92400e: #eba57a;
  --xt-94a3b8: #b3c4db;
  --xt-971823: #e48189;
  --xt-98a4b6: #b3c3db;
  --xt-991b1b: #e38282;
  --xt-999999: #caccce;
  --xt-9a3412: #e9977c;
  --xt-9aa3b2: #b3c2db;
  --xt-9aa6b8: #b3c3db;
  --xt-9ca3af: #c7cbd1;
  --xt-9db4d8: #b1c2dd;
  --xt-a4500f: #ecab79;
  --xt-a7f3d0: #c3f4dd;
  --xt-a8001f: #f76e87;
  --xt-aaaaaa: #caccce;
  --xt-aebfd8: #cfd9e8;
  --xt-b0b5be: #c7cbd1;
  --xt-b3261e: #e48781;
  --xt-b3ffb3: #bbfbbb;
  --xt-b42318: #e7857e;
  --xt-b45309: #f1aa74;
  --xt-b61f2a: #e38289;
  --xt-b6bdcc: #cfd7e8;
  --xt-b6c0cf: #cfd9e8;
  --xt-b7791f: #e3bc82;
  --xt-b7e0c2: #cfe8d5;
  --xt-b8860b: #f0cc75;
  --xt-b91c1c: #e58080;
  --xt-bcd0f7: #c2d3f5;
  --xt-be185d: #e87da9;
  --xt-bfdbfe: #bcd8fa;
  --xt-bfe3c6: #cfe8d4;
  --xt-bfe6cd: #cde9d7;
  --xt-c0356b: #d57c9f;
  --xt-c0392b: #d8796f;
  --xt-c46a18: #e8b07d;
  --xt-c4790c: #efbe76;
  --xt-c7ced9: #cfd9e8;
  --xt-c8d0e8: #ced5e8;
  --xt-c9c1f5: #cbc4f3;
  --xt-cbd5e0: #cfdbe8;
  --xt-cbd5e1: #cfdae8;
  --xt-cccccc: #eff0f0;
  --xt-ccccdd: #cfcfe8;
  --xt-cdd6e4: #cfd9e8;
  --xt-cfd6e0: #cfd9e8;
  --xt-cfd8e6: #cfd9e8;
  --xt-cfe0ff: #bbd2fb;
  --xt-d0d4dc: #cfd7e8;
  --xt-d1d5db: #cfd9e8;
  --xt-d4dae5: #cfd8e8;
  --xt-d6c068: #e4d8aa;
  --xt-d7deea: #cfd8e8;
  --xt-d8d8d8: #eff0f0;
  --xt-d8dee8: #cfd8e8;
  --xt-d97706: #f4b771;
  --xt-d9dde6: #cfd6e8;
  --xt-d9ecfb: #c1def5;
  --xt-dbe6f7: #c7d7f0;
  --xt-dbe6fb: #c2d3f5;
  --xt-dc2626: #e37b7b;
  --xt-dcf2e3: #cdead6;
  --xt-dcfce7: #c0f6d3;
  --xt-dd4444: #e79696;
  --xt-dddddd: #eff0f0;
  --xt-dfe3ea: #cfd8e8;
  --xt-dff5e3: #caecd1;
  --xt-e0645a: #e9aaa4;
  --xt-e0e0e0: #eff0f0;
  --xt-e2e6ee: #cfd7e8;
  --xt-e2e8f0: #cfdae8;
  --xt-e3b7b7: #e9cdcd;
  --xt-e3e3e3: #eff0f0;
  --xt-e3e8ef: #cfd9e8;
  --xt-e3e8f0: #cfd8e8;
  --xt-e3eaf7: #c9d6ed;
  --xt-e3f6ec: #cbecda;
  --xt-e5e7eb: #cfd7e8;
  --xt-e5e9f0: #cfd8e8;
  --xt-e6447d: #ec9ab7;
  --xt-e67e22: #e9af7b;
  --xt-e6e8ef: #cfd4e8;
  --xt-e6e9f2: #cfd5e8;
  --xt-e6f6ec: #ccead8;
  --xt-e6f6ef: #cceadd;
  --xt-e6f6f6: #cceaea;
  --xt-e7ecfb: #c4d0f2;
  --xt-e7f6ec: #cdead6;
  --xt-e8873b: #edba92;
  --xt-e8c46a: #ecd7a2;
  --xt-e8e8e8: #eff0f0;
  --xt-e8ecf3: #cfd8e8;
  --xt-e8f0fe: #bed3f9;
  --xt-e8f4fd: #c0dff6;
  --xt-e9eefb: #c5d1f2;
  --xt-e9f7ec: #ccead3;
  --xt-eaeef5: #cfd8e8;
  --xt-ecfdf5: #c1f5dd;
  --xt-eeeeee: #eff0f0;
  --xt-eef0f5: #cfd6e8;
  --xt-eef0ff: #bbc3fb;
  --xt-eef1f5: #cfdae8;
  --xt-eef1f6: #cfd8e8;
  --xt-eef2f8: #ced9e9;
  --xt-eef2ff: #bbcafb;
  --xt-eef3fb: #c7d7ef;
  --xt-eef3ff: #bbcefb;
  --xt-eef4ff: #bbd2fb;
  --xt-eef8f1: #cee9d6;
  --xt-ef4444: #f19c9c;
  --xt-eff6ff: #bbd7fb;
  --xt-f0b7b7: #f0c6c6;
  --xt-f0c36d: #f0d49e;
  --xt-f0e3b0: #f1e8c5;
  --xt-f0f0f0: #eff0f0;
  --xt-f0f3f9: #ced7e9;
  --xt-f0f9f0: #cee9ce;
  --xt-f0faf2: #cbebd2;
  --xt-f1edfa: #d4c9ed;
  --xt-f1f4f9: #ced8e8;
  --xt-f1f5f9: #cedbe8;
  --xt-f2f0fd: #cac3f4;
  --xt-f2f7ff: #bbd4fb;
  --xt-f3f4f6: #cfd7e8;
  --xt-f3f5f8: #cfd9e8;
  --xt-f3f5f9: #cfd7e8;
  --xt-f3f6ff: #bbcbfb;
  --xt-f4f6f9: #cfd9e8;
  --xt-f4f6fb: #ccd5ea;
  --xt-f4f7fb: #ccd9ea;
  --xt-f4fbf6: #ccead5;
  --xt-f59e0b: #f1bf6b;
  --xt-f5c2c7: #f2c4c9;
  --xt-f5c451: #f4d99a;
  --xt-f5d9a8: #f5e2c2;
  --xt-f5f6f8: #cfd7e8;
  --xt-f5f6fa: #cfd4e8;
  --xt-f5f7fb: #ced7e9;
  --xt-f5f7ff: #bbc8fb;
  --xt-f6a609: #f2c469;
  --xt-f6c04a: #f5d899;
  --xt-f6f8fb: #cfd9e8;
  --xt-f6f8fc: #cbd6eb;
  --xt-f7f9fc: #cdd8ea;
  --xt-f87171: #f59999;
  --xt-f8fafc: #cedbe8;
  --xt-f97316: #f4aa76;
  --xt-f9f9f9: #eff0f0;
  --xt-f9fafb: #cfdbe8;
  --xt-f9faff: #bbc6fb;
  --xt-fafafa: #eff0f0;
  --xt-fafbfc: #cfdbe8;
  --xt-fafbfd: #ced7e9;
  --xt-fafbfe: #c6d1f1;
  --xt-fafbff: #bbc8fb;
  --xt-fbbf24: #f6d784;
  --xt-fbe2e6: #f4c3cb;
  --xt-fbeed5: #f6e4c1;
  --xt-fbfbfd: #cfcfe8;
  --xt-fcd34d: #f8e196;
  --xt-fce4e4: #f5c2c2;
  --xt-fce7f3: #f4c2df;
  --xt-fde2e4: #f7bfc3;
  --xt-fde3ee: #f7bfd7;
  --xt-fde68a: #faeebc;
  --xt-fde7e1: #f7cbbf;
  --xt-fdeaea: #f6c1c1;
  --xt-fdecc8: #f9e6bd;
  --xt-fdecec: #f5c1c1;
  --xt-fdf0f1: #f4c3c7;
  --xt-fdf1e0: #f8e0bf;
  --xt-fdf3e0: #f8e4bf;
  --xt-fdf3f3: #f2c4c4;
  --xt-fecaca: #fabcbc;
  --xt-fed7aa: #fbdebc;
  --xt-fee2e2: #f9bdbd;
  --xt-fef2f2: #f7c0c0;
  --xt-fef3c7: #faeebc;
  --xt-fef5d4: #faedbd;
  --xt-ffb3b3: #fbbbbb;
  --xt-ffd0d0: #fbbbbb;
  --xt-ffeeee: #fbbbbb;
  --xt-fff0f0: #fbbbbb;
  --xt-fff4d6: #fbeabb;
  --xt-fff4e5: #fbe0bb;
  --xt-fff5f4: #fbc1bb;
  --xt-fff5f5: #fbbbbb;
  --xt-fff7e6: #fbe7bb;
  --xt-fff7ed: #fbdfbb;
  --xt-fff8e1: #fbecbb;
  --xt-fff8e6: #fbe9bb;
  --xt-fff8ec: #fbe4bb;
  --xt-fff8f8: #fbbbbb;
  --xt-fff9ec: #fbe7bb;
  --xt-fffaef: #fbe7bb;
  --xt-fffbe6: #fbf1bb;
  --xt-fffceb: #fbf2bb;
  --xt-fffcf3: #fbebbb;
  --xt-ffffff: #eff0f0;
}

/* ---- things that are not plain colour literals ---- */
/* The monthly bar chart paints with fill= presentation attributes, which CSS
   overrides. Its light palette (near-white track + violet bars) glares on a
   dark canvas, so dark mode gets a teal scheme: a barely-there track, a muted
   bar for past months and a bright one for the current month. */
html[data-theme="dark"] .mb-track      { fill: #1b222e; }
html[data-theme="dark"] .mb-bar        { fill: #3f8f85; }
html[data-theme="dark"] .mb-bar.is-cur { fill: #5fd4bd; }
html[data-theme="dark"] .mb-grid       { stroke: #28313f; }
html[data-theme="dark"] .mb-axis       { fill: #7d8799; }
html[data-theme="dark"] .mb-lbl        { fill: #8a93a6; }
html[data-theme="dark"] .mb-lbl.is-cur { fill: #e8edf5; }
/* legend swatches must match the bars */
html[data-theme="dark"] .dlegend i.mb-key        { background: #3f8f85 !important; }
html[data-theme="dark"] .dlegend i.mb-key.is-cur { background: #5fd4bd !important; }

/* SVG charts draw with fill=/stroke= presentation attributes, which CSS wins
   over. These keep axis lines and labels readable on a dark canvas. */
html[data-theme="dark"] svg text          { fill: #9aa4b6; }
html[data-theme="dark"] svg line          { stroke: #2a3341; }
html[data-theme="dark"] svg [stroke="#e6ebf2"] { stroke: #2a3341; }

/* The uploaded logo is a PNG with an opaque white background. Rather than
   inverting it (which would wreck the brand colours), sit it on a deliberate
   light plate so it reads as intentional against the dark chrome. */
html[data-theme="dark"] .brand img,
html[data-theme="dark"] img.logo {
  background: #f2f4f8; padding: 3px 6px; border-radius: 7px;
}
/* Photographs keep their own colours, just very slightly dimmed. */
html[data-theme="dark"] .avatar img,
html[data-theme="dark"] .staff-photo img  { filter: brightness(.94); }

/* --c-primary has to stay dark enough for white button labels, which makes it
   too dim for link text on a dark page — so links get their own lighter blue. */
html[data-theme="dark"] a:not(.btn):not(.sb-link):not(.sp-nav-item):not(.skip-link):not(.current) { color: #7aacff; }

/* Solid buttons take their fill from the semantic tokens, which are tuned
   LIGHT so they stay legible as TEXT on a dark page. A light fill under a
   white label fails contrast, so the filled variants get their own surface. */
/* The app uses BOTH .btn-danger and .btn.danger, and the latter is declared
   !important in style.css — so these must be !important to land. */
html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] a.btn.danger,
html[data-theme="dark"] button.btn.danger   { background: #a13030 !important; border-color: #a13030 !important; }
html[data-theme="dark"] .btn-danger:hover,
html[data-theme="dark"] a.btn.danger:hover,
html[data-theme="dark"] button.btn.danger:hover { background: #8c2929 !important; }
html[data-theme="dark"] .btn-success,
html[data-theme="dark"] a.btn.success,
html[data-theme="dark"] button.btn.success  { background: #1d7a44 !important; border-color: #1d7a44 !important; }
html[data-theme="dark"] .btn-success:hover,
html[data-theme="dark"] a.btn.success:hover,
html[data-theme="dark"] button.btn.success:hover { background: #18663a !important; }

/* The sidebar uses --c-primary for TEXT, where the button-tuned blue is too
   dark. Its highlight background comes from --c-primary-l, so re-scoping just
   --c-primary here affects the labels and nothing else. */
/* Sidebar navigation reads as dull white, not accent blue. The generic link
   rule above is deliberately high-specificity, so the override repeats its
   :not() chain to outrank it. */
html[data-theme="dark"] .sidebar a:not(.btn):not(.sb-link):not(.sp-nav-item):not(.skip-link):not(.current),
html[data-theme="dark"] .sidebar .nav-tree a,
html[data-theme="dark"] .sidebar .nav-tree .lbl { color: #c3cbd8; }
html[data-theme="dark"] .sidebar a:hover,
html[data-theme="dark"] .sidebar .nav-tree a:hover .lbl { color: #eef2f8; }

/* Active / open items: brighter white rather than a blue tint. --c-primary is
   what the sidebar uses for active text and icons, so re-scoping it here keeps
   the highlight without turning the menu blue. */
html[data-theme="dark"] .sidebar { --c-primary: #f2f5fa; }
html[data-theme="dark"] .sidebar .nav-tree a.is-active:not(.btn):not(.sb-link):not(.sp-nav-item):not(.skip-link):not(.current),
html[data-theme="dark"] .sidebar .nav-tree a.is-active .lbl { color: #ffffff; font-weight: 700; }

/* Anything sitting ON the primary fill keeps a white label, so the lighter
   link blue above must not bleed into it. */
html[data-theme="dark"] .pagination a.current,
html[data-theme="dark"] .pagination .current { color: #fff; }
/* …except the avatar chip, which uses --c-primary as a FILL under white
   initials, so it keeps the darker button-grade blue. */
html[data-theme="dark"] .sidebar .sb-user-avatar,
html[data-theme="dark"] .sidebar .user-avatar { --c-primary: #2a66cf; background: #2a66cf; }

/* Native form controls + scrollbars follow the scheme */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--c-surface); color: var(--c-text); border-color: var(--c-border);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--c-text-soft); }

/* Print always uses the light palette */
@media print { html[data-theme="dark"] { color-scheme: light; } }
