/*
  🎨 The app's colours: ONLY tokens, light in :root and dark under prefers-color-scheme (the device decides).
  Every other stylesheet (app.css, navmenu.css, the widgets, the Marmot kit) reads these names and never a
  colour of its own, so a new Boy app is a new accent here and nothing else.

  scripts/new-app.mjs writes the two ACCENT lines below (light, then dark) and the two ACCENT-CONTRAST lines (the
  text on the accent: white or near-black, whichever reads better on it), the manifest's colours and index.html's
  theme-color metas; the rest follows from them (hover, soft fills, the text on a tint, the Beta pill, the review
  popup: --mr-*), so a new app's colours are one command.

  The names are the family's (ChefBoy's and ChoreBoy's token block): --surface*, --text*, --border*, --accent*,
  --good/--warn/--bad (+ -soft; --bad-text and --bad-contrast: the words on --bad-soft and on --bad), --info, --shadow-*, --radius*, --font; plus --brand* (the logo colour),
  --beta-* (the Beta pill), --mr-* (⭐ the review popup kit, marmot-review.css), --toast-* (the toast) and
  --focus-ring (every focus outline).

  💍 WeddingBoy: WHITE and PINK. A white page and white cards, the pink accent everywhere (buttons, links, focus
  rings, the Beta pill, the review popup, the pickers, the toasts' buttons) and light pink tints for the soft
  surfaces (--surface-2, --sunken, --border*). The accent is #db2777, a deeper pink than the logo's own #FC568C,
  so white text on a button reads at 4.6:1 (the logo's pink would be 3.1:1); links and tinted text use
  --accent-text (#9e1c56, 7.6:1 on white). The secondary grey (--text-3) is a little darker than the family's so
  it reads at 4.5:1 or better on every pink tint. Dark mode keeps the family's dark neutrals with the lighter pink
  (#f472b6, near-black text on it at 7.3:1). DESIGN.md section 0 has the numbers.
*/
:root {
  color-scheme: light;
  --accent: #db2777; /* ACCENT (light): new-app.mjs --accent */

  /* The neutrals: a white page, light pink tints for the soft surfaces and lines (the text stays the family's grey). */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fdf4f8;
  --sunken: #fbeef4;
  --border: #f2e2ea;
  --border-strong: #e0c6d3;
  --line: var(--border);
  --card: var(--surface);
  --text: #15181d;
  --text-2: #464c56;
  --text-3: #5f6671;

  /* From the accent. */
  --accent-hover: color-mix(in srgb, var(--accent) 86%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --accent-contrast: #ffffff; /* ACCENT-CONTRAST (light): new-app.mjs, from the accent */
  --accent-text: color-mix(in srgb, var(--accent) 72%, #000);
  --brand: var(--accent);
  --brand-deep: var(--accent-text);
  --brand-tint: var(--accent-soft);

  /* What things mean (the same in every Boy app). */
  --good: #15803d;
  --good-soft: #ecfdf3;
  --warn: #b86a05;
  --warn-soft: #fff7e6;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --bad-text: #b91c1c; /* words on --bad-soft: 5.7:1 (--bad itself is 4.2:1 there) */
  --bad-contrast: #fff; /* words on --bad: 4.8:1 */
  --info: #026aa2;
  --info-soft: #f0f9ff;
  --gold: #f2b630;
  /* (the older names some widgets and charts.js still read) */
  --in: var(--good);
  --out: var(--text);
  --over: var(--bad);
  --over-soft: var(--bad-soft);
  --move: #64748b;

  /* The Beta pill next to the logo (index.html .beta-pill). */
  --beta-border: color-mix(in srgb, var(--accent) 55%, var(--border));
  --beta-bg: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --beta-text: var(--accent-text);

  /* The toast: dark on light, light on dark. */
  --toast-bg: var(--text);
  --toast-text: var(--bg);
  --toast-btn: color-mix(in srgb, var(--accent) 45%, #fff);

  /* Every focus outline: the accent itself (4.6:1 on white, 7.1:1 on the dark page), so a ring reads at 3:1 or more. */
  --focus-ring: var(--accent);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --scrim: rgba(12, 10, 8, .5);
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* ⭐ The review popup (marmot-review.css, the same kit in every Boy app) in this app's colours. 480 sits over
     boxes, menus, toasts and OK/Cancel (90) and pickers (400), under the tour (500). */
  --mr-bg: var(--surface);
  --mr-text: var(--text);
  --mr-muted: var(--text-2);
  --mr-border: var(--border-strong);
  --mr-field: var(--surface);
  --mr-accent: var(--accent);
  --mr-accent-hover: var(--accent-hover);
  --mr-accent-text: var(--accent-contrast);
  --mr-star: var(--gold);
  --mr-bad: var(--bad);
  --mr-scrim: var(--scrim);
  --mr-shadow: var(--shadow-lg);
  --mr-radius: var(--radius-lg);
  --mr-radius-sm: var(--radius);
  --mr-font: var(--font);
  --mr-z: 480;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --accent: #f472b6; /* ACCENT (dark): new-app.mjs --accent-dark */

    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1e222b;
    --sunken: #13161c;
    --border: #2a2f3a;
    --border-strong: #3a404d;
    --text: #e8eaf0;
    --text-2: #b8bdc8;
    --text-3: #8f96a3;

    --accent-hover: color-mix(in srgb, var(--accent) 80%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
    --accent-contrast: #0b0d12; /* ACCENT-CONTRAST (dark): new-app.mjs, from the accent */
    --accent-text: color-mix(in srgb, var(--accent) 70%, #fff);

    --good: #4ade80;
    --good-soft: rgba(74, 222, 128, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, .14);
    --bad-text: var(--bad);
    --bad-contrast: #0b0d12; /* near-black on the light red: 7.0:1 (white was 2.8:1) */
    --info: #7cd4fd;
    --info-soft: rgba(124, 212, 253, .12);
    --gold: #f5c75a;
    --move: #94a3b8;

    --toast-btn: color-mix(in srgb, var(--accent) 55%, #000); /* (6.0:1 on the light toast; 70% was 4.2) */

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    --scrim: rgba(0, 0, 0, .6);
  }
}
