/* OtpOwl — right-to-left overrides (loaded only for <html dir="rtl">).
   Layout is flex/grid based, so most of it mirrors automatically; this file
   fixes the physical sides that CSS still expresses as left/right. */

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

/* Skip link */
html[dir="rtl"] .skip-link { left: auto; right: -9999px; }
html[dir="rtl"] .skip-link:focus { right: 16px; }

/* Header */
html[dir="rtl"] .header-actions { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .header-balance {
  padding: 0 16px 0 14px;
  border-radius: 0 999px 999px 0;
}
html[dir="rtl"] .header-account {
  padding: 0 8px 0 10px;
  border-left: 0;
  border-right: 1px solid var(--line-2);
  border-radius: 999px 0 0 999px;
}
html[dir="rtl"] .header-session { direction: rtl; }

/* Language / account dropdowns: JS sets inline left, but keep CSS sane */
html[dir="rtl"] .lang-dropdown,
html[dir="rtl"] .chrome-dropdown,
html[dir="rtl"] .account-dropdown { left: auto; right: 0; }
html[dir="rtl"] .lang-dropdown a,
html[dir="rtl"] .lang-dropdown button,
html[dir="rtl"] .account-dropdown a,
html[dir="rtl"] .account-dropdown button { text-align: right; }

/* Country select */
html[dir="rtl"] .ms-caret { right: auto; left: 8px; }
html[dir="rtl"] .ms-dropdown,
html[dir="rtl"] .ms-option { text-align: right; }
html[dir="rtl"] .ms-summary-faces { padding-left: 0; padding-right: 2px; }
html[dir="rtl"] .ms-summary-face { margin-left: 0; margin-right: -6px; }
html[dir="rtl"] .ms-summary-face:first-child { margin-right: 0; }

/* FAQ marker */
html[dir="rtl"] .faq-list summary { padding: 24px 0 24px 40px; }
html[dir="rtl"] .faq-list summary::after {
  right: auto;
  left: 6px;
  border-right: 0;
  border-left: 2px solid var(--ink);
  transform: translateY(-70%) rotate(-45deg);
}
html[dir="rtl"] .faq-list details[open] summary::after {
  transform: translateY(-30%) rotate(135deg);
}

/* Tables */
html[dir="rtl"] .price-table th,
html[dir="rtl"] .data-table th,
html[dir="rtl"] .data-table td { text-align: right; }
html[dir="rtl"] .price-table .num,
html[dir="rtl"] .price-table .action { text-align: left; }
html[dir="rtl"] .price-table th:first-child,
html[dir="rtl"] .price-table td:first-child { padding-left: 0; padding-right: 16px; }

/* Footer */
html[dir="rtl"] .footer-bottom { text-align: left; }
html[dir="rtl"] .footer-links { justify-content: flex-start; }

/* Lists and signed-in chrome */
html[dir="rtl"] .legal-body ul,
html[dir="rtl"] .alipay-steps { padding-left: 0; padding-right: 22px; }
html[dir="rtl"] .history-service {
  margin-left: 0;
  margin-right: 8px;
  padding-left: 0;
  padding-right: 8px;
  border-left: 0;
  border-right: 1px solid var(--line-2);
}
html[dir="rtl"] .balance-strip .btn { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .filter-pills { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .pagination { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .input-with-actions input { padding-right: 12px; padding-left: 52px; }
html[dir="rtl"] .input-with-actions.has-generate input { padding-left: 92px; }
html[dir="rtl"] .alipay-value-button { text-align: right; }

/* Alert / quote accents */
html[dir="rtl"] .alert,
html[dir="rtl"] .notice,
html[dir="rtl"] .callout { border-left: 0; border-right: 3px solid var(--accent-light); }

/* Numbers, prices, phone numbers and codes must keep LTR order inside RTL
   text: without isolation "+44 7700 900 214" renders as "214 900 7700 44+" and
   "$0.43" as "0.43$". */
html[dir="rtl"] .phone,
html[dir="rtl"] .fc-code,
html[dir="rtl"] .fc-1 b,
html[dir="rtl"] .header-balance-value,
html[dir="rtl"] .stat-num,
html[dir="rtl"] .price-table .num,
html[dir="rtl"] .data-table .num,
html[dir="rtl"] .number-card-price,
html[dir="rtl"] .number-card-timer,
html[dir="rtl"] .number-card-clock,
html[dir="rtl"] .sms-item-code,
html[dir="rtl"] .code-chip,
html[dir="rtl"] .history-price,
html[dir="rtl"] .pay-amount-line,
html[dir="rtl"] .pay-clock,
html[dir="rtl"] [data-countdown] {
  direction: ltr;
  unicode-bidi: isolate;
}
html[dir="rtl"] .stat-num { text-align: right; }
html[dir="rtl"] .number-card-clock,
html[dir="rtl"] .pay-amount-line { text-align: right; }

/* Icons that encode direction */
html[dir="rtl"] .btn svg[data-dir],
html[dir="rtl"] .lang-suggest-actions .btn svg { transform: scaleX(-1); }

/* Suggestion card sits in the inline-start corner automatically; nudge the
   actions to read right-to-left like the rest of the card. */
html[dir="rtl"] .lang-suggest-actions { justify-content: flex-start; }
html[dir="rtl"] .lang-suggest-title { padding-inline-end: 26px; }
