/* Shared screen density. Physical documents and browser zoom retain their own sizing. */
@media screen and (min-width:601px){
 :root{--ui-text:clamp(12px,.28vw + 9px,14px);--ui-label:clamp(11px,.2vw + 9px,13px);--ui-control:clamp(32px,2.5vw + 6px,42px);--ui-gap:clamp(6px,.65vw,12px);--ui-pad:clamp(10px,1vw,18px);--ui-heading:clamp(17px,1.5vw + 3px,24px)}
 body{font-size:var(--ui-text)}
 :is(#appScreen,.admin-main,.master-main,.stocktake-shell){min-width:0}
 :is(#appScreen,.admin-main,.master-main,.stocktake-shell) :is(form,fieldset,.form-grid,.suite-card,.admin-card,.master-card){min-width:0;max-width:100%}
 :is(#appScreen,.admin-main,.master-main,.stocktake-shell,dialog) label{font-size:var(--ui-label);gap:4px}
 :is(#appScreen,.admin-main,.master-main,.stocktake-shell,dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select){min-height:var(--ui-control);padding:6px 9px;font-size:var(--ui-text);border-radius:6px;min-width:0}
 :is(#appScreen,.admin-main,.master-main,.stocktake-shell,dialog) textarea{font-size:var(--ui-text);padding:7px 9px;border-radius:6px;min-width:0}
 :is(.admin-main,.master-main,.stocktake-shell){padding:var(--ui-pad);gap:var(--ui-gap)}
 :is(.admin-card,.master-card,.suite-card){padding:var(--ui-pad)}
 :is(.admin-main,.master-main,.stocktake-shell) :is(.form-grid,.company-fields,.company-addresses){gap:var(--ui-gap)}
 :is(.admin-main,.master-main,.stocktake-shell) button{font-size:var(--ui-text);min-height:var(--ui-control);padding:6px 10px}
 .topbar{min-height:54px;padding:6px 12px;gap:10px}
 .topbar .header-logo{width:32px;height:32px}
 .topbar h1{font-size:clamp(14px,1.2vw + 2px,20px)}
 .topbar :is(button,select,.admin-link){min-height:var(--ui-control);font-size:var(--ui-text);padding:6px 10px}
 #appScreen.workspace-shell{--workspace-rail:48px;--workspace-panel:196px}
 #appScreen.workspace-shell>.topbar{min-height:54px;padding:6px 12px;gap:10px}
 #appScreen.workspace-shell>.topbar .header-logo{width:32px;height:32px}
 #appScreen.workspace-shell #companyName{font-size:clamp(14px,1.2vw + 2px,20px)}
 #appScreen.workspace-shell .top-actions{gap:7px}
 #appScreen.workspace-shell .shop-label{font-size:var(--ui-label);gap:5px}
 #appScreen.workspace-shell .shop-label select{min-width:125px;max-width:180px;font-size:var(--ui-text)}
 .workspace-shell .user-chip>span{width:30px;height:30px}
 .workspace-shell .user-chip{font-size:var(--ui-text);gap:7px}
 .workspace-shell .user-chip small{font-size:10px}
 #appScreen.workspace-shell>main{padding:10px}
 #appScreen.workspace-shell>.workspace-rail{padding:6px 4px;gap:4px}
 #appScreen.workspace-shell .workspace-module{width:40px;height:40px;padding:10px;border-radius:7px}
 #appScreen.workspace-shell .workspace-module svg{width:20px;height:20px}
 #appScreen.workspace-shell .workspace-shade{left:var(--workspace-rail)}
 #appScreen.workspace-shell .workspace-panel-heading{min-height:32px;padding:3px 7px;font-size:13px}
 #appScreen.workspace-shell .workspace-menu-section>:is(.workspace-group-toggle,.workspace-group-link){min-height:32px;font-size:12px;padding:6px 8px}
 #appScreen.workspace-shell .workspace-panel-pages{padding:1px 4px 4px 10px}
 #appScreen.workspace-shell .workspace-panel-pages button{min-height:30px;font-size:12px;padding:6px;line-height:1.25;overflow-wrap:normal}
 #appScreen.workspace-shell .workspace-breadcrumb{padding-bottom:8px;font-size:11px}
 #appScreen.workspace-shell :is(.ops-form,.workspace-products,.workspace-report-centre){padding:var(--ui-pad);gap:var(--ui-gap);font-size:var(--ui-text)}
 #appScreen.workspace-shell .ops-form .form-grid{gap:var(--ui-gap)}
 #appScreen.workspace-shell .ops-form label{font-size:var(--ui-label)}
 #appScreen.workspace-shell .ops-form :is(input:not([type=checkbox]):not([type=radio]),select,button){min-height:var(--ui-control);font-size:var(--ui-text);padding:6px 9px}
 #appScreen.workspace-shell :is(.section-header,.workspace-page-heading){padding:var(--ui-pad);gap:var(--ui-gap);margin-bottom:8px}
 #appScreen.workspace-shell :is(.section-header,.workspace-page-heading) h2{font-size:var(--ui-heading);margin:0 0 4px}
 #appScreen.workspace-shell .workspace-page-heading p{font-size:var(--ui-text)}
 #appScreen.workspace-shell :is(.workspace-product-toolbar,.report-filters,.inventory-filters){gap:var(--ui-gap);padding:var(--ui-pad)}
 #appScreen.workspace-shell :is(.workspace-product-table,.manage-product-grid,.service-grid-wrap,.table-wrap){max-width:100%;overflow:auto}
 #appScreen.workspace-shell :is(.workspace-product-table,.service-grid,.suite-table,.po-line-grid) :is(th,td){font-size:var(--ui-text);padding:6px 8px}
 #serviceSalesView :is(.service-invoice-header,.service-entry,.service-invoice-bottom,.service-invoice-actions){padding:var(--ui-pad);gap:var(--ui-gap)}
 #serviceSalesView .service-customer textarea{min-height:56px}
 #serviceSalesView :is(.service-entry-top,.service-customer-actions){gap:var(--ui-gap);margin-top:5px;margin-bottom:6px}
 #serviceSalesView .service-invoice-bottom{gap:20px}
 #serviceSalesView .service-invoice-actions button{min-height:var(--ui-control);font-size:var(--ui-text)}
 dialog:not(#workspaceProductDrawer):not(#mobileMoreDialog){max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto}
 dialog:not(#workspaceProductDrawer):not(#mobileMoreDialog)>.dialog-card{padding:var(--ui-pad);gap:var(--ui-gap)}
 dialog :is(.dialog-head,.payment-header) h2{font-size:var(--ui-heading)}
 dialog :is(.dialog-actions,.operation-form-actions) button{min-height:var(--ui-control);font-size:var(--ui-text);padding:7px 12px}
 #workspaceProductDrawer{width:min(480px,calc(100vw - 16px))}
 #workspaceProductDrawerBody{padding:0 var(--ui-pad) var(--ui-pad)}
 #workspaceProductDrawerBody .form-grid{gap:var(--ui-gap)}
 #workspaceProductDrawerBody :is(input,select,button){font-size:var(--ui-text);min-height:var(--ui-control);padding:6px 9px}
 #workspaceProductDrawerBody label{font-size:var(--ui-label);gap:4px}
 #workspaceProductDrawerBody .ops-form{padding:12px 0}
 #workspaceProductDrawer .workspace-drawer-heading{padding:12px 16px}
 #workspaceProductDrawer .workspace-drawer-heading h2{font-size:var(--ui-heading)}
 #paymentForm .payment-scroll{padding:var(--ui-pad);gap:var(--ui-gap)}
 #paymentForm .payment-header{padding-bottom:10px}
 #paymentForm .payment-choice{min-height:48px;font-size:var(--ui-text);padding:6px 8px}
 #paymentForm .payment-choice small{font-size:10px}
 #paymentForm .payment-amount-field input{min-height:46px;font-size:24px}
 #paymentForm .payment-due strong{font-size:24px}
 #paymentForm .dialog-actions button{min-height:44px;font-size:14px}
}
@media screen and (min-width:901px) and (max-width:1599px){
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)).active-view{grid-template-columns:minmax(0,1fr) clamp(360px,40vw,520px);gap:8px;height:calc(100dvh - var(--workspace-top,54px) - 20px)}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .catalog:not(.price-keypad-active){padding:8px;border-radius:8px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .search-row{gap:5px;margin-bottom:6px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .search-row :is(input,button,summary){min-height:34px;font-size:12px;padding:6px 8px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .catalog:not(.price-keypad-active)>.category-list{gap:5px;margin-bottom:6px;padding-bottom:4px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .catalog:not(.price-keypad-active)>.category-list .category{min-height:34px;padding:6px 9px;font-size:11px;border-radius:6px;gap:5px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .category svg{width:14px;height:14px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .catalog:not(.price-keypad-active)>#productList:not(.list-mode){grid-template-columns:repeat(auto-fill,minmax(min(100%,clamp(145px,14vw,200px)),1fr));gap:6px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #productList:not(.list-mode) .product-card{min-height:80px;padding:7px;gap:3px;border-radius:6px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #productList .product-card-main{min-height:32px;gap:7px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #productList .product-details strong{font-size:12px;line-height:1.25}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #productList .product-details small{font-size:9px;margin-top:2px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #productList :is(.product-visual,.product-photo){width:32px;height:32px;flex-basis:32px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #productList .product-card footer{min-height:22px;gap:3px;padding-top:3px;padding-bottom:0;padding-right:25px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #productList .product-card .price{font-size:16px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #productList .stock{font-size:9px;padding:0}
 #appScreen.workspace-shell #orderView[data-sales-layout="retail"] #productList.list-mode .product-card{min-height:60px;padding:7px 36px 7px 7px;gap:7px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-panel{padding:8px;border-radius:8px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-title{min-height:52px;padding:7px;gap:7px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-title h2{font-size:13px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-title .cart-heading-label{gap:6px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .sale-customer{font-size:11px;gap:3px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .sale-customer button{font-size:10px;min-height:25px;padding:3px 6px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #clearCart{width:30px;min-height:30px;padding:5px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #workspaceSaleActions{gap:3px;padding:6px 0}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #workspaceSaleActions button{min-height:34px;font-size:10px;padding:4px 3px;gap:3px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-grid-heading,#appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-grid-row{grid-template-columns:minmax(90px,1fr) 36px 62px 74px 60px;font-size:11px;gap:3px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-grid-qty{min-height:32px;font-size:12px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-grid-actions button{min-height:32px;width:26px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-breakdown>div,#appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-panel>.cart-vat{font-size:11px;padding-top:4px;padding-bottom:4px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-summary{min-height:44px;margin:6px 0;padding:7px 10px;font-size:16px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #cartTotal{font-size:24px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #payBtn{min-height:46px;font-size:16px}
}
@media screen and (min-width:601px) and (max-width:900px){
 #appScreen.workspace-shell .topbar .shop-label select{min-width:100px;max-width:150px}
 #appScreen.workspace-shell .top-actions{gap:5px;flex-wrap:wrap}
 #appScreen.workspace-shell .workspace-search-button span{display:none}
 #appScreen.workspace-shell .ops-form .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media screen and (max-width:600px){
 :is(.admin-main,.master-main,.stocktake-shell){padding:10px;gap:10px}
 :is(.admin-main,.master-main,.stocktake-shell) :is(.admin-card,.master-card,.suite-card){padding:12px;min-width:0}
 :is(.admin-main,.master-main,.stocktake-shell) :is(.form-grid,.company-fields,.company-addresses){grid-template-columns:minmax(0,1fr);gap:10px}
 :is(.admin-main,.master-main,.stocktake-shell) input:not([type=checkbox]):not([type=radio]),:is(.admin-main,.master-main,.stocktake-shell) select{font-size:16px;min-width:0}
 dialog{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
}
@media screen and (pointer:coarse) and (min-width:601px){
 :is(#appScreen,.admin-main,.master-main,.stocktake-shell,dialog) :is(button,input:not([type=checkbox]):not([type=radio]),select){min-height:40px}
 #appScreen.workspace-shell .workspace-panel-pages button{min-height:40px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) #workspaceSaleActions button{min-height:40px}
 #appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .category-list .category{min-height:40px}
}

@media screen and (min-width:601px){.login-shell:not(#loginScreen) .login-card{width:min(420px,100%);padding:24px;gap:12px}.login-shell:not(#loginScreen) .login-card h1{font-size:24px}.login-shell:not(#loginScreen) .login-card label{font-size:12px}.login-shell:not(#loginScreen) .login-card :is(input,select,button){font-size:13px;min-height:38px}}
@media screen and (pointer:coarse) and (min-width:901px) and (max-width:1599px){#appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .catalog:not(.price-keypad-active)>.category-list .category,#appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-grid-qty,#appScreen.workspace-shell #orderView:not([data-sales-layout="desktop"]):has(>.catalog:not(.price-keypad-active)) .cart-grid-actions button{min-height:40px}}
