/* HF03M · ar-sale A+B layout
   UI only. Targets the quotation/cart editor on ?page=ar-sale. */

.sales-app.is-document{position:relative}
.sales-app.is-document .sales-heading{min-height:52px;margin-bottom:12px;align-items:flex-start}
.sales-app.is-document .sales-heading-actions{
  position:fixed;
  top:62px;
  right:22px;
  z-index:160;
  display:flex;
  align-items:center;
  gap:7px;
  max-width:calc(100vw - 44px);
  padding:7px;
  border:1px solid #d8e4df;
  border-radius:12px;
  background:rgba(255,255,255,.96);
  box-shadow:0 10px 26px rgba(25,70,57,.16);
  backdrop-filter:blur(10px);
}
.sales-app.is-document .sales-heading-actions>button{min-height:34px;padding:6px 10px;border-radius:8px;font-size:11.5px;white-space:nowrap}
.sales-app.is-document .sales-heading-actions .sales-cart-button{min-width:0;min-height:34px!important;padding:6px 11px!important;font-size:11.5px!important;box-shadow:none!important}
.sales-app.is-document .sales-heading-actions .sales-cart-button svg{width:18px;height:18px}
.sales-app.is-document .sales-heading-actions .sales-cart-button b{min-width:20px;height:20px;font-size:10px}

.quote-editor-ab{max-width:none;width:100%;padding-bottom:72px}
.quote-editor-ab .quote-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin:0 0 11px;padding:0 2px}
.quote-editor-ab .quote-editor-head-copy{min-width:0}
.quote-editor-ab .quote-editor-head-copy h2{margin:0;color:#173f60;font-size:21px;line-height:1.25}
.quote-editor-ab .quote-editor-head-copy p{margin:4px 0 0;color:#71879a;font-size:10.5px}
.quote-editor-ab .quote-editor-head-badge{display:flex;align-items:center;gap:8px;padding:6px 9px;border:1px solid #dbe6e1;border-radius:9px;background:#f8fbfa;color:#5e766d;font-size:10px;white-space:nowrap}
.quote-editor-ab .quote-editor-head-badge strong{color:#20775e;font-size:11px}

.quote-editor-ab .quote-top-grid{display:grid;grid-template-columns:minmax(0,1.72fr) minmax(330px,.78fr);gap:12px;align-items:stretch;margin-bottom:12px}
.quote-editor-ab .quote-card{margin:0;border-color:#d8e5e0;border-radius:12px;box-shadow:0 2px 8px rgba(28,74,60,.035)}
.quote-editor-ab .quote-customer-pane,.quote-editor-ab .quote-document-pane{padding:14px 15px}
.quote-editor-ab .quote-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 10px;padding:0 0 8px;border-bottom:1px solid #e8efec}
.quote-editor-ab .quote-section-head>div{display:grid;gap:1px}
.quote-editor-ab .quote-section-kicker{font-size:8.5px;line-height:1.2;font-weight:900;letter-spacing:.12em;color:#0c8a69}
.quote-editor-ab .quote-section-head h3{margin:0;color:#234b5e;font-size:14px}
.quote-editor-ab .quote-section-head small{color:#879a94;font-size:9.5px;text-align:right}

.quote-editor-ab .quote-customer-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:end}
.quote-editor-ab .quote-customer-search-col{min-width:0}
.quote-editor-ab .quote-customer-search-label{display:block;margin-bottom:4px;color:#60798d;font-size:10px;font-weight:700}
.quote-editor-ab .quote-customer-search-wrap{margin:0}
.quote-editor-ab .quote-customer-search-wrap input{height:36px;padding:7px 10px;border-radius:8px}
.quote-editor-ab .quote-customer-add{height:36px;min-width:118px;padding:0 12px;border-color:#c8ddd5;background:#f5fbf8;color:#20765d;font-size:10.5px;font-weight:800;white-space:nowrap}
.quote-editor-ab .quote-customer-summary-host{margin-top:8px}
.quote-editor-ab .quote-customer-summary{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 10px;border:1px solid #d9e8e2;border-radius:9px;background:#f8fbfa}
.quote-editor-ab .quote-customer-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#e7f5ef;font-size:15px}
.quote-editor-ab .quote-customer-summary-main{min-width:0;display:grid;gap:3px}
.quote-editor-ab .quote-customer-name-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.quote-editor-ab .quote-customer-name-row>strong{max-width:min(560px,58vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#244c5e;font-size:12px}
.quote-editor-ab .quote-customer-code,.quote-editor-ab .quote-customer-level{display:inline-flex;align-items:center;min-height:19px;padding:1px 6px;border-radius:999px;font-size:9px;font-weight:850}
.quote-editor-ab .quote-customer-code{background:#edf3f1;color:#587168}
.quote-editor-ab .quote-customer-level{background:#e4f5ed;color:#207651}
.quote-editor-ab .quote-customer-meta{display:flex;gap:9px;flex-wrap:wrap;color:#60798d;font-size:9.5px}
.quote-editor-ab .quote-customer-summary p{margin:0;color:#687f8d;font-size:9.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.quote-editor-ab .quote-customer-change{padding:5px 8px;background:#fff;color:#3b6f5f;border-color:#d1e0db;font-size:9.5px;white-space:nowrap}
.quote-editor-ab .quote-customer-empty{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px dashed #d1dfda;border-radius:8px;background:#fbfdfc;color:#70867e}
.quote-editor-ab .quote-customer-empty>div{display:grid;gap:1px}.quote-editor-ab .quote-customer-empty strong{font-size:10.5px}.quote-editor-ab .quote-customer-empty small{font-size:9px}

.quote-editor-ab .quote-document-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.quote-editor-ab .quote-document-number,.quote-editor-ab .quote-document-field{display:grid;gap:4px;min-width:0}
.quote-editor-ab .quote-document-number span,.quote-editor-ab .quote-document-field>span{color:#6d837b;font-size:9px;font-weight:750}
.quote-editor-ab .quote-document-number strong{display:flex;align-items:center;min-height:36px;padding:7px 9px;border:1px solid #d8e5e0;border-radius:8px;background:#f8fbfa;color:#244c5e;font-size:10.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.quote-editor-ab .quote-document-field input,.quote-editor-ab .quote-document-field select{height:36px;margin:0;padding:6px 8px;border-radius:8px;font-size:10.5px}
.quote-editor-ab .quote-document-issuer{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:9px 10px;border:1px solid #dbe8e3;border-radius:8px;background:#f8fbfa;color:#466b5f;font-size:9.5px}
.quote-editor-ab .quote-document-issuer>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.quote-editor-ab .quote-document-issuer>button{min-height:30px;padding:5px 9px;background:#fff;color:#276c58;border-color:#cddfd9;font-size:9.5px;white-space:nowrap}

.quote-editor-ab .quote-products-card{padding:13px 13px 12px;overflow:visible}
.quote-editor-ab .quote-products-head{margin:0 0 8px;padding-bottom:8px;border-bottom:1px solid #e7efec}
.quote-editor-ab .quote-products-head>div:first-child{display:grid;gap:1px}
.quote-editor-ab .quote-inline-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
.quote-editor-ab .quote-inline-actions button{min-height:31px;padding:5px 8px;border-radius:7px;font-size:9.5px;white-space:nowrap}
.quote-editor-ab .quote-inline-actions .sales-primary{background:#0d8667!important;border-color:#0d8667!important;color:#fff!important}

.quote-editor-ab .quote-product-toolbar{display:grid;grid-template-columns:minmax(320px,1fr) auto;gap:10px;align-items:center;margin-bottom:8px}
.quote-editor-ab .quote-product-search{margin:0}
.quote-editor-ab .quote-product-search input{height:34px;padding:6px 10px;border-radius:8px}
.quote-editor-ab .quote-product-toolbar-hint{color:#84958f;font-size:9px;white-space:nowrap}

.quote-editor-ab .quote-table-wrap-compact{max-height:calc(100vh - 500px);min-height:235px;overflow:auto;border:1px solid #d9e6e1;border-radius:9px;background:#fff}
.quote-editor-ab .quote-table-compact{min-width:980px;font-size:10.5px;line-height:1.28}
.quote-editor-ab .quote-table-compact thead th{position:sticky;top:0;z-index:3;padding:7px 6px;background:#eaf6f1!important;color:#416b5d!important;font-size:9.5px;border-bottom:1px solid #d4e7df}
.quote-editor-ab .quote-table-compact td{padding:5px 6px;border-bottom:1px solid #edf2f0;vertical-align:middle}
.quote-editor-ab .quote-table-compact td:first-child{width:98px}
.quote-editor-ab .quote-table-compact td:nth-child(2){min-width:360px}
.quote-editor-ab .quote-table-compact td:nth-child(3){width:72px}
.quote-editor-ab .quote-table-compact td:nth-child(4),.quote-editor-ab .quote-table-compact td:nth-child(5){width:100px}
.quote-editor-ab .quote-table-compact td:nth-child(6){width:102px}
.quote-editor-ab .quote-table-compact td:last-child{width:70px}
.quote-editor-ab .quote-table-compact input{height:29px;min-height:29px;padding:4px 6px;border-radius:6px;font-size:10px}
.quote-editor-ab .quote-table-compact input[type=number]{min-width:58px}
.quote-editor-ab .quote-line-select{width:14px!important;height:14px!important;min-height:0!important;margin-right:4px;vertical-align:middle}
.quote-editor-ab .quote-table-compact [data-line-total]{font-size:11px;color:#0a72c5;font-weight:850}
.quote-editor-ab .quote-table-compact [data-q-remove]{font-size:15px!important;padding:2px 4px!important}
.quote-editor-ab .quote-details td{padding-top:0!important;padding-bottom:4px!important;background:#fbfdfc}
.quote-editor-ab .quote-detail-list{display:grid;gap:3px}
.quote-editor-ab .quote-detail-list>div{display:grid;grid-template-columns:12px minmax(0,1fr) 26px;gap:4px;align-items:center}
.quote-editor-ab .quote-detail-list input{height:27px!important}
.quote-editor-ab [data-add-detail]{min-height:25px;padding:3px 7px;margin-top:2px;border-style:dashed;background:#fff;color:#457363;font-size:9px}
.quote-editor-ab .quote-group-row td{padding:7px 6px!important;background:#f2faf6!important}
.quote-editor-ab .quote-group-row strong{font-size:10.5px}.quote-editor-ab .quote-group-row small{font-size:8.5px;color:#789085}
.quote-editor-ab .quote-group-pill{display:inline-flex;margin:2px 3px 0 0;padding:1px 5px;border-radius:999px;background:#eef5f2;color:#5d756b;font-size:8px}
.quote-editor-ab .ict-btn{min-height:24px;padding:2px 5px;font-size:8.5px}

.quote-editor-ab .quote-table-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 9px;border:1px solid #d9e6e1;border-top:0;border-radius:0 0 9px 9px;background:#f8fbfa;color:#607970;font-size:9.5px}
.quote-editor-ab .quote-table-summary strong{color:#315e50;font-size:10px}.quote-editor-ab .quote-table-summary b{font-size:12px;color:#0d7a5f}

.quote-editor-ab .quote-bottom-ab{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,.96fr) 280px;gap:10px;margin-top:10px;align-items:stretch}
.quote-editor-ab .quote-note-card{padding:10px;border:1px solid #dbe7e2;border-radius:9px;background:#fbfdfc}
.quote-editor-ab .quote-note-card label{display:grid;gap:5px;color:#526f64;font-size:9.5px;font-weight:800}
.quote-editor-ab .quote-note-card textarea{height:74px;min-height:74px;padding:7px 8px;border-radius:7px;font-size:10px;resize:vertical}
.quote-editor-ab .quote-terms-card{display:grid;grid-template-rows:auto auto;gap:6px}
.quote-editor-ab .quote-terms-tools{display:flex;align-items:center;gap:7px;min-width:0}
.quote-editor-ab .quote-terms-tools button{min-height:26px;padding:3px 7px;font-size:8.5px;white-space:nowrap}
.quote-editor-ab .quote-terms-tools small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px;color:#758b82}
.quote-editor-ab .quote-tax-summary-ab{display:grid;align-content:start;gap:0;padding:9px 11px;border:1px solid #d4e5de;border-radius:9px;background:#f3faf6}
.quote-editor-ab .quote-tax-summary-ab>div{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:29px;border-bottom:1px solid #deebe5;font-size:9.5px}
.quote-editor-ab .quote-tax-summary-ab>div:last-child{border-bottom:0}
.quote-editor-ab .quote-tax-summary-ab strong{font-variant-numeric:tabular-nums;color:#244c5e;font-size:11px}
.quote-editor-ab .quote-tax-summary-ab .quote-grand{min-height:42px;margin-top:3px;padding-top:4px;color:#176d54}
.quote-editor-ab .quote-tax-summary-ab .quote-grand strong{font-size:20px;color:#087a5b}

.quote-editor-ab .quote-footer-sticky{position:sticky;bottom:0;z-index:45;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;margin:10px -2px -4px;padding:8px 10px;border:1px solid #d4e3dd;border-radius:10px;background:rgba(255,255,255,.97);box-shadow:0 -7px 20px rgba(30,70,58,.09);backdrop-filter:blur(10px)}
.quote-editor-ab .quote-footer-sticky>button{min-height:35px;padding:6px 11px;font-size:10px}
.quote-editor-ab .quote-footer-total{display:flex;align-items:baseline;justify-content:flex-end;gap:7px;color:#687f76;font-size:9px}
.quote-editor-ab .quote-footer-total strong{font-size:18px;color:#087a5b;font-variant-numeric:tabular-nums}.quote-editor-ab .quote-footer-total small{font-size:9px}
.quote-editor-ab [data-q-save-print]{min-width:126px;background:#0b8465!important;border-color:#0b8465!important}

@media(max-width:1180px){
 .sales-app.is-document .sales-heading-actions{position:sticky;top:8px;right:auto;margin-left:auto;width:max-content;max-width:100%;z-index:55}
 .quote-editor-ab .quote-top-grid{grid-template-columns:1fr}
 .quote-editor-ab .quote-document-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .quote-editor-ab .quote-document-issuer{grid-column:auto}
 .quote-editor-ab .quote-bottom-ab{grid-template-columns:1fr 1fr}
 .quote-editor-ab .quote-tax-summary-ab{grid-column:1/-1;grid-template-columns:repeat(3,1fr);align-items:center}
 .quote-editor-ab .quote-tax-summary-ab>div{border-bottom:0;border-right:1px solid #deebe5;padding:0 10px}.quote-editor-ab .quote-tax-summary-ab>div:last-child{border-right:0}
}
@media(max-width:760px){
 .sales-app.is-document .sales-heading-actions{position:static;width:100%;overflow:auto;justify-content:flex-start;padding:5px;box-shadow:none}
 .sales-app.is-document .sales-heading-actions>button{flex:0 0 auto}
 .quote-editor-ab .quote-editor-head{display:grid}
 .quote-editor-ab .quote-editor-head-badge{justify-self:start}
 .quote-editor-ab .quote-customer-toolbar,.quote-editor-ab .quote-document-grid,.quote-editor-ab .quote-product-toolbar,.quote-editor-ab .quote-bottom-ab{grid-template-columns:1fr}
 .quote-editor-ab .quote-document-issuer{grid-column:auto}
 .quote-editor-ab .quote-inline-actions{justify-content:flex-start}
 .quote-editor-ab .quote-product-toolbar-hint{white-space:normal}
 .quote-editor-ab .quote-table-wrap-compact{max-height:none;min-height:220px}
 .quote-editor-ab .quote-tax-summary-ab{grid-column:auto;grid-template-columns:1fr}
 .quote-editor-ab .quote-tax-summary-ab>div{border-right:0;border-bottom:1px solid #deebe5}
 .quote-editor-ab .quote-footer-sticky{grid-template-columns:auto 1fr}.quote-editor-ab [data-q-save-print]{grid-column:1/-1}.quote-editor-ab .quote-footer-total{justify-content:flex-end}
}

/* HF03N · refinement: 3-column top, compact no-horizontal-scroll item grid */
.quote-editor-ab2{padding-top:2px}
.quote-editor-ab2 .quote-top-grid-three{
  grid-template-columns:minmax(470px,1.55fr) minmax(270px,.78fr) minmax(320px,1fr);
  gap:10px;
  align-items:stretch;
  margin-bottom:10px;
}
.quote-editor-ab2 .quote-customer-pane,
.quote-editor-ab2 .quote-document-pane,
.quote-editor-ab2 .quote-notes-pane{padding:12px 13px;min-width:0}
.quote-editor-ab2 .quote-section-head{margin-bottom:8px;padding-bottom:7px}
.quote-editor-ab2 .quote-section-head small{white-space:nowrap}

/* Customer: search + new customer stays in one line */
.quote-editor-ab2 .quote-customer-toolbar{grid-template-columns:minmax(0,1fr) 116px;gap:7px}
.quote-editor-ab2 .quote-customer-add{min-width:116px}
.quote-editor-ab2 .quote-customer-summary{padding:8px 9px}

/* Document: keep only essential controls; company label is retained only as hidden state for existing JS */
.quote-editor-ab2 .quote-document-grid-compact{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;height:calc(100% - 39px);align-content:start}
.quote-editor-ab2 .quote-document-grid-compact .quote-subunit-inline{grid-column:1/-1}
.quote-editor-ab2 .quote-document-issuer-button{
  grid-column:1/-1;
  display:flex;
  justify-content:flex-end;
  align-items:flex-end;
  min-height:34px;
  margin-top:auto;
  padding:0;
  border:0;
  background:transparent;
}
.quote-editor-ab2 .quote-document-issuer-button .quote-issuer-hidden{
  position:absolute!important;
  width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;border:0!important;
}
.quote-editor-ab2 .quote-document-issuer-button>button{
  min-height:32px;
  padding:5px 10px;
  border:1px solid #ccddd7;
  border-radius:8px;
  background:#fff;
  color:#276c58;
  font-size:9.5px;
  font-weight:800;
}

/* Terms + note become the third top card */
.quote-editor-ab2 .quote-top-notes-grid{display:grid;grid-template-rows:1fr 1fr;gap:7px;min-height:0}
.quote-editor-ab2 .quote-top-notes-grid .quote-note-card{padding:0;border:0;background:transparent;min-width:0}
.quote-editor-ab2 .quote-top-notes-grid .quote-note-card label{display:grid;gap:3px}
.quote-editor-ab2 .quote-top-notes-grid .quote-note-card label>span{font-size:9px;font-weight:800;color:#617b71}
.quote-editor-ab2 .quote-top-notes-grid textarea{
  width:100%;
  height:58px;
  min-height:58px;
  max-height:58px;
  resize:none;
  padding:6px 8px;
  border-radius:7px;
  font-size:9.5px;
  line-height:1.35;
}
.quote-editor-ab2 .quote-top-notes-grid .quote-terms-tools{margin-top:3px;display:flex;align-items:center;gap:5px;min-width:0}
.quote-editor-ab2 .quote-top-notes-grid .quote-terms-tools button{min-height:24px;padding:2px 6px;font-size:8px}
.quote-editor-ab2 .quote-top-notes-grid .quote-terms-tools small{font-size:7.5px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Product card moves upward and prioritizes usable table area */
.quote-editor-ab2 .quote-products-card{padding:11px 11px 10px}
.quote-editor-ab2 .quote-products-head{margin-bottom:6px;padding-bottom:6px}
.quote-editor-ab2 .quote-product-toolbar{margin-bottom:6px;grid-template-columns:minmax(0,1fr) auto}
.quote-editor-ab2 .quote-product-toolbar-hint{max-width:280px;overflow:hidden;text-overflow:ellipsis}

/* Fit the item table to the viewport. No 980px minimum, so normal desktop does not horizontal-scroll. */
.quote-editor-ab2 .quote-table-wrap-compact.quote-table-fit{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  overflow-y:auto;
  max-height:calc(100vh - 430px);
  min-height:260px;
}
.quote-editor-ab2 .quote-table-no-scroll{
  width:100%;
  min-width:0!important;
  table-layout:fixed;
  font-size:10px;
}
.quote-editor-ab2 .quote-table-no-scroll th,
.quote-editor-ab2 .quote-table-no-scroll td{box-sizing:border-box}
.quote-editor-ab2 .quote-table-no-scroll th:nth-child(1),
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(1){width:112px!important;min-width:0!important}
.quote-editor-ab2 .quote-table-no-scroll th:nth-child(2),
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(2){width:auto!important;min-width:0!important}
.quote-editor-ab2 .quote-table-no-scroll th:nth-child(3),
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(3){width:68px!important}
.quote-editor-ab2 .quote-table-no-scroll th:nth-child(4),
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(4){width:92px!important}
.quote-editor-ab2 .quote-table-no-scroll th:nth-child(5),
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(5){width:82px!important}
.quote-editor-ab2 .quote-table-no-scroll th:nth-child(6),
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(6){width:102px!important}
.quote-editor-ab2 .quote-table-no-scroll th:nth-child(7),
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(7){width:72px!important}

/* Checkbox + Code are one compact horizontal line aligned with the product-name input. */
.quote-editor-ab2 .quote-table-no-scroll td:first-child{white-space:nowrap;vertical-align:middle}
.quote-editor-ab2 .quote-table-no-scroll td:first-child .quote-line-select{
  display:inline-block!important;
  width:14px!important;height:14px!important;
  margin:0 5px 0 0!important;
  vertical-align:middle!important;
}
.quote-editor-ab2 .quote-table-no-scroll td:first-child input:not(.quote-line-select){
  display:inline-block!important;
  width:82px!important;
  max-width:calc(100% - 21px)!important;
  height:28px!important;
  min-height:28px!important;
  margin:0!important;
  vertical-align:middle!important;
  padding:3px 5px!important;
  background:#f4f8f7;
  color:#607a70;
  font-size:9px!important;
}
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(2)>input[data-line-field="name"]{
  width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(3) input,
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(4) input,
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(5) input{width:100%!important;min-width:0!important;text-align:right}
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(6){text-align:right;white-space:nowrap}
.quote-editor-ab2 .quote-table-no-scroll td:nth-child(7){white-space:nowrap;text-align:right}
.quote-editor-ab2 .quote-table-no-scroll td{padding-top:4px;padding-bottom:4px}
.quote-editor-ab2 .quote-details td{padding-top:0!important;padding-bottom:3px!important}
.quote-editor-ab2 .quote-details td:first-child{width:auto!important}
.quote-editor-ab2 .quote-detail-list>div{grid-template-columns:10px minmax(0,1fr) 24px}

/* With note/terms upstairs, keep only a compact tax summary below the table. */
.quote-editor-ab2 .quote-bottom-total-only{display:flex;justify-content:flex-end;margin-top:7px}
.quote-editor-ab2 .quote-bottom-total-only .quote-tax-summary-ab{
  width:min(600px,100%);
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  padding:6px 8px;
}
.quote-editor-ab2 .quote-bottom-total-only .quote-tax-summary-ab>div{
  min-height:38px;
  padding:0 10px;
  border-bottom:0;
  border-right:1px solid #deebe5;
}
.quote-editor-ab2 .quote-bottom-total-only .quote-tax-summary-ab>div:last-child{border-right:0}
.quote-editor-ab2 .quote-bottom-total-only .quote-tax-summary-ab .quote-grand{margin:0;padding:0 10px;min-height:38px}
.quote-editor-ab2 .quote-bottom-total-only .quote-tax-summary-ab .quote-grand strong{font-size:17px}

@media(max-width:1360px){
  .quote-editor-ab2 .quote-top-grid-three{grid-template-columns:minmax(430px,1.35fr) minmax(260px,.8fr)}
  .quote-editor-ab2 .quote-notes-pane{grid-column:1/-1}
  .quote-editor-ab2 .quote-top-notes-grid{grid-template-columns:1fr 1fr;grid-template-rows:auto}
  .quote-editor-ab2 .quote-top-notes-grid textarea{height:54px;min-height:54px;max-height:54px}
  .quote-editor-ab2 .quote-table-wrap-compact.quote-table-fit{max-height:calc(100vh - 500px)}
}
@media(max-width:900px){
  .quote-editor-ab2 .quote-top-grid-three{grid-template-columns:1fr}
  .quote-editor-ab2 .quote-notes-pane{grid-column:auto}
  .quote-editor-ab2 .quote-top-notes-grid{grid-template-columns:1fr}
  .quote-editor-ab2 .quote-table-wrap-compact.quote-table-fit{overflow-x:auto;max-height:none}
  .quote-editor-ab2 .quote-table-no-scroll{min-width:760px!important}
}

/* HF03O · restore balanced 2-column header + lower terms/note + vertical totals */
.quote-editor-ab3 .quote-top-grid-two{
  display:grid;
  grid-template-columns:minmax(0,1.72fr) minmax(330px,.78fr);
  gap:10px;
  align-items:stretch;
  margin-bottom:10px;
}
.quote-editor-ab3 .quote-customer-pane,
.quote-editor-ab3 .quote-document-pane{min-width:0;padding:12px 13px}
.quote-editor-ab3 .quote-customer-subunit-wrap{display:flex;justify-content:flex-start;margin-top:7px}
.quote-editor-ab3 .quote-customer-subunit{width:min(330px,100%);display:grid;gap:4px}
.quote-editor-ab3 .quote-customer-subunit[hidden]{display:none!important}
.quote-editor-ab3 .quote-customer-subunit>span{font-size:9px;font-weight:800;color:#617b71}
.quote-editor-ab3 .quote-customer-subunit select{height:32px;min-height:32px;padding:4px 8px}

.quote-editor-ab3 .quote-document-grid-simple{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:8px;
  align-content:start;
}
.quote-editor-ab3 .quote-document-grid-simple .quote-document-issuer{
  grid-column:1/-1;
  justify-content:flex-end;
  margin-top:6px;
}

/* Terms / note return below the item table. */
.quote-editor-ab3 .quote-bottom-restored{
  display:grid;
  grid-template-columns:minmax(0,1.12fr) minmax(0,.96fr) 285px;
  gap:10px;
  margin-top:8px;
  align-items:stretch;
}
.quote-editor-ab3 .quote-bottom-restored .quote-note-card{
  padding:9px 10px;
  border:1px solid #dbe7e2;
  border-radius:9px;
  background:#fbfdfc;
  min-width:0;
}
.quote-editor-ab3 .quote-bottom-restored .quote-note-card label{display:grid;gap:5px;color:#526f64;font-size:9.5px;font-weight:800}
.quote-editor-ab3 .quote-bottom-restored .quote-note-card textarea{height:74px;min-height:74px;padding:7px 8px;border-radius:7px;font-size:10px;resize:vertical}
.quote-editor-ab3 .quote-bottom-restored .quote-terms-tools{display:flex;align-items:center;gap:7px;margin-top:6px;min-width:0}
.quote-editor-ab3 .quote-bottom-restored .quote-terms-tools button{min-height:26px;padding:3px 7px;font-size:8.5px;white-space:nowrap}
.quote-editor-ab3 .quote-bottom-restored .quote-terms-tools small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px;color:#758b82}

/* Totals return to the familiar vertical stack. */
.quote-editor-ab3 .quote-tax-summary-vertical{
  width:100%;
  display:grid!important;
  grid-template-columns:1fr!important;
  align-content:start;
  padding:9px 11px!important;
}
.quote-editor-ab3 .quote-tax-summary-vertical>div{
  display:flex!important;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:31px!important;
  padding:0!important;
  border-right:0!important;
  border-bottom:1px solid #deebe5!important;
}
.quote-editor-ab3 .quote-tax-summary-vertical>div:last-child{border-bottom:0!important}
.quote-editor-ab3 .quote-tax-summary-vertical .quote-grand{min-height:43px!important;margin-top:3px!important;padding-top:4px!important}
.quote-editor-ab3 .quote-tax-summary-vertical .quote-grand strong{font-size:20px!important}

/* Remove redundant non-error info strip under the editor, but keep errors visible. */
.quote-editor-ab3>[data-q-message]:not(.is-error){display:none!important}
.quote-editor-ab3>[data-q-message].is-error{display:block!important;margin-top:8px}

/* Bottom bar is now actions only; no duplicated grand total. */
.quote-editor-ab3 .quote-footer-actions-only{
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:0!important;
  min-height:54px;
}
.quote-editor-ab3 .quote-footer-actions-close{display:flex;align-items:center;gap:7px}
.quote-editor-ab3 .quote-footer-actions-close>button{min-height:35px;padding:6px 12px;font-size:10px}
.quote-editor-ab3 .quote-footer-actions-close [data-q-manager]{border-color:#d7dfdc;background:#fff;color:#765f5f}
.quote-editor-ab3 .quote-footer-actions-close [data-q-save-print]{min-width:132px}

@media(max-width:1180px){
  .quote-editor-ab3 .quote-top-grid-two{grid-template-columns:minmax(0,1.35fr) minmax(310px,.8fr)}
  .quote-editor-ab3 .quote-bottom-restored{grid-template-columns:1fr 1fr}
  .quote-editor-ab3 .quote-tax-summary-vertical{grid-column:1/-1;max-width:420px;justify-self:end}
}
@media(max-width:760px){
  .quote-editor-ab3 .quote-top-grid-two,
  .quote-editor-ab3 .quote-document-grid-simple,
  .quote-editor-ab3 .quote-bottom-restored{grid-template-columns:1fr}
  .quote-editor-ab3 .quote-document-grid-simple .quote-document-issuer{grid-column:auto}
  .quote-editor-ab3 .quote-tax-summary-vertical{grid-column:auto;max-width:none}
  .quote-editor-ab3 .quote-footer-actions-only{justify-content:stretch!important}
  .quote-editor-ab3 .quote-footer-actions-close{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .quote-editor-ab3 .quote-footer-actions-close>button{width:100%}
}

/* HF03P · balance CUSTOMER / DOCUMENT header
   Customer keeps the working area; subunit moves inline with search.
   Document fields stack vertically: number -> date -> comparison company. */
.quote-editor-ab4 .quote-top-grid-balanced{
  grid-template-columns:minmax(0,2.2fr) minmax(300px,1fr);
  gap:10px;
  align-items:stretch;
}
.quote-editor-ab4 .quote-customer-toolbar-balanced{
  display:grid;
  grid-template-columns:minmax(320px,1fr) minmax(190px,260px) auto;
  gap:8px;
  align-items:end;
}
.quote-editor-ab4 .quote-customer-subunit-inline{
  width:100%;
  min-width:0;
  display:grid;
  gap:4px;
  margin:0;
}
.quote-editor-ab4 .quote-customer-subunit-inline[hidden]{display:none!important}
.quote-editor-ab4 .quote-customer-subunit-inline>span{
  font-size:9px;
  font-weight:800;
  color:#617b71;
}
.quote-editor-ab4 .quote-customer-subunit-inline select{
  width:100%;
  height:36px;
  min-height:36px;
  margin:0;
  padding:6px 8px;
  border-radius:8px;
  font-size:10px;
}
.quote-editor-ab4 .quote-customer-add{height:36px;align-self:end}
.quote-editor-ab4 .quote-customer-summary-host{margin-top:8px}

.quote-editor-ab4 .quote-document-grid-stack{
  display:grid;
  grid-template-columns:1fr!important;
  gap:8px;
  align-content:start;
}
.quote-editor-ab4 .quote-document-grid-stack .quote-document-number,
.quote-editor-ab4 .quote-document-grid-stack .quote-document-field,
.quote-editor-ab4 .quote-document-grid-stack .quote-document-issuer{
  grid-column:1!important;
  width:100%;
  min-width:0;
}
.quote-editor-ab4 .quote-document-grid-stack .quote-document-issuer{
  justify-content:flex-start;
  margin-top:0;
  padding:0;
  border:0;
  background:transparent;
}
.quote-editor-ab4 .quote-document-grid-stack .quote-document-issuer>button{
  width:100%;
  min-height:34px;
  justify-content:center;
}

@media(max-width:1180px){
  .quote-editor-ab4 .quote-top-grid-balanced{grid-template-columns:minmax(0,1.7fr) minmax(290px,.8fr)}
  .quote-editor-ab4 .quote-customer-toolbar-balanced{grid-template-columns:minmax(260px,1fr) minmax(170px,220px) auto}
}
@media(max-width:900px){
  .quote-editor-ab4 .quote-top-grid-balanced{grid-template-columns:1fr}
  .quote-editor-ab4 .quote-customer-toolbar-balanced{grid-template-columns:1fr minmax(170px,.5fr) auto}
}
@media(max-width:680px){
  .quote-editor-ab4 .quote-customer-toolbar-balanced{grid-template-columns:1fr}
  .quote-editor-ab4 .quote-customer-add{width:100%}
}
