/* =====================================================================
   Palettes: the greys a person can choose under Settings, General.
   Loaded after shell.css. theme-boot.js puts the choice on the root as
   data-palette (talqava, slate, paper or graphite) beside data-theme
   (light or dark). "talqava" is the standard look in shell.css and needs
   nothing here but the warning colour below. Each palette keeps the
   brand green, and the accent picker still works on top of it.
   Every text colour here is at least 4.5:1 (WCAG AA) on the page, a card
   and a raised surface of its own palette.
   ===================================================================== */

/* The standard light look: a warning amber dark enough to read (4.8:1 rather than 4.1:1). */
:root[data-theme="light"] { --warn: #8f5600; }

/* ---------- Slate: cool blue-grey ---------- */
:root[data-palette="slate"]:not([data-theme="light"]) {
  --bg: #131519;
  --side: #131519;
  --field: #131519;
  --panel: #1b1e23;
  --raised: #24282e;
  --line: #2c3037;
  --line2: #3d424a;
  --text: #e7ebf3;
  --soft: #b9bec6;
  --muted: #9da2a9;
  --warn: #e0a23a;
  --bad: #f08a8a;
  --bad-ink: #f08a8a;
  --glass-line: #2c3037;
  --glass: rgba(27, 30, 35, 0.6);
  --glass-strong: rgba(27, 30, 35, 0.86);
  --scrim: rgba(19, 21, 25, 0.6);
  --grad-text: linear-gradient(180deg, #e7ebf3 20%, #b9bec6 100%);
}
:root[data-palette="slate"][data-theme="light"] {
  --bg: #f3f5f9;
  --side: #f3f5f9;
  --field: #ffffff;
  --panel: #ffffff;
  --raised: #e7ebf3;
  --line: #d3d8e0;
  --line2: #b9bec6;
  --text: #21242a;
  --soft: #373b41;
  --muted: #4f5359;
  --warn: #9a5b00;
  --bad: #b42f2f;
  --bad-ink: #b42f2f;
  --glass-line: #d3d8e0;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --scrim: rgba(243, 245, 249, 0.55);
  --grad-text: linear-gradient(180deg, #21242a 20%, #373b41 100%);
}
:root[data-palette="slate"]:not([data-theme="light"]) :is(.acctmenu, .automenulist, .modelmenu) { background: #1b1e23; }

/* ---------- Paper: a warm page by day, warm graphite at night ---------- */
:root[data-palette="paper"]:not([data-theme="light"]) {
  --bg: #161513;
  --side: #161513;
  --field: #161513;
  --panel: #1f1e1c;
  --raised: #292825;
  --line: #33312d;
  --line2: #46433e;
  --text: #f3f1ec;
  --soft: #c9c4ba;
  --muted: #a29e95;
  --warn: #e0a23a;
  --bad: #ee8a7f;
  --bad-ink: #ee8a7f;
  --glass-line: #33312d;
  --glass: rgba(31, 30, 28, 0.6);
  --glass-strong: rgba(31, 30, 28, 0.86);
  --scrim: rgba(22, 21, 19, 0.6);
  --grad-text: linear-gradient(180deg, #f3f1ec 20%, #c9c4ba 100%);
}
:root[data-palette="paper"][data-theme="light"] {
  --bg: #f3f1ec;
  --side: #f3f1ec;
  --field: #fbfaf7;
  --panel: #fbfaf7;
  --raised: #e9e6df;
  --line: #dad6cd;
  --line2: #c4bfb4;
  --text: #1f1e1c;
  --soft: #45423d;
  --muted: #5f5b54;
  --warn: #8f5600;
  --bad: #a8322f;
  --bad-ink: #a8322f;
  --glass-line: #dad6cd;
  --glass: rgba(251, 250, 247, 0.6);
  --glass-strong: rgba(251, 250, 247, 0.86);
  --scrim: rgba(243, 241, 236, 0.55);
  --grad-text: linear-gradient(180deg, #1f1e1c 20%, #45423d 100%);
}
:root[data-palette="paper"]:not([data-theme="light"]) :is(.acctmenu, .automenulist, .modelmenu) { background: #1f1e1c; }

/* ---------- Graphite: pure white and true black, the most contrast ---------- */
:root[data-palette="graphite"]:not([data-theme="light"]) {
  --bg: #000000;
  --side: #000000;
  --field: #000000;
  --panel: #0f0f0f;
  --raised: #1a1a1a;
  --line: #242424;
  --line2: #3a3a3a;
  --text: #ffffff;
  --soft: #cfcfcf;
  --muted: #a3a3a3;
  --warn: #ffb020;
  --bad: #ff8a8a;
  --bad-ink: #ff8a8a;
  --glass-line: #242424;
  --glass: rgba(15, 15, 15, 0.6);
  --glass-strong: rgba(15, 15, 15, 0.86);
  --scrim: rgba(0, 0, 0, 0.6);
  --grad-text: linear-gradient(180deg, #ffffff 20%, #cfcfcf 100%);
  --ambient: none;
}
:root[data-palette="graphite"][data-theme="light"] {
  --bg: #ffffff;
  --side: #ffffff;
  --field: #ffffff;
  --panel: #ffffff;
  --raised: #f2f2f1;
  --line: #e4e4e2;
  --line2: #c9c9c6;
  --text: #0a0a0a;
  --soft: #2e2e2c;
  --muted: #55554f;
  --warn: #8f5600;
  --bad: #b02a2a;
  --bad-ink: #b02a2a;
  --glass-line: #e4e4e2;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --scrim: rgba(255, 255, 255, 0.55);
  --grad-text: linear-gradient(180deg, #0a0a0a 20%, #2e2e2c 100%);
  --ambient: none;
}
:root[data-palette="graphite"]:not([data-theme="light"]) :is(.acctmenu, .automenulist, .modelmenu) { background: #0f0f0f; }

/* ---------- choosing a palette in Settings ---------- */
.palettechip { display: inline-flex; align-items: center; gap: 8px; }
.palettechip .palettedot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line2); background: linear-gradient(135deg, var(--day) 50%, var(--night) 50%); flex: none; }
