/* RTL overrides — loaded only when the active language is bidi (Persian).
   The base layout is flex/grid based, so most of it flips automatically via
   the <html dir="rtl"> attribute. This file fixes the few hard-coded
   directional bits. */

body { direction: rtl; }

/* Tables hard-code text-align: left in app.css */
table.compact th, table.compact td,
table.programs-table th, table.programs-table td,
table.kv th, table.kv td {
  text-align: right;
}

/* Uppercase + letter-spacing looks wrong on Persian table headers */
table.compact th, table.programs-table th {
  text-transform: none;
  letter-spacing: normal;
}

/* Flash messages keep symmetric margins, fine — but nudge list bullets off */
.flash { padding-right: 0; }

/* Code / monospace blocks stay LTR — code is not RTL text */
code, .code-block, .result,
input[type="email"], input[name="api_key"] {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

/* Keep the brand mark + latin product name reading naturally */
.brand { direction: ltr; unicode-bidi: isolate; }

/* The chat log: user/assistant border accent flips to the right edge */
.chat-user { border-left: none; border-right: 3px solid #5468ff; }
.chat-assistant { border-left: none; border-right: 3px solid #888; }
.chat-system { border-left: none; border-right: 3px solid #d39e00; }

/* Prefer Vazirmatn-style stack first for Persian text */
html[lang="fa"] body {
  font-family: "Vazirmatn", ui-sans-serif, system-ui, "Segoe UI", Tahoma, sans-serif;
}
