/* Global day/night compatibility layer */
html{color-scheme:dark}body[data-theme="dark"]{color-scheme:dark}
body[data-theme="light"]{color-scheme:light;--md-bg:#edf4f7;--md-panel:#fff;--md-panel2:#f5f9fb;--md-line:#b7ced9;--md-text:#102630;--md-muted:#526c78;--md-accent:#007aa8;--ux-bg:#edf4f7;--ux-surface:#fff;--ux-surface2:#f5f9fb;--ux-line:#b7ced9;--ux-text:#102630;--ux-muted:#526c78;--ux-accent:#007aa8;--bg:#edf4f7;--panel:#fff;--line:#b7ced9;--text:#102630;--muted:#526c78;--accent:#007aa8;background:radial-gradient(900px 500px at 75% -15%,rgba(0,122,168,.08),transparent 60%),linear-gradient(180deg,#f6fafc,#edf4f7)!important;color:#102630!important}
body[data-theme="light"] .card{background:linear-gradient(145deg,#fff,#f5f9fb)!important;border-color:#b7ced9!important;box-shadow:0 12px 34px rgba(28,67,84,.12)!important;color:#102630!important}
body[data-theme="light"] .quick a,body[data-theme="light"] .module,body[data-theme="light"] .mods a{background:linear-gradient(145deg,#fff,#eaf4f8)!important;border-color:#9fc3d2!important;color:#102630!important;box-shadow:0 8px 22px rgba(28,67,84,.1)!important}
body[data-theme="light"] .quick a b,body[data-theme="light"] .module b{color:#006f9b!important}
body[data-theme="light"] .side,body[data-theme="light"] .top,body[data-theme="light"] nav,body[data-theme="light"] header{background-color:rgba(246,250,252,.94)!important;color:#102630!important}
body[data-theme="light"] p,body[data-theme="light"] span,body[data-theme="light"] small,body[data-theme="light"] label,body[data-theme="light"] td,body[data-theme="light"] th,body[data-theme="light"] li{color:inherit}
body[data-theme="light"] a{color:#006f9b}body[data-theme="light"] input,body[data-theme="light"] select,body[data-theme="light"] textarea{background:#fff!important;color:#102630!important;border-color:#9fc3d2!important}body[data-theme="light"] input::placeholder,body[data-theme="light"] textarea::placeholder{color:#718792!important}
body[data-theme="light"] button:not(.status-green):not(.status-yellow):not(.status-red){background:#e8f3f7!important;color:#102630!important;border-color:#8eb9ca!important}
body[data-theme="light"] table{background:#fff;color:#102630}body[data-theme="light"] tr{border-color:#c6d9e1!important}body[data-theme="light"] .item:hover,body[data-theme="light"] .item:focus{background:#e7f2f6!important}
body[data-theme="light"] .schnorlie{background:linear-gradient(135deg,#fff8dc,#eef7fa)!important;color:#263337!important;border-color:#c9aa43!important}
body[data-theme="light"] .status-green{color:#075f38!important;background:#dff7ea!important;border-color:#58b987!important}body[data-theme="light"] .status-yellow{color:#694f00!important;background:#fff4c7!important;border-color:#c8a72f!important}body[data-theme="light"] .status-red{color:#8c1f28!important;background:#ffe2e5!important;border-color:#d76c75!important}
body[data-theme="light"] .footer,body[data-theme="light"] .md-subtitle,body[data-theme="light"] .ux-meta{color:#526c78!important}
#globalThemeToggle{position:fixed;right:22px;bottom:22px;top:auto;z-index:2000;width:auto;min-width:108px;min-height:42px;padding:8px 14px;border-radius:999px;border:1px solid #267ca5;background:#071d2d;color:#eef8ff;font-weight:800;box-shadow:0 10px 28px rgba(0,0,0,.28);cursor:pointer}body[data-theme="light"] #globalThemeToggle{position:fixed;right:22px;bottom:22px;top:auto;z-index:2000;width:auto;min-width:108px;min-height:42px;padding:8px 14px;border-radius:999px;border:1px solid #267ca5;background:#071d2d;color:#eef8ff;font-weight:800;box-shadow:0 10px 28px rgba(0,0,0,.28);cursor:pointer}@media(max-width:700px){#globalThemeToggle{right:12px;bottom:calc(12px + env(safe-area-inset-bottom));top:auto;min-width:92px;font-size:12px}}
#globalThemeToggle{position:fixed!important;top:auto!important;right:24px!important;bottom:24px!important;left:auto!important;transform:none!important;z-index:2147483000!important}
@media(max-width:700px){#globalThemeToggle{top:auto!important;right:12px!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;left:auto!important}}

/* Login pages: keep authentication/admin links unobstructed */
body:has(input[type=password]) #globalThemeToggle{right:24px!important;bottom:78px!important}
@media(max-width:700px){body:has(input[type=password]) #globalThemeToggle{right:12px!important;bottom:86px!important}}
