/* darman-yar — Persian-first RTL customizations (served via custom_css).
   Vazirmatn itself is loaded offline through public/theme.json custom_fonts. */

html, body {
  direction: rtl;
}

body {
  font-family: "Vazirmatn", "IRANSansX", "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
  text-align: right;
}

/* Persian paragraphs read naturally right-aligned */
.main, .messages-container, .message-content {
  text-align: right;
}

/* keep LTR islands usable inside the RTL page (code, ids, urls) */
pre, code, kbd, samp, .codeblock {
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
}

a, .language-tag {
  unicode-bidi: plaintext;
}

/* softer look for the processing steps */
.step {
  opacity: 0.92;
}

/* readme/راهنمایی dialog: no raster logo here (it looked bad across themes) —
   just a brand-colored accent under the guide heading, theme-aware via shadcn vars.
   The markdown body renders inside a `.prose` wrapper, not `.markdown`. */
[role="dialog"] .prose h3:first-of-type {
  padding-bottom: .6rem;
  margin-bottom: 1.1rem;
  border-bottom: 2px solid hsl(var(--primary, 175 84% 26%) / 40%);
}

/* On refresh the SPA re-checks the session (/auth/config, /auth/header) and for a
   few hundred ms paints Chainlit's DEFAULT English sign-in screen. Hide that
   screen during the check; auto-reveal after 1.2s so a genuinely expired session
   still reaches the sign-in page instead of a blank screen. */
@keyframes reveal-default-login { to { visibility: visible; } }
#root .grid.min-h-svh.lg\:grid-cols-2 {
  visibility: hidden;
  animation: reveal-default-login 0s 1.2s forwards;
}
