#site-chatbot-panel,
#site-chatbot-panel *,
#site-chatbot-panel *::before,
#site-chatbot-panel *::after,
#chat-with-us-floating {
  box-sizing: border-box;
}

#site-chatbot-panel,
#chat-with-us-floating {
  font-family: Arial, sans-serif;
}

#site-chatbot-panel button,
#site-chatbot-panel textarea {
  font-family: inherit;
}

#site-chatbot-panel .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#chat-with-us-floating {
  align-items: center;
  background: linear-gradient(145deg, #198fd1 0%, #0078d7 58%, #005aa8 100%);
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  bottom: 20px;
  box-shadow: 0 10px 24px rgba(0, 90, 168, 0.28), 0 3px 8px rgba(16, 49, 82, 0.16);
  color: #fff;
  cursor: grab;
  display: inline-flex;
  font-size: 22px;
  height: 60px;
  justify-content: center;
  position: fixed;
  right: 20px;
  width: 60px;
  z-index: 99997;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

#chat-with-us-floating:hover {
  box-shadow: 0 13px 28px rgba(0, 90, 168, 0.34), 0 4px 10px rgba(16, 49, 82, 0.18);
  transform: translateY(-2px);
}

#site-chatbot-panel {
  bottom: 86px;
  display: flex;
  flex-direction: column;
  height: min(560px, calc(100vh - 120px));
  max-height: calc(100vh - 120px);
  max-width: calc(100vw - 16px);
  position: fixed;
  right: 20px;
  width: min(390px, calc(100vw - 40px));
  z-index: 99998;
}

#site-chatbot-panel[hidden] { display: none; }

#site-chatbot-resize {
  background: linear-gradient(135deg, transparent 38%, rgba(255, 255, 255, 0.9) 40%, rgba(255, 255, 255, 0.9) 46%, transparent 48%, transparent 58%, rgba(255, 255, 255, 0.9) 60%, rgba(255, 255, 255, 0.9) 66%, transparent 68%);
  border: 0;
  border-radius: 6px 0 0 0;
  cursor: nwse-resize;
  height: 20px;
  left: 3px;
  padding: 0;
  position: absolute;
  top: 3px;
  touch-action: none;
  width: 20px;
  z-index: 1;
}

#site-chatbot-resize:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.site-chatbot-card {
  background: #fafdff;
  border: 1px solid rgba(0, 120, 215, 0.14);
  border-radius: 20px;
  box-shadow: 0 22px 55px rgba(16, 49, 82, 0.22), 0 4px 14px rgba(0, 120, 215, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.site-chatbot-header {
  align-items: center;
  background: linear-gradient(120deg, #123d64 0%, #0078d7 78%, #198fd1 100%);
  color: #fff;
  display: flex;
  gap: 10px;
  min-height: 68px;
  padding: 12px 16px;
}

.site-chatbot-avatar {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  color: #0078d7;
  display: inline-flex;
  flex: 0 0 38px;
  height: 38px;
  justify-content: center;
}

.site-chatbot-header-copy { flex: 1; line-height: 1.15; }
.site-chatbot-header-copy strong { display: block; }
.site-chatbot-header-copy small { opacity: 0.82; }

.site-chatbot-close {
  background: transparent;
  border: 0;
  color: #fff;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  padding: 7px;
  transition: background 160ms ease, transform 160ms ease;
}

.site-chatbot-close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.04);
}

.site-chatbot-messages {
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8fc 100%);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  scrollbar-color: #a9cbe3 transparent;
  scrollbar-width: thin;
}

.site-chatbot-message {
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 10px;
  max-width: 88%;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.site-chatbot-message.is-assistant {
  background: #fff;
  border: 1px solid #ddeaf4;
  box-shadow: 0 4px 12px rgba(18, 61, 100, 0.06);
  color: #294256;
}

.site-chatbot-message.is-user {
  background: linear-gradient(135deg, #198fd1, #0078d7);
  box-shadow: 0 5px 14px rgba(0, 120, 215, 0.16);
  color: #fff;
  margin-left: auto;
}

.site-chatbot-message.is-error { background: #fff0f0; color: #9b1c1c; }

.site-chatbot-form {
  align-items: flex-end;
  background: #fff;
  border-top: 1px solid #e1edf5;
  display: flex;
  gap: 8px;
  padding: 11px;
}

.site-chatbot-form textarea {
  background: #f7fbfe;
  border: 1px solid #cedfeb;
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(18, 61, 100, 0.03);
  flex: 1;
  min-width: 0;
  max-height: 110px;
  resize: vertical;
  padding: 9px 11px;
}

.site-chatbot-form textarea:focus {
  border-color: #198fd1;
  box-shadow: 0 0 0 3px rgba(25, 143, 209, 0.12);
  outline: none;
}

.site-chatbot-form button {
  background: linear-gradient(145deg, #198fd1, #0078d7);
  border: 0;
  border-radius: 50%;
  color: #fff;
  height: 40px;
  width: 40px;
}

.site-chatbot-form button:disabled { cursor: not-allowed; opacity: 0.55; }

.site-chatbot-actions {
  background: #fff;
  border-top: 1px solid #e1edf5;
  display: flex;
  gap: 8px;
  padding: 10px;
}

.site-chatbot-actions button {
  background: #f7fbfe;
  border: 1px solid #c6dbea;
  border-radius: 12px;
  color: #123d64;
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  min-height: 44px;
  padding: 7px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 2px 7px rgba(18, 61, 100, 0.05);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.site-chatbot-actions button:hover {
  background: #edf7fc;
  border-color: #198fd1;
  box-shadow: 0 7px 16px rgba(25, 143, 209, 0.12);
  transform: translateY(-1px);
}

.site-chatbot-actions button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex: 0 0 17px;
}

.site-chatbot-actions button:active {
  transform: translateY(0);
}

#chat-with-us-floating:active { cursor: grabbing; }

.site-chatbot-header {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.site-chatbot-header:active { cursor: grabbing; }

.site-chatbot-form #site-chatbot-voice {
  background: #edf7fc;
  border: 1px solid #c5dbea;
  color: #0078d7;
  flex: 0 0 40px;
  box-shadow: 0 3px 9px rgba(18, 61, 100, 0.08);
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.site-chatbot-form #site-chatbot-voice svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  vertical-align: middle;
}

.site-chatbot-form #site-chatbot-voice:hover {
  background: #dceffc;
  box-shadow: 0 6px 14px rgba(25, 143, 209, 0.16);
  transform: translateY(-1px);
}

.site-chatbot-form #site-chatbot-voice.is-listening {
  background: #dc3545;
  color: #fff;
  animation: site-chatbot-pulse 1.2s infinite;
}

@keyframes site-chatbot-pulse {
  50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.16); }
}

#chat-with-us-floating,
body:not(.aitour-contact-options-hidden) #chat-with-us-floating {
  bottom: 20px;
  left: auto;
  right: 20px;
  touch-action: none;
}

#wechat-floating,
body:not(.aitour-contact-options-hidden) #wechat-floating {
  bottom: 20px;
  left: auto;
  right: 92px;
}

@media (max-width: 576px) {
  #site-chatbot-panel {
    bottom: 82px;
    height: calc(100vh - 100px);
    right: 10px;
    width: calc(100vw - 20px);
  }
}
