house-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999; /* deliberately extreme */
}

.chat-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  height: 480px;
  background: #f7f9f5;
  border: 1px solid #d0e2d4;
  color: rgb(25,68,35);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

.chat-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

@media (max-width: 600px) {

  .chat-panel {
    width: 100%;
    height: 70vh;
    right: 0;
    bottom: 0;
    border-radius: 0;
  }

  .chat-button {
    width: 64px;
    height: 64px;
    font-size: 28px;
    bottom: 16px;
    right: 16px;
  }

  .msg {
    font-size: 16px;
  }

  .chat-input {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .chat-messages {
    -webkit-overflow-scrolling: touch;
  }

  .close-btn,
  #chat-send-btn {
    padding: 12px 16px;
    font-size: 18px;
  }
}

#chat-send-btn {
  background: #2f5c3a;
}

/* Add this to your main stylesheet */
.chat-button.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(44, 62, 80, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(44, 62, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(44, 62, 80, 0);
  }
}

.chat-button.breathe {
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06); /* subtle expansion */
  }
  100% {
    transform: scale(1);
  }
}

.chat-header {
  background: #2f5c3a;
  color: white;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
    border: 1px solld #1e3a8a;
}

/* Watermark overlay */
.chat-header::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 0;
  right: 80px;
  bottom: 0;
    top: 12px;
  height: 24px; /* adjust to match your divider height */
  background-image: url("/images/chatbotheader.png");
  background-repeat: no-repeat;
  background-size: contain; /* or 'cover' depending on your divider proportions */
  background-position: right;
  opacity: 1; /* watermark level */
  pointer-events: none;
}

/* Ensure text and close button sit above the image */
.chat-header > * {
  position: relative;
  z-index: 2;
}

.chat-controls {
  display: flex;
  gap: 8px;
  z-index: 1; /* ensures it's above the ::before watermark */
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.close-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #f7f7f7;
}

.chat-input {
  display: flex;
  border-top: 1px solid #ddd;
}

.chat-input input {
  flex: 1;
  border: none;
  padding: 10px;
}

.chat-input button {
  background: #2c3e50;
  color: white;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
}

.chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #2f5c3a;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-button:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.msg {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  max-width: 80%;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

.user-msg {
  background: #d0e6ff;
  align-self: flex-end;
  margin-left: auto;
}

.bot-msg {
  background: #ffffff;
  border: 1px solid #ddd;
  margin-right: auto;
}

.msg-text {
  margin-bottom: 4px;
}

.timestamp {
  font-size: 10px;
  opacity: 0.6;
  align-self: flex-end;
}

.clear-btn {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.clear-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.clear-btn.spin {
  animation: spin 0.4s ease;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}