/* Shared builder header: product and rates on the left, checkout on the right. */
#gms-calc .gms-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 480px);
  gap: 8px 24px;
  align-items: start;
}
#gms-calc .gms-material { grid-column: 1; grid-row: 1; min-width: 0; }
#gms-calc #gms-dims-label { white-space: nowrap; }
#gms-calc .gms-rate-block {
  grid-column: 1;
  grid-row: 2;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  line-height: 1.5;
}
#gms-calc .gms-rate-block > div:not(.gms-pricetable) { display: inline-block; margin-right: 12px; }
#gms-calc .gms-pricetable { max-width: 100%; overflow-x: auto; }
#gms-calc .gms-pricetable table { margin: 0; }
#gms-calc .gms-buy {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin-left: 0;
}
#gms-calc .gms-price-block { min-width: 0; max-width: 100%; }
#gms-calc #gms-atc-slot { min-width: 0; }
@media (max-width: 1000px) {
  #gms-calc .gms-header { grid-template-columns: minmax(0, 1fr); }
  #gms-calc .gms-buy { grid-column: 1; grid-row: 3; margin-top: 6px; }
  #gms-calc .gms-price-block { text-align: left; }
  #gms-calc .gqs-production-note { max-width: 420px; }
}
@media (max-width: 540px) {
  #gms-calc .gms-buy { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #gms-calc #gms-atc-slot, #gms-calc #gms-atc-slot button { width: 100%; }
}
