#bac-root {
  --bac-teal: #0e5e5a;
  --bac-deep: #0b3b3a;
  --bac-ink: #102a2b;
  --bac-amber: #f0a04b;
  --bac-sand: #f6f3ec;
  --bac-line: #e3ddd0;
  position: fixed;
  right: 28px;
  bottom: 30px;
  z-index: 99990;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--bac-ink);
}
#bac-root.bac-raised { bottom: 104px; }
#bac-root.bac-left { right: auto; left: 28px; }
#bac-root *, #bac-root *::before, #bac-root *::after { box-sizing: border-box; }

.bac-launcher {
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 20px 0 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--bac-teal); color: #fff;
  font: inherit; font-weight: 700;
  box-shadow: 0 10px 28px rgba(16, 42, 43, .28);
  transition: transform .15s ease, background .15s ease;
}
.bac-launcher:hover { background: var(--bac-deep); transform: translateY(-1px); }
.bac-launcher:focus-visible, .bac-chip:focus-visible, .bac-send:focus-visible, .bac-close:focus-visible { outline: 3px solid var(--bac-amber); outline-offset: 2px; }
.bac-open .bac-launcher { display: none; }

.bac-dots, .bac-avatar { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.bac-dots { width: 32px; height: 32px; border-radius: 10px 10px 10px 3px; background: var(--bac-sand); }
.bac-dots i, .bac-avatar i { width: 6px; height: 6px; border-radius: 50%; background: var(--bac-teal); display: block; }
.bac-dots i.bac-amber, .bac-avatar i.bac-amber { background: var(--bac-amber); }

.bac-panel {
  width: 370px; max-width: calc(100vw - 24px);
  height: 560px; max-height: calc(100vh - 110px);
  display: flex; flex-direction: column;
  background: #fbfaf6; border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(16, 42, 43, .3);
}
.bac-panel[hidden] { display: none; }

.bac-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--bac-teal); color: #fff; }
.bac-avatar { width: 38px; height: 38px; flex: none; border-radius: 12px 12px 12px 4px; background: var(--bac-sand); }
.bac-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bac-title strong { font-size: 16px; }
.bac-title small { font-size: 12.5px; opacity: .85; }
.bac-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.bac-close:hover, .bac-new:hover { background: rgba(255, 255, 255, .15); }
.bac-new { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; opacity: .85; }
.bac-new:focus-visible { outline: 3px solid var(--bac-amber); outline-offset: 2px; }

.bac-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.bac-msg { max-width: 86%; padding: 9px 13px; border-radius: 16px; word-wrap: break-word; }
.bac-msg p { margin: 0 0 6px; } .bac-msg p:last-child { margin-bottom: 0; }
.bac-msg ul { margin: 4px 0 6px; padding-left: 18px; } .bac-msg li { margin: 2px 0; }
.bac-msg a { color: var(--bac-teal); text-decoration: underline; overflow-wrap: anywhere; }
.bac-bot { align-self: flex-start; background: #fff; border: 1px solid var(--bac-line); border-bottom-left-radius: 4px; }
.bac-user { align-self: flex-end; background: #ddede7; background: color-mix(in srgb, var(--bac-teal) 15%, #fff); border-bottom-right-radius: 4px; white-space: pre-wrap; }

.bac-typing { display: inline-flex; gap: 5px; padding: 13px 14px; }
.bac-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa9a7; animation: bac-blink 1.2s infinite ease-in-out; }
.bac-typing i:nth-child(2) { animation-delay: .15s; } .bac-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bac-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.bac-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.bac-chips:empty { display: none; }
.bac-chip { border: 1.5px solid var(--bac-teal); background: #fff; color: var(--bac-teal); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; min-height: 36px; }
.bac-chip:hover { background: var(--bac-teal); color: #fff; }

.bac-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--bac-line); background: #fff; }
.bac-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; padding: 11px 14px; border: 1px solid var(--bac-line); border-radius: 22px; font: inherit; color: var(--bac-ink); background: #fff; }
.bac-form textarea:focus { outline: none; border-color: var(--bac-teal); box-shadow: 0 0 0 2px rgba(14, 94, 90, .15); }
.bac-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--bac-amber); color: var(--bac-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.bac-send:disabled { opacity: .5; cursor: default; }

.bac-foot { padding: 8px 14px 10px; font-size: 11.5px; color: #5d6d6b; background: #fff; text-align: center; }
.bac-foot a { color: var(--bac-teal); }
.bac-foot .bac-powered { display: inline-block; margin-top: 3px; color: #5d6d6b; font-weight: 600; text-decoration: none; }
.bac-foot .bac-powered:hover { color: var(--bac-teal); }
.bac-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 480px) {
  #bac-root { right: 12px; bottom: 12px; }
  #bac-root.bac-raised { bottom: 84px; }
  #bac-root.bac-open, #bac-root.bac-left.bac-open { right: 0; bottom: 0; left: 0; top: 0; }
  #bac-root.bac-open .bac-panel { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .bac-launcher-label { display: none; }
  .bac-launcher { width: 56px; padding: 0; justify-content: center; }
}
/* Welcome bubble */
.bac-nudge { position: absolute; bottom: 70px; right: 0; display: flex; align-items: flex-start; gap: 2px; width: max-content; max-width: 270px; padding: 12px 8px 12px 14px; background: #fff; color: #1d2b36; border-radius: 16px 16px 4px 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .25s ease, transform .25s ease; }
.bac-left .bac-nudge { right: auto; left: 0; border-radius: 16px 16px 16px 4px; }
.bac-nudge.bac-in { opacity: 1; transform: none; }
.bac-nudge-text { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-size: 14px; line-height: 1.4; text-align: left; color: inherit; cursor: pointer; }
.bac-nudge-x { flex: none; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: #7a8a96; font-size: 18px; line-height: 1; cursor: pointer; }
.bac-nudge-x:hover { background: #eef2f5; }
.bac-open .bac-nudge { display: none; }
/* Gentle attention pulse on the chat button until it's opened */
.bac-launcher::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 var(--bac-teal); animation: bac-pulse 2.4s ease-out 3; pointer-events: none; }
.bac-launcher { position: relative; }
@keyframes bac-pulse { 0% { box-shadow: 0 0 0 0 rgba(64, 118, 242, .45); } 100% { box-shadow: 0 0 0 16px rgba(64, 118, 242, 0); } }
@supports (color: color-mix(in srgb, red 50%, transparent)) {
  @keyframes bac-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bac-teal) 45%, transparent); } 100% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--bac-teal) 0%, transparent); } }
}
/* Quick-reply chips slide in */
.bac-chip { animation: bac-pop .28s ease both; }
.bac-chip:nth-child(2) { animation-delay: .04s; } .bac-chip:nth-child(3) { animation-delay: .08s; } .bac-chip:nth-child(4) { animation-delay: .12s; } .bac-chip:nth-child(5) { animation-delay: .16s; } .bac-chip:nth-child(6) { animation-delay: .2s; }
@keyframes bac-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bac-msg { animation: bac-pop .22s ease both; }
/* Confetti when an enquiry is sent */
.bac-panel { position: relative; }
.bac-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.bac-confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: bac-fall 2.2s cubic-bezier(.25, .6, .4, 1) forwards; }
@keyframes bac-fall { to { top: 105%; transform: translateX(30px) rotate(540deg); opacity: .2; } }
@media (max-width: 480px) { .bac-nudge { bottom: 66px; max-width: min(270px, calc(100vw - 40px)); } }
@media (prefers-reduced-motion: reduce) { .bac-typing i, .bac-launcher::after, .bac-chip, .bac-msg { animation: none; } .bac-launcher, .bac-nudge { transition: none; } }

/* Button links in answers */
#bac-root .bac-msg a.bac-cta {
  display: inline-block;
  margin: 6px 0 2px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bac-teal);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  transition: transform .15s ease, filter .15s ease;
}
#bac-root .bac-msg a.bac-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
#bac-root .bac-msg a.bac-cta:focus-visible { outline: 3px solid var(--bac-amber); outline-offset: 2px; }
