/* Vortex Manager v49 — mobile web layout + compact PWA navigation */
:root{
  --vortex-safe-top: env(safe-area-inset-top, 0px);
  --vortex-safe-right: env(safe-area-inset-right, 0px);
  --vortex-safe-bottom: env(safe-area-inset-bottom, 0px);
  --vortex-safe-left: env(safe-area-inset-left, 0px);
}
html,body,#root{width:100%;max-width:100%;min-width:0;}
html{background:#050913;-webkit-text-size-adjust:100%;text-size-adjust:100%;}
body{margin:0;background:#050913;overflow-x:hidden;}
#root{min-width:0;}

/* Safari's changing top/bottom bars used to leave the Expo root at the wrong height.
   Dynamic viewport units keep browser mode and installed-app mode aligned to the visible screen. */
@media(max-width:700px){
  html,body,#root{height:100dvh!important;min-height:100dvh!important;max-height:100dvh!important;}
  body{overflow:hidden!important;}
  #root{display:flex!important;min-width:0!important;}
  #root>div{min-width:0!important;max-width:100%!important;}
}

@media (display-mode:standalone){
  html,body{overscroll-behavior:none;}
  body{user-select:none;-webkit-user-select:none;}
  input,textarea,[contenteditable="true"]{user-select:text;-webkit-user-select:text;}
  a,button,[role="button"]{-webkit-touch-callout:none;}
}

/* Compact bottom tab bar. Safe area moves the bar UP instead of inflating its height. */
@media(max-width:700px){
  .vortex-bottom-nav{
    height:60px!important;
    min-height:60px!important;
    max-height:60px!important;
    padding-top:4px!important;
    padding-bottom:4px!important;
    margin-left:8px!important;
    margin-right:8px!important;
    margin-bottom:0!important;
    border-radius:18px!important;
    box-sizing:border-box!important;
  }
  body:not(.vortex-standalone) .vortex-bottom-nav{bottom:6px!important;}
  body.vortex-standalone .vortex-bottom-nav{bottom:max(5px,var(--vortex-safe-bottom))!important;}
  .vortex-bottom-nav [role="tab"]{min-height:48px!important;}
  [aria-label="Open quick menu"]{
    width:50px!important;height:50px!important;border-radius:17px!important;
    bottom:calc(78px + var(--vortex-safe-bottom))!important;
  }
}

.vortex-pwa-badge{position:absolute;z-index:99;display:flex;align-items:center;justify-content:center;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:#ff3b30;color:#fff;font:700 10px/17px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 0 0 2px #07101d,0 4px 12px rgba(255,59,48,.28);pointer-events:none;top:-4px;right:-7px;}
.vortex-nav-badge-host{position:relative!important;overflow:visible!important;}

/* Keep the install helper out of the actual app screens. On the landing/login pages it is compact. */
.vortex-pwa-install{position:fixed;left:max(12px,var(--vortex-safe-left));right:max(12px,var(--vortex-safe-right));bottom:calc(12px + var(--vortex-safe-bottom));z-index:2147483000;background:linear-gradient(145deg,rgba(13,29,54,.98),rgba(5,12,25,.98));border:1px solid rgba(95,148,255,.38);border-radius:16px;box-shadow:0 18px 46px rgba(0,0,0,.5);padding:12px;color:#f5f8ff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);}
.vortex-pwa-install-head{display:flex;gap:10px;align-items:center}.vortex-pwa-install-icon{width:40px;height:40px;border-radius:11px;box-shadow:0 6px 18px rgba(31,107,255,.28)}.vortex-pwa-install-title{font-size:15px;font-weight:800}.vortex-pwa-install-copy{font-size:12px;line-height:1.35;color:#aabbd7;margin-top:1px}.vortex-pwa-install-actions{display:flex;gap:8px;margin-top:10px}.vortex-pwa-install button{border:0;border-radius:11px;padding:9px 12px;font-weight:800;font-size:12px;cursor:pointer}.vortex-pwa-install-primary{flex:1;background:linear-gradient(135deg,#2f7cff,#5ba0ff);color:#fff}.vortex-pwa-install-dismiss{background:#142139;color:#b8c8e6}.vortex-pwa-share{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:1px solid rgba(150,180,230,.35);border-radius:7px;color:#dbe8ff;font-size:14px;margin:0 2px;vertical-align:-2px}
.vortex-pwa-toast{position:fixed;z-index:2147482999;left:50%;transform:translateX(-50%);bottom:calc(72px + max(6px,var(--vortex-safe-bottom)));max-width:calc(100vw - 28px);padding:10px 14px;border-radius:999px;background:rgba(10,22,42,.96);border:1px solid rgba(92,143,244,.34);color:#eef5ff;font:700 12px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 14px 34px rgba(0,0,0,.42);backdrop-filter:blur(18px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.vortex-pwa-update{cursor:pointer;background:linear-gradient(135deg,rgba(28,83,188,.98),rgba(15,51,115,.98));}
