/* One palette, two grounds. Every colour on the site and in the dashboard is a
   token here, so the light version of the product is this file and nothing else.

   The light column is a role swap, not a tint: a dark ground becomes paper, and
   the "paper" family (the light document cards, the light homepage bands)
   becomes ink. That keeps the contrast bands the design leans on instead of
   flattening everything to one grey. Gold drops a few steps in light so it
   still reads as text on white.

   Generated -- edit scripts/build-theme.py and re-run it, not this file. */

/* The dark column doubles as the paper column. A report is a document, not a
   console, so anything marked .paper-doc keeps its original tokens in light
   mode instead of flipping to a black page. Being the more specific selector is
   the whole trick: no second copy of the palette to keep in sync. */
:root,
:root[data-theme="light"] .paper-doc{
  --k-bg:#0E0F14; --k-surface:#14151B; --k-surface-hi:#15161C;
  --k-line:#23242B; --k-line-2:#2F3038; --k-line-3:#3E3F48;
  --k-text:#F2F1ED; --k-text-hi:#FBFAF7; --k-text-max:#FFFFFF;
  --k-black:#000000; --k-text-2:#A2A2AB; --k-text-3:#8A8A93;
  --k-text-4:#7C7C86; --k-text-5:#6E6E77; --k-text-6:#63636C;
  --k-text-on-paper:#3A3A42; --k-paper-line:#DEDCD4; --k-paper-line-2:#D2CFC6;
  --k-paper-line-3:#C9C6BC; --k-paper-2:#E7E5DD; --k-paper-3:#EAE8E0;
  --k-gold:#C2A36B; --k-gold-hi:#D0B47E; --k-gold-2:#D8B68D;
  --k-gold-pale:#DDCFAE; --k-gold-orange:#C98F4E; --k-gold-dk:#8A6F35;
  --k-gold-dk-2:#8A6E2F; --k-gold-dk-3:#7A5A1E; --k-gold-deep:#6B5528;
  --k-gold-deep-2:#5A4A28; --k-gold-line:#3B341F; --k-gold-ink-2:#3A2E1C;
  --k-gold-bg:#1B1712; --k-gold-bg-2:#1B1A15; --k-gold-ink:#17150F;
  --k-gold-paper:#F0E7D5; --k-gold-paper-2:#F7F1E2; --k-gold-paper-3:#F5EAD3;
  --k-red:#E8A0A0; --k-red-dk:#8A3B2E; --k-red-line:#4A2A2C;
  --k-red-bg:#241618; --k-red-paper:#F6E3DE;
  --k-bg-rgb:14,15,20; --k-surface-rgb:20,21,27; --k-gold-rgb:194,163,107;
  color-scheme:dark;
}

:root[data-theme="light"]{
  --k-bg:#FBFAF7; --k-surface:#FFFFFF; --k-surface-hi:#F6F5F1;
  --k-line:#E3E1D9; --k-line-2:#D4D1C8; --k-line-3:#B9B6AC;
  --k-text:#16171C; --k-text-hi:#000000; --k-text-max:#000000;
  --k-black:#FFFFFF; --k-text-2:#55555E; --k-text-3:#9C9CA5;
  --k-text-4:#65656E; --k-text-5:#A0A0A9; --k-text-6:#6F6F78;
  --k-text-on-paper:#C9C6BC; --k-paper-line:#2B2C33; --k-paper-line-2:#35363E;
  --k-paper-line-3:#3E3F48; --k-paper-2:#24252C; --k-paper-3:#202128;
  --k-gold:#8A6C1E; --k-gold-hi:#A17F26; --k-gold-2:#8F7126;
  --k-gold-pale:#6E5A2A; --k-gold-orange:#9E6A26; --k-gold-dk:#D8B68D;
  --k-gold-dk-2:#D4B77F; --k-gold-dk-3:#DDCFAE; --k-gold-deep:#E2D3B0;
  --k-gold-deep-2:#E4D8BC; --k-gold-line:#E9DFC4; --k-gold-ink-2:#F0E7D5;
  --k-gold-bg:#FAF4E6; --k-gold-bg-2:#F7F3E7; --k-gold-ink:#FDFBF5;
  --k-gold-paper:#33291A; --k-gold-paper-2:#2B2318; --k-gold-paper-3:#30281A;
  --k-red:#B23B39; --k-red-dk:#E8A0A0; --k-red-line:#EFD3D3;
  --k-red-bg:#FCF2F2; --k-red-paper:#3A1F21;
  --k-bg-rgb:251,250,247; --k-surface-rgb:255,255,255; --k-gold-rgb:138,108,30;
  color-scheme:light;
}

:root[data-theme="light"] .paper-doc{ color-scheme:light; }

/* The switch itself: bottom right, so it never fights a header, and quiet
   enough to read as a utility rather than a call to action. */
.theme-toggle{position:fixed;right:18px;bottom:18px;z-index:9999;
  width:38px;height:38px;display:flex;align-items:center;justify-content:center;
  padding:0;border:1px solid var(--k-line-2);border-radius:999px;
  background:var(--k-surface);color:var(--k-text-4);cursor:pointer;
  line-height:1;transition:color .2s ease,border-color .2s ease;}
.theme-toggle:hover{color:var(--k-gold);border-color:var(--k-gold);}
.theme-toggle svg{width:17px;height:17px;display:block;}
@media print{.theme-toggle{display:none;}}
