/* Reliable, finger-sized controls for the dietary-rule editor on iPhone Safari. */
dialog {
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 180px;
}

.dialog-head {
  position: sticky;
  top: -22px;
  z-index: 2;
  background: var(--cream);
  padding-top: 8px;
}

.dialog-close {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  touch-action: manipulation;
}

#cancelRuleDialog {
  min-height: 54px;
  touch-action: manipulation;
}

/* Safari zooms the page when a focused form control is smaller than 16px. */
input,
textarea,
select,
textarea#reviewText {
  font-size: 16px;
  line-height: 1.4;
}

.field-help {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

@media (max-width: 480px) {
  dialog {
    width: calc(100% - 20px);
    margin: auto;
    padding-inline: 18px;
  }

  .dialog-actions {
    position: sticky;
    bottom: -22px;
    z-index: 2;
    margin-inline: -18px;
    padding: 12px 18px max(12px, env(safe-area-inset-bottom));
    background: var(--cream);
    border-top: 1px solid var(--line);
  }
}

.crop-frame {
  height: min(58vh, 560px);
  margin: 18px 0 12px;
  overflow: hidden;
  border-radius: 20px;
  background: #1e2723;
}

.crop-frame img {
  display: block;
  max-width: 100%;
}

.crop-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.crop-tools .secondary-btn {
  margin: 0;
  min-height: 48px;
}

.cropper-view-box,
.cropper-face {
  border-radius: 3px;
}
