/* Establish the canvas before the full appearance stylesheet and application startup. */
html[data-mathesio-color-mode-enabled="true"][data-bs-theme="dark"] {
    color-scheme: dark;
    background-color: var(--bs-body-bg, #212529);
    color: var(--bs-body-color, #dee2e6);
}

html[data-mathesio-color-mode-enabled="true"][data-bs-theme="light"] {
    color-scheme: light;
    background-color: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
}

html[data-mathesio-color-mode-enabled="true"][data-bs-theme="dark"] body {
    background-color: var(--bs-body-bg, #212529);
    color: var(--bs-body-color, #dee2e6);
}

html[data-mathesio-color-mode-enabled="true"][data-bs-theme="light"] body {
    background-color: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
}

/* Legacy module headers must inherit dark surfaces rather than Bootstrap's fixed light variant. */
html[data-bs-theme="dark"] .table > thead.table-light {
    --bs-table-bg: var(--bs-tertiary-bg);
    --bs-table-color: var(--bs-body-color);
    --bs-table-border-color: var(--bs-border-color);
}
