/* Brain Bug Kids - "Ask Bug" parent assistant */
.bbc { font-family: 'Dosis', sans-serif; --p: #6F4A92; --pk: #DA5192; --y: #F5B831; }
.bbc button { font-family: 'Dosis', sans-serif !important; text-transform: none !important; letter-spacing: 0 !important; line-height: 1.2; cursor: pointer; box-shadow: none; }
#back_to_top span { bottom: 100px !important; } /* lift the theme's back-to-top above the chat launcher */

/* launcher */
.bbc-launch { position: fixed; right: 20px; bottom: 22px; z-index: 99990; display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 22px 0 8px !important; border: 0 !important; border-radius: 999px !important; background: linear-gradient(120deg, var(--p), #9A4F9E 60%, var(--pk)) !important; color: #fff !important; font-weight: 800 !important; font-size: 19px !important; box-shadow: 0 12px 28px rgba(111, 74, 146, .4) !important; transition: transform .25s cubic-bezier(.2, 1.6, .4, 1); animation: bbc-in .5s .3s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.bbc-launch:hover { transform: translateY(-3px) scale(1.04); }
.bbc-launch::before { content: ''; position: absolute; inset: 0; border-radius: 999px; box-shadow: 0 0 0 0 rgba(218, 81, 146, .55); animation: bbc-ring 2.6s ease-out 2s infinite; }
.bbc-launch-bug { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; font-size: 26px; animation: bbc-wiggle 3s ease-in-out infinite; }
.bbc.is-open .bbc-launch { transform: scale(0); pointer-events: none; }

/* teaser bubble */
.bbc-teaser { position: fixed; right: 20px; bottom: 96px; z-index: 99990; max-width: 260px; background: #fff; color: #444; border-radius: 18px 18px 4px 18px; padding: 14px 34px 14px 16px; font-size: 17px; line-height: 1.4; box-shadow: 0 14px 34px rgba(51, 30, 70, .2); cursor: pointer; opacity: 0; transform: translateY(12px) scale(.9); transform-origin: bottom right; transition: opacity .3s, transform .4s cubic-bezier(.2, 1.6, .4, 1); }
.bbc-teaser.is-in { opacity: 1; transform: none; }
.bbc-teaser b { color: var(--p); display: block; }
.bbc-teaser-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: #F6F0FB !important; color: var(--p) !important; font-size: 18px !important; line-height: 26px !important; }

/* panel */
.bbc-panel { position: fixed; right: 20px; bottom: 20px; z-index: 99991; width: 390px; height: min(620px, calc(100vh - 40px)); display: flex; flex-direction: column; background: #FBF8FD; border-radius: 26px; overflow: hidden; box-shadow: 0 24px 70px rgba(51, 30, 70, .35); transform-origin: bottom right; animation: bbc-open .45s cubic-bezier(.2, 1.4, .4, 1); }
.bbc-panel[hidden] { display: none; }
.bbc-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 14px 16px 16px; color: #fff; background: linear-gradient(120deg, var(--p), #9A4F9E 60%, var(--pk)); }
.bbc-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, #3ABDD6, var(--y), #EA8361, var(--pk), var(--p)); }
.bbc-head strong { display: block; font-size: 21px; font-weight: 800; }
.bbc-head em { font-style: normal; font-size: 14px; opacity: .92; display: flex; align-items: center; gap: 6px; }
.bbc-dot { width: 8px; height: 8px; border-radius: 50%; background: #5BE38C; box-shadow: 0 0 0 3px rgba(91, 227, 140, .3); animation: bbc-blink 2s ease-in-out infinite; }
.bbc-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; font-size: 26px; animation: bbc-wiggle 3s ease-in-out infinite; }
.bbc-av.sm { width: 30px; height: 30px; font-size: 17px; }
.bbc-reset, .bbc-x { margin-left: auto; width: 36px; height: 36px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: rgba(255, 255, 255, .2) !important; color: #fff !important; font-size: 24px !important; line-height: 36px !important; }
.bbc-reset { font-size: 20px !important; }
.bbc-x { margin-left: 6px; }

/* conversation */
.bbc-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.bbc-msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 16.5px; line-height: 1.5; animation: bbc-pop .35s cubic-bezier(.2, 1.5, .4, 1) backwards; word-wrap: break-word; }
.bbc-msg p { margin: 0 0 6px; } .bbc-msg p:last-child { margin: 0; }
.bbc-msg ul { margin: 4px 0 6px; padding-left: 20px; } .bbc-msg li { margin: 2px 0; }
.bbc-msg b { color: var(--p); }
.bbc-msg.bot { align-self: flex-start; background: #fff; color: #444; border-bottom-left-radius: 6px; box-shadow: 0 3px 10px rgba(111, 74, 146, .08); }
.bbc-msg.me { align-self: flex-end; background: var(--p); color: #fff; border-bottom-right-radius: 6px; }
.bbc-msg.err { background: #FFF6F0; }

.bbc-starts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.bbc-start { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px !important; text-align: left; border: 2px solid #EFE6F4 !important; border-radius: 16px !important; background: #fff !important; color: #333 !important; font-size: 15.5px !important; font-weight: 700 !important; transition: transform .15s, border-color .15s; animation: bbc-pop .4s cubic-bezier(.2, 1.5, .4, 1) backwards; animation-delay: calc(.1s + var(--d) * .06s); }
.bbc-start span { font-size: 24px; }
.bbc-start:hover { border-color: var(--p) !important; transform: translateY(-2px); }

.bbc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bbc-chip { padding: 8px 13px !important; border: 2px solid #E2D4EE !important; border-radius: 999px !important; background: #fff !important; color: var(--p) !important; font-size: 14.5px !important; font-weight: 700 !important; animation: bbc-pop .35s .2s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.bbc-chip:hover { background: #F1EAF7 !important; }

.bbc-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.bbc-pick button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px !important; border: 2px solid #E2D4EE !important; border-radius: 999px !important; background: #fff !important; color: #333 !important; font-size: 16px !important; font-weight: 700 !important; transition: transform .15s; animation: bbc-pop .35s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.bbc-pick button span { font-size: 20px; }
.bbc-pick button:nth-child(2) { animation-delay: .05s; } .bbc-pick button:nth-child(3) { animation-delay: .1s; } .bbc-pick button:nth-child(4) { animation-delay: .15s; } .bbc-pick button:nth-child(n+5) { animation-delay: .2s; }
.bbc-pick button.is-on { background: var(--p) !important; border-color: var(--p) !important; color: #fff !important; transform: scale(1.05); }
.bbc-pick button:disabled:not(.is-on) { opacity: .4; }
.bbc-go { align-self: flex-start; padding: 12px 22px !important; border: 0 !important; border-radius: 999px !important; background: var(--y) !important; color: #333 !important; font-size: 17px !important; font-weight: 800 !important; box-shadow: 0 5px 0 #D99A12 !important; }
.bbc-go:disabled { opacity: .45; cursor: not-allowed; }

.bbc-cta { display: flex; align-items: center; gap: 12px; align-self: flex-start; max-width: 92%; padding: 12px 14px; border-radius: 18px; text-decoration: none !important; color: #fff !important; background: #25D366; box-shadow: 0 8px 18px rgba(37, 211, 102, .3); animation: bbc-pop .45s .15s cubic-bezier(.2, 1.5, .4, 1) backwards; transition: transform .2s; }
.bbc-cta:hover { transform: translateY(-2px); }
.bbc-cta span { font-size: 28px; }
.bbc-cta b { display: block; font-size: 17px; color: #fff; }
.bbc-cta em { font-style: normal; font-size: 13.5px; opacity: .9; }
.bbc-cta i { margin-left: auto; font-style: normal; font-size: 26px; }
.bbc-cta-quiz { background: linear-gradient(120deg, var(--y), #F0A21C); color: #333 !important; box-shadow: 0 8px 18px rgba(245, 184, 49, .35); }
.bbc-cta-quiz b { color: #333; }
.bbc-cta-visit { background: linear-gradient(120deg, #3ABDD6, #2A9DB5); box-shadow: 0 8px 18px rgba(58, 189, 214, .35); }

.bbc-typing { display: flex; align-items: center; gap: 5px; align-self: flex-start; padding: 8px 14px 8px 8px; background: #fff; border-radius: 18px; box-shadow: 0 3px 10px rgba(111, 74, 146, .08); }
.bbc-typing i { width: 8px; height: 8px; border-radius: 50%; background: #C9B5DD; animation: bbc-bounce 1s ease-in-out infinite; }
.bbc-typing i:nth-of-type(2) { animation-delay: .15s; } .bbc-typing i:nth-of-type(3) { animation-delay: .3s; }

/* input */
.bbc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #EFE6F4; }
.bbc-in { flex: 1; resize: none; max-height: 110px; padding: 11px 14px; border: 2px solid #EFE6F4; border-radius: 20px; font-family: 'Dosis', sans-serif; font-size: 16px; line-height: 1.35; outline: none; background: #FBF8FD; color: #333; }
.bbc-in:focus { border-color: var(--p); background: #fff; }
.bbc-send { flex: none; width: 46px; height: 46px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: var(--p) !important; color: #fff !important; font-size: 19px !important; transition: transform .15s; }
.bbc-send:active { transform: scale(.9); }
.bbc-foot { padding: 6px 14px 10px; background: #fff; font-size: 12.5px; color: #999; text-align: center; line-height: 1.4; }
.bbc-foot a { color: #1DA851 !important; font-weight: 700; white-space: nowrap; text-decoration: none !important; }

/* phones: launcher as a round bubble, chat as a full-screen sheet */
@media (max-width: 600px) {
	.bbc-launch { width: 60px; padding: 0 !important; justify-content: center; right: 16px; bottom: 18px; }
	.bbc-launch-txt { display: none; }
	.bbc-teaser { right: 16px; bottom: 90px; max-width: 230px; font-size: 16px; }
	.bbc-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; animation: bbc-sheet .4s cubic-bezier(.2, 1.1, .4, 1); padding-bottom: env(safe-area-inset-bottom); }
	.bbc-head { padding-top: max(16px, env(safe-area-inset-top)); }
	.bbc-msg { max-width: 90%; }
	html.bbc-lock, html.bbc-lock body { overflow: hidden !important; }
	html.bbc-lock .bb-fab { display: none; }
}

@keyframes bbc-in { from { transform: scale(0) rotate(-20deg); } }
@keyframes bbc-open { from { opacity: 0; transform: scale(.6) translateY(30px); } }
@keyframes bbc-sheet { from { transform: translateY(100%); } }
@keyframes bbc-pop { from { opacity: 0; transform: translateY(8px) scale(.94); } }
@keyframes bbc-ring { 0% { box-shadow: 0 0 0 0 rgba(218, 81, 146, .55); } 70%, 100% { box-shadow: 0 0 0 16px rgba(218, 81, 146, 0); } }
@keyframes bbc-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }
@keyframes bbc-blink { 50% { opacity: .4; } }
@keyframes bbc-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .bbc *, .bbc *::before { animation: none !important; transition: none !important; } }
