/* BWB-MK01 Buzz Assistant
   Palette from the live site :root on brandswithbuzz.com
   --red:#e31b2d  --charcoal:#171717  --white:#fff  --paper:#f4f4f4
   --line:#d9d9dc  --muted:#66666b  --font:Studio,Arial,sans-serif
   Electric yellow bolt from the live logo kit: #FFD400
*/

.bwb-chat,
.bwb-chat * {
  box-sizing: border-box;
}

.bwb-chat {
  --bwb-red: #e31b2d;
  --bwb-red-deep: #c90d27;
  --bwb-yellow: #FFD400;
  --bwb-charcoal: #171717;
  --bwb-white: #fff;
  --bwb-paper: #f4f4f4;
  --bwb-line: #d9d9dc;
  --bwb-muted: #66666b;
  --bwb-font: Studio, Arial, sans-serif;
  font-family: var(--bwb-font);
  color: var(--bwb-charcoal);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bwb-chat-toggle {
  position: fixed;
  z-index: 99980;
  right: 22px;
  bottom: 22px;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bwb-red);
  color: var(--bwb-yellow);
  cursor: pointer;
  box-shadow:
    0 0 0 3px var(--bwb-white),
    0 0 0 6px var(--bwb-red),
    0 10px 28px rgba(23, 23, 23, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.bwb-chat-toggle:hover,
.bwb-chat-toggle:focus-visible {
  background: var(--bwb-red-deep);
  transform: scale(1.04);
}

.bwb-chat-toggle:focus-visible {
  outline: 3px solid var(--bwb-yellow);
  outline-offset: 4px;
}

.bwb-chat-toggle svg {
  width: 28px;
  height: 28px;
  display: block;
}

.bwb-chat-toggle[aria-expanded="true"] {
  background: var(--bwb-charcoal);
  color: var(--bwb-white);
  box-shadow: 0 8px 20px rgba(23, 23, 23, 0.3);
}

.bwb-chat-toggle-close {
  display: none;
  width: 22px;
  height: 22px;
}

.bwb-chat-toggle[aria-expanded="true"] .bwb-chat-toggle-bolt {
  display: none;
}

.bwb-chat-toggle[aria-expanded="true"] .bwb-chat-toggle-close {
  display: block;
}

.bwb-chat-panel {
  position: fixed;
  z-index: 99990;
  right: 22px;
  bottom: 96px;
  width: min(392px, calc(100vw - 28px));
  height: min(600px, calc(100vh - 180px));
  display: flex;
  flex-direction: column;
  background: var(--bwb-white);
  color: var(--bwb-charcoal);
  border: 1px solid var(--bwb-line);
  border-radius: 22px;
  box-shadow: 0 22px 50px rgba(23, 23, 23, 0.22);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bwb-chat-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.bwb-chat-header {
  flex: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 16px 14px 14px 16px;
  background: var(--bwb-charcoal);
  color: var(--bwb-white);
  border-bottom: 3px solid var(--bwb-red);
}

.bwb-chat-logo {
  height: 28px;
  width: auto;
  max-width: 132px;
  display: block;
  object-fit: contain;
}

.bwb-chat-header-copy {
  min-width: 0;
}

.bwb-chat-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--bwb-white);
}

.bwb-chat-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bwb-yellow);
}

.bwb-chat-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bwb-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bwb-chat-close:hover,
.bwb-chat-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.bwb-chat-close:focus-visible {
  outline: 2px solid var(--bwb-yellow);
  outline-offset: 2px;
}

.bwb-chat-close svg {
  width: 16px;
  height: 16px;
}

.bwb-chat-transcript {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px 10px;
  background: var(--bwb-paper);
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: auto;
}

.bwb-chat-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bwb-chat-msg p {
  margin: 0 0 0.7em;
}

.bwb-chat-msg p:last-child {
  margin-bottom: 0;
}

.bwb-chat-msg a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bwb-chat-msg--bot {
  align-self: flex-start;
  background: var(--bwb-white);
  color: var(--bwb-charcoal);
  border: 1px solid var(--bwb-line);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04);
}

.bwb-chat-msg--user {
  align-self: flex-end;
  background: var(--bwb-red);
  color: var(--bwb-white);
  border-bottom-right-radius: 6px;
}

.bwb-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.bwb-chat-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--bwb-charcoal);
  color: var(--bwb-white) !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.bwb-chat-link:hover,
.bwb-chat-link:focus-visible {
  background: var(--bwb-red);
}

.bwb-chat-link--secondary {
  background: var(--bwb-white);
  color: var(--bwb-charcoal) !important;
  border: 1px solid var(--bwb-line);
}

.bwb-chat-link--secondary:hover,
.bwb-chat-link--secondary:focus-visible {
  background: var(--bwb-paper);
  color: var(--bwb-red) !important;
}

.bwb-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 8px;
  background: var(--bwb-white);
  border-top: 1px solid var(--bwb-line);
}

.bwb-chat-chip {
  border: 1px solid var(--bwb-line);
  background: var(--bwb-white);
  color: var(--bwb-charcoal);
  border-radius: 999px;
  padding: 7px 11px;
  font: 700 12px/1.2 var(--bwb-font);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bwb-chat-chip:hover,
.bwb-chat-chip:focus-visible {
  border-color: var(--bwb-red);
  color: var(--bwb-red);
  background: #fff7f8;
}

.bwb-chat-chip:focus-visible {
  outline: 2px solid var(--bwb-yellow);
  outline-offset: 2px;
}

.bwb-chat-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bwb-white);
  border: 1px solid var(--bwb-line);
  border-radius: 16px;
  border-bottom-left-radius: 6px;
}

.bwb-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bwb-red);
  animation: bwb-chat-dot 1s ease-in-out infinite;
}

.bwb-chat-typing span:nth-child(2) {
  background: var(--bwb-charcoal);
  animation-delay: 0.15s;
}

.bwb-chat-typing span:nth-child(3) {
  background: var(--bwb-yellow);
  animation-delay: 0.3s;
}

@keyframes bwb-chat-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-3px); opacity: 1; }
}

.bwb-chat-composer {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px 12px 12px;
  background: var(--bwb-white);
  border-top: 1px solid var(--bwb-line);
}

.bwb-chat-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border: 1px solid var(--bwb-line);
  border-radius: 14px;
  padding: 10px 12px;
  font: 15px/1.35 var(--bwb-font);
  color: var(--bwb-charcoal);
  background: var(--bwb-paper);
}

.bwb-chat-input:focus {
  outline: none;
  border-color: var(--bwb-red);
  background: var(--bwb-white);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.55);
}

.bwb-chat-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--bwb-red);
  color: var(--bwb-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bwb-chat-send:hover,
.bwb-chat-send:focus-visible {
  background: var(--bwb-red-deep);
}

.bwb-chat-send:focus-visible {
  outline: 2px solid var(--bwb-yellow);
  outline-offset: 2px;
}

.bwb-chat-send:disabled {
  opacity: 0.4;
  cursor: default;
}

.bwb-chat-send svg {
  width: 18px;
  height: 18px;
}

.bwb-chat-fineprint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--bwb-muted);
  text-align: center;
}

/* Bottom sheet on phone-width viewports, including 390px */
@media (max-width: 430px) {
  .bwb-chat-toggle {
    right: 16px;
    bottom: 16px;
  }

  .bwb-chat-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: min(92vh, 760px);
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    transform: translateY(18px);
    transform-origin: bottom center;
  }

  .bwb-chat-panel.is-open {
    transform: none;
  }

  .bwb-chat-toggle[aria-expanded="true"] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bwb-chat-toggle,
  .bwb-chat-panel,
  .bwb-chat-chip,
  .bwb-chat-typing span {
    animation: none !important;
    transition: none !important;
  }

  .bwb-chat-panel {
    transform: none;
  }

  .bwb-chat-transcript {
    scroll-behavior: auto;
  }
}


/* Isolation: the live site's dark-theme rules target bare p, a, h2, button,
   textarea and label. These overrides keep the widget readable on top of it. */
.bwb-chat .bwb-chat-panel,
.bwb-chat .bwb-chat-transcript,
.bwb-chat .bwb-chat-chips,
.bwb-chat .bwb-chat-composer {
  background-color: var(--bwb-white);
  color: var(--bwb-charcoal);
}
.bwb-chat .bwb-chat-transcript {
  background-color: var(--bwb-paper);
}
.bwb-chat .bwb-chat-header,
.bwb-chat .bwb-chat-header p,
.bwb-chat .bwb-chat-header h2,
.bwb-chat .bwb-chat-title {
  color: var(--bwb-white) !important;
  background: transparent;
}
.bwb-chat .bwb-chat-subtitle {
  color: var(--bwb-yellow) !important;
}
.bwb-chat .bwb-chat-msg--bot,
.bwb-chat .bwb-chat-msg--bot p,
.bwb-chat .bwb-chat-msg--bot li,
.bwb-chat .bwb-chat-msg--bot span {
  color: #171717 !important;
  background: transparent;
  opacity: 1 !important;
}
.bwb-chat .bwb-chat-msg--bot {
  background: #fff !important;
}
.bwb-chat .bwb-chat-msg--user,
.bwb-chat .bwb-chat-msg--user p {
  color: #fff !important;
  background: transparent;
}
.bwb-chat .bwb-chat-msg--user {
  background: var(--bwb-red) !important;
}
.bwb-chat .bwb-chat-chip,
.bwb-chat button.bwb-chat-chip {
  color: #171717 !important;
  background: #fff !important;
  border: 1px solid var(--bwb-line) !important;
  text-transform: none;
  letter-spacing: 0.01em;
  opacity: 1 !important;
  box-shadow: none;
}
.bwb-chat .bwb-chat-chip:hover,
.bwb-chat .bwb-chat-chip:focus-visible {
  color: var(--bwb-red) !important;
  border-color: var(--bwb-red) !important;
  background: #fff7f8 !important;
}
.bwb-chat .bwb-chat-input,
.bwb-chat textarea.bwb-chat-input {
  color: #171717 !important;
  background: var(--bwb-paper) !important;
  border: 1px solid var(--bwb-line) !important;
  opacity: 1 !important;
}
.bwb-chat .bwb-chat-input:focus {
  background: #fff !important;
  border-color: var(--bwb-red) !important;
}
.bwb-chat .bwb-chat-send,
.bwb-chat button.bwb-chat-send {
  background: var(--bwb-red) !important;
  color: #fff !important;
  opacity: 1 !important;
  box-shadow: none;
}
.bwb-chat .bwb-chat-send:disabled {
  background: #d9d9dc !important;
  color: #66666b !important;
  opacity: 1 !important;
}
.bwb-chat .bwb-chat-fineprint,
.bwb-chat .bwb-chat-composer p {
  color: var(--bwb-muted) !important;
  background: transparent;
}
.bwb-chat .bwb-chat-link {
  color: #fff !important;
  background: var(--bwb-charcoal) !important;
}
.bwb-chat .bwb-chat-link--secondary {
  color: #171717 !important;
  background: #fff !important;
  border: 1px solid var(--bwb-line) !important;
}
.bwb-chat .bwb-chat-close,
.bwb-chat button.bwb-chat-close {
  color: #fff !important;
  background: transparent !important;
  box-shadow: none;
  text-transform: none;
}
.bwb-chat .bwb-chat-toggle {
  color: var(--bwb-yellow) !important;
  background: var(--bwb-red) !important;
}
.bwb-chat .bwb-chat-toggle[aria-expanded="true"] {
  color: #fff !important;
  background: var(--bwb-charcoal) !important;
}
