/* ════════════════════════════════════════════════════════════════════════════
   sleeppi-themes.css — lean SleepPi theme palettes  (PROTOTYPE / SAMPLE)
   ----------------------------------------------------------------------------
   Six themes via html[data-webtui-theme="<value>"]. Each block overrides --sp-*;
   the token shim maps them to plumbing + engine-glue vars, so graphs + chrome
   re-theme together. Ramp hexes reconciled against the SOURCE OF TRUTH:
   `docs/reports/2026-07-01-galaxy-theme-extraction-for-sleeppi.md`.
     · catppuccin-latte / -mocha  — vendor palettes, report §5.3 (canonical Catppuccin).
     · tokyo-night-dark           — Galaxy first-party, report §5.1 (verbatim).
     · claude-dark, ultra-dark    — Galaxy first-party generated ports, report §5.2 (verbatim).
     · everforest-light           — vendor (Everforest light-medium); report anchors §6
                                    (bg0 #fffbef, fg #5c6a72, ok #8da101, warn #dfa000, low #f85552);
                                    remaining hues from canonical Everforest (report leaves full
                                    ramp in the vendored file). Low-chroma → widen line weights.
   Base-map follows report §3-B: page=base, panel=surface0, panel-alt/border=surface1.

   Graph-token mapping follows report §8.2, with TWO documented deviations required
   by the "OSCAR-grade graph fidelity above all" hard rule:
     (1) --sp-graph-flow = TEXT (high-contrast), NOT the report's suggested sapphire —
         the densest lane must stay maximally legible (OSCAR renders flow dark/near-black).
     (2) --sp-graph-cursor = sapphire (distinct), so the synced cursor doesn't collide
         with the text-coloured flow trace (report suggested cursor=foreground0).
   grid/axis/session-gap use theme-appropriate low-alpha neutrals so gridlines stay
   visible on every panel (report's grid=surface0 would equal the panel bg → invisible).
   Discipline (report §8.2): O₂-absent / audit / data-quality = MUTED neutral (never crit
   red); --sp-graph-pulse = red is a labelled trace, not an alarm; experimental ◇ kept a
   distinct hue (peach) from canonical (green) per the task's "visually distinct" rule.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Catppuccin Latte — light clinical (DEFAULT) — report §5.3 ────────────────── */
html[data-webtui-theme="catppuccin-latte"] {
  --sp-page-bg: #eff1f5; --sp-panel-bg: #ccd0da; --sp-panel-bg-alt: #bcc0cc;
  --sp-text-primary: #4c4f69; --sp-text-secondary: #5c5f77; --sp-text-muted: #7c7f93;
  --sp-border: #bcc0cc; --sp-border-table: #bcc0cc; --sp-separator: #ccd0da;
  --sp-status-ok: #40a02b; --sp-status-info: #209fb5; --sp-status-warn: #df8e1d; --sp-status-crit: #d20f39; --sp-status-muted: #8c8fa1;
  --sp-faint-strength: 0.6; --sp-glow-strength: 0;
  --sp-graph-flow: #4c4f69; --sp-graph-pressure: #1e66f5; --sp-graph-leak: #fe640b; --sp-graph-flow-limitation: #8839ef;
  --sp-graph-snore: #df8e1d; --sp-graph-spo2: #179299; --sp-graph-pulse: #d20f39; --sp-graph-event-flag: #209fb5;
  --sp-graph-rera: #7287fd; --sp-graph-pulse-spike: #e64553; --sp-graph-glasgow-v2: #40a02b; --sp-graph-glasgow-v1-audit: #8c8fa1;
  --sp-graph-ned-drop: #04a5e5; --sp-graph-artifact: #9ca0b0; --sp-graph-session-gap: rgba(76,79,105,0.07);
  --sp-graph-grid: rgba(76,79,105,0.10); --sp-graph-axis: rgba(76,79,105,0.28); --sp-graph-cursor: #209fb5; --sp-graph-selection: #7287fd; --sp-graph-window-highlight: rgba(114,135,253,0.18);
  --sp-airway-burden: #8839ef; --sp-autonomic-burden: #fe640b; --sp-oxygen-guardrail: #179299; --sp-leak-guardrail: #fe640b; --sp-central-watch: #df8e1d;
  --sp-data-quality: #8c8fa1; --sp-absent-o2-neutral: #9ca0b0; --sp-experimental-badge: #fe640b; --sp-audit-only-badge: #8c8fa1;
}

/* ── Claude Light Clinical — warm morning clinical (first-party, Claude-inspired) ─
   Inspired by the Claude iTerm2 / app light aesthetic (warm paper + terracotta
   accent) — NOT an inversion of claude-dark, NOT pure white, NOT beige lifestyle.
   Warm off-white paper page, subtly warmer panels, warm-charcoal text, Claude
   terracotta as the signature warm accent, muted teal/green/blue/purple secondaries,
   restrained warn/crit. Flow stays high-contrast dark (f3d5a19 dense-flow rule). */
html[data-webtui-theme="claude-light-clinical"] {
  /* CORRECTED tonal hierarchy — lighter clinical CANVAS, work surfaces sit darker/
     warmer on it: page (lightest) → panel/rail body → graph container → lane body
     (clean tile) → lane/panel headers (stronger). Tone-first; borders subtle. */
  --sp-page-bg: #faf7f0;               /* CANVAS — lightest clean warm paper (not white) */
  --sp-app-chrome-bg: #ece6da;         /* chrome — darker than canvas, recedes */
  --sp-rail-bg: #efe9de;               /* left-rail body — slightly darker/warmer than canvas */
  --sp-panel-bg: #ede7db;              /* panel/tile body — darker/warmer than canvas */
  --sp-panel-bg-raised: #e6dfd0;       /* active / selected evidence block — stronger */
  --sp-panel-bg-alt: #e4ddcd;
  --sp-panel-header-bg: #e3dccb;       /* panel header — stronger than panel body */
  --sp-graph-bg: #e9e3d5;              /* graph CONTAINER — a darker plotted work surface */
  --sp-graph-lane-bg: #f4efe6;         /* lane plot tile — clean, distinct, darker than canvas */
  --sp-graph-lane-alt-bg: #efe9dd;
  --sp-graph-lane-header-bg: #e2dbca;  /* lane header — stronger than lane body */
  --sp-inspector-bg: #efe9de;          /* inspector surface — like rail, distinct from canvas */
  --sp-text-primary: #3a3733; --sp-text-secondary: #57534b; --sp-text-muted: #8a8578;
  --sp-border: #dcd5c4; --sp-border-table: #ddd7c8; --sp-separator: #e4ded0; --sp-border-strong: #c8bfab;
  --sp-shadow-subtle: 0 1px 2px rgba(74,64,48,0.06);
  --sp-status-ok: #5f8f57; --sp-status-info: #4d7ea3; --sp-status-warn: #bf8b3a; --sp-status-crit: #bf4d43; --sp-status-muted: #8a8578;
  --sp-faint-strength: 0.6; --sp-glow-strength: 0;
  --sp-graph-flow: #3a3733; --sp-graph-pressure: #4d7ea3; --sp-graph-leak: #cc7a56; --sp-graph-flow-limitation: #8467a8;
  --sp-graph-snore: #bf8b3a; --sp-graph-spo2: #468f86; --sp-graph-pulse: #bf4d43; --sp-graph-event-flag: #4d7ea3;
  --sp-graph-rera: #a05fa0; --sp-graph-pulse-spike: #a8524a; --sp-graph-glasgow-v2: #5f8f57; --sp-graph-glasgow-v1-audit: #8a8578;
  --sp-graph-ned-drop: #b06a86; --sp-graph-artifact: #a39d8e; --sp-graph-session-gap: rgba(58,55,51,0.06);
  --sp-graph-grid: rgba(58,55,51,0.10); --sp-graph-axis: rgba(58,55,51,0.26); --sp-graph-cursor: #4d7ea3; --sp-graph-selection: #c26b4c; --sp-graph-window-highlight: rgba(194,107,76,0.13);
  --sp-airway-burden: #8467a8; --sp-autonomic-burden: #cc7a56; --sp-oxygen-guardrail: #468f86; --sp-leak-guardrail: #cc7a56; --sp-central-watch: #bf8b3a;
  --sp-data-quality: #8a8578; --sp-absent-o2-neutral: #a39d8e; --sp-experimental-badge: #cc7a56; --sp-audit-only-badge: #8a8578;
}

/* ── Everforest Light — low-glare clinical — report §6 anchors + canonical ────── */
html[data-webtui-theme="everforest-light"] {
  --sp-page-bg: #fffbef; --sp-panel-bg: #f4f0d9; --sp-panel-bg-alt: #e6e2cc;
  --sp-text-primary: #5c6a72; --sp-text-secondary: #708089; --sp-text-muted: #939f91;
  --sp-border: #e0dcc7; --sp-border-table: #e6e2cc; --sp-separator: #e6e2cc;
  --sp-status-ok: #8da101; --sp-status-info: #3a94c5; --sp-status-warn: #dfa000; --sp-status-crit: #f85552; --sp-status-muted: #a6b0a0;
  --sp-faint-strength: 0.6; --sp-glow-strength: 0;
  --sp-graph-flow: #5c6a72; --sp-graph-pressure: #3a94c5; --sp-graph-leak: #f57d26; --sp-graph-flow-limitation: #df69ba;
  --sp-graph-snore: #dfa000; --sp-graph-spo2: #35a77c; --sp-graph-pulse: #f85552; --sp-graph-event-flag: #3a94c5;
  --sp-graph-rera: #8da101; --sp-graph-pulse-spike: #d16d6a; --sp-graph-glasgow-v2: #6f8352; --sp-graph-glasgow-v1-audit: #a6b0a0;
  --sp-graph-ned-drop: #567b8c; --sp-graph-artifact: #b7b295; --sp-graph-session-gap: rgba(92,106,114,0.07);
  --sp-graph-grid: rgba(92,106,114,0.10); --sp-graph-axis: rgba(92,106,114,0.26); --sp-graph-cursor: #3a94c5; --sp-graph-selection: #df69ba; --sp-graph-window-highlight: rgba(223,105,186,0.14);
  --sp-airway-burden: #df69ba; --sp-autonomic-burden: #f57d26; --sp-oxygen-guardrail: #35a77c; --sp-leak-guardrail: #f57d26; --sp-central-watch: #dfa000;
  --sp-data-quality: #939f91; --sp-absent-o2-neutral: #a6b0a0; --sp-experimental-badge: #f57d26; --sp-audit-only-badge: #939f91;
}

/* ── Tokyo Night — calm dark / primary terminal — report §5.1 (verbatim) ──────── */
html[data-webtui-theme="tokyo-night-dark"] {
  --sp-page-bg: #1a1b26; --sp-panel-bg: #292e42; --sp-panel-bg-alt: #3b4261;
  --sp-text-primary: #c0caf5; --sp-text-secondary: #a9b1d6; --sp-text-muted: #737aa2;
  --sp-border: #3b4261; --sp-border-table: #3b4261; --sp-separator: #292e42;
  --sp-status-ok: #9ece6a; --sp-status-info: #2ac3de; --sp-status-warn: #e0af68; --sp-status-crit: #f7768e; --sp-status-muted: #565f89;
  --sp-faint-strength: 0.45; --sp-glow-strength: 0.5;
  --sp-graph-flow: #c0caf5; --sp-graph-pressure: #7aa2f7; --sp-graph-leak: #ff9e64; --sp-graph-flow-limitation: #bb9af7;
  --sp-graph-snore: #e0af68; --sp-graph-spo2: #73daca; --sp-graph-pulse: #f7768e; --sp-graph-event-flag: #2ac3de;
  --sp-graph-rera: #9d7cd8; --sp-graph-pulse-spike: #db4b4b; --sp-graph-glasgow-v2: #9ece6a; --sp-graph-glasgow-v1-audit: #565f89;
  --sp-graph-ned-drop: #7dcfff; --sp-graph-artifact: #545c7e; --sp-graph-session-gap: rgba(192,202,245,0.05);
  --sp-graph-grid: rgba(192,202,245,0.055); --sp-graph-axis: rgba(192,202,245,0.16); --sp-graph-cursor: #2ac3de; --sp-graph-selection: #7aa2f7; --sp-graph-window-highlight: rgba(122,162,247,0.16);
  --sp-airway-burden: #bb9af7; --sp-autonomic-burden: #ff9e64; --sp-oxygen-guardrail: #73daca; --sp-leak-guardrail: #ff9e64; --sp-central-watch: #e0af68;
  --sp-data-quality: #565f89; --sp-absent-o2-neutral: #545c7e; --sp-experimental-badge: #ff9e64; --sp-audit-only-badge: #565f89;
}

/* ── Catppuccin Mocha — Galaxy-parity dark / Status console — report §5.3 ─────── */
html[data-webtui-theme="catppuccin-mocha"] {
  --sp-page-bg: #1e1e2e; --sp-panel-bg: #313244; --sp-panel-bg-alt: #45475a;
  --sp-text-primary: #cdd6f4; --sp-text-secondary: #bac2de; --sp-text-muted: #9399b2;
  --sp-border: #45475a; --sp-border-table: #45475a; --sp-separator: #313244;
  --sp-status-ok: #a6e3a1; --sp-status-info: #74c7ec; --sp-status-warn: #f9e2af; --sp-status-crit: #f38ba8; --sp-status-muted: #7f849c;
  --sp-faint-strength: 0.45; --sp-glow-strength: 0.5;
  --sp-graph-flow: #cdd6f4; --sp-graph-pressure: #89b4fa; --sp-graph-leak: #fab387; --sp-graph-flow-limitation: #cba6f7;
  --sp-graph-snore: #f9e2af; --sp-graph-spo2: #94e2d5; --sp-graph-pulse: #f38ba8; --sp-graph-event-flag: #74c7ec;
  --sp-graph-rera: #b4befe; --sp-graph-pulse-spike: #eba0ac; --sp-graph-glasgow-v2: #a6e3a1; --sp-graph-glasgow-v1-audit: #7f849c;
  --sp-graph-ned-drop: #89dceb; --sp-graph-artifact: #6c7086; --sp-graph-session-gap: rgba(205,214,244,0.05);
  --sp-graph-grid: rgba(205,214,244,0.06); --sp-graph-axis: rgba(205,214,244,0.16); --sp-graph-cursor: #74c7ec; --sp-graph-selection: #b4befe; --sp-graph-window-highlight: rgba(180,190,254,0.16);
  --sp-airway-burden: #cba6f7; --sp-autonomic-burden: #fab387; --sp-oxygen-guardrail: #94e2d5; --sp-leak-guardrail: #fab387; --sp-central-watch: #f9e2af;
  --sp-data-quality: #7f849c; --sp-absent-o2-neutral: #6c7086; --sp-experimental-badge: #fab387; --sp-audit-only-badge: #7f849c;
}

/* ── Claude Dark — warm calm reading (Galaxy first-party) — report §5.2 (verbatim) */
html[data-webtui-theme="claude-dark"] {
  --sp-page-bg: #262624; --sp-panel-bg: #31312f; --sp-panel-bg-alt: #3b3b39;
  --sp-text-primary: #e5e4e1; --sp-text-secondary: #c3c2bf; --sp-text-muted: #8b8b88;
  --sp-border: #3b3b39; --sp-border-table: #3b3b39; --sp-separator: #31312f;
  --sp-status-ok: #9aca86; --sp-status-info: #53acac; --sp-status-warn: #e8c96b; --sp-status-crit: #d47563; --sp-status-muted: #727270;
  --sp-faint-strength: 0.45; --sp-glow-strength: 0.35;
  --sp-graph-flow: #e5e4e1; --sp-graph-pressure: #6a9bcc; --sp-graph-leak: #de9f67; --sp-graph-flow-limitation: #9b87f5;
  --sp-graph-snore: #e8c96b; --sp-graph-spo2: #3cbe8c; --sp-graph-pulse: #d47563; --sp-graph-event-flag: #53acac;
  --sp-graph-rera: #91b2d3; --sp-graph-pulse-spike: #d7897a; --sp-graph-glasgow-v2: #9aca86; --sp-graph-glasgow-v1-audit: #727270;
  --sp-graph-ned-drop: #6bc9a4; --sp-graph-artifact: #5b5b59; --sp-graph-session-gap: rgba(229,228,225,0.05);
  --sp-graph-grid: rgba(229,228,225,0.06); --sp-graph-axis: rgba(229,228,225,0.16); --sp-graph-cursor: #53acac; --sp-graph-selection: #9b87f5; --sp-graph-window-highlight: rgba(155,135,245,0.16);
  --sp-airway-burden: #9b87f5; --sp-autonomic-burden: #de9f67; --sp-oxygen-guardrail: #3cbe8c; --sp-leak-guardrail: #de9f67; --sp-central-watch: #e8c96b;
  --sp-data-quality: #727270; --sp-absent-o2-neutral: #5b5b59; --sp-experimental-badge: #de9f67; --sp-audit-only-badge: #727270;
}

/* ── Ultra Dark — high-contrast / OLED (Galaxy first-party) — report §5.2 (verbatim) */
html[data-webtui-theme="ultra-dark"] {
  --sp-page-bg: #000000; --sp-panel-bg: #0f0f0f; --sp-panel-bg-alt: #1c1c1c;
  --sp-text-primary: #ffffff; --sp-text-secondary: #d1d1d1; --sp-text-muted: #878787;
  --sp-border: #1c1c1c; --sp-border-table: #2b2b2b; --sp-separator: #1c1c1c;
  --sp-status-ok: #c3e88d; --sp-status-info: #86c4ff; --sp-status-warn: #ffcb6b; --sp-status-crit: #f07178; --sp-status-muted: #666666;
  --sp-faint-strength: 0.5; --sp-glow-strength: 0.6;
  --sp-graph-flow: #ffffff; --sp-graph-pressure: #82aaff; --sp-graph-leak: #f89e72; --sp-graph-flow-limitation: #c792ea;
  --sp-graph-snore: #ffcb6b; --sp-graph-spo2: #89ddff; --sp-graph-pulse: #f07178; --sp-graph-event-flag: #86c4ff;
  --sp-graph-rera: #aac5ff; --sp-graph-pulse-spike: #f38b90; --sp-graph-glasgow-v2: #c3e88d; --sp-graph-glasgow-v1-audit: #666666;
  --sp-graph-ned-drop: #aae7ff; --sp-graph-artifact: #474747; --sp-graph-session-gap: rgba(255,255,255,0.06);
  --sp-graph-grid: rgba(255,255,255,0.07); --sp-graph-axis: rgba(255,255,255,0.18); --sp-graph-cursor: #86c4ff; --sp-graph-selection: #82aaff; --sp-graph-window-highlight: rgba(130,170,255,0.2);
  --sp-airway-burden: #c792ea; --sp-autonomic-burden: #f89e72; --sp-oxygen-guardrail: #89ddff; --sp-leak-guardrail: #f89e72; --sp-central-watch: #ffcb6b;
  --sp-data-quality: #878787; --sp-absent-o2-neutral: #666666; --sp-experimental-badge: #f89e72; --sp-audit-only-badge: #878787;
}
