/* AI-Frontiers website assistant v1.0 (uses the brand tokens from site.css) */
.cb-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 70; height: 58px; padding: 0 20px 0 16px; border: 0; border-radius: 29px; background: var(--navy); color: var(--white); display: inline-flex; align-items: center; gap: 8px; font: 700 15px/1 var(--font); box-shadow: 0 10px 28px rgba(23, 54, 125, .35); cursor: pointer; transition: transform .15s; }
.cb-launcher:hover { transform: translateY(-2px); }
.cb-launcher svg { flex-shrink: 0; }
body.has-chatbot .wa-fab { bottom: 92px; }
body.cb-open .wa-fab { display: none; }

.cb-panel { position: fixed; right: 20px; bottom: 90px; z-index: 80; width: 380px; max-width: calc(100vw - 32px); height: min(620px, calc(100vh - 120px)); background: var(--white); border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(15, 23, 48, .25); display: flex; flex-direction: column; overflow: hidden; font-family: var(--font); }
.cb-panel[hidden] { display: none; }
.cb-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--navy); color: var(--white); }
.cb-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cb-avatar svg { width: 22px; height: 22px; }
.cb-title { display: grid; flex-grow: 1; line-height: 1.3; }
.cb-title strong { font-size: 15px; }
.cb-title span { font-size: 12px; color: #C9D3EE; }
.cb-close { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cb-close:hover { background: rgba(255, 255, 255, .12); }

.cb-log { flex-grow: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.cb-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; word-wrap: break-word; }
.cb-msg p { margin: 0; }
.cb-msg p + p, .cb-msg ul + p, .cb-msg p + ul { margin-top: 6px; }
.cb-msg ul { margin: 4px 0 0; padding-left: 18px; }
.cb-msg a { color: var(--navy); font-weight: 600; }
.cb-bot { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.cb-user { align-self: flex-end; background: var(--navy); color: var(--white); border-bottom-right-radius: 4px; }
.cb-typing { display: inline-flex; gap: 4px; padding: 14px; }
.cb-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: cbDot 1s infinite ease-in-out; }
.cb-typing span:nth-child(2) { animation-delay: .15s; }
.cb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cbDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.cb-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; background: var(--bg); }
.cb-suggest:not(:empty) { padding-bottom: 10px; }
.cb-chip { border: 1px solid var(--line-2); background: var(--white); color: var(--navy); border-radius: 16px; padding: 6px 12px; font: 600 13px/1.3 var(--font); cursor: pointer; text-align: left; }
.cb-chip:hover { background: var(--navy-soft); }

.cb-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--white); }
.cb-form input { flex-grow: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: 22px; font: 15px var(--font); color: var(--ink); }
.cb-form input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(23, 54, 125, .15); }
.cb-send { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.cb-foot { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--muted); text-align: center; background: var(--white); }
.cb-foot a { color: var(--navy); font-weight: 600; }
.cb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.cb-handoff, .cb-lead { align-self: stretch; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-size: 14px; display: grid; gap: 8px; }
.cb-handoff p, .cb-lead p { margin: 0; }
.cb-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--navy); background: var(--white); color: var(--navy); font: 700 13.5px var(--font); text-decoration: none; cursor: pointer; }
.cb-btn-primary { background: var(--navy); color: var(--white); }
.cb-btn-wa { background: #25D366; border-color: #25D366; color: var(--white); }
.cb-btn[disabled] { opacity: .6; cursor: wait; }
.cb-lead input[type=text], .cb-lead input[type=email], .cb-lead input[type=tel], .cb-lead textarea { width: 100%; padding: 9px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; font: 14px var(--font); color: var(--ink); }
.cb-lead textarea { resize: vertical; }
.cb-lead input:focus, .cb-lead textarea:focus { outline: none; border-color: var(--navy); }
.cb-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--slate); }
.cb-consent input { margin-top: 2px; accent-color: var(--navy); }
.cb-err { color: var(--danger); font-size: 13px; }
.cb-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; }

@media (max-width: 560px) {
  .cb-launcher { right: 14px; bottom: 14px; height: 54px; padding: 0 16px 0 14px; }
  .cb-launcher-label { display: none; }
  .cb-launcher { width: 54px; padding: 0; justify-content: center; }
  body.has-chatbot .wa-fab { bottom: 80px; }
  .cb-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  body.cb-open .cb-launcher { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cb-typing span { animation: none; } }
