html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

.theme-picker:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
}
.theme-picker select {
    min-height: 44px;
    max-inline-size: 100%;
    padding-inline: .5rem;
    border: 1px solid #8299b5;
    border-radius: .5rem;
    background: #fff;
    color: #1e3551;
    font: inherit;
}
.theme-picker select:focus-visible {
    outline: 3px solid #1866b5;
    outline-offset: 2px;
}
[data-theme="dark"] .theme-picker select {
    border-color: #5f799c;
    background: #172337;
    color: #e8edf6;
}
[data-theme="dark"] .theme-picker select:focus-visible,
.marketing-footer .theme-picker select:focus-visible { outline-color: #91beff; }

.theme-toggle:not([hidden]) {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
    border: 1px solid #8da1bd;
    border-radius: .5rem;
    background: transparent;
    color: #22446b;
    cursor: pointer;
}
.theme-toggle:not([hidden]):hover { background: #eef4fd; }
.theme-toggle:focus-visible { outline: 3px solid #1866b5; outline-offset: 2px; }
.theme-toggle-icon { display: block; }
.theme-toggle-sun,
[data-theme="dark"] .theme-toggle-moon { display: none; }
[data-theme="dark"] .theme-toggle-sun { display: block; }
[data-theme="dark"] .theme-toggle:not([hidden]) { border-color: #637b9b; color: #f7cb54; }
[data-theme="dark"] .theme-toggle:not([hidden]):hover { background: #243955; }
[data-theme="dark"] .theme-toggle:focus-visible { outline-color: #91beff; }

.theme-toggle--marketing-compact:not([hidden]) { display: none; }
@media (max-width: 1640px) {
    .marketing-page:not(.marketing-home-driving-fr) .theme-toggle--marketing-compact:not([hidden]) { display: inline-grid; }
    .marketing-page:not(.marketing-home-driving-fr) .theme-toggle--marketing-desktop:not([hidden]) { display: none; }
}
@media (max-width: 1279px) {
    .marketing-home-driving-fr .theme-toggle--marketing-compact:not([hidden]) { display: inline-grid; }
    .marketing-home-driving-fr .theme-toggle--marketing-desktop:not([hidden]) { display: none; }
}
@media (min-width: 1280px) and (max-width: 1500px) {
    .marketing-home-driving-fr .marketing-menu,
    .marketing-home-driving-fr .marketing-nav nav { column-gap: 14px; }
}
@media (min-width: 1280px) and (max-width: 1420px) {
    .marketing-home-driving-fr .marketing-header .marketing-menu,
    .marketing-home-driving-fr .marketing-header .marketing-nav nav { column-gap: 10px; }
    .marketing-home-driving-fr .marketing-actions { gap: 8px; }
    .marketing-home-driving-fr .marketing-actions .marketing-login,
    .marketing-home-driving-fr .marketing-actions .marketing-button-small { padding-inline: 10px; }
}
.marketing-nav .theme-toggle--marketing-compact { margin-inline-start: auto; }
@media (max-width: 420px) {
    .marketing-header .marketing-nav:has(.theme-toggle--marketing-compact:not([hidden])) { gap: .5rem; }
}

.marketing-footer-preferences {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .65rem;
    flex-shrink: 0;
}
.marketing-menu-appearance {
    display: none;
    justify-content: center;
    margin-block-start: .5rem;
}
@media (max-width: 1640px) {
    .marketing-page:not(.marketing-home-driving-fr) .marketing-menu-appearance { display: flex; }
}
@media (max-width: 1279px) {
    .marketing-home-driving-fr .marketing-menu-appearance { display: flex; }
}
.workspace-theme-preference {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .25rem 1rem;
}

.public-preferences {
    position: fixed;
    z-index: 5;
    inset-block-start: .5rem;
    inset-inline-end: .75rem;
    display: flex;
    align-items: center;
    justify-content: end;
    flex-wrap: wrap;
    gap: .45rem;
    max-inline-size: calc(100% - 1.5rem);
}
.public-preferences .public-language-switcher { position: static; }

@media (max-width: 1199px) {
    .public-preferences ~ main.public-shell { padding-block-start: 65px; }
}
@media (max-width: 380px) {
    .public-preferences .theme-picker { gap: .3rem; font-size: .8rem; }
}
@media (max-width: 320px) {
    .public-preferences ~ main.public-shell { padding-block-start: 104px; }
}
@media print {
    html[data-theme][data-bs-theme] {
        color-scheme: light;
        --bs-body-bg: #fff;
        --bs-body-bg-rgb: 255, 255, 255;
        --bs-body-color: #212529;
        --bs-body-color-rgb: 33, 37, 41;
        --bs-emphasis-color: #000;
        --bs-emphasis-color-rgb: 0, 0, 0;
        --bs-secondary-color: #495057;
        --bs-secondary-bg: #e9ecef;
        --bs-tertiary-bg: #f8f9fa;
        --bs-border-color: #dee2e6;
        --bs-link-color: #0754a4;
        --bs-link-color-rgb: 7, 84, 164;
    }
    .theme-picker:not([hidden]), .theme-toggle:not([hidden]) { display: none; }
}
