/* Shared phone geometry: CSS pixels, visual viewport, system safe areas. */
@media screen{
 body.design3.small-mobile{--mobile-dock-height:calc(68px + env(safe-area-inset-bottom));--phone-safe-top:env(safe-area-inset-top);--phone-safe-bottom:env(safe-area-inset-bottom)}
 body.design3.small-mobile .layout{position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:auto!important;width:100%!important;height:100dvh!important;padding-top:var(--phone-safe-top)!important;min-height:0!important}
 body.design3.small-mobile .main{height:calc(100dvh - var(--mobile-dock-height) - var(--phone-safe-top))!important;min-width:0!important;scroll-padding-top:16px;scroll-padding-bottom:20px}
 body.design3.small-mobile .main>header{padding-left:max(12px,env(safe-area-inset-left))!important;padding-right:max(12px,env(safe-area-inset-right))!important}
 body.design3.small-mobile .content{padding-left:max(12px,env(safe-area-inset-left))!important;padding-right:max(12px,env(safe-area-inset-right))!important;min-width:0!important}
 body.design3.small-mobile #mobileDock{top:auto!important;bottom:0!important;padding-left:max(4px,env(safe-area-inset-left))!important;padding-right:max(4px,env(safe-area-inset-right))!important}
 body.design3.small-mobile .sellersalefinish{position:fixed!important;left:0!important;right:0!important;width:100%!important;margin:0!important;z-index:35;background:#fff;top:auto!important;bottom:var(--mobile-dock-height)!important;padding-left:max(12px,env(safe-area-inset-left))!important;padding-right:max(12px,env(safe-area-inset-right))!important}
 body.design3.small-mobile .main:has(.sellersalefinish) .content{padding-bottom:calc(max(124px,var(--mobile-checkout-height,124px)) + 24px)!important}
 body.design3.small-mobile.viewport-keyboard{--mobile-dock-height:0px;--phone-safe-bottom:0px}
 body.design3.small-mobile.viewport-keyboard .layout{top:var(--app-top,0px)!important;height:var(--app-height,100dvh)!important}
 body.design3.small-mobile.viewport-keyboard .main{height:calc(var(--app-height,100dvh) - var(--phone-safe-top))!important}
 body.design3.small-mobile.viewport-keyboard #mobileDock{display:none!important}
 body.design3.small-mobile.viewport-keyboard .sellersalefinish{position:static!important;inset:auto!important;box-shadow:none!important}
 body.design3.small-mobile.viewport-keyboard .main:has(.sellersalefinish) .content{padding-bottom:24px!important}
 body.design3.small-mobile.viewport-keyboard .main>header{position:static!important}
 body.design3.small-mobile .sellersearch>.pwa-scanner-button{font-size:0!important;gap:0!important;justify-content:center!important}
 body.design3.small-mobile .paidactions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
 body.design3.small-mobile .paidactions>button{display:flex!important;justify-content:center;align-items:center;gap:6px;min-width:0!important;min-height:48px!important;margin:0!important;padding:10px 8px!important;white-space:normal!important;overflow-wrap:anywhere;line-height:1.3!important}
 body.design3.small-mobile .paidactions>button svg{flex:none;width:18px!important;height:18px!important}
 body.design3.small-mobile .paidactions>button span{white-space:normal!important;min-width:0;overflow-wrap:anywhere}
 body.design3.small-mobile :is(.heading,.panelhead,.tools,.row)>:is(input,select,textarea){min-width:0;max-width:100%}
 body.design3.small-mobile :is(.panel,.card,.paidallocation,.partnertrade,.mobile-inventory-card){overflow-wrap:anywhere}
 body.design3.small-mobile dialog#modal[open]{position:fixed!important;inset:auto!important;left:50%!important;top:calc(var(--app-top,0px) + var(--app-height,100dvh)/2)!important;transform:translate(-50%,-50%)!important;margin:0!important;width:min(540px,calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)))!important;max-width:calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right))!important;height:auto!important;min-height:0!important;max-height:calc(var(--app-height,100dvh) - var(--phone-safe-top) - var(--phone-safe-bottom) - 24px)!important}
 body.design3.small-mobile dialog#modal>#modalform{flex:0 1 auto!important;max-height:calc(var(--app-height,100dvh) - var(--phone-safe-top) - var(--phone-safe-bottom) - 112px)!important;min-height:0!important;scroll-padding:16px}
 body.design3.small-mobile dialog#modal .formfoot{position:static!important;flex-wrap:wrap;gap:8px;padding-bottom:var(--phone-safe-bottom)!important}
 body.design3.small-mobile dialog#modal .formfoot>button{min-width:0!important;flex:1 1 120px;min-height:44px!important}
 body.design3.small-mobile #scanbox{top:var(--app-top,0px)!important;bottom:auto!important;height:var(--app-height,100dvh)!important;max-height:var(--app-height,100dvh)!important}
 body.design3.small-mobile #scanbox>.panel{max-height:calc(var(--app-height,100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px)!important;min-width:0;overflow:auto}
 body.design3.small-mobile #scanbox #scanvideo{height:clamp(90px,calc(var(--app-height,100dvh)/3),300px)!important;min-height:90px!important}
 body.design3.small-mobile #scanbox :is(input,button){font-size:16px!important}
 body.design3.small-mobile dialog#modal input:not([type=checkbox]):not([type=radio]),body.design3.small-mobile dialog#modal select,body.design3.small-mobile dialog#modal textarea{font-size:16px!important;min-width:0!important;max-width:100%!important}
 body.design3.small-mobile #toast{bottom:calc(var(--mobile-dock-height) + 12px)!important;max-height:calc(var(--app-height,100dvh)/3);overflow:auto}
}
@media screen and (max-width:374px){
 body.design3.small-mobile #mobileDock .nav{font-size:10px!important;gap:3px!important}
 body.design3.small-mobile .main>header #aiHelperOpen{font-size:11px!important;padding:8px 6px!important}
 body.design3.small-mobile .main>header #headerLogout{padding:8px 9px!important}
 body.design3.small-mobile .main>header .tools{gap:6px!important}
 body.design3.small-mobile .main>header #mobileSettingsOpen{min-width:36px!important;padding:8px!important}
 body.design3.small-mobile .mobile-fixed-pager{gap:6px}
 body.design3.small-mobile .warehouse-stock-item{grid-template-columns:72px minmax(0,1fr);gap:8px}
 body.design3.small-mobile .warehouse-stock-photo :is(.partphoto,.pill){width:72px!important;height:72px!important}
}
/* A short browser viewport / open keyboard must leave the form scrollable. */
@media screen and (max-height:560px){
 body.design3.small-mobile .main>header{position:static!important}
 body.design3.small-mobile .content{padding-top:12px!important}
 body.design3.small-mobile dialog#modal>.dialoghead{padding:10px 12px!important}
 body.design3.small-mobile dialog#modal>.dialoghead h2{font-size:17px!important}
}
/* In landscape, keep checkout in the scrollable flow instead of covering search. */
@media screen and (max-height:500px) and (orientation:landscape){
 body.design3.small-mobile .sellersalefinish{position:static!important;inset:auto!important;width:auto!important;margin-top:12px!important}
 body.design3.small-mobile .main:has(.sellersalefinish) .content{padding-bottom:24px!important}
 body.design3.small-mobile .sellercheckout{display:block!important}
}
.ios-safari-guide{box-sizing:border-box;width:min(540px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow:auto}
.ios-safari-guide .dialoghead h2{font-size:20px;min-width:0}
.ios-safari-guide .pad{overflow-wrap:anywhere}
.ios-safari-guide li{margin-bottom:10px}
dialog.ios-safari-guide[open]{height:auto!important;min-height:0!important;max-height:calc(100dvh - 32px)!important}
.seller-search-top{position:fixed;right:max(12px,env(safe-area-inset-right));z-index:36;background:#2c5666;color:#fff;border:1px solid #fff;border-radius:24px;padding:10px 16px;min-height:44px;box-shadow:0 2px 8px #0003}
.seller-search-top[hidden]{display:none!important}
dialog.seller-product-preview[open]{width:min(540px,calc(100vw - 24px));height:auto!important;min-height:0!important;max-height:calc(100dvh - 32px);overflow:auto}
.seller-product-preview h3{overflow-wrap:anywhere}
.seller-product-preview .pad>button{margin-top:10px;min-height:44px}
.seller-preview-photo .partphoto{width:120px!important;height:120px!important;object-fit:contain}

body.design3.small-mobile.seller-empty-checkout .sellersalefinish{display:none!important}
body.design3.small-mobile.seller-empty-checkout .main:has(.sellersalefinish) .content{padding-bottom:24px!important}
/* Two views of the same live receipt; no duplicated cart or transaction state. */
body.design3.small-mobile.seller-pick-search :is(.sellerreceipt,.sellerbuyer,.sellersalefinish){display:none!important}
body.design3.small-mobile.seller-pick-receipt .sellerfind{display:none!important}
body.design3.small-mobile.seller-pick-search .main:has(.sellersalefinish) .content{padding-bottom:100px!important}
.seller-open-receipt{position:fixed;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));z-index:35;min-height:48px;box-shadow:0 2px 8px #0003}
.seller-open-receipt[hidden]{display:none!important}
#sellerAddMore{margin-bottom:12px;min-height:44px}
body.design3.small-mobile .seller-search-item{display:grid;grid-template-columns:minmax(0,1fr) 88px;gap:8px;padding:12px 8px;border:1px solid #dde4e5;border-radius:12px;background:#fff;margin:8px 0;align-items:center}
body.design3.small-mobile .seller-search-detail{display:flex!important;align-items:flex-start;gap:10px;background:transparent!important;border:0!important;text-align:left;min-width:0;padding:0!important;color:inherit}
.seller-search-info{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.seller-search-info strong{font-size:15px}
.seller-search-photo{flex:0 0 44px;width:44px}
.seller-search-photo :is(.partphoto,.pill){width:44px!important;height:44px!important;object-fit:contain}
.seller-search-add{display:flex;flex-direction:column;gap:8px;align-items:stretch;text-align:center}
.seller-search-add button{min-height:44px;padding:8px!important;white-space:normal}
.seller-search-add small{font-size:12px}
body.design3.small-mobile #sellerClearSearch{min-width:36px;width:36px;min-height:44px;padding:0;font-size:24px}
body.design3.small-mobile.seller-pick-receipt .sellercartitem>[data-restock-product]{grid-column:1/-1;width:100%;margin-top:12px;box-sizing:border-box}
body.design3.small-mobile.seller-pick-receipt .sellerreceipt>.empty{display:none}
@media screen and (orientation:landscape) and (max-height:500px){
 body.design3.small-mobile:is(.seller-pick-search,.seller-pick-receipt) #mobileDock [data-v0=transfers],body.design3.small-mobile:is(.seller-pick-search,.seller-pick-receipt) #mobileDock [data-v0=partners]{display:none!important}
}
body.design3.small-mobile:is(.seller-pick-search,.seller-pick-receipt) .main{overflow-anchor:none}
body.design3.small-mobile.viewport-keyboard :is(.seller-open-receipt,.seller-search-top){display:none!important}
body.design3.small-mobile.seller-pick-receipt .sellercartitem>.sale-shortage-sources{background:#fff4dc;border:1px solid #eadfc6;border-radius:10px;padding:12px;font-size:14px;line-height:1.4}
body.design3.small-mobile.seller-pick-receipt [data-cart-stock]{display:flex;flex-wrap:wrap;gap:4px}
body.design3.small-mobile.seller-pick-receipt [data-cart-stock] small{font-size:12px!important;line-height:1.4}
body.design3.small-mobile .seller-search-price{display:block!important;visibility:visible!important;font-size:20px!important;font-weight:800;line-height:1.35;color:#a83d30!important;white-space:normal;overflow-wrap:anywhere}
.seller-cart-icon{display:inline-block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;vertical-align:middle}
.seller-search-add button,.seller-open-receipt,.seller-product-preview .primary{display:flex;align-items:center;justify-content:center;gap:6px}
body.design3.small-mobile .seller-search-item{grid-template-columns:minmax(0,1fr) 106px}
#sellerBackToSearch{display:block;width:100%;min-height:44px;margin-bottom:8px;background:#fff;color:#2c5666;border:1px solid #aec2ca}
/* Sourcing actions are full rows, not the small +/- controls in .cartrow. */
body.design3.small-mobile .sellercartitem .sale-shortage-sources .seller-source-choice{display:flex;width:100%!important;max-width:100%;min-width:0;min-height:64px;padding:12px!important;font-size:14px!important;line-height:1.45;white-space:normal;box-sizing:border-box;text-align:left}
body.design3.small-mobile .sale-shortage-sources .seller-source-choice>*{max-width:100%;overflow-wrap:anywhere}
body.design3.small-mobile .sale-shortage-sources .restocksource{min-width:0}
body.design3.small-mobile .sale-shortage-sources [data-cancel-sale-reserve]{width:auto!important;max-width:100%;padding:8px 12px!important;font-size:14px!important;white-space:normal}

body.design3.small-mobile .seller-search-detail{width:100%!important;max-width:100%;white-space:normal!important;overflow-wrap:anywhere;box-sizing:border-box}
body.design3.small-mobile .seller-search-info{flex:1 1 0;min-width:0;max-width:100%;white-space:normal!important}
body.design3.small-mobile .seller-search-info>*{max-width:100%;white-space:normal;overflow-wrap:anywhere}
body.design3.small-mobile .sellersearch{position:relative}
body.design3.small-mobile .sellersearch #barcode{padding-right:46px!important}
body.design3.small-mobile #sellerClearSearch{position:absolute;z-index:2;width:44px;min-height:44px;border:0!important;background:transparent!important;color:#a83d30!important;font-size:28px!important;font-weight:700;margin:0;border-radius:8px}
body.design3.small-mobile #sellerClearSearch[hidden]{display:none!important}

/* Compact search actions keep the product name and price in the readable column. */
body.design3.small-mobile .seller-search-item{grid-template-columns:minmax(0,1fr) 52px;align-items:center}
body.design3.small-mobile .seller-search-add button{width:48px!important;height:48px;min-height:48px;padding:10px!important;border-radius:12px}
body.design3.small-mobile .seller-search-add .seller-cart-icon{width:26px;height:26px}
body.design3.small-mobile .seller-search-price.is-unset{font-size:13px!important;line-height:1.4;font-weight:600;white-space:nowrap}
body.design3.small-mobile .seller-search-add small{font-size:11px;overflow-wrap:anywhere}
/* Keep the system home-indicator area, without extra unused dock padding. */
body.design3.small-mobile{--mobile-dock-height:calc(62px + env(safe-area-inset-bottom))}
body.design3.small-mobile #mobileDock{padding-top:3px!important;padding-bottom:calc(3px + env(safe-area-inset-bottom))!important}
body.design3.small-mobile.viewport-keyboard{--mobile-dock-height:0px}
