/* BBS chat consultant — in the design's palette (#f5f5f1 / #17191c / #3152ff), Manrope + IBM Plex Mono */
.bbs-chat{--c-bg:#f5f5f1;--c-ink:#17191c;--c-mute:#6c6f68;--c-line:#d9dbd2;--c-blue:#3152ff;--c-blue-soft:#e7ebff;
  position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:90;
  font-family:Manrope,Arial,sans-serif;color:var(--c-ink);display:flex;flex-direction:column;align-items:flex-end;gap:12px;pointer-events:none}
.bbs-chat>*{pointer-events:auto}
.bbs-chat.raised{bottom:max(86px,calc(env(safe-area-inset-bottom) + 86px))}
.bbs-chat [hidden]{display:none!important}

/* avatar */
.bbs-chat-ava{position:relative;flex:none;width:44px;height:44px;border-radius:50%;background:var(--c-blue);color:#fff;display:grid;place-items:center;font-weight:700;font-size:18px}
.bbs-chat-ava img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}
.bbs-chat-online{position:absolute;right:0;bottom:1px;width:11px;height:11px;border-radius:50%;background:#2fc56b;border:2px solid var(--c-bg)}

/* launcher */
.bbs-chat-launcher{position:relative;width:64px;height:64px;border-radius:50%;border:0;padding:0;background:var(--c-ink);display:grid;place-items:center;cursor:pointer;
  box-shadow:0 14px 40px #11172240;transition:transform .2s ease}
.bbs-chat-launcher:hover{transform:translateY(-2px)}
.bbs-chat-launcher .bbs-chat-ava{width:52px;height:52px}
.bbs-chat-launcher .bbs-chat-online{border-color:var(--c-ink)}
.bbs-chat-badge{position:absolute;top:-2px;right:-2px;min-width:22px;height:22px;border-radius:11px;background:#ff3b30;color:#fff;font:700 12.5px/22px Manrope,Arial,sans-serif;text-align:center}
.bbs-chat.invite .bbs-chat-launcher{animation:bbs-chat-pulse 2.4s ease-out 3}
@keyframes bbs-chat-pulse{0%{box-shadow:0 0 0 0 #3152ff80,0 14px 40px #11172240}70%{box-shadow:0 0 0 18px #3152ff00,0 14px 40px #11172240}100%{box-shadow:0 0 0 0 #3152ff00,0 14px 40px #11172240}}

/* teaser (proactive message) */
.bbs-chat-teaser{position:relative;width:min(320px,calc(100vw - 36px));background:#fff;border-radius:18px 18px 4px 18px;padding:16px 18px 14px;
  box-shadow:0 20px 60px #1117222e;animation:bbs-chat-in .35s cubic-bezier(.16,.8,.2,1)}
.bbs-chat-teaser-head{display:flex;gap:10px;align-items:center;margin-bottom:10px;padding-right:22px}
.bbs-chat-teaser-head .bbs-chat-ava{width:36px;height:36px;font-size:15px}
.bbs-chat-teaser-head b,.bbs-chat-head b{display:block;font-size:15.5px;line-height:1.2}
.bbs-chat-teaser-head small,.bbs-chat-head small{display:block;font:400 12.5px/1.4 'IBM Plex Mono',monospace;color:var(--c-mute);letter-spacing:.02em}
.bbs-chat-teaser-text{margin:0 0 12px;font-size:16px;line-height:1.5;cursor:pointer}
.bbs-chat-teaser-reply{border:0;background:var(--c-blue);color:#fff;border-radius:40px;padding:11px 18px;font:600 15px/1 Manrope,Arial,sans-serif;cursor:pointer}
.bbs-chat-teaser-close{position:absolute;top:8px;right:10px;width:30px;height:30px;border:0;background:none;font-size:22px;line-height:1;color:var(--c-mute);cursor:pointer}

/* panel */
.bbs-chat-panel{width:min(380px,calc(100vw - 24px));height:min(560px,calc(100svh - 120px));background:var(--c-bg);border-radius:20px;overflow:hidden;
  display:flex;flex-direction:column;box-shadow:0 30px 100px #11172255;animation:bbs-chat-in .3s cubic-bezier(.16,.8,.2,1)}
@keyframes bbs-chat-in{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
.bbs-chat-head{display:flex;align-items:center;gap:12px;padding:16px 16px 14px 18px;background:var(--c-ink);color:#fff}
.bbs-chat-head small{color:#b9bcb3}
.bbs-chat-head .bbs-chat-online{border-color:var(--c-ink)}
.bbs-chat-head>div{flex:1;min-width:0}
.bbs-chat-close{width:36px;height:36px;border-radius:50%;border:1px solid #ffffff40;background:none;color:#fff;font-size:22px;line-height:1;cursor:pointer}
.bbs-chat-log{flex:1;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}
.bbs-chat-msg{max-width:86%;padding:11px 14px;border-radius:16px;font-size:16px;line-height:1.5;word-wrap:break-word;animation:bbs-chat-in .25s ease}
.bbs-chat-msg.bot{align-self:flex-start;background:#fff;border-bottom-left-radius:4px}
.bbs-chat-msg.user{align-self:flex-end;background:var(--c-blue);color:#fff;border-bottom-right-radius:4px}
.bbs-chat-msg.typing{display:flex;gap:5px;padding:15px 16px}
.bbs-chat-msg.typing span{width:7px;height:7px;border-radius:50%;background:#a7aaa2;animation:bbs-chat-dot 1s infinite}
.bbs-chat-msg.typing span:nth-child(2){animation-delay:.15s}.bbs-chat-msg.typing span:nth-child(3){animation-delay:.3s}
@keyframes bbs-chat-dot{0%,60%,100%{transform:none;opacity:.5}30%{transform:translateY(-4px);opacity:1}}
.bbs-chat-msg.quick{background:none;padding:0;display:flex;flex-wrap:wrap;gap:8px;max-width:100%}
.bbs-chat-msg.quick button{border:1px solid var(--c-blue);background:#fff;color:var(--c-blue);border-radius:40px;padding:9px 14px;font:500 15px/1.25 Manrope,Arial,sans-serif;cursor:pointer;text-align:left}
.bbs-chat-msg.quick button:hover{background:var(--c-blue-soft)}

/* call-back form inside the log */
.bbs-chat-form{display:grid;gap:10px;width:100%;max-width:100%}
.bbs-chat-form label{display:grid;gap:5px;font:500 12.5px/1.3 'IBM Plex Mono',monospace;text-transform:uppercase;letter-spacing:.06em;color:var(--c-mute)}
.bbs-chat-form input[type=text],.bbs-chat-form input:not([type]),.bbs-chat-form input[type=tel]{font:400 16px/1.3 Manrope,Arial,sans-serif;color:var(--c-ink);text-transform:none;letter-spacing:0;
  border:1px solid var(--c-line);border-radius:12px;padding:12px 13px;background:var(--c-bg);width:100%;box-sizing:border-box}
.bbs-chat-form input:focus{outline:2px solid var(--c-blue);outline-offset:1px;border-color:transparent}
.bbs-chat-consent{display:flex!important;gap:9px;align-items:flex-start;text-transform:none!important;letter-spacing:0!important;font:400 13px/1.45 Manrope,Arial,sans-serif!important}
.bbs-chat-consent input{margin:2px 0 0;width:17px;height:17px;accent-color:var(--c-blue);flex:none}
.bbs-chat-consent a{color:var(--c-blue)}
.bbs-chat-form button[type=submit]{border:0;background:var(--c-ink);color:#fff;border-radius:40px;padding:13px 18px;font:600 15.5px/1 Manrope,Arial,sans-serif;cursor:pointer}
.bbs-chat-form button[disabled]{opacity:.6;cursor:progress}
.bbs-chat-err{margin:0;color:#c62828;font-size:14px}

/* input bar */
.bbs-chat-input{display:flex;gap:8px;padding:12px;border-top:1px solid var(--c-line);background:#fff}
.bbs-chat-input input{flex:1;min-width:0;border:0;background:var(--c-bg);border-radius:40px;padding:12px 16px;font:400 16px/1.2 Manrope,Arial,sans-serif;color:var(--c-ink)}
.bbs-chat-input input:focus{outline:2px solid var(--c-blue)}
.bbs-chat-input button{width:44px;height:44px;flex:none;border-radius:50%;border:0;background:var(--c-blue);color:#fff;font-size:18px;cursor:pointer}

@media (max-width:560px){
  .bbs-chat{right:12px;bottom:max(12px,env(safe-area-inset-bottom))}
  .bbs-chat.open{left:0;right:0;bottom:0;top:0;align-items:stretch;justify-content:flex-end;gap:0}
  .bbs-chat.open .bbs-chat-launcher{display:none}
  .bbs-chat.open .bbs-chat-panel{width:100%;height:100%;border-radius:0}
  .bbs-chat-launcher{width:58px;height:58px}.bbs-chat-launcher .bbs-chat-ava{width:48px;height:48px}
}
@media (prefers-reduced-motion:reduce){.bbs-chat *{animation:none!important;transition:none!important}}
.bbs-chat .visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* performance: the teaser floats above the launcher instead of growing the fixed container (no layout shift),
   the invite pulse is a transform/opacity ring the compositor can animate (box-shadow animation repaints) */
.bbs-chat-teaser{position:absolute;right:0;bottom:calc(100% + 12px)}
.bbs-chat.invite .bbs-chat-launcher{animation:none}
.bbs-chat-launcher::after{content:'';position:absolute;inset:0;border-radius:50%;border:2px solid #3152ff;opacity:0;pointer-events:none}
.bbs-chat.invite .bbs-chat-launcher::after{animation:bbs-chat-ring 2.4s ease-out 3}
@keyframes bbs-chat-ring{0%{transform:scale(1);opacity:.7}70%{transform:scale(1.55);opacity:0}100%{transform:scale(1.55);opacity:0}}
@media (prefers-reduced-motion:reduce){.bbs-chat.invite .bbs-chat-launcher::after{animation:none}}
