/* Internationalisation: language picker, per-script font stacks, and right-to-left (Arabic, Hebrew, Persian, Urdu) mirroring.
   Loaded after app.css / assistant.css. Most layout flips automatically (flex/grid follow <html dir>); this file fixes the rest. */

/* ── language button + picker ── */
.lang-btn{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 16px 0 12px;border-radius:22px;background:var(--surface);border:1px solid var(--border);color:var(--t1);font-weight:600;font-size:14px;cursor:pointer;box-shadow:var(--shadow-sm);transition:all .22s var(--ease);max-width:100%}
.lang-btn:hover{border-color:rgba(79,70,229,.45);transform:translateY(-1px)}
.lang-btn .mi{font-size:20px;color:var(--indigo)}
.lang-btn.icon{width:44px;padding:0;justify-content:center}
.lang-btn.block{width:100%;justify-content:flex-start;height:56px;border-radius:20px;padding:0 16px}
.lang-btn.block .ln{flex:1;text-align:start}
.lang-fab{position:fixed;top:14px;inset-inline-end:14px;z-index:60}
@media (max-width:900px){.lang-fab .ln{display:none}.lang-fab.lang-btn{width:44px;padding:0;justify-content:center}}
.lang-list{display:flex;flex-direction:column;gap:6px;max-height:min(58vh,540px);overflow:auto;margin:0 -6px;padding:2px 6px 6px;overscroll-behavior:contain}
.lang-row{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border-radius:18px;border:1.5px solid transparent;background:var(--surface2);text-align:start;cursor:pointer;color:var(--t1);transition:all .2s var(--ease)}
.lang-row:hover{border-color:rgba(79,70,229,.35);transform:translateX(2px)}
[dir=rtl] .lang-row:hover{transform:translateX(-2px)}
.lang-row.on{border-color:var(--indigo);background:rgba(79,70,229,.08)}
.lang-row .lt{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.lang-row .ln{font-weight:600;font-size:16px;line-height:1.3}
.lang-row .le{font-size:12px;color:var(--t3)}
.lang-row .mi{color:var(--indigo)}
.lang-row .ck{flex:none;width:22px;height:22px;border-radius:50%;border:2px solid var(--border);transition:all .2s var(--ease)}
.lang-row.on .ck{border-color:var(--indigo);background:var(--indigo);box-shadow:inset 0 0 0 4px var(--surface2)}

/* ── fonts: Gilroy covers Latin; other scripts fall back to the best system face for that script ── */
html:lang(ar),html:lang(fa),html:lang(ur){--font:'Gilroy','Segoe UI',Tahoma,'Noto Sans Arabic','Noto Naskh Arabic','Geeza Pro','Arial',system-ui,sans-serif}
html:lang(he){--font:'Gilroy','Segoe UI','Arial Hebrew','Noto Sans Hebrew',Arial,system-ui,sans-serif}
html:lang(hi),html:lang(mr){--font:'Gilroy','Segoe UI','Nirmala UI','Noto Sans Devanagari','Kohinoor Devanagari',system-ui,sans-serif}
html:lang(bn){--font:'Gilroy','Segoe UI','Nirmala UI','Noto Sans Bengali','Kohinoor Bangla',system-ui,sans-serif}
html:lang(ta){--font:'Gilroy','Segoe UI','Nirmala UI','Noto Sans Tamil','Tamil Sangam MN',system-ui,sans-serif}
html:lang(te){--font:'Gilroy','Segoe UI','Nirmala UI','Noto Sans Telugu','Kohinoor Telugu',system-ui,sans-serif}
html:lang(th){--font:'Gilroy','Leelawadee UI','Noto Sans Thai','Thonburi',system-ui,sans-serif}
html:lang(ja){--font:'Gilroy','Hiragino Sans','Hiragino Kaku Gothic ProN','Yu Gothic UI','Meiryo','Noto Sans JP',system-ui,sans-serif}
html:lang(ko){--font:'Gilroy','Apple SD Gothic Neo','Malgun Gothic','Noto Sans KR',system-ui,sans-serif}
html:lang(zh-CN){--font:'Gilroy','PingFang SC','Microsoft YaHei','Noto Sans SC',system-ui,sans-serif}
html:lang(zh-TW){--font:'Gilroy','PingFang TC','Microsoft JhengHei','Noto Sans TC',system-ui,sans-serif}
/* letter-spacing breaks cursive joining (Arabic/Persian/Urdu) and looks wrong in Indic, Thai and CJK scripts */
html:lang(ar) *,html:lang(fa) *,html:lang(ur) *,html:lang(he) *,html:lang(hi) *,html:lang(mr) *,html:lang(bn) *,html:lang(ta) *,html:lang(te) *,html:lang(th) *,html:lang(ja) *,html:lang(ko) *,html:lang(zh-CN) *,html:lang(zh-TW) *{letter-spacing:normal!important}
html:lang(ar) .display,html:lang(fa) .display,html:lang(ur) .display,html:lang(hi) .display,html:lang(th) .display{line-height:1.3}

/* ── right-to-left ── */
[dir=rtl] .orb.a{right:auto;left:-80px}[dir=rtl] .orb.b{left:auto;right:-140px}
[dir=rtl] .dock{right:auto;left:20px}
[dir=rtl] .scanpill{padding:12px 14px 12px 20px}
[dir=rtl] .mi.flip{transform:scaleX(-1)}
[dir=rtl] .phones{direction:ltr}                                   /* decorative screenshots only — keep their fan arrangement */
[dir=rtl] .hero-art{direction:ltr}.hero-art figure p{direction:rtl}
[dir=rtl] input[type=email],[dir=rtl] input[type=password],[dir=rtl] input[type=url],[dir=rtl] #apiKey{direction:ltr;text-align:right}
[dir=rtl] input[type=password]::placeholder,[dir=rtl] input[type=email]::placeholder,[dir=rtl] #apiKey::placeholder{direction:rtl}
[dir=rtl] .pa-bub{direction:rtl;text-align:start}                   /* assistant stays docked bottom-left (its geometry is measured in JS); only the speech flips */
[dir=rtl] .pa-q{border-radius:14px 4px 4px 14px}
[dir=rtl] .seg,[dir=rtl] .chipset{direction:rtl}
@media (min-width:1000px){
  [dir=rtl] .navbar{left:auto;right:20px}
  [dir=rtl] main#view{padding:12px 12px 80px 40px}[dir=rtl] .topbar{padding:20px 12px 8px 40px}
}
/* user data of unknown direction (document titles, senders, entities…) lays itself out by its own script */
[dir=auto]{unicode-bidi:plaintext}
