/* Shared field geometry: controls never stretch to fill longer neighbouring copy. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  font: inherit;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select {
  min-height: 44px;
  align-self: start;
}
textarea {
  align-self: start;
  resize: vertical;
}
label:has(
  > :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    select,
    textarea
  )
) {
  min-width: 0;
  align-content: start;
}
/* Each grid row shares its label, control and help tracks, including wrapped labels. */
:is(
    form,
    .setup-form,
    .crm-fields,
    .report-filters,
    .filters,
    .experiment-form-grid,
    #plan-form
  )
  > label:has(
    > :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea)
  ) {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  row-gap: 8px;
  margin-block: 0;
}
.wizard-field-grid > .wizard-field {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  row-gap: 8px;
  align-content: start;
}
.wizard-field-grid .wizard-field-label {
  grid-row: 1;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-start;
  gap: 6px 10px;
}
.wizard-field-grid :is(input, textarea) {
  grid-row: 2;
  align-self: start;
}
.wizard-field-grid input {
  height: 48px;
}
.wizard-field-grid .wizard-field-help {
  grid-row: 3;
  align-self: start;
}
.wizard-field-grid .wizard-field-state {
  grid-row: 4;
  align-self: start;
}
.wizard-field-grid .wizard-required {
  white-space: normal;
  text-align: left;
}
.connections-page .connector-body .wizard-field-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 18px;
}
@media (max-width: 1500px) {
  .connections-page .connector-body .wizard-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .connections-page .connector-body .wizard-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Allow long copy and action rows to wrap inside their actual panel width. */
.panel,
.two-column > * {
  min-width: 0;
}
:is(.timeline-row, .list-row, .panel-header) > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.timeline-row,
.toolbar-group {
  flex-wrap: wrap;
}
