/* Fixed application chrome; independent scrolling for products, cart and tables. */
@media(min-width:761px){
.layout{height:100dvh;min-height:0;overflow:hidden}
.workspace{height:100dvh;display:flex;flex-direction:column;overflow:hidden;min-height:0}
.topbar{flex-shrink:0}
.panel{flex:1;min-height:0!important;overflow:auto;overscroll-behavior:contain}
.panel:has(.sale-layout),.panel:has(.draft-footer),.panel:has(.history-table){display:flex;flex-direction:column;overflow:hidden}
.panel>.page-heading{flex-shrink:0}
.sale-layout{flex:1;min-height:0;overflow:hidden;align-items:stretch}
.sale-layout:not(.catalog-layout){grid-template-columns:minmax(0,1fr) clamp(265px,25vw,340px)}
.sale-layout>section{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.sale-layout .search-row,.sale-layout .categories{flex-shrink:0}
#product-results{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:0 3px 12px 0}
.catalog-layout{grid-template-columns:minmax(0,1fr)}
.cart{position:relative;top:auto;align-self:stretch;height:100%;max-height:none;min-height:0;display:flex;flex-direction:column;background:white}
.cart-head{flex-shrink:0}.cart-items{flex:1;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain}
.cart-footer{flex-shrink:0;margin-top:auto;position:relative;z-index:1}
.panel:has(.draft-footer)>.draft-tools,.panel:has(.draft-footer)>.draft-note{flex-shrink:0}
.panel:has(.draft-footer)>.table-wrap,.panel:has(.history-table)>.table-wrap{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.panel:has(.draft-footer)>.draft-footer{position:relative;bottom:auto;flex-shrink:0;margin-top:12px;padding-bottom:4px}
.table-wrap thead th{position:sticky;top:0;z-index:2;background:#edf0f3}
}
.sidebar nav{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.sidebar .brand{flex-shrink:0}.sidebar-bottom{flex-shrink:0;margin-top:0}
@media(max-width:760px){.layout{height:100dvh;min-height:0;overflow:hidden}.workspace{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}.topbar{flex:0 0 79px}.panel{flex:1;min-height:0!important;overflow:auto;overscroll-behavior:contain}.panel:has(.sale-layout){display:flex;flex-direction:column;overflow:hidden}.panel>.page-heading{flex-shrink:0}.sale-layout{flex:1;min-height:0;overflow:hidden}.sale-layout>section{display:flex;flex-direction:column;min-height:0;overflow:hidden}.sale-layout .search-row,.sale-layout .categories{flex-shrink:0}#product-results{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}.sale-layout:not(.catalog-layout){display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(120px,1fr) minmax(180px,36dvh);gap:10px}.cart{position:relative;top:auto;align-self:stretch;min-height:0;height:100%;max-height:none;display:flex;flex-direction:column}.cart-head{flex-shrink:0;padding:10px 13px}.cart-head h3{font-size:15px}.cart-items{flex:1;min-height:0;max-height:none;overflow:auto;padding:0 12px}.cart-footer{flex-shrink:0;padding:10px 12px calc(10px + env(safe-area-inset-bottom));margin-top:auto}.cart-footer .total{margin-bottom:8px}.cart-footer .total strong{font-size:21px}.cart-footer button{min-height:42px}.cart-item{padding:8px 0}.panel:has(.draft-footer){display:flex;flex-direction:column;overflow:hidden}.panel:has(.draft-footer)>.draft-tools,.panel:has(.draft-footer)>.draft-note{flex-shrink:0}.panel:has(.draft-footer)>.table-wrap{flex:1;min-height:0;overflow:auto}.panel:has(.draft-footer)>.draft-footer{flex-shrink:0;position:relative;margin-top:10px;padding-top:10px;padding-bottom:4px}.table-wrap thead th{position:sticky;top:0;z-index:2;background:#edf0f3}}

/* Give the catalog the same bounded results viewport as the sales screen. */
.sale-layout.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
