.bf-chat {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 10000;
  display: grid;
  grid-template-rows: auto minmax(10rem, 19rem) auto;
  width: min(23rem, calc(100vw - 2rem));
  overflow: hidden;
  color: #eef7fc;
  background: #0b1b30;
  border: 1px solid #526677;
  border-radius: 1.25rem;
  box-shadow: 0 2rem 5.5rem rgba(0, 0, 0, 0.28);
  font: 1rem/1.45 "Lato", system-ui, sans-serif;
}

.bf-chat *, .bf-chat *::before, .bf-chat *::after { box-sizing: border-box; }
.bf-chat ::selection { color: #071322; background: #84cdf1; }
.bf-chat header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.1rem; background: #112941; border-bottom: 1px solid #526677; }
.bf-chat header > div { display: flex; align-items: center; gap: .7rem; }
.bf-chat header > .bf-chat-controls { display: none; gap: .35rem; }
.bf-chat-controls button { display: grid; width: 2.75rem; height: 2.75rem; padding: 0; place-items: center; color: #eef7fc; background: transparent; border: 1px solid transparent; border-radius: 999px; cursor: pointer; }
.bf-chat-controls button:hover { background: #0b1b30; border-color: #526677; }
.bf-chat-controls button > span { position: relative; display: block; width: 1rem; height: 1rem; }
.bf-chat-size > span { border: 1.5px solid currentColor; }
.bf-chat-size > span::after { position: absolute; right: 2px; bottom: 2px; left: 2px; height: 1.5px; background: currentColor; content: ""; opacity: 0; }
.bf-chat.bf-chat-full .bf-chat-size > span { border: 0; }
.bf-chat.bf-chat-full .bf-chat-size > span::after { top: 7px; right: 0; bottom: auto; left: 0; opacity: 1; }
.bf-chat-close > span::before, .bf-chat-close > span::after { position: absolute; top: 7px; left: 0; width: 1rem; height: 1.5px; background: currentColor; content: ""; transform: rotate(45deg); }
.bf-chat-close > span::after { transform: rotate(-45deg); }
.bf-chat header strong, .bf-chat header span { display: block; }
.bf-chat header strong { line-height: 1.2; }
.bf-chat header div div span { margin-top: .16rem; color: #a8bac7; font-size: .8125rem; }
.bf-chat-avatar { display: grid !important; width: 2.45rem; height: 2.45rem; flex: 0 0 auto; place-items: center; color: #071322; background: #5badda; border-radius: 50%; font-weight: 900; }
.bf-chat-messages { display: flex; flex-direction: column; gap: .65rem; min-height: 10rem; overflow-y: auto; padding: 1rem; scrollbar-color: #526677 #0b1b30; }
.bf-chat-bubble { width: fit-content; max-width: 84%; margin: 0; padding: .68rem .82rem; color: #eef7fc; background: #112941; border-radius: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bf-chat-bubble.visitor { align-self: end; color: #071322; background: #5badda; border-radius: 12px; }
.bf-chat-typing { display: flex; align-items: center; gap: .6rem; width: fit-content; padding: .6rem .75rem; color: #a8bac7; background: #112941; border-radius: 12px; font-size: .8125rem; }
.bf-chat-typing-dots { display: flex !important; align-items: center; gap: .22rem; }
.bf-chat-typing-dots i { display: block; width: .34rem; height: .34rem; background: #45b7e8; border-radius: 50%; animation: bf-chat-typing-pulse 1.15s cubic-bezier(.2, .8, .2, 1) infinite; }
.bf-chat-typing-dots i:nth-child(2) { animation-delay: .14s; }
.bf-chat-typing-dots i:nth-child(3) { animation-delay: .28s; }
.bf-chat-send { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; padding: .8rem; border-top: 1px solid #526677; }
.bf-chat-send input { min-width: 0; min-height: 2.75rem; padding: .6rem .72rem; color: #eef7fc; background: #071322; border: 1px solid #526677; border-radius: 12px; caret-color: #84cdf1; font: inherit; }
.bf-chat-send input::placeholder { color: #a8bac7; }
.bf-chat-send button { min-height: 2.75rem; padding: .6rem .9rem; color: #071322; background: #5badda; border: 0; border-radius: 999px; font: 900 .9rem/1 "Lato", system-ui, sans-serif; cursor: pointer; }
.bf-chat-send button:hover { background: #84cdf1; }
.bf-chat-send button:disabled { cursor: wait; opacity: .6; }
.bf-chat :focus-visible { outline: 3px solid #84cdf1; outline-offset: 2px; }
.bf-chat-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.bf-chat[hidden], .bf-chat-launcher[hidden] { display: none; }
.bf-chat-launcher { display: none; }

@keyframes bf-chat-typing-pulse {
  0%, 60%, 100% { opacity: .4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-.18rem); }
}

@media (max-width: 60rem) {
  .bf-chat.bf-chat-mobile { right: .65rem; bottom: .65rem; width: calc(100vw - 1.3rem); height: calc(50vh - .65rem); height: calc(50dvh - .65rem); grid-template-rows: auto minmax(0, 1fr) auto; }
  .bf-chat.bf-chat-mobile.bf-chat-full { top: calc(5rem + env(safe-area-inset-top)); right: .65rem; bottom: max(.65rem, env(safe-area-inset-bottom)); left: .65rem; width: auto; height: auto; }
  .bf-chat.bf-chat-mobile header { padding: .75rem .85rem; }
  .bf-chat.bf-chat-mobile header > .bf-chat-controls { display: flex; }
  .bf-chat-launcher.bf-chat-mobile { position: fixed; right: max(.8rem, env(safe-area-inset-right)); bottom: max(.8rem, env(safe-area-inset-bottom)); z-index: 10000; width: 3.5rem; height: 3.5rem; padding: 0; color: #fff; background: #007aff; border: 1px solid #66b2ff; border-radius: 50%; box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.28); cursor: pointer; place-items: center; }
  .bf-chat-launcher.bf-chat-mobile:not([hidden]) { display: grid; }
  .bf-chat-launcher.bf-chat-mobile:focus-visible { outline: 3px solid #84cdf1; outline-offset: 3px; }
  .bf-chat-launcher-icon { width: 1.65rem; height: 1.65rem; fill: currentColor; }
  .bf-chat-launcher-badge { position: absolute; top: -.35rem; right: -.35rem; min-width: 1.45rem; height: 1.45rem; padding: 0 .3rem; display: grid; place-items: center; color: #fff; background: #ff3b30; border: 2px solid #fff; border-radius: 999px; box-shadow: 0 .15rem .35rem rgba(0, 0, 0, 0.28); font: 800 .75rem/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
  .bf-chat-launcher-badge[hidden] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bf-chat-typing-dots i { animation: none; opacity: .75; }
}

