/* Override component font sizes that would make iPhone WebKit zoom on focus. */
@layer mobile-form-fonts {
  @media (max-width: 767px), (any-pointer: coarse) {
    input:not(
      [type="hidden"], [type="button"], [type="submit"], [type="reset"],
      [type="image"], [type="checkbox"], [type="radio"], [type="range"],
      [type="file"], [type="color"]
    ),
    select,
    textarea,
    [contenteditable=""],
    [contenteditable="true"],
    [contenteditable="plaintext-only"] {
      font-size: max(1rem, 16px) !important;
    }
  }
}

/* Keep scrolling and pinch zoom when interacting with touch controls. */
@media (any-pointer: coarse) {
  :where(
    button, a[href], input, select, textarea, summary, label[for],
    [role="button"], [role="tab"], [role="menuitem"], [role="option"],
    [role="combobox"], [contenteditable=""], [contenteditable="true"],
    [contenteditable="plaintext-only"]
  ) {
    touch-action: manipulation;
  }
}
