/* Keep mobile form text readable before focus so iOS does not auto-zoom.
   Apply to small screens and touch tablets, including landscape/PWA views.
   Never restrict the viewport or pinch zoom. Desktop and print keep their styles. */
@media screen and (max-width: 767px), screen and (hover: none) and (pointer: coarse) {
    /* The shared asset ID supplies enough specificity to beat legacy module
       !important form-control sizes; html is the matching selector. */
    :is(html, #carebridge-mobile-inputs) body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="range"]):not([type="color"]),
    :is(html, #carebridge-mobile-inputs) body textarea,
    :is(html, #carebridge-mobile-inputs) body select,
    :is(html, #carebridge-mobile-inputs) body [contenteditable=""],
    :is(html, #carebridge-mobile-inputs) body [contenteditable="true"],
    :is(html, #carebridge-mobile-inputs) body [contenteditable="plaintext-only"] {
        font-size: 16px !important;
        font-size: max(16px, 1rem, var(--mobile-input-font-size, 0px)) !important;
    }
    /* Preserve existing large verification, payment and kiosk entry text. */
    .sv-input--otp, .otp-digit { --mobile-input-font-size: 26px; }
    .ap-control-code input, .fpl-amount-input, .g-input { --mobile-input-font-size: 22px; }
    .payrollbox input { --mobile-input-font-size: 20px; }
    .cb-security-auth__form input, .pp-auth-body .pp-input { --mobile-input-font-size: 18px; }
    .moh-reporting-kiosk__form .form-control, .sav-form .sav-code-input { --mobile-input-font-size: 17px; }
    @media (max-width: 520px) {
        .otp-digit { --mobile-input-font-size: 19px; }
    }

    /* Safari gives native date fields an intrinsic width/appearance that can
       exceed narrow form columns. Keep the native picker and constrain its box. */
    :is(html, #carebridge-mobile-inputs) body input:is([type="date"], [type="datetime-local"], [type="time"], [type="month"], [type="week"]) {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
        min-inline-size: 0;
        max-inline-size: 100%;
        -webkit-appearance: none;
        appearance: none;
    }
    :is(html, #carebridge-mobile-inputs) body input::-webkit-date-and-time-value {
        min-width: 0;
        min-height: 1.4em;
        text-align: left;
    }
    :is(html, #carebridge-mobile-inputs) body input::-webkit-datetime-edit {
        min-width: 0;
        padding: 0;
    }
    :is(html, #carebridge-mobile-inputs) body input::-webkit-calendar-picker-indicator {
        flex-shrink: 0;
        margin: 0;
    }
    :is(html, #carebridge-mobile-inputs) body.dark input:is([type="date"], [type="datetime-local"], [type="time"], [type="month"], [type="week"]) {
        color-scheme: dark;
    }
}
