/* دکمه‌ی شناور پشتیبانی + پنجره‌ی پشتیبانی آنلاین (templates/includes/support_widget.html) */
.sp { position: fixed; left: 16px; bottom: 16px; z-index: 900; font-family: inherit; direction: rtl; }
.sp-fab { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 20px 12px 18px; border: 0; border-radius: 999px;
  background: #0B0B0B; color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.sp-fab:hover { background: #222; }
.sp-fab svg { flex: 0 0 auto; }
.sp-dot { position: absolute; top: 6px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #A90609; box-shadow: 0 0 0 2px #0B0B0B; }
.sp-dot[hidden] { display: none; }

.sp-panel { position: absolute; left: 0; bottom: calc(100% + 12px); width: min(360px, calc(100vw - 32px)); background: #fff; color: #111;
  border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.24); overflow: hidden; }
.sp-panel[hidden], .sp-panel [hidden] { display: none; }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: linear-gradient(90deg, #2C76B0, #4E5782 55%, #A90609); color: #fff; }
.sp-head b { flex: 1; font-size: 15px; }
.sp-x, .sp-back { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.sp-hint { margin: 14px 16px 6px; font-size: 13px; color: #666; }
.sp-menu { padding-bottom: 10px; }
.sp-opt { display: flex; align-items: center; gap: 12px; width: calc(100% - 20px); margin: 6px 10px; padding: 12px; border: 1px solid #ECECEC; border-radius: 14px;
  background: #fff; color: inherit; font: inherit; text-align: right; text-decoration: none; cursor: pointer; }
.sp-opt:hover { border-color: #CFCFCF; background: #FAFAFA; }
.sp-opt b { display: block; font-size: 14px; }
.sp-opt small { display: block; font-size: 12px; color: #777; margin-top: 2px; }
.sp-ico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.sp-ico svg { width: 22px; height: 22px; }
.sp-ico-live { background: linear-gradient(180deg, #2C76B0, #4E5782, #A90609); }
.sp-ico-bale { background: #2FB59B; }
.sp-ico-wa { background: #25D366; }

.sp-chat { display: flex; flex-direction: column; height: min(460px, calc(100vh - 140px)); }
.sp-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #F6F6F5; }
.sp-msg { margin: 0; max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-msg small { display: block; font-size: 11px; opacity: .55; margin-top: 2px; }
.sp-msg.is-me { align-self: flex-start; background: #0B0B0B; color: #fff; border-bottom-right-radius: 4px; }
.sp-msg.is-staff { align-self: flex-end; background: #fff; border: 1px solid #E6E6E6; border-bottom-left-radius: 4px; }
.sp-msg.is-pending { opacity: .55; }
.sp-form { padding: 10px; border-top: 1px solid #EEE; display: grid; gap: 8px; background: #fff; }
.sp-name, .sp-row textarea { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #DDD; border-radius: 12px; background: #fff; color: #111; }
.sp-row { display: flex; gap: 8px; align-items: flex-end; }
.sp-row textarea { flex: 1; min-width: 0; resize: none; max-height: 120px; }
.sp-row button { flex: 0 0 44px; height: 44px; border: 0; border-radius: 50%; background: #0B0B0B; color: #fff; cursor: pointer; display: grid; place-items: center; }
.sp-row button:disabled { opacity: .4; cursor: default; }
.sp-err { margin: 0; font-size: 12px; color: #A90609; }

@media (max-width: 600px) {
  .sp { left: 12px; bottom: 12px; }
  .sp-fab span { display: none; }
  .sp-fab { padding: 14px; }
}
@media print { .sp { display: none; } }
