/* 2 November 2026: AR/FA contact shortcuts use the lower-left corner.
   Other locales do not load this asset; every selector is also RTL/AR/FA scoped.
   Direction changes layout only. Channel logos retain their original geometry. */
html[dir="rtl"]:is([lang="ar"], [lang="fa"]) {
  --li-rtl-contact-edge: 24px;
}

html[dir="rtl"]:is([lang="ar"], [lang="fa"]) body .chat-widget.site-contact-float {
  direction: rtl;
  inset-inline-start: auto !important;
  inset-inline-end: calc(var(--li-rtl-contact-edge) + env(safe-area-inset-left)) !important;
}

/* The existing bottom offset, visibility and cookie-band avoidance stay active.
   Only move the desktop back-to-top control to the opposite horizontal edge. */
html[dir="rtl"]:is([lang="ar"], [lang="fa"]) body #floatUp[data-li-back-top] {
  inset-inline-end: auto !important;
  inset-inline-start: calc(var(--li-rtl-contact-edge) + env(safe-area-inset-right)) !important;
}

@media (max-width: 760px) {
  html[dir="rtl"]:is([lang="ar"], [lang="fa"]) {
    --li-rtl-contact-edge: 20px;
  }
}

/* Keep the existing short-landscape static fallback instead of fixing a
   control over a shallow viewport. Its static alignment follows the same side. */
@media (max-height: 420px) {
  html[dir="rtl"]:is([lang="ar"], [lang="fa"]) body .chat-widget.site-contact-float {
    inset-inline-start: auto !important;
    inset-inline-end: auto !important;
    margin-inline-start: auto !important;
    margin-inline-end: var(--li-rtl-contact-edge) !important;
  }
}
