@font-face {
  font-family: 'Noto Serif Tibetan';
  src: url('/fonts/noto-serif-tibetan-v1.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0F00-0FFF;
}
/* Script-specific fallbacks preserve the user's Uyghur font preference. */
body, button, input, select, textarea {
  font-family: var(--uyghur-font, 'ALKATIP Basma'), 'Noto Serif Tibetan', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
html[lang="ug"] button, html[lang="ug"] input, html[lang="ug"] select,
html[lang="ug"] textarea {
  font-family: var(--uyghur-font, 'ALKATIP Basma'), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.site-brand-row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; min-width: 0; }
.ui-language { display: inline-flex; align-items: center; gap: .25rem; flex-shrink: 0; color: #64748b; }
.ui-language select { width: auto; min-width: 78px; max-width: 112px; min-height: 30px; margin: 0; padding: .2rem .3rem; border: 1px solid #e3e8ef; border-radius: 6px; background: #f8faff; color: #334155; font: inherit; font-size: 12px; line-height: 1.6; cursor: pointer; }
.site-header .ui-language select { inline-size: 78px; block-size: 30px; }
.ui-language select:focus-visible { outline: 2px solid #83a7f7; outline-offset: 2px; }
.logo, .brand { direction: ltr; unicode-bidi: isolate; }
[data-i18n-skip], #profile-account, #identity, #file-name, #ocr-file-name { unicode-bidi: plaintext; }
html[dir="rtl"] .dropdown-input { padding-inline-start: .75rem; padding-inline-end: 2rem; text-align: start; }
html[dir="rtl"] .dropdown-arrow { right: auto; left: .75rem; }
html[dir="rtl"] .dropdown-list, html[dir="rtl"] table, html[dir="rtl"] th, html[dir="rtl"] td { text-align: start; }
html[dir="rtl"] .dialog-heading { text-align: start; }
html[dir="rtl"] .profile-grid dd { padding-right: 0; padding-inline-end: 1rem; }
html[dir="rtl"] .changelog-list { padding-right: 0; padding-inline-start: 0; }
html[dir="rtl"] .chat-message { text-align: start; }
html[dir="rtl"] .steps::before { left: auto; right: 14px; }
html[dir="rtl"] .cue-heading input, html[dir="rtl"] .range-label output { direction: ltr; }
html[lang="ug"] .dropdown-input { font-size: 13px; }
html:not([lang="zh-CN"]) .translate-btn { white-space: normal; height: auto; min-height: 36px; }
html:not([lang="zh-CN"]) .source-meta { flex-wrap: wrap; }
html:not([lang="zh-CN"]) .panel-actions { flex-wrap: wrap; }
@media (max-width: 700px) {
  .site-header > .site-brand-row { width: 100%; justify-content: space-between; }
  .ui-language select { min-height: 30px; font-size: 12px; }
  html:not([lang="zh-CN"]) .account-actions { gap: .25rem; }
  html:not([lang="zh-CN"]) .account-button { font-size: 11px; padding: .3rem .4rem; }
  html:not([lang="zh-CN"]) .controls-panel { min-width: 0; }
  html:not([lang="zh-CN"]) .speech-dialog .auth-tabs { flex-wrap: wrap; }
  html:not([lang="zh-CN"]) .topbar { flex-wrap: wrap; gap: .5rem; }
  html:not([lang="zh-CN"]) .font-preferences { flex-wrap: wrap; }
}
