:root {
  --ace-accent: #f6000f;
  --ace-bg: #f5f7fa;
  --ace-text: #1f2937;
  --ace-muted: #6b7280;
  --ace-border: #d1d5db;
  --ace-card-radius: 8px;
  --ace-button-radius: 5px;
  --ace-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
.ace-viewer-shell { font-family: Arial, Helvetica, sans-serif; color: var(--ace-text); background: var(--ace-bg); width: 100%; }
.ace-main-grid { display:grid; grid-template-columns:minmax(320px,420px) minmax(0,1fr); gap:24px; align-items:start; }
.ace-left-column > *, .ace-left-column .ace-pdf-topbar { margin-bottom:24px; }
.ace-pdf-topbar, .ace-quote-card, .ace-viewer-card, .ace-product-section { background:#fff; border:1px solid var(--ace-border); border-radius:8px; box-shadow: var(--ace-shadow); }
.ace-pdf-topbar { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:16px 24px; }
.ace-topbar-brand { display:flex; align-items:center; gap:16px; min-width:0; }
.ace-brand-link img { display:block; max-height:44px; width:auto; }
.ace-company-fallback { font-weight:700; font-size:18px; }
.ace-topbar-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.ace-home-button,.ace-contact-button,.ace-secondary-button,.ace-submit-button,.ace-add-line,.ace-remove-line { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:11px 18px; border:1px solid var(--ace-accent); border-radius:5px; text-decoration:none; text-transform:uppercase; letter-spacing:.03em; font-size:12px; font-weight:700; cursor:pointer; }
.ace-home-button,.ace-contact-button,.ace-submit-button { background:var(--ace-accent); color:#fff; }
.ace-secondary-button,.ace-add-line,.ace-remove-line { background:#fff; color:var(--ace-accent); }
.ace-home-button:hover,.ace-contact-button:hover,.ace-submit-button:hover,.ace-secondary-button:hover { background:#c4000c; border-color:#c4000c; color:#fff; text-decoration:none; }
.ace-add-line:hover,.ace-remove-line:hover { background:#fff5f5; border-color:#c4000c; color:#c4000c; }
.ace-quote-card,.ace-viewer-card { padding:28px; }
.ace-quote-card-copy { margin-bottom:18px; }
.ace-quote-card h2, .ace-product-section h2 { margin-top:0; }
.ace-quote-lines { display:flex; flex-direction:column; gap:12px; }
.ace-quote-line { display:grid; grid-template-columns:1.3fr .8fr auto; gap:12px; }
.ace-quote-line input, .ace-field-group input, .ace-field-group textarea { width:100%; min-height:46px; padding:12px 14px; border:1px solid var(--ace-border); border-radius:6px; font-size:15px; }
.ace-part-number-field { position:relative; }
.ace-product-suggestions { position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:35; background:#fff; border:1px solid var(--ace-border); border-radius:6px; box-shadow: var(--ace-shadow); max-height:240px; overflow-y:auto; }
.ace-product-suggestions[hidden] { display:none !important; }
.ace-product-suggestion { display:flex; flex-direction:column; width:100%; text-align:left; padding:10px 14px; border:0; border-bottom:1px solid #edf0f3; background:#fff; color:var(--ace-text); cursor:pointer; }
.ace-product-suggestion:hover { background:#fff5f5; }
.ace-product-suggestion-part { font-weight:700; }
.ace-product-suggestion-title { color:var(--ace-muted); font-size:13px; margin-top:2px; }

.ace-product-suggestion-message {
  display:block;
  width:100%;
  padding:11px 14px;
  background:#fff;
  color:var(--ace-muted);
  font-size:13px;
  line-height:1.35;
}
.ace-product-suggestion-loading {
  color:var(--ace-text);
}
.ace-product-suggestion-empty {
  color:var(--ace-muted);
}
.ace-submit-row { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:18px; }
.ace-modal[hidden] { display:none !important; }
.ace-modal,.ace-success-modal { position:fixed; inset:0; z-index:9999; }
.ace-modal-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.48); }
.ace-modal-dialog { position:relative; z-index:1; max-width:720px; margin:5vh auto; background:#fff; border-radius:8px; padding:28px; box-shadow: var(--ace-shadow); }
.ace-success-dialog { max-width:520px; }
.ace-modal-close { position:absolute; right:14px; top:10px; background:transparent; border:0; font-size:26px; cursor:pointer; }
.ace-modal-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.ace-field-group-full,.ace-honeypot { grid-column:1 / -1; }
.ace-honeypot { position:absolute; left:-9999px; }
.ace-modal-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:20px; }
.ace-right-column { min-width:0; }
.ace-product-panel { min-height:640px; }
.ace-product-empty { padding:24px; color:var(--ace-muted); }
.ace-product-section { padding:24px; margin-bottom:24px; }
.ace-product-content .ace-product-section:last-child { margin-bottom:0; }
.ace-kicker { margin:0 0 10px; color:var(--ace-accent); text-transform:uppercase; font-size:12px; font-weight:700; letter-spacing:.08em; }
.ace-document-title { margin:0 0 12px; font-size:32px; line-height:1.15; white-space:normal; overflow-wrap:anywhere; word-break:break-word; }
.ace-product-header { display:grid; grid-template-columns:minmax(0,1fr) minmax(180px,280px); gap:24px; align-items:start; }
.ace-product-code { margin:0; color:var(--ace-muted); font-weight:700; }
.ace-product-image { max-width:100%; width:100%; height:auto; display:block; object-fit:contain; }
.ace-overview-intro { font-size:17px; color:var(--ace-muted); line-height:1.6; }
 .ace-long-description p { line-height:1.7; }
.ace-spec-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.ace-spec-item { border:1px solid #e5e7eb; border-radius:6px; padding:12px 14px; }
.ace-spec-name { font-size:13px; color:var(--ace-muted); margin-bottom:6px; }
.ace-spec-value { font-weight:700; line-height:1.5; }
.ace-doc-list { display:flex; flex-direction:column; gap:10px; }
.ace-doc-item { display:flex; flex-direction:column; gap:3px; border:1px solid #e5e7eb; border-radius:6px; padding:12px 14px; text-decoration:none; color:inherit; }
.ace-doc-item:hover { border-color: var(--ace-accent); }
.ace-doc-title { font-weight:700; }
.ace-doc-meta { color:var(--ace-muted); font-size:13px; }
.ace-logistics-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px; }
.ace-logistics-item { border:1px solid #e5e7eb; border-radius:6px; padding:12px 14px; }
.ace-logistics-label { display:block; color:var(--ace-muted); font-size:13px; margin-bottom:6px; }
.ace-logistics-value { display:block; font-weight:700; }
.ace-product-loading { padding:24px; color:var(--ace-muted); }
@media (max-width: 960px) {
  .ace-main-grid { grid-template-columns:1fr; }
  .ace-product-panel { min-height:0; }
}
@media (max-width: 768px) {
  .ace-pdf-topbar { flex-direction:column; align-items:stretch; padding:14px; }
  .ace-quote-line { grid-template-columns:1fr; }
  .ace-modal-dialog { margin:2vh 12px; padding:22px 18px; }
  .ace-modal-grid { grid-template-columns:1fr; }
  .ace-product-header { grid-template-columns:1fr; }
  .ace-spec-grid { grid-template-columns:1fr; }
  .ace-document-title { font-size:26px; }
}

/* 1.0.8 compact product accordions */
.ace-product-accordion { padding:0; overflow:hidden; }
.ace-accordion-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 24px; cursor:pointer; font-size:22px; line-height:1.25; font-weight:700; text-transform:uppercase; letter-spacing:.03em; list-style:none; }
.ace-accordion-summary::-webkit-details-marker { display:none; }
.ace-product-accordion > :not(summary) { margin-left:24px; margin-right:24px; }
.ace-product-accordion > :last-child { margin-bottom:24px; }
.ace-accordion-icon { width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--ace-border); border-radius:999px; font-size:20px; line-height:1; color:var(--ace-accent); flex:0 0 auto; }
.ace-product-accordion[open] .ace-accordion-icon { transform:rotate(45deg); }
.ace-product-image-wrap { min-height:140px; display:flex; align-items:center; justify-content:center; }
.ace-product-image { max-height:260px; }

/* 1.1.4 clean layout override */
:root { --ace-bg: #ffffff; }
.ace-viewer-shell, .ace-two-column-shell { background: transparent !important; }
.ace-main-grid, .ace-left-column, .ace-right-column, .ace-product-panel { background: transparent !important; }
.ace-viewer-card { background: #ffffff !important; }
.ace-quote-line { align-items: stretch; }
.ace-quote-line input, .ace-quote-line .ace-part-number-field, .ace-quantity-input, .ace-remove-line { min-height: 46px; }
.ace-remove-line { width: 46px; height: 46px; padding: 0 !important; line-height: 1; align-self: stretch; font-size: 16px; }
.ace-submit-row { align-items: center; }
.ace-add-line { min-width: 150px; height: 44px; padding: 11px 16px !important; gap: 7px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; white-space: nowrap; }
.ace-add-line span { display: inline-block; }
@media (max-width: 768px) { .ace-add-line { width: 100%; } .ace-remove-line { width: 100%; } }

/* 1.1.5 modal visibility and address autocomplete */
.ace-modal,
.ace-success-modal {
  z-index: 2147483000 !important;
}
.ace-modal-dialog {
  max-height: 88vh;
  overflow-y: auto;
  margin: 6vh auto !important;
}
.ace-address-field {
  position: relative;
}
.ace-field-help {
  margin: 7px 0 0;
  color: var(--ace-muted);
  font-size: 12px;
  line-height: 1.35;
}
.ace-address-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 22px);
  z-index: 2147483001;
  background: #fff;
  border: 1px solid var(--ace-border);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  max-height: 220px;
  overflow-y: auto;
}
.ace-address-suggestions[hidden] {
  display: none !important;
}
.ace-address-suggestion {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid #edf0f3;
  background: #fff;
  color: var(--ace-text);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
}
.ace-address-suggestion:hover,
.ace-address-suggestion:focus {
  background: #fff5f5;
  outline: none;
}
.ace-address-suggestion-muted {
  color: var(--ace-muted);
}
@media (max-width: 768px) {
  .ace-modal-dialog {
    max-height: 94vh;
    margin: 3vh 12px !important;
  }
}

/* 1.1.6 RFQ modal stacking + quantity validation */
body > .ace-modal,
body > .ace-success-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  isolation: isolate;
}
body > .ace-modal .ace-modal-backdrop,
body > .ace-success-modal .ace-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
}
body > .ace-modal .ace-modal-dialog,
body > .ace-success-modal .ace-modal-dialog {
  position: relative !important;
  z-index: 2 !important;
  margin: max(24px, 5vh) auto !important;
  max-height: calc(100vh - 48px) !important;
}
.ace-quote-line-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #ff0014;
  border-radius: 6px;
  background: #fff5f5;
  color: #b0000e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.ace-quote-line-error[hidden] { display: none !important; }
.ace-input-error {
  border-color: #ff0014 !important;
  box-shadow: 0 0 0 2px rgba(255, 0, 20, .12) !important;
}

/* 1.1.11 thank-you modal stacking fix */
body > .ace-success-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: block !important;
  isolation: isolate;
}
body > .ace-success-modal .ace-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
}
body > .ace-success-modal .ace-modal-dialog {
  position: relative !important;
  z-index: 2 !important;
  margin: max(24px, 10vh) auto !important;
}

/* 1.1.12 quote line UX: view button + SVG delete icon */
.ace-quote-line {
  grid-template-columns: minmax(0, 1.35fr) minmax(92px, .55fr) auto 48px !important;
  align-items: stretch;
}
.ace-view-line,
.ace-remove-line {
  min-height: 46px !important;
  height: 46px;
  align-self: stretch;
}
.ace-view-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--ace-accent);
  border-radius: 6px;
  background: #fff;
  color: var(--ace-accent);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ace-view-line:hover:not(:disabled),
.ace-view-line-active {
  background: var(--ace-accent);
  color: #fff;
}
.ace-view-line:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.ace-quote-line-active {
  background: #fffafa;
  border-radius: 8px;
  outline: 2px solid rgba(246, 0, 15, .14);
  outline-offset: 6px;
}
.ace-remove-line {
  width: 48px;
  padding: 0 !important;
  border-radius: 6px !important;
  color: #7b8794;
}
.ace-remove-line:hover {
  color: var(--ace-accent);
  background: #fff5f5;
}
.ace-trash-icon {
  display: block;
  pointer-events: none;
}
.ace-trash-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 560px) {
  .ace-quote-line {
    grid-template-columns: 1fr 1fr;
  }
  .ace-part-number-field {
    grid-column: 1 / -1;
  }
}


/* 1.1.14 refined quote list UX */
.ace-quote-lines {
  gap: 10px;
}
.ace-quote-line {
  display: block !important;
}
.ace-line-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(92px, .5fr) 32px;
  gap: 12px;
  align-items: center;
}
.ace-quote-line:not(.ace-quote-line-active).ace-quote-line-has-product .ace-line-editor {
  display: none !important;
}
.ace-quote-line-active .ace-line-summary,
.ace-quote-line:not(.ace-quote-line-has-product) .ace-line-summary,
.ace-line-summary[hidden] {
  display: none !important;
}
.ace-line-summary {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--ace-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.ace-line-summary:hover,
.ace-line-summary:focus {
  background: #fffafa;
  border-color: rgba(246, 0, 15, .22);
  outline: none;
}
.ace-line-summary-title {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ace-text);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.ace-line-summary-meta {
  display: block;
  color: var(--ace-muted);
  font-size: 13px;
  line-height: 1.25;
}

.ace-line-summary-meta-missing-qty {
  color: #f6000f !important;
  font-weight: 700;
}
.ace-quote-line-active {
  background: transparent !important;
  outline: none !important;
  border-radius: 0 !important;
}
.ace-remove-line {
  width: 32px !important;
  min-width: 32px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #7b8794;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ace-remove-line:hover,
.ace-remove-line:focus {
  color: var(--ace-accent);
  background: transparent !important;
  outline: none;
}
.ace-view-line {
  display: none !important;
}
@media (max-width: 560px) {
  .ace-line-editor {
    grid-template-columns: 1fr 92px 32px;
  }
  .ace-part-number-field {
    grid-column: auto;
  }
}

/* 1.1.20 single CSV rendering fixes */
.ace-product-section,
.ace-product-content,
.ace-product-accordion { box-sizing: border-box; max-width: 100%; overflow: hidden; }
.ace-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.ace-spec-item { min-width: 0; overflow-wrap: anywhere; word-break: break-word; box-sizing: border-box; }
.ace-spec-name { text-transform: none; overflow-wrap: anywhere; }
.ace-spec-value { overflow-wrap: anywhere; word-break: break-word; }
.ace-long-description p { margin: 0 0 12px; }
.ace-overview-heading { margin: 18px 0 8px; font-size: 16px; line-height: 1.35; }
.ace-overview-list { margin: 0 0 14px 20px; padding: 0; }
.ace-overview-list li { margin: 4px 0; line-height: 1.55; }
.ace-doc-item { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 900px) { .ace-spec-grid { grid-template-columns: 1fr; } }


/* 1.1.21 single CSV display hardening */
.ace-document-title { max-width: 100%; overflow-wrap: anywhere; }
.ace-long-description ul, .ace-overview-list { list-style: disc; padding-left: 22px; margin-left: 0; }
.ace-long-description li, .ace-overview-list li { display: list-item; margin: 5px 0; }
.ace-spec-grid { overflow: hidden; }
.ace-spec-item { max-width: 100%; }

/* 1.1.22-safe targeted specification/download rendering fixes */
.ace-spec-value,
.ace-spec-line,
.ace-doc-title,
.ace-doc-meta {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.ace-spec-line {
  display: block;
  line-height: 1.55;
  margin: 2px 0;
}

/* 1.1.22-safe specification grid containment fix */
.ace-product-accordion > .ace-spec-grid {
  width: auto;
  max-width: none;
  box-sizing: border-box;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .ace-product-accordion > .ace-spec-grid {
    grid-template-columns: 1fr;
  }
}


/* 1.1.22-safe autocomplete status layout fix */
.ace-line-editor {
  align-items: start;
}
.ace-part-number-field .ace-product-suggestions {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  width: 100%;
  margin-top: 6px;
}
.ace-product-suggestion-message {
  white-space: normal;
}
