/* Palette tokens (PLAN.md 1.2). Type styles and the overlay use only these tokens, never raw colours.
   Set data-preset="<id>" on any element; :root is the default preset (market).
   Photo presets (bright, realistic): market, garland, lights, cosy. Illustrated (clay art): night, pine, candy.
   Extra tokens beyond the PLAN table: --glass (frosted panel behind header/footer), --tray (behind the door grid), --pill, --glass-line. */
:root, [data-preset="market"] {
  --bg: #dfe6ea; --bg-2: #f4efe8; --on-bg: #2a1d17; --on-bg-soft: #5e4c42;
  --glass: rgb(255 252 247 / .8); --glass-line: rgb(120 90 60 / .24); --tray: rgb(255 255 255 / .52); --pill: rgb(255 255 255 / .8);
  --door: #fffdf8; --door-edge: #e2d6c0; --door-ink: #1f5a3a; --inside: #e8e1d1; --on-inside: #2a1d17;
  --accent: #b3261e; --accent-ink: #ffffff;
  --surface: #fffdf8; --ink: #231a15; --ink-soft: #5f5148; --line: #e6dcc9;
  --ok: #2a7d4f; --bad: #b3261e; --focus: #1a5fb4; --backdrop: rgb(30 22 16 / .5);
}
[data-preset="garland"] {
  --bg: #4a2a1c; --bg-2: #7a5030; --on-bg: #2d1b12; --on-bg-soft: #614a3a;
  --glass: rgb(255 249 240 / .82); --glass-line: rgb(120 80 40 / .26); --tray: rgb(255 248 238 / .55); --pill: rgb(255 255 255 / .8);
  --door: #fff8ec; --door-edge: #e0cfae; --door-ink: #b3261e; --inside: #e8dcc4; --on-inside: #2d1b12;
  --accent: #1f6b3f; --accent-ink: #ffffff;
  --surface: #fffaf0; --ink: #2a1b12; --ink-soft: #5f4b3b; --line: #e8dcc4;
  --ok: #2a7d4f; --bad: #b3261e; --focus: #1a5fb4; --backdrop: rgb(36 20 10 / .55);
}
[data-preset="lights"] {
  --bg: #1a2a4a; --bg-2: #2c3f6a; --on-bg: #f7f1e3; --on-bg-soft: #cdd5e6;
  --glass: rgb(16 27 52 / .64); --glass-line: rgb(255 255 255 / .2); --tray: rgb(16 27 52 / .4); --pill: rgb(255 255 255 / .14);
  --door: #fbf6ea; --door-edge: #d9ccb0; --door-ink: #9e1f24; --inside: #2b3d66; --on-inside: #f7f1e3;
  --accent: #e8b04b; --accent-ink: #1f1a0e;
  --surface: #fcf8ef; --ink: #1f2430; --ink-soft: #5b6170; --line: #e4dccb;
  --ok: #2f8f5b; --bad: #c0392b; --focus: #1a5fb4; --backdrop: rgb(8 14 30 / .66);
}
[data-preset="cosy"] {
  --bg: #2b1a14; --bg-2: #4a2c20; --on-bg: #f8eedd; --on-bg-soft: #dcc9ad;
  --glass: rgb(40 23 17 / .64); --glass-line: rgb(255 236 200 / .22); --tray: rgb(40 23 17 / .42); --pill: rgb(255 240 215 / .14);
  --door: #ecd9b0; --door-edge: #c9ad78; --door-ink: #8f1d22; --inside: #4a2c20; --on-inside: #f8eedd;
  --accent: #d9a441; --accent-ink: #1f1a0e;
  --surface: #fbf4e6; --ink: #2a1c14; --ink-soft: #66503f; --line: #e8d9bb;
  --ok: #2a7d4f; --bad: #b3261e; --focus: #1a5fb4; --backdrop: rgb(24 12 8 / .66);
}
[data-preset="night"] {
  --bg: #0f1b2d; --bg-2: #1d3156; --on-bg: #f4efe4; --on-bg-soft: #b9c1d3;
  --glass: rgb(10 16 28 / .58); --glass-line: rgb(255 255 255 / .16); --tray: rgb(10 16 28 / .35); --pill: rgb(255 255 255 / .12);
  --door: #f3e9d6; --door-edge: #d4c19c; --door-ink: #8a2c2c; --inside: #2a3d63; --on-inside: #f4efe4;
  --accent: #e8b04b; --accent-ink: #1f1a0e;
  --surface: #fbf6ec; --ink: #1f2430; --ink-soft: #5b6170; --line: #e4dccb;
  --ok: #2f8f5b; --bad: #c0392b; --focus: #7fc8ff; --backdrop: rgb(10 16 28 / .72);
}
[data-preset="pine"] {
  --bg: #10281f; --bg-2: #1e4434; --on-bg: #f3efe2; --on-bg-soft: #b8cbbd;
  --glass: rgb(8 22 16 / .58); --glass-line: rgb(255 255 255 / .16); --tray: rgb(8 22 16 / .35); --pill: rgb(255 255 255 / .12);
  --door: #f6efe0; --door-edge: #d9c9a3; --door-ink: #a3262a; --inside: #2c5442; --on-inside: #f3efe2;
  --accent: #d9a441; --accent-ink: #1f1a0e;
  --surface: #fbf7ee; --ink: #1f2a24; --ink-soft: #56625b; --line: #e2dccb;
  --ok: #2f8f5b; --bad: #c0392b; --focus: #9fe0ff; --backdrop: rgb(8 22 16 / .72);
}
[data-preset="candy"] {
  --bg: #fdf7f2; --bg-2: #f6e1d8; --on-bg: #3a1f1f; --on-bg-soft: #7a5a55;
  --glass: rgb(255 255 255 / .74); --glass-line: rgb(58 31 31 / .16); --tray: rgb(255 255 255 / .5); --pill: rgb(255 255 255 / .8);
  --door: #c8312f; --door-edge: #9e2321; --door-ink: #ffffff; --inside: #f2d4cc; --on-inside: #3a1f1f;
  --accent: #1f7a4d; --accent-ink: #ffffff;
  --surface: #ffffff; --ink: #2a1a1a; --ink-soft: #7a5a55; --line: #efd9d2;
  --ok: #1f7a4d; --bad: #b3261e; --focus: #1a5fb4; --backdrop: rgb(58 31 31 / .45);
}
:root {
  --radius: 14px; --radius-s: 8px; --gap: clamp(8px, 2vw, 16px);
  --shadow: 0 10px 30px rgb(0 0 0 / .3); --ease-out: cubic-bezier(.2, .8, .2, 1);
  --foil: linear-gradient(135deg, #f7e08a 0%, #c9971f 28%, #fff1b0 50%, #b8860b 74%, #f0d064 100%);   /* gold foil edge */
  --glow: #f2c14e;
  --title-shadow: none;
}

/* Display font (PLAN.md 1.3): Fraunces, OFL, self-hosted latin subset (see CREDITS.md). Falls back to Georgia while loading. */
@font-face {
  font-family: Fraunces; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url("../assets/fonts/fraunces-latin.woff2") format("woff2");
}
:root { --font-display: Fraunces, Georgia, "Times New Roman", serif; --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* Fraunces has no Cyrillic: Ukrainian calendars (lang="uk" on <html>, or on the admin preview) use Lora (OFL, latin + cyrillic subset). */
@font-face {
  font-family: "Lora UK"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../assets/fonts/lora-uk.woff2") format("woff2");
}
:lang(uk) { --font-display: "Lora UK", Georgia, "Times New Roman", serif; }
