/* Mobile is a document to scroll, with a full-screen editor when a preview is open.
   Loaded after desktop workspace rules; no data, form or permission changes. */
@media (max-width:1000px) {
 html:root.mcpromo { -webkit-text-size-adjust:100%; scroll-padding-top:76px; }
 html:root.mcpromo body.app-page { font-size:16px; line-height:1.5; }
 html:root.mcpromo body.app-page .desktop-shell { width:100%!important; min-width:0!important; }
 html:root.mcpromo body.app-page[data-page] .main-shell {
  min-width:0!important; max-width:100%!important; box-sizing:border-box;
  padding:16px 12px calc(var(--mobile-bottom,76px) + 24px)!important;
 }
 html:root.mcpromo body.app-page .main-shell>:is(section,article,form,div),
 html:root.mcpromo body.app-page :is(.panel,.cw-workspace,.crm-workspace,.oi,.supplier-catalog) {
  min-width:0; max-width:100%; box-sizing:border-box;
 }
 html:root.mcpromo body.app-page :is(.mobile-topbar,.desktop-topbar,.desktop-utility-bar) { box-sizing:border-box; }
 html:root.mcpromo body.app-page .mobile-topbar { padding-inline:max(12px,env(safe-area-inset-left)); gap:8px; }
 html:root.mcpromo body.app-page .mobile-brand { flex:1; min-width:0; max-width:none; }
 html:root.mcpromo body.app-page .mobile-brand img { max-width:100%; width:170px; height:auto; max-height:42px; object-fit:contain; }
 html:root.mcpromo body.app-page .mobile-topbar-actions { flex:none; gap:4px; }
 html:root.mcpromo body.app-page :is(.desktop-topbar,.desktop-utility-bar) {
  position:relative!important; top:auto!important; height:auto!important; min-height:0!important;
  padding:12px!important; flex-wrap:wrap!important; gap:10px!important;
 }
 html:root.mcpromo body.app-page .desktop-page-heading { flex:1 1 100%!important; min-width:0!important; }
 html:root.mcpromo body.app-page .desktop-page-heading :is(h1,strong) { font-size:22px!important; line-height:1.3!important; white-space:normal!important; overflow-wrap:anywhere; }
 html:root.mcpromo body.app-page .mobile-topbar:has(.oi-settings-button) { flex-wrap:wrap; }
 html:root.mcpromo body.app-page .mobile-topbar:has(.oi-settings-button) .mobile-topbar-actions { margin-left:auto; }
 html:root.mcpromo body.app-page.r172-order-page .desktop-utility-bar.r172-order-header,
 html:root.mcpromo body.app-page.r172-dropbox-page .desktop-topbar.r172-dropbox-header { height:auto!important; min-height:0!important; grid-template-rows:none!important; gap:12px!important; padding:12px!important; }
 html:root.mcpromo body.app-page :is(.r172-title-row,.r172-identity,.r172-db-title-row,.r172-db-actions) { flex-wrap:wrap; gap:10px; }
 html:root.mcpromo body.app-page .r172-identity h1 { font-size:22px!important; white-space:normal; overflow-wrap:anywhere; }
 html:root.mcpromo body.app-page :is(.r172-facts,.r172-db-information) { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:14px; }
 html:root.mcpromo body.app-page .r172-facts .r172-fact { min-width:0; }
 html:root.mcpromo body.app-page .r172-facts .order-type-form select { width:100%!important; max-width:100%!important; font-size:16px!important; min-height:44px!important; height:auto!important; }
 html:root.mcpromo body.app-page .r172-db-information .dropbox-scan-progress { grid-column:1/-1; }
 html:root.mcpromo body.app-page :is(.button,button,summary) {
  min-height:44px!important; height:auto!important; box-sizing:border-box;
  font-size:14px!important; line-height:1.4!important; touch-action:manipulation;
 }
 html:root.mcpromo body.app-page .button { padding:10px 12px!important; white-space:normal!important; }
 html:root.mcpromo body.app-page :is(input,select,textarea) {
  font-size:16px!important; line-height:1.4!important; min-width:0!important; max-width:100%!important; box-sizing:border-box;
 }
 html:root.mcpromo body.app-page :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select) { min-height:44px!important; height:auto!important; }
 html:root.mcpromo body.app-page textarea { min-height:100px; }
 html:root.mcpromo body.app-page :is(input[type=checkbox],input[type=radio]) { width:22px!important; height:22px!important; min-height:22px!important; flex:none; }
 html:root.mcpromo body.app-page :is(label,.form-grid,.permission-fields) { min-width:0!important; }
 html:root.mcpromo body.app-page :is(.form-grid,.form-grid.two,.form-grid.three,.interface-field-grid-r100,.cw-fields,.payment-delivery-grid,.tracking-fields,.sc-filters,.sc-detail-filters) {
  display:grid!important; grid-template-columns:minmax(0,1fr)!important; gap:14px!important;
 }
 html:root.mcpromo body.app-page :is(.span-two,.span-three,.cw-wide) { grid-column:1/-1!important; }
 html:root.mcpromo body.app-page :is(.form-actions,.work-dialog-actions,.commercial-header-actions-r177,.cw-pagination-actions-r131,.sc-pages,.customer-quick-actions) { gap:8px!important; flex-wrap:wrap!important; }
 html:root.mcpromo body.app-page :is(.commercial-header-actions-r177,.form-actions)>.button { flex:1 1 auto; }
 html:root.mcpromo body.app-page :is(.sales-summary,.cw-metrics,.deadline-summary-grid,.crm-overview-metrics) { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
 html:root.mcpromo body.app-page :is(.crm-board,.cw-board,.sales-detail-grid,.oi-cost-layout) { grid-template-columns:minmax(0,1fr)!important; min-width:0!important; }
 html:root.mcpromo body.app-page :is(.crm-card,.sales-customer-card,.crm-board-card,.cw-board article) { min-width:0!important; max-width:100%!important; }
 html:root.mcpromo body.app-page :is(.crm-card,.sales-customer-card,.crm-board-card,.email-thread,.customer-section-panel) p { font-size:14px!important; overflow-wrap:anywhere; }
 html:root.mcpromo body.app-page :is(.table-scroll,.sc-table-wrap,.oi-table-wrap,.table-wrapper) { min-width:0!important; max-width:100%!important; overflow-x:auto; -webkit-overflow-scrolling:touch; }
 html:root.mcpromo body.app-page :is(.workspace-tabs-r177,.order-tabs,.customer-section-nav.workspace-tabs-r177) {
  display:flex!important; flex-wrap:nowrap!important; overflow-x:auto!important; max-width:100%;
  gap:0!important; scroll-padding-inline:12px; scrollbar-width:thin;
 }
 html:root.mcpromo body.app-page.r172-order-page .desktop-shell>.order-tabs.workspace-tabs-r177,
 html:root.mcpromo body.app-page.r172-order-page .desktop-shell>.order-tabs.workspace-tabs-r177:has(>a[hidden]) { display:flex!important; overflow-x:auto!important; }
 html:root.mcpromo body.app-page :is(.workspace-tabs-r177,.order-tabs,.customer-section-nav.workspace-tabs-r177)>a {
  flex:0 0 auto!important; min-width:105px!important; min-height:46px!important; font-size:14px!important; padding:12px!important; white-space:nowrap!important;
 }
 html:root.mcpromo body.app-page .mobile-bottom-nav { z-index:115; }
 html:root.mcpromo body.app-page .mobile-bottom-nav>a { font-size:11px!important; min-height:52px!important; }
 html:root.mcpromo body.app-page .sidebar { z-index:220; padding-top:calc(12px + env(safe-area-inset-top))!important; padding-bottom:calc(12px + env(safe-area-inset-bottom))!important; }
 html:root.mcpromo body.app-page .mobile-menu-shade { z-index:210; }
 html:root.mcpromo body.app-page .sidebar .nav-item { font-size:15px!important; min-height:46px!important; }
 html:root.mcpromo body.app-page .operational-inbox { max-width:100vw; width:min(100%,430px); box-sizing:border-box; }
 /* Native dialogs stay inside the visible viewport, including when the keyboard opens. */
 html:root.mcpromo body.app-page dialog {
  position:fixed!important; inset:auto!important; top:calc(var(--mobile-viewport-top,0px) + 8px)!important; left:8px!important;
  margin:0 auto!important; width:calc(100% - 16px)!important; min-width:0!important; max-width:640px!important;
  max-height:calc(var(--mobile-viewport-height,100dvh) - 16px)!important;
  padding:16px!important; box-sizing:border-box; overflow:auto!important; overscroll-behavior:contain;
  scroll-padding-block:12px 84px; border-radius:12px!important;
 }
 html:root.mcpromo body.app-page dialog :is(.work-dialog-head,.sc-dialog-head) { gap:10px; flex-wrap:wrap; }
 html:root.mcpromo body.app-page dialog :is(.work-dialog-actions,.dialog-actions,.sc-dialog-actions) {
  position:sticky; bottom:-16px; z-index:2; background:#fff; margin-bottom:-16px;
  padding:12px 0 calc(12px + env(safe-area-inset-bottom)); display:flex; gap:8px;
 }
 html:root.mcpromo body.app-page dialog :is(.work-dialog-actions,.dialog-actions,.sc-dialog-actions)>.button { flex:1; }
 html:root.mcpromo body.app-page :is(.appointment-context-grid-r132,.appointment-customer-r132,.appointment-notifications-r132) { grid-template-columns:minmax(0,1fr)!important; }
 html:root.mcpromo body.app-page .mcpc-panel-r112 { scroll-padding-bottom:16px; }
 /* The desktop list must not trap the entire page in a short scrolling box. */
 html:root.mcpromo.preview-workbench-page,
 html:root.mcpromo.preview-workbench-page body { overflow:visible; }
 html:root.mcpromo body.app-page[data-page] .preview-workbench-r178 {
  display:block!important; height:auto!important; min-height:0!important; overflow:visible!important;
 }
 html:root.mcpromo body.app-page .preview-list-r178 { display:flex!important; height:auto!important; overflow:visible!important; padding-top:0; }
 html:root.mcpromo body.app-page .preview-list-r178>:is(.orders-table-r73,.cw-client-list-r131),
 html:root.mcpromo body.app-page .preview-order-scroll-r178 { display:block!important; height:auto!important; max-height:none!important; overflow:visible!important; }
 html:root.mcpromo body.app-page .preview-list-r178>.cw-client-toolbar-r131 { padding:0 0 14px!important; }
 html:root.mcpromo body.app-page .preview-workbench-r178 :is(.orders-search-r73,.cw-search-filters) {
  display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important;
  flex-wrap:wrap!important; gap:10px!important; margin:0 0 14px!important;
 }
 html:root.mcpromo body.app-page .preview-workbench-r178 :is(.orders-search-r73,.cw-search-filters)>label { width:100%!important; min-width:0!important; font-size:14px!important; }
 html:root.mcpromo body.app-page .preview-workbench-r178 :is(.search-field,.cw-query-r131) { grid-column:1/-1; }
 html:root.mcpromo body.app-page .preview-workbench-r178 :is(.orders-search-r73,.cw-search-filters) :is(input,select) { font-size:16px!important; min-height:44px!important; height:auto!important; }
 html:root.mcpromo body.app-page .preview-workbench-r178 :is(.orders-search-r73,.cw-search-filters) :is(.button,summary) { font-size:14px!important; min-height:44px!important; height:auto!important; white-space:normal!important; width:100%!important; }
 html:root.mcpromo body.app-page .preview-workbench-r178 :is(.orders-search-r73,.cw-search-filters)>.workspace-sort-r180 { order:0; }
 html:root.mcpromo body.app-page .preview-list-r178 .cw-client-list-r131>.cw-client-columns-r131 { display:none!important; }
 html:root.mcpromo body.app-page .preview-list-r178 .cw-client-list-r131>.cw-row {
  display:grid!important; grid-template-columns:minmax(0,1fr)!important; min-width:0; gap:8px!important;
  padding:16px 12px!important; white-space:normal!important; border-bottom:1px solid #dce1e8;
 }
 html:root.mcpromo body.app-page .preview-list-r178 .cw-client-list-r131>.cw-row>* { display:block!important; font-size:14px!important; white-space:normal!important; overflow-wrap:anywhere; }
 html:root.mcpromo body.app-page .preview-list-r178 .cw-client-list-r131>.cw-row>strong { font-size:17px!important; }
 html:root.mcpromo body.app-page .preview-list-r178 .cw-client-list-r131>.cw-row small { font-size:13px!important; white-space:normal!important; }
 html:root.mcpromo body.app-page .preview-list-r178 .pagination { padding:14px 0!important; display:flex!important; flex-wrap:wrap!important; gap:12px!important; font-size:14px!important; }
 html:root.mcpromo body.app-page .preview-list-r178 .pagination input { width:76px!important; }
 html:root.mcpromo.preview-mobile-open,
 html:root.mcpromo.preview-mobile-open body { overflow:hidden!important; }
 html:root.mcpromo.preview-mobile-open body.app-page .mobile-bottom-nav { display:none!important; }
 html:root.mcpromo body.app-page .preview-workbench-r178.has-preview>.preview-list-r178 { display:none!important; }
 html:root.mcpromo body.app-page .preview-workbench-r178.has-preview>.preview-pane-r178 {
  position:fixed!important; left:0!important; top:var(--mobile-viewport-top,0px)!important; right:0!important;
  width:100%!important; height:var(--mobile-viewport-height,100dvh)!important; max-height:none!important;
  z-index:200; border:0!important; padding-top:env(safe-area-inset-top); box-sizing:border-box;
 }
 html:root.mcpromo body.app-page :is(.operational-editor-r178,.client-editor-r178) { height:100%; min-height:0; }
 html:root.mcpromo body.app-page :is(.preview-pane-tools-r178,.preview-header-tools-r181) { top:10px; right:10px; }
 html:root.mcpromo body.app-page :is(.preview-pane-tools-r178,.preview-header-tools-r181)>.button {
  width:44px!important; height:44px!important; min-width:44px!important; min-height:44px!important; font-size:24px!important; padding:6px!important;
 }
 html:root.mcpromo body.app-page [data-preview-expand] { display:none!important; }
 html:root.mcpromo body.app-page .preview-editor-heading-r178 { padding:14px 12px!important; }
 html:root.mcpromo body.app-page .preview-editor-heading-r178 h2 { font-size:20px!important; margin-right:52px!important; min-height:44px; overflow-wrap:anywhere; }
 html:root.mcpromo body.app-page .preview-editor-heading-r178 p { font-size:13px!important; }
 html:root.mcpromo body.app-page .preview-editor-body-r178 { padding:16px 12px!important; font-size:15px!important; scroll-padding-bottom:24px; }
 html:root.mcpromo body.app-page .preview-editor-body-r178 :is(p,label,dt,dd,.muted-copy) { font-size:14px!important; }
 html:root.mcpromo body.app-page .preview-editor-body-r178 :is(.form-grid,.tracking-fields,.permission-fields,.draft-recipient-group,.tracking-recipient) { grid-template-columns:minmax(0,1fr)!important; gap:14px!important; }
 html:root.mcpromo body.app-page .preview-editor-body-r178 :is(input,select,textarea) { font-size:16px!important; }
 html:root.mcpromo body.app-page .preview-editor-tabs-r178 { display:flex; overflow-x:auto; }
 html:root.mcpromo body.app-page .preview-editor-tabs-r178 a { flex:1 0 86px; min-height:46px; font-size:14px!important; }
 html:root.mcpromo body.app-page .preview-editor-footer-r178 { padding:10px 12px calc(10px + env(safe-area-inset-bottom))!important; gap:8px; flex-wrap:wrap; }
 html:root.mcpromo body.app-page .preview-editor-footer-r178 .button { min-height:44px!important; font-size:14px!important; }
 html:root.mcpromo body.app-page .client-preview-actions-r194 { width:100%; display:flex; gap:8px; }
 html:root.mcpromo body.app-page .client-preview-actions-r194>.button { flex:1; }
 html:root.mcpromo body.app-page .client-preview-open-r194 { width:100%; }
 html:root.mcpromo body.app-page .draft-item-card { grid-template-columns:22px minmax(0,1fr)!important; gap:10px!important; }
 html:root.mcpromo body.app-page .draft-item-card>.document-actions,
 html:root.mcpromo body.app-page .preview-draft-actions-r181>.document-actions { grid-column:1/-1!important; grid-row:auto!important; display:flex!important; flex-direction:row!important; flex-wrap:wrap; align-items:stretch!important; }
 html:root.mcpromo body.app-page .draft-item-card .document-actions>.button,
 html:root.mcpromo body.app-page .draft-selection-tools-r182>.button { min-height:44px!important; height:auto!important; font-size:14px!important; white-space:normal!important; padding:10px!important; }
 /* Existing line inputs stay in the same table/form, presented as labeled records. */
 html:root.mcpromo body.app-page table.mobile-records-r206 { display:block!important; width:100%!important; min-width:0!important; max-width:100%!important; table-layout:auto!important; }
 html:root.mcpromo body.app-page table.mobile-records-r206>colgroup,
 html:root.mcpromo body.app-page table.mobile-records-r206>thead { display:none!important; }
 html:root.mcpromo body.app-page table.mobile-records-r206>tbody { display:grid!important; width:100%; gap:16px; }
 html:root.mcpromo body.app-page table.mobile-records-r206>tbody>tr { display:grid!important; grid-template-columns:minmax(0,1fr)!important; gap:12px; padding:16px!important; border:1px solid #dce1e8; border-radius:10px; width:100%!important; box-sizing:border-box; }
 html:root.mcpromo body.app-page table.mobile-records-r206>tbody>tr>td { display:block!important; grid-column:1/-1!important; min-width:0!important; width:100%!important; padding:0!important; border:0!important; white-space:normal!important; box-sizing:border-box; }
 html:root.mcpromo body.app-page table.mobile-records-r206>tbody>tr>td::before { content:attr(data-label); display:block!important; font-size:13px; font-weight:600; color:#566174; margin-bottom:5px; }
 html:root.mcpromo body.app-page table.mobile-records-r206>tbody>tr>td:not([data-label])::before { display:none!important; }
 html:root.mcpromo body.app-page .oi .oi-entry-table .oi-variant { grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important; gap:8px!important; }
 html:root.mcpromo body.app-page .oi .oi-entry-table :is(input,select,textarea) { width:100%!important; }
 html:root.mcpromo body.app-page .oi .oi-entry-table .oi-entry-name { position:static!important; }
 html:root.mcpromo body.app-page .oi :is(.oi-tabs,.oi-steps) { display:flex!important; overflow-x:auto; flex-wrap:nowrap; max-width:100%; }
 html:root.mcpromo body.app-page .oi :is(.oi-tabs,.oi-steps)>button { flex:0 0 auto; }
 html:root.mcpromo body.app-page .sc-detail-scroll { max-height:none; }
 html:root.mcpromo body.app-page .sc-dialog .sc-detail-scroll { max-height:55dvh; overflow:auto; }
 html:root.mcpromo body.app-page [hidden],
 html:root.mcpromo body.app-page .preview-workbench-r178 [hidden],
 html:root.mcpromo body.app-page table.mobile-records-r206>tbody>tr[hidden],
 html:root.mcpromo body.app-page table.mobile-records-r206>tbody>tr>td[hidden] { display:none!important; }
}
