/* Shared language control and script-aware layouts. No remote font dependencies. */
.language-picker { position:relative; display:inline-flex; align-items:center; justify-content:center; gap:8px; flex-shrink:0; min-width:94px; height:44px; border:1px solid var(--line-strong); border-radius:24px; color:var(--text); background:var(--bg); direction:ltr; transition:background var(--duration),border-color var(--duration),box-shadow var(--duration); }
.language-picker > svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.5; flex-shrink:0; }
.language-picker > svg:last-of-type { width:10px; height:10px; }
.language-picker [data-language-code] { font:500 12px/1 var(--font); letter-spacing:.03em; min-width:20px; text-align:center; }
.language-picker select { position:absolute; inset:0; width:100%; height:100%; margin:0; cursor:pointer; opacity:0; font:15px/1.5 Arial,sans-serif; direction:ltr; color:var(--text); background:var(--surface); }
.language-picker:not(.is-enhanced):hover,.language-picker:not(.is-enhanced):focus-within { background:var(--header-hover-bg); border-color:var(--accent-soft); box-shadow:var(--header-glow); }
.language-picker:focus-within { outline:2px solid var(--accent-text); outline-offset:4px; }
.language-picker.is-enhanced { border:0; background:transparent; }
.language-picker.is-enhanced:focus-within { outline:none; }
.language-trigger { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-width:94px; height:44px; padding:0 16px; border:1px solid var(--line-strong); border-radius:24px; background:rgba(7,9,11,.86); transition:background var(--duration),border-color var(--duration),box-shadow var(--duration); }
.language-trigger > svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.5; flex-shrink:0; }
.language-trigger > svg:last-of-type { width:10px; height:10px; transition:transform 180ms; }
.language-trigger:hover,.language-trigger:focus-visible,.language-picker.is-open .language-trigger { background:var(--header-hover-bg); border-color:var(--accent-soft); box-shadow:var(--header-glow); }
.language-picker.is-open .language-trigger > svg:last-of-type { transform:rotate(180deg); }
.language-trigger:focus-visible { outline-offset:4px; }
.language-panel { position:absolute; top:calc(100% + 12px); right:0; z-index:2; width:256px; padding:8px; border:1px solid var(--line-strong); border-radius:6px; background:linear-gradient(145deg,#20171d,#111214 40%); box-shadow:0 20px 56px #0009,0 1px 0 #ff4b7026 inset; max-height:calc(100dvh - 100px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--line-strong) transparent; animation:language-reveal 160ms var(--ease) both; }
.language-panel-heading { margin:0 8px 5px; padding:9px 4px 14px; border-bottom:1px solid var(--line); font:500 12px/1.5 var(--font); color:var(--muted); letter-spacing:.02em; white-space:normal; }
.language-option { display:grid; grid-template-columns:28px 1fr 18px; align-items:center; gap:12px; width:100%; min-height:46px; padding:10px 12px; border-radius:3px; background:transparent; text-align:left; font:400 16px/1.5 'Barlow',Arial,sans-serif; transition:background 140ms,color 140ms; }
.language-option-code { color:var(--soft); font:500 10px/1.5 'Barlow',Arial,sans-serif; letter-spacing:.08em; }
.language-option-name { justify-self:start; }
.language-option-name[lang=ar] { font-family:Tahoma,Arial,sans-serif; }
.language-option-name[lang=zh-Hans] { font-family:'Microsoft YaHei','PingFang SC',Arial,sans-serif; }
.language-option-check { visibility:hidden; color:var(--accent-text); font-size:15px; }
.language-option[aria-checked=true] { background:rgba(var(--accent-deep-rgb),.28); box-shadow:2px 0 var(--accent) inset; }
.language-option[aria-checked=true] .language-option-code { color:var(--accent-text); }
.language-option[aria-checked=true] .language-option-check { visibility:visible; }
.language-option:hover { background:var(--surface-soft); }
.language-option:focus-visible { outline-offset:-2px; outline-width:1px; background:var(--surface-soft); }
[dir=rtl] .language-panel { right:auto; left:0; }
@keyframes language-reveal { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .language-panel { animation:none; } .language-trigger,.language-trigger > svg,.language-option { transition:none; } }
.desktop-nav a,.header-cta,.language-picker { white-space:nowrap; }
html:not([lang=tr]):not([lang=en]) :is(h1,h2,h3,p,dd,dt,.text-link,.button,.stage-summary) { overflow-wrap:anywhere; hyphens:manual; }
.header-inner,.product-copy,.method-step-body { min-width:0; }
.stage-copy { min-width:0; max-width:100%; }
.stage-title,.stage-number { max-width:100%; overflow-wrap:anywhere; hyphens:auto; }

/* Arabic shaping and Chinese reading rhythm require different font metrics. */
html[lang=ar] { --font:Tahoma,Arial,sans-serif; --display:Tahoma,Arial,sans-serif; --mono:Tahoma,Arial,sans-serif; }
html[lang=zh-Hans] { --font:'Microsoft YaHei','PingFang SC','Noto Sans CJK SC',Arial,sans-serif; --display:var(--font); --mono:var(--font); }
html:is([lang=ar],[lang=zh-Hans]) .brand span { font-family:'Barlow Condensed',Arial,sans-serif; }
html[lang=ar] :is(h1,h2,h3,.eyebrow,.product-kicker,.stage-number,.flow-detail-label,.example-heading,.example-result>span,.workflow-caption,.hero-signature) { letter-spacing:0; }
html[lang=ar] :is(h1,h2,h3) { line-height:1.5; }
html[lang=ar] .hero { --font:Tahoma,Arial,sans-serif; }
html[lang=ar] .hero h1 { font-size:clamp(48px,6.4vw,92px); line-height:1.45; letter-spacing:0; }
html[lang=ar] .hero-description { line-height:1.9; }
html[lang=ar] .hero .eyebrow { letter-spacing:0; }
html[lang=ar] :is(.about-hero h1,.method-hero h1,.store-intro h1) { font-size:clamp(48px,5.5vw,80px); }
html[lang=ar] :is(.about-block h2,.method-example-heading h2,.method-principles h2,.method-step-body h3,.flow-explanation h3) { font-size:clamp(29px,3.2vw,45px); }
html[lang=ar] :is(.brand,.product-copy h2,.checkout-summary h3,#product-dialog-title) { font-family:'Barlow Condensed',Arial,Tahoma,sans-serif; }
html[lang=ar] #product-dialog-title { font-family:Tahoma,Arial,sans-serif; font-size:32px; }
html[lang=zh-Hans] :is(h1,h2,h3) { line-height:1.35; letter-spacing:0; }
html[lang=zh-Hans] .hero { --font:'Microsoft YaHei','PingFang SC',Arial,sans-serif; }
html[lang=zh-Hans] .hero h1 { font-size:clamp(45px,6.4vw,92px); line-height:1.4; letter-spacing:0; }
html[lang=zh-Hans] :is(.about-hero h1,.method-hero h1,.store-intro h1) { font-size:clamp(48px,5.5vw,80px); }
html[lang=zh-Hans] :is(.about-block h2,.method-example-heading h2,.method-principles h2,.method-step-body h3) { font-size:clamp(30px,3.2vw,45px); }

/* Logical navigation and reading order; identifiers and prices stay left-to-right. */
[dir=rtl] .desktop-nav { margin-left:14px; margin-right:auto; }
[dir=rtl] .brand,[dir=rtl] .language-picker,[dir=rtl] .coin-name,[dir=rtl] .coin-ticker,[dir=rtl] .product-copy h2,[dir=rtl] #checkout-product-name { direction:ltr; unicode-bidi:isolate; }
[dir=rtl] :is(.product-price,.checkout-price,.product-dialog-price strong) { direction:ltr; unicode-bidi:isolate; text-align:right; }
[dir=rtl] #checkout-address { direction:ltr; text-align:left; unicode-bidi:plaintext; }
[dir=rtl] #checkout-address::placeholder { direction:rtl; text-align:right; }
[dir=rtl] .section-index { padding-right:0; padding-left:16px; border-right:0; border-left:1px solid var(--line-strong); }
[dir=rtl] .product-purchase { border-left:0; border-right:1px solid var(--line); padding-left:0; padding-right:28px; }
[dir=rtl] .method-step-output { border-left:0; border-right:1px solid var(--line-strong); padding-left:0; padding-right:26px; }
[dir=rtl] .method-request { padding-right:0; padding-left:27px; }
[dir=rtl] .method-example-flow { border-left:0; border-right:1px solid #c5bab7; padding-left:0; padding-right:33px; }
[dir=rtl] .payment-facts dd { text-align:left; }
[dir=rtl] .coin-option input { right:auto; left:10px; }
[dir=rtl] .workflow-mode,[dir=rtl] .example-step { margin-left:0; margin-right:auto; }
[dir=rtl] .flow-tags span { padding-left:10px; padding-right:0; }
[dir=rtl] .flow-tags span+span { border-left:0; border-right:1px solid var(--line-strong); padding-left:10px; padding-right:16px; }
/* The numbered technical diagram keeps its geometric flow; Arabic captions read RTL. */
[dir=rtl] .flow-network { direction:ltr; }
[dir=rtl] .stage-copy { direction:rtl; }
[dir=rtl] .stage-title { font-size:25px; line-height:1.5; letter-spacing:0; }
[dir=rtl] .stage-number { font-size:11px; line-height:1.6; letter-spacing:0; }
[dir=rtl] .stage-summary { line-height:1.8; letter-spacing:0; }
[dir=rtl] .flow-detail-label { flex-wrap:wrap; line-height:1.6; }
.workflow-top,.example-heading { flex-wrap:wrap; }
.example-heading .example-step { overflow-wrap:anywhere; }
@media (min-width:761px) and (max-width:1100px) {
 [dir=rtl] .desktop-nav { margin-left:0; }
 [dir=rtl] .product-purchase { padding-right:24px; }
}
@media(max-width:760px) {
 .language-trigger { min-width:88px; padding-inline:13px; }
 .language-panel,[dir=rtl] .language-panel { position:fixed; top:80px; left:24px; right:24px; width:auto; max-height:calc(100dvh - 96px); }
 html:is([lang=de],[lang=fr],[lang=es]) .stage-title { font-size:clamp(22px,6.5vw,31px); }
 .language-picker { margin-left:auto; min-width:88px; }
 [dir=rtl] .language-picker { margin-left:0; margin-right:auto; }
 [dir=rtl] .product-purchase { border-right:0; padding-right:0; }
 [dir=rtl] .method-step-output { padding-right:16px; }
 [dir=rtl] .method-request { padding:0; }
 [dir=rtl] .method-example-flow { border-right:0; padding-right:0; }
 [dir=rtl] .store-list-bar p:last-child { text-align:left; }
 [dir=rtl] .stage-copy { align-items:flex-end; text-align:right; }
 [dir=rtl] .stage-title { font-size:23px; }
 [dir=rtl] .stage-summary { font-size:11px; }
 html[lang=ar] .hero h1 { font-size:41px; }
 html[lang=ar] :is(.about-hero h1,.method-hero h1,.store-intro h1) { font-size:40px; }
 html[lang=ar] :is(.hero .button,.button) { line-height:1.8; }
 html[lang=zh-Hans] .hero h1 { font-size:42px; }
 html[lang=zh-Hans] :is(.about-hero h1,.method-hero h1,.store-intro h1) { font-size:40px; }
 html[lang=zh-Hans] .stage-title { font-size:27px; }
 html[lang=zh-Hans] .hero .button { white-space:normal; }
}
