.bxr-chat-widget {
  --bxr-accent: var(--green, #0ef57d);
  --bxr-accent-rgb: 14, 245, 125;
}

.bxr-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--bxr-accent);
  color: var(--ink, #121513);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(var(--bxr-accent-rgb), 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  animation: bxr-chat-pulse 2.4s ease-out infinite;
}

.bxr-chat-launcher:hover {
  transform: scale(1.06);
}

.bxr-chat-launcher.is-quiet {
  animation: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.bxr-chat-launcher svg {
  width: 26px;
  height: 26px;
}

@keyframes bxr-chat-pulse {
  0% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(var(--bxr-accent-rgb), 0.55);
  }
  70% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 0 14px rgba(var(--bxr-accent-rgb), 0);
  }
  100% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(var(--bxr-accent-rgb), 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bxr-chat-launcher {
    animation: none;
  }
}

.bxr-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: var(--ink-2, #191d1b);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.bxr-chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.bxr-chat-header {
  padding: 16px 18px;
  background: var(--ink-3, #222725);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.bxr-chat-header h2 {
  font-family: "Exo 2", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.bxr-chat-close {
  background: none;
  border: none;
  color: var(--grey, #757575);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
}

.bxr-chat-close:hover {
  color: #fff;
}

.bxr-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.bxr-chat-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bxr-chat-msg.is-bot {
  align-self: flex-start;
  background: var(--ink-3, #222725);
  color: #fff;
  border-bottom-left-radius: 3px;
}

.bxr-chat-widget .bxr-chat-msg a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--bxr-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  word-break: break-word;
}

.bxr-chat-widget .bxr-chat-msg strong {
  font-weight: 700;
}

.bxr-chat-msg.is-user {
  align-self: flex-end;
  background: var(--bxr-accent);
  color: var(--dark, #2b2b2b);
  border-bottom-right-radius: 3px;
}

.bxr-chat-msg.is-note {
  align-self: center;
  background: none;
  color: var(--grey, #757575);
  font-size: 12px;
  text-align: center;
  max-width: 100%;
}

.bxr-chat-msg.is-error {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--grey, #757575);
  color: var(--grey, #757575);
}

.bxr-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--ink-3, #222725);
  flex-shrink: 0;
}

.bxr-chat-input {
  flex: 1;
  resize: none;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  background: #fff;
  color: var(--dark, #2b2b2b);
  max-height: 80px;
}

.bxr-chat-input:focus {
  outline: 2px solid var(--bxr-accent);
}

.bxr-chat-send {
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  background: var(--bxr-accent);
  color: var(--ink, #121513);
  font-family: "Exo 2", sans-serif;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.bxr-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Helles Farbschema - Panel, Kopf- und Fußzeile drehen auf hell, der
   Akzent (Button, Nutzer-Bubble) bleibt unveraendert farbig. */
.bxr-chat-widget--light .bxr-chat-panel {
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.bxr-chat-widget--light .bxr-chat-header,
.bxr-chat-widget--light .bxr-chat-form {
  background: var(--light, #f4f4f4);
}

.bxr-chat-widget--light .bxr-chat-header h2 {
  color: var(--dark, #2b2b2b);
}

.bxr-chat-widget--light .bxr-chat-close {
  color: var(--grey, #757575);
}

.bxr-chat-widget--light .bxr-chat-close:hover {
  color: var(--dark, #2b2b2b);
}

.bxr-chat-widget--light .bxr-chat-msg.is-bot {
  background: var(--light, #f4f4f4);
  color: var(--dark, #2b2b2b);
}

.bxr-chat-widget--light .bxr-chat-input {
  background: var(--light, #f4f4f4);
}

@media (max-width: 480px) {
  .bxr-chat-panel {
    right: 16px;
    left: 16px;
    width: auto;
  }

  .bxr-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}
