/* Website assistant - floating chat window. Accent colour comes from --cb-accent (set per site in include/chatbot-widget.php). */
#cbRoot { --cb-accent: #e86732; --cb-accent-dark: #c9501d; --cb-ink: #181a20; --cb-muted: #717171; --cb-bg: #ffffff; --cb-soft: #f5f6f8; font-family: "Noto Sans", Arial, sans-serif; }
#cbRoot *, #cbRoot *::before, #cbRoot *::after { box-sizing: border-box; }

/* keep the existing back-to-top button above the chat button */
.scrollToHome { right: 34px !important; }
.scrollToHome.show { bottom: 104px !important; right: 34px !important; }

.cb-launch { position: fixed; right: 24px; bottom: 24px; z-index: 99990; width: 62px; height: 62px; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--cb-accent), var(--cb-accent-dark)); box-shadow: 0 10px 28px rgba(0,0,0,.28); display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease, box-shadow .25s ease; }
.cb-launch:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 14px 34px rgba(0,0,0,.34); }
.cb-launch:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--cb-accent); }
.cb-launch svg { width: 30px; height: 30px; fill: currentColor; transition: transform .3s ease, opacity .3s ease; }
.cb-launch .cb-ico-close { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.5); }
.cb-open .cb-launch .cb-ico-chat { opacity: 0; transform: rotate(90deg) scale(.5); }
.cb-open .cb-launch .cb-ico-close { opacity: 1; transform: none; }
.cb-launch::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--cb-accent); animation: cb-pulse 2.6s ease-out infinite; pointer-events: none; }
.cb-open .cb-launch::after { display: none; }
@keyframes cb-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.65); opacity: 0; } }

.cb-nudge { position: fixed; right: 96px; bottom: 36px; z-index: 99989; max-width: 230px; padding: 11px 14px; border-radius: 14px 14px 4px 14px; background: #fff; color: var(--cb-ink);
  font-size: 14px; line-height: 1.35; box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: pointer; animation: cb-rise .5s ease both; }
.cb-nudge button { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--cb-ink); color: #fff; font-size: 13px; line-height: 22px; cursor: pointer; padding: 0; }
.cb-open .cb-nudge { display: none; }

.cb-panel { position: fixed; right: 24px; bottom: 100px; z-index: 99991; width: 380px; max-width: calc(100vw - 24px); height: 590px; max-height: calc(100vh - 124px); display: none; flex-direction: column;
  background: var(--cb-bg); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 60px rgba(0,0,0,.35); transform-origin: bottom right; }
.cb-open .cb-panel { display: flex; animation: cb-pop .28s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes cb-pop { from { opacity: 0; transform: translateY(18px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes cb-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.cb-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; background: linear-gradient(135deg, var(--cb-ink), #2b2f3a); }
.cb-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: var(--cb-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; position: relative; }
.cb-avatar::after { content: ""; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #35d07f; border: 2px solid #23262f; }
.cb-title { flex: 1; min-width: 0; }
.cb-title strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-title span { font-size: 12px; opacity: .8; }
.cb-x { background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 6px; opacity: .8; }
.cb-x:hover { opacity: 1; }

.cb-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--cb-soft); scroll-behavior: smooth; }
.cb-msg { display: flex; margin-bottom: 12px; animation: cb-rise .25s ease both; }
.cb-msg.cb-me { justify-content: flex-end; }
.cb-bubble { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; color: var(--cb-ink); background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); border-bottom-left-radius: 4px; overflow-wrap: anywhere; }
.cb-me .cb-bubble { background: var(--cb-accent); color: #fff; border-radius: 16px; border-bottom-right-radius: 4px; }
.cb-bubble p { margin: 0 0 6px; } .cb-bubble p:last-child { margin-bottom: 0; }
.cb-bubble ul { margin: 4px 0 6px; padding-left: 18px; } .cb-bubble li { margin-bottom: 3px; }
.cb-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.cb-links a { display: inline-block; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--cb-accent); color: var(--cb-accent-dark); font-size: 13px; text-decoration: none; background: #fff; transition: background .2s, color .2s; }
.cb-links a:hover, .cb-links a:focus-visible { background: var(--cb-accent); color: #fff; }

.cb-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.cb-typing i { width: 7px; height: 7px; border-radius: 50%; background: #aab; animation: cb-dot 1.1s infinite ease-in-out; }
.cb-typing i:nth-child(2) { animation-delay: .15s; } .cb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cb-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.cb-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 14px 10px; background: var(--cb-soft); }
.cb-chips button { border: 1px solid #d5d8de; background: #fff; color: var(--cb-ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: all .2s; }
.cb-chips button:hover, .cb-chips button:focus-visible { border-color: var(--cb-accent); color: var(--cb-accent-dark); transform: translateY(-1px); }

.cb-form { margin-top: 10px; display: grid; gap: 7px; }
.cb-form input[type=text], .cb-form input[type=tel] { width: 100%; padding: 9px 11px; border: 1px solid #cfd3da; border-radius: 10px; font-size: 14px; }
.cb-form input:focus { outline: 2px solid var(--cb-accent); border-color: transparent; }
.cb-form .cb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cb-form button { padding: 9px 12px; border: 0; border-radius: 10px; background: var(--cb-accent); color: #fff; font-weight: 600; cursor: pointer; }
.cb-form button:disabled { opacity: .6; cursor: default; }
.cb-err { color: #c0392b; font-size: 13px; }

.cb-input { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #e6e8ec; }
.cb-input input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid #d5d8de; border-radius: 999px; font-size: 14px; }
.cb-input input:focus { outline: 2px solid var(--cb-accent); border-color: transparent; }
.cb-input button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--cb-accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.cb-input button:hover { transform: scale(1.07); }
.cb-input button svg { width: 20px; height: 20px; fill: currentColor; }
.cb-foot { padding: 0 12px 9px; background: #fff; font-size: 11px; color: var(--cb-muted); text-align: center; }

@media (max-width: 520px) {
  .cb-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .cb-launch { right: 16px; bottom: 16px; }
  .cb-nudge { right: 88px; bottom: 26px; }
  .cb-open .cb-launch { display: none; }
}
@media (prefers-reduced-motion: reduce) { #cbRoot *, #cbRoot *::before, #cbRoot *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
