/* Direction follows the interface; creation content retains its own direction. */
.language-preferences { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; width: min(100%, 29rem); gap: .75rem; }
.language-preferences label { display: flex; flex-direction: column; align-items: stretch; gap: .3rem; min-width: 0; }
.language-preferences label > span { color: var(--ui-muted, #94a3b8); font-size: .7rem; line-height: 1.3; text-align: start; }
.language-preferences .language-select { width: 100%; min-width: 0; max-width: 100%; background: var(--ui-input, #172033); color: var(--ui-text, #f1f5f9); border-color: var(--ui-border, #475569); }
.language-preferences .language-select option { background: var(--ui-input, #172033); color: var(--ui-text, #f1f5f9); }
[dir="rtl"] .pro-header, [dir="rtl"] .history-sidebar, [dir="rtl"] [role="dialog"] { text-align: start; }
[dir="rtl"] .pro-header .justify-self-end { justify-self: end; }
[dir="rtl"] .pro-header .justify-self-start { justify-self: start; }
[dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] [contenteditable] { text-align: start; unicode-bidi: plaintext; }
[dir="rtl"] pre, [dir="rtl"] code, [dir="rtl"] input[type="url"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="number"], [dir="rtl"] video, [dir="rtl"] audio { direction: ltr; }
[dir="rtl"] [data-user-content], [dir="rtl"] [data-i18n-content] { unicode-bidi: plaintext; }
[dir="rtl"] .pro-history-rail { border-right: 0; border-inline-end: 1px solid var(--ui-border, rgba(255,255,255,.06)); }
[dir="rtl"] .pro-user-dropdown, [dir="rtl"] .creation-toolbar-style .project-style-picker { right: auto; left: 0; }
[dir="rtl"] .assistant-markdown ul, [dir="rtl"] .assistant-markdown ol { padding-left: 0; padding-inline-start: 1.35rem; }
[dir="rtl"] .model-picker-submenu { margin-left: 0; margin-inline-start: 10px; padding-left: 0; padding-inline-start: 5px; border-left: 0; border-inline-start: 2px solid var(--ui-border, #3b4257); }
[dir="rtl"] .session-asset-group:not([open]) > summary::before { transform: rotate(135deg); }
[dir="rtl"] #pro-back-to-start > [aria-hidden="true"] { display: inline-block; transform: scaleX(-1); }

/* Shared header controls: account, recharge and creation pages. */
.header-language .language-preferences { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; width: auto; gap: 12px; }
.header-language .language-preferences label { flex-direction: row; align-items: center; gap: 8px; }
.header-language .language-preferences label > span { white-space: nowrap; }
.header-language .language-preferences .language-select { width: auto; max-width: 150px; padding: 7px 10px; font-size: 14px; line-height: 20px; height: 36px; border: 1px solid var(--ui-border, #475569); border-radius: 8px; }
.header-language #speech-language-notice { max-width: 32rem; margin: 4px 0 0; font-size: 10px; text-align: end; }
.header-language #speech-language-notice:empty { display: none; }
@media (max-width: 640px) {
  .header-language .language-preferences label > span { display: none; }
  .header-language .language-preferences { gap: 8px; }
}
