/* Shared mobile foundation; loaded after component styles. */
[hidden]{display:none!important}
html{scroll-padding-top:5rem}
body{font-size:1rem;line-height:1.5;padding-inline-start:env(safe-area-inset-left);padding-inline-end:env(safe-area-inset-right)}
main,.page,.container,.panel,.card{min-width:0;max-width:100%;box-sizing:border-box}
img,video{max-width:100%}
:is(.product-card,.order-menu-card) img{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:cover}
.profile-avatar img{display:block;width:100%;height:100%;aspect-ratio:1;object-fit:cover}
:is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:max(1rem,16px);max-width:100%;box-sizing:border-box}
:is(button,.btn,.icon-btn,.chip,select,input:not([type=checkbox]):not([type=radio]),.control-panel-links a,.topbar nav a,.profile-menu summary){min-height:2.75rem}
:is(button,.icon-btn){min-width:2.75rem}
:is(.actions,.card-actions,.section-toolbar,.panel-head,.form-actions){gap:.75rem}
:is(.card-actions,.form-actions){display:flex;flex-wrap:wrap;align-items:center}
.topbar{padding-top:max(.5rem,env(safe-area-inset-top));padding-bottom:.5rem;gap:.5rem;flex-wrap:wrap}
.topbar .user-area{display:flex;align-items:center;gap:.625rem;min-width:0;flex-wrap:wrap}
.topbar .profile-menu summary{display:flex;align-items:center;gap:.5rem}
.topbar .profile-menu summary>span:last-child{display:none}
.table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.control-panel-drawer{padding-bottom:env(safe-area-inset-bottom)}
:is(.checkout-terminal,.pos-terminal,main.page){padding-bottom:max(1rem,env(safe-area-inset-bottom))}
@media(min-width:48rem){.topbar .profile-menu summary>span:last-child{display:inline}.topbar{gap:.75rem}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* Small-screen defaults: preserve every terminal section in document flow. */
body{padding-bottom:env(safe-area-inset-bottom)}
h1{font-size:clamp(1.5rem,4vw,2.5rem);line-height:1.2;overflow-wrap:anywhere}
:is(button,.btn,.icon-btn,.chip,.product-add,.qty button,.small-link,.control-panel-links a,.topbar nav a,select,input:not([type=checkbox]):not([type=radio])){min-height:max(2.75rem,44px)!important}
:is(button,.icon-btn,.product-add,.qty button){min-width:max(2.75rem,44px)!important}
.product-card-footer{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.product-card-footer .small-link{max-width:none;white-space:normal;overflow:visible;font-size:.875rem;line-height:1.4;flex:1 1 4rem}
.product-card .product-image{aspect-ratio:4/3;height:auto;min-height:0;overflow:hidden}
.product-card .product-image img{height:100%;object-fit:cover}
body.terminal-body{overflow:auto}
.checkout-pro-page{grid-template-columns:minmax(0,1fr);height:auto;min-height:70vh;gap:1rem}
:is(.checkout-main,.commercial-checkout,.checkout-payment-panel,.payment-panel-scroll){min-width:0;overflow:visible}
.commercial-checkout{grid-template-columns:minmax(0,1fr);height:auto}
.checkout-queue{max-height:18rem;overflow:auto}
.payment-method-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.625rem}
.checkout-command-bar{grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;padding-bottom:max(1rem,env(safe-area-inset-bottom))}
.checkout-command-bar> :last-child{grid-column:1/-1}
.commercial-payment-row{grid-template-columns:repeat(2,minmax(0,1fr)) max(2.75rem,44px);gap:.625rem}
.commercial-payment-row [data-pay-reference]{grid-column:1/3}
.commercial-payment-row .icon-btn{grid-column:3;grid-row:1}
.terminal-shortcuts{position:static;flex-wrap:wrap;padding:.75rem;gap:.75rem}
.commercial-payment-row>*{min-width:0;max-width:100%}
.checkout-receipt-preview .checkout-line{grid-template-columns:minmax(0,1fr) auto auto;gap:.5rem;overflow-wrap:anywhere}
.kc-native #installPwaBtn{display:none!important}
@media(min-width:30rem){.payment-method-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:64rem){
 .checkout-pro-page{grid-template-columns:minmax(14rem,18rem) minmax(0,1fr)}
 .checkout-queue{max-height:75vh;position:sticky;top:6rem;align-self:start}
 .checkout-command-bar{grid-template-columns:auto auto minmax(0,1fr)}
 .checkout-command-bar> :last-child{grid-column:auto}
}
@media(min-width:80rem){.commercial-checkout{grid-template-columns:minmax(0,1fr) minmax(22rem,32rem)}}

/* Release 004 responsive hardening. Keep this stylesheet last in <head>. */
html,body{max-width:100%;overflow-x:hidden}
.admin-shell,.admin-content,.page,.workplace-page,.tracking-page,.record-detail-page,.sales-pro-page,.diagnostics-page{min-width:0;max-width:100%;box-sizing:border-box}
:is(.diagnostic-grid,.form-grid,.detail-summary-grid,.record-detail-grid,.sales-kpis,.sales-command-card,.advanced-sales-filters,.workplace-grid,.dashboard-grid){min-width:0}
:is(.panel,.card,.diagnostic-card,.landing-card,.sales-results,.checkout-main,.checkout-payment-panel){overflow-wrap:anywhere}
dialog{max-width:min(96vw,72rem);max-height:92vh;overflow:auto;box-sizing:border-box}
pre,code{max-width:100%;overflow-wrap:anywhere;word-break:break-word}
.table-wrap,.sales-results{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.table-wrap table,.sales-results table{min-width:max-content}
.section-toolbar,.panel-head,.pagination-bar,.inline-actions,.record-actions,.workplace-actions{flex-wrap:wrap}
@media(max-width:47.999rem){
 body{min-width:0}
 .admin-shell,.admin-content,.page,.workplace-page,.tracking-page,.record-detail-page,.sales-pro-page,.diagnostics-page{width:100%!important;margin-inline:0!important;padding-inline:clamp(.75rem,3vw,1rem)!important}
 :is(.form-grid,.detail-summary-grid,.record-detail-grid,.diagnostic-grid,.sales-kpis,.advanced-sales-filters){grid-template-columns:minmax(0,1fr)!important}
 :is(.section-toolbar,.panel-head,.pagination-bar,.inline-actions,.record-actions,.workplace-actions){align-items:stretch}
 :is(.section-toolbar,.panel-head,.pagination-bar,.inline-actions,.record-actions,.workplace-actions)>*{max-width:100%}
 .topbar{width:100%;max-width:100%;padding-inline:max(.75rem,env(safe-area-inset-left)) max(.75rem,env(safe-area-inset-right))}
 .topbar nav{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 .topbar nav a{white-space:nowrap}
 .auth-card{width:min(100%,34rem);margin-inline:auto}
 .panel,.card,.diagnostic-card,.landing-card{max-width:100%}
 table{font-size:.9rem}
}
@media(max-width:35.999rem){
 :is(.actions,.card-actions,.form-actions,.section-toolbar,.panel-head,.inline-actions,.record-actions,.workplace-actions){display:flex;flex-direction:column;align-items:stretch}
 :is(.actions,.card-actions,.form-actions,.section-toolbar,.panel-head,.inline-actions,.record-actions,.workplace-actions)>.btn,
 :is(.actions,.card-actions,.form-actions,.section-toolbar,.panel-head,.inline-actions,.record-actions,.workplace-actions)>button{width:100%}
 .payment-method-grid{grid-template-columns:minmax(0,1fr)}
 .commercial-payment-row{grid-template-columns:minmax(0,1fr)}
 .commercial-payment-row [data-pay-reference],.commercial-payment-row .icon-btn{grid-column:auto;grid-row:auto}
 .checkout-command-bar{grid-template-columns:minmax(0,1fr)}
 .checkout-command-bar>*{grid-column:auto!important}
}

