/* PolChat — فارسی و راست‌چین */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');
html[lang="fa"], html[lang="fa-IR"] { direction: rtl; }
html[lang^="fa"] body, html[lang^="fa"] button, html[lang^="fa"] input, html[lang^="fa"] textarea {
  font-family: Vazirmatn, Tahoma, sans-serif !important;
}
/* تشخیص خودکار جهت هر پاراگراف پیام */
.markdown p, .markdown li, .markdown h1, .markdown h2, .markdown h3, textarea { unicode-bidi: plaintext; text-align: start; }
/* کد، فرمول و نمودار همیشه چپ‌چین */
pre, code, .katex, .mermaid { direction: ltr !important; text-align: left !important; unicode-bidi: isolate; }
/* پنهان کردن لینک‌ها و نشانه‌های هسته */
a[href*="librechat"], a[href*="github.com/danny-avila"], a[href*="litellm"] { display: none !important; }
/* پیام خوشامد: کلمه‌به‌کلمه */
.split-parent { direction: rtl; unicode-bidi: plaintext; letter-spacing: 0 !important; }
.pc-word { display: inline-block; opacity: 0; animation: pcWord .45s ease-out forwards; }
@keyframes pcWord { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pc-word { animation: none; opacity: 1; } }
/* دکمه‌های افزوده */
.pc-btn { display:block; margin-top:12px; padding:10px; text-align:center; border:1px solid #16B8A6; color:#16B8A6; border-radius:10px; text-decoration:none; font-weight:600; }
.pc-btn:hover { background: rgba(22,184,166,.08); }
.pc-wallet { position:fixed; bottom:16px; left:16px; z-index:50; padding:8px 14px; border-radius:99px; background:#16B8A6; color:#fff !important; font-size:13px; font-weight:600; text-decoration:none; box-shadow:0 2px 10px rgba(0,0,0,.2); }

/* ===== حالت ساده ===== */
.pc-mode { position:fixed; bottom:16px; left:112px; z-index:50; padding:8px 14px; border-radius:99px; border:1px solid #16B8A6; background:transparent; color:#16B8A6; font:600 13px Vazirmatn,Tahoma,sans-serif; cursor:pointer; }
.pc-mode:hover { background:rgba(22,184,166,.08); }
html.pc-simple [data-testid="model-selector-button"],
html.pc-simple [data-testid="parameters-button"],
html.pc-simple [data-testid="bookmark-menu"],
html.pc-simple [data-testid="token-usage"],
html.pc-simple [data-testid="tools-menu-run-code"],
html.pc-simple [data-testid="tools-menu-skills"],
html.pc-simple [data-testid="tools-menu-memory"],
html.pc-simple [data-testid="code-approval-mode"],
html.pc-simple [data-testid^="code-workspace"],
html.pc-simple [data-testid="nav-agents-marketplace-button"],
html.pc-simple [data-testid="composer-context-rail"] { display:none !important; }
.pc-admin-link { left:230px; text-decoration:none; }

/* ===== اصلاحات راست‌به‌چپ (نسخه ۲) ===== */
html[dir="rtl"], html[lang^="fa"] { direction: rtl; }
/* پیام خوشامد: یک پاراگراف مستقل راست‌به‌چپ تا ترتیب کلمات درست باشد */
.split-parent { display: inline-block !important; direction: rtl !important; unicode-bidi: isolate !important; text-align: center !important; }
.pc-word { unicode-bidi: normal; }
/* کادر پیام و همه‌ی ورودی‌ها: راست‌چین، متن انگلیسی خودکار چپ‌چین */
html[dir="rtl"] textarea, html[lang^="fa"] textarea,
html[dir="rtl"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[lang^="fa"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  direction: rtl; text-align: start; unicode-bidi: plaintext;
}
html[dir="rtl"] textarea::placeholder, html[dir="rtl"] input::placeholder,
html[lang^="fa"] textarea::placeholder, html[lang^="fa"] input::placeholder { direction: rtl; text-align: right; }
/* پیام‌ها، منوها، دیالوگ‌ها و تنظیمات */
html[lang^="fa"] .markdown, html[lang^="fa"] [role="menu"], html[lang^="fa"] [role="dialog"],
html[lang^="fa"] [role="listbox"], html[lang^="fa"] nav { direction: rtl; }
html[lang^="fa"] .markdown :is(p, li, h1, h2, h3, h4, h5, h6, blockquote, td, th) { unicode-bidi: plaintext; text-align: start; }
html[lang^="fa"] .markdown :is(ul, ol) { padding-inline-start: 1.5em; padding-left: 0; }
/* آیکن‌های جهت‌دار در راست‌به‌چپ برعکس شوند */
html[dir="rtl"] :is(.lucide-chevron-right, .lucide-chevron-left, .lucide-chevrons-right, .lucide-chevrons-left,
  .lucide-arrow-right, .lucide-arrow-left, .lucide-corner-down-left, .lucide-corner-down-right,
  .lucide-panel-left, .lucide-panel-right, .lucide-panel-left-close, .lucide-panel-left-open,
  .lucide-log-out, .lucide-undo, .lucide-redo, .lucide-reply, .lucide-share, .lucide-list-indent-increase, .lucide-list-indent-decrease),
html[lang^="fa"] :is(.lucide-chevron-right, .lucide-chevron-left, .lucide-chevrons-right, .lucide-chevrons-left,
  .lucide-arrow-right, .lucide-arrow-left, .lucide-panel-left, .lucide-panel-right, .lucide-panel-left-close, .lucide-panel-left-open, .lucide-log-out) {
  transform: scaleX(-1);
}
/* کد، فرمول، نمودار، مسیر فایل و ایمیل همیشه چپ‌به‌راست */
pre, code, kbd, samp, .katex, .katex-display, .mermaid, [class*="language-"],
input[type="email"], input[type="url"], input[type="password"], input[type="tel"], input[type="number"] {
  direction: ltr !important; text-align: left !important; unicode-bidi: isolate;
}
input[type="email"]::placeholder, input[type="url"]::placeholder, input[type="password"]::placeholder, input[type="tel"]::placeholder { text-align: right; direction: rtl; }

/* ===== کلیدهای دوحالته (Switch) در راست‌به‌چپ =====
   کلید در حالت LTR چیده و سپس آینه می‌شود: خاموش = راست، روشن = چپ */
html[dir="rtl"] [role="switch"], html[lang^="fa"] [role="switch"] {
  direction: ltr !important;
  transform: scaleX(-1);
}
html[dir="rtl"] [role="switch"] > *, html[lang^="fa"] [role="switch"] > * { direction: ltr !important; }
/* چک‌باکس‌ها و اسلایدرها */
html[dir="rtl"] [role="slider"], html[dir="rtl"] input[type="range"] { direction: ltr; }
