/* V91.5.432: responsive layout authority. Presentation-only: no market calculations.
   Loaded after legacy inline responsive rules to eliminate tablet/phone conflicts. */
@media (hover:none) and (pointer:coarse) {
  /* One navigation system on touch devices, including landscape tablets. */
  #lf-app-root .tab-strip {display:none!important;}
  #lf-app-root .mobile-bottom-nav {
    display:flex!important;position:fixed!important;left:0!important;right:0!important;
    bottom:0!important;z-index:12000!important;
    min-height:58px!important;box-sizing:border-box!important;
    padding:4px max(6px,env(safe-area-inset-right,0px))
      max(5px,env(safe-area-inset-bottom,0px))
      max(6px,env(safe-area-inset-left,0px))!important;
    gap:0!important;overflow:hidden!important;
  }
  #lf-app-root .mobile-bottom-nav button{
    flex:1 1 0!important;min-width:0!important;min-height:48px!important;
    padding:4px 2px!important;touch-action:manipulation!important;
  }
  #lf-app-root .mobile-more-menu {
    position:fixed!important;bottom:calc(66px + env(safe-area-inset-bottom,0px))!important;
    z-index:11999!important;max-height:calc(100dvh - 130px - env(safe-area-inset-bottom,0px))!important;
    overflow-y:auto!important;overscroll-behavior:contain!important;
  }
  #lf-app-root .content-area.chart-mode{
    padding-bottom:calc(68px + env(safe-area-inset-bottom,0px))!important;
    box-sizing:border-box!important;min-height:0!important;overflow:hidden!important;
  }
  #lf-app-root .advanced-chart-panel-root{
    min-width:0!important;min-height:0!important;max-width:100%!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-gex-ribbon{
    max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;
    flex-wrap:nowrap!important;scrollbar-width:none!important;touch-action:pan-x!important;
    overscroll-behavior-x:contain!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-context284{min-width:0!important;max-width:100%!important;}
  #lf-app-root .advanced-chart-panel-root .lf-atlas-context-head284,
  #lf-app-root .advanced-chart-panel-root .lf-v301-context-actions,
  #lf-app-root .advanced-chart-panel-root .lf-atlas-levels284{
    min-width:0!important;max-width:100%!important;
    overflow-x:auto!important;overflow-y:hidden!important;
    scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-context-head284 > *,
  #lf-app-root .advanced-chart-panel-root .lf-v301-context-actions > *,
  #lf-app-root .advanced-chart-panel-root .lf-atlas-levels284 > *{flex-shrink:0!important;}
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane284{min-width:0!important;max-width:100%!important;}
  #lf-app-root .advanced-chart-panel-root .lf285-uw-alerts{
    min-width:0!important;max-width:100%!important;overflow-x:auto!important;
    overflow-y:auto!important;scrollbar-width:thin!important;
    overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane-head284{
    left:6px!important;right:6px!important;gap:5px!important;
    min-width:0!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane-head284 b{
    min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane-head284 span{
    min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane-head284 button{
    flex:0 0 auto!important;min-height:29px!important;touch-action:manipulation!important;
  }
}
/* True phone: two readable header rows, rather than one clipped strip.
   Bottom row scrolls; financial chart keeps the remaining flex area. */
@media (max-width:768px){
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header{
    display:flex!important;flex-flow:row wrap!important;align-items:center!important;
    align-content:flex-start!important;gap:4px 6px!important;
    height:auto!important;min-height:76px!important;max-height:116px!important;
    padding:5px 7px!important;overflow:visible!important;
    box-sizing:border-box!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-v235-advanced-actions{
    display:flex!important;order:20!important;
    flex:1 0 100%!important;width:100%!important;max-width:100%!important;
    min-width:0!important;min-height:34px!important;
    align-items:center!important;gap:5px!important;flex-wrap:nowrap!important;
    overflow-x:auto!important;overflow-y:hidden!important;
    scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
    touch-action:pan-x!important;overscroll-behavior-x:contain!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-v235-advanced-actions > *{
    flex-shrink:0!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-v235-advanced-actions select,
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-v235-advanced-actions button{
    min-height:32px!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-header-drawing-rail{display:none!important;}
  #lf-app-root .advanced-chart-panel-root .lf-chart-crosshair-hud{display:none!important;}
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane284:not(.lf431-expanded){
    height:112px!important;flex:0 0 112px!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane284.lf431-expanded{
    height:min(216px,29dvh)!important;flex:0 0 min(216px,29dvh)!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane284 .lf285-uw-item{
    min-width:150px!important;max-width:210px!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane284 .lf285-uw-alerts{
    top:34px!important;bottom:4px!important;
  }
  html body > .lf-global-drawing-rail.lf-v235-draw-open{
    max-height:48px!important;max-width:calc(100vw - 12px)!important;
    overflow-x:auto!important;overflow-y:hidden!important;
  }
}
/* Tablet portrait, landscape and foldable touch screens: chart header stays legible;
   remove the 769px cutoff that otherwise switches the chart to desktop-only controls. */
@media (min-width:769px) and (max-width:1366px) and (hover:none) and (pointer:coarse){
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header{
    display:flex!important;flex-flow:row wrap!important;align-content:flex-start!important;
    align-items:center!important;gap:5px 8px!important;
    height:auto!important;max-height:154px!important;min-height:82px!important;
    padding:7px 10px!important;overflow:visible!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-v235-advanced-actions{
    display:flex!important;order:25!important;
    flex:1 0 100%!important;width:100%!important;min-width:0!important;
    align-items:center!important;flex-wrap:nowrap!important;
    overflow-x:auto!important;overflow-y:hidden!important;
    scrollbar-width:none!important;-webkit-overflow-scrolling:touch!important;
    gap:7px!important;touch-action:pan-x!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-v235-advanced-actions > *{flex-shrink:0!important;}
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-v235-advanced-actions button,
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-v235-advanced-actions select{
    min-height:36px!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header > .lf-header-drawing-rail{
    flex:1 0 100%!important;order:30!important;width:100%!important;max-width:100%!important;
    min-height:38px!important;height:38px!important;overflow-x:auto!important;overflow-y:hidden!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane284:not(.lf431-expanded){
    height:126px!important;flex:0 0 126px!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane284.lf431-expanded{
    height:min(230px,27dvh)!important;flex:0 0 min(230px,27dvh)!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf285-uw-item{min-width:185px!important;}
  /* Global drawing tool must not occlude the price axis or fixed navigation. */
  html body > .lf-global-drawing-rail:not(.lf-v235-draw-closed){
    max-width:min(640px,calc(100vw - 20px))!important;
    overflow-x:auto!important;overflow-y:hidden!important;
  }
  #lf-app-root .mobile-more-menu{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
}
@media (max-height:560px) and (hover:none) and (pointer:coarse){
  #lf-app-root .advanced-chart-panel-root .lf-atlas-flowpane284.lf431-expanded{
    height:min(150px,28dvh)!important;flex:0 0 min(150px,28dvh)!important;
  }
  #lf-app-root .advanced-chart-panel-root .lf-advanced-header{
    max-height:110px!important;overflow-y:auto!important;
  }
  #lf-app-root .mobile-more-menu{max-height:calc(100dvh - 84px)!important;}
}
@media(prefers-reduced-motion:reduce){
  #lf-app-root .advanced-chart-panel-root .lf285-uw-alerts{scroll-behavior:auto!important;}
}
