/* Live purchase references: 21 October 2026. Only the six Purchase destinations.
   Keep all existing controls and their financial/recovery behaviour reachable. */
@media screen {
 #purchaseHeaderFlags{display:inline-flex;align-items:center;gap:16px;margin-left:18px;flex-wrap:wrap;min-width:0;max-width:100%}
 #purchaseBookClassGroup{min-width:0;max-width:100%}
 #purchaseBookClass{min-width:0;max-width:330px;height:25px;font:12px Arial;flex-shrink:1}
 #purchaseVatCoefficient{width:76px;height:25px;font:12px Arial}
 #purchaseVatCoefficientGroup[hidden]{display:none}
 #purchaseHeaderFlags:has(#purchaseVatCoefficientGroup:not([hidden])){gap:8px;margin-left:10px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceCurrency:has(#purchaseVatCoefficientGroup:not([hidden])){padding-left:0}
 #purchaseHeaderFlags label{display:flex;align-items:center;gap:5px;font:12px Arial;white-space:nowrap}
 #purchaseHeaderFlags input[type="checkbox"]{width:14px;height:14px;margin:0;accent-color:#007ad9}
 html.purchaseReferenceView,html.purchaseReferenceView body{min-width:0}
 html.purchaseReferenceView #app,html.purchaseReferenceView main.main{min-width:0;max-width:100%}
 [data-purchase-reference]{min-width:0;max-width:100%;box-sizing:border-box}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #invoiceForm{grid-template-columns:minmax(48px,.25fr) minmax(0,.75fr) minmax(48px,.25fr) minmax(0,.75fr) minmax(48px,.25fr) minmax(0,.75fr);grid-template-rows:repeat(4,25px) auto auto minmax(0,1fr) auto auto;column-gap:7px;row-gap:7px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .billingMainFields>label{grid-template-columns:minmax(48px,25%) minmax(0,1fr);gap:7px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] :is(.invoiceFields>input,.invoiceFields>select,.billingMainFields input,.billingMainFields select){height:25px;padding:2px 5px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceDatePresentation,html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceDatePresentation input,html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceDatePresentation .invoiceDateCalendar{height:25px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceDatePresentation .invoiceDateCalendar{width:25px;flex-basis:25px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceCurrency{grid-column:1/-1;justify-content:flex-start;padding-left:12%;margin:5px 0 0;flex-wrap:wrap;min-width:0;max-width:100%;box-sizing:border-box}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceCurrency output{height:25px;min-width:45px;padding:3px 7px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .billingPolicyControls{grid-column:1/-1;grid-row:9;max-width:100%;margin:2px 0}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #billingInvoiceHint{grid-row:10}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceTableWrap{min-width:0;min-height:220px;height:calc(100dvh - 422px);margin:9px 0 0}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items{min-width:0;width:100%;table-layout:fixed}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items col{width:auto!important}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items col:nth-child(1){width:7.5%!important}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items col:nth-child(2){width:10.5%!important}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items col:nth-child(3){width:20%!important}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items col:nth-child(n+4){width:8.85%!important}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items th{height:50px;white-space:normal;overflow-wrap:anywhere;padding:5px 4px;font-size:12px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items td{overflow-wrap:anywhere;padding:1px 3px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items :is(input,select){min-width:0;max-width:100%}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceFooter{min-width:0;grid-template-columns:minmax(0,1fr) auto;gap:6px;min-height:70px;margin-top:7px;padding:6px 0 0;border-top:1px solid #d5d5d5}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceFooterTools{grid-column:1;grid-row:1;flex-wrap:wrap;min-width:0}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .docActions{grid-column:1;grid-row:2;justify-self:start;flex-wrap:wrap;gap:10px;max-width:100%}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .totals{grid-column:2;grid-row:1/3;display:flex;align-items:end;gap:7px;width:auto;max-width:130px;font-size:12px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .totals .grand{gap:2px;font-size:12px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #invoiceTotalCurrency{border:1px solid #d5d5d5;background:#ebedf0;padding:5px;min-width:36px;font-size:11px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #invoicePurchaseSearch{width:24px;min-width:24px;height:24px;min-height:24px;padding:0;font-size:0;border:1px solid transparent;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6' fill='none' stroke='%23367d92' stroke-width='3'/%3E%3Cpath d='m15 15 6 6' stroke='%23367d92' stroke-width='3'/%3E%3C/svg%3E") center/16px 16px no-repeat}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchHeader{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;min-width:0}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchColumn{grid-template-columns:minmax(48px,.3fr) minmax(0,.7fr);min-width:0;gap:5px}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchColumn>:is(label,span){white-space:normal;overflow-wrap:anywhere}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchGrid{flex:none;max-width:100%;min-width:0;min-height:220px;height:calc(100dvh - 408px)}
 #billingBatchScreen[data-purchase-reference=payment] #billingBatchForm{min-height:0}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchFooter{grid-template-columns:auto 1fr auto}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchFooter .billingNewActions{justify-content:center;flex-wrap:wrap;gap:15px}
 #purchaseBatchPrintLabel{display:flex;align-items:center;gap:5px}
 #purchaseBatchPrintChoice{max-width:175px;height:27px;border:1px solid #bfc4ca;border-radius:2px;background:#fff}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchGrid table{min-width:0;table-layout:fixed}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchGrid :is(th,td){min-width:0;overflow-wrap:anywhere;white-space:normal;padding:4px 3px;font-size:11px}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchGrid th{height:50px;font-weight:700}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchGrid input{min-width:0;width:100%}
 #billingBatchScreen[data-purchase-reference=payment] #billingBatchTitle{margin:0 35px 7px}
 #customsScreen[data-purchase-reference=customs] :is(.formGrid,.tableWrap){min-width:0;max-width:100%}
 #customsScreen[data-purchase-reference=customs] .detailToolbar{flex-wrap:wrap}
 #documentDetail[data-purchase-reference=return] #printArea{grid-template-columns:repeat(3,minmax(0,1fr));min-width:0}
 #documentDetail[data-purchase-reference=return] #creditForm{grid-template-columns:55px minmax(0,1fr) 55px minmax(0,1fr) 55px minmax(0,1fr);min-width:0}
 #documentDetail[data-purchase-reference=return] #creditItems{min-width:0;max-width:100%}
 #documentSearchScreen[data-purchase-reference=search] .documentSearchFilters{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 18px}
 #documentSearchScreen[data-purchase-reference=search] .documentSearchFilter>span:first-child,#documentSearchScreen[data-purchase-reference=search] .documentSearchFilter>label{max-width:36%;white-space:normal;overflow-wrap:anywhere}
 #documentSearchScreen[data-purchase-reference=search] .documentSearchTable{min-width:0;max-width:100%}
 #documentSearchScreen[data-purchase-reference=search] .documentSearchHeading{flex-wrap:wrap;gap:12px}
 #documentSearchScreen[data-purchase-reference=search] .documentSearchPagination{flex-wrap:wrap}
}
@media screen and (max-width:760px){
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceTableWrap{height:330px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .items{min-width:600px}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceCurrency{padding-left:0}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] .invoiceFooter{display:grid}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchHeader{grid-template-columns:1fr;gap:14px}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchColumn{grid-template-columns:105px minmax(0,1fr)}
 #billingBatchScreen[data-purchase-reference=payment] .billingBatchGrid table{min-width:640px}
 #documentSearchScreen[data-purchase-reference=search] .documentSearchFilters{grid-template-columns:1fr}
 #documentDetail[data-purchase-reference=return] #printArea{grid-template-columns:1fr}
 #documentDetail[data-purchase-reference=return] #creditForm{grid-template-columns:90px minmax(0,1fr)}
}
@media screen and (forced-colors:active){
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #invoicePurchaseSearch{width:auto;background:ButtonFace;color:ButtonText;border:1px solid ButtonText;font-size:12px;padding:2px 5px}
}

/* Purchase credit uses the verified source-linked editor. */
@media screen {
 #documentDetail.tradePurchaseReturnLayout input:focus-visible{outline:2px solid #367aa8;outline-offset:-2px;background:#fff}
 #documentDetail.tradePurchaseReturnLayout [hidden]{display:none!important}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnTitle{border-bottom:1px solid #d5d5d5;padding-bottom:10px;margin-bottom:7px}
 #documentDetail.tradePurchaseReturnLayout #printArea{display:block}
 #documentDetail.tradePurchaseReturnLayout #printArea>.printHeader,
 #documentDetail.tradePurchaseReturnLayout #printArea>.detailInfo{display:none}
 #documentDetail.tradePurchaseReturnLayout #creditForm{grid-template-columns:73px minmax(0,1fr) 73px minmax(0,1fr) 73px minmax(0,1fr);gap:7px 8px;align-items:start}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnHeader{display:contents}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnHeader>label{display:grid;grid-template-columns:73px minmax(0,1fr);gap:8px;align-items:center;margin:0}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnHeader output{display:block;min-height:29px;padding:6px;border:1px solid #bfc4ca;border-radius:2px;background:#f7f7f7;overflow-wrap:anywhere}
 #documentDetail.tradePurchaseReturnLayout .tradeReturnClient{grid-column:1/3;grid-row:1}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnPartner{grid-column:1/3;grid-row:2/5;white-space:pre-line;font-size:11px;line-height:1.8}
 #documentDetail.tradePurchaseReturnLayout .tradeReturnService{grid-column:3/5;grid-row:1}
 #documentDetail.tradePurchaseReturnLayout .tradeReturnNumber{grid-column:3/5;grid-row:2}
 #documentDetail.tradePurchaseReturnLayout .tradeReturnSource{grid-column:5/7;grid-row:2}
 #documentDetail.tradePurchaseReturnLayout #creditForm>label[for=creditDate]{grid-column:3;grid-row:3;align-self:center}
 #documentDetail.tradePurchaseReturnLayout #creditDate{grid-column:4;grid-row:3}
 #documentDetail.tradePurchaseReturnLayout #creditForm>label[for=creditReason]{align-self:center}
 #documentDetail.tradePurchaseReturnLayout #creditForm>label[for=creditMode]{grid-column:5;grid-row:3;align-self:center}
 #documentDetail.tradePurchaseReturnLayout #creditMode{grid-column:6;grid-row:3}
 #documentDetail.tradePurchaseReturnLayout .tradeReturnCurrency{grid-column:1/-1;grid-row:5;display:flex;align-items:center;justify-content:center;gap:8px;margin:7px 0}
 #documentDetail.tradePurchaseReturnLayout #creditForm>label[for=creditAmount]{grid-column:3/6;grid-row:6;align-self:center}
 #documentDetail.tradePurchaseReturnLayout #creditAmount{grid-column:6;grid-row:6}
 #documentDetail.tradePurchaseReturnLayout #creditForm:has(#creditAmount:disabled)>label[for=creditAmount],
 #documentDetail.tradePurchaseReturnLayout #creditAmount:disabled{display:none}
 #documentDetail.tradePurchaseReturnLayout #creditItems{grid-row:7;min-height:220px;height:calc(100dvh - 445px);max-height:none;margin:10px 0 0}
 #documentDetail.tradePurchaseReturnLayout #creditItems.hidden{display:none}
 #documentDetail.tradePurchaseReturnLayout #creditItems .table{width:100%;min-width:0;table-layout:fixed}
 #documentDetail.tradePurchaseReturnLayout #creditItems th{height:51px;padding:6px 5px;font-size:11px;text-align:left;position:sticky;top:0;z-index:1}
 #documentDetail.tradePurchaseReturnLayout #creditItems td{padding:2px 4px;font-size:11px;text-align:right;vertical-align:middle;overflow-wrap:anywhere}
 #documentDetail.tradePurchaseReturnLayout #creditItems td:nth-child(-n+4){text-align:left}
 #documentDetail.tradePurchaseReturnLayout #creditItems tr:nth-child(even){background:#f4f4f5}
 #documentDetail.tradePurchaseReturnLayout #creditItems small{display:block;font-size:10px;color:#56616d;line-height:1.35}
 #documentDetail.tradePurchaseReturnLayout #creditItems input{width:100%!important;height:29px;text-align:right}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnBlanks{color:#85898d}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnBlanks tr{background:#fff}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnBlanks tr.tradeReturnBlankEven{background:#f4f4f5}
 #documentDetail.tradePurchaseReturnLayout #creditEstimate{display:none}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnTotals{grid-column:4/7;grid-row:8;display:flex;gap:8px;justify-self:end;margin-top:7px}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnTotals>div{display:flex;flex-direction:column;text-align:right}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnTotals span{padding:5px;border:1px solid #d5d5d5;background:#ebedf0;font-weight:600}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnTotals b{padding:5px;border:1px solid #d5d5d5;border-top:0;font-weight:400;white-space:nowrap}
 #documentDetail.tradePurchaseReturnLayout #creditForm>label:has(#creditStockReturn){grid-column:1/4;grid-row:8;line-height:1.5;margin-top:10px}
 #documentDetail.tradePurchaseReturnLayout #creditBack{grid-column:1;grid-row:9;margin-top:10px}
 #documentDetail.tradePurchaseReturnLayout #purchaseReturnToolbar{grid-column:1/-1;grid-row:9;display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:10px;padding:8px 0;border-block:1px solid #ddd}
 #documentDetail.tradePurchaseReturnLayout #purchaseReturnToolbar>button{margin:0;width:auto;white-space:nowrap}
 #documentDetail.tradePurchaseReturnLayout #purchaseReturnToolbar #purchaseReturnPrintLabel{display:flex;align-items:center;gap:6px;margin:0}
 #documentDetail.tradePurchaseReturnLayout #purchaseReturnPrintChoice{height:29px;min-width:0;font:12px Arial}
 #documentDetail.tradePurchaseReturnLayout #purchaseReturnSaveAndNew{grid-column:3;grid-row:9;margin-top:10px}
 #documentDetail.tradePurchaseReturnLayout #creditSave{grid-column:4;grid-row:9;margin-top:10px}
 #documentDetail.tradePurchaseReturnLayout #creditReturnHint{grid-row:10;margin-top:8px}
 #documentDetail.tradePurchaseReturnLayout #creditHint{grid-row:11}
}

@media screen {
 #documentDetail.tradePurchaseReturnLayout .invoiceDatePresentation{display:flex;position:relative;align-items:center;min-width:0;height:29px;grid-column:4;grid-row:3}
 #documentDetail.tradePurchaseReturnLayout .invoiceDatePresentation input[type=text]{flex:1;min-width:0;width:100%;height:29px;box-sizing:border-box;margin:0;border:1px solid #bfc4ca;border-right:0;border-radius:2px 0 0 2px;padding:3px 6px;font:12px Arial;background:#fff}
 #documentDetail.tradePurchaseReturnLayout .invoiceDateCalendar{display:flex;flex:0 0 27px;align-items:center;justify-content:center;width:27px;height:29px;padding:0;margin:0;border:1px solid #007ad9;border-radius:0 2px 2px 0;background:#007ad9;color:#fff;cursor:pointer}
 #documentDetail.tradePurchaseReturnLayout .invoiceDateCalendar svg{width:16px;height:16px}
 #documentDetail.tradePurchaseReturnLayout .invoiceDateCalendar:disabled{cursor:not-allowed;opacity:.6}
 #documentDetail.tradePurchaseReturnLayout .invoiceDatePresentation input.invoiceDateNative{position:absolute;inset:0;width:100%;height:29px;opacity:0;pointer-events:none;margin:0}
 #documentDetail.tradePurchaseReturnLayout .invoiceDatePresentation input.invoiceDateFallback{opacity:1;pointer-events:auto;z-index:2;background:#fff}
}
@media screen and (max-width:760px){
 #documentDetail.tradePurchaseReturnLayout #tradeReturnHeader{display:flex;flex-direction:column;gap:8px}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnHeader>label{grid-template-columns:100px minmax(0,1fr)}
 #documentDetail.tradePurchaseReturnLayout #creditItems{height:340px;max-width:100%;margin-top:4px}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnTotals{align-self:flex-end;max-width:100%;flex-wrap:wrap}
 #documentDetail.tradePurchaseReturnLayout #creditForm>button{width:100%}
}


/* The book classification occupies the fourth right header row in the live reference. */
@media screen {
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #purchaseBookClassGroup{grid-column:5/7;grid-row:4;display:grid;grid-template-columns:minmax(48px,25%) minmax(0,1fr);gap:7px;align-items:center;margin:0;font:12px Arial}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #purchaseBookClass{width:100%;max-width:none;height:25px;padding:2px 5px;border:1px solid #bfc4ca;border-radius:2px;background:white}
}

/* Existing customs controls arranged into document / VAT / charges columns. */
@media screen and (min-width:761px){
 #customsScreen[data-purchase-reference=customs] #customsForm:not([hidden]){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 18px;align-items:start}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid{display:contents}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid>label{grid-column:1;display:grid;grid-template-columns:90px minmax(0,1fr);align-items:center;gap:6px;margin:0;font-size:12px}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid>label:has(#customsInvoice){grid-column:1/-1;grid-row:1;grid-template-columns:150px minmax(0,1fr);margin-bottom:10px}
 #customsScreen[data-purchase-reference=customs] label:has(#customsReference){grid-row:2}
 #customsScreen[data-purchase-reference=customs] label:has(#customsSerialNumber){grid-row:3}
 #customsScreen[data-purchase-reference=customs] label:has(#customsDate){grid-row:4}
 #customsScreen[data-purchase-reference=customs] label:has(#customsDescription){grid-row:5}
 #customsScreen[data-purchase-reference=customs] label:has(#customsNotes){grid-row:6/8}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid>label:has(#customs_base){grid-column:3;grid-row:2}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid>label:has(#customs_vat){grid-column:3;grid-row:3}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid>label:has(#customs_excise){grid-column:3;grid-row:4}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid>label:has(#customs_duty){grid-column:3;grid-row:5}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid>label:has(#customs_transport){grid-column:3;grid-row:6}
 #customsScreen[data-purchase-reference=customs] #customsForm>.formGrid>label:has(#customs_other){grid-column:3;grid-row:7}
 #customsScreen[data-purchase-reference=customs] #customsVATBreakdown{grid-column:2;grid-row:2/8;margin:0;padding:8px;align-self:start}
 #customsScreen[data-purchase-reference=customs] #customsVATBreakdown th,#customsScreen[data-purchase-reference=customs] #customsVATBreakdown td{padding:5px;font-size:12px;overflow-wrap:anywhere}
 #customsScreen[data-purchase-reference=customs] #customsVATBreakdown th:first-child{width:22%}
 #customsScreen[data-purchase-reference=customs] #customsCreateWorksheet{grid-column:1/-1;grid-row:8;margin:10px 0}
 #customsScreen[data-purchase-reference=customs] #customsForm>p{grid-column:1/-1;grid-row:11;font-size:12px;margin:4px 0}
 #customsScreen[data-purchase-reference=customs] #customsFooterSearch{grid-column:1;grid-row:9;justify-self:start}
 #customsScreen[data-purchase-reference=customs] #customsPrintLabel{grid-column:2;grid-row:9}
 #customsScreen[data-purchase-reference=customs] #customsSaveAndNew{grid-column:2;grid-row:10}
 #customsScreen[data-purchase-reference=customs] #customsSave{grid-column:3;grid-row:10}
}
@media screen and (max-width:760px){
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #purchaseBookClassGroup{grid-column:1/-1;grid-row:auto;grid-template-columns:100px minmax(0,1fr);order:4}
}

#purchaseSerialGroup{display:flex;align-items:center;gap:5px;font:12px Arial}#purchaseSerialNumber{width:140px;max-width:100%}

@media screen and (min-width:761px){#documentDetail.tradePurchaseReturnLayout #tradeReturnPurchaseMetadata{grid-column:5/7;grid-row:4}}

@media screen {
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #billingPartnerBalance{display:block!important;grid-column:1/3;grid-row:2;margin:0;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #invoicePartnerFacts{grid-row:3/5}
 #documentDetail.tradePurchaseReturnLayout #purchaseReturnSituation{grid-column:1/3;grid-row:2;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnPartner{grid-row:3/5}
}
@media screen and (max-width:760px){
 html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #billingPartnerBalance,html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #invoicePartnerFacts{grid-column:1/-1;grid-row:auto}
}

@media screen and (min-width:761px){html.purchaseReferenceView #invoice[data-purchase-reference=invoice] #invoiceForm{grid-template-rows:29px auto 29px 29px auto auto minmax(0,1fr) auto auto}}
#purchaseAccountSituation{grid-column:1/-1;margin:0;font-size:11px;line-height:1.4;overflow-wrap:anywhere}
@media screen {#purchaseItemSituation{font-size:11px;margin:0;padding:5px;line-height:1.4;background:#f0f0f0}}

@media screen {
 #documentDetail.tradePurchaseReturnLayout #tradeReturnPurchaseFlags{margin-left:12px;white-space:normal;overflow-wrap:anywhere}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnPurchaseSerial{grid-column:3/5;grid-row:4}
}
@media screen and (max-width:760px){
 #documentDetail.tradePurchaseReturnLayout #creditForm{display:flex;flex-direction:column;align-items:stretch;gap:8px;min-width:0}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnHeader{min-width:0;width:100%}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnHeader>label{min-width:0;grid-template-columns:90px minmax(0,1fr)}
 #documentDetail.tradePurchaseReturnLayout .tradeReturnCurrency{flex-wrap:wrap}
 #documentDetail.tradePurchaseReturnLayout #creditItems{overflow:auto;width:100%;box-sizing:border-box}
 #documentDetail.tradePurchaseReturnLayout #creditItems .table{min-width:720px}
 #documentDetail.tradePurchaseReturnLayout .invoiceDatePresentation{width:100%}
 #documentDetail.tradePurchaseReturnLayout #creditReason,#documentDetail.tradePurchaseReturnLayout #creditMode{width:100%;box-sizing:border-box;min-width:0}
 #documentDetail.tradePurchaseReturnLayout #purchaseReturnToolbar{justify-content:flex-start;width:100%;box-sizing:border-box}
 #documentDetail.tradePurchaseReturnLayout #tradeReturnTotals{align-self:flex-end}
}

@media screen {
 #screen[data-purchase-reference=return-source] .invoiceDatePresentation{position:relative;display:inline-flex;min-width:0;width:calc(50% - 12px);height:29px}
 #screen[data-purchase-reference=return-source] .invoiceDatePresentation input[type=text]{width:100%;min-width:0;height:29px;box-sizing:border-box}
 #screen[data-purchase-reference=return-source] .invoiceDateCalendar{flex:0 0 27px;width:27px;height:29px;padding:4px;background:#007ad9;color:white;border:1px solid #007ad9}
 #screen[data-purchase-reference=return-source] .invoiceDateCalendar svg{width:16px;height:16px}
 #screen[data-purchase-reference=return-source] .invoiceDateNative{position:absolute;inset:0;opacity:0;pointer-events:none}
 #screen[data-purchase-reference=return-source] .invoiceDateFallback{opacity:1;pointer-events:auto;z-index:2;background:white;width:100%}
}
