/* PicoPuff colour and type tokens from the approved 1 December 2026 mock-up. */
:root {
  color-scheme: light;
  --bg: #eef9ff;
  --surface: #ffffff;
  --surface-2: #dcf2ff;
  --line: #d9dfe5;
  --text: #15202d;
  --text-2: #384352;
  --text-3: #5f6a77;
  --brand: #5bb8f2;
  --brand-ink: #116bb5;
  --primary: #116bb5;
  --primary-hover: #154e87;
  --on-primary: #ffffff;
  --danger: #ba2b2e;
  --ok: #007840;
  --ok-bg: #daf7e3;
  --focus: #116bb5;
  --font-brand: Comfortaa, ui-rounded, system-ui, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(21,32,45,.08),0 1px 1px rgba(21,32,45,.04);
  --sh-2: 0 6px 20px rgba(21,32,45,.10);
  --pdf: #c4302b;
  --pdf-bg: #fde9e7;
  --img: #7b3fc4;
  --img-bg: #f1e8fc;
  --data: #1d7a45;
  --data-bg: #e1f4e8;
  --doc: #1f5fc2;
  --doc-bg: #e4edfc;
  --qr: #a85400;
  --qr-bg: #ffefd9;
  --cloud: #ffffff;
  --cloud-shade: #e0f1fd;
  --cloud-edge: #c6e3f7;
  --hill: #d4efd6;
  --hill-top: #a9dcb1;
  --spark: #7cc8f7;
  --page-sky: var(--surface-2);
  --task-foreground: var(--on-primary);
  --hero-sky: radial-gradient(600px 220px at 65% 0%, #5bb8f238, transparent 70%), linear-gradient(var(--surface-2), var(--bg));
  --twinkle: twinkle;
  --primary-press: #0b4a80;
  --t-fast: 120ms;
  --ease-out: cubic-bezier(.2,.7,.2,1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1220;
  --surface: #121c2e;
  --surface-2: #1a2740;
  --line: #24344d;
  --text: #e6ecf2;
  --text-2: #a5afba;
  --text-3: #8f9aa6;
  --brand: #66c2fb;
  --brand-ink: #66c2fb;
  --primary: #66c2fb;
  --primary-hover: #92d4ff;
  --on-primary: #0b1421;
  --danger: #ff8a80;
  --ok: #5fd89a;
  --ok-bg: #12301f;
  --focus: #92d4ff;
  --sh-1: inset 0 1px 0 rgba(255,255,255,.05),0 6px 18px rgba(0,0,0,.28);
  --sh-2: inset 0 1px 0 rgba(255,255,255,.07),0 10px 28px rgba(0,0,0,.4);
  --pdf: #ff8a80;
  --pdf-bg: #3a1d1f;
  --img: #c9a2ff;
  --img-bg: #2c2140;
  --data: #6fdc9c;
  --data-bg: #16301f;
  --doc: #8fb6ff;
  --doc-bg: #1b2a45;
  --qr: #ffb366;
  --qr-bg: #38260f;
  --cloud: #2c3f5e;
  --cloud-shade: #23344f;
  --cloud-edge: #3a5277;
  --hill: #0f2233;
  --hill-top: #1d3b55;
  --spark: #dcecff;
  --page-sky: #0f1c33;
  --task-foreground: var(--text);
  --hero-sky: radial-gradient(420px 200px at 85% 10%, rgba(244,231,176,.08), transparent 70%), linear-gradient(180deg, #13253f, var(--bg));
  --twinkle: twinkle-night;
  --night-sky: block;
  --primary-press: #2a7fb8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a1220;
    --surface: #121c2e;
    --surface-2: #1a2740;
    --line: #24344d;
    --text: #e6ecf2;
    --text-2: #a5afba;
    --text-3: #8f9aa6;
    --brand: #66c2fb;
    --brand-ink: #66c2fb;
    --primary: #66c2fb;
    --primary-hover: #92d4ff;
    --on-primary: #0b1421;
    --danger: #ff8a80;
    --ok: #5fd89a;
    --ok-bg: #12301f;
    --focus: #92d4ff;
    --sh-1: inset 0 1px 0 rgba(255,255,255,.05),0 6px 18px rgba(0,0,0,.28);
    --sh-2: inset 0 1px 0 rgba(255,255,255,.07),0 10px 28px rgba(0,0,0,.4);
    --pdf: #ff8a80;
    --pdf-bg: #3a1d1f;
    --img: #c9a2ff;
    --img-bg: #2c2140;
    --data: #6fdc9c;
    --data-bg: #16301f;
    --doc: #8fb6ff;
    --doc-bg: #1b2a45;
    --qr: #ffb366;
    --qr-bg: #38260f;
    --cloud: #2c3f5e;
    --cloud-shade: #23344f;
    --cloud-edge: #3a5277;
    --hill: #0f2233;
    --hill-top: #1d3b55;
    --spark: #dcecff;
    --page-sky: #0f1c33;
    --task-foreground: var(--text);
    --hero-sky: radial-gradient(420px 200px at 85% 10%, rgba(244,231,176,.08), transparent 70%), linear-gradient(180deg, #13253f, var(--bg));
    --twinkle: twinkle-night;
    --night-sky: block;
    --primary-press: #2a7fb8;
  }
}

/* The legacy phase script sets body backgrounds and overlays inline. */
:root[data-theme="dark"] body:not(.pp-scene),
:root[data-theme="dark"] body:has(.pp-task-layout) {
  background: linear-gradient(180deg, var(--page-sky) 0, var(--bg) 420px) no-repeat, var(--bg) !important;
}

:root[data-theme="dark"] body:not(.pp-scene) > :is(#pp-night, #pp-dawn, #pp-day, #pp-dusk, #pp-breathe),
:root[data-theme="dark"] body:not([data-task-view="none"]) .pp-task-layout #stars {
  display: none !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body:not(.pp-scene),
  :root:not([data-theme="light"]) body:has(.pp-task-layout) {
    background: linear-gradient(180deg, var(--page-sky) 0, var(--bg) 420px) no-repeat, var(--bg) !important;
  }

  :root:not([data-theme="light"]) body:not(.pp-scene) > :is(#pp-night, #pp-dawn, #pp-day, #pp-dusk, #pp-breathe),
  :root:not([data-theme="light"]) body:not([data-task-view="none"]) .pp-task-layout #stars {
    display: none !important;
  }
}
