.boxx-form-section {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.boxx-form-section__col {
  min-width: 0;
}

/* Whitespace-only columns still fail :empty, so ignore text and hide when there is no element. */
.boxx-form-section__col:not(:has(*)) {
  display: none;
}

@media (min-width: 48rem) {
  .boxx-form-section--50-50 {
    grid-template-columns: 1fr 1fr;
  }

  .boxx-form-section--33-66 {
    grid-template-columns: 1fr 2fr;
  }

  .boxx-form-section--33-33-33 {
    grid-template-columns: repeat(3, 1fr);
  }

  /* A hidden empty column leaves its track. Let the columns that remain share the row. */
  .boxx-form-section:has(> .boxx-form-section__col:not(:has(*))) {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }
}
