.quote-generator-trigger {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  border: 1px solid #21d0e4;
  border-radius: 4px;
  color: #e9fcff;
  background: linear-gradient(110deg, rgba(18, 177, 202, .22), rgba(8, 38, 59, .75));
  font: 800 12px/1.2 "DM Sans", sans-serif;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: inset 0 0 24px rgba(29, 207, 228, .06);
}

.quote-generator-trigger:hover {
  color: #04111e;
  background: #21d0e4;
}

.quote-generator-overlay {
  z-index: 160;
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  color: #eaf8ff;
}

.quote-generator-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(1, 8, 16, .88);
  backdrop-filter: blur(15px);
  cursor: default;
}

.quote-generator-panel {
  z-index: 1;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1040px, 100%);
  max-height: calc(100vh - 44px);
  border: 1px solid rgba(75, 211, 233, .45);
  border-radius: 8px;
  overflow: hidden;
  background: #071522;
  box-shadow: 0 38px 110px rgba(0, 0, 0, .68);
}

.quote-generator-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(122, 190, 217, .2);
}

.quote-generator-eyebrow {
  color: #22d2e4;
  font: 600 9px/1.2 "DM Mono", monospace;
  letter-spacing: .2em;
}

.quote-generator-topbar h2 {
  margin: 7px 0 3px;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1;
}

.quote-generator-topbar p {
  margin: 0;
  color: #8da6b8;
  font-size: 11px;
}

.quote-generator-close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(124, 190, 218, .38);
  border-radius: 50%;
  color: #c8eaf4;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.quote-document {
  padding: 28px;
  overflow: auto;
  color: #10243a;
  background: #edf3f7;
}

.quote-document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 21px;
  border-bottom: 2px solid #0a315b;
}

.quote-document-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.quote-document-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.quote-document-brand strong,
.quote-document-brand span {
  display: block;
}

.quote-document-brand strong {
  color: #0a376e;
  font-size: 28px;
  letter-spacing: .025em;
}

.quote-document-brand span {
  margin-top: 2px;
  color: #337897;
  font: 700 8px/1.2 "DM Mono", monospace;
  letter-spacing: .17em;
}

.quote-document-meta {
  min-width: 255px;
  margin: 0;
}

.quote-document-meta div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 3px 0;
}

.quote-document-meta dt {
  color: #5b7486;
  font: 700 8px/1.4 "DM Mono", monospace;
  letter-spacing: .1em;
}

.quote-document-meta dd {
  margin: 0;
  color: #0a315b;
  font: 600 10px/1.4 "DM Mono", monospace;
}

.quote-customer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 20px 0;
}

.quote-customer-fields label {
  display: grid;
  gap: 7px;
}

.quote-customer-fields span {
  color: #47657a;
  font: 700 8px/1.2 "DM Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quote-customer-fields input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #b6c7d2;
  border-radius: 3px;
  outline: none;
  color: #102a44;
  background: rgba(255, 255, 255, .72);
  font: 500 11px/1 "DM Sans", sans-serif;
}

.quote-customer-fields input:focus {
  border-color: #179bb5;
  box-shadow: 0 0 0 3px rgba(23, 155, 181, .12);
}

.quote-table-wrap {
  overflow-x: auto;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.quote-table th {
  padding: 11px 10px;
  color: #ecfaff;
  background: #0a315b;
  font: 700 8px/1.2 "DM Mono", monospace;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.quote-table th:nth-child(n + 3),
.quote-table td:nth-child(n + 3) {
  text-align: right;
}

.quote-table td {
  padding: 13px 10px;
  border-bottom: 1px solid #c5d3db;
  vertical-align: top;
}

.quote-table td strong,
.quote-table td span {
  display: block;
}

.quote-table td strong {
  font-size: 12px;
}

.quote-table td span {
  margin-top: 4px;
  color: #1b8ba4;
  font: 700 8px/1.2 "DM Mono", monospace;
}

.quote-totals {
  width: min(420px, 100%);
  margin: 20px 0 22px auto;
}

.quote-totals > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 0;
  border-bottom: 1px solid #cad7df;
}

.quote-totals span {
  color: #557186;
  font-size: 10px;
}

.quote-totals strong {
  font-size: 12px;
  text-align: right;
}

.quote-totals .quote-grand-total {
  padding-top: 13px;
  border-bottom: 0;
}

.quote-totals .quote-grand-total span {
  color: #0b315a;
  font-weight: 800;
}

.quote-totals .quote-grand-total strong {
  color: #0a376e;
  font-size: 19px;
}

.quote-document-note {
  padding: 14px 16px;
  border-left: 3px solid #159db5;
  color: #456075;
  background: #dce9ef;
}

.quote-document-note strong,
.quote-document-note b {
  display: block;
  color: #0a376e;
  font: 800 8px/1.4 "DM Mono", monospace;
  letter-spacing: .08em;
}

.quote-document-note p {
  margin: 6px 0 8px;
  font-size: 9px;
  line-height: 1.55;
}

.quote-document-note b {
  color: #587286;
  font-size: 7px;
}

.quote-generator-actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
  padding: 16px 28px;
  border-top: 1px solid rgba(122, 190, 217, .2);
  background: #071522;
}

.quote-image-action {
  color: #04111e;
  border: 1px solid #19d2df;
  background: #19d2df;
  box-shadow: 0 10px 30px rgba(25, 210, 223, .16);
}

.quote-image-action:hover {
  background: #76eff5;
}

.quote-image-action:disabled {
  cursor: wait;
  opacity: .72;
}

.quote-generator-actions button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 4px;
  font: 800 11px/1.2 "DM Sans", sans-serif;
  cursor: pointer;
}

.quote-action-secondary {
  border: 1px solid rgba(110, 199, 220, .42);
  color: #c8e6ef;
  background: transparent;
}

@media (max-width: 680px) {
  .quote-generator-overlay {
    padding: 0;
  }

  .quote-generator-panel {
    width: 100%;
    height: 100svh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .quote-generator-topbar {
    padding: max(18px, env(safe-area-inset-top)) 18px 16px;
  }

  .quote-generator-topbar h2 {
    font-size: 29px;
  }

  .quote-generator-topbar p {
    max-width: 255px;
    font-size: 10px;
    line-height: 1.45;
  }

  .quote-document {
    padding: 18px 14px 24px;
  }

  .quote-document-header {
    gap: 15px;
  }

  .quote-document-brand {
    gap: 8px;
  }

  .quote-document-brand img {
    width: 39px;
    height: 39px;
  }

  .quote-document-brand strong {
    font-size: 21px;
  }

  .quote-document-brand span {
    font-size: 6px;
  }

  .quote-document-meta {
    min-width: 155px;
  }

  .quote-document-meta div {
    gap: 7px;
  }

  .quote-document-meta dt,
  .quote-document-meta dd {
    font-size: 6px;
  }

  .quote-customer-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quote-table,
  .quote-table tbody,
  .quote-table tr,
  .quote-table td {
    display: block;
  }

  .quote-table thead {
    display: none;
  }

  .quote-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid #c0d0d9;
    background: rgba(255, 255, 255, .5);
  }

  .quote-table td,
  .quote-table td:nth-child(n + 3) {
    padding: 0;
    border: 0;
    text-align: left;
    font-size: 10px;
  }

  .quote-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #657d8e;
    font: 700 6px/1.2 "DM Mono", monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .quote-table td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 6px;
    border-bottom: 1px solid #ccd8df;
  }

  .quote-totals {
    margin-top: 14px;
  }

  .quote-generator-actions {
    grid-template-columns: 1fr 1fr;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  }

  .quote-image-action {
    grid-column: 1 / -1;
  }

  .quote-generator-actions button {
    min-height: 46px;
    padding: 0 8px;
    font-size: 10px;
  }

}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body.quote-printing {
    background: #fff !important;
  }

  body.quote-printing > :not(.quote-generator-overlay) {
    display: none !important;
  }

  body.quote-printing .quote-generator-overlay,
  body.quote-printing .quote-generator-panel {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 0;
    border: 0;
    overflow: visible;
    color: #10243a;
    background: #fff;
    box-shadow: none;
  }

  body.quote-printing .quote-generator-backdrop,
  body.quote-printing .quote-generator-topbar,
  body.quote-printing .quote-generator-actions {
    display: none !important;
  }

  body.quote-printing .quote-document {
    padding: 0;
    overflow: visible;
    background: #fff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.quote-printing .quote-table {
    display: table;
  }

  body.quote-printing .quote-table thead {
    display: table-header-group;
  }

  body.quote-printing .quote-table tbody {
    display: table-row-group;
  }

  body.quote-printing .quote-table tr {
    display: table-row;
  }

  body.quote-printing .quote-table td {
    display: table-cell;
  }

  body.quote-printing .quote-table td::before {
    display: none;
  }
}
