/* 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; }
.proto-hub { color:#203531; }
.proto-hero { margin-block:22px 20px; padding:clamp(18px,3vw,38px); border:1px solid var(--proto-line); border-radius:16px; background:linear-gradient(105deg,var(--proto-tint),#fff); }
.proto-hero p { margin:0; font-size:.82rem; color:var(--proto-accent); font-weight:700; letter-spacing:.08em; }
.proto-hero h1 { margin:.35em 0 .25em; font-size:clamp(1.65rem,3vw,2.5rem); line-height:1.18; color:var(--proto-ink); }
.proto-hero span,.proto-panel p,.proto-panel small { color:#526560; line-height:1.6; }
.proto-panel { margin-block:14px; padding:clamp(14px,2.2vw,26px); background:white; border:1px solid var(--proto-line); border-radius:14px; }
.proto-panel h2 { margin:0 0 12px; color:var(--proto-ink); font-size:1.18rem; }
.proto-panel header p { margin:0 0 12px; }
.proto-steps,.proto-lookup,.proto-owner-grid { display:grid; gap:10px; margin:0; padding:0; list-style:none; grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr)); }
.proto-steps li { min-width:0; }
.proto-step,.proto-lookup a,.proto-owner-grid article { min-width:0; box-sizing:border-box; border:1px solid var(--proto-line); border-radius:10px; background:#fff; padding:16px; color:var(--proto-ink); }
.proto-step { height:100%; display:flex; align-items:flex-start; gap:10px; text-decoration:none; }
.proto-step b,.proto-lookup b { display:block; font-size:1.02rem; }
.proto-seq { display:inline-grid; place-items:center; min-width:2em; min-height:2em; border-radius:6px; font-weight:750; background:var(--proto-tint); color:var(--proto-accent); font-variant-numeric:tabular-nums; }
.proto-enter { margin-left:auto; }
.proto-step small,.proto-lookup small { margin-top:4px; display:block; }
.proto-lookup a { display:block; text-decoration:none; }
.proto-hub a:hover,.proto-hub summary:hover { background:var(--proto-tint); }
.proto-hub a:focus-visible,.proto-hub summary:focus-visible,.proto-hub button:focus-visible { outline:3px solid var(--proto-accent); outline-offset:2px; }
[data-prototype-style=flow] .proto-steps { grid-template-columns:1fr; }
[data-prototype-style=flow] .proto-step { height:auto; align-items:center; }
[data-prototype-style=flow] .proto-seq { border-radius:50%; }
.proto-preview { margin:5px 0 2px 20px; padding:3px 12px; border-left:2px solid var(--proto-line); }
.proto-preview summary { padding:8px; color:var(--proto-accent); cursor:pointer; font-weight:bold; }
.proto-task { display:block; width:fit-content; max-width:100%; padding:8px; color:var(--proto-ink); text-decoration:underline; text-underline-offset:.2em; }
.proto-owner-search { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:16px 0; }
.proto-owner-search input,.proto-owner-search button { min-height:42px; border:1px solid var(--proto-line); border-radius:7px; padding-inline:12px; font:inherit; }
.proto-owner-search button,.proto-cta { color:white; background:var(--proto-accent); border:0; padding:8px 10px; border-radius:6px; font-weight:650; cursor:pointer; }
.proto-hub a.proto-cta:hover { background:var(--proto-ink); color:white; }
.proto-owner-grid article header { display:flex; align-items:baseline; gap:8px; justify-content:space-between; flex-wrap:wrap; }
.proto-owner-grid article h3 { margin:0; font-size:1rem; overflow-wrap:anywhere; }
.proto-owner-grid article > div { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.proto-cta { display:inline-block; text-decoration:none; font-size:.88rem; }
.proto-quiet { color:var(--proto-ink); background:var(--proto-tint); }
@media (min-width:761px) {
  html[data-prototype-style=desk] .proto-step { display:grid; grid-template-columns:1fr auto; }
  html[data-prototype-style=desk] .proto-step .proto-seq { grid-column:1 / -1; width:fit-content; }
  html[data-prototype-style] .proto-hub .proto-people { border-left:4px solid var(--proto-accent); }
}
@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); }
  .proto-hub .proto-hero { margin-block:12px; }
  .proto-steps,.proto-owner-grid,.proto-lookup { grid-template-columns:minmax(0,1fr); }
  .proto-owner-search input { flex:1; min-width:110px; }
  .proto-owner-search label { width:100%; }
  .proto-owner-grid .proto-cta { min-height:42px; display:inline-flex; align-items:center; }
}
@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; }
