/* Loaded last by every rendered page to preserve usable native WebKit controls. */
/* One scalable height for single-line controls, including native date editors.
   The em component leaves room when text is enlarged; textareas remain flexible. */
#fullForm input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
#fullForm select,
#privacyConsentModal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
body.admin-shell-page #editForm input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
body.admin-shell-page #editForm select {
  box-sizing: border-box;
  min-width: 0;
  min-height: 44px;
  height: max(44px, calc(1.5em + 22px));
  padding-block: 10px;
  line-height: 1.4;
}

@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select,
  textarea,
  body.admin-shell-page #editForm input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  body.admin-shell-page #editForm select,
  body.admin-shell-page #editForm textarea {
    font-size: 16px !important;
    min-height: 44px !important;
  }

  button {
    min-width: 44px;
    min-height: 44px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
  }

  label:has(input[type="checkbox"]),
  label:has(input[type="radio"]) {
    min-height: 44px;
  }
}

/* Preserve the native picker while avoiding Safari's intrinsic date overflow. */
input[type="date"],
body.admin-shell-page #editForm input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
  background-clip: padding-box;
  font-variant-numeric: tabular-nums;
}

input[type="date"]::-webkit-date-and-time-value,
body.admin-shell-page #editForm input[type="date"]::-webkit-date-and-time-value {
  display: block;
  width: 100%;
  min-height: 1.2em;
  margin: 0;
  text-align: left;
}

input[type="date"]::-webkit-datetime-edit,
body.admin-shell-page #editForm input[type="date"]::-webkit-datetime-edit {
  min-width: 0;
  padding: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator,
body.admin-shell-page #editForm input[type="date"]::-webkit-calendar-picker-indicator {
  width: 20px;
  min-width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

@media (max-width: 640px) {
  .stepper {
    display: flex !important;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .stepper button {
    width: auto;
    min-width: 72px !important;
    min-height: 44px !important;
    height: 44px !important;
    padding-inline: 0 !important;
    flex: 0 0 72px !important;
    scroll-snap-align: start;
  }
}
