/* Floating launcher button */
.uh-chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(135deg, #111827, #1f2937);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 9998;
}

.uh-chat-launcher:hover {
  transform: translateY(-2px);
}

/* Chat container */
.uh-chat-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  max-width: calc(100% - 32px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.98);
  transition: 0.25s ease;
}

.uh-chat-container.uh-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Chat wrapper */
.APM-chat {
  border-radius: 16px;
  overflow: hidden;
  background: #f9fafb;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  max-height: 75vh;
}

/* Header */
.uh-chat-header {
  padding: 12px;
  background: linear-gradient(135deg, #f3c144, #f3c144);
  color: #3e418b;
  display: flex;
  justify-content: space-between;
}

.uh-chat-header-main {
  display: flex;
  flex-direction: column;
}

.uh-chat-title {
  font-size: 14px;
  font-weight: 600;
}

.uh-chat-subtitle {
  font-size: 12px;
  opacity: 0.8;
}

/* Chat window */
.uh-chat-window {
  height: 360px;
  overflow-y: auto;
  padding: 10px;
  background: #f3f4f6;
}

/* Messages */
.msg {
  margin: 6px 0;
  font-size: 13px;
  max-width: 100%;
}

.msg-inner {
  display: flex;
  gap: 6px;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3c144, #f3c144);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3e418b;
  border-radius: 50%;
  font-size: 13px;
  flex-shrink: 0;

}
.msg-avatar span {
  font-weight: 600;
}

.msg-text {
  padding: 9px 11px;
  border-radius: 12px;
  background: #fff;
  line-height: 1.4;
}

/* User bubble */
.msg.user {
  text-align: right;
}

.msg.user .msg-text {
  background: #dbeafe;
}

/* FIX: Chat Input Bar Layout */
.uh-chat-form {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  background: #ffffff !important;
  border-top: 1px solid #ddd !important;
  width: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 99999 !important;
}

/* FIX: Remove theme overrides & show proper input box */
.uh-chat-form input {
  all: unset !important;
  display: block !important;
  width: 100% !important;
  background: #ffffff !important;
  color: #111827 !important;
  padding: 12px 16px !important;
  border-radius: 999px !important;
  border: 1px solid #ccc !important;
  font-size: 15px !important;
  height: 46px !important;
  line-height: 20px !important;
  box-sizing: border-box !important;
}

/* Placeholder fix */
.uh-chat-form input::placeholder {
  color: #6b7280 !important;
}

/* Extra fix for themes that style all inputs globally */
.uh-chat-form input[type="text"],
.uh-chat-form input[type="search"],
.uh-chat-form input[type="email"],
.uh-chat-form input[type="tel"],
.uh-chat-form input[type="url"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  border-radius: 999px !important;
}

/* FIX: Send Button */
.uh-chat-form button {
  all: unset !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f3c144 !important; /* U Homes L blue */
  color: #3e418b !important;
  padding: 0 26px !important;
  height: 46px !important;
  border-radius: 999px !important;
  font-size: 15px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.uh-chat-form button:hover {
  background: #1f2264 !important;
}

/* Scrollbar */
.uh-chat-window::-webkit-scrollbar {
  width: 6px;
}

.uh-chat-window::-webkit-scrollbar-thumb {
  background: #c5c5c5;
  border-radius: 10px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .uh-chat-container {
    right: 10px;
    left: 10px;
    width: auto;
  }
  .uh-chat-window {
    height: 320px;
  }
}
