/* Shelf color tokens: the single home for color (dark-mode plan, Phase 0; DESIGN.md "Themes").

   How theming works
   - A theme is ONE selector block that sets the SAME token names as the light block. Light is the default and lives
     on :root, so a page without data-theme (or one that pins its own look, like capture) still gets light values.
     Every other theme is html[data-theme="<name>"]{...}.
   - app-settings.js sets html[data-theme] before first paint from the per-device choice (localStorage 'shelf.theme').
     Its THEMES registry lists each theme's name, color-scheme and browser theme-color.
   - Components only ever read var(--token). They never name a theme, never test data-theme, never carry raw hex for
     anything a theme could change.
   - Mana colors (and the other tokens in the first block) mean the same thing in every theme, so they are set once
     and no theme block may override them.

   Adding a theme
   1. Copy the dark block below, rename the selector to html[data-theme="<name>"], set every token.
   2. Add <name> to THEMES in app-settings.js (color-scheme and theme-color = its --bg).
   3. Add <name> to G_BASE and G_TONES in collection-model.js (and ShelfSpotlight.THEMES) for canvas and Data view.
   4. tests/theme.test.cjs checks that every theme block sets exactly the light block's token names.

   Phase 0 note: light values equal the literals the pages used before this file existed, so light renders the same.
   Dark is a first draft (to review in Phase 3) and is reachable only with the dev flag (?theme=dark). */

/* Theme-invariant: color here carries meaning (mana) and must read the same as in other deck apps. */
:root{
  --mana-w:#f4ead0;--mana-u:#b3d4ea;--mana-b:#8c8480;--mana-r:#eea98b;--mana-g:#9fcfaf;--mana-m:#d1a43e;--mana-c:#b7bec6;
  --mana-generic:#cfcac6;--pip-ink:#1a1a1a;
}

/* Light (default). */
:root{
  color-scheme:light;
  --bg:#fff;--surface:#fff;--paper:#f3f2ee;--soft:#f6f6f4;
  --ink:#111;--on-ink:#fff;--muted:#61615e;--faint:#8b8b86;--placeholder-text:#6c6c69;
  --line:#e7e7e4;--rule:#cfcfca;--edge:#b3b3af;
  --ok:#1f7a45;--danger:#8a1c1c;--warn:#9a3b12;
  --overlay:rgba(243,242,238,.94);--glass:rgba(255,255,255,.94);--scrim:#0006;
  --art-empty:#ecebe7;--gleam:rgba(255,255,255,.9);--grab:#d4d4d0;--card-edge:transparent;
  --shadow-1:0 1px 2px #0002,0 12px 24px -12px #0005;
  --shadow-2:0 -18px 40px -18px #0005;
  --shadow-3:0 0 0 2px var(--ink),0 22px 34px -16px #0008;
  --thumb:rgba(0,0,0,.25);--rail:rgba(0,0,0,.12);--rail-fill:rgba(0,0,0,.55);
  --pile:#d3d2cc;--pile-line:rgba(17,17,17,.45);--pile-seam:rgba(17,17,17,.28);
  --chart-line:rgba(17,17,17,.15);--bar-track:#efefeb;--hatch-a:#cfcfca;--hatch-b:#f1f1ee;
  --pip-edge:rgba(0,0,0,.22);--sw-edge:rgba(17,17,17,.45);
  /* Phase 1 additions: one-off greys and alphas that had no token. Light = the old literal (drift kept; settle in Phase 3). */
  --hover:#fafaf8;--picked:#f4f4f1;--soft-warm:#f6f5f1;--ink-2:#3a3a38;--toggle-off:#d6d6d2;--star-off:#c2c2be;
  --danger-soft:#fbeeee;--notice:#fbf7ee;--notice-edge:#d8c9a8;--row-rule:#f0f0ed;--art-empty-2:#e9e9e6;
  --art-empty-3:#e7e6e1;--dash-a:#c4c4c0;--dash-b:#c9c9c5;--dash-c:#b9b9b4;--hatch-edge:#c9c9c4;
  --surface-0:rgba(255,255,255,0);--overlay-veil:rgba(243,242,238,.86);--overlay-add:rgba(243,242,238,.9);
  --glass-soft:rgba(255,255,255,.7);--scrim-soft:rgba(17,17,17,.28);--wash:rgba(17,17,17,.04);
  --wash-edge:rgba(17,17,17,.06);--wash-2:rgba(17,17,17,.08);--wash-3:rgba(17,17,17,.14);
  --input-rule:rgba(17,17,17,.18);--placeholder-soft:rgba(17,17,17,.28);--placeholder-soft-2:rgba(17,17,17,.3);
  --on-ink-wash:#ffffff1f;--on-ink-wash-2:#ffffff2e;--on-ink-wash-3:#ffffff38;--on-ink-line:#ffffff3d;
  --on-ink-edge:rgba(255,255,255,.35);--on-ink-ring:#fff8;--on-ink-muted:rgba(255,255,255,.7);--on-ink-warn:#f0c8a8;
  --rank-0:#fff;--rank-1:#e0e0dc;--rank-2:#c2c2bd;--rank-3:#9e9e99;--rank-4:#7d7d79;--rank-5:#5b5b58;--rank-6:#3a3a38;
  --rank-7:#111;
  --danger-edge:#dcc1c1;--link-rule:#0003;--toggle-off-2:#d9d9d5;--edge-soft:#c9c9c4;--glass-strong:rgba(255,255,255,.96);--placeholder-2:#8f8e88;--avatar-empty:#eee;--note-warn:#a2422c;--scrim-light:#0004;
  --badge-glass:rgba(255,255,255,.88);
}

/* Dark ("Lifted", Jarlan 2026-11-30: one step up from near-black so panels and rules read). Values follow G_BASE.dark. */
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#161614;--surface:#201f1d;--paper:#161614;--soft:#201f1d;
  --ink:#f3f2ee;--on-ink:#161614;--muted:#9a9992;--faint:#6b6a65;--placeholder-text:#88877f;
  --line:#2e2d2a;--rule:#403f3a;--edge:#4a4945;
  --ok:#5cc28a;--danger:#e0847a;--warn:#e0955e;
  --overlay:rgba(22,22,20,.92);--glass:rgba(32,31,29,.9);--scrim:rgba(0,0,0,.6);
  --art-empty:#242321;--gleam:rgba(255,255,255,.06);--grab:#3a3934;--card-edge:rgba(255,255,255,.07);
  --shadow-1:0 0 0 1px var(--card-edge),0 12px 24px -12px #000c;
  --shadow-2:0 -18px 40px -18px #000;
  --shadow-3:0 0 0 2px var(--ink),0 22px 34px -16px #000;
  --thumb:rgba(255,255,255,.3);--rail:rgba(255,255,255,.14);--rail-fill:rgba(255,255,255,.6);
  --pile:#3e3d3a;--pile-line:rgba(243,242,238,.4);--pile-seam:rgba(15,15,14,.55);
  --chart-line:rgba(243,242,238,.15);--bar-track:#2a2927;--hatch-a:#3a3934;--hatch-b:#201f1d;
  --pip-edge:rgba(0,0,0,.35);--sw-edge:rgba(243,242,238,.35);
  /* Phase 1 additions: one-off greys and alphas that had no token. Light = the old literal (drift kept; settle in Phase 3). */
  --hover:#1c1c1a;--picked:#262523;--soft-warm:#201f1d;--ink-2:#d4d3ce;--toggle-off:#3a3934;--star-off:#4a4945;
  --danger-soft:rgba(224,132,122,.14);--notice:#211d15;--notice-edge:#5a4c32;--row-rule:#2a2927;--art-empty-2:#242321;
  --art-empty-3:#242321;--dash-a:#45443f;--dash-b:#45443f;--dash-c:#4a4945;--hatch-edge:#45443f;
  --surface-0:rgba(26,26,24,0);--overlay-veil:rgba(15,15,14,.86);--overlay-add:rgba(15,15,14,.9);
  --glass-soft:rgba(26,26,24,.7);--scrim-soft:rgba(0,0,0,.5);--wash:rgba(243,242,238,.05);
  --wash-edge:rgba(243,242,238,.08);--wash-2:rgba(243,242,238,.1);--wash-3:rgba(243,242,238,.16);
  --input-rule:rgba(243,242,238,.2);--placeholder-soft:rgba(243,242,238,.32);
  --placeholder-soft-2:rgba(243,242,238,.34);--on-ink-wash:rgba(15,15,14,.1);--on-ink-wash-2:rgba(15,15,14,.16);
  --on-ink-wash-3:rgba(15,15,14,.2);--on-ink-line:rgba(15,15,14,.24);--on-ink-edge:rgba(15,15,14,.35);
  --on-ink-ring:rgba(15,15,14,.5);--on-ink-muted:rgba(15,15,14,.7);--on-ink-warn:#9a3b12;--rank-0:#1a1a18;
  --rank-1:#33322f;--rank-2:#4a4945;--rank-3:#6b6a65;--rank-4:#8f8e88;--rank-5:#b4b4ae;--rank-6:#d4d3ce;
  --rank-7:#f3f2ee;
  --danger-edge:rgba(224,132,122,.4);--link-rule:rgba(243,242,238,.3);--toggle-off-2:#3a3934;--edge-soft:#45443f;--glass-strong:rgba(26,26,24,.96);--placeholder-2:#88877f;--avatar-empty:#222220;--note-warn:#e0955e;--scrim-light:rgba(0,0,0,.5);
  --badge-glass:rgba(26,26,24,.88);
}

/* A live theme switch repaints at once instead of running every color transition (app-settings.js adds the class
   for one frame). Theme-agnostic: no theme name here. */
html.theme-switching,html.theme-switching *,html.theme-switching *::before,html.theme-switching *::after{transition:none!important}
