html[dir="rtl"] {
  text-align: start;
}

:where(html[dir="rtl"]) :where(label, legend, caption, th, td, select, textarea,
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"],
    [type="color"], [type="button"], [type="submit"], [type="reset"], [type="image"])) {
  text-align: start;
}

/* Keep technical values in reading order at the start of the Arabic field. */
:where(html[dir="rtl"]) :is(input, textarea)[dir="ltr"] {
  text-align: end;
}

/* A decimal field can show Arabic instructions until it has a value. */
:where(html[dir="rtl"]) input[dir="ltr"][inputmode="decimal"]:placeholder-shown {
  direction: rtl;
  text-align: start;
}
