﻿:root {
    /* WP-30.04: a slightly cooler app ground so white panels read as panels, and a darker
       secondary text colour — the captions and hints set in it are small, so they need the
       extra contrast (about 7:1 on white instead of 6:1). */
    --rl-bg-app: #f3f5f8;
    --rl-bg-surface: #ffffff;
    --rl-bg-sidebar: #f0f3f7;
    --rl-bg-toolbar: #f6f8fa;
    --rl-bg-hover: #edf3fa;
    --rl-bg-selection: #dcebfa;
    --rl-bg-selection-focus: #c9e0f8;
    --rl-border: #d5dbe3;
    --rl-border-subtle: #e5e9ef;
    --rl-border-strong: #c3cad4;
    --rl-text-primary: #1b2530;
    --rl-text-secondary: #4b5664;
    --rl-text-disabled: #8a94a1;
    --rl-primary: #1769d2;
    --rl-primary-hover: #1259b6;
    --rl-primary-soft: #eef5fc;
    --rl-success: #16753a;
    --rl-success-bg: #e8f5ec;
    --rl-warning: #9a5a00;
    --rl-warning-bg: #fff4df;
    --rl-danger: #c62828;
    --rl-danger-bg: #fdecec;
    --rl-icon: #4c5968;
    /* Text and border on a filled primary surface, plus the informational (blue) status pair.
       Every one of these has a dark counterpart below — a raw hex here would stay light. */
    --rl-primary-contrast: #ffffff;
    --rl-primary-strong: #0e4771;
    --rl-info: #174d75;
    --rl-info-bg: #e3eff8;
    --rl-info-border: #a9cbe4;
    --rl-success-border: #9bc5a9;
    --rl-warning-border: #d6b363;
    --rl-danger-border: #d0aaa7;
    --rl-scrim: rgb(15 23 30 / 45%);
    /* Light tint behind a question that only needs a click, not the full blocking scrim. */
    --rl-scrim-soft: rgb(15 23 30 / 12%);
    --rl-shadow-popover: 0 6px 20px rgb(15 23 30 / 14%);
    --rl-radius-sm: 4px;
    /* CS-9: one height for a field and a button that stand in the same row (they were 31 and 30 px,
       command-bar fields 32 px), and the compact height for dense bars. Guideline: 30–34 px. */
    --rl-control-height: 32px;
    --rl-control-height-compact: 28px;
    --rl-radius-md: 5px;
    --rl-space-1: 4px;
    --rl-space-2: 8px;
    --rl-space-3: 12px;
    --rl-space-4: 16px;
    --rl-space-5: 20px;
    --rl-space-6: 24px;
    --rl-space-8: 32px;
    /* WP-30.04: the variable Segoe UI of Windows 11 first — it is drawn for small sizes and much
       easier to read at 12–14 px than classic Segoe UI, which stays the fallback. */
    --rl-font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --rl-font-family-heading: "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    /* The guideline's range is 13–14 px for UI text; the practice test asked for larger type, so
       the UI sits at the top of it. Tables stay one step denser. */
    --rl-font-ui: 14px;
    --rl-font-table: 13px;
    --rl-font-small: 12px;
    /* Field captions and the hint lines under them. These were 10 px capitals, which testers
       found hard to read; they are now 12 px in sentence case (see .field label). */
    --rl-font-caption: 12px;
    /* Menu bar, toolbar and tab labels (CS-20): they sat at 12 px, below the guideline's 13–14 px
       for UI text; 13 px keeps the bars compact and readable. */
    --rl-font-control: 13px;
    --rl-sidebar-width: 190px;
    --rl-sidebar-handle-width: 5px;
    --rl-toolbar-height: 44px;
    --rl-statusbar-height: 30px;
    /* Motion (UI pass 2026-11). Feedback, not decoration: a control answers a hover or a press
       within one frame-ish step, something new on the page eases in, nothing loops except a busy
       indicator. Every value is switched off under prefers-reduced-motion in rooklane.css, and no
       animation carries information on its own. */
    --rl-motion-instant: 80ms;
    --rl-motion-fast: 120ms;
    --rl-motion-medium: 180ms;
    --rl-motion-slow: 260ms;
    --rl-ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --rl-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --rl-ease-in: cubic-bezier(0.4, 0, 1, 1);
    /* Spring and overshoot curves for micro-interactions (a tick that lands, a badge that settles),
       taken from Open Props 1.7.23 easings (--ease-spring-2, --ease-elastic-out-3; MIT, Adam Argyle,
       github.com/argyleink/open-props). Only for transform, never for colour. */
    --rl-ease-spring: linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1);
    --rl-ease-overshoot: cubic-bezier(0.5, 1.25, 0.75, 1.25);
    /* The ring a keyboard focus draws. A full-strength primary, so it reaches 3:1 against the
       surface in both themes (finding CS-6: the old light ring was practically invisible). */
    --rl-focus-ring: 2px solid var(--rl-primary);
}

/* Darkmode (token level): overrides the color tokens only — spacing/font/layout tokens above
   are theme-independent. Applied by toggling `data-theme` on <html> via rookLane.setTheme (see
   index.html). Everything the app draws re-themes through these tokens: the raw hex literals
   that used to sit in rooklane.css (and stayed light here) are gone, apart from the kiosk/beamer
   surface, the white QR quiet zone and the print rules, which are fixed colours by intent. */
:root[data-theme="dark"] {
    /* Flips the native controls (scrollbars, dropdown lists, date pickers, spinners) to their
       dark rendering. Without it Chromium keeps drawing them from the light scheme pinned in
       rooklane.css, which is where most of the stray white in dark mode came from. */
    color-scheme: dark;
    --rl-bg-app: #14181d;
    --rl-bg-surface: #1b2027;
    --rl-bg-sidebar: #171b21;
    --rl-bg-toolbar: #171b21;
    --rl-bg-hover: #232932;
    --rl-bg-selection: #1f3a5c;
    --rl-bg-selection-focus: #244a73;
    --rl-border: #2c333d;
    --rl-border-subtle: #232932;
    --rl-border-strong: #3a434f;
    --rl-text-primary: #e8ecf1;
    --rl-text-secondary: #a7b0bc;
    --rl-text-disabled: #5f6975;
    --rl-primary: #4b9eff;
    --rl-primary-hover: #6db2ff;
    --rl-primary-soft: #16283d;
    --rl-success: #4cc373;
    --rl-success-bg: #14301f;
    --rl-warning: #e0a530;
    --rl-warning-bg: #3a2a0c;
    --rl-danger: #ef5b5b;
    --rl-danger-bg: #3a1616;
    --rl-icon: #a7b0bc;
    --rl-primary-contrast: #0d1219;
    --rl-primary-strong: #3a86e0;
    --rl-info: #9ccbff;
    --rl-info-bg: #16283d;
    --rl-info-border: #27496b;
    --rl-success-border: #2c6540;
    --rl-warning-border: #6b5117;
    --rl-danger-border: #6d2f2f;
    --rl-scrim: rgb(4 7 10 / 62%);
    --rl-scrim-soft: rgb(4 7 10 / 30%);
    --rl-shadow-popover: 0 6px 20px rgb(0 0 0 / 40%);
}
