/* MYTHD mobile 2.0 shell. Original navigation and permission handlers remain authoritative. */
#mythdModernApp .m2-toolbar,#mythdModernApp .m2-bottom,#mythdModernApp .m2-shade,#mythdModernApp .m2-drawer-tools,#mythdModernApp .m2-settings-card{display:none}
@media (max-width:680px), (max-width:1100px) and (max-height:600px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
html body #mythdModernApp.m2-ready .m2-toolbar{display:flex!important;align-items:center;gap:8px;padding:9px 12px 5px;background:var(--graphite-900);position:relative;z-index:25;min-width:0}
#mythdModernApp.m2-ready .m2-round{width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;border:1px solid var(--graphite-700);border-radius:50%;background:var(--graphite-800);color:var(--paper);padding:0;font:700 24px/1 system-ui;touch-action:manipulation}
#mythdModernApp.m2-ready .m2-round svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round}
#mythdModernApp.m2-ready #m2Plus{color:#08d88c}
html body #mythdModernApp.m2-ready .m2-toolbar #workspaceSearchShell{position:relative!important;inset:auto!important;display:block!important;flex:1 1 0!important;min-width:0!important;width:auto!important;padding:0!important;margin:0!important;background:transparent!important;border:0!important}
#mythdModernApp.m2-ready .m2-toolbar .inv-doc-search{width:100%!important;display:block!important}
#mythdModernApp.m2-ready .m2-toolbar #invDocumentForm{display:block!important;margin:0!important}
#mythdModernApp.m2-ready .m2-toolbar .inv-doc-controls{display:flex!important;align-items:center;border:1px solid var(--graphite-700);border-radius:28px;background:var(--graphite-950);padding:0 5px;gap:4px!important;height:44px}
#mythdModernApp.m2-ready .m2-toolbar #workspaceRefresh{width:32px!important;flex:0 0 32px!important;border:0!important;background:transparent!important;padding:5px!important}
#mythdModernApp.m2-ready .m2-toolbar #invDocumentSearch{border:0!important;background:transparent!important;box-shadow:none!important;width:0!important;flex:1 1 0!important;padding:4px 2px!important;font-size:16px!important}
#mythdModernApp.m2-ready .m2-toolbar #invDocumentForm button[type=submit]{font-size:11px!important;min-width:0!important;padding:4px 7px!important;border-radius:20px!important;height:30px!important}
#mythdModernApp.m2-ready .m2-toolbar #workspaceSearchToggle,#mythdModernApp.m2-ready .m2-toolbar #invDocumentClear{display:none!important}
#mythdModernApp.m2-ready .m2-toolbar #invDocumentResults{position:absolute!important;top:calc(100% + 5px)!important;left:0!important;width:100%!important;max-height:65dvh!important;overflow:auto!important;z-index:60!important}
html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header{min-height:44px!important;padding:3px 12px 5px!important;gap:6px!important}
html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header .m-head-identity #mLogoRefresh{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;flex-basis:30px!important}
html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header .m-head-sub{display:none!important}
html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header .compact-mythd-mark{display:none!important}
html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header .compact-company-title{font-size:14px!important}
html body #mythdModernApp.m2-ready .m-sidebar{position:fixed!important;inset:0 auto 0 0!important;box-sizing:border-box!important;width:min(83vw,340px)!important;max-width:340px!important;height:100dvh!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important;padding:calc(env(safe-area-inset-top) + 15px) 14px calc(env(safe-area-inset-bottom) + 16px)!important;background:var(--graphite-900)!important;z-index:1001!important;overflow:auto!important;transform:translateX(-105%);visibility:hidden;transition:transform .22s ease,visibility .22s;box-shadow:8px 0 30px #0005}
html body #mythdModernApp.m2-ready.m2-drawer-open .m-sidebar{transform:translateX(0);visibility:visible}
#mythdModernApp.m2-ready .m-sidebar .m-nav{display:flex!important;flex-direction:column!important;align-items:stretch!important;width:100%!important;max-height:none!important;overflow:visible!important;gap:3px!important;padding:0!important;mask-image:none!important;-webkit-mask-image:none!important}
#mythdModernApp.m2-ready .m-sidebar .m-nav button{width:100%!important;justify-content:flex-start!important;text-align:left!important;min-height:46px!important;white-space:normal!important;padding:10px!important;font-size:14px!important;border-radius:10px!important;transform:none!important;box-shadow:none!important}
#mythdModernApp.m2-ready .m-sidebar .m-nav button.active{border-color:var(--graphite-700)!important;background:color-mix(in srgb,#08d88c 18%,var(--graphite-900))!important}
#mythdModernApp.m2-ready .m-sidebar .m-nav-scroll,#mythdModernApp.m2-ready .m-sidebar .mythd-tab-indicator{display:none!important}
#mythdModernApp.m2-ready .m2-drawer-tools{display:flex!important;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
#mythdModernApp.m2-ready .m2-drawer-tools strong{font-size:22px;color:#08d88c;letter-spacing:1px}
#mythdModernApp.m2-ready .m2-shade:not([hidden]){display:block!important;position:fixed;inset:0;background:#0008;z-index:1000}
#mythdModernApp.m2-ready .m-mobilebar{display:none!important}
html body #mythdModernApp.m2-ready .m2-bottom{position:fixed!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;left:50%!important;transform:translateX(-50%);width:min(92vw,440px)!important;display:flex!important;align-items:center;gap:3px;padding:5px;box-sizing:border-box;border:1px solid var(--graphite-700);border-radius:40px;background:color-mix(in srgb,var(--graphite-800) 91%,transparent);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 4px 18px #0004;z-index:65}
#mythdModernApp.m2-ready .m2-bottom button{flex:1 1 0;min-width:0;min-height:51px;background:none;border:0;color:var(--paper);border-radius:32px;padding:5px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;touch-action:manipulation}
#mythdModernApp.m2-ready .m2-bottom button.active{background:color-mix(in srgb,#08d88c 22%,var(--graphite-800));color:var(--paper)}
#mythdModernApp.m2-ready .m2-bottom button svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#mythdModernApp.m2-ready .m2-bottom button span{font-size:11px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body #mythdModernApp.m2-ready:has(dialog[open],.modal-overlay,[aria-modal=true]) .m2-bottom,html body #mythdModernApp.m2-ready.m2-keyboard .m2-bottom{display:none!important}
#mythdModernApp.m2-ready .m-content{padding-bottom:calc(100px + env(safe-area-inset-bottom))!important}
/* Global ticker positioning is defined below; it lives outside the workspace. */
#mythdModernApp.m2-ready :is(.inv-shell,.purchasing-layout){display:block!important;min-width:0!important}
/* Shared mobile node navigation: Purchasing is the visual source of truth.
   Explicit screen selectors outrank older filled Inventory/Freight active styles. */
html body #mythdModernApp.m2-ready :is(#mInventory .inv-nav,#mFreight .fy-nav,#mPurchasing .purchasing-leftnav,.mr-stage-tabs){display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;gap:17px!important;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;box-sizing:border-box;max-width:100%!important;min-width:0!important;width:100%!important;position:relative!important;inset:auto!important;border:0!important;border-bottom:1px solid var(--graphite-700)!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;padding:0 4px!important;margin:0 0 10px!important;scrollbar-width:none}
html body #mythdModernApp.m2-ready :is(#mInventory .inv-nav,#mFreight .fy-nav,#mPurchasing .purchasing-leftnav,.mr-stage-tabs)::-webkit-scrollbar{display:none}
html body #mythdModernApp.m2-ready :is(#mInventory .inv-nav,#mFreight .fy-nav,#mPurchasing .purchasing-leftnav,.mr-stage-tabs)>:is(a,button):not([hidden]){flex:0 0 auto!important;display:inline-flex;align-items:center;justify-content:center;min-width:0!important;width:auto!important;max-width:none!important;min-height:43px!important;box-sizing:border-box;white-space:nowrap!important;padding:9px 2px!important;margin:0!important;border:0!important;border-bottom:3px solid transparent!important;border-radius:0!important;background:transparent!important;color:var(--steel-400)!important;box-shadow:none!important;text-decoration:none!important;font-size:13px!important;font-weight:650!important;touch-action:manipulation}
html body #mythdModernApp.m2-ready :is(#mInventory .inv-nav,#mFreight .fy-nav,#mPurchasing .purchasing-leftnav,.mr-stage-tabs)>:is(a,button):not([hidden]):is(.active,[aria-current=page],[aria-selected=true],.m-primary){background:transparent!important;box-shadow:none!important;border-color:transparent!important;border-bottom-color:#08d88c!important;color:var(--paper)!important;font-weight:650!important}
html body #mythdModernApp.m2-ready :is(#mInventory .inv-nav,#mFreight .fy-nav,#mPurchasing .purchasing-leftnav,.mr-stage-tabs)>:is(a,button):focus-visible{outline:2px solid #08d88c;outline-offset:-2px}
html body #mythdModernApp.m2-ready .mr-stage-tabs button.active span{background:var(--graphite-700);color:var(--paper)}
html body #mythdModernApp.m2-ready .mr-compact-controls #mrStageSelect{display:none!important}
#mythdModernApp.m2-ready .m2-settings-card{display:block!important}
#mythdModernApp.m2-ready .m2-panel{border:1px solid var(--graphite-700);border-radius:20px 20px 0 0;background:var(--graphite-900);color:var(--paper);width:min(100vw,520px);max-width:100vw;max-height:85dvh;margin:auto auto 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom));box-sizing:border-box;overflow:auto}
#mythdModernApp.m2-ready .m2-panel::backdrop{background:#0008}
#mythdModernApp.m2-ready .m2-panel h2{margin:0 0 10px}
#mythdModernApp.m2-ready .m2-panel button{min-height:44px;touch-action:manipulation}
#mythdModernApp.m2-ready .m2-panel .m2-action{display:block;text-align:left;width:100%;margin:5px 0}
#mythdModernApp.m2-ready .m2-panel label{display:block;margin:12px 0}
#mythdModernApp.m2-ready .m2-panel select{display:block;width:100%;padding:10px;margin-top:4px;background:var(--graphite-950);color:var(--paper);border:1px solid var(--graphite-700);border-radius:8px;font-size:16px}
}
@media (max-width:680px), (max-width:1100px) and (max-height:600px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
/* Global legacy modals are siblings of the Modern workspace, not descendants. */
html body:has(#modalSlot .modal-overlay:not([hidden])) #mythdModernApp.m2-ready .m2-bottom,
html body:has(dialog[open],.modal-overlay:not([hidden]):not([aria-hidden="true"]),[aria-modal="true"]:not([hidden]):not([aria-hidden="true"])) #mythdModernApp.m2-ready .m2-bottom{display:none!important;pointer-events:none!important}
html body:has(#modalSlot .modal-overlay:not([hidden])) #mythdLiveTicker{display:none!important}
html body:has(#saveAppearance) #modalSlot #modalOverlay{z-index:1100!important;padding:calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom))!important}
html body #modalSlot #modalOverlay .modal-box:has(#saveAppearance){max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;box-sizing:border-box;overflow-y:auto;scroll-padding-bottom:76px}
html body #modalSlot #modalOverlay .modal-row:has(#saveAppearance){position:sticky;bottom:0;z-index:2;background:var(--graphite-900);padding:10px 0 4px;border-top:1px solid var(--graphite-700)}
html body #modalSlot #modalOverlay .modal-row:has(#saveAppearance) button{min-height:44px}
 /* The search M is the single MYTHD mark. Keep only genuine company identity. */
html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header:not(#mythdCompactUnused) :is(.mythd-header-brand,.compact-mythd-mark,#mLogoRefresh:not([data-has-company-logo="true"])){display:none!important}
html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header:not(#mythdCompactUnused) .m-head-identity>div{display:block!important}
html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header:not(#mythdCompactUnused) .m-head-title[hidden]{display:none!important}
}
@media (max-width:680px), (max-width:1100px) and (max-height:600px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
 /* Keep one company name: the compact header title is authoritative. */
 html body #mythdModernApp.m2-ready .m-topbar #compactCompanyName{display:none!important}
 html body #mythdModernApp.m2-ready .m-topbar .compact-company-title{font-size:14px!important;line-height:1.25!important}
 /* Every drawer icon has the same footprint, including the original Freight SVG. */
 html body #mythdModernApp.m2-ready .m-sidebar .m-nav button[data-m-screen]>svg{display:block!important;width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;max-width:20px!important;max-height:20px!important;flex:0 0 20px!important}
 html body #mythdModernApp.m2-ready .m-sidebar .m-nav button[data-m-screen]>img.pa-nav-avatar{width:24px!important;height:24px!important;max-width:24px!important;max-height:24px!important;flex:0 0 24px!important;object-fit:cover}
 html body #mythdModernApp.m2-ready .m-sidebar .m-nav button[data-m-screen="freight"]{height:auto!important;min-height:46px!important}
 /* The ticker is appended to body, so the original descendant selector never matched. */
 /* The ticker owns the screen's bottom edge, including the iPhone safe area. */
 html body:has(#mythdModernApp.m2-ready) #mythdLiveTicker{inset:auto 0 0 0!important;box-sizing:border-box!important;height:calc(30px + env(safe-area-inset-bottom,0px))!important;padding-bottom:env(safe-area-inset-bottom,0px)!important;z-index:64!important}
 html body:has(#mythdModernApp.m2-ready) #mythdLiveTicker .mythd-ticker-item{height:30px!important}
 /* Lift shortcuts by ticker height plus a 10px gap; revert when ticker is disabled. */
 html body:has(> #mythdLiveTicker:not([hidden]):not([style*="display: none"]):not([style*="display:none"])) #mythdModernApp.m2-ready .m2-bottom{bottom:calc(40px + env(safe-area-inset-bottom,0px))!important}
 html body:has(#mythdModernApp.m2-ready) #mythdModernApp .m-content{padding-bottom:calc(130px + env(safe-area-inset-bottom,0px))!important}
 html body:has(#mythdModernApp.m2-ready.m2-drawer-open) #mythdLiveTicker,
 html body:has(#mythdModernApp.m2-ready.m2-keyboard) #mythdLiveTicker,
 html body:has(#mythdModernApp.m2-ready):has(dialog[open],.modal-overlay:not([hidden]):not([aria-hidden="true"]),[aria-modal="true"]:not([hidden]):not([aria-hidden="true"])) #mythdLiveTicker,
 html body #mythdModernApp.m2-ready.m2-drawer-open .m2-bottom{display:none!important;pointer-events:none!important}
}
@media(prefers-reduced-motion:reduce){#mythdModernApp.m2-ready .m-sidebar{transition:none!important}}
@media print{#mythdModernApp .m2-toolbar,#mythdModernApp .m2-bottom,#mythdModernApp .m2-shade{display:none!important}}
/* Short touch landscape: preserve mobile shell with safe-area spacing and compact controls. */
@media (max-width:1100px) and (max-height:600px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
 html body #mythdModernApp.m2-ready .m2-toolbar{padding:4px max(12px,env(safe-area-inset-right)) 4px max(12px,env(safe-area-inset-left))}
 html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header:not(#mythdCompactUnused){min-height:44px!important;height:auto!important;padding:3px max(12px,env(safe-area-inset-right)) 3px max(12px,env(safe-area-inset-left))!important;gap:8px!important}
 html body #mythdModernApp.m2-ready .m-main>header.m-topbar.mythd-compact-header:not(#mythdCompactUnused) .m-head-identity #mLogoRefresh{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important;flex:0 0 34px!important}
 html body #mythdModernApp.m2-ready .m2-toolbar #workspaceRefresh svg{width:22px!important;height:20px!important;max-width:100%!important;max-height:100%!important;flex:none!important}
 html body #mythdModernApp.m2-ready .m-sidebar{padding-left:max(14px,env(safe-area-inset-left))!important}
 html body #mythdModernApp.m2-ready .m2-bottom{padding:3px}
 #mythdModernApp.m2-ready .m2-bottom button{min-height:44px;flex-direction:row;gap:6px;padding:4px}
 html body #mythdModernApp.m2-ready .m-content{padding-left:max(12px,env(safe-area-inset-left))!important;padding-right:max(12px,env(safe-area-inset-right))!important}
}
/* Live retains its notification control inside the search shell. */
@media (max-width:680px), (max-width:1100px) and (max-height:600px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
html body #mythdModernApp.m2-ready .m2-toolbar .inv-doc-search{display:flex!important;align-items:center;gap:3px;position:relative;min-width:0}
html body #mythdModernApp.m2-ready .m2-toolbar #invDocumentForm{flex:1 1 0;min-width:0}
html body #mythdModernApp.m2-ready .m2-toolbar #mActivityNotifications{position:relative!important;inset:auto!important;flex:0 0 32px;width:32px!important;min-width:32px!important;height:36px!important;padding:4px!important;margin:0!important}
html body #mythdModernApp.m2-ready .m2-toolbar #mActivityNotifications .m-notification-label{display:none!important}
html body #mythdModernApp.m2-ready .m2-toolbar #mActivityNotifications svg{width:18px!important;height:18px!important}
html body #mythdModernApp.m2-ready .m2-toolbar #mActivityNotificationPanel{position:absolute!important;top:100%!important;right:0!important;width:min(85vw,340px)!important;max-height:65dvh;overflow:auto;z-index:70}
}
/* Continuous Reddit-style favorite bar morph; keep the same fixed anchor above the ticker. */
@media (max-width:680px), (max-width:1100px) and (max-height:600px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
 html body #mythdModernApp.m2-ready .m2-bottom{left:calc(50% - min(46vw,220px))!important;transform:none;min-width:0;height:63px;overflow:hidden;transition:width .34s cubic-bezier(.22,.8,.22,1),left .34s cubic-bezier(.22,.8,.22,1),border-radius .34s ease}
 #mythdModernApp.m2-ready .m2-bottom .m2-favorites{display:flex;align-items:center;gap:3px;flex:1 1 0;min-width:0;width:100%;transform-origin:left center;transition:opacity .18s ease,transform .34s cubic-bezier(.22,.8,.22,1)}
 #mythdModernApp.m2-ready .m2-bottom .m2-expand{position:absolute;inset:4px;min-width:0;min-height:0;padding:0;opacity:0;transform:scale(.72);pointer-events:none;transition:opacity .18s ease,transform .34s cubic-bezier(.22,.8,.22,1)}
 #mythdModernApp.m2-ready .m2-bottom .m2-expand svg{width:25px;height:25px;stroke:currentColor;fill:currentColor;stroke-width:1.25}
 html body #mythdModernApp.m2-ready .m2-bottom.m2-collapsed{left:max(12px,env(safe-area-inset-left,0px))!important;width:63px!important;border-radius:50%}
 #mythdModernApp.m2-ready .m2-bottom.m2-collapsed .m2-favorites{opacity:0;transform:scale(.72);pointer-events:none}
 #mythdModernApp.m2-ready .m2-bottom.m2-collapsed .m2-expand{opacity:1;transform:scale(1);pointer-events:auto}
 #mythdModernApp.m2-ready .m2-bottom button:focus-visible{outline:2px solid #08d88c;outline-offset:-3px}
 html body #mythdModernApp.m2-ready .m2-bottom.m2-empty{display:none!important}
}
@media (max-width:1100px) and (max-height:600px) and (orientation:landscape) and (hover:none) and (pointer:coarse){
 html body #mythdModernApp.m2-ready .m2-bottom{height:52px}
 html body #mythdModernApp.m2-ready .m2-bottom.m2-collapsed{width:52px!important}
}
@media(prefers-reduced-motion:reduce){
 #mythdModernApp.m2-ready .m2-bottom,#mythdModernApp.m2-ready .m2-bottom .m2-favorites,#mythdModernApp.m2-ready .m2-bottom .m2-expand{transition:none!important}
}