/* Right-to-left support (Arabic; also he/fa/ur if ever added).
 *
 * The bundled Bootstrap is the LTR build, so its directional utilities
 * (ms-*/me-*) compile to physical left/right and do NOT flip under dir="rtl".
 * i18n.js sets <html dir="rtl"> for RTL languages; here we mirror the handful of
 * directional utilities the flasher UI actually uses. */

[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
[dir="rtl"] .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
[dir="rtl"] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }

/* Checkboxes / radios (Settings) move to the right edge. */
[dir="rtl"] .form-check { padding-left: 0; padding-right: 1.5em; }
[dir="rtl"] .form-check .form-check-input { float: right; margin-left: 0; margin-right: -1.5em; }

/* Bootstrap toggle switch (help-hints / debug toggles). */
[dir="rtl"] .form-switch { padding-left: 0; padding-right: 2.5em; }
[dir="rtl"] .form-switch .form-check-input { float: right; margin-left: 0; margin-right: -2.5em; }

/* Technical Latin content stays LTR so it reads correctly embedded in RTL text:
 * the monospace log + diagnostics dump (left-aligned), and inline tokens
 * (device-info values like VID:PID / SoC, the version, and <code>). */
[dir="rtl"] #log,
[dir="rtl"] #diag-output { direction: ltr; text-align: left; }
[dir="rtl"] .device-info .value,
[dir="rtl"] #version-num,
[dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }
