.quote-workspace {
  container-type: inline-size;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.quote-workspace > .panel { margin: 0; }

.quote-selection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-inline-start: 4px solid #405eb4;
  background: linear-gradient(115deg, #edf2fc, #fff 66%);
}

.quote-material {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quote-material > span,
.quote-material p,
.quote-list-head p {
  color: #516681;
  font-size: 12px;
}

.quote-material h3,
.quote-list-head h3 { margin: 4px 0 0; }

.quote-material p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 5px 0 0;
}

.quote-material p b { color: #25457a; }

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quote-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quote-metrics:empty { display: none; }

.quote-metrics > div {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 12px 15px;
  border: 1px solid #dde5f1;
  border-radius: 12px;
  background: #fff;
}

.quote-metrics > div:nth-child(2) {
  border-color: #d4e8dd;
  background: #f3faf6;
}

.quote-metrics span,
.quote-metrics small {
  color: #536a86;
  font-size: 12px;
}

.quote-metrics strong {
  color: #203b64;
  font-size: clamp(16px, 2vw, 26px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.quote-metrics > div:nth-child(2) strong { color: #16634f; }

.quote-directory {
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

.quote-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
}

.quote-list-head p { margin: 4px 0 0; }
.quote-list-head p:empty { display: none; }

.quote-filters {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) minmax(120px, 1fr) minmax(125px, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  border-block: 1px solid #e1e8f3;
  background: #f6f8fc;
}

.quote-filters label {
  display: grid;
  min-width: 0;
  gap: 4px;
  margin: 0;
  color: #435977;
  font-size: 12px;
}

.quote-filters label > :is(input, select) {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.quote-error {
  margin: 12px 16px;
  padding: 9px 12px;
  border: 1px solid #f0d1d8;
  border-radius: 8px;
  background: #fff4f5;
  color: #93253b;
}

.quote-results[aria-busy="true"] { opacity: .65; }

.quote-empty {
  margin: 0;
  padding: 34px 12px;
  color: #516681;
  text-align: center;
}

.quote-table-wrap {
  max-height: 460px;
  overflow: auto;
}

.quote-table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
}

.quote-col-supplier { width: 24%; }
.quote-col-price { width: 17%; }
.quote-col-source { width: 18%; }
.quote-col-detail { width: 70px; }

.quote-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 39px;
  padding: 8px 11px;
  background: #edf2fa;
  color: #435a78;
  font-size: 12px;
}

.quote-table tbody td {
  height: 58px;
  padding: 8px 11px;
  overflow-wrap: anywhere;
}

.quote-supplier-cell small,
.quote-source-cell time,
.quote-price-cell small {
  display: block;
  color: #566d88;
  font-size: 11px;
}

.quote-price-cell strong {
  display: block;
  color: #203b64;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.quote-source-cell time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quote-lowest,
.quote-terms-cell .is-fastest {
  color: #14664e;
  font-weight: 750;
}

.quote-lowest {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #e4f4eb;
  font-size: 11px;
}

.quote-terms-cell dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 7px;
  margin: 0;
  font-size: 11px;
}

.quote-terms-cell dt,
.quote-detail-grid dt {
  color: #536984;
}

.quote-terms-cell dd,
.quote-detail-grid dd {
  margin: 1px 0 0;
  color: #263b55;
  overflow-wrap: anywhere;
}

.quote-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.quote-detail-grid > div {
  padding: 10px 12px;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  background: #f7f9fc;
}

.quote-detail-grid > div:last-child { grid-column: 1 / -1; }
.quote-detail-grid dd { white-space: pre-wrap; }

@container (max-width: 680px) {
  .quote-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-filters .quote-actions { justify-content: end; }
  .quote-table-wrap { max-height: none; }
  .quote-table, .quote-table tbody { display: block; }
  .quote-table thead, .quote-table colgroup { display: none; }
  .quote-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e1e8f2;
  }
  .quote-table tbody td {
    display: block;
    height: auto;
    padding: 0;
    border: 0;
  }
  .quote-table .quote-price-cell { text-align: end; }
  .quote-table .quote-terms-cell { grid-column: 1 / -1; }
  .quote-terms-cell dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quote-table .quote-detail-cell { justify-self: end; }
}

@container (max-width: 420px) {
  .quote-filters > label:first-child { grid-column: 1 / -1; }
  .quote-filters .quote-actions { grid-column: 1 / -1; }
  .quote-metrics { gap: 5px; }
  .quote-metrics > div { padding: 8px; }
  .quote-metrics span, .quote-metrics small { font-size: 11px; }
}

@media (max-width: 600px) {
  .quote-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
