/* Shared palette: use Bootstrap's semantic tokens for components and these
   application tokens for surfaces that differ from standard Bootstrap. */
:root, [data-bs-theme="light"] {
    color-scheme: light;
    --app-page-bg: #f5f7fb;
    --app-highlight-bg: #fff0b3;
    --app-highlight-color: #684800;
    --app-highlight-border: #856404;
    --app-selection-bg: #edf4ff;
    --app-heatmap-empty: #ebedf0;
    --app-chart-grid: #dee2e6;
    --app-toggle-shadow: 0 .25rem 1rem rgb(0 0 0 / 18%);
}

[data-bs-theme="dark"] {
    color-scheme: dark;
    --app-page-bg: #151a23;
    --app-highlight-bg: #514019;
    --app-highlight-color: #ffe69c;
    --app-highlight-border: #d6a52c;
    --app-selection-bg: #182e4b;
    --app-heatmap-empty: #343a40;
    --app-chart-grid: #495057;
    --app-toggle-shadow: 0 .25rem 1rem rgb(0 0 0 / 40%);
}

body { background-color: var(--app-page-bg); }

.theme-toggle {
    position: fixed;
    right: max(1.25rem, env(safe-area-inset-right));
    bottom: calc(var(--app-cookie-notice-height, 0px) + max(1.25rem, env(safe-area-inset-bottom)));
    z-index: 1035; /* Below dialogs, above page content. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: var(--app-toggle-shadow);
    font-size: 1.25rem;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--bs-tertiary-bg); }
.theme-toggle:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: 3px; }
/* Reserve room at the end of each page for the floating control. */
body { padding-bottom: 5rem; }
@media print { .theme-toggle { display: none; } }
