:root, [data-theme="light"] {
    color-scheme: light;
    --page: #f3f5f9;
    --surface: #ffffff;
    --secondary: #f7f9fc;
    --text: #213147;
    --muted: #56677b;
    --border: #d6dee8;
    --accent: #355fd6;
    --heading: #254d8c;
    --section: #216860;
    --context: #80551c;
    --action: #264fb8;
    --action-text: #ffffff;
    --selection: #e8eefc;
    --hero: #e5efee;
    --hero-ink: #183f43;
    --art-line: #739b96;
    --planet: #518b85;
    --success: #206644;
    --warning: #805117;
    --error: #b02c34;
    --focus: #855500;
    --shadow: 0 2px 8px rgb(25 45 65 / 3%);
}
[data-theme="dark"] {
    color-scheme: dark;
    --page: #101010;
    --surface: #1c1c1c;
    --secondary: #262626;
    --text: #f2f2f2;
    --muted: #b3b3b3;
    --border: #454545;
    --accent: #eebc70;
    --heading: #f1c66c;
    --section: #e9aa73;
    --context: #cbb68a;
    --action: #eebc70;
    --action-text: #221a10;
    --selection: #3b3020;
    --hero: #252c28;
    --hero-ink: #dfebe1;
    --art-line: #83988a;
    --planet: #769c87;
    --success: #93d7ad;
    --warning: #f0c27d;
    --error: #ff9fa6;
    --focus: #ffd37b;
    --shadow: none;
}
[data-theme="blue-dark"] {
    color-scheme: dark;
    --page: #101a28;
    --surface: #192637;
    --secondary: #1d2d42;
    --text: #e5ecf5;
    --muted: #a4b3c8;
    --border: #3c5068;
    --accent: #9ab4ff;
    --heading: #8fb5f2;
    --section: #80c9c2;
    --context: #d8b774;
    --action: #a8c0ff;
    --action-text: #14233e;
    --selection: #263c5d;
    --hero: #1c3440;
    --hero-ink: #d2eae5;
    --art-line: #71969c;
    --planet: #609a9d;
    --success: #8edab9;
    --warning: #f3c488;
    --error: #ffa7b1;
    --focus: #f3ca88;
    --shadow: none;
}
/* Keep the no-script System choice usable too. The script resolves it before paint. */
@media (prefers-color-scheme: dark) {
    [data-theme="system"] {
        color-scheme: dark;
        --page: #101010;
        --surface: #1c1c1c;
        --secondary: #262626;
        --text: #f2f2f2;
        --muted: #b3b3b3;
        --border: #454545;
        --accent: #eebc70;
        --heading: #f1c66c;
        --section: #e9aa73;
        --context: #cbb68a;
        --action: #eebc70;
        --action-text: #221a10;
        --selection: #3b3020;
        --hero: #252c28;
        --hero-ink: #dfebe1;
        --art-line: #83988a;
        --planet: #769c87;
        --success: #93d7ad;
        --warning: #f0c27d;
        --error: #ff9fa6;
        --focus: #ffd37b;
    }
}
/* Override Bootstrap's :root defaults so its components follow our selected theme. */
html[data-theme] {
    --bs-body-bg: var(--page);
    --bs-body-color: var(--text);
    --bs-border-color: var(--border);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: var(--secondary);
    --bs-link-color: var(--accent);
    --bs-link-hover-color: var(--heading);
    --radius: 12px;
}
