.staff-products .products-filter {
  grid-template-columns: minmax(0, 1.5fr) minmax(120px, 1fr) auto;
  align-items: end;
  margin-block: 14px;
  max-width: 700px;
}

.staff-products .products-editor {
  margin-block: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7fafd;
}

.staff-products .products-editor h3 { margin: 0 0 12px; }
.staff-products .products-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  min-width: 0;
  border: 0;
}

.staff-products .products-wide { grid-column: 1 / -1; }
.staff-products .products-fields p { margin: 0; }
.staff-products .products-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.staff-products .products-status { margin-block: 12px; }
.staff-products .products-status:empty,
.staff-products #products-effective-mode:empty { display: none; }
.staff-products .products-code { display: block; margin-top: 3px; }
.staff-products td:last-child .btn { margin: 3px; }
.staff-products textarea { resize: vertical; }
.staff-products td { overflow-wrap: anywhere; }

.staff-products .products-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf1f7;
  color: #415067;
  font-size: 0.82rem;
  font-weight: 650;
}

.staff-products .products-badge[data-status="active"] {
  background: #e3f4ec;
  color: #166044;
}

@media (max-width: 650px) {
  .staff-products .products-filter,
  .staff-products .products-fields { grid-template-columns: minmax(0, 1fr); }
  .staff-products .products-filter button { justify-self: start; }
}

.staff-products .products-metadata-form { display: block; margin-block: 24px; }
.staff-products .products-metadata-form h3 { margin: 0 0 10px; }
.staff-products .products-metadata-intro { max-width: 70ch; margin-bottom: 18px; }
.staff-products .products-metadata-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.staff-products .products-metadata-controls section { margin-block: 26px; }
.staff-products .products-metadata-flags { display: flex; gap: 18px; flex-wrap: wrap; }
.staff-products .products-metadata-checkbox { display: flex; flex-direction: row-reverse; justify-content: start; align-items: center; gap: 8px; }
.staff-products .products-metadata-checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.staff-products .products-variant-rows,
.staff-products .products-confirmation-rows { display: grid; gap: 12px; margin-block: 12px; }
.staff-products .products-variant-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) minmax(120px,1fr); gap: 12px; }
.staff-products .products-confirmation-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.staff-products .products-metadata-form .products-actions { margin-block: 18px 0; }
.staff-products .products-catalog-dependencies,
.staff-products .products-catalog-history { margin-block: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.staff-products .products-catalog-dependencies h4,
.staff-products .products-catalog-history h4,
.staff-products .products-metadata-form h4 { margin: 0 0 10px; }
.staff-products .products-catalog-dependencies h5 { margin: 18px 0 6px; }
.staff-products .products-catalog-dependencies ul { margin-block: 6px; padding-left: 22px; }
.staff-products .products-catalog-history ol { padding-left: 22px; }
.staff-products .products-catalog-history li { margin-bottom: 18px; }
.staff-products .products-catalog-history p { margin-block: 6px; overflow-wrap: anywhere; }
.staff-products .products-catalog-history pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 75ch; font-size: .85rem; }
.staff-products .products-catalog-history summary { cursor: pointer; text-underline-offset: 3px; }
.staff-products .products-metadata-form input:read-only { background: var(--surface); }
.staff-products .products-metadata-form :focus-visible,
.staff-products .products-catalog-history summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 650px) {
  .staff-products .products-variant-row,
  .staff-products .products-confirmation-row { grid-template-columns: minmax(0,1fr); }
  .staff-products .products-variant-row + .products-variant-row { border-top: 1px solid var(--line); padding-top: 14px; }
}
