/* RC6.6.9.2 | isolated POS navigation, scrolling and rendering stability only. */
@media screen and (min-width:901px){
  html,body{height:100%;max-height:100%;overflow:hidden!important}
  #appView.app-shell{display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden}
  #appView>.topbar{flex:0 0 auto;min-height:0;max-height:35vh;z-index:50}
  #appView>.workspace{flex:1 1 auto;height:auto;min-height:0;min-width:0;
    display:grid;grid-template-columns:132px minmax(0,1fr);overflow:hidden}
  #appView .sidebar{width:132px;min-width:132px;max-width:132px;min-height:0;
    overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;padding:8px 7px}
  #appView .sidebar button,#appView .sidebar a.knowledge-nav-link{width:100%;min-width:0;
    max-width:100%;height:auto;min-height:59px;box-sizing:border-box;overflow:visible;
    flex:0 0 auto;display:flex;align-items:center;justify-content:center;flex-direction:column;
    gap:3px;padding:7px 5px;text-align:center;border-radius:12px}
  #appView .sidebar button>b,#appView .sidebar a.knowledge-nav-link>b{font-size:11px;
    line-height:1.3;max-width:100%;white-space:normal;overflow-wrap:normal;word-break:normal}
  #appView .sidebar .side-label{font-size:9px;line-height:1.4;white-space:nowrap;overflow:visible}
  #appView .view-stage{flex:1;min-height:0;min-width:0;overflow:hidden}
  #appView .view-stage>.view.active.scroll-view{height:100%;min-height:0;
    overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:auto;
    scrollbar-gutter:stable;-webkit-overflow-scrolling:touch}
  #posView.active{height:100%;min-height:0;overflow:hidden}
  #posView.active .pos-layout,#posView.active .catalog-panel,#posView.active .cart-panel{height:100%;min-height:0}
  #posView.active .product-grid{min-height:0;overflow-y:auto;overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch}
  #posView.active .cart-panel>.cart-scroll-body{min-height:0;overflow-x:hidden!important;
    overflow-y:auto!important;overscroll-behavior-y:auto;-webkit-overflow-scrolling:touch}
  #posView.active .cart-scroll-body .cart-lines{height:auto!important;max-height:none!important;
    min-height:90px!important;overflow:visible!important;flex:0 0 auto!important}
}
/* Align diagnostics rows without forcing technical codes or overflowing long store names. */
#diagDeviceList .ready-row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(130px,.8fr) minmax(135px,.7fr);
  gap:12px;align-items:center;min-width:0}
#diagDeviceList .ready-row>*{min-width:0;overflow-wrap:break-word}
@media(max-width:900px){
  #diagDeviceList .ready-row{grid-template-columns:minmax(0,1fr);gap:4px}
  #appView .sidebar button b,#appView .sidebar a.knowledge-nav-link b{overflow-wrap:normal;word-break:normal}
}
@media print{#appView.app-shell{height:auto!important;overflow:visible!important}}
/* Mobile: use ONE document scroll owner; Safari otherwise strands content inside body scroll. */
@media screen and (max-width:700px){
  html,body{height:auto!important;min-height:100%!important;max-height:none!important;
    overflow-x:hidden!important;overflow-y:auto!important}
  #appView.app-shell{height:auto!important;min-height:100dvh;max-height:none!important;overflow:visible!important}
  #appView>.workspace,#appView .view-stage{height:auto!important;min-height:0;overflow:visible!important}
  #appView .view-stage>.view.active.scroll-view{height:auto!important;min-height:50vh;
    overflow:visible!important}
  #posView.active{height:auto!important;overflow:visible!important}
  #posView.active .catalog-panel,#posView.active .cart-panel{height:auto!important;overflow:visible!important}
}
/* Tablet with stacked POS: the whole POS view must scroll, not clip the cart below its height. */
@media screen and (min-width:701px) and (max-width:900px){
  #appView.app-shell{display:flex;flex-direction:column;height:100dvh;min-height:0}
  #appView>.topbar{flex:0 0 auto}
  #appView>.workspace{flex:1 1 auto;height:auto;min-height:0}
  #appView .view-stage{min-height:0}
  #posView.active{height:100%;min-height:0;overflow-x:hidden;overflow-y:auto!important}
  #posView.active .pos-layout{height:auto!important;display:block!important;overflow:visible!important}
  #posView.active .catalog-panel,#posView.active .cart-panel{height:auto!important;overflow:visible!important}
  #posView.active .product-grid{max-height:min(48vh,480px);overflow-y:auto!important}
}
