/* Hot bar (Book / Call / Chat) on the sample sites: shared layout and chat
   mechanics. Each site skins it in its own site.css (.hb variables). */
:where(.hb) { --hb-bg: #111; --hb-fg: #fff; --hb-accent: #fff; --hb-accent-fg: #111; --hb-panel: #fff; --hb-ink: #111; --hb-muted: #6b7280; --hb-soft: #f3f4f6; --hb-me: #111; --hb-me-fg: #fff; --hb-r: 18px; --hb-font: inherit;
}
.hb { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-family: var(--hb-font); }
.hb-bar { display: flex; gap: 4px; padding: 6px; background: var(--hb-bg); color: var(--hb-fg); border-radius: 999px; box-shadow: 0 24px 50px -18px rgba(0,0,0,.45); }
.hb-b { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: inherit; background: transparent; transition: background .25s, color .25s, transform .25s; cursor: pointer; border: 0; text-decoration: none; }
.hb [hidden] { display: none !important; }
.hb-b:hover { background: rgba(255,255,255,.12); }
.hb-b:active { transform: scale(.96); }
.hb-b i { display: grid; place-items: center; width: 20px; height: 20px; }
.hb-b i svg { width: 20px; height: 20px; }
.hb-book { background: var(--hb-accent); color: var(--hb-accent-fg); }
.hb-book:hover { background: var(--hb-accent); filter: brightness(1.06); }
.hb-dot { position: absolute; top: 6px; right: 8px; width: 17px; height: 17px; border-radius: 50%; background: #e5484d; color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--hb-bg); animation: hbpulse 1.8s ease-in-out infinite; }
@keyframes hbpulse { 50% { transform: scale(1.15); } }
.hb.open .hb-text { background: rgba(255,255,255,.16); }

.hb-greet { position: relative; display: flex; gap: 12px; align-items: flex-start; width: 300px; padding: 16px 38px 16px 16px; background: var(--hb-panel); color: var(--hb-ink); border-radius: var(--hb-r); box-shadow: 0 24px 50px -20px rgba(0,0,0,.4), 0 0 0 1px rgba(0,0,0,.05); cursor: pointer; opacity: 0; transform: translateY(10px) scale(.97); transform-origin: bottom right; transition: opacity .35s, transform .45s cubic-bezier(.22,1,.36,1); }
.hb-greet.on { opacity: 1; transform: none; }
.hb-greet img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.hb-greet b { display: block; font-size: 15px; line-height: 1.25; }
.hb-greet p { margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--hb-muted); }
.hb-gx { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: var(--hb-muted); display: grid; place-items: center; cursor: pointer; }
.hb-gx:hover { background: var(--hb-soft); }
.hb-gx svg, .hb-px svg { width: 14px; height: 14px; }

.hb-panel { width: 370px; height: min(540px, calc(100vh - 140px)); display: flex; flex-direction: column; background: var(--hb-panel); color: var(--hb-ink); border-radius: var(--hb-r); overflow: hidden; box-shadow: 0 40px 80px -24px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.05); opacity: 0; transform: translateY(14px) scale(.97); transform-origin: bottom right; transition: opacity .3s, transform .45s cubic-bezier(.22,1,.36,1); }
.hb-panel.on { opacity: 1; transform: none; }
.hb-ph { display: flex; align-items: center; gap: 12px; padding: 16px 14px 14px 16px; background: var(--hb-bg); color: var(--hb-fg); }
.hb-av { position: relative; flex: none; }
.hb-av img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; }
.hb-av::after { content: ""; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: #34c77b; box-shadow: 0 0 0 2px var(--hb-bg); }
.hb-ph b { display: block; font-size: 15px; }
.hb-ph small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .75; }
.hb-ph small i { width: 7px; height: 7px; border-radius: 50%; background: #34c77b; }
.hb-px { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: inherit; display: grid; place-items: center; cursor: pointer; }
.hb-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.hb-msg { max-width: 84%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; animation: hbin .35s cubic-bezier(.22,1,.36,1) both; }
@keyframes hbin { from { opacity: 0; transform: translateY(6px); } }
.hb-msg.them { align-self: flex-start; background: var(--hb-soft); border-bottom-left-radius: 6px; }
.hb-msg.them a { font-weight: 600; text-decoration: underline; color: inherit; }
.hb-msg.me { align-self: flex-end; background: var(--hb-me); color: var(--hb-me-fg); border-bottom-right-radius: 6px; }
.hb-msg.typing { display: flex; gap: 4px; padding: 14px 16px; }
.hb-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--hb-muted); opacity: .5; animation: hbty 1.1s infinite; }
.hb-msg.typing span:nth-child(2) { animation-delay: .15s; } .hb-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hbty { 30% { opacity: 1; transform: translateY(-3px); } }
.hb-msg.chips { background: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.hb-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; justify-content: flex-end; }
.hb-chips button, .hb-msg.chips button { height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--hb-me); background: transparent; color: var(--hb-me); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.hb-chips button:hover, .hb-msg.chips button:hover { background: var(--hb-me); color: var(--hb-me-fg); }
.hb-comp { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(0,0,0,.07); }
.hb-comp input { flex: 1; height: 44px; border: 0; border-radius: 999px; background: var(--hb-soft); padding: 0 16px; font: inherit; font-size: 14.5px; color: var(--hb-ink); outline: none; }
.hb-comp input:focus { box-shadow: 0 0 0 2px var(--hb-me); background: #fff; }
.hb-comp button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--hb-accent); color: var(--hb-accent-fg); display: grid; place-items: center; cursor: pointer; flex: none; }
.hb-comp button svg { width: 18px; height: 18px; }
.hb-demo { padding: 0 14px 10px; font-size: 11px; color: var(--hb-muted); text-align: center; }
body.lock .hb, body.drawer-open .hb { opacity: 0; pointer-events: none; }
.hb { transition: opacity .3s; }
@media (max-width: 700px) {
  .hb { left: 10px; right: 10px; bottom: 10px; align-items: stretch; }
  .hb-bar { justify-content: stretch; }
  .hb-b { flex: 1; justify-content: center; padding: 0 8px; font-size: 14px; }
  .hb-greet, .hb-panel { width: 100%; }
  .hb-panel { height: min(520px, calc(100vh - 110px)); }
  body { padding-bottom: 76px; }
  .sample { bottom: 80px !important; }
}

/* collapsed while the hero (which has its own call to action) is on screen:
   just a chat circle, then it grows into the full bar on scroll */
.hb-bar { transition: padding .5s cubic-bezier(.22,1,.36,1), gap .5s cubic-bezier(.22,1,.36,1), background .4s, box-shadow .4s; }
.hb-b { max-width: 220px; overflow: hidden; white-space: nowrap; transition: max-width .55s cubic-bezier(.22,1,.36,1), padding .55s cubic-bezier(.22,1,.36,1), opacity .35s, background .25s, color .25s, transform .25s; }
.hb-b span { display: inline-block; max-width: 120px; overflow: hidden; transition: max-width .5s cubic-bezier(.22,1,.36,1), opacity .3s; }
/* phones: labels like "Free estimate" fit instead of clipping at 120px */
@media (max-width: 700px) { .hb-b span { max-width: none; } .hb-b { gap: 6px; padding-left: 6px; padding-right: 6px; } }
.hb.mini .hb-bar { gap: 0; }
.hb.mini .hb-b:not(.hb-text) { max-width: 0; padding-left: 0; padding-right: 0; opacity: 0; pointer-events: none; }
.hb.mini .hb-text { width: 58px; height: 58px; padding: 0; justify-content: center; }
.hb.mini .hb-text span { max-width: 0; opacity: 0; }
.hb.mini .hb-text i, .hb.mini .hb-text i svg { width: 24px; height: 24px; }
.hb.mini .hb-bar { padding: 4px; }
@media (max-width: 700px) { .hb.mini { left: auto; right: 14px; bottom: 14px; align-items: flex-end; } .hb.mini .hb-bar { justify-content: flex-end; } .hb.mini .hb-b.hb-text { flex: none; } }
