:root { color-scheme: dark; }
body > .theme-tools {
    display: flex;
    justify-content: flex-end;
    padding: max(12px, env(safe-area-inset-top, 0px)) 16px 0;
    margin-bottom: 10px;
}
body:has(#loginBtn) > .theme-tools { position: absolute; top: 0; right: 0; }
body:has(#loginBtn) { padding-top: max(66px, calc(env(safe-area-inset-top, 0px) + 54px)); }
#themeCycle {
    width: auto; min-height: 34px; margin: 0; padding: 5px 12px;
    border: 1px solid #66758a66; border-radius: 9px;
    background: #243047; color: #eef3ff; font: 600 13px system-ui, sans-serif; cursor: pointer;
}
#themeCycle:focus-visible { outline: 2px solid #8171ef; outline-offset: 3px; }
:root[data-theme="light"] {
    color-scheme: light; color: #172236; background: #edf2fa;
    --theme-panel: #fff; --theme-field: #eef2f8; --theme-line: #d3deec;
}
[data-theme="light"] body { background: #edf2fa; color: #172236; }
[data-theme="light"] :is(.card,.glass-effect,.glass-effect-strong,.record-card,.request-record-layout,nav) {
    background: var(--theme-panel); color: #172236; border-color: var(--theme-line);
}
[data-theme="light"] :is(.bg-dark-lighter,[class*="bg-dark-lighter/"],input,textarea,select,.destination-buttons button:not([aria-pressed="true"])) {
    background: var(--theme-field); color: #172236; border-color: var(--theme-line);
}
[data-theme="light"] :is(.text-gray-100,.text-gray-200,.text-gray-300) { color: #27344a; }
[data-theme="light"] :is(.text-gray-400,.text-gray-500,label,.status) { color: #506179; }
[data-theme="light"] :is(input,textarea)::placeholder { color: #65748a; }
[data-theme="light"] :is([class*="border-white/"],.request-read-button) { border-color: var(--theme-line); }
[data-theme="light"] .request-read-button { color: #4834a6; }
[data-theme="light"] #themeCycle { background: #fff; color: #2f2468; border-color: var(--theme-line); }
[data-theme="light"] .viewport-notice { background: #fff; color: #172236; border-color: var(--theme-line); }

