/* APEX Mobile UI v1.2 — app-style presentation, no changes to strategy/execution. */
#nv-root .apex-mobile-top,#nv-root .apex-mobile-bottom,#nv-root .apex-mobile-backdrop,#nv-root .apex-drawer-header,#nv-root .apex-drawer-controls{display:none}
@media (max-width:960px){
  html{overflow-x:hidden;scroll-padding-top:72px}
  body{min-width:0;margin:0!important;overflow-x:hidden}
  #nv-root{display:block!important;min-width:0;width:100%;overflow:clip}
  #nv-root .nv-side{
    position:fixed!important;top:0!important;left:0!important;right:auto!important;bottom:0!important;
    transform:translateX(-103%);transition:transform .22s ease!important;
    width:min(84vw,350px)!important;min-width:0!important;max-width:350px!important;
    height:100dvh!important;max-height:100dvh!important;padding:14px 14px max(20px,env(safe-area-inset-bottom))!important;
    z-index:103!important;box-shadow:14px 0 70px #0009!important;overflow-y:auto!important;
    flex-direction:column!important;display:flex!important;align-items:stretch!important;
    border:0!important;border-right:1px solid #354766!important;
  }
  body.apex-mobile-menu-open #nv-root .nv-side{transform:translateX(0)}
  #nv-root .nv-logo{margin:5px 0 10px!important;font-size:22px!important}
  #nv-root .nv-nav{display:flex!important;flex-direction:column!important;gap:3px!important;width:100%!important;max-width:none!important;overflow:visible!important;height:auto!important;max-height:none!important;padding:5px 0!important;flex:1!important}
  #nv-root .nv-nav button{width:100%!important;min-width:0!important;max-width:none!important;min-height:48px!important;padding:12px 13px!important;text-align:left!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:11px!important;font-size:14px!important;font-weight:650!important;white-space:normal!important;flex-shrink:0!important;border-radius:12px!important}
  #nv-root .nv-nav button span{font-size:19px!important;line-height:1!important}
  #nv-root .nv-sidefoot{display:none!important}
  #nv-root .apex-drawer-header{display:flex;justify-content:space-between;align-items:center;gap:12px;color:#d5dff3;font-size:11px;letter-spacing:.08em;font-weight:700;padding:7px 0}
  #nv-root .apex-drawer-controls{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px;padding:13px 0;border-top:1px solid #354662;margin-top:10px}
  #nv-root .apex-drawer-controls button{background:#1e2b47;border:1px solid #344565;border-radius:11px;color:#e5ecff;padding:11px 6px;font-size:12px;font-weight:700;min-height:44px}
  #nv-root .apex-drawer-controls button.apex-m-start{background:#275d52;border-color:#2d7c6b;color:#d0fff0}
  #nv-root .apex-drawer-controls button.apex-m-stop{background:#4a2c43;border-color:#74405a;color:#ffcfdb}
  #nv-root .apex-mobile-backdrop{position:fixed;inset:0;z-index:102;display:none;border:0;border-radius:0;background:#050918bb;backdrop-filter:blur(3px)}
  body.apex-mobile-menu-open #nv-root .apex-mobile-backdrop{display:block}
  body.apex-mobile-menu-open{overflow:hidden}
  #nv-root .apex-mobile-top{display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:98;
     padding:calc(9px + env(safe-area-inset-top)) 14px 10px;background:#101a2ef5;border-bottom:1px solid #2c3c5a;
     min-height:calc(64px + env(safe-area-inset-top));box-shadow:0 8px 22px #02071538;backdrop-filter:blur(16px)}
  #nv-root .apex-icon-btn{display:grid;place-items:center;flex:none;border:1px solid #354766;background:#1d2b45;color:#e7edff;border-radius:12px;min-width:44px;min-height:44px;padding:8px}
  #nv-root .apex-icon-btn svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round}
  #nv-root .apex-mobile-brand{display:flex;align-items:center;min-width:0;flex:1;gap:9px}
  #nv-root .apex-mobile-logo{display:grid;place-items:center;flex:none;font-size:22px;font-weight:850;width:35px;height:35px;border-radius:11px;background:linear-gradient(130deg,#38bafc,#7752ee);color:white}
  #nv-root .apex-mobile-brand strong{display:block;font-size:13px;font-weight:850;letter-spacing:.03em;color:#f3f5ff;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #nv-root .apex-mobile-brand small{display:block;font-size:11px;color:#acbad6;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
  #nv-root .apex-mobile-spot{font-size:10px;color:#8ce6ce;border:1px solid #2f675b;background:#18382f;border-radius:9px;padding:6px 7px;white-space:nowrap}
  #nv-root .nv-main{width:100%!important;min-width:0!important;max-width:100%!important;margin:0!important;
    padding:14px 12px calc(94px + env(safe-area-inset-bottom))!important}
  #nv-root .nv-header{position:static!important;height:auto!important;display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:center!important;margin-bottom:15px!important}
  #nv-root .nv-headtitle{min-width:0;flex:1 1 100%}
  #nv-root .nv-headtitle h1{font-size:21px!important;line-height:1.2}
  #nv-root .nv-headtitle p{line-height:1.45;font-size:11px;max-width:100%;white-space:normal}
  #nv-root .nv-actions{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;width:100%;gap:7px!important}
  #nv-root .nv-actions .nv-search{flex:1 1 100%!important;width:100%!important;max-width:none!important;min-width:0}
  #nv-root .nv-actions .nv-pill{flex:0 1 auto;font-size:11px;max-width:100%;white-space:normal}
  #nv-root .nv-cards,#nv-root .nv-cards.nv-topcards{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  #nv-root .nv-cards>.nv-card{grid-column:auto!important;min-width:0!important;min-height:100px;padding:12px!important}
  #nv-root .nv-cards>.nv-card.nv-hero{grid-column:1/-1!important;min-height:122px}
  #nv-root .nv-card .nv-value{font-size:18px!important;overflow-wrap:anywhere;line-height:1.18}
  #nv-root .nv-grid,#nv-root .nv-grid.two,#nv-root .nv-grid.three,#nv-root .nv-grid.four,#nv-root .nv-grid.half,#nv-root .nv-settingsgrid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
  #nv-root .nv-panel{padding:13px!important;min-width:0;width:100%;overflow:hidden}
  #nv-root .nv-panel header{display:flex;flex-wrap:wrap;gap:6px}
  #nv-root .nv-panel h2{font-size:14px!important;overflow-wrap:anywhere}
  #nv-root .nv-scroll,.table-viewport{width:100%;max-width:100%;overflow-x:auto!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;border-radius:10px;scrollbar-width:thin}
  #nv-root .nv-scroll table,#nv-root table{max-width:none;min-width:590px}
  #nv-root .nv-scroll:has(table){position:relative}
  #nv-root .nv-chartwrapper,#nv-root svg,#nv-root canvas{max-width:100%;min-width:0}
  #nv-root .nv-fusion-banner{padding:17px!important;border-radius:17px}
  #nv-root .nv-fusion-banner h2{font-size:23px!important;line-height:1.14}
  #nv-root .nv-fusion-banner:after{font-size:170px;top:-48px}
  #nv-root .nv-flowchips{gap:4px;flex-wrap:wrap}
  #nv-root .nv-trading-controls{padding:12px!important}
  #nv-root .nv-controltabs,#nv-root .nv-flex,#nv-root .nv-controls{flex-wrap:wrap!important;gap:7px}
  #nv-root input,#nv-root select,#nv-root textarea,#login input{font-size:16px!important;max-width:100%;min-width:0}
  #nv-root input[type="checkbox"],#nv-root input[type="radio"]{min-width:auto}
  #nv-root button,#nv-root .btn,#login button{touch-action:manipulation}
  #nv-root .nv-button,#nv-root .nv-controls button,#nv-root .nv-controltabs button{min-height:44px}
  #nv-root .nv-bottom-avoid{margin-bottom:65px}
  #nv-root .apex-mobile-bottom{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;z-index:99;
      background:#111b2fee;backdrop-filter:blur(16px);border-top:1px solid #30405c;
      box-shadow:0 -9px 26px #03071355;padding:7px 5px calc(6px + env(safe-area-inset-bottom));gap:2px}
  #nv-root .apex-mobile-bottom button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
      min-width:0;min-height:53px;color:#acb9d4;background:transparent;border:0;border-radius:12px;
      padding:5px 1px;font-size:10px;font-weight:700;touch-action:manipulation}
  #nv-root .apex-mobile-bottom button svg{stroke:currentColor;fill:none;stroke-width:2;width:21px;height:21px}
  #nv-root .apex-mobile-bottom button.active{color:#cbbaff;background:#292549}
  #nv-root .apex-mobile-bottom button:focus-visible,#nv-root .apex-icon-btn:focus-visible,#nv-root .nv-nav button:focus-visible{outline:2px solid #b59dff;outline-offset:2px}
  #login.auth{display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:center!important;justify-items:center!important;min-height:100dvh!important;padding:calc(20px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom))!important}
  #login .authbox{width:100%!important;max-width:430px!important;min-width:0!important;padding:25px 19px!important;border-radius:20px!important}
  #login .auth-hero{display:none!important}
  #nv-root .nv-footer{padding:12px 0;font-size:10px;overflow-wrap:anywhere}
}
@media (max-width:370px){
  #nv-root .nv-main{padding-left:9px!important;padding-right:9px!important}
  #nv-root .nv-cards,#nv-root .nv-cards.nv-topcards{gap:7px!important}
  #nv-root .nv-cards>.nv-card{padding:10px!important}
  #nv-root .nv-card .nv-value{font-size:16px!important}
  #nv-root .apex-mobile-bottom button{font-size:9px!important}
  #nv-root .apex-mobile-spot{display:none}
}
@media (prefers-reduced-motion:reduce){#nv-root .nv-side{transition:none!important}}

/* v1.9 mobile auth: hide successfully completed full-screen login. */
html body #login.auth[hidden]{display:none!important;visibility:hidden!important;pointer-events:none!important}
