#bl-chat { --bl-chat-bottom: 24px; position: fixed; right: 24px; bottom: max(var(--bl-chat-bottom), env(safe-area-inset-bottom)); z-index: 900; font-family: Urbanist, Arial, sans-serif; color: #0f4c45; }
#bl-chat *, #bl-chat *::before, #bl-chat *::after { box-sizing: border-box; }
#bl-chat button, #bl-chat textarea, #bl-chat input { font: inherit; }
#bl-chat button { cursor: pointer; }
#bl-chat button:disabled { opacity: .6; cursor: default; }
#bl-chat :is(button, input, a):focus-visible { outline: 3px solid #6fd9b0 !important; outline-offset: 2px; }
#bl-chat .bl-chat-launch { display: grid; place-items: center; width: 56px; height: 56px; padding: 13px; border: 1px solid rgb(111 217 176 / .5); border-radius: 50%; background: #0f4c45; color: #fff; box-shadow: 0 4px 18px rgb(15 76 69 / .18); }
#bl-chat .bl-chat-launch svg { width: 28px; height: 28px; }
#bl-chat .bl-chat-panel { position: absolute; right: 0; bottom: 68px; width: 360px; height: 480px; max-width: calc(100vw - 32px); max-height: min(70vh, calc(100dvh - var(--bl-chat-bottom) - 80px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgb(15 76 69 / .15); border-radius: 20px; background: #fff; box-shadow: 0 8px 32px rgb(15 76 69 / .15); }
#bl-chat [hidden] { display: none !important; }
#bl-chat .bl-chat-head { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgb(255 255 255 / .12); background: #0f4c45; color: #fff; }
#bl-chat h2 { margin: 0; font-size: 19px; line-height: 1.3; color: #0f4c45; }
#bl-chat .bl-chat-close { flex: 0 0 44px; width: 44px; height: 44px; border: 0; background: transparent; color: #fff; font-size: 28px; }
#bl-chat .bl-chat-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
/* The inner stack grows with content so older messages stay scrollable. */
#bl-chat .bl-chat-stack { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
#bl-chat .bl-chat-stack > * { flex-shrink: 0; }
#bl-chat .bl-chat-message { width: fit-content; max-width: 92%; margin: 0 0 12px; padding: 12px; border: 1px solid #eaf7f1; border-radius: 14px; background: #fff; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
#bl-chat .bl-chat-user { margin-left: auto; background: #eaf7f1; }
#bl-chat .bl-chat-status { flex-shrink: 0; margin: 0; padding: 0 16px; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
#bl-chat .bl-chat-status:empty { display: none; }
#bl-chat .bl-chat-form { flex-shrink: 0; margin: 0; padding: 12px 16px 0; }
#bl-chat .bl-chat-compose { display: flex; align-items: flex-end; gap: 8px; }
#bl-chat textarea { flex: 1; min-width: 0; width: 100%; height: 44px; min-height: 44px; max-height: 110px; resize: none; border: 1px solid #0f4c45; border-radius: 10px; padding: 10px; font-size: 16px; line-height: 22px; overflow-y: auto; color: #0f4c45; background: #fff; }
#bl-chat .bl-chat-compose button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 11px; border: 0; border-radius: 50%; background: #0f4c45; color: #fff; }
#bl-chat .bl-chat-compose button svg { width: 22px; height: 22px; }
#bl-chat textarea:focus, #bl-chat textarea:focus-visible { border: 1px solid #0f4c45; outline: none !important; box-shadow: none; }
#bl-chat .bl-chat-notice { flex-shrink: 0; margin: 0; padding: 8px 16px 12px; font-size: 11px; line-height: 1.5; color: #66736d; }
#bl-chat .bl-chat-notice a { display: block; margin-top: 2px; color: inherit; text-decoration: underline; }

#bl-chat .bl-chat-brand { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; overflow: hidden; border-radius: 50%; background: #eaf7f1; color: #0f4c45; border: 0; }
#bl-chat .bl-chat-brand svg { display: block; width: 100%; height: 100%; }
#bl-chat .bl-chat-heading { min-width: 0; }
#bl-chat .bl-chat-head h2 { color: #fff; }
#bl-chat h2 { font-size: 17px; }
#bl-chat .bl-chat-subtitle { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 11px; line-height: 1.4; color: rgb(255 255 255 / .7); }
#bl-chat .bl-chat-subtitle > span { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #6fd9b0; }
#bl-chat .bl-chat-new { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 44px; margin-left: auto; padding: 6px; border: 0; background: transparent; color: #fff; }
#bl-chat .bl-chat-new svg { width: 20px; height: 20px; }
#bl-chat .bl-chat-chips { display: flex; flex-direction: column; width: 92%; gap: 10px; }
#bl-chat .bl-chat-chips button:not(.bl-chat-booking) { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(15,76,69,.12); border-radius: 12px; background: #fff; color: #0f4c45; font-size: 13px; line-height: 1.35; text-align: left; }
#bl-chat .bl-chat-chips button > span:last-child { flex-shrink: 0; }
#bl-chat .bl-chat-chips .bl-chat-booking { display: block; width: 100%; min-height: 32px; padding: 6px 0; border: 0; border-radius: 0; background: transparent; color: #0f4c45; font-size: 12px; line-height: 1.5; text-align: center; text-decoration: none; text-underline-offset: 3px; }
#bl-chat .bl-chat-greeting { width: 92%; background: #eaf7f1; border: 0; }
@media (hover: hover) {
  #bl-chat .bl-chat-chips button:not(.bl-chat-booking):hover { background: #eaf7f1; color: #0f4c45; border-color: #0f4c45; }
  #bl-chat .bl-chat-chips .bl-chat-booking:hover { text-decoration: underline; }
}
#bl-chat .bl-chat-lead { margin: 12px 0 0; padding: 16px; border: 1px solid #6fd9b0; border-radius: 16px; background: #eaf7f1; }
#bl-chat .bl-chat-lead h3 { margin: 0 0 12px; font-size: 16px; line-height: 1.4; }
#bl-chat .bl-chat-lead label { display: block; font-size: 13px; margin: 10px 0 6px; }
#bl-chat .bl-chat-lead input { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 1px solid rgb(15 76 69 / .3); border-radius: 10px; color: #0f4c45; background: #fff; font-size: 16px; }
#bl-chat .bl-chat-lead button { width: 100%; min-height: 44px; margin-top: 12px; border: 0; border-radius: 10px; background: #0f4c45; color: #fff; }
#bl-chat .bl-chat-lead-status { margin: 8px 0 0; font-size: 13px; line-height: 1.4; }
#bl-chat .bl-chat-lead-status:empty { display: none; }
#bl-chat .bl-chat-typing { display: flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 4px 16px; color: #66736d; font-size: 12px; }
#bl-chat .bl-chat-typing span { margin-right: 4px; }
#bl-chat .bl-chat-typing i { width: 4px; height: 4px; border-radius: 50%; background: #0f4c45; animation: bl-chat-dot 1.2s infinite; }
#bl-chat .bl-chat-typing i:nth-of-type(2) { animation-delay: .15s; }
#bl-chat .bl-chat-typing i:nth-of-type(3) { animation-delay: .3s; }
@keyframes bl-chat-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { #bl-chat .bl-chat-typing i { animation: none; } }
@media (max-width: 600px) {
  html.bl-chat-mobile-open, html.bl-chat-mobile-open body { overflow: hidden; }
  #bl-chat .bl-chat-panel { position: fixed; inset: var(--bl-chat-top, 0px) 0 auto; width: 100%; max-width: none; height: var(--bl-chat-height, 100dvh); max-height: var(--bl-chat-height, 100dvh); border: 0; border-radius: 20px 20px 0 0; }
  #bl-chat .bl-chat-head { padding-top: max(12px, env(safe-area-inset-top)); }
  #bl-chat .bl-chat-notice { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  #bl-chat:has(.bl-chat-panel:not([hidden])) .bl-chat-launch { visibility: hidden; }
}

/* Motion uses the launcher's lower-right anchor and respects reduced motion. */
#bl-chat .bl-chat-panel { transform-origin: bottom right; }
#bl-chat .bl-chat-launch { position: relative; }
#bl-chat .bl-chat-launch svg { position: absolute; inset: 0; margin: auto; transition: opacity 200ms ease, transform 200ms ease; }
#bl-chat .bl-chat-icon-bubble { opacity: 1; transform: rotate(0); }
#bl-chat .bl-chat-icon-close { opacity: 0; transform: rotate(-90deg); }
#bl-chat .bl-chat-launch[aria-expanded="true"] .bl-chat-icon-bubble { opacity: 0; transform: rotate(90deg); }
#bl-chat .bl-chat-launch[aria-expanded="true"] .bl-chat-icon-close { opacity: 1; transform: rotate(0); }
#bl-chat .bl-chat-enter { animation: bl-chat-message-in 150ms ease-out; }
@keyframes bl-chat-message-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #bl-chat .bl-chat-launch svg { transition: none; }
  #bl-chat .bl-chat-enter { animation: none; }
}

@media (max-width: 600px) {
  /* Reserve the page's final controls and avoid competing with mobile menus/forms. */
  body:has(.mn-open) #bl-chat,
  body:has(main :is(input, textarea, select):focus) #bl-chat .bl-chat-launch { visibility: hidden; pointer-events: none; }
  #bl-chat .bl-chat-messages { overflow-x: hidden; }
  #bl-chat .bl-chat-chips { max-width: 100%; }
  #bl-chat .bl-chat-chips button { overflow-wrap: anywhere; }
  #bl-chat .bl-chat-new { flex-basis: 44px; width: 44px; }
  #bl-chat .bl-chat-lead :is(input, button) { min-height: 48px; }
  #bl-chat .bl-chat-status { max-height: 64px; overflow-y: auto; }
}
