/* SalesSmartly 客服浮层：直接控制 iframe，可拖动、可隐藏，避免遮挡回到顶部与页脚 */
#s-chat-plugin.tp-cs-managed,
#ss-chat-p.tp-cs-managed {
  transition: opacity 0.2s ease;
}

#s-chat-plugin.tp-cs-hidden,
#s-chat-popup.tp-cs-hidden,
#ss-chat-p.tp-cs-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.tp-cs-controls {
  position: fixed;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.24);
  opacity: 0.96;
  pointer-events: auto;
}

.tp-cs-controls.is-dragging {
  opacity: 1;
  cursor: grabbing;
}

.tp-cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #f8fafc;
  cursor: pointer;
  line-height: 1;
}

.tp-cs-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.tp-cs-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.tp-cs-drag-handle {
  cursor: grab;
  touch-action: none;
  font-size: 13px;
  letter-spacing: -1px;
}

.tp-cs-drag-handle:active {
  cursor: grabbing;
}

.tp-cs-hide-btn {
  font-size: 18px;
}

.tp-cs-restore {
  position: fixed;
  z-index: 10000;
  right: 0;
  bottom: 120px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 8px 12px;
  border: none;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: -2px 4px 16px rgba(217, 119, 6, 0.35);
}

.tp-cs-restore.is-visible {
  display: inline-flex;
}

.tp-cs-restore svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .tp-cs-restore {
    bottom: 108px;
  }
}
