/* Keep assembly sections at their natural height; only the modal body scrolls. */
#inventory-dialog-body.stock-assembly-form {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
}
#inventory-dialog-body.stock-assembly-form > * {
  margin-top: 0;
  margin-bottom: 16px;
}
#inventory-dialog-body.stock-assembly-form .dialog-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}
#inventory-dialog-body.stock-assembly-form #assembly-components,
#inventory-dialog-body.stock-assembly-form #refurbish-parts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: auto;
  min-height: min-content;
  max-height: none;
  overflow: visible;
}
#inventory-dialog-body.stock-assembly-form .assembly-component-row {
  flex: 0 0 auto;
  min-width: 0;
  padding: 16px;
  margin: 0;
  overflow: visible;
  box-shadow: none;
}
#inventory-dialog-body.stock-assembly-form label,
#inventory-dialog-body.stock-assembly-form .product-search-picker {
  min-width: 0;
}
/* Inline results cannot disappear underneath another row or the Add button. */
#inventory-dialog-body.stock-assembly-form .product-search-results {
  position: static;
  inset: auto;
  width: 100%;
  max-height: min(240px, 30dvh);
  overflow-y: auto;
  margin-top: 6px;
}
#inventory-dialog-body.stock-assembly-form #assembly-add-component,
#inventory-dialog-body.stock-assembly-form [data-remove-component] {
  width: auto;
  min-height: 44px;
}
#inventory-dialog-body.stock-assembly-form [data-remove-component] {
  margin-top: 12px;
}
@media (max-width: 700px) {
  #inventory-dialog-body.stock-assembly-form .dialog-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
