/* Photon design tokens. Source: Quanta DESIGN.md (Postyellow, grey ramp, pill buttons, ring borders).
   Neutral brand: no logo. Fonts: system fallback stack only (Delivery is licensed and these pages
   reach clients on a public URL, so no @font-face here).
   Dark theme exists only for the panel (decision 25-nov; DESIGN.md has none): same Postyellow for
   actions with black text, lifted greys, a lighter red for error text so it passes AA on dark. */

:root {
  color-scheme: light;
  /* Brand */
  --py: #FFCC00; --py-70: #FFDB4C; --py-50: #FFE57F; --py-30: #FFF0B2; --py-20: #FFF5CC;
  --red: #D40511; --black: #000; --white: #fff;
  /* Grey ramp (black at opacity) */
  --g80: #333333; --g60: #666666; --g45: #8C8C8C; --g30: #B2B2B2; --g20: #CCCCCC; --g10: #E6E6E6; --g08: #EBEBEB; --g05: #F2F2F2;
  /* Additional palette (status) */
  --warm-green: #C4D19A; --cool-green: #A3D0B8; --light-blue: #B2DEF3; --light-violet: #C5D3F0; --dark-violet: #B7BBCE;
  --kraft: #D6B68A;

  /* Roles (light) */
  --bg: #FFFFFF;
  --bg-sunken: var(--g05);
  --surface: #FFFFFF;
  --surface-2: var(--g05);
  --surface-hover: rgba(0,0,0,.04);
  --text: var(--g80);
  --text-strong: #000;
  --text-muted: var(--g60);
  --text-faint: var(--g45);       /* disabled and placeholders only: below AA for body text */
  --line: var(--g10);
  --line-strong: var(--g20);
  --input-border: #8C8C8C;         /* 3.3:1 on white: form controls must reach 3:1 */
  --placeholder: #707070;          /* 4.9:1 on white */
  --ring-color: rgba(0,0,0,.10);
  --fill: rgba(0,0,0,.06);         /* secondary button */
  --fill-hover: rgba(0,0,0,.10);
  --accent: var(--py);
  --accent-hover: var(--py-70);
  --on-accent: #000;
  --accent-soft: var(--py-20);     /* selected row, highlight wash */
  --accent-warn: var(--py-30);     /* warning banner */
  --danger: var(--red);            /* destructive buttons and error text */
  --danger-text: var(--red);
  --danger-soft: #FBE6E7;          /* red 10% */
  --chip-blocked-text: #A3040D;    /* AA on the 12% red chip */
  --on-danger: #fff;
  --ok-soft: #DCE3C2;              /* warm green 60% over white */
  --info-soft: #E8F5FB;            /* light blue 30% over white */
  --chip-text: var(--g80);
  --focus: 0 0 0 3px rgba(0,0,0,.85);
  --focus-input: 0 0 0 3px rgba(255,204,0,.55);
  --scrim: rgba(0,0,0,.40);

  /* Type */
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --fs-display: 4rem;   --fs-page: 2.5rem;  --fs-section: 1.75rem; --fs-card: 1.25rem;
  --fs-body-l: 1.125rem; --fs-body: 1rem;   --fs-ui: .875rem;      --fs-grid: .8125rem;
  --fs-label: .75rem;   --fs-caption: .6875rem;

  /* Space (8px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* Radius: generous shell, tight grids */
  --r-pill: 9999px; --r-feature: 28px; --r-card: 20px; --r-panel: 12px; --r-input: 10px; --r-grid: 8px; --r-small: 6px;

  /* Depth: ring borders, float only for floating UI */
  --ring: 0 0 0 1px var(--ring-color);
  --float: 0 8px 24px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.06);
  --modal: 0 24px 64px rgba(0,0,0,.18);

  /* Motion */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --t-fast: 80ms; --t: 120ms; --t-slow: 220ms;

  /* Shell */
  --appbar-h: 64px; --sidebar-w: 240px; --content-max: 1440px;
}

/* Dark: panel only. Pages opt in by not forcing data-theme="light". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme-lock="light"]) {
    color-scheme: dark;
    --bg: #141414; --bg-sunken: #1A1A1A; --surface: #1E1E1E; --surface-2: #262626; --surface-hover: rgba(255,255,255,.05);
    --text: #E6E6E6; --text-strong: #FFFFFF; --text-muted: #B2B2B2; --text-faint: #8C8C8C;
    --line: #2E2E2E; --line-strong: #4A4A4A; --input-border: #858585; --placeholder: #A0A0A0; --ring-color: rgba(255,255,255,.12);
    --fill: rgba(255,255,255,.10); --fill-hover: rgba(255,255,255,.16);
    --accent-soft: rgba(255,204,0,.14); --accent-warn: rgba(255,204,0,.20);
    --danger-text: #FF8A8F; --danger-soft: rgba(212,5,17,.22); --chip-blocked-text: #FF9DA1;
    --ok-soft: rgba(196,209,154,.22); --info-soft: rgba(178,222,243,.16);
    --focus: 0 0 0 3px rgba(255,255,255,.92);
    --scrim: rgba(0,0,0,.6);
    --float: 0 8px 24px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08);
    --modal: 0 24px 64px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414; --bg-sunken: #1A1A1A; --surface: #1E1E1E; --surface-2: #262626; --surface-hover: rgba(255,255,255,.05);
  --text: #E6E6E6; --text-strong: #FFFFFF; --text-muted: #B2B2B2; --text-faint: #8C8C8C;
  --line: #2E2E2E; --line-strong: #4A4A4A; --input-border: #858585; --placeholder: #A0A0A0; --ring-color: rgba(255,255,255,.12);
  --fill: rgba(255,255,255,.10); --fill-hover: rgba(255,255,255,.16);
  --accent-soft: rgba(255,204,0,.14); --accent-warn: rgba(255,204,0,.20);
  --danger-text: #FF8A8F; --danger-soft: rgba(212,5,17,.22); --chip-blocked-text: #FF9DA1;
  --ok-soft: rgba(196,209,154,.22); --info-soft: rgba(178,222,243,.16);
  --focus: 0 0 0 3px rgba(255,255,255,.92);
  --scrim: rgba(0,0,0,.6);
  --float: 0 8px 24px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08);
  --modal: 0 24px 64px rgba(0,0,0,.6);
}
