/* ER NEXUS PWA • accessible mobile and desktop layer */
:root{--nx-safe-top:env(safe-area-inset-top,0px);--nx-safe-bottom:env(safe-area-inset-bottom,0px)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;overscroll-behavior-y:none}
body.er-nexus-theme{min-width:320px}
.ernexus-app{min-height:100vh;min-height:100dvh}
.ernexus-main,.ernexus-topbar-v2,.ernexus-top-actions,.ernexus-workspace-title,
.ernexus-command-grid,.ernexus-panel,.ernexus-record-table-wrap{min-width:0}
.ernexus-app button:focus-visible,.ernexus-app a:focus-visible,.ernexus-pwa-sheet button:focus-visible{
  outline:2px solid #ffd879;outline-offset:3px}
.ernexus-install{min-width:42px;min-height:42px;align-items:center;justify-content:center}
.ernexus-install[hidden]{display:none!important}
.ernexus-pwa-sheet[hidden],.ernexus-pwa-update[hidden],.ernexus-pwa-network[hidden]{display:none!important}
.ernexus-pwa-sheet{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;
  padding:calc(16px + var(--nx-safe-top)) 16px calc(16px + var(--nx-safe-bottom));
  background:rgba(1,5,11,.78);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.ernexus-pwa-card{position:relative;width:min(100%,440px);max-height:calc(100dvh - 40px);
  overflow-y:auto;overscroll-behavior:contain;background:linear-gradient(145deg,#142236,#0a1423);
  color:#f4f8ff;border:1px solid rgba(246,183,60,.22);border-radius:24px;
  padding:clamp(22px,5vw,32px);box-shadow:0 30px 100px #0008}
.ernexus-pwa-brand{display:flex;align-items:center;gap:13px;color:#e2ebf8;font-weight:900;
  font-size:13px;letter-spacing:.14em}
.ernexus-pwa-brand img{width:50px;height:50px;object-fit:contain;border-radius:13px}
.ernexus-pwa-kicker{display:block;margin-top:25px;color:#f6b73c;font-size:11px;
  letter-spacing:.13em;font-weight:900;text-transform:uppercase}
.ernexus-pwa-card h2{margin:9px 0 10px;font-size:clamp(23px,5vw,29px);line-height:1.16}
.ernexus-pwa-card p,.ernexus-pwa-card li{color:#b2bfd1;font-size:14px;line-height:1.65}
.ernexus-pwa-card ol{margin:16px 0 20px;padding-left:22px}
.ernexus-pwa-card li+li{margin-top:8px}
.ernexus-pwa-close{position:absolute;top:15px;right:15px;display:grid;place-items:center;
  width:40px;height:40px;border:1px solid #334257;background:#121d2d;color:#c4d1e2;
  border-radius:12px;font-size:23px;cursor:pointer}
.ernexus-pwa-card .ernexus-pwa-confirm{display:block;width:100%;min-height:48px;
  border:0;border-radius:12px;background:linear-gradient(130deg,#f6b73c,#ffdf91);
  color:#081421;font-size:14px;font-weight:900;cursor:pointer}
.ernexus-pwa-card small{display:block;margin-top:13px;color:#76889e;font-size:11px}
.ernexus-pwa-update,.ernexus-pwa-network{position:fixed;z-index:9000;right:calc(16px + env(safe-area-inset-right,0px));
  bottom:calc(18px + var(--nx-safe-bottom));max-width:min(420px,calc(100vw - 32px));
  display:flex;align-items:center;gap:11px;padding:14px 15px;border:1px solid #304158;
  border-radius:16px;background:#0e1b2c;color:#eef4fc;box-shadow:0 22px 55px #0007;
  font:600 13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.ernexus-pwa-network{border-color:#604d2a;bottom:calc(20px + var(--nx-safe-bottom))}
.ernexus-pwa-update strong{display:block;font-size:13px}
.ernexus-pwa-update p{margin:3px 0 0;color:#95a8c0;font-size:11px;line-height:1.4}
.ernexus-pwa-update button{min-height:40px;flex:none;border:0;border-radius:9px;
  padding:8px 11px;color:#071522;background:#f6b73c;font-weight:900;cursor:pointer}
.ernexus-pwa-update button[data-pwa-later]{background:#1d2e43;color:#d5e1f0}
@media(max-width:1100px){
  .ernexus-app .ernexus-main{padding-bottom:calc(96px + var(--nx-safe-bottom))!important}
  .ernexus-app .ernexus-mobile-dock{bottom:calc(10px + var(--nx-safe-bottom))!important;
    left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right))}
  .ernexus-app .ernexus-sidebar{padding-top:var(--nx-safe-top)}
  .ernexus-app .ernexus-topbar-v2{height:auto!important;min-height:64px;
    padding-top:var(--nx-safe-top)!important;padding-left:max(12px,env(safe-area-inset-left));
    padding-right:max(12px,env(safe-area-inset-right))}
  .ernexus-app .ernexus-mobile-menu,.ernexus-app .ernexus-command,
  .ernexus-app .ernexus-install,.ernexus-app .ernexus-notification-button{
    min-width:42px!important;min-height:42px!important}
  .ernexus-app .ernexus-topbar .ernexus-install:not([hidden]){display:flex!important}
  .ernexus-app .ernexus-record-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media(max-width:620px){
  .ernexus-app .ernexus-topbar-v2{gap:6px;min-height:66px}
  .ernexus-app .ernexus-topbar-left{gap:7px;flex:1 1 auto}
  .ernexus-app .ernexus-top-actions{gap:4px;flex:0 0 auto}
  .ernexus-app .ernexus-workspace-title h1{font-size:clamp(12px,3vw,15px)!important}
  .ernexus-app .ernexus-install{width:42px;padding:0}
  .ernexus-app .ernexus-install b{display:none!important}
  .ernexus-app input:not([type=checkbox]):not([type=radio]),
  .ernexus-app select,.ernexus-app textarea{font-size:max(16px,1rem)!important}
  .ernexus-app .ernexus-command-grid{grid-template-columns:minmax(0,1fr)}
  .ernexus-app .ernexus-record-inspector{overflow-wrap:anywhere}
  .ernexus-app .ernexus-panel-head h3{font-size:13px}
  .ernexus-app .ernexus-action-item b,.ernexus-app .ernexus-readiness-row b{font-size:12px}
  .ernexus-app .ernexus-action-item p,.ernexus-app .ernexus-readiness-row small{font-size:11px}
  .ernexus-app .ernexus-kpis-v2 article>div span{font-size:11px}
  .ernexus-app .ernexus-kpis-v2 article>strong{font-size:clamp(20px,5vw,27px)}
  .ernexus-pwa-update{left:12px;right:12px;max-width:none;flex-wrap:wrap}
  .ernexus-pwa-update>div{flex:1 1 100%}
}
@media(max-width:380px){
  .ernexus-app .ernexus-breadcrumb{display:none}
  .ernexus-app .ernexus-top-actions{gap:2px}
  .ernexus-app .ernexus-notification-button{display:none}
  .ernexus-app .ernexus-install:not([hidden]){display:flex!important}
}
@media(orientation:landscape) and (max-height:480px){
  .ernexus-pwa-sheet{place-items:start center;overflow:auto}
  .ernexus-pwa-card{max-height:none}
  .ernexus-app .ernexus-mobile-dock{padding:3px}
}
@media(min-width:1600px){
  .ernexus-app .ernexus-main{max-width:none}
  .ernexus-app .ernexus-mission-v2{max-width:1850px;margin:0 auto}
}
@media(prefers-reduced-motion:reduce){
  .ernexus-pwa-sheet *,.ernexus-app .ernexus-sidebar{scroll-behavior:auto!important;
    transition:none!important;animation:none!important}
}

/* Multi-user account switcher: visible and touch-accessible on every screen. */
.ernexus-account{position:relative;z-index:70;flex:none}
.ernexus-account .ernexus-user{min-width:42px;min-height:42px;cursor:pointer}
.ernexus-account .ernexus-user[aria-expanded="true"]{
  border-color:rgba(246,183,60,.6);background:#17263a}
.ernexus-account-menu[hidden]{display:none!important}
.ernexus-account-menu{
  position:absolute;right:0;top:calc(100% + 11px);
  width:min(325px,calc(100vw - 24px));max-height:min(480px,calc(100dvh - 100px));
  overflow-y:auto;overscroll-behavior:contain;z-index:1000;
  padding:11px;border:1px solid rgba(246,183,60,.22);border-radius:16px;
  background:linear-gradient(160deg,#162438,#0b1421);
  box-shadow:0 25px 80px rgba(0,0,0,.68);color:#f3f7ff;
}
.ernexus-account-identity{display:flex;flex-direction:column;gap:5px;
  padding:12px 12px 15px;border-bottom:1px solid rgba(148,163,184,.16);
  overflow-wrap:anywhere}
.ernexus-account-identity strong{font-size:14px;line-height:1.4}
.ernexus-account-identity small{font-size:12px;color:#a3b5ca}
.ernexus-account-identity span{display:inline-flex;align-self:start;
  padding:4px 8px;border-radius:99px;border:1px solid rgba(246,183,60,.22);
  background:rgba(246,183,60,.07);color:#f6cf7c;font-size:11px;font-weight:700}
.ernexus-account-logout{display:flex;align-items:center;gap:11px;
  min-height:48px;margin-top:11px;padding:10px 12px;
  color:#f8f0e5!important;background:rgba(246,183,60,.07);
  border:1px solid rgba(246,183,60,.18);border-radius:11px;
  text-decoration:none!important;font-size:13px;font-weight:800;line-height:1.4}
.ernexus-account-logout:hover,.ernexus-account-logout:focus-visible{
  background:rgba(246,183,60,.15);border-color:#f6b73c}
.ernexus-account-logout span{font-size:21px;color:#f6b73c}
.ernexus-account-hint{display:block;margin:12px 4px 3px;color:#8597af;
  font-size:11px;line-height:1.5}
@media(max-width:620px){
  .ernexus-app .ernexus-account .ernexus-user{display:flex!important;
    justify-content:center;padding:5px!important;width:44px!important;height:44px!important}
  .ernexus-app .ernexus-account .ernexus-user>span{width:32px;height:32px}
  .ernexus-app .ernexus-account .ernexus-user>b{display:none!important}
  .ernexus-account-menu{position:fixed;right:max(10px,env(safe-area-inset-right));
    left:max(10px,env(safe-area-inset-left));top:calc(67px + env(safe-area-inset-top));
    width:auto;max-height:calc(100dvh - 100px - env(safe-area-inset-bottom));z-index:1100}
}
@media(max-width:390px){
  .ernexus-app .ernexus-topbar .ernexus-account .ernexus-user{display:flex!important}
}

.ernexus-login-switch-help{margin:16px 0 8px!important;font-size:12px!important;line-height:1.55!important;color:#b5c2d3!important}
