#tm-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: Inter, Arial, sans-serif;
}

.tm-chat-toggle {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tm-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.tm-chat-toggle-dot {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

.tm-chat-window {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 370px;
  max-width: calc(100vw - 24px);
  height: 560px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  animation: tmChatShow 0.22s ease;
}

.tm-chat-window.is-hidden {
  display: none;
}

@keyframes tmChatShow {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.tm-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.tm-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tm-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.tm-chat-title {
  font-size: 16px;
  font-weight: 700;
}

.tm-chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12px;
}

.tm-chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.tm-chat-header-actions {
  display: flex;
  gap: 6px;
}

.tm-chat-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}

.tm-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
}

.tm-chat-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.tm-chat-message-user {
  align-items: flex-end;
}

.tm-chat-message-bot {
  align-items: flex-start;
}

.tm-chat-bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 14px;
  word-break: break-word;
}

.tm-chat-message-bot .tm-chat-bubble {
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
}

.tm-chat-message-user .tm-chat-bubble {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-bottom-right-radius: 6px;
}

.tm-chat-time {
  margin-top: 4px;
  padding: 0 4px;
  font-size: 11px;
  color: #9ca3af;
}

.tm-chat-typing {
  margin-bottom: 12px;
}

.tm-chat-typing-bubble {
  display: inline-flex;
  gap: 4px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  padding: 10px 14px;
}

.tm-chat-typing-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  animation: tmTyping 1.2s infinite ease-in-out;
}

.tm-chat-typing-bubble span:nth-child(2) {
  animation-delay: 0.15s;
}

.tm-chat-typing-bubble span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes tmTyping {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.tm-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
  background: #f8fafc;
}

.tm-chat-chip {
  padding: 8px 12px;
  border: 1px solid #86d3a1;
  border-radius: 999px;
  background: #fff;
  color: #166534;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
}
.tm-chat-chip:hover {
  background: #ecfdf5;
}

.tm-chat-form {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.tm-chat-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  outline: none;
  font-size: 14px;
}
.tm-chat-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.tm-chat-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #1f7a4f;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 640px) {
  #tm-chat-widget {
    right: 12px;
    bottom: 12px;
  }
  .tm-chat-window {
    width: calc(100vw - 24px);
    height: 70vh;
    bottom: 74px;
  }
  .tm-chat-toggle {
    width: 58px;
    height: 58px;
  }
}
