/* Scoped mobile layer; desktop and printed documents keep their original layout. */
:root{--ma-background:#f8fafc;--ma-surface:#fff;--ma-text:#1e293b;--ma-muted:#526177;--ma-line:#dce3ec;--ma-primary:#2563eb;--ma-radius:12px;--ma-touch:44px;--ma-keyboard:0px}
#maConnection[hidden]{display:none}
#maConnection{position:fixed;top:64px;left:12px;right:12px;z-index:31000;padding:12px;background:#fff7ed;color:#92400e;border:1px solid #fed7aa;border-radius:8px;font-size:14px;line-height:1.5}
.ma-fold{border:1px solid var(--ma-line);border-radius:var(--ma-radius);margin:12px 0;background:var(--ma-surface)}
.ma-fold>summary{cursor:pointer;padding:12px;min-height:var(--ma-touch);box-sizing:border-box;font-size:14px;font-weight:600;color:var(--ma-text)}
.ma-fold>:not(summary){margin:12px}
.ma-sheet{display:none}
@media screen and (max-width:760px){
 body.ui-v2-preview{color:var(--ma-text)!important;font-variant-numeric:tabular-nums}
 body.ui-v2-preview.workbench-shell{padding-bottom:calc(98px + env(safe-area-inset-bottom,0px))!important}
 body.ui-v2-preview :is(button,summary,a.button){min-height:var(--ma-touch);touch-action:manipulation}
 body.ui-v2-preview :is(input,textarea,select){scroll-margin-top:90px;scroll-margin-bottom:180px}
 body.ui-v2-preview :is(h1,h2,h3){scroll-margin-top:84px}
 body.ui-v2-preview #wbForward{display:none!important}
 body.ui-v2-preview #wbTopbar #wbHistoryTools button{width:44px!important}
 body.ui-v2-preview #wbPageTitle{font-weight:600}
 body.ui-v2-preview #coInboxOpen{min-height:44px!important;min-width:70px!important;background:#fff!important;border:1px solid var(--ma-line)!important;box-shadow:0 3px 12px #16253b12}
 body.ui-v2-preview #wbDashboard{padding:16px!important}
 body.ui-v2-preview #wbDashboard h1{font-size:22px!important;margin:0}
 body.ui-v2-preview #wbDashboard>p{margin:6px 0 20px;font-size:14px}
 body.ui-v2-preview .wb-dashboard-metrics{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 body.ui-v2-preview .wb-dashboard-metrics .wb-metric{order:var(--ma-order);padding:14px!important;text-align:left;border:1px solid var(--ma-line)!important;background:#fff!important;border-radius:10px!important;min-height:84px}
 body.ui-v2-preview .wb-metric span{font-size:14px!important;color:var(--ma-muted)}
 body.ui-v2-preview .wb-metric strong{font-size:26px!important;color:var(--ma-text)}
 body.ui-v2-preview .wb-recent-order{font-size:14px!important;line-height:1.6!important;text-align:left;padding:14px!important;min-height:64px!important;white-space:normal!important;overflow-wrap:anywhere}
 body.ui-v2-preview #editPage>h2{font-size:22px!important;margin:0 0 16px}
 body.ui-v2-preview #editPage>.ma-fold .ai5{border:0;padding:0;margin:12px;background:transparent}
 body.ui-v2-preview #productGallery5{grid-template-columns:1fr!important;gap:8px!important;max-height:55dvh;overflow-y:auto;overscroll-behavior-y:contain}
 body.ui-v2-preview #productGallery5>.product5{display:grid;grid-template-columns:64px minmax(0,1fr);gap:8px;min-height:80px!important;text-align:left;padding:8px!important;align-items:center}
 body.ui-v2-preview #productGallery5>.product5>:is(img,.mailimage5){width:64px!important;height:64px!important;object-fit:contain;grid-row:1/3}
 body.ui-v2-preview #productGallery5>.product5>:is(b,p){font-size:13px!important;min-width:0;overflow-wrap:anywhere;margin:0}
 body.ui-v2-preview #items>.item{padding:12px!important;margin:12px 0!important;border-radius:10px}
 body.ui-v2-preview .ma-form-actions{position:sticky;bottom:calc(70px + env(safe-area-inset-bottom,0px));z-index:48;display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:12px!important;margin:16px -14px -14px!important;background:#fff!important;border-top:1px solid var(--ma-line);box-shadow:0 -4px 12px #16253b08}
 body.ma-order-edit #coInboxOpen{bottom:calc(142px + env(safe-area-inset-bottom,0px))}
 body.ma-keyboard-open #fmBottomNav{display:none!important}
 body.ma-keyboard-open .ma-form-actions{position:fixed;bottom:var(--ma-keyboard);left:0;right:0;margin:0!important}
 body.ma-keyboard-open #coInboxOpen{display:none!important}
 body.ui-v2-preview.workbench-shell #listPage{padding:14px!important}
 body.ui-v2-preview #listPage>h2{font-size:22px;margin:0 0 16px}
 body.ui-v2-preview #orderList .order5{padding:14px!important;border-radius:12px!important}
 body.ui-v2-preview .order5 h3{font-size:16px!important;line-height:1.5!important}
 body.ui-v2-preview #productGrid .productInfo{padding:14px!important}
 body.ui-v2-preview .lc-category-strip,body.ui-v2-preview #lcStatusStrip{max-width:100%;overflow-x:auto;flex-wrap:nowrap!important}
 body.ui-v2-preview #lcStatusStrip>*{flex:none}
 body.ui-v2-preview .ma-detail-table{display:block;width:100%!important;min-width:0!important;border:0!important}
 body.ui-v2-preview .ma-detail-table :is(tbody,tr,td){display:block!important;width:auto!important;min-width:0!important;box-sizing:border-box}
 body.ui-v2-preview .ma-detail-table tr:first-child:has(th){position:absolute;width:1px!important;height:1px;overflow:hidden;clip-path:inset(50%)}
 body.ui-v2-preview .ma-detail-table tr:not(:first-child){padding:12px 0;border-bottom:1px solid var(--ma-line)}
 body.ui-v2-preview .ma-detail-table td{display:grid!important;grid-template-columns:88px minmax(0,1fr);gap:12px;border:0!important;padding:5px 0!important;font-size:14px!important;overflow-wrap:anywhere}
 body.ui-v2-preview .ma-detail-table td::before{content:attr(data-ma-label);color:var(--ma-muted);font-size:13px}
 body.ui-v2-preview.workbench-shell dialog.ma-sheet[open]{display:flex!important;flex-direction:column;position:fixed!important;inset:auto 0 var(--ma-keyboard) 0!important;margin:0!important;width:100%!important;max-width:100%!important;max-height:calc(90dvh - var(--ma-keyboard))!important;border:0!important;border-radius:16px 16px 0 0!important;padding:0!important;background:#fff;overflow:hidden}
 .ma-sheet::backdrop{background:#13223866}
 body.ma-sheet-open{overflow:hidden!important}
 body.ui-v2-preview dialog.ma-sheet>header{display:flex!important;justify-content:space-between;align-items:center;gap:16px;flex:none;position:static!important;padding:16px!important;margin:0!important;background:#fff!important;color:var(--ma-text)!important;border-bottom:1px solid var(--ma-line)!important;box-shadow:none!important}
 body.ui-v2-preview dialog.ma-sheet>header h2{font-size:18px!important;color:var(--ma-text)!important;margin:0!important}
 body.ui-v2-preview dialog.ma-sheet>header button{flex:none;min-width:64px;min-height:44px;color:#fff!important;background:var(--ma-primary)!important}
 .ma-sheet-body{padding:16px 16px calc(20px + env(safe-area-inset-bottom,0px));overflow-y:auto;overscroll-behavior:contain;min-height:0}
 .ma-sheet-body :is(#fvFilters,.grid){display:grid!important;grid-template-columns:1fr!important;gap:14px!important;padding:0!important;border:0!important;background:transparent!important}
 .ma-sheet-body #wbTopActions{position:static!important;width:auto!important;max-width:100%!important;padding:0!important;display:grid!important;grid-template-columns:1fr!important}
 .ma-sheet-body #wbTopActions button{font-size:15px!important;text-align:left}
 .ma-sheet-body :is(input,select,textarea){font-size:16px!important;width:100%;max-width:100%}
 .ma-sheet-body :is(input[type=checkbox],input[type=radio]){width:auto}
 .ma-sheet-body :is(nav,.toolbar5){display:flex;flex-wrap:wrap;gap:8px}
 body.ui-v2-preview.workbench-shell dialog.co-dialog{width:calc(100vw - 16px)!important;padding:16px!important;max-height:calc(92dvh - var(--ma-keyboard))!important;margin:auto auto max(8px,var(--ma-keyboard))!important}
 body.ui-v2-preview :is(#wbDetailAnchors,.dossier-tabs){scroll-padding-inline:12px;overscroll-behavior-x:contain}
}
@media print{.ma-sheet,#maConnection,.ma-form-actions{display:none!important}}
@media(prefers-reduced-motion:reduce){.ma-sheet,.ma-fold{scroll-behavior:auto}}

@media screen and (max-width:760px){.ma-order-search{display:block;margin:12px 0;font-size:13px}.ma-order-search input{width:100%}}

/* Keep secondary product actions easy to tap on phones. */
@media screen and (max-width:760px){
 body.fv-refined.ui-v2-preview.fiyaoo-branded.workbench-shell #library #productGrid .product-more5 .fl-menu button,
 body.fv-refined.ui-v2-preview.fiyaoo-branded.workbench-shell #library #productGrid .product-more5 .fl-menu a.button,
 body.ui-v2-preview.workbench-shell [data-lg-step]{
  min-height:44px!important;
  padding-block:10px!important;
 }
 body.ui-v2-preview #fiyaooRemoteNotice{
  position:static;transform:none;max-width:none;
  margin:12px 16px calc(84px + env(safe-area-inset-bottom,0px));
  padding:8px 12px;border-radius:8px;box-shadow:none;font-size:12px;
 }
 /* Expand in the card instead of placing a clipped popup under the search bar. */
 body.fv-refined.ui-v2-preview.fiyaoo-branded.workbench-shell #library #productGrid .product-more5[open]{
  flex-basis:100%;grid-column:1/-1;width:100%!important;
 }
 body.fv-refined.ui-v2-preview.fiyaoo-branded.workbench-shell #library #productGrid .product-more5[open] .fl-menu{
  position:static!important;width:100%!important;min-width:0!important;
  max-height:none!important;overflow:visible!important;margin-top:8px!important;
 }
}
