/**
 * Hyperstar phone fields — placeholder uses the site's RTL reading direction,
 * while real phone numbers are always entered and displayed LTR.
 *
 * :placeholder-shown tracks the actual field value (including autofill) without
 * requiring JavaScript. Cover legacy text fields as well as native tel inputs
 * and phone inputs generated by form plugins.
 */
body :is(
    input[type="tel"],
    input[autocomplete="tel"],
    input[autocomplete="tel-national"],
    input[inputmode="tel"],
    input[name*="mobile" i],
    input[name*="phone" i],
    input[id*="mobile" i],
    input[id*="phone" i]
):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
    direction: ltr !important;
    text-align: left !important;
}

/* An empty field shows the Persian placeholder at the right edge. */
body :is(
    input[type="tel"],
    input[autocomplete="tel"],
    input[autocomplete="tel-national"],
    input[inputmode="tel"],
    input[name*="mobile" i],
    input[name*="phone" i],
    input[id*="mobile" i],
    input[id*="phone" i]
):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):placeholder-shown {
    direction: rtl !important;
    text-align: right !important;
}

/* Keep the placeholder itself RTL across native and custom form fields. */
body :is(
    input[type="tel"],
    input[autocomplete="tel"],
    input[autocomplete="tel-national"],
    input[inputmode="tel"],
    input[name*="mobile" i],
    input[name*="phone" i],
    input[id*="mobile" i],
    input[id*="phone" i]
):not([type="hidden"]):not([type="checkbox"]):not([type="radio"])::placeholder {
    direction: rtl;
    text-align: right;
    letter-spacing: normal;
}
