/* Order save controls stay in document flow when space is limited.
   Browser zoom reduces the CSS viewport and uses the same rules. */
@media (max-width:1399px),(max-height:799px){
 main:has(.order-head){padding-bottom:24px}
 .save-bar{position:static;inset:auto;width:auto;height:auto;min-height:0;max-height:none;overflow:visible;margin:24px 0 0;padding:16px;background:var(--surface,#fff);border:1px solid var(--divider,#dce0e5);border-radius:var(--radius-panel,8px);display:flex;flex-wrap:wrap;gap:16px;align-items:center}
 .save-bar .sticky-totals{display:flex;flex-wrap:wrap;gap:12px 24px;min-width:0;flex:1 1 220px}
 .save-bar .sticky-totals span{min-width:0}
 .save-actions{margin:0;display:flex;flex-wrap:wrap;gap:8px;width:auto;flex:1 1 220px}
 .save-actions>*{flex:1 1 120px;white-space:normal!important;min-height:44px}
 .summary-heading,.summary-breakdown{display:none}
}
@media (min-width:1400px) and (max-height:799px){main:has(.order-head){padding-right:32px}}
@media (max-width:900px),(max-height:600px){
 .order-head{position:static;top:auto}
 #order-form :is(input,select,textarea,button),.save-actions>*{scroll-margin-top:80px;scroll-margin-bottom:24px}
}
@media (max-width:600px){
 .save-bar{padding:14px;display:block}
 .save-bar .sticky-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:16px}
 .save-bar .sticky-totals strong{white-space:normal;overflow-wrap:anywhere}
 .save-actions{width:100%;display:flex}
 #client-details[hidden]{display:none!important}
 .client-results button{min-height:44px}
}
@media(max-width:600px){
 #client :is(button,a){max-width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere}
 #client button{display:block;width:100%;text-align:left}
 .save-actions>*{min-width:0;max-width:100%;overflow-wrap:anywhere;flex:1 1 100%}
 .panel .comments{min-width:0;overflow-wrap:anywhere}
}
@media(max-width:600px){
 .panel-head{flex-wrap:wrap;gap:10px}
 .panel-head>*{min-width:0;max-width:100%}
 .panel-head button{white-space:normal;overflow-wrap:anywhere}
}
@media(max-width:360px){
 .mobile-nav{flex-wrap:wrap;height:auto;gap:8px;align-items:center}
 .mobile-nav>*{min-width:0;max-width:100%}
 #order-form :is(input,select,textarea,button),.save-actions>*{scroll-margin-top:120px}
}
