/* Business forms retain their field order. Device controls share a single shell. */
html[data-prototype-style] { --proto-ink:#16433f; --proto-accent:#116b5d; --proto-tint:#e9f5f0; --proto-line:#cbded7; }
html[data-prototype-style=flow] { --proto-ink:#263e66; --proto-accent:#32588b; --proto-tint:#edf3fa; --proto-line:#c3d3e7; }
html[data-prototype-style=worker] { --proto-ink:#4c365c; --proto-accent:#745080; --proto-tint:#f6eef6; --proto-line:#e0cee1; }
.proto-mobile-nav { display:none; }
@media (max-width:760px) {
  html[data-prototype-style] { scroll-padding-top:7rem; -webkit-text-size-adjust:100%; }
  html[data-prototype-style] :where(.container,.main,main,.card,.section,.order-panel,.order-panel-head,.finance-panel,.dialog-body,.modal-body,.order-filters,.toolbar) { min-width:0; max-width:100%; box-sizing:border-box; }
  html[data-prototype-style] :where(input:not([type=checkbox]):not([type=radio]),select,textarea) { max-width:100%; box-sizing:border-box; font-size:max(16px,1em); }
  html[data-prototype-style] :where(button,.btn,.order-button,input[type=submit]) { min-height:38px; touch-action:manipulation; }
  html[data-prototype-style] :where(dialog,.modal-box,.modal-content,.drawer,.drawer-panel) { max-width:100vw; box-sizing:border-box; }
  html[data-prototype-style] :where(.toolbar,.actions,.form-actions,.filter-bar,.order-action-group) { flex-wrap:wrap; }
  html[data-prototype-style] :where(.tabs,.view-tabs,.order-worker-links,.header .right) { max-width:100%; overflow-x:auto; scrollbar-width:thin; }
  html[data-prototype-style] :where(.header .right a,.order-worker-links a) { flex:none; }
  html[data-prototype-style] :where(.table-wrap,.table-scroll,.finance-table-wrap,.ledger-table-wrap,.overview-table-scroll,.order-table-wrap) { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
  html[data-prototype-style] :where(.card,.section,.panel,.main,.container,.modal-body,.content,.card-body):has(>table) { max-width:100%; overflow-x:auto; }
  html[data-prototype-style] .order-worker-header { flex-wrap:wrap; height:auto; }
  html[data-prototype-style] .order-worker-links { display:flex; flex-wrap:nowrap; }
  html[data-prototype-style] body:not(.admin-shell) > .header:has(.right) { height:auto; flex-wrap:wrap; gap:6px; }
  html[data-prototype-style] body:not(.admin-shell) > .header .right { display:flex; flex-wrap:nowrap; align-items:center; }
  html[data-prototype-style] :where(.login-shell,.admin-auth-shell) :where(input,button) { min-height:44px; }
  .proto-mobile-nav { display:flex; align-items:center; flex-wrap:wrap; gap:4px; padding:6px 10px; border-bottom:1px solid var(--proto-line); background:#fff; }
  .proto-mobile-nav a { color:var(--proto-ink); text-decoration:none; padding:7px 11px; border-radius:7px; font-size:13px; font-weight:680; }
  .proto-mobile-nav a[aria-current=page] { background:var(--proto-tint); color:var(--proto-accent); }
}
@media print { .proto-mobile-nav { display:none; } }
@media (max-width:760px) {
  html[data-prototype-style] body.admin-shell > table { display:block; width:100%; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
  html[data-prototype-style] .card-title:has(> button) { flex-wrap:wrap; row-gap:6px; }
}
/* The inventory catalogue already owns this wrapper on phones; constrain wide editable rows on desktop too. */
html[data-prototype-style] .products-table-scroll { min-width:0; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
