#jxx-support-root {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 1000;
  width: 340px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#jxx-support-bubble {
  position: absolute;
  right: 64px;
  bottom: 8px;
  width: 248px;
  min-width: 248px;
  max-width: 248px;
  padding: 14px 32px 14px 16px;
  background: #fff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 8px 32px rgba(49, 94, 255, 0.18);
  border: 1px solid #ecf0fc;
  font-size: 14px;
  line-height: 1.6;
  color: #3b4157;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#jxx-support-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#jxx-support-bubble-text {
  display: block;
  margin: 0;
  color: #3b4157;
}

#jxx-support-bubble-text .jxx-bubble-name {
  color: #315eff;
  font-weight: 600;
}

#jxx-support-bubble-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: #868da5;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

#jxx-support-launcher {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #4569e6 0%, #315eff 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(49, 94, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#jxx-support-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(49, 94, 255, 0.42);
}

#jxx-support-launcher svg {
  width: 26px;
  height: 26px;
}

#jxx-support-launcher.has-unread::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: #ff4d4f;
  border-radius: 50%;
  border: 2px solid #fff;
}

#jxx-support-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.16);
  border: 1px solid #ecf0fc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#jxx-support-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.jxx-support-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, #4569e6 0%, #315eff 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.jxx-support-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.jxx-support-header-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.jxx-support-header-info p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 6px;
}

.jxx-support-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52c41a;
  box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.25);
}

.jxx-support-header-close {
  margin-left: auto;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.jxx-support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f4f5fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jxx-support-msg {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jxx-support-msg.is-user {
  align-self: flex-end;
  align-items: flex-end;
}

.jxx-support-msg.is-bot {
  align-self: flex-start;
  align-items: flex-start;
}

.jxx-support-msg-meta {
  font-size: 11px;
  color: #868da5;
}

.jxx-support-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.jxx-support-msg.is-bot .jxx-support-msg-bubble {
  background: #fff;
  color: #3b4157;
  border: 1px solid #e3e7f1;
  border-bottom-left-radius: 4px;
}

.jxx-support-msg.is-user .jxx-support-msg-bubble {
  background: #315eff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.jxx-support-msg-bubble a {
  color: #315eff;
  text-decoration: underline;
}

.jxx-support-msg.is-user .jxx-support-msg-bubble a {
  color: #fff;
}

.jxx-support-quick {
  padding: 10px 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #f4f5fa;
  flex-shrink: 0;
}

.jxx-support-quick button {
  border: 1px solid #dce4fc;
  background: #fff;
  color: #315eff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.jxx-support-quick button:hover {
  background: #ecf0fc;
}

.jxx-support-footer {
  padding: 12px 16px 16px;
  background: #fff;
  border-top: 1px solid #ecf0fc;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.jxx-support-footer input {
  flex: 1;
  height: 40px;
  border: 1px solid #e3e7f1;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 14px;
  outline: none;
}

.jxx-support-footer input:focus {
  border-color: #315eff;
  box-shadow: 0 0 0 3px rgba(49, 94, 255, 0.12);
}

.jxx-support-footer button {
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: #315eff;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.jxx-support-footer button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.jxx-support-typing {
  align-self: flex-start;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e3e7f1;
  border-radius: 14px;
  font-size: 13px;
  color: #868da5;
}

@media (max-width: 480px) {
  #jxx-support-panel {
    width: calc(100vw - 32px);
    right: -4px;
    height: min(70vh, 520px);
  }
}
