/* Website assistant on a business page: a bubble at the bottom right and the chat panel it opens. Classes start with bc-. */
.bc { --bc-brand: #4f46e5; --bc-brand-2: #2563eb; --bc-ink: #0f172a; --bc-muted: #64748b; --bc-line: #e5e7f0; font-family: inherit; }
.bc [hidden] { display: none !important; }
.bc button { font-family: inherit; }

/* the bubble */
.bc-bubble { position: fixed; right: 20px; bottom: 92px; z-index: 1040; display: inline-flex; align-items: center; gap: .55rem; border: 0; cursor: pointer; color: #fff; font-weight: 700; font-size: .95rem;
  padding: .8rem 1.2rem .8rem 1rem; border-radius: 999px; background: linear-gradient(135deg, var(--bc-brand), var(--bc-brand-2)); box-shadow: 0 12px 30px rgba(37,99,235,.40), 0 2px 6px rgba(15,23,42,.18); transition: transform .15s ease, box-shadow .15s ease; }
.bc-bubble i { font-size: 1.2rem; }
.bc-bubble:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(37,99,235,.46), 0 2px 6px rgba(15,23,42,.18); }
.bc-bubble:focus-visible, .bc-close:focus-visible, .bc-send:focus-visible, .bc-chips button:focus-visible, .bc-offer:focus-visible, .bc-owner-btn:focus-visible { outline: 3px solid rgba(79,70,229,.45); outline-offset: 2px; }
.bc.is-open .bc-bubble { display: none; }

/* the panel */
.bc-panel { position: fixed; right: 20px; bottom: 92px; z-index: 1045; width: 380px; max-width: calc(100vw - 24px); height: 600px; max-height: calc(100vh - 112px); display: flex; flex-direction: column;
  background: #fff; border-radius: 22px; box-shadow: 0 28px 70px rgba(15,23,42,.30), 0 0 0 1px rgba(15,23,42,.06); overflow: hidden; animation: bc-pop .18s ease-out; }
@keyframes bc-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.bc-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1rem .95rem; color: #fff; background: linear-gradient(135deg, var(--bc-brand), var(--bc-brand-2)); }
.bc-avatar { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: var(--bc-brand); background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.2); }
.bc-head-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bc .bc-head-main strong { font-size: 1rem; line-height: 1.2; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-head-main small { display: flex; align-items: center; gap: .4rem; color: rgba(255,255,255,.88); font-size: .76rem; }
.bc-head-main small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.28); flex: 0 0 auto; }
.bc-close { background: rgba(255,255,255,.18); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; display: grid; place-items: center; }
.bc-close:hover { background: rgba(255,255,255,.3); }

/* the conversation */
.bc-body { flex: 1; overflow-y: auto; padding: 1rem .95rem .75rem; display: flex; flex-direction: column; gap: .6rem; background: #f4f5fb; scroll-behavior: smooth; overscroll-behavior: contain; }
.bc-msg { max-width: 84%; padding: .65rem .9rem; border-radius: 18px; font-size: .94rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bc-msg--bot { align-self: flex-start; background: #fff; color: var(--bc-ink); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 0 0 1px rgba(15,23,42,.04); }
.bc-msg--me { align-self: flex-end; background: linear-gradient(135deg, var(--bc-brand), var(--bc-brand-2)); color: #fff; border-bottom-right-radius: 6px; }
.bc-typing { display: inline-flex; gap: 4px; align-items: center; padding: .85rem 1rem; }
.bc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: bc-dot 1s infinite ease-in-out; }
.bc-typing i:nth-child(2) { animation-delay: .15s; }
.bc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

.bc-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .1rem; }
.bc-chips button { border: 1.5px solid #c7d2fe; background: #fff; color: #3730a3; font-weight: 600; font-size: .85rem; padding: .42rem .9rem; border-radius: 999px; cursor: pointer; transition: background .12s, border-color .12s; }
.bc-chips button:hover { background: #eef2ff; border-color: #a5b4fc; }
.bc-offer { align-self: flex-start; display: inline-flex; align-items: center; gap: .4rem; border: 1.5px solid var(--bc-brand); background: #fff; color: var(--bc-brand); font-weight: 700; font-size: .86rem; padding: .45rem .95rem; border-radius: 999px; cursor: pointer; }
.bc-offer:hover { background: #eef2ff; }

/* the box for typing */
.bc-form { display: flex; align-items: center; gap: .4rem; margin: 0; padding: .35rem .35rem .35rem 1rem; background: #fff; border-top: 1px solid var(--bc-line); }
.bc-input { flex: 1; min-width: 0; border: 0; background: transparent; padding: .7rem 0; font: inherit; font-size: .96rem; color: var(--bc-ink); }
.bc-input::placeholder { color: #94a3b8; }
.bc-input:focus, .bc-input:focus-visible { outline: 0; box-shadow: none; }
.bc-form:focus-within { box-shadow: inset 0 2px 0 var(--bc-brand); }
.bc-send { flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; cursor: pointer; display: grid; place-items: center; background: linear-gradient(135deg, var(--bc-brand), var(--bc-brand-2)); transition: transform .12s; }
.bc-send:hover:not(:disabled) { transform: scale(1.06); }
.bc-send:disabled { opacity: .5; cursor: wait; }
.bc-owner-btn { display: flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-top: 1px solid var(--bc-line); background: #fafbff; color: var(--bc-muted); font-weight: 600; font-size: .8rem; padding: .55rem; cursor: pointer; }
.bc-owner-btn:hover { background: #f1f3ff; color: var(--bc-brand); }

/* the name and number form */
.bc-lead { padding: 1rem; border-top: 1px solid var(--bc-line); background: #fff; display: grid; gap: .6rem; }
.bc-lead-title { margin: 0; font-weight: 800; font-size: 1rem; color: var(--bc-ink); }
.bc-in { width: 100%; border: 1.5px solid #d5d9e6; border-radius: 12px; padding: .7rem .85rem; font: inherit; font-size: .96rem; color: var(--bc-ink); background: #fff; }
.bc-in:focus { outline: 0; border-color: var(--bc-brand); box-shadow: 0 0 0 3px rgba(79,70,229,.16); }
.bc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bc-err { margin: 0; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: .45rem .65rem; font-size: .85rem; }
.bc-send-lead { border: 0; border-radius: 12px; padding: .8rem; font-weight: 800; font-size: .95rem; color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--bc-brand), var(--bc-brand-2)); }
.bc-send-lead:disabled { opacity: .6; cursor: wait; }
.bc-link { background: none; border: 0; color: var(--bc-muted); font-size: .85rem; cursor: pointer; padding: .2rem; }
.bc-link:hover { text-decoration: underline; }

/* phones: a sheet from the bottom, with room for the on-screen keyboard */
@media (max-width: 767.98px) {
  .bc-bubble { right: 14px; bottom: 96px; padding: .75rem 1.05rem .75rem .95rem; }
  .bc-panel { left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; height: min(86vh, 640px); max-height: 100dvh; border-radius: 22px 22px 0 0; animation-name: bc-rise; }
  .bc-input, .bc-in { font-size: 16px; }   /* stops the phone zooming in when the box is tapped */
  .bc-form { padding-bottom: calc(.35rem + env(safe-area-inset-bottom)); }
}
@keyframes bc-rise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bc-panel, .bc-bubble, .bc-send { animation: none; transition: none; } }
body.dr-sheet-lock .bc-bubble { display: none; }
