/* Dimensions, typography and card structure from compact-mobile-requests.html. */
/* Request details: override late desktop grid rules only on phones. */
@media(max-width:760px){
 body:has(#requestWorkspace) .notification-drawer:not(.open){visibility:hidden;box-shadow:none}
 body:has(#requestWorkspace) .topbar .search,body:has(#requestWorkspace) .topbar .search input{min-width:0}
 #requestWorkspace{width:100%;min-width:0;padding-bottom:calc(100px + env(safe-area-inset-bottom,0px))}
 #requestWorkspace .v4-crumb{height:auto;min-height:21px;flex-wrap:wrap}
 #requestWorkspace .v4-title,#requestWorkspace .v4-title>div{min-width:0;max-width:100%;flex-wrap:wrap}
 #requestWorkspace .v4-title h1{white-space:normal;overflow-wrap:anywhere}
 #requestWorkspace .v4-steps{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);width:100%;padding:0 0 8px;overflow:visible}
 #requestWorkspace .v4-step{min-width:0;text-align:center;gap:4px}
 #requestWorkspace .v4-step>strong,#requestWorkspace .v4-step>small{max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.3;font-size:10px}
 #requestWorkspace .v4-step>b{width:28px;height:28px}
 #requestWorkspace .v4-step i{top:14px}
 #requestWorkspace .v4-grid-top,#requestWorkspace .v4-grid-bottom,#requestWorkspace .request-parts-grid{grid-template-columns:minmax(0,1fr)}
 #requestWorkspace .v4-card header{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start}
 #requestWorkspace .v4-card header>div{min-width:0;overflow-wrap:anywhere}
 #requestWorkspace .v4-card header>button{grid-column:2;justify-self:start;margin:0;max-width:100%;white-space:normal}
 #requestWorkspace .v4-machine-card .v4-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 #requestWorkspace .v4-facts>div,#requestWorkspace .v4-facts>div>span{min-width:0;padding:0;border:0}
 #requestWorkspace .v4-request-machine-card>.v4-facts{gap:0}
 #requestWorkspace .v4-request-machine-card>.v4-facts>div{min-height:56px;padding:10px 14px;border-bottom:1px solid #e6edf1}
 #requestWorkspace .v4-request-machine-card>.v4-facts>div:nth-child(odd){border-right:1px solid #e6edf1}
 #requestWorkspace .v4-request-machine-card>.v4-facts>div:nth-last-child(-n+2){border-bottom:0}
 #requestWorkspace .v4-facts strong,#requestWorkspace .v4-machine-name p{overflow-wrap:anywhere}
 #requestWorkspace .v4-machine-name p strong{display:inline-block;margin-left:0}
 #requestWorkspace .request-workflow-bar{width:100%;left:0;right:0;flex-wrap:wrap;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px))}
 #requestWorkspace .workflow-actions{min-width:0;max-width:100%;flex-wrap:wrap}
 #requestWorkspace .v4-send{min-width:0;max-width:100%;height:auto;min-height:40px;white-space:normal}
 #requestWorkspace .v4-request-summary{grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:auto auto auto}
 #requestWorkspace .v4-request-summary>div:first-child,#requestWorkspace .v4-request-work-head{display:contents}
 #requestWorkspace .v4-request-work-head>small{grid-column:1;grid-row:1;align-self:center}
 #requestWorkspace .v4-request-summary>div:nth-child(2){grid-column:2;grid-row:1;justify-self:start;align-self:center;max-width:130px}
 #requestWorkspace .v4-request-summary .v4-request-edit{grid-column:3;grid-row:1;justify-self:end;align-self:center}
 #requestWorkspace .v4-request-summary>div:first-child>strong{grid-column:1/-1;grid-row:2;align-self:start}
 #requestWorkspace .v4-request-summary-description{grid-column:1/-1;grid-row:3}
}
.mr-toolbar-icon,.mr-create-menu{display:none}
@media(max-width:760px){
 body.is-mobile-requests{line-height:21px;font-weight:430}
 body.is-mobile-requests .mr-original-icon{display:none}
 /* The approved preview did not load Inter: it rendered using the system fallback. */
 body.is-mobile-requests{--mr-bg:#f3f6f8;--mr-white:#fff;--mr-ink:#17263e;--mr-muted:#75869c;--mr-line:#dbe4ea;--mr-soft:#eef3f5;--mr-teal:#078d91;--mr-teal-soft:#e5f4f3;--mr-amber:#b96a08;--mr-amber-soft:#fff2dc;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--mr-ink);background:var(--mr-bg)}
 body.is-mobile-requests .topbar{height:64px;min-height:64px;position:sticky;top:0;z-index:30;background:#fff;border-bottom:1px solid var(--mr-line);display:flex;align-items:center;gap:22px;padding:0 14px;box-shadow:none}
 body.is-mobile-requests .topbar .topbar-logo,body.is-mobile-requests .topbar .sync-state,body.is-mobile-requests .topbar .language-switch,body.is-mobile-requests .topbar .profile>div,body.is-mobile-requests .topbar .logout{display:none}
 body.is-mobile-requests .topbar .mobile-menu{border:0;background:transparent;color:#0789d0;width:32px;height:36px;padding:0;display:grid;place-items:center;flex:0 0 auto;font-size:25px;line-height:1;box-shadow:none;border-radius:0}
 body.is-mobile-requests .topbar .icon-button{border:0;background:transparent;color:#3b5872;width:32px;height:36px;padding:0;display:grid;place-items:center;flex:0 0 auto;font-size:23px;line-height:1;box-shadow:none;border-radius:0}
 body.is-mobile-requests .mr-toolbar-icon{display:block;width:16px;height:16px}
 /* Keep the mobile header focused on navigation and stock scanning. */
 body.is-mobile-requests .mr-mobile-brand{display:none}
 body.is-mobile-requests .topbar .profile{display:none}
 body.is-mobile-requests .topbar .mobile-stock-scan{display:grid;place-items:center;width:38px;height:38px;flex:0 0 38px;border:0;border-radius:50%;background:#e7f4f3;color:#07898d;font-size:0;box-shadow:none}
 body.is-mobile-requests .topbar .mobile-stock-scan svg{width:23px;height:23px}
 body.is-mobile-requests .mr-brand-mark{width:28px;height:28px;border:1.5px solid #587085;border-radius:5px;display:grid;place-items:center;font-size:10px;letter-spacing:-.07em;color:#587085;flex:0 0 auto}
 body.is-mobile-requests .topbar .search{display:flex;height:39px;min-width:0;width:auto;max-width:none;flex:1;border:1px solid var(--mr-line);border-radius:9px;background:#fff;align-items:center;gap:8px;padding:0 10px;box-shadow:none;overflow:hidden}
 body.is-mobile-requests .topbar .search>span{display:flex;align-items:center;font-size:22px;line-height:1;flex:0 0 auto;color:#48647b}
 body.is-mobile-requests .topbar .search input{min-width:0;width:100%;height:36px;border:0;background:none;margin:0;padding:0;font-family:inherit;font-size:16px;font-weight:430;box-shadow:none;outline:none;color:var(--mr-ink)}
 body.is-mobile-requests .topbar .search input::placeholder{font-size:16px;color:#9aa7b5;opacity:1}
 body.is-mobile-requests .topbar .top-actions{display:flex;align-items:center;gap:15px;flex:0 0 auto;margin-left:auto}
 body.is-mobile-requests .topbar .icon-button em{position:absolute;right:-1px;top:1px;min-width:15px;width:auto;height:15px;padding:0 3px;border:0;border-radius:50%;display:grid;place-items:center;background:#df3449;color:white;font-size:9px;font-weight:700;font-style:normal}
 body.is-mobile-requests .topbar .profile{display:none}
 body.is-mobile-requests .notification-drawer:not(.open){visibility:hidden;box-shadow:none}
 body.is-mobile-requests #sidebar .mr-create-menu{display:block;width:100%;border:1px solid var(--mr-line);border-radius:9px;background:var(--mr-teal);color:white;padding:10px 12px;margin:12px 0;font-family:inherit;font-size:13px;font-weight:600;text-align:left;cursor:pointer}
 body.is-mobile-requests #sidebar .mr-create-menu[hidden]{display:none}
 body.is-mobile-requests #mainContent .mr-body{padding:18px 14px 34px;max-width:620px;margin:0 auto;background:var(--mr-bg)}
 .is-mobile-requests .mr-body>.page-head{display:block;margin:0 0 12px;padding:0;min-height:0}
 .is-mobile-requests .mr-body>.page-head>div:first-child,.is-mobile-requests .mr-body .portal-back-row,.is-mobile-requests .mr-body>.page-head .head-actions>[data-action="new-request"]{display:none}
 .is-mobile-requests .mr-body>.page-head .head-actions{display:block;margin:0;padding:0;width:100%}
 .is-mobile-requests .mr-body>.page-head .head-actions>[data-action="request-trash"]{display:none!important}
 .is-mobile-requests .mr-list-heading{margin-bottom:14px}
 .is-mobile-requests .mr-eyebrow{display:block;color:#8797aa;font-size:11px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;line-height:1.35}
 .is-mobile-requests .mr-list-heading>div{display:flex;align-items:center;justify-content:space-between;margin-top:3px}
 .is-mobile-requests .mr-list-heading h1{margin:0;color:var(--mr-ink);font-size:23px;line-height:1.15;letter-spacing:-.03em}
 .is-mobile-requests .mr-total{border-radius:99px;background:#e6eff7;color:#52708d;padding:5px 10px;font-size:12px;font-weight:750;white-space:nowrap}
 .is-mobile-requests .mr-body .registry-search-bar{display:flex;align-items:center;gap:9px;width:100%;height:43px;border:1px solid var(--mr-line);border-radius:12px;background:#fff;padding:0 12px;margin:0;box-shadow:0 2px 6px rgba(26,56,80,.04);font-size:13px;font-weight:430;line-height:21px}
 .is-mobile-requests .mr-body .registry-search-bar>span{display:flex;color:#47647f}
 .is-mobile-requests .mr-body .registry-search-bar svg{width:17px;height:17px}
 .is-mobile-requests .mr-body .registry-search-bar input{height:34px;min-width:0;width:100%;border:0;outline:0;background:none;padding:0;margin:0;color:var(--mr-ink);font-family:inherit;font-size:16px;font-weight:430;box-shadow:none}
 .is-mobile-requests .mr-body .registry-search-bar input::placeholder{font-size:13px;color:#8b99aa;opacity:1}
 .is-mobile-requests .mr-body .request-status-filters{display:flex;flex-wrap:nowrap;gap:4px;overflow:visible;scrollbar-width:none;white-space:nowrap;margin:0 0 10px;padding:4px;border:1px solid #d8e4ea;border-radius:16px;background:#eef4f7;box-shadow:none;width:100%;max-width:100%;vertical-align:initial}
 .is-mobile-requests .mr-body .request-status-filters::-webkit-scrollbar{display:none}
 .is-mobile-requests .mr-body .request-status-filters .filter-chip{height:48px;min-height:48px;min-width:0;border:1px solid #d8e4ea;border-radius:13px;background:#f8fbfc;color:#63768c;padding:0 3px;font-family:inherit;font-size:10px;font-weight:700;flex:1 1 0;display:flex;align-items:center;justify-content:center;gap:2px;box-shadow:none;cursor:pointer;line-height:normal;transition:none;transform:none}
 .is-mobile-requests .mr-body .request-status-filters .filter-chip.active{background:var(--mr-teal);border-color:var(--mr-teal);color:white;box-shadow:0 2px 4px rgba(7,141,145,.2)}
 .is-mobile-requests .mr-body .request-status-filters .filter-chip b{display:none}
 /* The lower filters use the same segmented-control treatment as statuses. */
 .is-mobile-requests .mr-body .mr-type-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch;gap:4px;width:100%;max-width:100%;overflow:visible;margin:0 0 10px;padding:4px;border:1px solid #d8e4ea;border-radius:16px;background:#eef4f7;box-shadow:none;white-space:normal}
 .is-mobile-requests .mr-body .mr-type-filters::-webkit-scrollbar{display:none}
 .is-mobile-requests .mr-body .mr-type-filters .filter-chip{width:auto;height:48px;min-height:48px;min-width:0;margin:0;padding:8px 6px;border:1px solid #d8e4ea;border-radius:13px;background:#f8fbfc;color:#63768c;font-family:inherit;font-size:10px;font-weight:700;line-height:1.15;white-space:normal;box-shadow:none;transition:none;display:flex;align-items:center;justify-content:center;text-align:center}
 .is-mobile-requests .mr-body .mr-type-filters .filter-chip[data-request-filter="pdi"],
 .is-mobile-requests .mr-body .mr-type-filters .filter-chip[data-request-filter="multiwork"]{grid-column:span 2;font-size:10px}
 .is-mobile-requests .mr-body .mr-type-filters .filter-chip.active{background:var(--mr-teal);border-color:var(--mr-teal);color:white;box-shadow:0 2px 4px rgba(7,141,145,.2)}
 /* Priority is already visible on each request card; hide the extra legend
    row on mobile to keep the register compact. */
 .is-mobile-requests .mr-body .request-priority-legend{display:none!important}
 .is-mobile-requests .mr-body .request-priority-badge{display:flex;align-items:center;justify-content:center;flex:1 1 0;height:36px;min-height:36px;min-width:0;padding:0 3px;font-family:inherit;font-size:10px;font-weight:700;line-height:normal;border:0;border-radius:10px;background:transparent;color:#63768c;box-shadow:none}
 .is-mobile-requests .mr-body .request-priority-badge.urgent{color:var(--mr-amber);background:var(--mr-amber-soft);border:0}
 .is-mobile-requests .mr-body .request-status-group{margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
 .is-mobile-requests .mr-body .request-status-group-head{display:flex;align-items:center;gap:7px;margin:14px 2px 8px;padding:0}
 .is-mobile-requests .mr-body .request-status-group-head h2{font-size:17px;font-weight:800;line-height:1.3;letter-spacing:-.02em;color:var(--mr-ink);margin:0}
 .is-mobile-requests .mr-body .request-status-group-head>span{height:21px;min-width:22px;border-radius:99px;background:#e6eff7;color:#52708d;display:grid;place-items:center;font-size:10px;padding:0 6px;font-weight:750}
 .mr-body .mr-card{background:var(--mr-white);border:1px solid var(--mr-line);border-radius:17px;margin-bottom:11px;padding:13px;box-shadow:0 3px 10px rgba(35,62,85,.03);overflow:hidden;cursor:pointer}
 .mr-body .mr-card-top{display:flex;align-items:center;gap:8px;padding:0;min-width:0}
 .mr-body .mr-code-wrap{display:flex;align-items:center;gap:5px;min-width:0;flex:0 1 auto}
 .mr-body .mr-favorite-mark{display:inline-block;flex:0 0 auto;color:#e3a722;font-size:14px;line-height:1}
 .mr-body .mr-code{display:inline-block;color:var(--mr-teal);font-family:inherit;font-size:18px;line-height:1.1;font-weight:850;letter-spacing:.01em;border:0;background:none;margin:0;padding:0;text-align:left;cursor:pointer;white-space:nowrap}
 .mr-body .mr-type-tag{max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:99px;background:#eef3f6;color:#536b82;padding:6px 8px;font-size:10px;line-height:1;font-weight:750;flex:0 1 auto}
 .mr-body .mr-type-wrap{display:flex;flex:0 1 auto;flex-direction:column;align-items:center;gap:3px;min-width:0;max-width:42%}
 .mr-body .mr-type-wrap .mr-type-tag{max-width:100%}
 .mr-body .mr-warranty-filed{display:block;max-width:100%;color:var(--mr-amber);font-size:9px;font-weight:800;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .mr-body .mr-check{appearance:none;-webkit-appearance:none;width:20px;height:20px;min-width:20px;border:1.5px solid #bdc8d3;border-radius:6px;background:#fff;flex:0 0 auto;margin:0 0 0 auto;padding:0;cursor:pointer;box-shadow:none}
 .mr-body .mr-check:checked{border-color:var(--mr-teal);background:var(--mr-teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='m5 12 4 4 10-10'/%3E%3C/svg%3E") center/16px no-repeat}
 .mr-body .mr-urgent{font-size:14px;color:var(--mr-amber);line-height:1}
 .mr-body .mr-date-row{display:flex;align-items:center;gap:5px;margin:8px 0 11px;color:#7d8ea2;font-size:11px;line-height:1.25;font-weight:600;min-width:0}
 .mr-body .mr-date-icon{width:14px;height:14px;stroke:#8b9bae;flex:0 0 auto}
 .mr-body .mr-one-c{margin-left:auto;padding:3px 7px;border-radius:99px;background:#eef3f6;color:#63788d;font-size:10px;white-space:nowrap}
 .mr-body .mr-machine{display:flex;align-items:center;gap:10px;margin:0;padding:10px;background:#f5f8f9;border-radius:12px;min-width:0}
 .mr-body .mr-machine-visual{width:68px;height:52px;display:grid;place-items:center;flex:0 0 auto;overflow:hidden}
 .mr-body .mr-machine-photo{display:block;width:68px;height:52px;padding:3px;object-fit:contain;background:#fff;border:1px solid #e7edf0;border-radius:10px;flex:0 0 auto}
 .mr-body .mr-machine-visual .machine-placeholder{width:68px;height:52px;border-radius:10px;background:#e3f1f1;color:var(--mr-teal);display:grid;place-items:center;font-size:23px}
 .mr-body .mr-machine-copy{min-width:0}
 .mr-body .mr-machine-copy strong{display:block;font-size:14px;font-weight:750;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .mr-body .mr-machine-copy small{display:block;color:#8798aa;font-size:11px;line-height:1.2;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .mr-body .mr-client-row{display:flex;align-items:flex-start;gap:9px;padding:12px 1px 10px;border-bottom:1px solid #edf1f3;min-width:0}
 .mr-body .mr-client-icon{width:16px;height:16px;stroke:#7690a4;flex:0 0 auto;margin-top:1px}
 .mr-body .mr-client-copy{min-width:0;display:block}
 .mr-body .mr-label{display:block;color:#8b9aad;font-size:9px;font-weight:800;line-height:1.2;letter-spacing:.07em;text-transform:uppercase;margin-bottom:3px}
 .mr-body .mr-client-copy strong{display:block;font-size:12px;font-weight:700;line-height:1.25;overflow-wrap:anywhere}
 .mr-body .mr-work{padding:10px 1px 1px;min-width:0}
 .mr-body .mr-work strong{display:block;font-size:13px;font-weight:700;line-height:1.35;overflow-wrap:anywhere}
 .mr-body .mr-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:11px}
 .mr-body .mr-open-detail{display:flex;align-items:center;gap:4px;border:0;background:transparent;color:#5d7489;font:inherit;font-size:11px;font-weight:750;padding:5px 0;cursor:pointer}
 .mr-body .mr-next-icon{width:15px;height:15px;stroke:currentColor}
 .mr-body .mr-status{border-radius:99px;background:#e4f3ef;color:#168273;padding:6px 9px;font-size:10px;font-weight:800;line-height:1.2;flex:0 0 auto;max-width:48%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .mr-body .mr-status.progress{background:#e7f0ff;color:#2169c9}
 .mr-body .mr-status.finished{background:#e7f4ed;color:#198052}
 .mr-body .mr-status.waiting{background:#fff3df;color:#a96306}
 .mr-body [hidden]{display:none!important}
}

/* Keep container details readable on phones: four fitted stages and stacked
   cards instead of narrow side-by-side tracking/material columns. */
@media(max-width:760px){
 .container-v4-page{width:100%;max-width:100%;min-width:0}
 .container-v4-page .v4-title{width:100%;max-width:100%;min-width:0}
 .container-v4-page .v4-title>div:first-child{width:100%;max-width:100%;min-width:0;flex:1 1 100%}
 .container-v4-page .v4-title h1{max-width:100%;min-width:0;font-size:clamp(18px,6vw,23px);overflow-wrap:anywhere}
 .container-v4-page>.v4-steps{grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:0 2px;overflow:visible}
 .container-v4-page>.v4-steps>.v4-step{min-width:0;text-align:center}
 .container-v4-page>.v4-steps>.v4-step>strong{max-width:100%;min-width:0;font-size:clamp(8px,2.7vw,11px);line-height:1.2;overflow-wrap:anywhere}
 .container-v4-page>.v4-steps>.v4-step>small{max-width:100%;min-width:0;font-size:clamp(8px,2.5vw,10px);line-height:1.2;overflow-wrap:anywhere}
 .container-v4-page .v4-grid-bottom{grid-template-columns:minmax(0,1fr)!important;width:100%;min-width:0}
 .container-v4-page .v4-grid-bottom>.v4-card{grid-column:1;width:100%;min-width:0}
 .container-v4-page .v4-grid-top>.v4-card{min-height:0}
 .container-v4-page .container-tracking-card{width:100%;min-width:0}
 .container-v4-page .container-tracking-card header{display:grid;grid-template-columns:22px minmax(0,1fr);align-items:center;gap:9px}
 .container-v4-page .container-tracking-card header>.v4-icon{grid-column:1;grid-row:1}
 .container-v4-page .container-tracking-card header>div{grid-column:2;grid-row:1;min-width:0}
 .container-v4-page .container-tracking-card header>a,
 .container-v4-page .container-tracking-card header>button{grid-column:1/-1;display:flex;align-items:center;justify-content:center;width:100%;max-width:100%;min-width:0;min-height:36px;white-space:normal;text-align:center;overflow-wrap:anywhere}
 .container-v4-page .container-tracking-body{grid-template-columns:minmax(0,1fr);gap:12px;width:100%;min-width:0}
 .container-v4-page .container-tracking-body>div{grid-column:1;min-width:0}
 .container-v4-page .container-tracking-body strong,
 .container-v4-page .container-tracking-body span{min-width:0;overflow-wrap:anywhere}
 .container-v4-page .unloaded-equipment-row{grid-template-columns:44px minmax(0,1fr);gap:9px;width:100%;min-width:0}
 .container-v4-page .unloaded-equipment-image{width:44px;min-width:0}
 .container-v4-page .unloaded-equipment-copy{min-width:0;overflow-wrap:anywhere}
 .container-v4-page .unloaded-equipment-copy p{min-width:0;overflow-wrap:anywhere;word-break:break-word}
 .container-v4-page .unloaded-equipment-delete{grid-column:2;justify-self:start;max-width:100%;white-space:normal}
 .container-unload-bar{width:100%;box-sizing:border-box;padding:12px!important;justify-content:center}
 .container-unload-bar .v4-send{width:100%!important;max-width:100%;min-width:0!important;flex:1 1 100%!important}
}

/* Materials first, tracking last in the container details grid. */
.container-v4-page .materials-card{order:1}
.container-v4-page .container-tracking-card{order:2}

/* The generic request-card header rule above uses a narrow icon column. The
   materials card has its own two-level header, so keep it as a full-width
   flex layout on phones; otherwise the title collapses to one character per
   line. */
@media(max-width:760px){
 #requestWorkspace .materials-card>.materials-header{
  display:flex;
  grid-template-columns:none;
  align-items:flex-start;
  gap:12px;
  width:100%;
 }
 #requestWorkspace .materials-card>.materials-header>.materials-heading{
  display:flex;
  grid-column:auto;
  flex:1 1 100%;
  width:100%;
  min-width:0;
 }
 #requestWorkspace .materials-card>.materials-header>.materials-header-actions{
  display:flex;
  grid-column:auto;
  width:100%;
  min-width:0;
  flex:1 1 100%;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
 }
 #requestWorkspace .materials-card .v4-material-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 88px 64px 28px;
  min-width:0;
 }
 #requestWorkspace .materials-card .materials-item-name,
 #requestWorkspace .materials-card .material-spec{grid-column:1/-1;min-width:0}
 #requestWorkspace .materials-card .material-name,
 #requestWorkspace .materials-card .material-spec{min-width:0;width:100%}
 #requestWorkspace .materials-card .material-unit{grid-column:2;grid-row:3}
 #requestWorkspace .materials-card .material-quantity{grid-column:3;grid-row:3}
 #requestWorkspace .materials-card [data-remove-material]{grid-column:4;grid-row:3}
}

/* Final mobile materials layout. This file is loaded after portal-v4.css, so
   keep the request-specific selectors here to prevent the older mobile grid
   from moving the edit button below the stats and stretching each row. */
@media(max-width:760px){
 #requestWorkspace .v4-grid-bottom{align-items:start}
 #requestWorkspace .materials-card{height:auto!important;align-self:start;padding:16px 14px 14px;overflow:hidden}
 #requestWorkspace .materials-card>.materials-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:14px 10px;width:100%;margin-bottom:14px}
 #requestWorkspace .materials-card>.materials-header>.materials-heading{grid-column:1;grid-row:1;display:flex;align-items:flex-start;gap:10px;flex:initial;width:auto;min-width:0}
 #requestWorkspace .materials-card>.materials-header>.materials-heading h3{font-size:19px!important;line-height:1.2!important;margin:0 0 3px!important}
 #requestWorkspace .materials-card>.materials-header>.materials-heading p{font-size:11px!important;line-height:1.35!important}
 #requestWorkspace .materials-card .materials-drop-icon{width:34px;height:34px;font-size:17px}
 #requestWorkspace .materials-card>.materials-header>.materials-header-actions{grid-column:1/-1;grid-row:2;width:auto;min-width:0;display:flex;align-items:center;justify-content:flex-start;gap:8px;flex:initial;margin:0;flex-wrap:wrap}
 #requestWorkspace .materials-card .materials-summary-chip{min-width:0;padding:6px 9px;border-radius:10px;grid-template-columns:20px auto;column-gap:6px}
 #requestWorkspace .materials-card .materials-summary-icon{width:20px;height:20px;border-radius:6px;font-size:12px}
 #requestWorkspace .materials-card .materials-summary-chip strong{font-size:14px}
 #requestWorkspace .materials-card .materials-summary-chip small{font-size:8px}
 #requestWorkspace .materials-card>.materials-header>.section-edit-btn{grid-column:2;grid-row:1;align-self:start;justify-self:end;margin:0;min-height:34px;padding:0 10px;border-color:#9ed6d7;border-radius:8px;color:#07898d;font-size:10px;line-height:1;white-space:nowrap}
 #requestWorkspace .materials-card .materials-add-btn{width:auto;margin:0 0 0 auto;min-height:34px;padding:0 10px;font-size:10px}
 #requestWorkspace .materials-card #materialRows{display:grid;gap:9px;margin-top:0;min-height:0}
 #requestWorkspace .materials-card .v4-material-row{display:grid;grid-template-columns:38px minmax(0,1fr) auto 24px;grid-template-rows:auto auto;align-items:center;column-gap:10px;row-gap:3px;min-width:0;min-height:0;height:auto;padding:13px 11px;border:1px solid #d7e7eb;border-radius:14px;background:#fff;box-shadow:0 2px 8px rgba(28,57,78,.04);font-size:12px;overflow:hidden}
 #requestWorkspace .materials-card .v4-material-row:first-child{border-color:#bfe4e3;background:#f1fbfb;box-shadow:inset 4px 0 0 #0a9b9e,0 2px 8px rgba(28,57,78,.04)}
 #requestWorkspace .materials-card .materials-item-name{grid-column:1/3;grid-row:1;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:10px;min-width:0}
 #requestWorkspace .materials-card .materials-row-icon{width:38px;height:38px;border-radius:11px;background:#e4f7f6;color:#078f94;font-size:18px}
 #requestWorkspace .materials-card .v4-material-row .material-name{grid-column:2;min-width:0;width:100%;height:30px;padding:0;border:0;background:transparent;color:#193653;font-size:14px;font-weight:800;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #requestWorkspace .materials-card .v4-material-row .material-spec{grid-column:2;grid-row:2;min-width:0;width:100%;height:22px;margin:0;padding:0;border:0;background:transparent;color:#7f92a6;font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #requestWorkspace .materials-card .materials-quantity-group{grid-column:3;grid-row:1/3;display:flex;align-items:center;gap:3px;min-width:62px;height:32px;padding:0 8px;border-radius:999px;background:#e5f6f5;color:#183a57}
 #requestWorkspace .materials-card .v4-material-row .material-quantity{width:34px;height:28px;margin:0;padding:0;border:0!important;background:transparent!important;color:#183a57;font-size:15px;font-weight:800;line-height:1;text-align:right}
 #requestWorkspace .materials-card .v4-material-row .material-unit{width:22px;height:28px;margin:0;padding:0;border:0!important;background:transparent!important;background-image:none!important;color:#183a57;font-size:11px;font-weight:800;line-height:1;appearance:none;-webkit-appearance:none;text-align:left}
 #requestWorkspace .materials-card .v4-material-row button[data-remove-material]{grid-column:4;grid-row:1/3;display:none!important}
 #requestWorkspace .materials-card .materials-row-chevron{grid-column:4;grid-row:1/3;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;color:#6f8193;font-size:27px;font-weight:400;line-height:1}
 #requestWorkspace .materials-card.is-editing .v4-material-row{grid-template-columns:38px minmax(0,1fr) 62px 28px;background:#fff}
 #requestWorkspace .materials-card.is-editing .v4-material-row:first-child{background:#fff}
 #requestWorkspace .materials-card.is-editing .materials-row-chevron{display:none}
 #requestWorkspace .materials-card.is-editing .v4-material-row button[data-remove-material]{display:grid!important;place-items:center;width:28px;height:28px;border-radius:50%;background:#eff8f8;color:#07898d;font-size:18px}
 #requestWorkspace .materials-card.is-editing .materials-quantity-group{display:contents}
 #requestWorkspace .materials-card.is-editing .v4-material-row .material-quantity{grid-column:3;grid-row:1;width:62px;height:32px;padding:6px 7px;border:1px solid #d4e1e7!important;border-radius:7px;background:#fff!important;text-align:center}
 #requestWorkspace .materials-card.is-editing .v4-material-row .material-unit{grid-column:3;grid-row:2;width:62px;height:28px;padding:4px 6px;border:1px solid #d4e1e7!important;border-radius:7px;background:#fff!important;background-image:linear-gradient(45deg,transparent 50%,#52677f 50%),linear-gradient(135deg,#52677f 50%,transparent 50%)!important;background-position:calc(100% - 11px) 50%,calc(100% - 6px) 50%!important;background-size:5px 5px,5px 5px!important;background-repeat:no-repeat!important}
}
@media(max-width:420px){
 #requestWorkspace .materials-card{padding-left:12px;padding-right:12px}
 #requestWorkspace .materials-card>.materials-header{gap:12px 7px}
 #requestWorkspace .materials-card>.materials-header>.materials-heading h3{font-size:17px!important}
 #requestWorkspace .materials-card>.materials-header>.materials-heading p{font-size:10px!important}
 #requestWorkspace .materials-card>.materials-header>.section-edit-btn{padding:0 8px;font-size:9px}
 #requestWorkspace .materials-card .materials-summary-chip{padding:6px 8px}
 #requestWorkspace .materials-card .v4-material-row{padding:12px 9px}
 #requestWorkspace .materials-card .v4-material-row .material-name{font-size:13px}
}

/* Final overrides for the approved mobile request-detail redesign. */
@media(max-width:760px){
 #requestWorkspace .v4-title h1{white-space:nowrap!important;overflow:hidden!important;overflow-wrap:normal!important}
 #requestWorkspace .v4-steps{grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-auto-flow:initial!important;grid-auto-columns:auto!important;width:auto!important;padding:10px 4px 12px!important;overflow:visible!important}
 #requestWorkspace .v4-step:nth-child(4){display:none!important}
 #requestWorkspace .v4-request-main{display:contents!important}
 #requestWorkspace .v4-request-summary{grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:auto auto!important}
 #requestWorkspace .v4-request-summary>div:first-child{display:block!important}
 #requestWorkspace .v4-request-work-head{display:flex!important}
 #requestWorkspace .v4-request-summary>div:nth-child(2){display:none!important}
 #requestWorkspace .v4-request-machine-card>.v4-facts>div{min-height:67px!important;padding:12px 10px!important}
 #requestWorkspace .v4-request-machine-card>.v4-facts>div:nth-child(4){display:none!important;min-height:0!important;height:0!important;padding:0!important;border:0!important}
 #requestWorkspace .v4-request-machine-card>.v4-facts>div:nth-child(5){order:3!important;border-right:1px solid #e6edf1!important;border-bottom:0!important}
 #requestWorkspace .v4-request-machine-card>.v4-facts>div:nth-child(2){order:4!important;border-right:0!important;border-bottom:0!important}
 #requestWorkspace .v4-bottom-bar{flex-wrap:nowrap!important;padding:9px 10px calc(9px + env(safe-area-inset-bottom,0px))!important}
 #requestWorkspace .v4-bottom-bar .workflow-actions{flex-wrap:nowrap!important}
}

/* Mobile request detail: restore the real controls and keep the compact
   detail header usable while the page scrolls. */
#requestWorkspace .v4-mobile-back{display:none}
#requestWorkspace .mobile-work-toggle{display:none}
@media(max-width:760px){
 body:has(#requestWorkspace) .topbar{position:fixed!important;top:0!important;left:0!important;right:0!important;width:100%!important;z-index:31!important;margin:0!important;transform:none!important;transition:none!important}
 /* The shell header (64px) and the fixed navy request bar (68px) are both
    removed from normal flow. Keep the progress status below both layers so
    its circles and labels never sit underneath the navy bar. */
 #requestWorkspace{padding-top:132px!important}
 #requestWorkspace .v4-title{position:fixed!important;top:64px!important;left:0!important;right:0!important;width:100%!important;z-index:29!important;margin:0!important;box-shadow:0 5px 18px rgba(23,47,79,.18);transform:none!important;transition:none!important}
 #requestWorkspace .v4-title::before{content:none!important;display:none!important}
 #requestWorkspace .v4-mobile-back{display:grid;width:36px;height:36px;grid-column:1;grid-row:1;place-items:center;padding:0;border:0;background:transparent;color:#fff;font:300 42px/.8 ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;cursor:pointer}
 #requestWorkspace .v4-steps{grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-auto-flow:initial!important;grid-auto-columns:auto!important;overflow:visible!important}
 #requestWorkspace .v4-step:nth-child(4){display:grid!important}
 #requestWorkspace .v4-step>strong,#requestWorkspace .v4-step>small{max-width:100%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #requestWorkspace .completed-work-card{display:block!important}
 #requestWorkspace .completed-work-card:has(.completed-work-list:empty){display:block!important}
 #requestWorkspace .completed-work-card>header{display:flex!important;align-items:center!important;gap:9px;margin-bottom:0!important}
 #requestWorkspace .completed-work-card>header>div{display:block;flex:1;min-width:0}
 #requestWorkspace .completed-work-card>header>button.planning-edit-btn{flex:0 0 auto;margin:0;max-width:42%;white-space:nowrap}
 #requestWorkspace .completed-work-card .mobile-work-toggle{display:grid!important;flex:0 0 30px;place-items:center;width:30px;height:30px;margin:0;padding:0;border:1px solid #c8dce3;border-radius:50%;background:#f2f9fa;color:#087e80;font-size:24px;font-weight:400;line-height:1;cursor:pointer;transition:transform .15s ease}
 #requestWorkspace .completed-work-card .mobile-work-toggle[aria-expanded="true"]{transform:rotate(90deg)}
 #requestWorkspace .completed-work-card .completed-work-list{display:none!important}
 #requestWorkspace .completed-work-card.mobile-expanded .completed-work-list{display:grid!important;margin-top:10px}
 #requestWorkspace .photo-card .request-upload-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
 #requestWorkspace .photo-card .request-upload-actions label{display:grid!important;height:74px;min-width:0;padding:7px;border:1px dashed #adbfcd;border-radius:10px;align-content:center;justify-items:center;cursor:pointer}
 #requestWorkspace .photo-card .request-upload-actions label strong{max-width:100%;margin-top:3px;color:#23364c;font-size:10px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #requestWorkspace .photo-card .request-upload-actions label small{max-width:100%;margin-top:3px;color:#8996a6;font-size:8px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #requestWorkspace .photo-card .request-upload-actions label .v4-icon{font-size:19px;color:#07898d}
 #requestWorkspace .photo-card .request-files-button{display:flex!important;align-items:center;justify-content:center;min-height:32px;height:auto;margin-top:8px;padding:7px 9px;font-size:10px}
 #requestWorkspace .photo-card .upload-status{display:block!important;min-height:16px;margin-top:5px}
}

/* Keep the mobile shell header fixed on every portal menu. Detail pages get
   a fixed back strip directly below it; the request detail keeps its own
   dark title bar and back arrow in that slot. */
@media(max-width:760px){
 body.app-ready .topbar{position:fixed!important;top:0!important;left:0!important;right:0!important;width:100%!important;z-index:31!important;margin:0!important;transform:none!important;transition:none!important}
 body.app-ready #mainContent{padding-top:64px!important}
 body:has(#requestWorkspace) #mainContent{padding-top:0!important}
 body:not(.is-mobile-requests) #mainContent:has(> .page:not(.tasks-page):not(.request-trash-page) .portal-back-row){padding-top:calc(64px + var(--portal-mobile-toolbar-height,48px))!important}
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .portal-back-row{position:fixed!important;top:64px!important;left:0!important;right:0!important;width:100%!important;z-index:29!important;display:flex!important;flex-wrap:wrap!important;align-content:center!important;align-items:center!important;gap:8px!important;box-sizing:border-box!important;min-height:48px!important;height:auto!important;max-height:none!important;margin:0!important;padding:7px 12px!important;background:#fff!important;border-bottom:1px solid #dbe6eb!important;box-shadow:0 4px 12px rgba(23,47,79,.1)!important;overflow:visible!important;transform:none!important;transition:none!important}
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .portal-back-row .portal-back-button{height:34px!important}
}

/* Mobile registry controls share the fixed back strip, but wrap naturally.
   The strip height is measured by request-mobile.js so it never covers rows. */
@media(max-width:760px){
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .requests-back-row .registry-search-bar,
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .clients-back-row .registry-search-bar,
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .warehouse-back-row .registry-search-bar,
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .team-back-row .registry-search-bar,
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .documents-back-row .registry-search-bar,
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .maintenance-back-row .registry-search-bar{flex:1 1 180px!important;width:auto!important;max-width:none!important;min-width:0!important}
 body:not(.is-mobile-requests) #mainContent > .containers-board-page .containers-back-row .container-board-search{flex:1 1 180px!important;width:auto!important;max-width:none!important;min-width:0!important}
 body:not(.is-mobile-requests) #mainContent > .containers-board-page .containers-back-row .container-board-new{width:auto!important;flex:0 1 auto!important}
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .equipment-back-row .equipment-list-toolbar{flex:1 1 180px!important;width:auto!important;max-width:none!important;min-width:0!important;height:auto!important;margin:0!important}
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .portal-back-row>.btn,
 body:not(.is-mobile-requests) #mainContent > .page:not(.tasks-page):not(.request-trash-page) .portal-back-row>a.btn{flex:0 1 auto!important;max-width:100%!important}
}

/* Desktop request detail: keep the workflow in the title row, between the
   internal 1C field and the request actions. The flow copy remains for mobile. */
#requestWorkspace .v4-title-steps{display:none!important}
@media(min-width:1181px){
 #requestWorkspace.v4-page{position:relative}
 #requestWorkspace .v4-title{position:relative;display:grid!important;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;min-height:46px;margin-bottom:10px!important}
 #requestWorkspace .v4-title>div:first-of-type{min-width:0;display:flex;align-items:center;gap:12px}
 #requestWorkspace .v4-title .v4-more{margin-left:auto;flex:0 0 auto}
 #requestWorkspace .v4-title-steps{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;min-width:0;width:100%;height:36px;margin:0;padding:0 10px;overflow:visible}
 #requestWorkspace .v4-flow-steps{display:none!important}
 #requestWorkspace .v4-title-steps .v4-step{display:grid!important;align-items:center!important;justify-items:center!important;align-content:center!important;gap:2px!important;min-width:0;min-height:36px;height:auto!important;grid-template-rows:30px auto auto!important;white-space:normal!important;text-align:center!important}
 #requestWorkspace .v4-title-steps .v4-step i{top:15px;transform:none;z-index:0}
 #requestWorkspace .v4-title-steps .v4-step>b{position:relative;z-index:1;flex:0 0 30px;width:30px;height:30px;font-size:13px}
 #requestWorkspace .v4-title-steps .v4-step>strong{position:relative;z-index:1;padding:0 8px;background:var(--canvas);color:#314158;font-size:11px;line-height:1;white-space:nowrap}
 #requestWorkspace .v4-title-steps .v4-step>small{display:block!important;position:relative;z-index:1;color:#7d8ba0;font-size:10px;line-height:1.1;white-space:nowrap}
}

/* Approved contrast pass for the actual mobile request cards. This stylesheet
   is loaded after the shared portal styles, so keep the visual emphasis here
   where the compact .mr-card markup is rendered. */
@media(max-width:760px){
 .is-mobile-requests .mr-body .mr-card{
  border-color:#c5d8e1;
  background:linear-gradient(180deg,#fff 0%,#fbfdfe 100%);
  box-shadow:0 5px 16px rgba(23,47,79,.1),0 1px 2px rgba(23,47,79,.06);
  transition:border-color .15s,box-shadow .15s,transform .15s;
 }
 .is-mobile-requests .mr-body .mr-card:hover,
 .is-mobile-requests .mr-body .mr-card:focus-within{
  border-color:#63b9bb;
  box-shadow:0 7px 20px rgba(23,47,79,.14),0 0 0 2px rgba(99,185,187,.12);
 }
 .is-mobile-requests .mr-body .mr-card.mr-card-urgent{
  border-color:#e3bc80;
  background:linear-gradient(180deg,#fffaf3 0%,#fff7eb 100%);
 }
 .is-mobile-requests .mr-body .mr-code{color:#057f84;font-weight:900}
 .is-mobile-requests .mr-body .mr-type-tag{
  background:#e6eff3;
  color:#405c73;
  box-shadow:inset 0 0 0 1px rgba(54,90,113,.12);
 }
 .is-mobile-requests .mr-body .mr-check{
  border-color:#8ea7b7;
  box-shadow:0 1px 2px rgba(23,47,79,.08);
 }
 .is-mobile-requests .mr-body .mr-date-row{color:#657f95}
 .is-mobile-requests .mr-body .mr-date-icon{stroke:#6d879b}
 .is-mobile-requests .mr-body .mr-one-c{background:#e7eff3;color:#526e84}
 .is-mobile-requests .mr-body .mr-machine{
  background:#edf4f6;
  border:1px solid #d4e3e8;
 }
 .is-mobile-requests .mr-body .mr-machine-copy strong{color:#1a3552;font-weight:800}
 .is-mobile-requests .mr-body .mr-machine-copy small{color:#71879b}
 .is-mobile-requests .mr-body .mr-client-row{border-bottom-color:#d7e4e9}
 .is-mobile-requests .mr-body .mr-client-icon{stroke:#627f95}
 .is-mobile-requests .mr-body .mr-label{color:#6f879b}
 .is-mobile-requests .mr-body .mr-client-copy strong,
 .is-mobile-requests .mr-body .mr-work strong{color:#1f3a57;font-weight:800}
 .is-mobile-requests .mr-body .mr-open-detail{color:#365f79;font-weight:800}
 .is-mobile-requests .mr-body .mr-status{box-shadow:inset 0 0 0 1px rgba(18,73,96,.12);font-weight:850}
 .is-mobile-requests .mr-body .mr-status.progress{background:#dfebff;color:#1f62be}
 .is-mobile-requests .mr-body .mr-status.finished{background:#dcf1e5;color:#147448}
 .is-mobile-requests .mr-body .mr-status.waiting{background:#ffedcf;color:#9a5c05}
}
