.chatbot-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: #FF1493;
  box-shadow: 0 4px 16px rgba(255, 20, 147, 0.3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
  z-index: 99999;
}

.chatbot-launcher:hover {
  transform: scale(1.08);
}

.chatbot-launcher svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.chatbot-panel {
  position: fixed;
  right: 20px;
  bottom: 82px;
  width: min(calc(100vw - 32px), 460px);
  height: min(68vh, 500px);
  padding: 0;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 99998;
}

.chatbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chatbot-header {
  position: static;
  top: auto;
  z-index: auto;
  background: #FF1493;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: none;
}

.chatbot-title strong {
  font-size: 0.95rem;
  font-weight: 600;
  display: block;
}

.chatbot-title span {
  font-size: 0.75rem;
  opacity: 0.8;
}

.chatbot-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}

.chatbot-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
  background: #f7f7f8;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.chatbot-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  position: relative;
  animation: chatbot-pop 0.2s ease;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.chatbot-message.bot {
  background: #ffffff;
  align-self: flex-start;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.chatbot-message.user {
  background: #FF1493;
  color: #ffffff;
  align-self: flex-end;
  border-top-right-radius: 4px;
}

.chatbot-message.user a {
  color: #ffffff;
  text-decoration: underline;
}

.chatbot-message .time {
  display: block;
  font-size: 0.62rem;
  color: #aaa;
  margin-top: 4px;
  text-align: right;
}

.chatbot-message.user .time {
  color: rgba(255, 255, 255, 0.7);
}

.chatbot-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: #ffffff;
  align-self: flex-start;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.chatbot-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bbb;
  animation: chatbot-bounce 1.2s infinite ease-in-out;
}

.chatbot-dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-dot:nth-child(3) { animation-delay: 0.4s; }

.chatbot-quick-replies {
  padding: 9px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px 7px;
  background: #ffffff;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.chatbot-quick-replies button {
  border: 1px solid #ddd;
  background: #fafafa;
  color: #444;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  min-height: 28px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-quick-replies button:hover {
  background: #FF1493;
  color: #ffffff;
  border-color: #FF1493;
}

.chatbot-message a {
  color: #FF1493;
  text-decoration: underline;
  font-weight: 500;
}

@keyframes chatbot-pop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes chatbot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 600px) {
  .chatbot-panel {
    right: 8px;
    bottom: 72px;
    left: 8px;
    width: auto;
    height: min(72vh, 480px);
  }
  .chatbot-quick-replies {
    padding: 8px 10px;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 5px 6px;
  }
  .chatbot-quick-replies button {
    padding: 4px 7px;
    font-size: 0.68rem;
    min-height: 27px;
  }
  .chatbot-launcher {
    right: 14px;
    bottom: 14px;
  }
}