/* Touch layouts: a tool occupies the screen instead of nesting small windows. */
@media(max-width:760px){
 html.mobile-tool-active,html.mobile-tool-active body{overflow:hidden!important}
 html.mobile-tool-active iframe.mobile-tool-frame{position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:none!important;z-index:10050!important;border:0!important;background:#f4f8fa}
 .stable-reader-host:has(>.mobile-tool-frame){position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;z-index:10040!important;border:0!important}
 .stable-reader-host:has(>.mobile-tool-frame)>.stable-reader-back{display:none!important}
 dialog.hub-quote-dialog,dialog.hub-order-dialog,dialog.hub-order-dialog.product-movable,dialog.doc-catalog-dialog,dialog.stamp-explorer{position:fixed!important;inset:0!important;margin:0!important;transform:none!important;width:100%!important;max-width:100%!important;min-width:0!important;height:100dvh!important;max-height:100dvh!important;min-height:0!important;border:0!important;border-radius:0!important;resize:none!important;box-sizing:border-box}
 .hub-quote-header,.hub-order-header{padding:8px 12px!important;gap:6px!important;flex-wrap:wrap!important;flex-shrink:0;touch-action:pan-y!important}
 .hub-quote-header>div:first-child,.hub-order-header>div:first-child{min-width:0;flex:1 1 180px}
 .hub-quote-header h2,.hub-order-header h2{font-size:18px!important;margin:2px 0!important}
 .hub-quote-header small,.hub-order-header small,.hub-quote-context,.hub-order-context{display:none!important}
 .hub-quote-header p,.hub-order-header p{font-size:12px!important;max-height:32px;overflow:auto}
 .hub-quote-controls,.hub-order-controls,.product-window-controls{flex-direction:row!important;gap:4px!important;flex-wrap:wrap}
 .hub-quote-controls button,.hub-order-controls button,.product-window-controls button{min-height:44px;padding:8px!important;font-size:13px}
 .hub-quote-controls button[aria-pressed],.hub-order-controls button[aria-pressed]{display:none!important}
 .hub-quote-status,.hub-order-status{padding:5px 12px!important;font-size:11px!important;max-height:42px;overflow:auto;flex-shrink:0}
 dialog:has(iframe.mobile-tool-frame) .hub-quote-header,dialog:has(iframe.mobile-tool-frame) .hub-order-header,dialog:has(iframe.mobile-tool-frame) .hub-quote-status,dialog:has(iframe.mobile-tool-frame) .hub-order-status{display:none!important}
 .order-modern-form input:not([type=checkbox]):not([type=radio]),.order-modern-form select,.order-modern-form textarea,dialog input:not([type=checkbox]):not([type=radio]),dialog select,dialog textarea{font-size:16px!important;max-width:100%;box-sizing:border-box}
 .order-form-layout,.order-form-grid,.order-item-content,.ipc-details{grid-template-columns:minmax(0,1fr)!important;min-width:0}
 .order-item-card{grid-template-columns:minmax(0,1fr)!important;padding:12px!important;min-width:0}
 .order-item-values{grid-template-columns:1fr 1fr!important;gap:10px!important}.order-item-values> :last-child{grid-column:1/-1}
 .order-form-section{padding:14px 10px!important}.order-modern-form button,.order-modern-form .btn{min-height:44px}
 .order-form-actions{position:relative;grid-template-columns:1fr!important;gap:8px;padding-bottom:env(safe-area-inset-bottom,12px)}
 .stamp-head{padding:10px 12px!important;gap:8px}.stamp-head h2{font-size:19px!important;margin:2px 0}.stamp-eyebrow{display:none}.stamp-close{width:44px;height:44px}
 .stamp-tools{padding:8px 12px!important;max-height:45dvh;overflow:auto}.stamp-search input{font-size:16px!important;padding:10px 0}
 .stamp-filter-fold{margin-top:8px;border:1px solid #d0e0e8;border-radius:9px}.stamp-filter-fold>summary{padding:10px;min-height:44px;box-sizing:border-box;color:#12536b;font-weight:700;cursor:pointer}.stamp-filter-fold .stamp-filters{padding:0 10px 10px;margin-top:0}
 .stamp-workspace{min-height:0;overflow:auto!important;overscroll-behavior:contain}.stamp-browse{padding:12px!important}.stamp-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px}.stamp-card-copy{padding:9px}.stamp-card-copy>strong{font-size:18px}
 .stamp-explorer:not(.mobile-detail) .stamp-detail{display:none}
 .stamp-explorer.mobile-detail .stamp-tools,.stamp-explorer.mobile-detail .stamp-browse{display:none}
 .stamp-explorer.mobile-detail .stamp-detail{min-height:100%;border:0}.stamp-detail-content{overflow:visible}.stamp-detail-footer{position:sticky;bottom:0;padding:10px 12px max(10px,env(safe-area-inset-bottom));z-index:2}.stamp-add{min-height:48px;font-size:16px!important}
 .stamp-back{display:block;width:100%;min-height:44px;border:1px solid #bdd6e1;border-radius:9px;padding:10px;background:#fff;color:#12536b;margin:0 0 12px;text-align:left;font:inherit}
 .doc-catalog-dialog[open]{display:flex;flex-direction:column}.doc-catalog-dialog>header{flex-shrink:0;gap:8px;padding:10px 12px}.doc-catalog-dialog>header button{min-width:44px;min-height:44px}.doc-catalog-content{flex:1;min-height:0;max-height:none!important;overflow:auto!important;padding:12px!important}.doc-catalog-filters{padding:10px 12px;gap:8px;max-height:35dvh;overflow:auto;flex-shrink:0}.doc-catalog-large{height:26dvh}.doc-catalog-detail{gap:12px}.doc-catalog-detail>section{padding:12px}
 .bulk-dialog{width:100%!important;max-width:100%!important;max-height:100dvh!important;border-radius:0;margin:auto 0}.bulk-dialog button{min-height:44px}.bulk-content{padding:12px}
}
@media(min-width:761px){.stamp-filter-fold>summary,.stamp-back{display:none}.stamp-filter-fold:not([open])>.stamp-filters{display:grid}}

.mobile-form-nav{display:none}
@media(max-width:760px){
 .mobile-form-nav{display:flex;position:sticky;top:0;z-index:25;gap:8px;padding:8px;background:#f4f8fa;border-bottom:1px solid #cddfe6}
 .mobile-form-nav button{flex:1;min-height:44px;border:1px solid #b8d8df;border-radius:10px;background:white;color:#12536b;font-weight:700;font-size:14px;cursor:pointer}
 .order-form-section,.order-form-aside{scroll-margin-top:68px}
 .product-results{max-width:100%!important;overflow-x:hidden!important}
 .product-results button{white-space:normal!important;min-width:0!important;overflow-wrap:anywhere}
 .product-results button>*{min-width:0;white-space:normal!important}
}
@media(max-width:760px){
 dialog.hub-tool-dialog,dialog.chat-floating-tool{position:fixed!important;inset:0!important;margin:0!important;width:100%!important;max-width:100%!important;height:100dvh!important;max-height:100dvh!important;border:0!important;border-radius:0!important;padding:0!important;box-sizing:border-box;overflow:auto}
 dialog.chat-floating-tool[open]{display:flex;flex-direction:column}
 .chat-floating-tool>header,.hub-tool-head{padding:10px 12px!important;flex-shrink:0;gap:8px!important}
 .chat-floating-tool>header h2{font-size:18px!important}.chat-floating-tool>header button{min-height:44px}
 .chat-floating-tool iframe{flex:1;min-height:0;height:100%!important}
 .chat-floating-tool .ia-calculator,.chat-floating-tool .qr-menu{max-height:none!important;overflow:auto;min-height:0;flex:1;padding:12px!important}
 .hub-tool-content{padding:12px!important}.hub-tool-head{flex-wrap:wrap}
}

.quote-prepare-jump{display:block!important;background:#edf8f8;color:#087a76}
@media(max-width:760px){
 .quote-saved{margin:0!important;max-width:none!important;padding:12px!important;border:0;border-radius:0;box-sizing:border-box;overflow-wrap:anywhere}
 .quote-saved h1{font-size:21px}.quote-saved button,.quote-saved a,.quote-saved summary.quote-text-button{max-width:100%;box-sizing:border-box;white-space:normal;min-height:44px}
 .quote-saved button,.quote-saved summary.quote-text-button{width:100%;margin:6px 0!important}
 .quote-saved textarea{font-size:16px;min-height:160px;max-height:34dvh;resize:vertical;padding:10px;border:1px solid #9ebfc8;border-radius:8px}
 .quote-saved input[type=checkbox]{flex:0 0 22px;width:22px!important;height:22px;vertical-align:middle}
 .quote-saved [data-quote-images] label{flex-wrap:wrap;padding:10px;border:1px solid #d2e4e8;border-radius:10px;overflow-wrap:anywhere}
 .quote-saved fieldset{min-width:0;box-sizing:border-box}.quote-saved input[type=file]{width:100%;font-size:16px}
 .inbox26.chat-layout .hub-composer{max-height:55%!important;flex-shrink:0;overflow:visible!important}
 .inbox26.chat-layout .ia-draft{max-height:22dvh;overflow:auto;overscroll-behavior:contain;flex-shrink:1;gap:4px;padding:6px}
 .inbox26.chat-layout .ia-draft>p{width:100%;margin:0;font-size:12px}.inbox26.chat-layout .ia-draft small{overflow-wrap:anywhere}
 .inbox26.chat-layout .chat-compose-line{flex-shrink:0}.inbox26.chat-layout .chat-compose-line textarea{max-height:18dvh!important;font-size:16px}
 .inbox26.chat-layout .chat-compose-line button{min-width:44px;min-height:44px}
}

/* Keep the send controls reachable on short phone viewports. */
@media(max-width:760px) and (max-height:600px){
 .inbox26.chat-layout .hub-composer{position:fixed!important;bottom:0!important;left:0;right:0;z-index:80;margin:0!important;max-height:55dvh!important;overflow:auto!important;border-radius:14px 14px 0 0;padding-bottom:max(8px,env(safe-area-inset-bottom));box-sizing:border-box}
 .inbox26.chat-layout .ia-draft{max-height:18dvh}
 .inbox26.chat-layout .chat-compose-line{position:sticky;bottom:0;background:white;z-index:2;padding:4px 0}
 .inbox26.chat-layout .chat-compose-line textarea{max-height:12dvh!important;min-height:44px}
}
