/* Insets on Web/PWA. Android consumes native insets around the entire WebView. */
:root{--life-safe-top:env(safe-area-inset-top,0px);--life-safe-left:env(safe-area-inset-left,0px);--life-safe-right:env(safe-area-inset-right,0px);--life-safe-bottom:env(safe-area-inset-bottom,0px);--life-mobile-header:56px;--life-mobile-top-space:8px}
@media(max-width:820px){
 html body.life-ui #topbar,body.lifeos-mobile #topbar{position:relative!important;top:auto!important;box-sizing:border-box;height:calc(var(--life-mobile-header) + var(--life-safe-top) + var(--life-mobile-top-space))!important;min-height:calc(var(--life-mobile-header) + var(--life-safe-top) + var(--life-mobile-top-space))!important;flex:0 0 calc(var(--life-mobile-header) + var(--life-safe-top) + var(--life-mobile-top-space))!important;padding:calc(var(--life-safe-top) + var(--life-mobile-top-space)) max(12px,var(--life-safe-right)) 0 max(12px,var(--life-safe-left))!important}
 html body.life-ui #content,body.lifeos-mobile #content{min-height:0;flex:1 1 auto}
 html body.life-ui #sidebar,body.lifeos-mobile #sidebar{padding-top:calc(20px + var(--life-safe-top))!important;padding-left:max(12px,var(--life-safe-left))!important;padding-right:max(12px,var(--life-safe-right))!important;padding-bottom:calc(20px + var(--life-safe-bottom))!important}
 html body.life-ui #mobiletab,html body.life-ui.lifeos-mobile #mobiletab{bottom:calc(8px + var(--life-safe-bottom))!important;left:calc(8px + var(--life-safe-left))!important;right:calc(8px + var(--life-safe-right))!important}
}
/* The sign-in gate is also light on first entry, including a saved dark theme. */
html[data-lifeos-startup="auth"] body #auth-gate{background:#f6f7fa!important;color:#303844!important;--bg:#f6f7fa;--bg-elevated:#fff;--bg-elevated-2:#f7f8fa;--bg-hover:#edf1f5;--text:#303844;--text-dim:#64707e;--text-faint:#64707e;--border:#dce2e9;--border-soft:#e4e8ee;--life-canvas:#f6f7fa;--life-surface:#fff;--life-ink:#303844;--life-muted:#64707e;--life-tertiary:#64707e;--life-line:#dce2e9;--life-line-soft:#e4e8ee;--life-hover:#edf1f5;color-scheme:light;padding:calc(24px + var(--life-safe-top)) max(16px,var(--life-safe-right)) calc(24px + var(--life-safe-bottom)) max(16px,var(--life-safe-left))!important}
html[data-lifeos-startup="auth"] body #auth-gate .auth-card{background:#fff!important;border-color:#e4e8ee!important;box-shadow:0 20px 60px -40px rgba(66,93,117,.3);color:#303844!important}
html[data-lifeos-startup="auth"] body #auth-gate :is(h1,.brand-name){color:#303844!important}
html[data-lifeos-startup="auth"] body #auth-gate :is(.auth-sub,.auth-status,.field label){color:#64707e!important}
html[data-lifeos-startup="auth"] #auth-gate :is(input,select){background:#f7f8fa!important;color:#303844!important;border-color:#dce2e9!important}
html[data-lifeos-startup="auth"] body #auth-gate :is(.btn-primary,.btn.primary){background:#425d70!important;color:#fff!important}
html[data-lifeos-startup="auth"] body #auth-gate .auth-status.err{color:#a63d4a!important}
html[data-lifeos-startup="auth"] body #auth-gate .auth-status.ok{color:#286b52!important}
