/* System-script fallbacks work without fetching third-party font services. */
:root:lang(ar) { --font-body: 'Segoe UI', Tahoma, Arial, sans-serif; --font-display: var(--font-body); }
:root:lang(zh-CN) { --font-body: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif; --font-display: var(--font-body); }
:root:lang(zh-TW) { --font-body: 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans CJK TC', sans-serif; --font-display: var(--font-body); }
:root:lang(ja) { --font-body: 'Yu Gothic', Meiryo, 'Hiragino Kaku Gothic ProN', sans-serif; --font-display: var(--font-body); }
:root:lang(ko) { --font-body: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; --font-display: var(--font-body); }
:root:lang(hi) { --font-body: 'Nirmala UI', 'Noto Sans Devanagari', Mangal, sans-serif; --font-display: var(--font-body); }
:root:lang(th) { --font-body: 'Leelawadee UI', 'Noto Sans Thai', Tahoma, sans-serif; --font-display: var(--font-body); }
:root:is(:lang(ar), :lang(zh), :lang(ja), :lang(ko), :lang(hi), :lang(th)) :is(h1,h2,h3,p,button,label,select,[data-i18n],.sidebar-link,.nav-card-title,.lang-en,.lang-tr,.docs-category-pill,.spec-node) {
  letter-spacing: normal;
  text-transform: none;
}
:root:is(:lang(ar), :lang(hi), :lang(th)) :is(p,li,button,.hero__lede,.sidebar-link) { line-height: 1.7; }
:root:is(:lang(ar), :lang(hi), :lang(th)) .hero__display { line-height: 1.35; }
:root:is(:lang(zh), :lang(ja)) { line-break: strict; word-break: normal; }
:root:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
:is(.hero__content,.hero__display,.hero__lede,.section-title,.section-subtitle,.docs-content,.docs-callout-content,.nav-card-title,.waitlist-status) { min-inline-size: 0; overflow-wrap: anywhere; }
:is(.hero__cta-group,.waitlist-form) { flex-wrap: wrap; }
:is(.btn-primary,.btn-secondary,.btn-ghost-nav,.nav-pill__cta) { white-space: normal; height: auto; text-align: center; }
/* Language names identify languages without assigning a national flag. */
.lang-flag-box { display: none !important; }
.lang-select, #langSelect {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  padding: 6px 24px 6px 10px;
  min-inline-size: 88px;
  max-inline-size: 170px;
  line-height: 1.5;
}
.lang-select option { unicode-bidi: isolate; }
/* Preserve source code, numeric demos and interaction coordinates in RTL. */
pre,code,kbd,input[type='email'],input[type='url'],input[type='range'],input[type='number'],.hero__terminal,.code-window,.shader-editor {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}
[dir='rtl'] .hero__content { text-align: start; }
[dir='rtl'] .docs-sidebar { border-right: 0; border-left: 1px solid var(--color-rule); }
[dir='rtl'] .lang-chevron-icon { right: auto; left: 8px; }
[dir='rtl'] :is(.lang-select,#langSelect) { padding-inline-start: 10px; padding-inline-end: 24px; }
[dir='rtl'] :is(.sidebar-link,.docs-callout-content,.docs-content) { text-align: start; }
[dir='rtl'] .docs-callout { border-left: 0; border-inline-start: 3px solid var(--color-info); }
body:not([data-active-lang='tr']) .lang-tr { display: none !important; }
@media (max-width: 991px) {
  [dir='rtl'] .hero__content { text-align: center; }
}
@media (max-width: 1024px) {
  [dir='rtl'] .docs-sidebar { left: auto; right: 0; transform: translateX(100%); }
  [dir='rtl'] .docs-sidebar.open { transform: translateX(0); }
}
@media (max-width: 600px) {
  .lang-select, #langSelect { max-inline-size: 118px; font-size: 11px; }
  .nav-pill__actions { gap: 6px; }
  .nav-pill__cta { max-inline-size: 110px; }
  .docs-header-inner { gap: 8px; }
}

.docs-badge-row { flex-wrap: wrap; }

/* Long translated menus can use two lines without pushing actions out of view. */
@media (min-width: 1181px) {
  .nav-pill__links { min-inline-size: 0; flex: 1; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
  .nav-pill__links a { padding-inline: 6px; line-height: 1.4; }
}
