.bd-chat-root {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  font-family: var(--font-body, 'Inter Tight', sans-serif);
}
.bd-chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand, #2563eb);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}
.bd-chat-bubble:hover { transform: translateY(-2px); }
.bd-chat-bubble svg { width: 26px; height: 26px; }
.bd-chat-teaser {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  white-space: nowrap;
  display: none;
}
.bd-chat-teaser.bd-show { display: block; }
.bd-chat-teaser button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 0 0.5rem;
  color: rgba(0,0,0,0.45);
}
.bd-chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  width: 380px;
  max-width: calc(100vw - 2.5rem);
  height: 560px;
  max-height: calc(100vh - 8rem);
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
}
.bd-chat-panel.bd-open { display: flex; }
.bd-chat-header {
  background: var(--brand, #2563eb);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}
.bd-chat-header-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.bd-chat-ai-tag {
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255,255,255,0.18);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
}
.bd-chat-info-btn, .bd-chat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.25rem;
  display: inline-grid;
  place-items: center;
}
.bd-chat-disclaimer {
  background: #f8fafc;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  color: rgba(0,0,0,0.65);
  display: none;
}
.bd-chat-disclaimer.bd-show { display: block; }
.bd-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.bd-chat-msg {
  max-width: 85%;
  padding: 0.55rem 0.8rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bd-chat-msg-user {
  align-self: flex-end;
  background: var(--brand, #2563eb);
  color: #fff;
}
.bd-chat-msg-asst {
  align-self: flex-start;
  background: #f1f5f9;
  color: #0f172a;
}
.bd-chat-msg-system {
  align-self: center;
  background: transparent;
  color: rgba(0,0,0,0.5);
  font-size: 0.78rem;
  font-style: italic;
  max-width: 100%;
  text-align: center;
}
.bd-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: #fff;
}
.bd-chat-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 0.4rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  resize: none;
  max-height: 6rem;
}
.bd-chat-input:focus { outline: 2px solid var(--brand, #2563eb); outline-offset: -1px; }
.bd-chat-send {
  background: var(--brand, #2563eb);
  color: #fff;
  border: none;
  border-radius: 0.4rem;
  padding: 0 0.9rem;
  cursor: pointer;
  font-weight: 600;
}
.bd-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 480px) {
  .bd-chat-panel {
    width: calc(100vw - 1rem);
    right: 0.5rem;
    bottom: 5rem;
    height: calc(100vh - 7rem);
  }
  body.bd-on-contact-page .bd-chat-bubble {
    width: 44px;
    height: 44px;
  }
}
