/* ═══════════════════════════════════════════════════════════════════
   asa-advisor.css — ویجتِ چتِ «مشاورِ پرورشِ آسادارو»
   هویتِ بصری: «ماتریا مدیکا زنده» — کاغذِ گیاه‌شناختی + سرمه‌ای + برنجی
   همهٔ کلاس‌ها/متغیّرها پیشوندِ اختصاصی دارند تا با CSSِ صفحه تداخل نکنند.
   همهٔ سلکتورها با #asa-adv-root پیشونددار شده‌اند تا هم از ریسِتِ داخلی
   و هم از CSSِ قالبِ وردپرس قوی‌تر باشند. بدونِ هیچ وابستگیِ خارجی.
   ═══════════════════════════════════════════════════════════════════ */

/* ── ریشه: متغیّرهای پالت + فونت ─────────────────────────────────── */
#asa-adv-root {
  --advink:    #14261F;
  --advink2:   #141A26;
  --advnavy:   #141A26;
  --advnavy2:  #1B2A4A;
  --advhero:   #0A1220;
  --advpaper:  #ffffff;
  --advpaper2: #ffffff;
  --advgreen:  #2E7D5B;
  --advgreen2: #3FA46A;
  --advgreen3: #7BC49A;
  --advbrass:  #C0A24B;
  --advamber:  #E0A458;
  --advlac:    #C8102E;
  --advtext:   #14201B;
  --advmuted:  #4A4640;
  --adv-font: 'IRANSansX', 'Vazirmatn', Tahoma, sans-serif;
  --adv-shadow: 0 24px 64px -18px rgba(20, 34, 61, .38),
                0 6px  20px -8px  rgba(20, 34, 61, .25);
  /* جهت از خاصیتِ HTMLِ dir می‌آید (fa/ar=rtl، en/ru/tr=ltr)؛ اینجا ثابت نمی‌شود
     تا در زبان‌های LTR به‌درستی برعکس شود — UAهای استاندارد این را از روی
     ویژگیِ dir خودِ عنصر اعمال می‌کنند، پس نیازی به override نیست. */
  font-family: var(--adv-font);
  text-align: start;
}

/* ریسِتِ محدود — فقط box-sizing با specificity بالا؛ margin/padding با
   :where بدونِ وزن، تا سلکتورهای کلاسیِ خودِ ویجت همیشه برنده باشند */
#asa-adv-root,
#asa-adv-root * { box-sizing: border-box; }
:where(#asa-adv-root, #asa-adv-root *) { margin: 0; padding: 0; }

#asa-adv-root button {
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

#asa-adv-root svg { display: block; pointer-events: none; }

#asa-adv-root [hidden] { display: none !important; }

/* ── نقطهٔ سبزِ نبض‌دار (آنلاین) ──────────────────────────────────── */
#asa-adv-root .asa-adv-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--advgreen2);
  position: relative;
  flex: none;
}
#asa-adv-root .asa-adv-dot::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--advgreen2);
  opacity: .7;
  animation: asaAdvPulse 1.9s ease-out infinite;
}
@keyframes asaAdvPulse {
  0%   { transform: scale(.45); opacity: .85; }
  75%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ── لانچرِ شناور (پایین، سمتِ شروع — inset-inline-start در RTL=راست/در LTR=چپ) ─
   نکتهٔ نقصِ ۲: در بارگذاریِ اولیه (پیش از اسکرول) ممکن است هیرو تا پایینِ
   ویوپورت ادامه یابد و CTAِ دومِ هیرو زیرِ لانچر بیفتد. به‌جایِ آفستِ ثابتِ
   بی‌رابطه‌ با ارتفاعِ محتوا (که در یک عرض جواب می‌دهد و در عرضِ دیگر نه)، لانچر
   تا اولین اسکرولِ کاربر محو است (asa-adv-launcher--prehide، توسطِ JS مدیریت
   می‌شود) — همان الگویِ رایجِ ویجت‌هایِ چت که تضمین می‌کند هیچ‌وقت رویِ محتوایِ
   بالایِ صفحه ننشیند، در هر عرض/ارتفاعِ صفحه. */
#asa-adv-root .asa-adv-launcher {
  position: fixed;
  bottom: 22px; inset-inline-start: 22px;
  z-index: 99998;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--advnavy) 0%, var(--advnavy2) 100%);
  color: var(--advpaper);
  border: 1px solid rgba(192, 162, 75, .55);
  box-shadow: 0 10px 30px -8px rgba(20, 34, 61, .5);
  font-size: 14px; font-weight: 600; line-height: 1;
  opacity: 1; visibility: visible;
  transition: transform .25s ease, box-shadow .25s ease,
              opacity .3s ease, visibility 0s linear;
  -webkit-tap-highlight-color: transparent;
}
#asa-adv-root .asa-adv-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px -10px rgba(20, 34, 61, .6);
}
/* حالتِ پیش‌ازاسکرول: کاملاً غیرفعال (هم بصری هم تعاملی/تب) تا با CTAِ هیرو
   تداخل نکند؛ به‌محضِ اسکرولِ کاربر (یا اگر صفحه اصلاً اسکرول‌شدنی نباشد) JS
   این کلاس را برمی‌دارد. */
#asa-adv-root .asa-adv-launcher.asa-adv-launcher--prehide {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
#asa-adv-root .asa-adv-launcher:focus-visible {
  outline: 2px solid var(--advbrass);
  outline-offset: 3px;
}
#asa-adv-root .asa-adv-launcher-icon {
  width: 24px; height: 24px;
  color: var(--advgreen3);
  flex: none;
}
#asa-adv-root .asa-adv-launcher-icon svg { width: 100%; height: 100%; }
#asa-adv-root .asa-adv-launcher-label { padding-top: 1px; }

/* ── پنلِ گفتگو ───────────────────────────────────────────────────── */
#asa-adv-root .asa-adv-panel {
  position: fixed;
  bottom: 92px; inset-inline-start: 22px;
  z-index: 99999;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  background: var(--advpaper);
  border: 1px solid rgba(20, 38, 31, .08);
  border-radius: 18px;
  box-shadow: var(--adv-shadow);
  overflow: hidden;
  /* حالتِ بسته: نامرئی ولی آمادهٔ ترنزیشن (visibility با تأخیر تا انیمیشنِ
     محوشدن کامل شود). سختگیریِ اضافه پایین‌تر: بعد از پایانِ انیمیشن، JS
     کلاسِ asa-adv-panel--closed را اضافه می‌کند تا display:none هم بگیرد —
     یعنی پنلِ بسته هیچ هندسه‌ای (even fixed) به لِی‌اوت تحمیل نکند. */
  opacity: 0; visibility: hidden;
  transform: translateY(16px) scale(.97);
  transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
}
#asa-adv-root.asa-adv-open .asa-adv-panel {
  opacity: 1; visibility: visible;
  transform: none;
  transition: opacity .28s ease, transform .28s ease, visibility 0s;
}
/* بعد از پایانِ کاملِ انیمیشنِ بسته‌شدن (JS این کلاس را اضافه می‌کند): کاملاً
   بیرون از لِی‌اوت. حذف می‌شود همان لحظه‌ای که asa-adv-open اضافه می‌شود، پیش
   از شروعِ ترنزیشنِ باز شدن، تا انیمیشن سالم بماند. */
#asa-adv-root .asa-adv-panel.asa-adv-panel--closed {
  display: none;
}

/* ── هدرِ سرمه‌ای ─────────────────────────────────────────────────── */
#asa-adv-root .asa-adv-header {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  background: linear-gradient(135deg, var(--advnavy) 0%, var(--advnavy2) 100%);
  color: var(--advpaper);
  flex: none;
}
#asa-adv-root .asa-adv-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(246, 243, 234, .1);
  border: 1px solid rgba(192, 162, 75, .55);
  display: flex; align-items: center; justify-content: center;
  color: var(--advgreen3);
  position: relative;
  flex: none;
}
#asa-adv-root .asa-adv-avatar svg { width: 20px; height: 20px; }
/* نقطهٔ آنلاین روی آواتار */
#asa-adv-root .asa-adv-avatar::after {
  content: '';
  position: absolute;
  bottom: -1px; left: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--advgreen2);
  border: 2px solid var(--advnavy2);
}
#asa-adv-root .asa-adv-header-txt { flex: 1; min-width: 0; }
#asa-adv-root .asa-adv-title {
  display: block;
  font-size: 14.5px; font-weight: 700;
  color: var(--advpaper);
  line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#asa-adv-root .asa-adv-subtitle {
  display: block;
  direction: ltr; text-align: start;
  font-style: italic;
  font-size: 10px;
  letter-spacing: .08em;
  color: rgba(246, 243, 234, .62);
  line-height: 1.4;
}
#asa-adv-root .asa-adv-close {
  width: auto; min-width: 40px; height: 36px;
  margin-inline-start: auto;
  padding: 0 10px;
  gap: 5px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #14223D;
  background: #ffffff;
  border: 2px solid #14223D;
  font-size: 13px; font-weight: 700; line-height: 1;
  position: relative; z-index: 3;
  flex: none; flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(20, 34, 61, .25);
  transition: background .2s ease, color .2s ease;
}
#asa-adv-root .asa-adv-close:hover { background: #F0F2F6; color: #0B1220; }
#asa-adv-root .asa-adv-close:focus-visible { outline: 2px solid var(--advbrass); outline-offset: 2px; }
#asa-adv-root .asa-adv-close svg {
  width: 18px; height: 18px; flex: none;
  stroke: #14223D; color: #14223D;
  stroke-width: 2.4;
}
#asa-adv-root .asa-adv-close-txt { color: #14223D; white-space: nowrap; padding-top: 1px; }

/* خطِ برنجیِ باریکِ زیرِ هدر */
#asa-adv-root .asa-adv-hairline {
  height: 2px; flex: none;
  background: linear-gradient(90deg, transparent 0%, var(--advbrass) 30%, var(--advamber) 50%, var(--advbrass) 70%, transparent 100%);
}

/* ── ناحیهٔ پیام‌ها + واترمارکِ گیاهیِ کم‌رنگ ─────────────────────── */
#asa-adv-root .asa-adv-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  background-color: var(--advpaper);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E7D5B' stroke-opacity='0.07' stroke-width='0.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 4c-9 .5-14 5.5-14 12 0 1.7.3 3 1 4'/%3E%3Cpath d='M20 4c.5 9-4.5 14-11 14'/%3E%3Cpath d='M20 4 7 17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center 55%;
  background-size: 240px;
  scrollbar-width: thin;
  scrollbar-color: rgba(192, 162, 75, .45) transparent;
}
#asa-adv-root .asa-adv-messages::-webkit-scrollbar { width: 6px; }
#asa-adv-root .asa-adv-messages::-webkit-scrollbar-track { background: transparent; }
#asa-adv-root .asa-adv-messages::-webkit-scrollbar-thumb {
  background: rgba(192, 162, 75, .45);
  border-radius: 3px;
}

/* ── حباب‌های پیام ────────────────────────────────────────────────── */
#asa-adv-root .asa-adv-msg {
  max-width: 84%;
  display: flex; flex-direction: column;
}
/* در RTL: flex-start = راست (مشاور)، flex-end = چپ (کاربر) */
#asa-adv-root .asa-adv-msg-b { align-self: flex-start; }
#asa-adv-root .asa-adv-msg-u { align-self: flex-end; }

#asa-adv-root .asa-adv-bubble {
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.9;
  word-break: break-word;
  /* حفظِ خطوطِ جدیدِ پاسخ — متن با textContent درج می‌شود (ایمن از XSS) */
  white-space: pre-line;
}
/* کارتِ کاغذیِ مشاور با حاشیهٔ برنجیِ سمتِ شروع (راست در RTL، چپ در LTR) —
   خاصیت‌هایِ منطقی تا در en/ru/tr درست برعکس شود، نه فقط در fa/ar درست بماند */
#asa-adv-root .asa-adv-msg-b .asa-adv-bubble {
  background: var(--advpaper2);
  color: var(--advtext);
  border: 1px solid rgba(192, 162, 75, .35);
  border-inline-start: 3px solid var(--advbrass);
  border-start-start-radius: 5px;
  border-start-end-radius: 16px;
  border-end-start-radius: 16px;
  border-end-end-radius: 16px;
  box-shadow: 0 2px 8px -3px rgba(20, 38, 31, .12);
}
/* حبابِ سبزِ کاربر */
#asa-adv-root .asa-adv-msg-u .asa-adv-bubble {
  background: linear-gradient(135deg, var(--advgreen) 0%, #235F46 100%);
  color: #F3F7F0;
  border-start-start-radius: 16px;
  border-start-end-radius: 16px;
  border-end-start-radius: 16px;
  border-end-end-radius: 5px;
  box-shadow: 0 2px 8px -3px rgba(46, 125, 91, .35);
}
/* پیامِ خطا (سرویس در دسترس نیست و …) */
#asa-adv-root .asa-adv-msg-err .asa-adv-bubble {
  background: #FBF1F0;
  color: #7A1F2B;
  border-color: rgba(200, 16, 46, .25);
  border-inline-start-color: var(--advlac);
}
/* تصویرِ ضمیمه داخلِ حباب */
#asa-adv-root .asa-adv-bubble img {
  display: block;
  width: 180px; max-width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(20, 38, 31, .15);
  margin-bottom: 6px;
}
/* ساعتِ پیام (اعدادِ فارسی) */
#asa-adv-root .asa-adv-time {
  font-size: 10px;
  color: var(--advmuted);
  opacity: .75;
  margin-top: 3px;
  line-height: 1.4;
}
#asa-adv-root .asa-adv-msg-b .asa-adv-time { text-align: start; }
#asa-adv-root .asa-adv-msg-u .asa-adv-time { text-align: end; }

/* ── نشانگرِ «در حالِ نوشتن…» ────────────────────────────────────── */
#asa-adv-root .asa-adv-typing {
  align-self: flex-start;
  display: flex; align-items: center; gap: 5px;
  background: var(--advpaper2);
  border: 1px solid rgba(192, 162, 75, .35);
  border-inline-start: 3px solid var(--advbrass);
  border-start-start-radius: 5px;
  border-start-end-radius: 16px;
  border-end-start-radius: 16px;
  border-end-end-radius: 16px;
  padding: 13px 16px;
}
#asa-adv-root .asa-adv-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--advmuted);
  opacity: .4;
  animation: asaAdvBlink 1.2s infinite ease-in-out;
}
#asa-adv-root .asa-adv-typing span:nth-child(2) { animation-delay: .18s; }
#asa-adv-root .asa-adv-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes asaAdvBlink {
  0%, 80%, 100% { transform: translateY(0);    opacity: .35; }
  40%           { transform: translateY(-4px); opacity: .9; }
}

/* ── پیش‌نمایشِ تصویرِ انتخاب‌شده (بالای ورودی) ───────────────────── */
#asa-adv-root .asa-adv-attach-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: rgba(46, 125, 91, .07);
  border-top: 1px solid rgba(46, 125, 91, .18);
  flex: none;
}
#asa-adv-root .asa-adv-attach-preview img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(192, 162, 75, .55);
  flex: none;
}
#asa-adv-root .asa-adv-preview-name {
  flex: 1; min-width: 0;
  font-size: 11.5px;
  color: var(--advmuted);
  direction: ltr; text-align: start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#asa-adv-root .asa-adv-preview-remove {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--advlac);
  transition: background .2s ease;
  flex: none;
}
#asa-adv-root .asa-adv-preview-remove:hover { background: rgba(200, 16, 46, .1); }
#asa-adv-root .asa-adv-preview-remove svg { width: 15px; height: 15px; }

/* ── راهنمای گذرا (مثلاً «حجمِ تصویر زیاد است») ──────────────────── */
#asa-adv-root .asa-adv-hint {
  font-size: 11.5px;
  color: var(--advlac);
  padding: 6px 16px 0;
  background: var(--advpaper2);
  flex: none;
}

/* ── نوارِ ورودی ─────────────────────────────────────────────────── */
#asa-adv-root .asa-adv-inputbar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px 6px;
  background: var(--advpaper2);
  border-top: 1px solid rgba(20, 38, 31, .08);
  flex: none;
}
#asa-adv-root .asa-adv-input {
  flex: 1;
  min-height: 40px; max-height: 120px;
  padding: 9px 12px;
  border: 1px solid rgba(20, 38, 31, .16);
  border-radius: 12px;
  background: #fff;
  color: var(--advtext);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  resize: none;
  overflow-y: auto;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#asa-adv-root .asa-adv-input::placeholder { color: var(--advmuted); opacity: .65; }
#asa-adv-root .asa-adv-input:focus {
  outline: none;
  border-color: var(--advgreen);
  box-shadow: 0 0 0 3px rgba(46, 125, 91, .13);
}
#asa-adv-root .asa-adv-input:disabled { opacity: .55; }

#asa-adv-root .asa-adv-attach,
#asa-adv-root .asa-adv-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
#asa-adv-root .asa-adv-attach { color: var(--advmuted); }
#asa-adv-root .asa-adv-attach:hover { color: var(--advgreen); background: rgba(46, 125, 91, .09); }
#asa-adv-root .asa-adv-send {
  background: var(--advlac);
  color: var(--advpaper);
  box-shadow: 0 3px 10px -3px rgba(200, 16, 46, .55);
}
#asa-adv-root .asa-adv-send:hover { background: #A50D26; transform: translateY(-1px); }
#asa-adv-root .asa-adv-send:disabled,
#asa-adv-root .asa-adv-attach:disabled {
  opacity: .45; cursor: default;
  transform: none;
}
#asa-adv-root .asa-adv-attach svg,
#asa-adv-root .asa-adv-send svg { width: 19px; height: 19px; }
#asa-adv-root .asa-adv-attach:focus-visible,
#asa-adv-root .asa-adv-send:focus-visible { outline: 2px solid var(--advbrass); outline-offset: 2px; }

/* ── لینکِ ظریفِ فرمِ لید ─────────────────────────────────────────── */
#asa-adv-root .asa-adv-lead-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  padding: 7px 10px 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--advpaper2);
  color: var(--advgreen);
  font-size: 12.5px; font-weight: 500;
  flex: none;
  transition: color .2s ease;
}
#asa-adv-root .asa-adv-lead-link:hover { color: var(--advnavy2); text-decoration: underline; }
#asa-adv-root .asa-adv-lead-link:focus-visible { outline: 2px solid var(--advbrass); outline-offset: -2px; }
#asa-adv-root .asa-adv-lead-link svg { width: 14px; height: 14px; flex: none; }

/* ── فرمِ لید (کارتِ شناور داخلِ پنل) ─────────────────────────────── */
#asa-adv-root .asa-adv-lead-overlay {
  position: absolute; inset: 0;
  z-index: 5;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 34, 61, .4);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  padding: 16px;
}
#asa-adv-root .asa-adv-lead-card {
  width: 100%;
  background: var(--advpaper2);
  border-radius: 16px;
  border-top: 3px solid var(--advbrass);
  box-shadow: 0 18px 44px -12px rgba(20, 34, 61, .5);
  padding: 18px 16px;
  animation: asaAdvSlideUp .3s ease;
}
@keyframes asaAdvSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: none;             opacity: 1; }
}
#asa-adv-root .asa-adv-lead-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
#asa-adv-root .asa-adv-lead-head strong {
  font-size: 14.5px; font-weight: 700;
  color: var(--advnavy2);
}
#asa-adv-root .asa-adv-lead-close {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--advmuted);
  transition: background .2s ease;
}
#asa-adv-root .asa-adv-lead-close:hover { background: rgba(20, 38, 31, .07); }
#asa-adv-root .asa-adv-lead-close svg { width: 15px; height: 15px; }
#asa-adv-root .asa-adv-lead-hint {
  font-size: 12px;
  color: var(--advmuted);
  line-height: 1.8;
  margin-bottom: 12px;
}
#asa-adv-root .asa-adv-field { display: block; margin-bottom: 10px; }
#asa-adv-root .asa-adv-field > span {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--advink);
  margin-bottom: 5px;
}
#asa-adv-root .asa-adv-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(20, 38, 31, .16);
  border-radius: 10px;
  background: #fff;
  color: var(--advtext);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#asa-adv-root .asa-adv-field input:focus {
  outline: none;
  border-color: var(--advgreen);
  box-shadow: 0 0 0 3px rgba(46, 125, 91, .13);
}
#asa-adv-root .asa-adv-field input[dir="ltr"] { text-align: left; }
#asa-adv-root .asa-adv-lead-error {
  font-size: 12px;
  color: var(--advlac);
  line-height: 1.7;
  margin: 2px 0 8px;
}
#asa-adv-root .asa-adv-lead-submit {
  width: 100%;
  padding: 11px;
  border-radius: 999px;
  background: var(--advlac);
  color: var(--advpaper);
  font-size: 13.5px; font-weight: 700;
  box-shadow: 0 4px 14px -4px rgba(46, 125, 91, .55);
  transition: background .2s ease, transform .15s ease;
}
#asa-adv-root .asa-adv-lead-submit:hover { background: #A50D26; transform: translateY(-1px); }
#asa-adv-root .asa-adv-lead-submit:disabled { opacity: .55; cursor: default; transform: none; }
#asa-adv-root #asa-adv-auth-form .asa-adv-lead-submit + .asa-adv-lead-submit {
  margin-top: 8px;
  background: var(--advnavy2);
  box-shadow: 0 4px 14px -4px rgba(20, 34, 61, .45);
}
#asa-adv-root #asa-adv-auth-form .asa-adv-lead-submit + .asa-adv-lead-submit:hover {
  background: var(--advnavy);
}
/* کارتِ موفقیت */
#asa-adv-root .asa-adv-lead-success { text-align: center; }
#asa-adv-root .asa-adv-lead-success-icon {
  width: 46px; height: 46px;
  margin: 4px auto 10px;
  border-radius: 50%;
  background: rgba(46, 125, 91, .12);
  border: 1px solid rgba(46, 125, 91, .35);
  display: flex; align-items: center; justify-content: center;
  color: var(--advgreen);
}
#asa-adv-root .asa-adv-lead-success-icon svg { width: 22px; height: 22px; }
#asa-adv-root .asa-adv-lead-success strong {
  display: block;
  font-size: 14.5px;
  color: var(--advnavy2);
  margin-bottom: 4px;
}
#asa-adv-root .asa-adv-lead-success p {
  font-size: 12.5px;
  color: var(--advmuted);
  line-height: 1.9;
  margin-bottom: 12px;
}
#asa-adv-root .asa-adv-lead-success-close {
  padding: 8px 22px;
  border-radius: 999px;
  border: 1px solid rgba(46, 125, 91, .45);
  color: var(--advgreen);
  font-size: 12.5px; font-weight: 600;
  transition: background .2s ease, color .2s ease;
}
#asa-adv-root .asa-adv-lead-success-close:hover { background: var(--advgreen); color: var(--advpaper); }

/* ── موبایل: تقریباً تمام‌صفحه ────────────────────────────────────── */
@media (max-width: 480px) {
  #asa-adv-root .asa-adv-panel {
    inset-inline-start: 0; inset-inline-end: 0; bottom: 0;
    width: 100%; max-width: none;
    height: 94vh; height: 94dvh;
    max-height: none;
    border-radius: 20px 20px 0 0;
  }
  /* وقتی پنل باز است، لانچر زیرش پنهان شود */
  #asa-adv-root.asa-adv-open .asa-adv-launcher {
    opacity: 0; visibility: hidden;
  }
  #asa-adv-root .asa-adv-close {
    min-width: 44px; min-height: 44px; height: 44px;
    padding: 0 12px;
  }
}

/* ── رندرِ Markdownِ پاسخِ مشاور ──────────────────────────────────── */
#asa-adv-root .asa-adv-md { white-space: normal; line-height: 1.85; }
#asa-adv-root .asa-adv-md > div { margin: 0; }
#asa-adv-root .asa-adv-md .asa-adv-sp { height: 7px; }
#asa-adv-root .asa-adv-md .asa-adv-h {
  font-weight: 800; color: var(--advnavy2);
  font-size: 13.5px; margin: 9px 0 3px; line-height: 1.5;
}
#asa-adv-root .asa-adv-md .asa-adv-h:first-child { margin-top: 0; }
#asa-adv-root .asa-adv-md strong { font-weight: 700; color: var(--advnavy2); }
#asa-adv-root .asa-adv-md code {
  font-family: Menlo, Consolas, monospace; font-size: .9em;
  background: rgba(46, 125, 91, .1); padding: 1px 5px; border-radius: 4px;
}
#asa-adv-root .asa-adv-md hr { border: 0; border-top: 1px solid rgba(192, 162, 75, .4); margin: 9px 0; }
#asa-adv-root .asa-adv-md .asa-adv-li { position: relative; padding-inline-start: 15px; margin: 2px 0; }
#asa-adv-root .asa-adv-md .asa-adv-li::before {
  content: '•'; position: absolute; inset-inline-start: 2px; color: var(--advgreen); font-weight: 700;
}
#asa-adv-root .asa-adv-md .asa-adv-li-n { padding-inline-start: 2px; }
#asa-adv-root .asa-adv-md .asa-adv-li-n::before { content: none; }
#asa-adv-root .asa-adv-md .asa-adv-q {
  border-inline-start: 3px solid var(--advbrass);
  padding-inline-start: 9px; margin: 5px 0; color: var(--advmuted);
}
#asa-adv-root .asa-adv-md .asa-adv-tw { overflow-x: auto; margin: 8px 0; }
#asa-adv-root .asa-adv-md .asa-adv-tbl {
  border-collapse: collapse; font-size: 12px; min-width: 100%; background: #fff;
}
#asa-adv-root .asa-adv-md .asa-adv-tbl th,
#asa-adv-root .asa-adv-md .asa-adv-tbl td {
  border: 1px solid rgba(20, 38, 31, .14); padding: 5px 8px; text-align: start; white-space: nowrap;
}
#asa-adv-root .asa-adv-md .asa-adv-tbl thead th {
  background: rgba(46, 125, 91, .1); color: var(--advnavy2); font-weight: 700;
}

#asa-adv-root a.asa-adv-phone-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; margin-top: 8px;
}
#asa-adv-root a.asa-adv-phone-cta svg { width: 16px; height: 16px; }
#asa-adv-root .asa-adv-auth-page {
  display: block; text-align: center; margin-top: 10px;
  font-size: 12.5px; color: var(--advgreen); text-decoration: none;
}
#asa-adv-root .asa-adv-auth-page:hover { text-decoration: underline; }

/* ── احترام به کاهشِ حرکت ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #asa-adv-root *,
  #asa-adv-root *::before,
  #asa-adv-root *::after {
    animation: none !important;
    transition: none !important;
  }
}
