/* Three workspace layouts; resizing never replaces forms, sessions or records. */
.app-main,.master-data-main{width:100%;min-width:0}
#workspace,#workspace>section,.master-data-main>section{min-width:0}
/* The signed-in identity is already in the header; keep its bound inputs intact. */
#newView .request-info{display:none}
#newView>.purchased-toggle{min-height:48px;padding:10px 12px}
#newView .purchased-toggle input{width:24px;height:24px;min-height:24px;margin:0;flex-shrink:0}
.app-shell header,.master-data-shell header{padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right))}
.app-shell main input,.app-shell main select,.app-shell main textarea,.master-data-main input{min-width:0;max-width:100%}
.app-shell .sales-line,.app-shell .commercial-grid{min-width:0}
.master-data-main{padding-top:20px}
.master-data-main>section{margin-bottom:16px}
.master-data-main h1{font-size:25px}
.master-data-main h2{font-size:21px}
.master-data-main header a,.master-data-shell header a{white-space:normal;text-decoration:none}
.master-data-main .card{overflow-wrap:anywhere}
#supplierReview{scroll-margin-top:20px}
#supplierReviewRows .card>button{margin-top:8px;min-height:44px}
#masterSaved>details{margin:0}
#masterSaved{display:grid;gap:12px}
#masterSaved summary{min-height:44px;cursor:pointer}
.commercial-create{container-type:inline-size}
@container (max-width:540px){
 .sales-line{grid-template-columns:minmax(0,1fr) minmax(70px,100px)}
 .sales-line input:first-child{grid-column:1/-1}
 .sales-line input{width:100%;min-width:0}
}

/* PC / Mac: primary modules above secondary actions, then a wide work area. */
@media (min-width:1200px) and (hover:hover) and (pointer:fine){
 .app-shell,.master-data-shell{--workspace-layout:desktop}
 .app-shell header,.master-data-shell header{padding:16px max(24px,calc((100vw - 1720px)/2));min-height:78px}
 .app-shell .app-main{max-width:1720px;padding:24px 24px 40px}
 #workspace:not([hidden]){display:block}
 #workspace>nav{display:flex;flex-flow:row nowrap;position:static;max-height:none;overflow-x:auto;overflow-y:hidden;margin:0 0 18px;padding:7px 2px 10px;gap:8px;border:0;border-radius:0;background:transparent;scrollbar-width:thin}
 #workspace>nav .tab{flex:0 0 auto;min-width:110px;width:auto;min-height:44px;padding:10px 16px;text-align:center;white-space:nowrap;font-size:14px;line-height:1.4}
 #newView:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) 250px;grid-template-rows:auto auto auto minmax(0,1fr);column-gap:20px;align-items:start}
 #newView>.project{grid-column:2;grid-row:1;margin-bottom:12px;align-items:flex-start}
 #newView>.purchased-toggle{grid-column:2;grid-row:2;margin:0 0 12px}
 #newView>#draftBox{grid-column:2;grid-row:3;margin:0;padding:14px}
 #newView>#requestForm,#newView>#purchasedIntake{grid-column:1;grid-row:1/span 4}
 #newView .project-icon{display:none}
 #newView .project .count{padding:4px 7px;font-size:12px}
 #newView .project{padding:12px;flex-wrap:wrap}
 #newView .project-choice{flex:1 1 160px}
 #items{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:16px;align-items:start}
 #items>.item-card{margin:0 0 12px}
 #newView .fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 #newView .fields>label:first-child,#newView .fields>.quantity-grid{grid-column:1/-1}
 .app-shell .commercial-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
 .app-shell .commercial-totals{grid-template-columns:repeat(4,minmax(0,1fr))}
 #userList,#projectList{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:16px;align-items:start}
 #userList>.card,#projectList>.card{margin:0}
 .master-data-main{max-width:1640px;padding:24px;display:grid;grid-template-columns:minmax(340px,.85fr) minmax(0,1.4fr);gap:20px;align-items:start}
 .master-data-main>section{margin:0}
 .master-import-card{grid-column:1;grid-row:1}
 .supplier-review-card{grid-column:2;grid-row:1}
 .master-records-card{grid-column:1/-1}
 #supplierReviewRows{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:12px}
 #supplierReviewRows>.card{margin:0}
 #masterSaved{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* iPad / medium windows: two navigation levels and two-column input. */
@media (min-width:640px) and (max-width:1199px), (min-width:640px) and (any-pointer:coarse), (min-width:640px) and (hover:none){
 .app-shell,.master-data-shell{--workspace-layout:tablet}
 .app-shell header{padding:10px max(18px,env(safe-area-inset-right)) 10px max(18px,env(safe-area-inset-left));gap:12px;min-height:68px}
 .app-shell header .brand small,.app-shell header .pilot,.app-shell header .language-picker>span{display:none}
 .app-shell header .brand{font-size:19px}
 .app-shell header .account-profile strong{font-size:14px}
 .app-shell header .language-picker select{min-height:48px;width:100px;font-size:16px;margin:0}
 .app-shell .app-main{max-width:1400px;padding:0 max(18px,env(safe-area-inset-right)) 30px max(18px,env(safe-area-inset-left))}
 #workspace:not([hidden]){display:block}
 #workspace>nav{position:static;max-height:none;overflow-y:hidden;border:0;border-radius:0}
 #workspace>nav{display:flex;flex-flow:row nowrap;overflow-x:auto;overscroll-behavior-x:contain;gap:8px;max-width:100%;margin:14px 0 18px;padding:3px 2px 8px;background:transparent;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
 #workspace>nav .tab{flex:0 0 auto;min-height:48px;min-width:120px;padding:10px 16px;white-space:nowrap;font-size:14px;justify-content:center}
 #newView:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) minmax(200px,.7fr);gap:12px;align-items:start}
 #newView>.project{grid-column:1;grid-row:1/span 2;align-self:stretch}
 #newView>.purchased-toggle{grid-column:2;grid-row:1;margin:0}
 #newView>#draftBox{grid-column:2;grid-row:2;margin:0;padding:12px}
 #newView>#requestForm,#newView>#purchasedIntake{grid-column:1/-1;grid-row:3}
 #items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
 #items>.item-card{margin:0}
 #items>.item-card:only-child{grid-column:1/-1}
 #newView .fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 #newView .fields>label:first-child,#newView .fields>.quantity-grid{grid-column:1/-1}
 #newView .project{padding:14px;margin-bottom:12px}
 #newView .card{padding:16px;border-radius:14px}
 #newView input,#newView select,#newView .catalog-open,.app-shell .secondary,.app-shell .tab{min-height:48px}
 #newView .footer-action{margin-top:12px}
 .app-shell .commercial-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,390px),1fr));gap:16px}
 .app-shell .commercial-form{grid-template-columns:repeat(2,minmax(0,1fr))}
 .app-shell .commercial-form .wide{grid-column:1/-1}
 .master-data-shell header{padding:14px 20px}
 .master-data-main{max-width:1400px;padding:20px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
 .master-data-main>section{margin:0;padding:16px}
 .master-records-card{grid-column:1/-1}
 #masterSaved{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* iPhone / narrow or short touch windows: one column and local horizontal scroll. */
@media (max-width:639px), (max-height:500px) and (any-pointer:coarse){
 .app-shell,.master-data-shell{--workspace-layout:phone}
 .app-shell .app-main{max-width:100%;padding:0 max(12px,env(safe-area-inset-right)) 24px max(12px,env(safe-area-inset-left))}
 .app-shell header{padding:6px max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left));gap:6px;min-height:56px}
 .app-shell header .brand small,.app-shell header .pilot,.app-shell header .language-picker>span{display:none}
 .app-shell header .brand{font-size:15px;gap:6px}
 .app-shell header .brandmark{width:28px;height:28px}
 .app-shell header .account-profile strong{font-size:12px}
 .app-shell header .account-bar{gap:5px}
 .app-shell header .account-bar small{font-size:10px;padding:1px 5px}
 .app-shell header .language-picker select{width:76px;min-height:44px;font-size:16px;margin:0;padding:5px}
 .app-shell header #logout{font-size:11px;padding:6px;min-height:44px}
 #workspace>nav{display:flex;flex-flow:row nowrap;overflow-x:auto;margin:8px 0 10px;padding:3px 2px 8px;gap:7px;background:transparent;scrollbar-width:none}
 #workspace>nav .tab{flex:0 0 auto;min-width:76px;min-height:44px;font-size:13px;padding:9px 12px;white-space:nowrap}
 #newView:not([hidden]){display:block}
 #items{display:block}
 #items>.item-card{margin:0 0 8px}
 .app-shell .commercial-grid,.app-shell .commercial-form{grid-template-columns:minmax(0,1fr)}
 .app-shell .commercial-totals{grid-template-columns:repeat(2,minmax(0,1fr))}
 .master-data-shell header{padding:10px 12px;gap:8px;grid-template-columns:minmax(0,1fr) auto;font-size:15px}
 .master-data-shell header a{font-size:12px;padding:9px 10px;max-width:120px}
 .master-data-main{display:block;max-width:100%;padding:12px}
 .master-data-main>.card{padding:14px}
 .master-data-main h1{font-size:23px}
 .master-data-main h2{font-size:20px}
 #masterSaved{grid-template-columns:minmax(0,1fr)}
 #supplierReviewRows .card>button{width:100%;margin:7px 0 0}
}

/* Shared top-level module bar. Keep it ahead of all actions/content at every width. */
#workspace>.workspace-navigation{position:sticky;top:0;z-index:8;min-width:0;width:100%;max-width:100%;padding-top:8px;background:#f3f6fa;border-bottom:1px solid var(--line)}
#workspace>.workspace-navigation .workspace-groups{position:relative;display:flex;flex-flow:row nowrap;gap:8px;min-width:0;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scroll-behavior:smooth;scroll-padding-inline:3px;scrollbar-width:thin;padding:3px 3px 9px}
#workspace>.workspace-navigation .workspace-group{flex:1 0 auto;min-height:48px;min-width:106px;padding:10px 14px;white-space:nowrap;font-size:14px;line-height:1.3;border-radius:10px;overflow-wrap:normal}
#workspace>.workspace-navigation .workspace-group.workspace-support{min-height:48px;font-size:14px}
#workspace>.workspace-navigation .workspace-group.active{border-color:#354487;box-shadow:inset 0 1px 0 #ffffff24,0 3px 0 #121b47,0 4px 8px #1e276126}
#workspace>nav{width:100%;max-width:100%;min-width:0}
@media(max-width:639px){
 #workspace>.workspace-navigation{padding-top:5px}
 #workspace>.workspace-navigation .workspace-groups{gap:7px}
 #workspace>.workspace-navigation .workspace-group,#workspace>.workspace-navigation .workspace-group.workspace-support{flex:0 0 auto;min-width:94px;min-height:44px;padding:9px 12px;font-size:13px}
}
@media(prefers-reduced-motion:reduce){#workspace>.workspace-navigation .workspace-groups{scroll-behavior:auto}}

/* Short touch landscape is a phone workspace, not the narrow portrait layout.
   Screen rotation changes CSS only: keep the same input nodes, draft and session. */
@media (orientation:landscape) and (min-width:568px) and (max-height:500px) and (any-pointer:coarse),
       (orientation:landscape) and (min-width:568px) and (max-height:500px) and (hover:none){
 .app-shell,.master-data-shell{--workspace-layout:phone-landscape}
 body>header{padding:4px max(12px,env(safe-area-inset-right)) 4px max(12px,env(safe-area-inset-left));min-height:52px;gap:8px}
 .app-shell header .brand small,.app-shell header .pilot,.app-shell header .language-picker>span,.app-shell header .account-bar small{display:none}
 .app-shell header .brand{font-size:15px;gap:6px}
 .app-shell header .brandmark{width:28px;height:28px}
 .app-shell header .account-profile strong{font-size:13px}
 .app-shell header .language-picker select{width:82px;min-height:44px;margin:0;padding:5px;font-size:16px}
 .app-shell header #logout{min-height:44px;padding:6px 10px}
 .app-shell .app-main,.master-data-main,#subcontractApp,#inventoryApp{max-width:100%;min-width:0;padding:0 max(12px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
 #workspace>.workspace-navigation{padding-top:3px}
 #workspace>.workspace-navigation .workspace-groups{gap:6px;padding:2px 2px 6px}
 #workspace>.workspace-navigation .workspace-group,#workspace>.workspace-navigation .workspace-group.workspace-support{flex:0 0 auto;min-width:94px;min-height:44px;padding:8px 12px;font-size:13px}
 #workspace>nav{margin:4px 0 8px;padding:2px 2px 5px;gap:6px}
 #workspace>nav .tab{min-width:90px;min-height:44px;padding:8px 12px;font-size:13px}
 #newView:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,.65fr);gap:8px 12px;align-items:start}
 #newView>.project{grid-column:1;grid-row:1/span 2;align-self:stretch;padding:10px;margin:0}
 #newView>.purchased-toggle{grid-column:2;grid-row:1;margin:0;min-height:44px;padding:8px 10px}
 #newView>#draftBox{grid-column:2;grid-row:2;margin:0;padding:10px}
 #newView>#requestForm,#newView>#purchasedIntake{grid-column:1/-1;grid-row:3}
 #items{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
 #items>.item-card{margin:0}
 #newView .card{padding:12px;border-radius:14px}
 #newView .fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
 #newView .fields>label.wide,#newView .fields>label:first-child,#newView .fields>label:has([data-field=spec]){grid-column:auto}
 #newView .fields>.quantity-grid,#newView .catalog-hint{grid-column:1/-1}
 #newView .quantity-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 #newView input,#newView select,#newView .catalog-open{min-height:44px;font-size:16px}
 #newView .stepper{grid-template-columns:44px minmax(0,1fr) 44px}
 #newView .stepper button{min-width:44px;min-height:44px}
 #newView .footer-action{flex-flow:row wrap;align-items:center;gap:8px;padding:6px 0 calc(6px + env(safe-area-inset-bottom))}
 #newView .footer-action #draftStatus{flex:1 1 110px;font-size:11px;text-align:left}
 #newView .footer-action #saveExitDraft{flex:0 1 140px;min-width:100px;min-height:44px}
 #newView .footer-action #submit{flex:1 1 180px;min-width:140px;min-height:44px}
 .review-delivery,.review-delivery .contact-fields,.app-shell .commercial-form{grid-template-columns:repeat(2,minmax(0,1fr))}
 .review-delivery>.wide,.review-delivery>.contact-fields,.app-shell .commercial-form>.wide{grid-column:1/-1}
 .app-shell .review-actions{flex-flow:row wrap;gap:8px;padding:6px 0 calc(6px + env(safe-area-inset-bottom))}
 .app-shell .review-actions>button{flex:1 1 140px;min-height:44px}
 .master-data-main{display:block;padding-top:12px}
 .master-data-main>.card{padding:14px}
 .app-shell dialog,#subDialog,#inventoryDialog{max-width:calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 16px);max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);overflow:auto;margin:auto;padding:12px 16px;scroll-padding-bottom:60px}
 .rfq-dialog h2{font-size:22px}
 .rfq-supplier-list{max-height:min(180px,45dvh)}
 .rfq-dialog-actions,.rfq-email-actions{gap:8px;margin-top:10px;padding-bottom:max(4px,env(safe-area-inset-bottom))}
 .rfq-dialog-actions>button,.rfq-email-actions>button{min-height:44px}
 @media (min-width:740px){.rfq-step-grid{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:14px}}
}

/* Compact primary/secondary hierarchy. Keep the direct nav for module mounts. */
#workspace>.workspace-navigation{padding:4px 5px 0;border:1px solid #d6dfed;border-bottom:0;border-radius:12px 12px 0 0;background:#eef2f9}
#workspace>.workspace-navigation .workspace-groups{gap:5px;padding:2px 1px 5px;scrollbar-width:thin}
#workspace>.workspace-navigation .workspace-group,#workspace>.workspace-navigation .workspace-group.workspace-support{flex:0 0 auto;min-width:0;min-height:46px;padding:7px 11px;font-size:13px;line-height:1.3;border-radius:9px}
#workspace>nav{position:sticky;top:var(--workspace-primary-height,58px);z-index:7;display:flex;flex-flow:row nowrap;width:100%;max-width:100%;gap:5px;margin:0 0 14px;padding:5px 6px 7px;background:#eef2f9;border:1px solid #d6dfed;border-top:0;border-radius:0 0 12px 12px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
#workspace>nav .tab{flex:0 0 auto;min-width:0;width:auto;min-height:44px;padding:6px 10px;font-size:12px;font-weight:600;line-height:1.3;border:1px solid transparent;border-radius:7px;background:transparent;color:#536580;box-shadow:none;white-space:nowrap;text-align:center}
#workspace>nav .tab.active{background:#dce6f7;border-color:#b6c8e5;color:#1e3263;box-shadow:inset 0 -2px 0 #677fb0}
.material-notes{white-space:pre-wrap;overflow-wrap:anywhere}
.material-product-links{display:grid;gap:6px;margin-top:6px}
.material-product-links a{display:block;max-width:100%;min-height:44px;padding:8px 0;overflow-wrap:anywhere}
.material-notes a,.material-product-links a{color:#176b9c;text-decoration:underline;text-underline-offset:2px}

/* Own purchase records: one group per request, one horizontal row per item. */
.record-group{padding:0;overflow:hidden}
.record-group-heading{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:16px;min-height:60px;cursor:pointer}
.record-group-heading::before{content:'▸';flex:none}
.record-group>details[open]>.record-group-heading::before{content:'▾'}
.record-order-number{font-weight:700;overflow-wrap:anywhere;flex:1 1 240px}
.record-status-summary{flex:1 1 100%;font-size:13px;color:var(--ink,#173448);padding-left:20px}
.record-body{border-top:1px solid #d5dfeb;padding:12px}
.record-table-scroll{max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.record-table{border-collapse:separate;border-spacing:0;width:100%;min-width:1550px;font-size:14px}
.record-table th,.record-table td{padding:10px;vertical-align:top;text-align:left;border-bottom:1px solid #d5dfeb;border-right:1px solid #e4eaf1;white-space:normal;min-width:108px}
.record-table th{background:#eaf0f7;font-size:12px;font-weight:700}
.record-table th:first-child,.record-table td:first-child{position:sticky;left:0;z-index:1;background:#fff;min-width:88px;width:100px;box-shadow:2px 0 3px #19395014}
.record-table th:first-child{background:#eaf0f7;z-index:2}
.record-table td:nth-child(3),.record-table td:nth-child(4),.record-table td:nth-child(10),.record-table td:nth-child(11){min-width:190px;max-width:300px;overflow-wrap:anywhere}
.record-table td:nth-child(2){min-width:145px}
.record-table .badge{white-space:normal}
.record-table button{min-height:44px;margin-bottom:4px}
.record-table input,.record-table select,.record-table textarea{font-size:16px;min-height:44px;width:100%;min-width:100px;margin:0}
.record-table textarea{min-height:110px;min-width:220px}
.record-table .photos{margin:0;gap:4px;flex-wrap:wrap}
.record-table .photo{width:66px;height:66px}
.record-table .photo img{width:66px;height:66px;object-fit:cover}
.record-table .photo button{min-height:28px}
.record-editing td{background:#fffbe9}
.record-lock{font-size:12px;color:#59677c}
.record-delivery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.record-delivery dt{font-size:12px;color:#607085}.record-delivery dd{margin:4px 0 0;overflow-wrap:anywhere}
.record-photo-add{font-size:12px}.record-photo-add input{width:185px}
@media(max-width:550px){.record-body{padding:8px}.record-delivery{grid-template-columns:1fr}.record-group-heading{padding:12px;gap:6px 12px}.record-table{font-size:13px}}
@media(orientation:landscape) and (max-height:500px){.record-delivery{grid-template-columns:repeat(4,minmax(0,1fr))}.record-table td,.record-table th{padding:8px}}

/* Shared oldest-first intake, personal post-RFQ follow-up, shared mobile shell. */
.procurement-layout{display:grid;grid-template-columns:190px minmax(0,1fr);gap:14px;align-items:start}
.procurement-sidebar{position:sticky;top:calc(var(--workspace-primary-height,58px) + 60px);max-height:70dvh;overflow:auto;background:#edf2f8;border:1px solid #d5dfeb;border-radius:12px;padding:8px}
.procurement-sidebar .rfq-project-tabs{display:flex;flex-direction:column;overflow:visible;gap:6px;margin:0}
.procurement-sidebar button{width:100%;min-height:44px;text-align:left;white-space:normal;display:flex;justify-content:space-between;gap:8px}
.procurement-sidebar button.active{background:#1e2761;color:white}.procurement-main{min-width:0}
.procurement-main .rfq-table{min-width:1500px}.procurement-main .rfq-table td{vertical-align:top;white-space:normal}.procurement-main .rfq-table small{display:block}
.intake-source th{background:#eaf0f7;padding:10px;text-align:left}.intake-source details{font-size:12px;font-weight:400}
.procurement-toolbar,.desk-actions{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}.procurement-toolbar label{min-width:150px;flex:1}
.desk-batch{display:flex;justify-content:space-between;align-items:center;gap:12px}.desk-batch h2{font-size:18px}
.desk-suppliers,.desk-charge-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.desk-suppliers .card{margin:0}
.desk-check{display:flex;gap:10px;align-items:flex-start;margin:14px 0}.desk-check input{width:20px;height:20px;min-width:20px;flex:none}
.procurement-dialog{width:min(1000px,96vw);max-height:88dvh;overflow:auto}.procurement-dialog input[type=number]{min-width:100px}
.supplier-preview-table{width:100%;border-collapse:collapse;min-width:600px}.supplier-preview-table td,.supplier-preview-table th{border:1px solid #b7c7db;padding:9px;text-align:left}.supplier-preview-table th{background:#eaf0f7}
.supplier-table-preview{overflow:auto;margin:12px 0}.supplier-table-preview table{border-collapse:collapse;width:100%;min-width:600px}.supplier-table-preview td,.supplier-table-preview th{border:1px solid #b7c7db;padding:8px;text-align:left}
#deskDetail{scroll-margin-top:130px}#deskDetail fieldset,#deskDialog fieldset{min-width:0;border:1px solid #d5dfeb;border-radius:10px;margin:12px 0;padding:12px}
@media(max-width:600px){.procurement-layout{grid-template-columns:104px minmax(0,1fr);gap:8px}.procurement-sidebar{padding:4px;top:calc(var(--workspace-primary-height,58px) + 54px)}.procurement-sidebar button{font-size:12px;padding:7px;overflow-wrap:anywhere}.desk-batch{flex-wrap:wrap}.desk-batch h2{font-size:16px}.procurement-main .rfq-sheet-head{flex-wrap:wrap}.procurement-main .rfq-sheet-head button{width:100%}.desk-suppliers,.desk-charge-grid{grid-template-columns:1fr}.procurement-toolbar label{min-width:120px}}
@media(orientation:landscape) and (max-height:500px){.procurement-layout{grid-template-columns:150px minmax(0,1fr)}.procurement-sidebar{max-height:55dvh}}
#deskProjectToggle{display:none;grid-column:1/-1}.procurement-layout.projects-collapsed{grid-template-columns:minmax(0,1fr)}
@media(max-width:600px){#deskProjectToggle{display:block;justify-self:start;min-height:44px}.procurement-layout.projects-collapsed .procurement-sidebar{display:none}}
@media print{#rfqPrintLink{display:none}}
/* Material source choices reuse the intake sheet and compact workbench. */
.source-check{display:flex!important;align-items:center;gap:8px;font-weight:500}.source-check input[type=checkbox]{width:22px;min-width:22px;height:22px;min-height:22px;margin:0}.source-vendor-action{display:grid;gap:5px;min-width:170px}.source-vendor-action small{font-size:12px}.source-choices{display:grid;gap:8px;border-top:1px solid var(--line);padding-top:10px;margin-top:10px}.source-choices small{font-size:12px;color:var(--muted);white-space:normal}.source-task p{overflow-wrap:anywhere}.source-task h3{font-size:17px}.source-task .sub-actions{margin-bottom:0}#sourceDialog label{display:grid;gap:6px;margin:12px 0}#sourceDialog .source-check{display:flex}#sourceDialog p{overflow-wrap:anywhere}#sourceDialog select{max-width:100%}#sourceTaskList{margin-top:18px}#sourceTaskList>h2,#sourceReceipts>h2{font-size:19px}

/* Compact shell: one sticky location bar, user-controlled navigation, account menu and tactile keys.
   Applies only after the signed-in workspace script runs; the signed-out header keeps its language picker. */
.app-shell>header{position:sticky;top:0;z-index:30}
.compact-shell.shell-signed-in>header{display:flex;align-items:center;gap:10px;min-height:56px;padding:calc(6px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left))}
.compact-shell.shell-signed-in>header .brand{flex:none;gap:8px;font-size:17px}
.compact-shell.shell-signed-in>header .brand small{display:none}
.compact-shell.shell-signed-in>header .brandmark{width:32px;height:32px}
.shell-crumb{display:flex;align-items:center;gap:7px;flex:0 1 auto;min-width:0;max-width:560px;min-height:44px;padding:6px 12px;border:1px solid #ffffff38;border-radius:11px;background:linear-gradient(#ffffff26,#ffffff0d);color:#fff;font-size:15px;font-weight:700;line-height:1.2;text-align:left;box-shadow:inset 0 1px 0 #ffffff33,0 2px 0 #0b1236;transition:transform .08s,box-shadow .08s}
.shell-crumb:active{transform:translateY(2px);box-shadow:inset 0 1px 0 #ffffff26,0 0 0 #0b1236}
.shell-burger{display:grid;gap:3px;width:16px;flex:none}.shell-burger i{display:block;height:2px;border-radius:2px;background:currentColor}
.shell-crumb-module{flex:none;font-weight:500;opacity:.78;white-space:nowrap}
.shell-crumb-sep{flex:none;opacity:.6}
.shell-crumb-view{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shell-crumb-chevron{flex:none;width:8px;height:8px;margin:0 2px 3px 4px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);transition:transform .15s}
.shell-crumb[aria-expanded="true"] .shell-crumb-chevron{transform:rotate(-135deg);margin-bottom:-3px}
.shell-crumb-module:empty,.shell-crumb-module:empty+.shell-crumb-sep{display:none}
.shell-avatar{flex:none;margin-left:auto;width:44px;height:44px;padding:0;border:2px solid #ffffff66;border-radius:50%;background:linear-gradient(#5262b3,#2f3a80);color:#fff;font-size:15px;font-weight:700;box-shadow:inset 0 1px 0 #ffffff40,0 2px 0 #0b1236}
.shell-avatar:active{transform:translateY(2px);box-shadow:0 0 0 #0b1236}
.shell-avatar[aria-expanded="true"]{border-color:var(--amber)}
.shell-menu{position:fixed;z-index:40;top:calc(var(--app-header-h,56px) + 6px);right:max(8px,env(safe-area-inset-right));display:grid;gap:12px;width:min(340px,calc(100vw - 16px));max-height:calc(100dvh - var(--app-header-h,56px) - 16px);overflow:auto;overscroll-behavior:contain;padding:12px;border:1px solid var(--line);border-radius:14px;background:#fff;color:#16203a;box-shadow:0 18px 40px #0f142640}
.shell-menu .account-bar{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin:0;padding:12px;border-radius:10px;background:#eef2f9;color:#16203a}
.shell-menu .account-profile{min-height:44px;color:#16203a}
.shell-menu .account-bar strong{display:block;font-size:16px;white-space:normal}
.shell-menu .account-bar small{display:inline-block;margin-top:4px;padding:1px 8px;border:1px solid #c9d4e3;border-radius:999px;color:#4a5b70;font-size:12px}
.shell-menu #logout{width:100%;min-height:44px;font-size:14px}
.shell-menu .header-actions{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px}
.shell-menu .header-actions .language-picker{display:grid;flex:1 1 160px;gap:4px;color:#4a5b70;font-size:13px}
.shell-menu .header-actions .language-picker>span{display:block;color:#4a5b70}
.shell-menu .header-actions .language-picker select{width:100%;min-height:44px;margin:0;background:#fff;border:1px solid #c9d4e3;color:#16203a;font-size:16px}
.shell-menu .header-actions .pilot{display:inline-block;align-self:center;border-color:#c9d4e3;color:#4a5b70}
.shell-menu .shell-menu-install{width:100%}
.shell-menu .site-footer{padding:10px 2px 0;border-top:1px solid var(--line);text-align:left;font-size:12px}
.shell-backdrop{position:fixed;inset:0;z-index:24;background:#0a0e1e66}
/* Sticky offsets follow the location bar; collapsed navigation gives its space back immediately. */
.compact-shell #workspace>.workspace-navigation{top:var(--app-header-h,0px);display:flex;align-items:center;gap:8px}
.compact-shell #workspace>.workspace-navigation .workspace-groups{flex:1 1 auto;min-width:0}
.compact-shell #workspace>nav{top:calc(var(--app-header-h,0px) + var(--workspace-primary-height,58px))}
.shell-collapse{flex:none;min-height:40px;margin:0 2px 4px;padding:6px 12px;border:1px solid #c9d4e3;border-radius:9px;background:linear-gradient(#fff,#eef2f8);color:#4a5b70;font-size:13px;font-weight:600;white-space:nowrap;box-shadow:inset 0 1px 0 #fff,0 2px 0 #c3cfdd}
.nav-collapsed #workspace{--workspace-primary-height:0px!important}
.nav-collapsed #workspace>.workspace-navigation,.nav-collapsed #workspace>nav{display:none}
.nav-collapsed #workspace{padding-top:8px}
/* Phone: the navigation opens as a menu over the page, so the table, selections and scroll stay put underneath. */
.nav-overlay #workspace>.workspace-navigation{position:fixed;z-index:26;top:var(--app-header-h,56px);left:0;right:0;margin:0;padding:12px max(12px,env(safe-area-inset-right)) 4px max(12px,env(safe-area-inset-left));border:0;border-radius:0;background:#f3f6fb}
.nav-overlay #workspace>.workspace-navigation .workspace-groups{flex-wrap:wrap;overflow:visible}
.nav-overlay #workspace>.workspace-navigation .workspace-group{flex:0 0 auto}
.nav-overlay .shell-collapse{display:none}
.nav-overlay #workspace>nav{position:fixed;z-index:26;top:calc(var(--app-header-h,56px) + var(--workspace-primary-height,0px));left:0;right:0;flex-wrap:wrap;overflow:visible;max-height:none;margin:0;padding:8px max(12px,env(safe-area-inset-right)) 14px max(12px,env(safe-area-inset-left));border:0;border-top:1px solid #d6dfed;border-radius:0 0 16px 16px;background:#f3f6fb;box-shadow:0 18px 30px #0a0e1e40}
.nav-overlay{overflow:hidden}
@media (max-width:639px),(max-height:500px) and (any-pointer:coarse){
 .compact-shell.shell-signed-in>header{min-height:52px;padding-top:calc(4px + env(safe-area-inset-top,0px));padding-bottom:4px;gap:8px}
 .compact-shell.shell-signed-in>header .brand>div{display:none}
 .compact-shell.shell-signed-in>header .brandmark{width:30px;height:30px}
 .shell-crumb{flex:1 1 auto;max-width:none;font-size:15px}
}
/* Page titles: one line with the count and refresh, no eyebrow or oversized heading. */
.compact-shell #workspace>section>.heading{margin-bottom:10px;gap:10px;align-items:center}
.compact-shell #workspace>section>.heading h1{margin:0;font-size:21px;letter-spacing:-.2px;line-height:1.3}
.compact-shell #workspace>section>.heading .eyebrow{display:none}
/* Install tip: one slim, dismissible strip in the browser; hidden in the installed app as before. */
.compact-shell #iphoneInstall{min-height:44px;margin:8px 0;padding:2px 2px 2px 12px;gap:8px}
.compact-shell #iphoneInstall>span{flex:1 1 auto;min-width:0}
.compact-shell #iphoneInstall [data-install-help]{min-height:40px;padding:6px 12px}
.compact-shell #iphoneInstall{font-size:12.5px;line-height:1.35}
@media (max-width:639px){.compact-shell #iphoneInstall [data-install-help]{font-size:12.5px;padding:6px 10px}}
.shell-tip-close{flex:none;width:44px;height:40px;padding:0;border:0;background:none;color:var(--muted);font-size:22px;line-height:1}
.install-tip-dismissed #iphoneInstall{display:none!important}
/* Tactile keys: raised when available, pressed in when selected, and a short press-down on tap. */
.compact-shell #workspace>.workspace-navigation .workspace-group{background:linear-gradient(#fff,#edf1f8);border:1px solid #c6d1e1;color:#1e2761;box-shadow:inset 0 1px 0 #fff,0 3px 0 #b7c4d6,0 4px 8px #1e276114;transition:transform .08s,box-shadow .08s}
.compact-shell #workspace>.workspace-navigation .workspace-group:active{transform:translateY(3px);box-shadow:inset 0 1px 0 #fff,0 0 0 #b7c4d6,0 1px 2px #1e276114}
.compact-shell #workspace>.workspace-navigation .workspace-group.active{transform:translateY(2px);background:linear-gradient(#26327a,#1e2761);border-color:#121a4d;color:#fff;box-shadow:inset 0 2px 5px #0a103a99,0 1px 0 #b7c4d6}
.compact-shell #workspace>nav .tab{background:linear-gradient(#fff,#f0f3f8);border:1px solid #cdd7e5;color:#34465f;box-shadow:inset 0 1px 0 #fff,0 2px 0 #c0ccdb;border-radius:9px;transition:transform .08s,box-shadow .08s}
.compact-shell #workspace>nav .tab:active{transform:translateY(2px);box-shadow:inset 0 1px 0 #fff,0 0 0 #c0ccdb}
.compact-shell #workspace>nav .tab.active{transform:translateY(1px);background:linear-gradient(#ffe6a3,#f5b841);border-color:#cf931d;color:#1e2761;font-weight:700;box-shadow:inset 0 2px 3px #a8731a66,0 1px 0 #fff}
.compact-shell .secondary{background-image:linear-gradient(#fbfcfe,#e3ebf2);border:1px solid #c6d3df;box-shadow:inset 0 1px 0 #fff,0 2px 0 #b9c8d6;transition:transform .08s,box-shadow .08s}
.compact-shell .primary{box-shadow:inset 0 1px 0 #ffffff66,0 3px 0 #b8821e,0 4px 8px #1e27611f;transition:transform .08s,box-shadow .08s}
.compact-shell .secondary:not(:disabled):active{transform:translateY(2px);box-shadow:inset 0 1px 0 #fff,0 0 0 #b9c8d6}
.compact-shell .primary:not(:disabled):active{transform:translateY(3px);box-shadow:inset 0 1px 0 #ffffff66,0 0 0 #b8821e}
.compact-shell .primary:disabled,.compact-shell .secondary:disabled{box-shadow:none;transform:none}
@media (hover:hover){.compact-shell #workspace>nav .tab:not(.active):hover,.compact-shell #workspace>.workspace-navigation .workspace-group:not(.active):hover,.compact-shell .secondary:not(:disabled):hover{border-color:#9fb1c8}}
@media (prefers-reduced-motion:reduce){.shell-crumb,.shell-crumb-chevron,.compact-shell .primary,.compact-shell .secondary,.compact-shell #workspace>nav .tab,.compact-shell #workspace>.workspace-navigation .workspace-group{transition:none}}
/* Installation help is in the account menu once signed in; the page-bottom duplicate is hidden there. */
.compact-shell.shell-signed-in .app-main>.install-tip{display:none!important}
.shell-menu .account-bar>div{min-width:0}
.shell-menu .account-profile{padding:0}

/* Work frame: jobsite button, collapsible or bottom-sheet jobsite list, filter summary and a pinned material table. */
.compact-shell #deskProjectToggle{display:inline-flex;align-items:center;gap:8px;grid-column:1/-1;justify-self:start;max-width:100%;min-height:44px;padding:6px 14px;color:#1e2761;font-size:15px}
.desk-project-pin{flex:none;width:11px;height:11px;margin:0 2px 3px;border:2px solid #1e2761;border-radius:50% 50% 50% 0;background:var(--amber);transform:rotate(-45deg)}
.desk-project-name{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700}
.desk-project-count{flex:none;min-width:24px;padding:0 7px;border-radius:999px;background:#1e2761;color:#fff;font-size:12px;line-height:22px;text-align:center}
.desk-project-count:empty{display:none}
.desk-project-chevron{flex:none;width:8px;height:8px;margin:0 2px 4px 2px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);transition:transform .15s}
#deskProjectToggle[aria-expanded="true"] .desk-project-chevron{transform:rotate(-135deg);margin-bottom:-2px}
.compact-shell .procurement-layout{row-gap:10px}
.compact-shell .procurement-layout.projects-collapsed,.compact-shell .procurement-layout.projects-sheet{grid-template-columns:minmax(0,1fr)}
.compact-shell .procurement-layout:not(.projects-sheet) .procurement-sidebar{top:calc(var(--app-sticky-h,0px) + 8px);max-height:calc(100dvh - var(--app-sticky-h,0px) - 16px)}
.compact-shell .procurement-layout.projects-sheet .procurement-sidebar{position:fixed;z-index:35;top:auto;left:0;right:0;bottom:0;display:block;max-height:min(70dvh,560px);overflow:auto;overscroll-behavior:contain;padding:16px max(14px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));border:0;border-radius:18px 18px 0 0;background:#fff;box-shadow:0 -12px 40px #0a0e1e40}
.compact-shell .procurement-layout.projects-sheet .procurement-sidebar[hidden]{display:none}
.compact-shell .procurement-layout.projects-sheet:not(.projects-collapsed)::after{content:"";position:fixed;inset:0;z-index:34;background:#0a0e1e66}
.compact-shell .procurement-layout.projects-sheet .rfq-project-tabs button{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:48px;font-size:16px}
.compact-shell .procurement-main .rfq-sheet-head{flex-direction:row;flex-wrap:nowrap;align-items:center;gap:10px;padding:8px 12px}
.compact-shell .procurement-main .rfq-sheet-head>div{min-width:0}
.compact-shell .procurement-main .rfq-sheet-head button{flex:none;width:auto;min-height:44px}
.compact-shell .procurement-main .rfq-table-scroll{max-height:calc(100dvh - var(--app-sticky-h,56px) - 76px);min-height:280px}
/* Checkbox and item name stay visible while the other columns scroll sideways; status slides under the name. */
.compact-shell .procurement-main .rfq-table thead th:first-child,.compact-shell .procurement-main .rfq-table tbody td:first-child{position:sticky;left:0;z-index:2;background:#fff}
.compact-shell .procurement-main .rfq-table thead th:nth-child(3),.compact-shell .procurement-main .rfq-table tbody td:nth-child(3){position:sticky;left:var(--rfq-first-col,44px);z-index:2;min-width:150px;max-width:42vw;background:#fff;box-shadow:1px 0 0 #d4dee9,6px 0 8px -6px #1e276140}
.compact-shell .procurement-main .rfq-table thead th:first-child,.compact-shell .procurement-main .rfq-table thead th:nth-child(3){z-index:4;background:#eef3f7}
.compact-shell .procurement-main .rfq-table tbody tr.selected td{background:#fff4ce}
@media (hover:hover){.compact-shell .procurement-main .rfq-table tbody tr:not(.intake-source):hover td{background:#fffbea}}
.compact-shell .intake-source-head{position:sticky;left:10px;display:inline-block;max-width:min(680px,calc(100vw - 72px))}
/* Purchasing filters: a one-line summary that opens the full controls. */
#deskFilterToggle{display:inline-flex;align-items:center;gap:8px;max-width:100%;min-height:44px;margin:0 0 10px;text-align:left}
#deskFilterSummary{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#5e6f82;font-weight:500}
#deskFilterSummary:not(:empty)::before{content:"· "}
#deskFilterToggle::after{content:"";flex:none;width:7px;height:7px;margin:0 2px 3px 4px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg)}
#deskFilterToggle[aria-expanded="true"]::after{transform:rotate(-135deg);margin-bottom:-2px}
@media (prefers-reduced-motion:reduce){.desk-project-chevron{transition:none}}
/* The jobsite button sits on the title line; phones drop the title because the location bar names the page. */
.compact-shell #historyView>.heading #deskProjectToggle{flex:0 1 auto;min-width:0;margin-left:auto}
.compact-shell #historyView>.heading .refresh{flex:none}
#historyView:has(#procurementIntake[hidden]) #deskProjectToggle{display:none}
@media (max-width:639px),(max-height:500px) and (any-pointer:coarse){
 .compact-shell #historyView>.heading:has(#deskProjectToggle:not([hidden])) h1{display:none}
 .compact-shell #historyView>.heading #deskProjectToggle{flex:1 1 auto;margin-left:0}
 .compact-shell #iphoneInstall>span{display:none}
 .compact-shell #iphoneInstall{justify-content:flex-end;padding-left:4px}
 .compact-shell #iphoneInstall [data-install-help]{flex:1 1 auto}
 .compact-shell .procurement-main .rfq-sheet-head .primary{padding:8px 14px;font-size:15px}
}
.compact-shell .procurement-main .rfq-table tbody td:nth-child(3){width:min(360px,42vw);max-width:min(360px,42vw)}
@media (min-width:640px){.compact-shell .procurement-main .rfq-table tbody td:nth-child(3){min-width:300px}}
.compact-shell .procurement-main .rfq-table tbody td:nth-child(3) .source-choices label{white-space:normal}
/* Row summaries: history reference and source plan sit side by side as tags; opening one gives it the full cell width. */
.compact-shell [data-intake-reference]{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.compact-shell [data-intake-reference]>details[open]{flex-basis:100%}
.compact-shell .source-route>summary,.compact-shell .reference-brief>summary{display:inline-flex;align-items:center;gap:6px;max-width:100%;min-height:32px;padding:3px 11px;border:1px solid #c9d4e3;border-radius:999px;background:linear-gradient(#fff,#eef2f8);box-shadow:inset 0 1px 0 #fff,0 2px 0 #c3cfdd;color:#5e6f82;font-size:12.5px;line-height:1.25;list-style:none;cursor:pointer}
.compact-shell .source-route>summary::-webkit-details-marker,.compact-shell .reference-brief>summary::-webkit-details-marker,.compact-shell .delivery-brief>summary::-webkit-details-marker{display:none}
.compact-shell .source-route>summary b,.compact-shell .reference-brief>summary b{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#1e2761;font-weight:600}
.compact-shell .source-route>summary:active,.compact-shell .reference-brief>summary:active{transform:translateY(2px);box-shadow:inset 0 1px 0 #fff,0 0 0 #c3cfdd}
.compact-shell .source-route[open]>summary,.compact-shell .reference-brief[open]>summary{border-color:#1e2761;background:#e9eef8;box-shadow:inset 0 1px 3px #1e276133}
.compact-shell .source-route:has(b:not(:empty))>summary b{color:#1e2761}
.compact-shell .source-route .source-choices{margin-top:8px;padding:10px;border:1px solid #dce5ed;border-radius:10px;background:#f8fafd}
.compact-shell .reference-brief>summary~*{margin-top:8px}
@media (any-pointer:coarse){.compact-shell .source-route>summary,.compact-shell .reference-brief>summary{min-height:40px;font-size:13px}}
/* Shared delivery details: one line under the requester; the full block opens on tap. */
.compact-shell .delivery-brief{margin-top:2px;font-size:12.5px}
.compact-shell .delivery-brief>summary{display:flex;align-items:center;gap:6px;min-height:32px;max-width:100%;list-style:none;cursor:pointer;color:#4a5b70}
.compact-shell .delivery-brief>summary::after{content:"";flex:none;width:6px;height:6px;margin:0 4px 3px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg)}
.compact-shell .delivery-brief[open]>summary::after{transform:rotate(-135deg);margin-bottom:-2px}
.compact-shell .delivery-brief>summary span{flex:none;padding:1px 7px;border-radius:6px;background:#dfe7f2;color:#1e2761;font-weight:600}
.compact-shell .delivery-brief>summary b{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:500}
.compact-shell .delivery-brief>p{margin:4px 0 2px;font-weight:400;white-space:normal}
@media (any-pointer:coarse){.compact-shell .delivery-brief>summary{min-height:40px}}

/* Task actions in the pinned first column stack compactly so the column stays narrow. */
.compact-shell .procurement-main .rfq-table tbody td:first-child{width:1%}
.compact-shell .procurement-main .rfq-table tbody td:first-child .secondary{display:block;width:100%;min-width:64px;min-height:36px;margin-top:6px;padding:4px 8px;font-size:12px;white-space:nowrap}
@media (any-pointer:coarse){.compact-shell .procurement-main .rfq-table tbody td:first-child .secondary{min-height:44px}}
.compact-shell .intake-source-head{display:inline-flex;flex-wrap:wrap;align-items:center;column-gap:14px}
.compact-shell .intake-source-head .delivery-brief{margin:0}
/* Phones: status moves under the item name so the name column starts next to the checkbox. */
.compact-shell .procurement-main .rfq-table .intake-state-inline{display:none}
@media (max-width:639px),(max-height:500px) and (any-pointer:coarse){
 .compact-shell .procurement-main .rfq-table thead th:nth-child(2),.compact-shell .procurement-main .rfq-table tbody tr:not(.intake-source) td:nth-child(2){display:none}
 .compact-shell .procurement-main .rfq-table thead th:nth-child(3){min-width:min(240px,55vw)}
 .compact-shell .procurement-main .rfq-table tbody td:nth-child(3){width:min(240px,55vw);max-width:min(240px,55vw)}
 .compact-shell .procurement-main .rfq-table .intake-state-inline{display:block;margin-top:2px;color:#b4541a;font-size:12px}
}
@media (max-width:639px),(max-height:500px) and (any-pointer:coarse){
 .compact-shell .procurement-main .rfq-table tbody td:nth-child(3){width:min(260px,60vw);max-width:min(260px,60vw)}
 .compact-shell [data-intake-reference]{gap:5px}
 .compact-shell .source-route>summary,.compact-shell .reference-brief>summary{gap:4px;padding:2px 9px;font-size:12.5px}
 .compact-shell .procurement-main .rfq-table tbody td:first-child .secondary{min-width:56px;padding:4px 6px}
}

/* Request entry table: one material per row, edited in place. The existing item markup and handlers are reused;
   wrappers become display:contents so each field label is a cell of the row grid. */
#newView .item-table{min-width:0;border:1px solid #d6e0ea;border-radius:12px;background:#fff;overflow:hidden}
#newView .item-table-head{display:none}
#newView #items{display:block;margin:0}
#newView #items>.item-card{display:grid;column-gap:8px;row-gap:6px;align-items:start;margin:0;padding:8px 10px;border:0;border-bottom:1px solid #e3eaf1;border-radius:0;box-shadow:none;background:#fff}
#newView #items>.item-card:last-child{border-bottom:0}
#newView #items .item-top,#newView #items .item-body,#newView #items .fields,#newView #items .quantity-grid{display:contents}
#newView #items .item-body[hidden]{display:contents!important}
#newView #items label[data-col]{min-width:0;margin:0;font-size:0;line-height:1.2;color:#5e6f82}
#newView #items label[data-col]>*{font-size:15px}
#newView #items label[data-col]>span{display:none}
#newView #items label[data-col] input,#newView #items label[data-col] select{margin-top:0;min-height:44px;width:100%}
#newView #items .name-with-voice,#newView #items .catalog-input{margin-top:0}
#newView #items .row-number{grid-area:num;align-self:start;padding-top:12px;color:#5e6f82;font-weight:700;text-align:center;font-variant-numeric:tabular-nums;position:relative}
#newView #items label[data-col=name]{grid-area:name}
#newView #items label[data-col=spec]{grid-area:spec}
#newView #items label[data-col=quantity]{grid-area:qty}
#newView #items label[data-col=unit]{grid-area:unit}
#newView #items label[data-col=code]{grid-area:code}
#newView #items label[data-col=use]{grid-area:use}
#newView #items .row-tools{grid-area:tools;display:flex;gap:6px;min-width:0}
#newView #items .remove{grid-area:del;align-self:start;min-height:44px;min-width:44px;margin:0;padding:6px 8px;border:1px solid #e3c9c9;border-radius:9px;background:linear-gradient(#fff,#f8eeee);color:#9c3030;font-size:13px;font-weight:600;box-shadow:inset 0 1px 0 #fff,0 2px 0 #dcbcbc}
#newView #items .remove:active{transform:translateY(2px);box-shadow:none}
#newView #items .item-toggle{display:none}
#newView #items .catalog-hint{display:none;grid-column:2/-1;margin:0;font-size:12px}
#newView #items .item-card:focus-within .catalog-hint{display:block}
#newView #items .row-tools .secondary{flex:1 1 auto;display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:44px;min-width:44px;padding:4px 9px;font-size:13px;white-space:nowrap}
#newView #items .row-tools b{font-weight:700;font-variant-numeric:tabular-nums}
#newView #items .row-tools .has-content{border-color:#1e2761;color:#1e2761;background-image:linear-gradient(#f4f7fd,#dfe7f6)}
#newView #items .row-tools .row-notes.has-content .row-lbl::after{content:" ✓"}
#newView #items .row-tools [aria-expanded="true"]{background:#e9eef8;border-color:#1e2761;box-shadow:inset 0 1px 3px #1e276133;transform:translateY(1px)}
/* Photos and notes open in the row's own extension area under its fields; other rows stay one line. */
#newView #items .photo-button,#newView #items .photos,#newView #items .item-details{grid-column:2/-1;margin:0}
#newView #items .item-card:not(.photos-open) .photo-button,#newView #items .item-card:not(.photos-open) .photos{display:none}
#newView #items .photos:empty{display:none}
#newView #items .item-details>summary{display:none}
#newView #items .item-details:not([open]){display:none}
#newView #items .item-details textarea{margin-top:0;min-height:72px;width:100%}
#newView #items .photo-button{justify-self:start}
/* Validation: rows with a missing field after a submit attempt carry a red mark on the row number. */
#requestForm.validated #items>.item-card:has(:invalid) .row-number::after{content:"";position:absolute;top:6px;right:2px;width:8px;height:8px;border-radius:50%;background:#b42318}
#requestForm.validated #items>.item-card:has(:invalid){background:#fff8f7}
#newView .add-item{margin:10px 0 12px}

/* Desktop: the full table in one line per material. */
@media (min-width:1100px) and (min-height:501px),(min-width:1100px) and (pointer:fine){
 #newView .item-table-head,#newView #items>.item-card{grid-template-columns:32px minmax(210px,2fr) minmax(185px,1.7fr) 72px 74px minmax(100px,.75fr) minmax(130px,1fr) 112px 44px;grid-template-areas:"num name spec qty unit code use tools del"}
 #newView .item-table-head{display:grid;column-gap:8px;padding:8px 10px;background:#eef3f7;border-bottom:1px solid #cbd8e2;color:#456176;font-size:12.5px;font-weight:600;white-space:nowrap}
}
/* Tablet / medium: still one row per material; related fields share a cell in two layers. */
@media (min-width:640px) and (max-width:1099px) and (min-height:501px),(min-width:640px) and (max-width:1099px) and (pointer:fine){
 #newView .item-table-head,#newView #items>.item-card{grid-template-columns:30px minmax(0,2fr) 72px 74px minmax(0,1fr) 92px;grid-template-areas:"num name qty unit code tools" "num spec qty unit use del"}
 #newView .item-table-head{display:grid;column-gap:8px;row-gap:2px;padding:8px 10px;background:#eef3f7;border-bottom:1px solid #cbd8e2;color:#456176;font-size:12.5px;font-weight:600;white-space:nowrap}
 #newView #items .row-tools .row-lbl{display:none}
 #newView #items .remove{justify-self:stretch}
}
#newView .item-table-head .h-num{grid-area:num}#newView .item-table-head .h-name{grid-area:name}#newView .item-table-head .h-spec{grid-area:spec}#newView .item-table-head .h-qty{grid-area:qty}#newView .item-table-head .h-unit{grid-area:unit}#newView .item-table-head .h-code{grid-area:code}#newView .item-table-head .h-use{grid-area:use}#newView .item-table-head .h-tools{grid-area:tools}#newView .item-table-head .h-del{grid-area:del}
#newView .item-table-head b{color:#b42318}
/* Phone landscape: a real horizontal table; row number and item name stay pinned while the rest scrolls. */
@media (max-height:500px) and (any-pointer:coarse) and (orientation:landscape){
 #newView .item-table{overflow-x:auto;overscroll-behavior-x:contain}
 #newView .item-table-head,#newView #items>.item-card{width:1160px;grid-template-columns:30px 240px 72px 74px 230px 120px 160px 100px 44px;grid-template-areas:"num name qty unit spec code use tools del";padding-left:0}
 #newView .item-table-head{display:grid;column-gap:8px;padding-block:7px;background:#eef3f7;border-bottom:1px solid #cbd8e2;color:#456176;font-size:12.5px;font-weight:600;white-space:nowrap}
 #newView .item-table-head .h-num,#newView #items .row-number{position:sticky;left:0;z-index:2;background:inherit}
 #newView #items .row-number{background:#fff;align-self:stretch}
 #newView .item-table-head .h-name,#newView #items label[data-col=name]{position:sticky;left:42px;z-index:2;background:inherit;box-shadow:6px 0 8px -6px #1e276140}
 #newView #items label[data-col=name]{background:#fff}
 #newView #items .row-tools .row-lbl{display:none}
 #newView #items .photo-button,#newView #items .photos,#newView #items .item-details{position:sticky;left:42px;max-width:calc(100vw - 80px)}
}
/* Phone portrait: one line per material with name, quantity and unit editable in place.
   The summary bar below expands the rest of that row; only one row is open at a time. */
@media (max-width:639px){
 #newView #items>.item-card{grid-template-columns:24px minmax(0,1fr) 78px 74px;grid-template-areas:"num name qty unit" "tog tog tog tog";padding:8px 8px 4px}
 #newView #items>.item-card:has(> .item-top [aria-expanded="false"]) :is(label[data-col=spec],label[data-col=code],label[data-col=use],.row-tools,.remove,.photo-button,.photos,.item-details,.catalog-hint){display:none}
 #newView #items>.item-card:has(> .item-top [aria-expanded="false"]) :is(.stepper>button,.catalog-open,.voice-btn){display:none}
 #newView #items>.item-card:has(> .item-top [aria-expanded="false"]) .stepper{display:block}
 #newView #items .item-toggle{grid-area:tog;display:flex;align-items:center;gap:6px;min-height:44px;padding:0 4px 0 30px;background:none;border:0;color:#5e6f82;font-size:12.5px;text-align:left}
 #newView #items .item-toggle .item-number,#newView #items .item-toggle [data-item-name]{display:none}
 #newView #items .item-toggle .item-heading{min-width:0;flex:1}
 #newView #items .item-toggle [data-item-preview]{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12.5px;color:#5e6f82}
 #newView #items .item-toggle .item-chevron{margin-left:auto;font-size:16px;color:#1e2761}
 /* The open row grows: name on its own line, then labelled fields. */
 #newView #items>.item-card:has(> .item-top [aria-expanded="true"]){grid-template-columns:24px minmax(0,1fr) minmax(0,1fr);grid-template-areas:"num name name" "num qty unit" "num spec spec" "num code code" "num use use" "num tools del" "tog tog tog";background:#fbfcff;box-shadow:inset 3px 0 0 #1e2761}
 #newView #items>.item-card:has(> .item-top [aria-expanded="true"]) label[data-col]{font-size:12px}
 #newView #items>.item-card:has(> .item-top [aria-expanded="true"]) label[data-col]>span{display:inline}
 #newView #items>.item-card:has(> .item-top [aria-expanded="true"]) label[data-col]>:not(span){margin-top:3px}
 #newView #items>.item-card:has(> .item-top [aria-expanded="true"]) .item-toggle [data-item-preview]{visibility:hidden}
 #newView #items label[data-col]>*{font-size:16px}
 #newView #items .remove{justify-self:stretch}
}
/* While typing on a touch screen the sticky submit bar steps aside for the keyboard. */

/* Mouse and keyboard: typing is faster than steppers or voice, so the table keeps those cells clean. */
@media (pointer:fine){
 #newView #items .voice-btn{display:none}
}
#newView .item-table>#usLanguageHint{margin:0;padding:7px 10px;border-bottom:1px solid #e3eaf1;background:#fbfcfe;font-size:12.5px}
/* Phones: the jobsite, already-purchased switch and draft tools shrink so the first material shows sooner. */
@media (max-width:639px){
 #newView{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:8px;align-content:start}
 #newView>*{grid-column:1/-1;min-width:0}
 #newView>#draftBox,#newView>.draft-tools{grid-column:auto;align-self:start}
 #newView .project{margin:0 0 8px;padding:8px 10px;gap:8px}
 #newView .project .project-icon,#newView .project .project-label{display:none}
 #newView .project select{min-height:44px}
 #newView .project #projectAddress{font-size:12px}
 #newView .purchased-toggle{margin:0 0 8px;min-height:44px;padding:0 10px}
 #newView #draftBox,#newView .draft-tools{margin:0 0 8px;padding:0}
 #newView #draftBox>summary,#newView .draft-tools>summary{display:flex;align-items:center;min-height:44px;padding:0 12px;font-size:14px}
 #newView #draftBox[open],#newView .draft-tools[open]{grid-column:1/-1}
}

/* Bottom action dock: selection count, jobsite and the one primary action stay within thumb reach. */
.action-dock{display:none}
.compact-shell .action-dock{position:fixed;z-index:20;left:0;right:0;bottom:0;display:flex;align-items:center;gap:10px;min-height:60px;padding:8px max(12px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));border-top:1px solid #dce5ed;background:#fffffff2;backdrop-filter:blur(10px);box-shadow:0 -4px 14px #0f14260f}
.compact-shell .action-dock[hidden]{display:none}
.action-dock-summary{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;line-height:1.3}
.action-dock-summary #rfqSelectionCount{font-size:15px;font-weight:700;color:#16203a;margin:0}
.action-dock-summary #intakeDockProject{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12.5px;color:#5e6f82}
.compact-shell .action-dock .secondary{flex:none;min-height:44px}
.compact-shell .action-dock .primary{flex:none;width:auto;min-height:46px;margin:0;padding:10px 18px}
@media (min-width:1100px){.compact-shell .action-dock{left:auto;right:max(24px,env(safe-area-inset-right));bottom:16px;min-width:520px;border:1px solid #d6e0ea;border-radius:14px;padding-bottom:8px}}
/* The old in-table header only held the title, count and button; the dock now carries them. */
.compact-shell .procurement-main .rfq-sheet-head{display:none}
.compact-shell .procurement-main .rfq-table-scroll{max-height:calc(100dvh - var(--app-sticky-h,56px) - 84px)}
#historyView:not([hidden]) #procurementIntake:not([hidden]) .procurement-main{padding-bottom:76px}
/* While typing, bottom bars step aside for the keyboard; the request footer becomes the same style of dock. */
.keyboard-open .action-dock,.keyboard-open #newView .footer-action{display:none!important}
.compact-shell #newView .footer-action{z-index:10;margin:0 calc(-1 * max(16px,env(safe-area-inset-left)));padding:8px max(16px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));border-top:1px solid #dce5ed;background:#fffffff2;box-shadow:0 -4px 14px #0f14260f}

/* Dialogs: one scroll area per dialog, close control pinned to the top corner, primary actions pinned to the bottom.
   Phones get a full-screen sheet clear of the notch and home indicator; wider screens keep a wide panel. */
html:has(dialog[open]){overflow:hidden}
.compact-shell :is(.rfq-dialog,.workflow-dialog,.supplier-dialog,.financial-entry-dialog){overscroll-behavior:contain}
.compact-shell .rfq-dialog .dialog-close{position:sticky;top:0;float:right;z-index:6;margin:-8px -8px 0 8px;border-radius:50%;background:#fffffff0;box-shadow:0 1px 4px #1e276126}
.compact-shell .workflow-dialog>button.secondary:first-child,.compact-shell .workflow-dialog>.workflow-actions:first-child{position:sticky;top:0;z-index:6;float:right;margin:0 0 6px 10px;background:#fff}
.compact-shell :is(.rfq-dialog-actions,.rfq-email-actions){position:sticky;bottom:0;z-index:5;margin-top:14px;padding:10px 0 calc(8px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff;box-shadow:0 -6px 12px -8px #1e276133}
.compact-shell .workflow-dialog form>button.primary:last-child{position:sticky;bottom:0;z-index:5;width:100%;margin-top:12px;box-shadow:0 -10px 14px -6px #fff,inset 0 1px 0 #ffffff66,0 3px 0 #b8821e}
.compact-shell .workflow-dialog h2,.compact-shell .rfq-dialog h2{clear:none;padding-right:8px}
@media (max-width:639px),(max-height:500px) and (any-pointer:coarse){
 .compact-shell dialog:is(.rfq-dialog,.workflow-dialog,.supplier-dialog,.financial-entry-dialog){width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:calc(10px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left))}
 .compact-shell .rfq-dialog .dialog-close{margin:-6px -6px 0 8px}
 /* No scroll area inside the scrolling sheet: the supplier list grows with the page. */
 .compact-shell .rfq-dialog .rfq-supplier-list{max-height:none;overflow:visible}
 .compact-shell .rfq-dialog .rfq-step-grid{gap:14px;margin-top:10px}
 /* Supplier emails: a swipeable strip of supplier cards; each keeps its own review, Gmail and confirm actions. */
 .compact-shell .rfq-recipient-queue{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;margin:10px calc(-1 * max(14px,env(safe-area-inset-left))) 12px;padding:2px max(14px,env(safe-area-inset-left)) 8px}
 .compact-shell .rfq-recipient-card{flex:0 0 min(80vw,300px);scroll-snap-align:start}
 .compact-shell .rfq-email-actions{flex-direction:row;flex-wrap:wrap}
 .compact-shell .rfq-email-actions>button{flex:1 1 140px}
}
/* Links styled as keys need a box of their own so their padding never overlaps neighbouring rows. */
.compact-shell a:is(.secondary,.primary){display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:6px 0;text-decoration:none}
/* Pinned action bars reach the dialog's bottom edge so nothing scrolls visibly beneath them. */
.compact-shell .rfq-dialog,.compact-shell .workflow-dialog{padding-bottom:0}
.compact-shell .workflow-dialog form>button.primary:last-child{bottom:12px;margin-bottom:12px}
.compact-shell .workflow-dialog>:last-child:not(form){margin-bottom:16px}

/* Receiving on phones: each material is a compact grid instead of eight label/value lines.
   Name and use first, then specification and cost code, then ordered / received / remaining side by side,
   this receipt and status, and the three receipt keys in one row. Cells keep their existing labels. */
@media (max-width:720px){
 .compact-shell .po-group-header{padding:10px 12px}
 .compact-shell .po-items tr[data-po-row]{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px 10px;padding:10px 12px}
 .compact-shell .po-items tr[data-po-row]>td{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:2px;min-width:0;padding:0;text-align:left;overflow-wrap:anywhere}
 .compact-shell .po-items tr[data-po-row]>td::before{font-size:10.5px;letter-spacing:.2px}
 .compact-shell .po-items tr[data-po-row] td strong,.compact-shell .po-items tr[data-po-row] td small{text-align:left}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(1){grid-column:1/-1;order:1}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(1)::before{display:none}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(1) strong{font-size:15px}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(2){grid-column:span 4;order:2}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(3){grid-column:span 2;order:3}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(4){grid-column:span 2;order:4}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(5){grid-column:span 2;order:5}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(7){grid-column:span 2;order:6;font-weight:700;color:#1e2761}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(6){grid-column:span 3;order:7}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(8){grid-column:span 3;order:8}
 .compact-shell .po-items tr[data-po-row]>td.po-actions-cell{grid-column:1/-1;order:9;padding-top:2px}
 .compact-shell .po-items tr[data-po-row]>td.po-actions-cell::before{display:none}
 .compact-shell .po-item-actions{display:flex;flex-wrap:nowrap;gap:6px;width:100%}
 .compact-shell .po-item-actions button.small,.compact-shell .po-items .danger.small{flex:1 1 0;min-width:0;min-height:44px;padding:6px 8px;font-size:14px}
 .compact-shell #receivingRotateHint{padding:6px 10px;margin:0 0 10px;font-size:13px}
}
.compact-shell .po-items .danger.small{box-shadow:inset 0 1px 0 #fff8,0 2px 0 #e2b4b4}
.compact-shell .po-items .danger.small:active{transform:translateY(2px);box-shadow:none}

/* Request cards (records and approvals): requester and count on the title line, project, ID, date and request number on one wrapped line. */
.compact-shell #historyView article.card[data-order-id]{padding:12px 14px;margin-bottom:10px}
.compact-shell #historyView .order-head h2{font-size:17px;margin:0 0 2px}
.compact-shell #historyView .order-head .meta{display:inline;font-size:12.5px}
.compact-shell #historyView .order-head .meta:not(:last-child)::after{content:" · "}
.compact-shell #historyView article.card[data-order-id]>.approval-badge{display:inline-block;margin:6px 0 2px}
.compact-shell #historyView article.card[data-order-id]>details>summary{display:flex;align-items:center;min-height:44px;padding:0}
.compact-shell #historyView article.card[data-order-id] .workflow-actions .secondary{min-height:44px}

/* Purchasing follow-up: task cards keep every line but drop the large paragraph gaps; actions share one row. */
.compact-shell .desk-batch{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 14px;padding:12px 14px;margin-bottom:10px}
.compact-shell .desk-batch h2{margin:0;font-size:16px}
.compact-shell .desk-batch p{margin:2px 0;font-size:13px;color:#4a5b70}
.compact-shell .source-task{padding:12px 14px;margin-bottom:10px}
.compact-shell .source-task h3{margin:0 0 4px;font-size:16px}
.compact-shell .source-task p{margin:2px 0;font-size:13.5px}
.compact-shell .source-task .sub-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.compact-shell .source-task a[target]{display:inline-flex;align-items:center;min-height:44px;margin-right:8px}
@media (max-width:720px){
 .compact-shell .po-items tr[data-po-row]{grid-template-columns:repeat(4,minmax(0,1fr))}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(2){grid-column:span 2;order:2}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(3){grid-column:span 1;order:3}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(8){grid-column:span 1;order:4}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(4){grid-column:span 1;order:5}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(5){grid-column:span 1;order:6}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(7){grid-column:span 1;order:7}
 .compact-shell .po-items tr[data-po-row]>td:nth-child(6){grid-column:span 1;order:8}
}
.compact-shell #historyView .order-head .meta{line-height:1.45}
.compact-shell #historyView article.card[data-order-id]>details>summary{list-style:none;gap:8px;color:#1e2761;font-weight:600}
.compact-shell #historyView article.card[data-order-id]>details>summary::-webkit-details-marker{display:none}
.compact-shell #historyView article.card[data-order-id]>details>summary::before{content:"";width:7px;height:7px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(-45deg);transition:transform .15s}
.compact-shell #historyView article.card[data-order-id]>details[open]>summary::before{transform:rotate(45deg)}

/* Quantity is typed on the numeric keypad on every device; the −/+ keys stay in the markup but are not shown. */
#newView #items .stepper>button{display:none}
#newView #items .stepper{display:block}
#newView #items [data-field="quantity"]{text-align:right;font-variant-numeric:tabular-nums}

/* An open suggestion menu lifts its row above neighbouring rows and pinned cells. */
#newView #items>.item-card.catalog-open{position:relative;z-index:50}
#newView #items .catalog-options{z-index:60}

/* Supplier quotations: source order, one editable row per material, fees separate. */
#deskDialog:has(#deskQuoteForm){width:min(1400px,96vw);max-width:96vw}
.quote-import{padding:10px;border:1px solid var(--line);border-radius:10px;background:#f4f7fc;margin-bottom:10px}
.quote-import p{overflow-wrap:anywhere}.quote-import select{width:100%;max-width:100%}
#quoteMetadata,#quoteChargesSection{padding:8px 10px;border:1px solid var(--line);border-radius:8px;margin:8px 0}
#quoteMetadataSummary,#quoteChargesSummary{font-weight:400;color:var(--muted)}
.quote-entry{min-width:1050px;table-layout:fixed}
.quote-entry th,.quote-entry td{min-width:0;padding:8px;max-width:none}
.quote-entry th:first-child,.quote-entry td:first-child{min-width:42px;width:42px;max-width:42px}
.quote-entry th:nth-child(2),.quote-entry td:nth-child(2){min-width:165px;width:165px;max-width:200px}
.quote-entry th:nth-child(3),.quote-entry td:nth-child(3){min-width:235px;width:235px;max-width:300px}
.quote-entry th:nth-child(4),.quote-entry td:nth-child(4){min-width:85px;width:85px;max-width:100px}
.quote-entry th:nth-child(5),.quote-entry td:nth-child(5){min-width:85px;width:85px}
.quote-entry th:nth-child(6),.quote-entry td:nth-child(6){min-width:95px;width:95px}
.quote-entry th:nth-child(7),.quote-entry td:nth-child(7){min-width:110px;width:110px;white-space:nowrap}
.quote-entry input:not([type=checkbox]){width:100%;min-width:60px;font-size:16px;padding:8px}
.quote-entry input[type=checkbox]{width:20px;min-width:20px;height:20px;min-height:20px;flex:none}
.quote-entry label{display:flex;align-items:center;gap:6px;font-size:12px;min-height:44px}
.quote-entry small{display:block;font-size:12px;color:var(--muted)}
.quote-charge{display:grid;grid-template-columns:minmax(110px,1fr) minmax(140px,2fr) 100px auto;gap:8px;align-items:center;margin:10px 0}
.quote-charge>*{min-width:0;width:100%}#quoteImportReview label{margin:8px 0}#quoteImportStatus{font-weight:600}
@media(max-width:639px){#deskDialog:has(#deskQuoteForm){width:100vw;max-width:100vw}.quote-charge{grid-template-columns:minmax(0,1fr) 100px}.quote-charge input[name=chargeDescription]{grid-column:1/-1;grid-row:1}.quote-charge select{grid-column:1/-1}.quote-charge button{min-height:44px}}
#deskDialog:has(#deskScopeForm){width:min(1400px,96vw);max-width:96vw}
.scope-entry{min-width:1550px;table-layout:fixed}.scope-entry input,.scope-entry textarea{min-width:80px;width:100%}
#quoteTaxSource{overflow-wrap:anywhere}
/* Allocate scarce table width to descriptions; numeric and action columns stay compact. */
.quote-entry{min-width:1120px;width:100%;table-layout:fixed}
.quote-entry th:nth-child(1),.quote-entry td:nth-child(1){width:36px;min-width:36px;max-width:36px}
.quote-entry th:nth-child(2),.quote-entry td:nth-child(2){width:24%;min-width:250px;max-width:none}
.quote-entry th:nth-child(3),.quote-entry td:nth-child(3){width:26%;min-width:270px;max-width:none}
.quote-entry th:nth-child(4),.quote-entry td:nth-child(4){width:72px;min-width:72px;max-width:72px}
.quote-entry th:nth-child(5),.quote-entry td:nth-child(5){width:74px;min-width:74px;max-width:74px}
.quote-entry th:nth-child(6),.quote-entry td:nth-child(6){width:90px;min-width:90px;max-width:90px}
.quote-entry th:nth-child(7),.quote-entry td:nth-child(7){width:100px;min-width:100px;max-width:100px}
.quote-entry th:nth-child(8),.quote-entry td:nth-child(8){width:140px;min-width:140px;max-width:140px}
.quote-entry input[name=quantity],.quote-entry input[name=unitPrice]{text-align:right;font-variant-numeric:tabular-nums;padding:8px 4px}
.quote-entry input[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}
.quote-entry td:first-child{position:static;box-shadow:none}
.record-group .record-table,#procurementIntake .record-table{table-layout:fixed;min-width:1640px}
.record-group .record-table :is(th,td),#procurementIntake .record-table :is(th,td){min-width:0;max-width:none;overflow-wrap:anywhere}
.record-group .record-table :is(th,td):nth-child(1),#procurementIntake .record-table :is(th,td):nth-child(1){width:76px}
.record-group .record-table :is(th,td):nth-child(2),#procurementIntake .record-table :is(th,td):nth-child(2){width:120px}
.record-group .record-table :is(th,td):nth-child(3),#procurementIntake .record-table :is(th,td):nth-child(3){width:280px}
.record-group .record-table :is(th,td):nth-child(4),#procurementIntake .record-table :is(th,td):nth-child(4){width:250px}
.record-group .record-table :is(th,td):nth-child(5),#procurementIntake .record-table :is(th,td):nth-child(5){width:76px}
.record-group .record-table :is(th,td):nth-child(6),#procurementIntake .record-table :is(th,td):nth-child(6){width:76px}
.record-group .record-table :is(th,td):nth-child(7),#procurementIntake .record-table :is(th,td):nth-child(7){width:126px}
.record-group .record-table :is(th,td):nth-child(8),#procurementIntake .record-table :is(th,td):nth-child(8){width:88px}
.record-group .record-table :is(th,td):nth-child(9),#procurementIntake .record-table :is(th,td):nth-child(9){width:160px}
.record-group .record-table :is(th,td):nth-child(10),#procurementIntake .record-table :is(th,td):nth-child(10){width:240px}
.record-group .record-table :is(th,td):nth-child(11),#procurementIntake .record-table :is(th,td):nth-child(11){width:110px}
.record-table input[type=checkbox]{width:20px;min-width:20px;height:20px;min-height:20px}
.record-group .record-table input{min-width:0}.record-table .material-notes a{overflow-wrap:anywhere}
.scope-entry{table-layout:fixed;min-width:1710px}.scope-entry :is(th,td){min-width:0;max-width:none}
.scope-entry :is(th,td):nth-child(1),.scope-entry :is(th,td):nth-child(2){width:270px}
.scope-entry :is(th,td):nth-child(3),.scope-entry :is(th,td):nth-child(4){width:80px}
.scope-entry :is(th,td):nth-child(5){width:145px}.scope-entry :is(th,td):nth-child(6){width:160px}
.scope-entry :is(th,td):nth-child(7){width:200px}.scope-entry :is(th,td):nth-child(8){width:270px}.scope-entry :is(th,td):nth-child(9){width:180px}
.desk-comparison{table-layout:fixed;min-width:calc(720px + var(--supplier-count,1)*190px)}
.desk-comparison :is(th,td){min-width:0;max-width:none;overflow-wrap:anywhere}
.desk-comparison :is(th,td):nth-child(1){width:260px;min-width:260px}
.desk-comparison :is(th,td):nth-child(2){width:300px;min-width:300px}
.desk-comparison :is(th,td):nth-child(3),.desk-comparison :is(th,td):nth-child(4){width:80px;min-width:80px;max-width:80px}
.desk-comparison :is(th,td):nth-child(n+5){width:190px;min-width:190px}
.record-table input[type=radio]{width:20px;min-width:20px;height:20px;min-height:20px;flex:none}
.desk-comparison label{display:flex;align-items:center;gap:8px;min-height:44px;margin:0}
