/* FormDialog (built here): a ModalDialog whose body is a short form. Its trigger sits where the button is asked for;
   its fields are stacked, with the dialog's own foot under them. Tokens only. */
.wi-form-dialog {
  display: inline-flex;
}

/* What the form does, under the title: quieter than its fields, as ConfirmDialog's description. */
.wi-form-dialog__description {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--font-line-height-sm);
}

.wi-form-dialog__form {
  display: grid;
  gap: var(--space-5);
}

.wi-form-dialog__fields {
  display: grid;
  gap: var(--space-4);
}

/* Fields loaded in a Turbo frame once the dialog opens (a campaign's Duplicate) are laid out as the form's own: the frame
   is a grid with the same gap, so each field is a grid item, spaced as the others, and a checkbox's label sits on no line
   of text whose height its box's state would change. The frame keeps its box (not `display: contents`): a lazy frame
   loads once its box is in view. */
.wi-form-dialog__fields > turbo-frame {
  display: grid;
  gap: var(--space-4);
}

/* A form with panels (`panels` of the component): the panel that is open replaces the form (`hidden`, by sheet_panels_controller.js; Sheet.css
   hides it whatever `display` it has). The panel's head is its Back button and its title, its
   body the block, its foot the Done button. On a phone the sheet has one height whichever view is open (what a sheet is at
   most: 92%), so it doesn't jump from the form to a list; the body takes what the head and the foot leave. */
.wi-form-dialog__panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
  outline: none;
}
.wi-form-dialog__panel-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.wi-form-dialog__panel-head .wi-modal-dialog__title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.wi-form-dialog__panel-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
@media (max-width: 767.98px) {
  .wi-modal-dialog.wi-sheet-on-phone.wi-form-dialog--panels {
    height: 92%;
  }
}
