/* Spirit Sight - Workbench dark theme
   =====================================
   Forks ONLY the luminance-carrying tokens; everything else inherits
   from default.css. Values from the approved dark mockup
   (docs/research/theme-mockups/a-workbench.html, data-theme="dark").
   The shell (header/sidebar) is already dark in both themes. */

[data-theme="dark"] {
    color-scheme: dark;

    /* Neutrals */
    --color-bg-primary: #1F1F1F;
    --color-bg-secondary: #161616;
    --color-bg-tertiary: #262626;
    --color-bg-inset: #101010;
    /* Char motif: gauge empty-arc track, charred oak. */
    --color-char-track: #33291F;
    --color-bg-hover: #2A2A2A;
    --color-bg-active: #333333;
    --color-bg-selected: #1C2E4A;
    --color-bg-dark: #0B0B0B;

    /* Sidebar / rail (a step darker than surfaces) */
    --color-sidebar-bg: #0B0B0B;
    --color-sidebar-hover: rgba(255, 255, 255, 0.07);
    --color-sidebar-active: #1F1F1F;
    --color-sidebar-text: #C6C6C6;
    --color-sidebar-text-muted: #787878;
    --color-sidebar-text-active: #FFFFFF;
    --color-sidebar-border: rgba(255, 255, 255, 0.08);

    /* Text */
    --color-text-primary: #F4F4F4;
    --color-text-secondary: #B5B5B5;
    --color-text-tertiary: #8D8D8D;
    --color-text-quaternary: #787878;
    --color-text-inverse: #161616;
    --color-text-muted: #525252;

    /* Status (desaturated for dark grounds) */
    --color-critical: #FA4D56;
    --color-critical-bg: #2D1214;
    --color-critical-border: #6E2327;

    --color-warning: #D9A153;
    --color-warning-bg: #2A2013;
    --color-warning-border: #6B4E1F;

    --color-success: #42BE65;
    --color-success-bg: #12291A;
    --color-success-border: #1F5C33;

    --color-info: #78A9FF;
    --color-info-bg: #14213A;
    --color-info-border: #2A4A85;

    --color-critical-muted: #C25A60;
    --color-warning-muted: #B08A4E;
    --color-success-muted: #4E9E6C;
    --color-info-muted: #6D8FCB;

    /* Categorical chart palette (brightened for dark canvas) */
    --chart-1: #D9A153;
    --chart-2: #78A9FF;
    --chart-3: #42BE65;
    --chart-4: #BE95FF;
    --chart-5: #3DDBD9;
    --chart-6: #FF7EB6;
    --chart-7: #D0846A;
    --chart-8: #4589FF;

    /* Interactive */
    --color-primary: #4589FF;
    --color-primary-hover: #78A9FF;
    --color-primary-active: #A6C8FF;
    --color-primary-light: #1C2E4A;

    --color-accent: #D9A153;
    --color-accent-hover: #E5B36E;
    --color-accent-active: #C08A3E;
    --color-accent-light: #2A2013;

    /* Borders */
    --color-border-primary: #4D4D4D;
    --color-border-secondary: #333333;
    --color-border-hover: #6F6F6F;
    --color-border-focus: #4589FF;
    --color-border-active: #4589FF;

    /* Shadows (overlays only; flat language) */
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.50);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.55);
    --shadow-2xl: 0 12px 36px rgba(0, 0, 0, 0.60);
    --shadow-focus: 0 0 0 2px rgba(69, 137, 255, 0.40);
    --shadow-focus-error: 0 0 0 2px rgba(250, 77, 86, 0.35);

    /* RGB helpers */
    --color-primary-rgb: 69, 137, 255;
    --color-accent-rgb: 217, 161, 83;
    --color-primary-alpha: rgba(69, 137, 255, 0.18);
    --color-info-dark: #A6C8FF;
    --color-info-hover: #78A9FF;
    --color-error-dark: #FF8389;
    --color-error-hover: #FA4D56;
    --color-warning-dark: #E5B36E;
    --color-warning-hover: #D9A153;
    --color-success-dark: #6FDC8C;
    --color-success-hover: #42BE65;
}

[data-theme="dark"] ::selection {
    background-color: rgba(69, 137, 255, 0.30);
}
[data-theme="dark"] ::-moz-selection {
    background-color: rgba(69, 137, 255, 0.30);
}
