/* ===== لوکسی — دستیار هوشمند سُها — دکمه شناور + بنر + پنجره چت =====
   فقط از متغیرهای :root در style.css (--navy, --mustard, --gold-cream, ...) و فونت
   Vazirmatn استفاده می‌کند؛ رنگ/فونت تازه‌ای تعریف نشده. بدون CDN (CSP: 'self').
   شفاف‌ها با color-mix روی همان متغیرها ساخته می‌شوند؛ خط قبلِ هر color-mix
   مقدار یکدست جایگزین برای مرورگرهای قدیمی است. */

.soha-ai {
  position: relative;
  z-index: 160;
  font-family: var(--font-main);
  direction: rtl;
  color: var(--ink);
}
.soha-ai *, .soha-ai *::before, .soha-ai *::after { box-sizing: border-box; }
.soha-ai button, .soha-ai textarea { font-family: inherit; }

/* ---------- اسکله دکمه شناور (سمت چپ، چون سایت RTL است) ---------- */
.soha-ai-fab-dock {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 160;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
  transition: opacity 0.28s ease, transform 0.28s ease;
  will-change: transform, opacity;
}
.soha-ai-fab-dock.soha-ai-fab-dock--compact {
  gap: 0;
}
.soha-ai-fab-dock.soha-ai-fab-dock--banner-hide {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(calc(-100% - 24px), 0, 0);
}
.soha-ai.is-open .soha-ai-fab-dock {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(calc(-100% - 24px), 0, 0);
}

.soha-ai-fab {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid var(--gold-cream);
  border-radius: 50%;
  background: var(--navy);
  color: var(--navy);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 28px -10px var(--navy), inset 0 1px 0 var(--white);
  transition: box-shadow 0.22s ease, opacity 0.22s ease;
  -webkit-tap-highlight-color: transparent;
  /* انیمیشن آماده — نفس کشیدن */
  animation: sohaFabBreathe 3s ease-in-out infinite;
  will-change: transform;
}
.soha-ai-fab.soha-ai-fab--stopped { animation: none; }
.soha-ai-fab:hover { box-shadow: 0 16px 32px -10px var(--navy); }
.soha-ai-fab:active { transform: scale(0.95); }
.soha-ai-fab:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }
.soha-ai-fab img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.soha-ai-fab::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid var(--mustard);
  opacity: 0;
  pointer-events: none;
  animation: sohaAiPulse 3.2s ease-out infinite;
}
.soha-ai.is-open .soha-ai-fab::after { animation: none; }

@keyframes sohaFabBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes sohaAiPulse {
  0% { opacity: 0.55; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.35); }
}

/* برچسب شیشه‌ای — ۵ ثانیه اول، بعد نرم جمع می‌شود */
.soha-ai-fab-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 120px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold-cream);
  background: var(--white);
  background: color-mix(in srgb, var(--white) 72%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 20px -14px var(--navy), inset 0 1px 0 var(--white);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  transform: translateX(0) scale(1);
  transition:
    max-width 0.4s ease,
    opacity 0.35s ease,
    padding 0.35s ease,
    border-width 0.35s ease,
    transform 0.35s ease;
}
.soha-ai-fab-tag.soha-ai-fab-tag--collapsed {
  max-width: 0;
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
  border-width: 0;
  transform: translateX(-6px) scale(0.85);
}

.soha-ai-sparkle {
  display: inline-block;
  color: var(--mustard-text);
  animation: sohaSparklePulse 4s ease-in-out infinite;
  transform-origin: center;
  will-change: opacity, transform;
}
@keyframes sohaSparklePulse {
  0%, 70%, 100% { opacity: 0.35; transform: scale(0.85); }
  85% { opacity: 1; transform: scale(1.15); }
}

/* بادکنک راهنمای اولین بازدید */
.soha-ai-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: min(260px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--gold-cream);
  background: var(--white);
  background: color-mix(in srgb, var(--white) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.75;
  box-shadow: 0 16px 36px -18px var(--navy), inset 0 1px 0 var(--white);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 3;
}
.soha-ai-tip::after {
  content: '';
  position: absolute;
  left: 22px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 1px solid var(--gold-cream);
  border-bottom: 1px solid var(--gold-cream);
  transform: rotate(45deg);
  background: var(--white);
  background: color-mix(in srgb, var(--white) 88%, transparent);
}
.soha-ai-tip.soha-ai-tip--visible {
  opacity: 1;
  transform: none;
}
.soha-ai-tip[hidden] { display: none !important; }

/* روی صفحه محصول موبایل/تبلت، نوار ثابت «افزودن به سبد» پایین است؛ دکمه بالاتر می‌نشیند */
@media (max-width: 899px) {
  body:has(.sticky-cart-bar:not([hidden])) .soha-ai-fab-dock {
    bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- پنجره چت (انیمیشن آماده soha-ai-chatwindow) ---------- */
.soha-ai-panel.soha-ai-chatwindow {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 260;
  width: 392px;
  max-width: calc(100vw - 32px);
  height: min(660px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--gold-cream);
  background: var(--gold-cream-soft);
  background: linear-gradient(170deg,
    color-mix(in srgb, var(--white) 90%, transparent),
    color-mix(in srgb, var(--gold-cream-soft) 88%, transparent));
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: 0 28px 60px -20px var(--navy), inset 0 1px 0 var(--white);
  /* انیمیشن آماده */
  transform: scale(0.85);
  opacity: 0;
  transform-origin: bottom left;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  pointer-events: none;
  visibility: hidden;
}
.soha-ai-panel.soha-ai-chatwindow.soha-ai-chatwindow--open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.soha-ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  border-bottom: 2px solid var(--mustard);
  color: var(--white);
}
.soha-ai-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--mustard), var(--gold-cream));
  color: var(--navy);
  border: 1px solid var(--gold-cream);
}
.soha-ai-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.soha-ai-title { flex: 1; min-width: 0; line-height: 1.35; }
.soha-ai-title strong { display: block; font-size: 0.98rem; font-weight: 800; }
.soha-ai-title span { display: block; font-size: 0.72rem; color: var(--gold-cream); }
.soha-ai-iconbtn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s ease;
}
.soha-ai-iconbtn:hover { background: var(--navy-soft); }
.soha-ai-iconbtn:focus-visible { outline: 2px solid var(--mustard); }

/* ---------- گفتگو ---------- */
.soha-ai-msgs {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.soha-ai-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: sohaAiIn 0.28s ease both;
}
.soha-ai-msg.is-user {
  align-self: flex-start; /* RTL: سمت راست */
  background: linear-gradient(160deg, var(--navy-soft), var(--navy));
  color: var(--white);
  border-bottom-right-radius: 5px;
}
.soha-ai-msg.is-bot {
  align-self: flex-end; /* RTL: سمت چپ */
  background: var(--white);
  background: color-mix(in srgb, var(--white) 92%, transparent);
  border: 1px solid var(--gold-cream);
  border-bottom-left-radius: 5px;
  box-shadow: 0 6px 16px -12px var(--navy);
}
.soha-ai-msg.is-error {
  border-color: var(--discount);
  color: var(--discount);
}

@keyframes sohaAiIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.soha-ai-typing {
  align-self: flex-end;
  display: inline-flex;
  gap: 5px;
  padding: 13px 16px;
  border-radius: 18px;
  border: 1px solid var(--gold-cream);
  border-bottom-left-radius: 5px;
  background: var(--white);
  background: color-mix(in srgb, var(--white) 92%, transparent);
}
.soha-ai-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mustard-text);
  animation: sohaAiDot 1.1s ease-in-out infinite;
}
.soha-ai-typing i:nth-child(2) { animation-delay: 0.16s; }
.soha-ai-typing i:nth-child(3) { animation-delay: 0.32s; }
@keyframes sohaAiDot {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.45; }
  35% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- کارت محصول داخل چت ---------- */
.soha-ai-cards {
  align-self: flex-end;
  width: 92%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.soha-ai-pcard {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--gold-cream);
  background: var(--white);
  background: color-mix(in srgb, var(--white) 94%, transparent);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 18px -14px var(--navy);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: sohaAiIn 0.3s ease both;
}
.soha-ai-pcard:hover { transform: translateY(-2px); border-color: var(--mustard); }
.soha-ai-pcard:focus-visible { outline: 2px solid var(--mustard); outline-offset: 2px; }
.soha-ai-pimg {
  width: 62px;
  aspect-ratio: 3 / 4;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--gold-cream-soft);
}
.soha-ai-pimg img { width: 100%; height: 100%; object-fit: cover; }
.soha-ai-pbody { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.soha-ai-pbrand { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.soha-ai-pname {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--navy);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.soha-ai-pprice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 2px; }
.soha-ai-pprice strong { font-size: 0.9rem; font-weight: 900; color: var(--mustard-text); }
.soha-ai-pprice s { font-size: 0.72rem; color: var(--muted); }
.soha-ai-parrow { align-self: center; color: var(--mustard-text); flex-shrink: 0; }

/* ---------- اعلان سبد + لینک‌ها ---------- */
.soha-ai-note {
  align-self: flex-end;
  width: 92%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--mustard);
  background: var(--gold-cream-soft);
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--navy);
  animation: sohaAiIn 0.3s ease both;
}
.soha-ai-note b { font-weight: 800; }
.soha-ai-cta, .soha-ai-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mustard), var(--gold-cream));
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.soha-ai-cta:hover, .soha-ai-link:hover { filter: brightness(1.05); transform: translateY(-1px); }
.soha-ai-links { align-self: flex-end; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- پیشنهادهای سریع ---------- */
.soha-ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 10px;
}
.soha-ai-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--gold-cream);
  background: var(--white);
  background: color-mix(in srgb, var(--white) 90%, transparent);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.soha-ai-chip:hover { background: var(--gold-cream-soft); border-color: var(--mustard); }
.soha-ai-quick[hidden] { display: none; }

/* ---------- ورودی ---------- */
.soha-ai-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--gold-cream);
  background: var(--white);
  background: color-mix(in srgb, var(--white) 80%, transparent);
}
.soha-ai-input {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--gold-cream);
  border-radius: 22px;
  background: var(--white);
  color: var(--ink);
  font-size: 16px; /* جلوگیری از زوم خودکار iOS */
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.soha-ai-input:focus {
  border-color: var(--mustard);
  box-shadow: 0 0 0 3px var(--gold-cream-soft);
}
.soha-ai-input:disabled { background: var(--gold-cream-soft); color: var(--muted); }
.soha-ai-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mustard), var(--gold-cream));
  color: var(--navy);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.soha-ai-send:hover:not(:disabled) { transform: scale(1.06); }
.soha-ai-send:disabled { opacity: 0.45; cursor: not-allowed; }
.soha-ai-send svg { transform: scaleX(-1); } /* پیکان به سمت چپ در RTL */
.soha-ai-foot {
  padding: 0 14px 8px;
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  background: var(--white);
  background: color-mix(in srgb, var(--white) 80%, transparent);
  flex-shrink: 0;
}
.soha-ai-form { flex-shrink: 0; }
.soha-ai-quick { flex-shrink: 0; }

/* ---------- نوار باریک معرفی لوکسی زیر جستجو در هدر ---------- */
/* sentinel غیرقابل‌دید در جریان سند — برای IntersectionObserver FAB */
.soha-ai-strip-sentinel {
  height: 1px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
/* فاصلهٔ کوچک بین ردیف جستجو و نوار تا از هدر جدا به نظر برسد */
.site-header:has(.soha-ai-strip-wrap) .header-inner {
  padding-bottom: 6px;
}
.soha-ai-strip-wrap {
  margin-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--gold-cream) 42%, transparent);
  /* شیشه‌ای روشن‌تر از سرمه‌ای هدر تا مرز واضح باشد */
  background: color-mix(in srgb, var(--navy-soft, #1B3A52) 72%, var(--white));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--white) 22%, var(--navy-soft, #1B3A52)),
    color-mix(in srgb, var(--white) 12%, var(--navy))
  );
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--white) 18%, transparent);
}
.soha-ai-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  max-height: 48px;
  padding: 0 24px;
  width: 100%;
  max-width: var(--max, 1400px);
  margin: 0 auto;
  box-sizing: border-box;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--gold-cream-soft);
  font-family: inherit;
  text-align: start;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.soha-ai-strip-wrap:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--white) 28%, var(--navy-soft, #1B3A52)),
    color-mix(in srgb, var(--white) 16%, var(--navy))
  );
}
.soha-ai-strip:focus-visible {
  outline: 2px solid var(--gold-cream);
  outline-offset: -2px;
}
.soha-ai-strip-media {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--mustard);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold-cream) 35%, transparent);
  background: var(--navy);
}
.soha-ai-strip-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.soha-ai-strip-msg {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gold-cream-soft);
}
.soha-ai-strip-full { display: inline; }
.soha-ai-strip-short { display: none; }
.soha-ai-strip-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  /* سرمه‌ای اصلی + متن طلایی — کنتراست واضح روی نوار شیشه‌ای */
  background: var(--navy);
  color: var(--gold-cream);
  border: 1px solid var(--mustard);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.45);
  pointer-events: none; /* کل نوار قابل لمس است */
}

/* نوار لوکسی داخل کادر واحد صفحه اصلی (نیمهٔ راست) */
.soha-ai-strip.soha-ai-strip--duo {
  height: auto;
  max-height: none;
  min-height: 0;
  padding: 0;
  max-width: none;
  margin: 0;
  width: 100%;
  gap: 8px;
  color: var(--gold-cream-soft);
}
.luxi-calc-duo .soha-ai-strip-media {
  width: 32px;
  height: 32px;
}
.luxi-calc-duo .soha-ai-strip-msg {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--gold-cream);
}
.luxi-calc-duo .soha-ai-strip-cta {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 0.78rem;
  background: linear-gradient(145deg, var(--mustard), var(--mustard-hover));
  color: var(--navy);
  border: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 3px 0 rgba(0, 0, 0, 0.22),
    0 6px 12px rgba(0, 0, 0, 0.18);
}
.luxi-calc-duo .soha-ai-strip:active .soha-ai-strip-cta {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 1px 0 rgba(0, 0, 0, 0.22),
    0 2px 5px rgba(0, 0, 0, 0.16);
}

@media (max-width: 480px) {
  .soha-ai-strip.soha-ai-strip--duo {
    gap: 6px;
  }
  .luxi-calc-duo .soha-ai-strip-media {
    width: 28px;
    height: 28px;
  }
  .luxi-calc-duo .soha-ai-strip-msg { font-size: 0.78rem; }
  .luxi-calc-duo .soha-ai-strip-full { display: none; }
  .luxi-calc-duo .soha-ai-strip-short { display: inline; }
  /* روی عرض باریک فقط آواتار + متن کوتاه (بدون دکمه جدا) */
  .luxi-calc-duo .soha-ai-strip-cta { display: none; }
  .luxi-calc-duo .soha-ai-sparkle { display: none; }
}

@media (max-width: 560px) {
  .soha-ai-strip:not(.soha-ai-strip--duo) {
    height: 44px;
    padding: 0 14px;
    gap: 8px;
  }
  .soha-ai-strip:not(.soha-ai-strip--duo) .soha-ai-strip-msg { font-size: 0.8rem; }
  .soha-ai-strip:not(.soha-ai-strip--duo) .soha-ai-strip-full { display: none; }
  .soha-ai-strip:not(.soha-ai-strip--duo) .soha-ai-strip-short { display: inline; }
  .soha-ai-strip:not(.soha-ai-strip--duo) .soha-ai-strip-cta { padding: 3px 10px; font-size: 0.74rem; min-height: 26px; }
  .soha-ai-fab-tag { font-size: 0.78rem; padding: 6px 10px; }
  .soha-ai-tip { width: min(240px, calc(100vw - 36px)); font-size: 0.8rem; }
}

/* ---------- موبایل: تمام‌صفحه؛ ارتفاع با visualViewport در JS تنظیم می‌شود ---------- */
@media (max-width: 600px) {
  .soha-ai-fab-dock {
    left: 12px;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }
  .soha-ai-fab {
    width: 48px;
    height: 48px;
  }
  /* اسکرول: کاملاً خارج از لبه چپ — فقط transform + opacity */
  .soha-ai-fab-dock.soha-ai-fab-dock--peek {
    transform: translate3d(calc(-100% - 20px), 0, 0);
    opacity: 0;
    pointer-events: none;
  }
  .soha-ai-fab-dock.soha-ai-fab-dock--banner-hide {
    transform: translate3d(calc(-100% - 20px), 0, 0);
  }
  .soha-ai.is-open .soha-ai-fab-dock {
    transform: translate3d(calc(-100% - 20px), 0, 0);
  }
  .soha-ai-panel.soha-ai-chatwindow {
    left: 0;
    right: 0;
    bottom: auto;
    top: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    transform-origin: bottom center;
    transform: translateY(100%);
    opacity: 1;
  }
  .soha-ai-panel.soha-ai-chatwindow.soha-ai-chatwindow--open {
    transform: none;
    opacity: 1;
  }
  .soha-ai-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .soha-ai-foot {
    padding: 0 14px 6px;
  }
  .soha-ai-form {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .soha-ai.is-kb-open .soha-ai-form {
    padding-bottom: 10px;
  }
  .soha-ai-msg { max-width: 92%; }
  .soha-ai-cards, .soha-ai-note { width: 100%; }
  html.soha-ai-lock {
    overflow: hidden;
    height: 100%;
  }
  html.soha-ai-lock body {
    overflow: hidden;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .soha-ai *, .soha-ai *::before, .soha-ai *::after,
  .soha-ai-strip-wrap, .soha-ai-strip-wrap * {
    animation: none !important;
    transition-duration: 0.01s !important;
  }
  .soha-ai-msgs { scroll-behavior: auto; }
  .soha-ai-panel.soha-ai-chatwindow { opacity: 0; transform: none; }
  .soha-ai-panel.soha-ai-chatwindow.soha-ai-chatwindow--open { opacity: 1; }
}
