/* xFi Trading Hub v0.5.39 - final mobile safe area layout override.
   All prior mobile layouts and order/chart functions remain unchanged. */
@media(max-width:560px){
 html,body.terminal-body{overscroll-behavior:none!important}
 body.terminal-body .mobile-xfi-nav{
  display:grid!important;position:fixed!important;
  bottom:calc(var(--xfi-device-bottom,12px) + env(safe-area-inset-bottom,0px))!important;
  left:max(12px,env(safe-area-inset-left,0px))!important;
  right:max(12px,env(safe-area-inset-right,0px))!important;
  width:auto!important;min-width:0!important;max-width:none!important;
  height:68px!important;min-height:68px!important;max-height:68px!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  padding:5px!important;gap:0!important;
  border-radius:36px!important;z-index:150!important;
  box-sizing:border-box!important;transform:translateZ(0);
 }
 body.terminal-body .mobile-xfi-nav:has(>button[data-view="bots"]:not([hidden])){grid-template-columns:repeat(6,minmax(0,1fr))!important}
 body.terminal-body .mobile-xfi-nav>button{min-width:0!important;max-width:100%!important;width:100%!important;padding:3px 0!important;min-height:0!important;box-sizing:border-box!important;overflow:hidden!important;font-size:clamp(9px,2.75vw,11.5px)!important}
 body.terminal-body .mobile-xfi-nav>button>.xfi-mobile-nav-icon{width:26px!important;height:27px!important;flex-shrink:0!important;min-width:0!important}
 body.terminal-body .mobile-xfi-nav>button>.xfi-mobile-nav-icon svg{width:25px!important;height:25px!important}
 body.terminal-body .mobile-xfi-nav>button>span{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
 /* The quote, chart, trade, settings and history views must not hide behind the nav/system bar. */
 body.terminal-body.mobile-view-quotes .watch-panel{
  padding-bottom:calc(100px + var(--xfi-device-bottom,12px) + env(safe-area-inset-bottom,0px))!important;
  max-height:var(--xfi-visible-h,100dvh)!important;
 }
 body.terminal-body.mobile-view-trade .xfi-mobile-trade,
 body.terminal-body.mobile-view-trade .order-panel,
 body.terminal-body.mobile-view-history .chart-workspace,
 body.terminal-body.mobile-view-settings .xfi-native-settings,
 body.terminal-body.mobile-view-settings .terminal-layout{
  padding-bottom:calc(104px + var(--xfi-device-bottom,12px) + env(safe-area-inset-bottom,0px))!important;
 }
 body.terminal-body.mobile-view-chart .chart-workspace{
  height:var(--xfi-visible-h,100dvh)!important;
  padding-bottom:calc(88px + var(--xfi-device-bottom,12px) + env(safe-area-inset-bottom,0px))!important;
 }
 body.terminal-body .mobile-xfi-nav>button:focus-visible{outline:2px solid #73b7ff!important;outline-offset:-3px!important}
}
