/* ============================================================================
 * Lily theme tokens: dark
 *
 * Only the token block from the Lily "dark" theme, re-scoped so it layers on
 * top of lily-light.css instead of replacing it. The component rules in the
 * light stylesheet all read these tokens through var(), so redeclaring the
 * tokens is the whole of the theme switch.
 *
 * Two selectors, both with real specificity (the light theme declares its own
 * tokens inside :where(), which has none, so these always win):
 *   1. :root[data-theme="dark"]  — the explicit choice, set by the toggle.
 *   2. the prefers-color-scheme media query, excluding an explicit "light",
 *      so a visitor whose OS is dark gets dark before any script runs.
 *
 * Source: lily-design-system/themes/dark.css. Credit: DaisyUI.
 * ========================================================================= */

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

    /* Page-level surface (primary canvas). Sits behind body copy and
       primary content areas. Lightest base shade in light themes,
       deepest in dark themes. */
    --color-base-100: oklch(25.33% 0.016 252.42);
    /* Secondary surface — section panels, card backgrounds, sidebars,
       table-header fills. One step away from the page surface. */
    --color-base-200: oklch(23.26% 0.014 253.1);
    /* Tertiary surface — dividers, sunken wells, hover-row backgrounds.
       The most muted of the three base shades. */
    --color-base-300: oklch(21.15% 0.012 254.09);
    /* Primary text colour. High-contrast against base-100 to meet WCAG
       contrast ratios for body copy. */
    --color-base-content: oklch(97.807% 0.029 256.847);
    /* Primary brand / action colour. Used on primary buttons, active
       navigation items, selected states, and the focus ring. */
    --color-primary: oklch(58% 0.233 277.117);
    /* Foreground colour used over `--color-primary` fills (so primary
       buttons retain a guaranteed contrast ratio). */
    --color-primary-content: oklch(96% 0.018 272.314);
    /* Secondary brand colour. Pressed/hover state for primary buttons
       and visited links; also drives the secondary chrome family. */
    --color-secondary: oklch(65% 0.241 354.308);
    /* Foreground colour used over `--color-secondary` fills. */
    --color-secondary-content: oklch(94% 0.028 342.258);
    /* Accent colour — used sparingly for emphasis, the AI label,
       illustrations, and tertiary call-outs. */
    --color-accent: oklch(77% 0.152 181.912);
    /* Foreground colour used over `--color-accent` fills. */
    --color-accent-content: oklch(38% 0.063 188.416);
    /* Neutral chrome surface — footer bars, code blocks, tooltips,
       government-banner strips. Typically the theme's darkest neutral. */
    --color-neutral: oklch(14% 0.005 285.823);
    /* Foreground colour used over `--color-neutral` fills. */
    --color-neutral-content: oklch(92% 0.004 286.32);
    /* Informational status colour — informational banners, links,
       'did-you-know' callouts. */
    --color-info: oklch(74% 0.16 232.661);
    /* Foreground colour used over `--color-info` fills. */
    --color-info-content: oklch(29% 0.066 243.157);
    /* Success / confirmation colour — used on success panels, completed
       step indicators, validation pass states, and the green RAG status. */
    --color-success: oklch(76% 0.177 163.223);
    /* Foreground colour used over `--color-success` fills. */
    --color-success-content: oklch(37% 0.077 168.94);
    /* Warning colour — yellow/amber band; used on phase banners,
       in-progress states, validation warnings, and the amber RAG status. */
    --color-warning: oklch(82% 0.189 84.429);
    /* Foreground colour used over `--color-warning` fills. Often dark so
       text remains legible on a bright yellow background. */
    --color-warning-content: oklch(41% 0.112 45.904);
    /* Error / destructive colour — used on alert dialogs, error messages,
       validation failures, urgent care cards, and the red RAG status. */
    --color-error: oklch(71% 0.194 13.428);
    /* Foreground colour used over `--color-error` fills. */
    --color-error-content: oklch(27% 0.105 12.094);
    /* Smallest corner radius. Applied to chips, badges, switches,
       and radio/checkbox containers (mapped to `--lily-radius-sm`). */
    --radius-selector: 0.5rem;
    /* Medium corner radius. Applied to inputs, buttons, menu items,
       tooltips, and most everyday form controls
       (mapped to `--lily-radius-md`). */
    --radius-field: 0.25rem;
    /* Largest corner radius. Applied to cards, dialogs, drawers, and
       hero blocks (mapped to `--lily-radius-lg`). */
    --radius-box: 0.5rem;
    /* Base size for selector-style controls (checkbox/radio glyph
       size, switch thumb diameter). Currently unused by Lily's
       baseline component rules but available for theme extensions. */
    --size-selector: 0.25rem;
    /* Base size for field-style controls (input height multiplier).
       Currently unused by Lily's baseline component rules but
       available for theme extensions. */
    --size-field: 0.25rem;
    /* Default border width applied to inputs, buttons, dividers, table
       cells, etc. Single source of truth for the system's stroke weight. */
    --border: 1px;
    /* Depth flag (0 or 1). Lily's baseline rules read it implicitly via
       the shadow tokens; a depth-0 theme effectively renders flat. */
    --depth: 1;
    /* Noise flag (0 or 1). Reserved for theme extensions that want to
       layer a subtle texture; the baseline rules do not consume it. */
    --noise: 0;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        /* Page-level surface (primary canvas). Sits behind body copy and
           primary content areas. Lightest base shade in light themes,
           deepest in dark themes. */
        --color-base-100: oklch(25.33% 0.016 252.42);
        /* Secondary surface — section panels, card backgrounds, sidebars,
           table-header fills. One step away from the page surface. */
        --color-base-200: oklch(23.26% 0.014 253.1);
        /* Tertiary surface — dividers, sunken wells, hover-row backgrounds.
           The most muted of the three base shades. */
        --color-base-300: oklch(21.15% 0.012 254.09);
        /* Primary text colour. High-contrast against base-100 to meet WCAG
           contrast ratios for body copy. */
        --color-base-content: oklch(97.807% 0.029 256.847);
        /* Primary brand / action colour. Used on primary buttons, active
           navigation items, selected states, and the focus ring. */
        --color-primary: oklch(58% 0.233 277.117);
        /* Foreground colour used over `--color-primary` fills (so primary
           buttons retain a guaranteed contrast ratio). */
        --color-primary-content: oklch(96% 0.018 272.314);
        /* Secondary brand colour. Pressed/hover state for primary buttons
           and visited links; also drives the secondary chrome family. */
        --color-secondary: oklch(65% 0.241 354.308);
        /* Foreground colour used over `--color-secondary` fills. */
        --color-secondary-content: oklch(94% 0.028 342.258);
        /* Accent colour — used sparingly for emphasis, the AI label,
           illustrations, and tertiary call-outs. */
        --color-accent: oklch(77% 0.152 181.912);
        /* Foreground colour used over `--color-accent` fills. */
        --color-accent-content: oklch(38% 0.063 188.416);
        /* Neutral chrome surface — footer bars, code blocks, tooltips,
           government-banner strips. Typically the theme's darkest neutral. */
        --color-neutral: oklch(14% 0.005 285.823);
        /* Foreground colour used over `--color-neutral` fills. */
        --color-neutral-content: oklch(92% 0.004 286.32);
        /* Informational status colour — informational banners, links,
           'did-you-know' callouts. */
        --color-info: oklch(74% 0.16 232.661);
        /* Foreground colour used over `--color-info` fills. */
        --color-info-content: oklch(29% 0.066 243.157);
        /* Success / confirmation colour — used on success panels, completed
           step indicators, validation pass states, and the green RAG status. */
        --color-success: oklch(76% 0.177 163.223);
        /* Foreground colour used over `--color-success` fills. */
        --color-success-content: oklch(37% 0.077 168.94);
        /* Warning colour — yellow/amber band; used on phase banners,
           in-progress states, validation warnings, and the amber RAG status. */
        --color-warning: oklch(82% 0.189 84.429);
        /* Foreground colour used over `--color-warning` fills. Often dark so
           text remains legible on a bright yellow background. */
        --color-warning-content: oklch(41% 0.112 45.904);
        /* Error / destructive colour — used on alert dialogs, error messages,
           validation failures, urgent care cards, and the red RAG status. */
        --color-error: oklch(71% 0.194 13.428);
        /* Foreground colour used over `--color-error` fills. */
        --color-error-content: oklch(27% 0.105 12.094);
        /* Smallest corner radius. Applied to chips, badges, switches,
           and radio/checkbox containers (mapped to `--lily-radius-sm`). */
        --radius-selector: 0.5rem;
        /* Medium corner radius. Applied to inputs, buttons, menu items,
           tooltips, and most everyday form controls
           (mapped to `--lily-radius-md`). */
        --radius-field: 0.25rem;
        /* Largest corner radius. Applied to cards, dialogs, drawers, and
           hero blocks (mapped to `--lily-radius-lg`). */
        --radius-box: 0.5rem;
        /* Base size for selector-style controls (checkbox/radio glyph
           size, switch thumb diameter). Currently unused by Lily's
           baseline component rules but available for theme extensions. */
        --size-selector: 0.25rem;
        /* Base size for field-style controls (input height multiplier).
           Currently unused by Lily's baseline component rules but
           available for theme extensions. */
        --size-field: 0.25rem;
        /* Default border width applied to inputs, buttons, dividers, table
           cells, etc. Single source of truth for the system's stroke weight. */
        --border: 1px;
        /* Depth flag (0 or 1). Lily's baseline rules read it implicitly via
           the shadow tokens; a depth-0 theme effectively renders flat. */
        --depth: 1;
        /* Noise flag (0 or 1). Reserved for theme extensions that want to
           layer a subtle texture; the baseline rules do not consume it. */
        --noise: 0;
    }
}
