/* ───────────── چت با ربات پشتیبانی — همان Design System ───────────── */
.chat { margin-top: 12px; }
.chat__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  padding: 4px 0 12px;
}

/* پیام‌ها: ربات سمت شروع (راست)، کاربر سمت پایان (چپ) */
.chat-msg { max-width: 88%; display: flex; flex-direction: column; gap: 8px; }
.chat-msg--bot { align-self: flex-start; }
.chat-msg--user { align-self: flex-end; }
.chat-msg__text {
  padding: 10px 14px;
  border-radius: 14px;
  font: 500 13px/24px var(--font);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.chat-msg--bot .chat-msg__text { background: var(--category-bg); color: var(--navy); border-top-right-radius: 4px; }
.chat-msg--user .chat-msg__text { background: var(--green); color: var(--white); border-top-left-radius: 4px; }

/* دکمه‌های آماده (Quick Reply) */
.chat-msg__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--green);
  color: var(--green);
  font: 600 12px/1.4 var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.chat-chip:active { background: var(--green-light); }
.chat-chip.is-used { box-shadow: inset 0 0 0 1px var(--border); color: var(--gray); cursor: default; }
@media (hover: hover) { .chat-chip:not(.is-used):hover { background: var(--green-light); } }

/* «در حال نوشتن» */
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; border-radius: 14px; border-top-right-radius: 4px; background: var(--category-bg); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #B4B7C2; animation: chat-dot 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }

/* نوار ورودی: هنگام اسکرول پایین صفحه می‌ماند */
.chat-input {
  position: sticky;
  bottom: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.chat-input:focus-within { border-color: var(--green); }
.chat-input__field {
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--black);
  font: 500 16px/1 var(--font);       /* ≥ 16px تا iOS هنگام فوکوس Zoom نکند */
  -webkit-appearance: none;
  appearance: none;
}
.chat-input__field::placeholder { color: #B4B7C2; font-weight: 400; }
.chat-input__send {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
}
.chat-input__send svg { transform: scaleX(-1); }     /* RTL: هواپیمای کاغذی رو به چپ */
.chat-input__send:active:not(:disabled) { background: var(--green-dark); }
.chat-input__send:disabled { background: #C9DDD8; cursor: default; }
