/* Tablet/compact desktop: never activate the phone composition at 768px or above. */
.rt-cancel-splits{width:100%;min-height:48px;margin-top:14px;border:1px solid #fecaca;border-radius:12px;background:#fff1f2;color:#9f1239;font-weight:900}
.rt-cancel-splits:disabled{border-color:#e2e8f0;background:#f1f5f9;color:#64748b}
@media (min-width:768px){
 html,body,body.tpv-body,#app,.app-shell,.main-area{height:auto;min-height:100%;overflow-y:visible}
 body{overflow-x:hidden;overflow-y:auto}
 .app-shell{align-items:start;min-height:100dvh}
 .sidebar{position:sticky;top:0;height:100dvh;max-height:100dvh;overflow:hidden;overscroll-behavior:contain}
 .sidebar .brandmark,.sidebar .ai-card,.sidebar .profile{flex:0 0 auto}
 .sidebar nav{flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ffffff40 transparent;padding-right:2px}
 .sidebar .ai-card{margin-top:0}
 .main-area,.tpv-workspace,.floor-column,.module-page{overflow:visible;min-height:0}
 .ticket-panel{height:auto;max-height:none;overflow:visible}
 #runtimePay .rt-back,.touch-backdrop{overflow-x:hidden;overflow-y:auto;align-items:start}
 #runtimePay .rt-card,.touch-pad-card{max-height:none;margin:16px auto;overflow:visible}
 .employee-gate,.employee-manager{overflow-y:auto}
}
@media (min-width:768px) and (max-width:950px){
 .tpv-workspace{display:grid;grid-template-columns:minmax(0,1fr);align-items:start}
 .ticket-panel{position:static;top:auto;min-height:0}
 .product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .floor-plan{min-height:340px}
 .topbar{position:sticky;top:0}
}
@media (min-width:951px) and (max-width:1150px){
 .tpv-workspace{grid-template-columns:minmax(0,1fr) minmax(300px,340px);align-items:start}
}
/* Paint the navigation rail for the whole document when long catalogues make
   the page taller than the sticky navigation content. */
@media (min-width:1151px){
 .app-shell{background:linear-gradient(90deg,#16233e 0 205px,var(--bg) 205px 100%)}
}
@media (min-width:768px) and (max-width:1150px){
 .app-shell{background:linear-gradient(90deg,#16233e 0 78px,var(--bg) 78px 100%)}
}

/* Product catalogue and ticket composition for tablet and desktop. */
@media (min-width:768px){
 .catalog{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:10px}
 .category-row{flex:0 0 auto;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;overscroll-behavior-x:contain}
 .category-row button{flex:0 0 auto;min-height:46px}
 .product-grid{flex:1 1 auto;min-height:0;max-height:100%;overflow-y:auto;overscroll-behavior:contain;align-content:start;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));grid-auto-rows:168px;gap:10px;padding:2px 2px 10px;scrollbar-gutter:stable}
 .product-card{min-width:0;min-height:0;height:168px;display:grid;grid-template-rows:94px minmax(34px,1fr) auto;align-items:start;gap:6px;padding:8px;border-radius:14px;text-align:left;overflow:hidden}
 .product-img{width:100%;height:94px;min-height:0;border-radius:10px;overflow:hidden;background:#f1f4f8}
 .product-img img{display:block;width:100%;height:100%;max-width:none;object-fit:cover;object-position:center}
 .product-card b{margin:0;font-size:13px;line-height:1.25;font-weight:800;color:#172033;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
 .product-card span{margin:0;font-size:14px;line-height:1;font-weight:900;color:#174ea6}
 .quick-actions{position:relative;z-index:2;margin-top:0}
 .quick-actions button{min-height:50px;padding:10px 8px}
}

@media (min-width:768px) and (max-width:950px){
 .catalog{max-height:min(520px,58dvh)}
 .product-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
 .quick-actions{margin-top:8px}
}

@media (min-width:951px){
 html:has(body.tpv-body .tpv-workspace),body.tpv-body:has(.tpv-workspace){height:100dvh!important;min-height:0!important;overflow:hidden!important}
 body.tpv-body:has(.tpv-workspace) #app,body.tpv-body:has(.tpv-workspace) .app-shell,body.tpv-body:has(.tpv-workspace) .main-area{height:100dvh!important;min-height:0!important;overflow:hidden!important}
 .main-area{display:grid;grid-template-rows:90px minmax(0,1fr)}
 body.tpv-body:has(.tpv-workspace) .tpv-workspace{height:100%;min-height:0;overflow:hidden!important;grid-template-columns:minmax(0,1fr) clamp(320px,22vw,380px);align-items:stretch}
 .floor-column{height:100%;min-height:0;display:grid;grid-template-rows:auto clamp(190px,28vh,310px) minmax(220px,1fr) auto;gap:8px;overflow:hidden}
 .zone-tabs,.floor-plan,.catalog,.quick-actions{margin:0}
 .floor-plan,.floor-tables{min-height:0;height:100%}
 .floor-tables{padding-top:48px;padding-bottom:20px;gap:18px 28px}
 .ticket-panel{position:sticky;top:0;height:100%;min-height:0;max-height:none;overflow:hidden}
 .ticket-lines{min-height:0;overflow-y:auto;overscroll-behavior:contain}
}

@media (min-width:1500px){
 .product-grid{grid-template-columns:repeat(auto-fill,minmax(165px,1fr))}
}
