/* ویجت پشتیبانی همراه مهر — فیروزه‌ای + نارنجی */
.hm-sc {
  position: fixed;
  z-index: 9999;
  bottom: 1.25rem;
  left: 1.25rem;
  font-family: "Vazirmatn", "Vazir", Tahoma, sans-serif;
  direction: rtl;
}

.hm-sc-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #0d9488 0%, #e89d16 100%);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.hm-sc-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 36px rgba(232, 157, 22, 0.35);
}
.hm-sc-fab .material-symbols-outlined {
  font-size: 1.6rem;
  line-height: 1;
}

.hm-sc-panel {
  position: absolute;
  bottom: calc(100% + .75rem);
  left: 0;
  width: min(20rem, 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;
  opacity: 0;
  visibility: hidden;
  transform: translateY(.5rem) scale(.96);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.hm-sc-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.hm-sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1rem;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #14b8a6 100%);
  color: #fff;
}
.hm-sc-head h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
}
.hm-sc-close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: .5rem;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  cursor: pointer;
}
.hm-sc-close:hover { background: rgba(255, 255, 255, .25); }

.hm-sc-body {
  padding: 1rem;
}
.hm-sc-welcome {
  margin: 0 0 .85rem;
  font-size: .85rem;
  line-height: 1.6;
  color: #475569;
}

.hm-sc-channels {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.hm-sc-channel {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .75rem;
  border-radius: .75rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #134e4a;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
  transition: border-color .15s, background .15s, transform .15s;
}
.hm-sc-channel:hover {
  border-color: #0d9488;
  background: #ecfdf5;
  transform: translateX(-2px);
}
.hm-sc-channel .material-symbols-outlined {
  font-size: 1.25rem;
  color: #0d9488;
  flex-shrink: 0;
}
.hm-sc-channel.is-phone .material-symbols-outlined { color: #d97706; }

.hm-sc-tabs {
  display: flex;
  gap: .25rem;
  padding: .5rem .75rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.hm-sc-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: .5rem .25rem;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.hm-sc-tab.is-active {
  color: #0f766e;
  border-bottom-color: #0d9488;
}

.hm-sc-thread {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 14rem;
  overflow-y: auto;
  margin-bottom: .75rem;
  padding: .25rem;
}
.hm-sc-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 88%;
}
.hm-sc-msg.is-mine {
  align-self: flex-end;
  align-items: flex-end;
}
.hm-sc-msg-bubble {
  padding: .55rem .75rem;
  border-radius: .85rem;
  background: #f1f5f9;
  color: #0f172a;
  font-size: .85rem;
  line-height: 1.55;
  word-break: break-word;
}
.hm-sc-msg.is-mine .hm-sc-msg-bubble {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
}
.hm-sc-msg-time {
  font-size: .7rem;
  color: #94a3b8;
  margin-top: .15rem;
}

.hm-sc-compose {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
}
.hm-sc-compose textarea {
  flex: 1;
  min-height: 2.5rem;
  max-height: 6rem;
  resize: vertical;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  padding: .5rem .65rem;
  font-family: inherit;
  font-size: .85rem;
}
.hm-sc-send {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: .75rem;
  background: #0d9488;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.hm-sc-send:hover { background: #0f766e; }

.hm-sc-login-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.hm-sc-guest-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  margin-bottom: .65rem;
}
.hm-sc-guest-fields input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: .65rem;
  padding: .4rem .55rem;
  font-family: inherit;
  font-size: .78rem;
  background: #f8fafc;
  color: #0f172a;
}
.hm-sc-guest-fields input:focus {
  outline: none;
  border-color: #0d9488;
  background: #fff;
}

@media (max-width: 560px) {
  .hm-sc { bottom: .85rem; left: .85rem; }
  .hm-sc-panel { width: min(18rem, calc(100vw - 1.7rem)); }
  .hm-sc-guest-fields { grid-template-columns: 1fr; }
}
