/* Phase 4: compact header on phones, readable inputs, touch targets.
   Loaded last; layout only, no colours (colours come from branding variables). */
@media (max-width:600px){
 #active-workspace.notice{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 10px;padding:8px 12px;margin:0;font-size:14px;line-height:1.4;border-radius:0}
 #active-workspace.notice>*{margin:0}
 #workspace-switch-controls{margin:0!important;padding:0}
 #workspace-switch-controls button{min-height:40px;padding:4px 12px;font-size:14px}
 .portal-header.header-organized{padding:8px 12px!important;gap:8px!important;display:flex!important;flex-direction:column!important;align-items:stretch!important}
 .portal-header .portal-brand{gap:8px;min-height:0;order:-1!important}
 .portal-header .portal-controls{order:1!important}
 .portal-brand img{width:34px!important;height:34px!important}
 .portal-brand span{font-size:16px;line-height:1.3}
 .portal-brand small{display:none}
 .portal-controls,#ux-bar,#ux-bar>div:first-child,#header-account-row{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:center;gap:6px!important;margin:0!important;width:auto!important}
 .portal-controls button,.portal-controls a.button,#ux-bar button,#header-account-row button,#header-account-row a{min-height:44px!important;height:auto!important;padding:6px 12px!important;font-size:14px!important;white-space:nowrap;flex:0 0 auto!important;width:auto!important;margin:0!important}
 #ux-bell{display:inline-flex;align-items:center;gap:4px}
 #unit-facility-picker{display:flex!important;align-items:center;gap:8px;padding:8px 12px!important;margin:8px 0!important;font-size:14px}
 #unit-facility-picker select{flex:1;min-width:0}
 .portal-main{padding-top:8px}
 /* iOS zooms into fields with text smaller than 16px */
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important}
}
@media (pointer:coarse){
 button,[role=button],a.button,select{min-height:44px}
 input[type=checkbox],input[type=radio]{min-width:22px;min-height:22px}
}
#offline-banner{position:fixed;inset-inline:0;bottom:0;z-index:9999;background:#7a1f1f;color:#fff;padding:10px 14px calc(10px + env(safe-area-inset-bottom));text-align:center;font-size:15px;box-shadow:0 -2px 8px rgba(0,0,0,.2)}
#offline-banner[hidden]{display:none}
.empty-state{padding:16px;text-align:center;color:#4c5f63;border:1px dashed #bfd2dc;border-radius:10px;margin:12px 0}
/* Phase 4 — text contrast (WCAG AA 4.5:1). Same hues, slightly darker. */
:root{--muted:#53676a}
.portal-main footer{color:#5b6b64}
.section-copy p{color:#53676a}
.policy-compact .building-readiness-table .readiness-title th{background:#1f6f96;color:#fff}
/* iPhone notch/status bar: whatever sits first at the top gets the safe-area inset. */
#app>#active-workspace.notice:first-child{padding-top:max(8px,env(safe-area-inset-top,0px))}
@media (max-width:600px){
 .portal-header.header-organized{padding-top:max(8px,env(safe-area-inset-top,0px))!important}
 #app>#active-workspace:first-child+.portal-shell .portal-header.header-organized{padding-top:8px!important}
}
/* Login / applicant pages: the language bar sits first in <body>; keep it below the iPhone status bar. */
body>#ux-bar.ux-guest{padding-top:max(10px,env(safe-area-inset-top,0px))}
body>#ux-bar.ux-guest~#app>#active-workspace.notice:first-child{padding-top:8px}
/* iPhone status bar area: a dark strip so the white clock / signal / battery stay readable on every page. */
body::before{content:"";position:fixed;top:0;left:0;right:0;height:env(safe-area-inset-top,0px);background:#0d3b66;z-index:2147483000;pointer-events:none}
