/* Palette values come from the shared themes.json catalog, without remote assets. */
.button.primary,.send-button,.nav-item.active em,.attachment-icon { color:var(--on-accent,#fff); }
.message-meta { color:var(--muted); }
.appearance-settings { margin-top:24px;padding-top:22px;border-top:1px solid var(--line); }
.brand-lockup { min-width:0; }
.brand-lockup .brand-mark { flex:0 0 34px; }
.brand-lockup > span:last-child { min-width:0;line-height:1.4; }
.brand-row .brand-lockup { font-size:13px; }
.theme-preview-nav b { font-size:10px;overflow-wrap:normal;line-height:1.5; }
.appearance-settings label small { font-weight:400;line-height:1.65; }
.theme-preview { display:flex;min-height:155px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--bg); }
.theme-preview-nav { display:flex;flex-direction:column;gap:10px;padding:16px;width:100px;border-inline-end:1px solid var(--line);background:var(--surface); }
.theme-preview-nav i { height:8px;border-radius:4px;background:var(--surface-3); }
.theme-preview-nav i:last-child { width:65%;background:var(--accent); }
.theme-preview-chat { display:flex;flex:1;min-width:0;flex-direction:column;gap:10px;padding:16px;align-items:flex-start;justify-content:center; }
.theme-preview-chat > span { max-width:90%;border:1px solid var(--line);padding:9px 12px;border-radius:10px;line-height:1.6;font-size:12px; }
.preview-incoming { background:var(--incoming); }
.theme-preview-chat .preview-outgoing { align-self:flex-end;background:var(--outgoing); }
.theme-preview-swatches { display:flex;gap:6px;align-self:flex-end; }
.theme-preview-swatches i { width:12px;height:12px;border-radius:50%;background:var(--accent); }
.theme-preview-swatches i:nth-child(2) { background:var(--green); }
.theme-preview-swatches i:nth-child(3) { background:var(--danger); }
.theme-preview-swatches i:nth-child(4) { background:var(--text); }
.login-language { position:absolute;z-index:2;inset-inline-end:24px;top:20px;display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted); }
.login-language select { background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:7px 10px;color:var(--text); }
:is(button,a,input,select,textarea):focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
html[data-scheme="light"] .status-ready { color:#236537; }
html[data-scheme="light"] .status-processing { color:#76520a; }
html[data-scheme="light"] .learning-badge { color:#176245!important; }
html[data-scheme="light"] .proposal-badge { color:#78500b!important; }
html[data-scheme="light"] .status-failed { color:var(--danger); }

/* UI direction follows the interface, content follows its own writing system. */
html[lang="fa"] { --font:"Segoe UI",Tahoma,Arial,sans-serif; }
html[lang="fa"] body { line-height:1.65; }
html[lang="fa"] .form-grid label { font-size:12px; }
.profile-card > p,.connection-main header small { direction:ltr;unicode-bidi:isolate; }
html[lang="fa"] :is(h1,h2,h3,h4,.section-heading,.detail-section h4) { letter-spacing:normal; }
.automation-card,.nav-item,.mini-nav button,.chat-row,.brain-card,.brain-card-main,.chat-identity,.copilot-onboarding label,.folder-tree-select,.chat-menu-tag,.chat-context-menu > footer button { text-align:start; }
.nav-sidebar,.chat-column { border-right:0;border-inline-end:1px solid var(--line); }
.mini-nav em,.typing-speed-readout small { margin-left:0;margin-inline-start:auto; }
.folder-tree-row { padding-left:0;padding-inline-start:calc(var(--folder-depth,0) * 13px); }
.native-toggle,.switch { direction:ltr; }
.messages { direction:ltr; }
.message-text,.reply-snippet span,.saved-card p,.draft-page-card p,.experience-row p,.rule-text,.copilot-answer { unicode-bidi:plaintext;text-align:start; }
input:is([type="password"],[type="url"],[type="number"],[type="tel"],[autocomplete="username"]) { direction:ltr;text-align:left; }
:is(input,textarea)[dir="ltr"] { text-align:left; }
:is(input,textarea)[dir="auto"] { text-align:start; }
html[dir="rtl"] .details-drawer { right:auto;left:0;border-left:0;border-right:1px solid var(--line); }
html[dir="rtl"] .toast-stack { right:auto;left:18px; }
html[dir="rtl"] .ai-typing-status { left:auto;right:19px;letter-spacing:normal; }
html[dir="rtl"] .emoji-picker { right:auto;left:0; }
html[dir="rtl"] .send-button > span { transform:scaleX(-1); }
html[dir="rtl"] .chat-row.tinted { box-shadow:inset -3px 0 var(--tone-color); }
html[dir="rtl"] .login-card h1 { line-height:1.5; }
html[dir="rtl"] .card-actions,html[dir="rtl"] .modal-footer { flex-wrap:wrap; }
html[dir="rtl"] .form-grid label { line-height:1.65; }
@media (max-width:1500px) {
  html[dir="rtl"] .copilot-drawer { right:auto;left:0; }
}
@media (max-width:1100px) {
  html[dir="rtl"] .nav-sidebar { left:auto;right:0;transform:translateX(101%); }
  html[dir="rtl"] .nav-sidebar.open { transform:translateX(0); }
}
@media (max-width:760px) {
  .theme-preview-nav { width:72px;padding:12px; }
  .theme-preview-chat { padding:12px; }
  .login-language { top:12px;inset-inline-end:16px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important; }
}
