/* Selector de tema junto a Notificaciones. */
button#mmg-theme-toggle {
    box-sizing:border-box;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:none;
    width:42px;
    height:42px;
    padding:0;
    margin:0;
    border:1px solid #d7e0ed;
    border-radius:12px;
    background:#fff;
    color:#274466;
    cursor:pointer;
    box-shadow:none;
}
button#mmg-theme-toggle:hover { border-color:#6587ae; background:#edf4fc; }
button#mmg-theme-toggle:focus-visible { outline:3px solid #2b73b5; outline-offset:2px; }
button#mmg-theme-toggle > svg {
    width:21px;
    height:21px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.75;
    stroke-linecap:round;
    stroke-linejoin:round;
}
button#mmg-theme-toggle[data-position="header"] { margin-inline-start:8px; }
.access-top > button#mmg-theme-toggle { margin-inline-start:auto; }
button#mmg-theme-toggle:is([data-position="floating"],[data-position="alone"]) {
    position:fixed;
    top:18px;
    right:74px;
    z-index:95;
}
button#mmg-theme-toggle[data-position="alone"] { right:24px; }

/* El espacio entre los dos iconos es menor que entre las otras acciones. */
:is(.mmg-shell-tools,.top-right,.header-tools) > #mmg-notice-launcher:has(+ #mmg-theme-toggle) { margin-inline-end:-10px; }
@media (max-width:1250px) {
    :is(.mmg-shell-tools,.top-right,.header-tools) > #mmg-notice-launcher:has(+ #mmg-theme-toggle) { margin-inline-end:0; }
}
@media (max-width:650px) {
    button#mmg-theme-toggle[data-position="floating"] { top:12px; right:60px; }
    button#mmg-theme-toggle[data-position="alone"] { top:12px; right:12px; }
    :is(.mmg-shell-tools,.top-right,.header-tools):has(> #mmg-theme-toggle) { gap:6px; }
}
@media (max-width:380px) {
    .mmg-shell-enabled .mmg-shell-header:has(#mmg-theme-toggle) { gap:6px; padding-inline:8px; }
    .mmg-shell-enabled .mmg-shell-header:has(#mmg-theme-toggle) .mmg-shell-brand { gap:4px; }
    .mmg-shell-enabled .mmg-shell-header:has(#mmg-theme-toggle) .mmg-shell-brand > img { width:26px; height:29px; }
    .mmg-shell-enabled .mmg-shell-header:has(#mmg-theme-toggle) .mmg-shell-brand strong {
        font-size:10px;
        white-space:nowrap;
        overflow-wrap:normal;
    }
    .mmg-shell-enabled .mmg-shell-header:has(#mmg-theme-toggle) .mmg-shell-brand small { display:none; }
    body > header:has(> .header-tools > #mmg-theme-toggle) { gap:6px; padding-inline:10px; }
    body > header:has(> .header-tools > #mmg-theme-toggle) > .brand { gap:6px; }
    body > header:has(> .header-tools > #mmg-theme-toggle) > .brand > img { width:34px; flex-shrink:0; }
    :is(.mmg-shell-tools,.top-right,.header-tools):has(> #mmg-theme-toggle) { gap:4px; }
    :is(.mmg-shell-tools,.top-right,.header-tools) > button#mmg-theme-toggle,
    :is(.mmg-shell-tools,.top-right,.header-tools) > button#mmg-notice-launcher { width:38px; height:40px; }
    :is(.mmg-shell-tools,.top-right,.header-tools) > button#mmg-notice-launcher { padding:7px; }
    :is(.mmg-shell-tools,.top-right,.header-tools):has(> #mmg-theme-toggle) :is(.identity-logout,.mmg-shell-button,#logout) { padding-inline:6px; }
}
@media screen {
    :root[data-mmg-theme-switch] *,
    :root[data-mmg-theme-switch] *::before,
    :root[data-mmg-theme-switch] *::after { transition: none !important; }
    :root[data-mmg-theme="dark"] {
        color-scheme: dark;
        background: #0e1724;
        color: #e9f2fc;
        --mmg-dark-canvas: #0e1724;
        --mmg-dark-panel: #172437;
        --mmg-dark-control: #101c2c;
        --mmg-dark-text: #e9f2fc;
        --mmg-dark-quiet: #a9bdd2;
        --mmg-dark-blue: #8ecbff;
        --mmg-dark-outline: #86c5ff;
    }
    :root[data-mmg-theme="dark"] body { background: var(--mmg-dark-canvas); color: var(--mmg-dark-text); }
    :root[data-mmg-theme="dark"] a { color: var(--mmg-dark-blue); }
    :root[data-mmg-theme="dark"] :where(input,textarea,select,button,dialog) { color: var(--mmg-dark-text); }
    :root[data-mmg-theme="dark"] :where(input:not([type=checkbox],[type=radio],[type=range],[type=color]),textarea,select) { background-color: var(--mmg-dark-control); }
    :root[data-mmg-theme="dark"] ::placeholder { color: #a4b8cc; opacity: 1; }
    :root[data-mmg-theme="dark"] :focus-visible { outline-color: var(--mmg-dark-outline); }
    :root[data-mmg-theme="dark"] ::selection { background: #345b82; color: #fff; }
    :root[data-mmg-theme="dark"] button#mmg-theme-toggle { color: #f5dda9; background: #1b2e43; border-color: #506b86; }
    :root[data-mmg-theme="dark"] button#mmg-theme-toggle:hover { background: #243e58; border-color: #7ea3c5; }
    :root[data-mmg-theme="dark"] button#mmg-theme-toggle:focus-visible { outline-color: var(--mmg-dark-outline); }
}
@media print {
    :root[data-mmg-theme="dark"] { color-scheme: light; }
    button#mmg-theme-toggle { display: none !important; }
}
