/* ویجت پشتیبانی مصرف‌شاپ — FAB + کانال‌های پویا */
.ms-sc {
  position: fixed;
  z-index: 9999;
  bottom: 1.25rem;
  left: 1.25rem;
  font-family: Vazirmatn, Tahoma, sans-serif;
  direction: rtl;
}
.ms-sc-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, #0d9488, #f59e0b);
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.ms-sc-fab:hover { transform: scale(1.06); }
.ms-sc-fab.is-open {
  background: #1e293b;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
}
.ms-sc-menu {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.45rem);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  pointer-events: none;
}
.ms-sc-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.ms-sc-menu.is-open .ms-sc-channel {
  animation: ms-sc-pop 0.28s ease both;
}
.ms-sc-menu.is-open .ms-sc-channel:nth-child(1) { animation-delay: 0.02s; }
.ms-sc-menu.is-open .ms-sc-channel:nth-child(2) { animation-delay: 0.05s; }
.ms-sc-menu.is-open .ms-sc-channel:nth-child(3) { animation-delay: 0.08s; }
.ms-sc-menu.is-open .ms-sc-channel:nth-child(4) { animation-delay: 0.11s; }
.ms-sc-menu.is-open .ms-sc-channel:nth-child(5) { animation-delay: 0.14s; }
.ms-sc-menu.is-open .ms-sc-channel:nth-child(6) { animation-delay: 0.17s; }
.ms-sc-menu.is-open .ms-sc-channel:nth-child(7) { animation-delay: 0.2s; }
.ms-sc-menu.is-open .ms-sc-channel:nth-child(8) { animation-delay: 0.23s; }
@keyframes ms-sc-pop {
  from { opacity: 0; transform: translateY(0.35rem) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ms-sc-channel {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  --ms-sc-color: #0d9488;
}
.ms-sc-channel:hover .ms-sc-channel-btn {
  transform: scale(1.07);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--ms-sc-color) 45%, transparent);
}
.ms-sc-channel:hover .ms-sc-channel-label {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}
.ms-sc-channel-btn {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ms-sc-color);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  position: relative;
}
.ms-sc-channel-logo {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}
.ms-sc-channel-fallback {
  display: grid;
  place-items: center;
}
.ms-sc-channel-label {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  white-space: nowrap;
  transition: box-shadow 0.18s ease;
}
.ms-sc-panel {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  left: 0;
  width: min(21rem, calc(100vw - 2.5rem));
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px rgba(15, 118, 110, 0.18);
  overflow: hidden;
  display: none;
}
.ms-sc-panel.is-open { display: block; }
.ms-sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}
.ms-sc-head h3 { margin: 0; font-size: 0.95rem; font-weight: 800; }
.ms-sc-close {
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
}
.ms-sc-body { padding: 0.85rem; }
.ms-sc-welcome { margin: 0 0 0.75rem; font-size: 0.85rem; color: #475569; line-height: 1.6; }
.ms-sc-guest-fields { display: grid; gap: 0.4rem; margin-bottom: 0.6rem; }
.ms-sc-guest-fields input,
.ms-sc-compose textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  box-sizing: border-box;
}
.ms-sc-thread {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 14rem;
  overflow: auto;
  margin-bottom: 0.6rem;
  padding: 0.25rem;
}
.ms-sc-msg { max-width: 85%; }
.ms-sc-msg.is-mine { align-self: flex-start; }
.ms-sc-msg.is-them { align-self: flex-end; }
.ms-sc-msg.is-bot .ms-sc-bubble { background: #ecfeff; border-color: #a5f3fc; }
.ms-sc-bubble {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.ms-sc-msg.is-mine .ms-sc-bubble {
  background: #0d9488;
  color: #fff;
  border-color: #0d9488;
}
.ms-sc-meta { font-size: 0.7rem; color: #94a3b8; margin-bottom: 0.15rem; }
.ms-sc-compose { display: flex; gap: 0.4rem; align-items: flex-end; }
.ms-sc-send {
  border: none;
  background: #0d9488;
  color: #fff;
  border-radius: 0.7rem;
  width: 2.6rem;
  height: 2.6rem;
  cursor: pointer;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .ms-sc { bottom: 1rem; left: 0.75rem; }
  .ms-sc-channel-label { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
}
