.chat-button {
  position: fixed;
  right: 25px;
  bottom: 25px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #2F2C27;
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  z-index: 9999;
}

.chat-button.hidden {
  display: none;
}

.chat-box {
  position: fixed;
  right: 25px;
  bottom: 25px;
  width: 420px;
  height: 650px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  transition: all .25s ease;
}

.chat-box.minimized {
  opacity: 0;
  transform: translateY(20px) scale(.95);
  pointer-events: none;
}

.chat-header {
  background: #2F2C27;
  color: white;
  padding: 14px 23px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.chat-brand img {
  width: 36px;
  height: auto;
  display: block;
}

.chat-brand strong {
  display: block;
  font-size: 15px;
  line-height: 16px;
}

.chat-brand small {
  display: block;
  font-size: 13px;
  font-weight: normal;
  margin-top: 2px;
  opacity: 0.9;
}

.chat-header small {
  display: block;
  font-weight: normal;
  margin-top: 4px;
  opacity: 0.9;
}

.minimize-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.message {
  width: fit-content;
  max-width: 75%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
}

.bot {
  background: #e2e8f0;
  color: #111827;
  align-self: flex-start;
  max-width: 72% !important;
}

.user {
  background: #2F2C27;
  color: white;
  margin-left: auto;
  max-width: 68% !important;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: white;
  box-sizing: border-box;
}

.chat-input textarea {
  flex: 1;
  height: 44px;
  min-height: 44px;
  max-height: 110px;
  border: 1px solid #ddd;
  border-radius: 22px;
  outline: none;
  resize: none;
  padding: 12px 16px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  line-height: 20px;
  overflow-y: hidden;
  box-sizing: border-box;
}

.send-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 50%;
  background: #2F2C27;
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  padding: 0;
  box-sizing: border-box;
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 2px;
}

.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #98a2b3;
  animation: typingBounce 1.4s infinite ease-in-out;
}

#typingMessage {
  width: fit-content !important;
  min-width: auto !important;
  min-height: auto !important;
  max-width: none !important;
  padding: 7px 10px !important;
  border-radius: 14px !important;
  margin-bottom: 8px !important;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

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

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: .4;
  }

  40% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

.message {
  width: fit-content !important;
  max-width: 75% !important;

  padding: 9px 12px 6px 12px !important;
  margin-bottom: 10px !important;

  border-radius: 14px !important;

  font-size: 14px !important;
  line-height: 1.35 !important;

  box-sizing: border-box !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;

  overflow: visible !important;
  height: auto !important;
  min-height: unset !important;
  max-height: none !important;
}

.message-text {
  display: block !important;
  white-space: pre-wrap !important;
  margin: 0 !important;
  padding: 0 !important;
}

.message-time {
  display: block !important;
  font-size: 10px !important;
  line-height: 1 !important;
  margin-top: 5px !important;
  text-align: right !important;
  opacity: 0.55 !important;
  position: static !important;
}

.bot {
  background: #e2e8f0 !important;
  color: #111827 !important;
  align-self: flex-start !important;
  max-width: 72% !important;
}

.user {
  background: #2F2C27 !important;
  color: white !important;
  margin-left: auto !important;
  max-width: 68% !important;
}

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

.bot .message-time {
  color: rgba(0,0,0,0.45) !important;
}