.alert-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 1.5rem 4rem rgb(0 20 70 / 28%);
  color: var(--ink, #14213d);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.alert-dialog::backdrop { background: rgb(0 17 52 / 58%); }

.alert-dialog-open { overscroll-behavior: none; }
.alert-dialog-card { min-width: 0; padding: 1.5rem; box-sizing: border-box; }
.alert-dialog-card * { box-sizing: border-box; }

.alert-dialog-heading,
.alert-dialog-actions,
.alert-field-grid {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.alert-dialog-heading { justify-content: space-between; }
.alert-dialog-heading h2 { margin: .15rem 0 .5rem; }
.alert-dialog-close { border: 0; background: transparent; font: inherit; font-size: 1.8rem; cursor: pointer; }
.alert-field-grid > label { flex: 1; font-weight: 700; }
.alert-field-grid input,
.alert-field-grid select { display: block; width: 100%; margin-top: .35rem; }
.alert-field-grid input[readonly] { color: #4c596d; background: #eef2f7; }
.alert-trigger-fields { display: grid; gap: .55rem; margin: 1rem 0; }
.alert-trigger-fields label { display: flex; gap: .55rem; align-items: flex-start; }
.alert-saved-fields { margin: 1rem 0; }
.alert-saved-options { display: grid; gap: .65rem; max-height: 16rem; overflow-y: auto; }
.alert-saved-options label { display: flex; gap: .55rem; align-items: flex-start; overflow-wrap: anywhere; }
.alert-saved-options input { flex: none; margin-top: .2rem; }
.alert-privacy,
.alert-management,
.alert-search-baseline { font-size: .9rem; line-height: 1.5; }
.alert-management { padding: .75rem .85rem; color: #173a60; background: #eef5ff; border-radius: .65rem; }
.alert-dialog-actions { margin-top: 1rem; flex-wrap: wrap; }
.alert-dialog-status { min-height: 1.5rem; font-weight: 700; }
.pursuit-controls { display: grid; gap: .45rem; margin-top: .6rem; }
.pursuit-controls label { font-size: .78rem; font-weight: 700; }
.pursuit-controls select,
.pursuit-controls textarea { width: 100%; margin-top: .2rem; }
.saved-item-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

@media (max-width: 520px) {
  .alert-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
  }
  .alert-dialog-card { padding: 1rem; }
  .alert-field-grid { display: grid; }
  .alert-dialog-actions .button { width: 100%; }
}

/* iOS Safari zooms focused form controls whose computed text size is below
   16px. Compact controls inherit smaller label text on desktop, so apply the
   floor only on touch-first devices, including phones in landscape. */
@media (hover: none) and (pointer: coarse) {
  input,
  select,
  textarea,
  [contenteditable]:not([contenteditable="false"]) {
    font-size: max(16px, 1em) !important;
  }
}
