/* The site's colours, in one place. Exact values from the BackLab app (~/Developer/laboratory/Web/shell.js THEMES):
   dark = "Midnight", light = "Platinum". Always Platinum; tokens are light-dark() pairs so data-scheme="dark" can preview Midnight through
   light-dark(), so every token below flips with color-scheme and nothing else has to.
   Review aid: <html data-scheme="light"> or "dark" forces a theme (document.documentElement.dataset.scheme = 'light'). */

:root { color-scheme: light; }   /* Platinum always (owner's choice); data-scheme="dark" still previews Midnight */
:root[data-scheme="light"] { color-scheme: light; }
:root[data-scheme="dark"] { color-scheme: dark; }

:root {
  /* Surfaces */
  --bg: light-dark(#bfbfbf, #000000);          /* window frame: page background, footer */
  --bg-elev: light-dark(#c9c9c9, #0a0a0a);
  --page: light-dark(#e0e0e0, #0a0a0a);        /* the rounded panel everything above the footer sits in */
  --card: light-dark(#ebebeb, #141414);
  --card-2: light-dark(#f2f2f2, #1c1c1c);
  --sunken: light-dark(#d2d2d2, #010101);

  /* Ink */
  --ink: light-dark(#050913, #f3f3f3);
  --ink-2: light-dark(#2b2f36, #c9c9c9);
  --muted: light-dark(#45494d, #8c8c8c);
  --ink-3: light-dark(#3a3d41, #737373);       /* small text on the frame (footer); Platinum's frame needs the darker grey */
  --faint: light-dark(#7a7f85, #5a5a5a);

  /* Lines */
  --line: light-dark(rgba(0,0,0,.09), rgba(32,32,32,.7));
  --line-2: light-dark(rgba(0,0,0,.16), rgba(255,255,255,.14));

  /* Accent is mono: white on Midnight, ink on Platinum */
  --accent: light-dark(#050913, #f5f5f7);
  --on-accent: light-dark(#ffffff, #000000);

  /* Money (Conventional palette; Platinum uses the app's darker inks) */
  --profit: light-dark(#0b5329, #1db954);
  --loss: light-dark(#9a1414, #ef4444);
  --breakeven: light-dark(#0f45a8, #3b82f6);
  --danger: light-dark(#b71c1c, #ff7a7f);

  --shadow-card: inset 0 1px 0 light-dark(transparent, rgba(255,255,255,.04)), 0 1px 2px light-dark(rgba(0,0,0,.06), rgba(0,0,0,.5)), 0 10px 28px -12px light-dark(rgba(0,0,0,.18), rgba(0,0,0,.6));
  --seg-on: light-dark(rgba(255,255,255,.94), rgba(255,255,255,.15));

  /* Buttons: black chrome on Midnight, white on Platinum (app BUTTONS "theme") */
  --kb-ink: light-dark(#0b0b0c, #f5f5f7);
  --kb-body: linear-gradient(180deg, light-dark(#ffffff, #1d1d20) 0%, light-dark(#fbfbfc, #0c0c0e) 52%, light-dark(#f4f4f6, #060607) 100%);
  --kb-edge: linear-gradient(155deg, light-dark(#00000014, #ffffff99) 0%, light-dark(#00000018, #ffffff24) 34%, light-dark(#0000001c, #ffffff0d) 58%, light-dark(#00000021, #ffffff52) 100%);
  --kb-shadow: inset 0 1px 0 light-dark(#ffffff, #ffffff1f), inset 0 -1px 0 light-dark(#00000008, #00000080), 0 1px 1px light-dark(#0000000a, #00000099), 0 6px 14px -8px light-dark(#00000026, #000000e6);
  --kb-shadow-hover: inset 0 1px 0 light-dark(#ffffff, #ffffff33), inset 0 -1px 0 light-dark(#00000008, #00000080), 0 1px 1px light-dark(#0000000a, #00000099), 0 10px 22px -10px light-dark(#00000044, #ffffff24);
  --kb-shadow-press: inset 0 3px 7px light-dark(#00000014, #000000e6), inset 0 -1px 0 light-dark(#ffffff99, #ffffff14), 0 3px 8px -6px light-dark(#0000, #00000099);
  --kb-light: light-dark(#ffffff00, #ffffff38);

  /* World map steps (0 users → most), grey ramp with contrast on either page */
  --map-0: light-dark(#cbcbcb, #353535);
  --map-1: light-dark(#b2b2b2, #474747);
  --map-2: light-dark(#8e8e8e, #6d6d6d);
  --map-3: light-dark(#6a6a6a, #959595);
  --map-4: light-dark(#45494d, #b8b8b8);
  --map-5: light-dark(#1f2226, #dbdbdb);
}

/* ---- Theme picker (top bar palette, assets/js/theme-picker.js). Default = Platinum.
   data-theme picks one of the app's four themes (shell.js THEMES); Midnight/Platinum are the light-dark() pairs above,
   Onyx and Light override the surfaces and inks with the app's values. ---- */
:root[data-theme="platinum"] { color-scheme: light; }
:root[data-theme="midnight"] { color-scheme: dark; }
:root[data-theme="onyx"] {
  color-scheme: dark;
  --bg: #1a1a1a; --bg-elev: #1f1f1f; --page: #222526; --card: #2b2f31; --card-2: #343a3d; --sunken: #141617;
  --ink: #f3f3f3; --ink-2: #cfd3d6; --muted: #9aa0a6; --ink-3: #9aa0a6; --faint: #6b7177;
  --line: #3a3f43; --line-2: rgba(255,255,255,.18);
  --shadow-card: inset 0 0 0 1px #3a3f43, 0 1px 2px rgba(0,0,0,.35);
  --seg-on: rgba(255,255,255,.14);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ebedf1; --bg-elev: #f1f3f6; --page: #f3f5f9; --card: #ffffff; --card-2: #ffffff; --sunken: #e6e9ee;
  --ink: #050913; --ink-2: #2b2f36; --muted: #525865; --ink-3: #525865; --faint: #8b91a0;
  --line: rgba(177,183,197,.7); --line-2: rgba(5,9,19,.14);
  --shadow-card: 0 1px 2px rgba(15,23,42,.06), 0 12px 32px -14px rgba(15,23,42,.18);
  --seg-on: rgba(255,255,255,.94);
  --profit: #1a7f43; --loss: #c62828; --breakeven: #2563eb;
}
