/* xFi Trading Hub 0.5.40: Mobile UX refinements only */
@media(max-width:560px){
  html,body.terminal-body{width:100%!important;max-width:100vw!important;overflow-x:clip!important;-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important}
  body.terminal-body button,body.terminal-body a,body.terminal-body input,body.terminal-body select,body.terminal-body textarea{touch-action:manipulation}
  /* iOS zooms the entire viewport when a focused input has computed font-size below 16px. */
  body.terminal-body input:not([type=checkbox]):not([type=radio]),body.terminal-body select,body.terminal-body textarea{font-size:16px!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  body.terminal-body .xfi-v2-search input,body.terminal-body .xfi-browser-search input,body.terminal-body .xfi-history-symbol-filter select,body.terminal-body .watch-search input{font-size:16px!important}
  body.terminal-body .terminal-layout,body.terminal-body .chart-workspace,body.terminal-body .watch-panel,body.terminal-body .xfi-mobile-trade,body.terminal-body .xfi-native-settings,body.terminal-body .xfi-native-browser{min-width:0!important;max-width:100vw!important;box-sizing:border-box!important}
  /* One-click mode is always enabled on mobile: hide redundant desktop preference. */
  body.terminal-body .xfi-trading-settings{display:none!important}
  /* Clean funding rows: concise labels, no redundant descriptions. */
  body.terminal-body .xfi-funding-settings .xfi-funding-row{min-height:54px!important;max-height:58px!important;padding:3px 0!important}
  body.terminal-body .xfi-funding-settings .xfi-funding-row>a{font-size:16px!important;line-height:1.2!important}
  body.terminal-body .xfi-funding-settings .xfi-funding-row>a>span small{display:none!important}
  body.terminal-body .xfi-settings-group:not(.xfi-chart-level-preferences){margin-bottom:12px!important}
  /* History date chooser: compact native-sheet styling, no unnecessary tall rows. */
  .xfi-history-filter-sheet>section{width:100%!important;max-width:100vw!important;box-sizing:border-box!important;overflow-y:auto!important;overflow-x:hidden!important;padding:calc(10px + env(safe-area-inset-top,0px)) 15px calc(92px + env(safe-area-inset-bottom,0px))!important}
  .xfi-history-filter-sheet header{margin-bottom:12px!important;min-height:42px!important}
  .xfi-history-filter-sheet header h2{font-size:18px!important}
  .xfi-history-symbol-filter{height:46px!important;min-height:46px!important;padding:0 13px!important;margin-bottom:12px!important;font-size:15px!important;border-radius:12px!important}
  .xfi-history-period-list{border-radius:13px!important}
  .xfi-history-period-list button{min-height:0!important;height:46px!important;padding:0 14px!important;font-size:15px!important;line-height:1.2!important}
  .xfi-history-period-list i{font-size:17px!important}
  .xfi-history-custom-range{margin:9px 0!important;gap:8px!important}
  .xfi-history-custom-range input{height:44px!important;font-size:16px!important}
  .xfi-history-apply{height:44px!important;margin-top:10px!important}
  .xfi-history-report{min-height:53px!important;margin-top:10px!important;padding:8px 12px!important}
  /* Higher-specificity hidden rule: original grid styling could expose both date sections. */
  .xfi-history-filter-sheet [hidden],.xfi-history-custom-range[hidden]{display:none!important}
  /* Mobile quote search must never force the page wider than its viewport. */
  body.terminal-body .xfi-browser-search,body.terminal-body .xfi-v2-search,body.terminal-body .watch-search{max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
}

.xfi-market-closed-badge{display:inline-flex!important;align-items:center;margin:0 8px 0 0;padding:3px 8px;border:1px solid #9b6436;border-radius:6px;background:#312014;color:#ffd09a;font:700 11px system-ui;white-space:nowrap}
.xfi-market-closed-badge[hidden]{display:none!important}
