/* Arabic / RTL. Loaded always; every rule is gated on html.fn-rtl so it costs
   nothing in English. Deliberately small: the layout is flexbox and grid, which
   mirror themselves once dir="rtl" is set. Only things pinned to a physical
   side, or that must NOT mirror, need saying here. */
html.fn-rtl body { direction: rtl; text-align: right; }

/* Numbers, money, tickers and ISINs stay left-to-right inside Arabic prose.
   Without this "USD 500,000" renders with the currency on the wrong side and
   reads as a different figure. */
html.fn-rtl .amt, html.fn-rtl .tokamt,
html.fn-rtl .ds-invcard-ledger-val,
html.fn-rtl .ds-invcard-back-isin-val,
html.fn-rtl .ds-invcard-metric-value,
html.fn-rtl .v, html.fn-rtl code, html.fn-rtl .mono,
html.fn-rtl [data-no-i18n] { direction: ltr; unicode-bidi: embed; }

/* Pinned to a physical edge, so flipped by hand. */
html.fn-rtl .fnvc-close { right: auto; left: 14px; }
html.fn-rtl .ds-invcard-cta-arrow { transform: scaleX(-1); }
html.fn-rtl .fn-side { border-right: 0; border-left: 1px solid var(--border, #243040); }
html.fn-rtl .track > *, html.fn-rtl .bar > * { float: right; }

/* Arabic needs a little more line height to stay legible at these sizes. */
html.fn-rtl { line-height: 1.7; }

/* Language switcher */
.fn-lang{display:inline-flex;gap:2px;border:1px solid var(--border,#243040);border-radius:8px;overflow:hidden;vertical-align:middle}
.fn-lang button{background:none;border:0;color:var(--muted,#8b98a8);font:600 11px var(--ui,system-ui);padding:5px 10px;cursor:pointer}
.fn-lang button.on{background:var(--accent,#2fd07a);color:#06120c}
.fn-lang button:not(.on):hover{color:var(--accent,#2fd07a)}

/* Text that has no Arabic yet stays left-to-right. Latin prose inside an RTL
   container throws its trailing full stop to the front — "Real projects." reads
   as ".Real projects" — which looks like a rendering fault rather than an
   untranslated string. Applied by the engine, per element, only in Arabic. */
html.fn-rtl .fn-ltr-text { direction: ltr; text-align: right; unicode-bidi: isolate; }
