.trade-layout{display:grid;grid-template-columns:1.2fr 1fr;gap:20px}.trade-panel{background:#fff;border:1px solid #dce5ee;border-radius:16px;padding:20px}.trade-panel h3{margin:0 0 15px}.trade-panel input,.trade-panel select{box-sizing:border-box;width:100%;padding:10px;border:1px solid #cbd7e1;border-radius:8px;font:inherit}.trade-panel label{display:grid;gap:5px;margin:10px 0}.trade-panel button{padding:10px 15px;border:1px solid #cbd7e1;border-radius:8px;background:#f5f8fb;cursor:pointer}.trade-panel button.primary{background:#193e36;color:white}.trade-panel button:disabled{opacity:.5}.trade-product,.trade-line{display:grid;grid-template-columns:1fr 90px 85px;gap:9px;align-items:center;border-bottom:1px solid #e4ebf0;padding:12px 0}.trade-line{grid-template-columns:1fr 90px 95px 38px}.trade-panel small{display:block;color:#596d7c;margin-top:5px}.trade-total{display:flex;justify-content:space-between;font-size:23px;margin:18px 0}.trade-address{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.trade-panel details{margin-top:15px}.trade-panel textarea{width:100%;min-height:85px;box-sizing:border-box;padding:10px}.trade-status{padding:12px 0;white-space:pre-wrap}@media(max-width:850px){.trade-layout{grid-template-columns:1fr}.trade-panel{padding:14px}.trade-product{grid-template-columns:1fr 80px 75px}.trade-address{grid-template-columns:1fr}}

/* Approved compact trade layout; ordinary POS stays unchanged. */
.trade-layout{gap:12px}.trade-panel{padding:12px;border-radius:10px}.trade-panel h3{margin-bottom:10px}.trade-panel label{margin:7px 0;gap:3px}.trade-panel input,.trade-panel select{padding:8px}.trade-panel button{padding:8px 11px}.trade-product,.trade-line{padding:8px 0;gap:7px}.trade-total{margin:12px 0;font-size:20px}.trade-recipient{margin:10px 0}.trade-recipient summary{cursor:pointer}.trade-sheet-dialog{max-width:760px;width:calc(100% - 24px);max-height:90vh;overflow:auto;border:1px solid #cbd7e1;border-radius:10px;padding:16px;color:#222;background:#f1f3f6}.trade-sheet{background:#fff;padding:32px;margin-top:12px;min-height:600px}.trade-sheet-top{display:grid;grid-template-columns:1.2fr 1fr;gap:24px;margin:18px 0 22px}.trade-sheet input{display:block;border:0;border-bottom:1px solid #ddd;border-radius:0;padding:5px 0}.trade-sheet table{width:100%;border-collapse:collapse}.trade-sheet th{background:#dedede}.trade-sheet td,.trade-sheet th{text-align:left;padding:8px;border-bottom:1px solid #ddd}@media(max-width:560px){.trade-sheet{padding:14px;min-height:450px}.trade-sheet-top{grid-template-columns:1fr;gap:16px;margin:12px 0 24px}.trade-address{grid-template-columns:1fr 1fr}.trade-address label:nth-child(-n+2){grid-column:1/-1}}

/* Address warnings supplement colour with field state and explicit text. */
.address-check{margin:8px 0;font-size:13px}.address-check p{margin:4px 0}.address-check.has-errors{color:#a51d28}.address-check a{display:inline-block;margin-top:4px;font-size:11px;color:#596d7c}.address-check small{color:inherit}.posapp .trade-panel input[aria-invalid="true"],.posapp .trade-sheet input[aria-invalid="true"]{border:2px solid #b42332;background:#fff1f2;color:#831521}.address-check[hidden]{display:none}

/* Compact editable address in the delivery-note preview. */
.trade-sheet [data-sheet-address]{display:grid;grid-template-columns:72px minmax(0,1fr);column-gap:5px;row-gap:0;align-items:start}
.trade-sheet [data-sheet-address] input{grid-column:1/-1;box-sizing:border-box;width:100%;min-width:0;min-height:0;height:auto;margin:0;padding:1px 0;line-height:1.2;font:inherit}
.trade-sheet [data-sheet-address] input:not([aria-invalid="true"]){border:0;background:transparent;box-shadow:none}
.trade-sheet [data-sheet-address] input[data-address-field="postalCode"]{grid-column:1}
.trade-sheet [data-sheet-address] input[data-address-field="city"]{grid-column:2}

/* Smaller delivery preview that fits the viewport without an artificial paper height. */
.trade-sheet-dialog{box-sizing:border-box;padding:10px;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px)}
.trade-sheet{box-sizing:border-box;padding:16px 20px;margin-top:8px;min-height:0;font-size:13px;line-height:1.25;max-height:calc(100vh - 90px);max-height:calc(100dvh - 90px);overflow:auto}
.trade-sheet-top{gap:16px;margin:8px 0 12px}.trade-sheet h3{font-size:15px;margin:8px 0}.trade-sheet small{font-size:11px}.trade-sheet input{font-size:13px}.trade-sheet table{margin-top:6px;table-layout:fixed}.trade-sheet td,.trade-sheet th{padding:5px 7px;font-size:13px;line-height:1.25;overflow-wrap:anywhere}.trade-sheet td:first-child,.trade-sheet th:first-child{width:34px}.trade-sheet td:last-child,.trade-sheet th:last-child{width:70px}
.trade-sheet tbody tr:nth-child(odd){background:#f0f0f0}.trade-sheet tbody tr:nth-child(even){background:#fff}
@media(max-width:560px){.trade-sheet{padding:12px}.trade-sheet-top{gap:8px;margin:6px 0 10px}}

/* Price tiers use numeric fields, with no separators to type. */
.trade-tier-row{display:grid;grid-template-columns:minmax(80px,1fr) minmax(140px,1.5fr) 36px;gap:8px;align-items:end;padding:6px 0;border-bottom:1px solid #e4ebf0}
.trade-tier-row>label{min-width:0;margin:0}.trade-tier-price{display:grid;grid-template-columns:minmax(65px,1fr) 58px;gap:6px;min-width:0;margin:0;padding:0;border:0}
.trade-tier-price legend{padding:0;font-size:inherit}.trade-tier-price label{margin:0;font-size:12px}.trade-tier-row input{min-width:0}.trade-tier-row>button{padding:8px 0;min-height:36px;margin-bottom:0}
.trade-tier-row input[aria-invalid="true"]{border:2px solid #b42332;background:#fff1f2}
@media(max-width:380px){.trade-tier-row{grid-template-columns:minmax(62px,1fr) minmax(110px,1.4fr) 30px;gap:5px}.trade-tier-price{grid-template-columns:minmax(50px,1fr) 46px;gap:4px}}

/* Keep postcode and city on one compact line. A4 invoice preview mirrors the envelope address area. */
.trade-sheet [data-sheet-address]{grid-template-columns:var(--postcode-width,5ch) minmax(0,1fr);column-gap:0.6ch}
/* Invoice content is isolated from the website's generic header/footer theme. */
.posapp .trade-invoice-sheet{position:relative;display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:210/297;overflow:visible;padding:26px 38px 24px;font:13px/1.35 Arial,sans-serif;color:#222;background:#fff}
.posapp .trade-invoice-sheet .trade-sheet-seller{position:static;display:block;box-sizing:border-box;width:44%;max-width:none;min-height:76px;margin:0 0 0 auto;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent;color:#666;text-align:right;font:11px/1.4 Arial,sans-serif}
.posapp .trade-invoice-sheet .trade-sheet-seller strong{display:block;font-size:12px;font-weight:600;color:#444}.posapp .trade-invoice-sheet .trade-sheet-seller span{display:block}
.posapp .trade-invoice-sheet .trade-sheet-top{flex-shrink:0;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:24px;min-height:145px;margin:40px 0 18px;padding:0;color:#222}
.posapp .trade-invoice-sheet .trade-sheet-return{display:block;white-space:nowrap;font-size:8px;line-height:1.3;margin:0 0 5px;color:#777}
.posapp .trade-invoice-sheet h3{margin:0 0 12px;color:#222;font-size:15px}.posapp .trade-invoice-sheet table{flex-shrink:0;table-layout:fixed;width:100%;margin:0;border-collapse:collapse;color:#222;font-size:12px}
.posapp .trade-invoice-sheet th,.posapp .trade-invoice-sheet td{box-sizing:border-box;padding:6px 5px;font:12px/1.3 Arial,sans-serif;color:#222}
.posapp .trade-invoice-sheet th:first-child,.posapp .trade-invoice-sheet td:first-child{width:7%;white-space:nowrap;overflow-wrap:normal;word-break:normal}
.posapp .trade-invoice-sheet th:nth-child(2){width:35%}.posapp .trade-invoice-sheet th:nth-child(3){width:14%}.posapp .trade-invoice-sheet th:nth-child(4),.posapp .trade-invoice-sheet th:nth-child(5){width:22%}
.posapp .trade-invoice-sheet th:nth-child(n+3),.posapp .trade-invoice-sheet td:nth-child(n+3){text-align:right}
.posapp .trade-invoice-sheet .trade-sheet-total{text-align:right;margin:12px 0 24px;color:#222;font-weight:bold}
.posapp .trade-invoice-sheet .trade-sheet-footer{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex-shrink:0;gap:16px;box-sizing:border-box;width:100%;max-width:none;height:auto;min-height:0;margin:auto 0 0;padding:10px 0 0;border:0;border-top:1px solid #c6c6c6;border-radius:0;box-shadow:none;background:transparent;color:#777;text-align:left;font:9px/1.45 Arial,sans-serif;overflow-wrap:anywhere}
.posapp .trade-invoice-sheet .trade-sheet-footer>div{display:block;min-width:0;margin:0;padding:0;gap:0;color:inherit;background:transparent;font:inherit}
@media(max-width:560px){.posapp .trade-invoice-sheet{padding:18px 14px 18px}.posapp .trade-invoice-sheet .trade-sheet-top{gap:12px;margin-top:22px;min-height:125px}.posapp .trade-invoice-sheet .trade-sheet-seller{font-size:10px;min-height:54px}.posapp .trade-invoice-sheet .trade-sheet-footer{gap:8px;font-size:8px}.posapp .trade-invoice-sheet td,.posapp .trade-invoice-sheet th{font-size:10px;padding:4px 3px}}

/* Customer address starts after one blank line; invoice details occupy the right column. */
.posapp .trade-invoice-sheet .trade-sheet-return{margin-bottom:18px}
.posapp .trade-invoice-sheet .trade-sheet-meta small{display:block;margin-top:5px}
.trade-issued-invoice{box-sizing:border-box;width:min(1000px,96vw);height:92vh;border:1px solid #cbd7e1;border-radius:10px;padding:12px}
.trade-issued-invoice>strong{display:block;margin-bottom:8px}.trade-issued-invoice>a{margin-left:12px}.trade-issued-invoice>iframe{display:block;width:100%;height:calc(100% - 82px);border:0;margin-top:10px}
.trade-issued-invoice[open]{display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:auto auto auto minmax(0,1fr);gap:8px}
.trade-issued-invoice>strong,.trade-issued-invoice>[data-cancellation-review-result]{grid-column:1/-1}
.trade-issued-invoice>[data-cancellation-review]{justify-self:start}
.trade-issued-invoice>[data-cancellation-review-result]{max-height:28vh;overflow:auto;overflow-wrap:anywhere}
.trade-issued-invoice>iframe{grid-column:1/-1;grid-row:4;min-height:0;height:100%;margin-top:0}
@media(max-width:520px){.trade-issued-invoice[open]{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto auto minmax(0,1fr)}.trade-issued-invoice>[data-cancellation-review]{grid-column:1/-1}.trade-issued-invoice>iframe{grid-row:5}}

.trade-invoice-sheet .trade-deposit-line td{font-size:11px;padding-top:3px;padding-bottom:3px;font-weight:400}
