/* ── Northbury Helper Chat Widget ── */

.chat-btn {
  position: fixed;
  bottom: 1.8rem;
  left: 1.8rem;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.3rem;
  background: #1c3d2e;
  color: #fff;
  border: none;
  border-radius: 40px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  transition: all 0.25s;
}
.chat-btn:hover {
  background: #254d3a;
  box-shadow: 0 6px 28px rgba(0,0,0,0.28);
  transform: translateY(-2px);
}
.chat-btn-icon { font-size: 1.15rem; }
.chat-btn-dot {
  width: 8px;
  height: 8px;
  background: #4cbb7f;
  border-radius: 50%;
  margin-left: 2px;
  animation: chat-pulse 2s ease-in-out infinite;
}

.chat-panel {
  position: fixed;
  bottom: 5.5rem;
  left: 1.8rem;
  z-index: 300;
  width: 360px;
  max-height: 540px;
  background: #fff;
  border: 1px solid #ddd5c8;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.chat-header {
  background: #1c3d2e;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.chat-avatar {
  width: 38px;
  height: 38px;
  background: #c8923a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.chat-header-info { flex: 1; }
.chat-name {
  color: #fff;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}
.chat-status {
  color: rgba(255,255,255,0.65);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
}
.chat-status-dot { color: #4cbb7f; }
.chat-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  transition: all 0.2s;
  line-height: 1;
}
.chat-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 200px;
  max-height: 320px;
}

.chat-msg {
  display: flex;
  max-width: 88%;
}
.msg-bot  { align-self: flex-start; }
.msg-user { align-self: flex-end; }

.chat-bubble {
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  line-height: 1.55;
}
.msg-bot .chat-bubble {
  background: #f0ebe3;
  color: #2c2c2c;
  border-bottom-left-radius: 3px;
}
.msg-user .chat-bubble {
  background: #1c3d2e;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 0.9rem;
}
.chat-typing span {
  width: 7px;
  height: 7px;
  background: #888;
  border-radius: 50%;
  display: inline-block;
  animation: chat-bounce 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

.chat-suggestions {
  padding: 0.5rem 0.75rem 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
  border-top: 1px solid #ede8e0;
}
.chat-sugg-btn {
  background: #f5f0e8;
  border: 1px solid #ddd5c8;
  color: #1c3d2e;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.chat-sugg-btn:hover { background: #1c3d2e; color: #fff; border-color: #1c3d2e; }

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #ede8e0;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid #ddd5c8;
  border-radius: 20px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  color: #2c2c2c;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: #1c3d2e; }
.chat-send {
  background: #c8923a;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.55rem 1.1rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.chat-send:hover { background: #b07e30; }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-powered {
  text-align: center;
  padding: 0.3rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.65rem;
  color: #aaa;
  flex-shrink: 0;
}

@keyframes chat-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}
@keyframes chat-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-6px); }
}

@media(max-width: 480px) {
  .chat-panel { width: calc(100vw - 2rem); left: 1rem; }
  .chat-btn-label { display: none; }
}
