/* Retargeting attention effects (includes/class-qcld-wpbot-retarget-fx.php). Self-contained: no animate.css. */
.qcld-rfx-run-spring { animation: qcld-rfx-spring .75s cubic-bezier(.2,.8,.3,1) both; transform-origin: 100% 100%; }
.qcld-rfx-run-slide { animation: qcld-rfx-slide .8s cubic-bezier(.2,.9,.3,1) both; }
.qcld-rfx-run-spotlight { animation: qcld-rfx-spot .7s cubic-bezier(.2,.8,.3,1) both; transform-origin: 100% 100%; }
.qcld-rfx-run-sweep { animation: qcld-rfx-spring .6s cubic-bezier(.2,.8,.3,1) both; transform-origin: 100% 100%; }

@keyframes qcld-rfx-spring { 0% { opacity: 0; transform: scale(.25); } 55% { opacity: 1; transform: scale(1.05); } 72% { transform: scale(.98); } 86% { transform: scale(1.01); } 100% { opacity: 1; transform: none; } }
@keyframes qcld-rfx-slide { 0% { opacity: 0; transform: translateY(110vh); } 60% { opacity: 1; transform: translateY(-12px); } 78% { transform: translateY(5px); } 100% { opacity: 1; transform: none; } }
@keyframes qcld-rfx-spot { 0% { opacity: 0; transform: scale(.85); } 60% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: none; } }

/* Spotlight: the page dims behind the chat. */
.qcld-rfx-dim { position: fixed; inset: 0; background: rgba(12, 16, 34, .55); z-index: 99990; opacity: 0; transition: opacity .45s ease; }
.qcld-rfx-dim.is-on { opacity: 1; }
.qcld-rfx-ring { outline: 4px solid rgba(124, 140, 255, .9) !important; outline-offset: 0; box-shadow: 0 24px 48px rgba(0, 0, 0, .35) !important; }

/* Light sweep: a band of light runs around the window border. */
.qcld-rfx-sweep { position: absolute; inset: 0; padding: 3px; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 2147483000; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.qcld-rfx-sweep::before { content: ""; position: absolute; left: 50%; top: 50%; width: 250%; aspect-ratio: 1; transform: translate(-50%, -50%); background: conic-gradient(from 0deg, transparent 0 60%, #7c8cff 75%, #ff6b63 85%, transparent 95%); animation: qcld-rfx-spin 1.3s linear 3; }
@keyframes qcld-rfx-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Peek and Wave: a bubble beside the launcher. */
.qcld-rfx-bubble { position: fixed; z-index: 100000; max-width: 260px; background: #fff; color: #1b1f33; border-radius: 14px 14px 3px 14px; padding: 11px 14px; font-family: inherit; font-size: 14px; line-height: 1.4; font-weight: 400; letter-spacing: normal; box-shadow: 0 10px 28px rgba(15, 20, 60, .25); cursor: pointer; animation: qcld-rfx-bubble .4s cubic-bezier(.2,.9,.3,1.2) both; }
.qcld-rfx-bubble.is-left { border-radius: 14px 14px 14px 3px; }
.qcld-rfx-bubble .qcld-rfx-x { position: absolute; top: -8px; left: -8px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #dde0ea; background: #fff; color: #5b6178; font: 13px/18px sans-serif; text-align: center; padding: 0; cursor: pointer; }
.qcld-rfx-bubble.is-left .qcld-rfx-x { left: auto; right: -8px; }
.qcld-rfx-bubble .qcld-rfx-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.qcld-rfx-bubble .qcld-rfx-dots span { width: 6px; height: 6px; border-radius: 50%; background: #8a90a8; animation: qcld-rfx-dot .9s infinite; }
.qcld-rfx-bubble .qcld-rfx-dots span:nth-child(2) { animation-delay: .15s; }
.qcld-rfx-bubble .qcld-rfx-dots span:nth-child(3) { animation-delay: .3s; }
.qcld-rfx-bubble .qcld-rfx-msg { animation: qcld-rfx-fade .35s both; }
@keyframes qcld-rfx-bubble { 0% { opacity: 0; transform: translateX(16px) scale(.85); } 100% { opacity: 1; transform: none; } }
@keyframes qcld-rfx-dot { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-4px); } }
@keyframes qcld-rfx-fade { from { opacity: 0; } to { opacity: 1; } }

.qcld-rfx-badge { position: fixed; z-index: 100001; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #e8504a; color: #fff; font: 700 11px/19px sans-serif; text-align: center; animation: qcld-rfx-badge .45s cubic-bezier(.3,1.6,.5,1) both; pointer-events: none; }
@keyframes qcld-rfx-badge { 0% { transform: scale(0); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }

.qcld-rfx-wave { animation: qcld-rfx-wave 1.2s ease-in-out 2; transform-origin: 70% 80%; }
@keyframes qcld-rfx-wave { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-18deg); } 30% { transform: rotate(14deg); } 45% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }

@media (prefers-reduced-motion: reduce) {
	.qcld-rfx-run-spring, .qcld-rfx-run-slide, .qcld-rfx-run-spotlight, .qcld-rfx-run-sweep, .qcld-rfx-sweep::before,
	.qcld-rfx-bubble, .qcld-rfx-bubble .qcld-rfx-msg, .qcld-rfx-bubble .qcld-rfx-dots span, .qcld-rfx-badge, .qcld-rfx-wave { animation: none !important; }
	.qcld-rfx-dim { transition: none; }
}

/* The chat icon messages make way for the bubble. */
.qcld-rfx-bubble-on #wp-chatbot-notification-container { display: none !important; }

/* Retargeting message (js/qcld-wpbot-automations-bridge.js): its own card pinned at the top of the
   chat, not an agent's reply. Colours, corners and font come from the theme's bot message
   (--qcld-rt-*, set by the script); the accent is the theme's send button. */
.qcld-rt-card { position: sticky; top: 0; z-index: 5; margin: 8px 10px 6px; padding: 10px 34px 10px 12px; background: var(--qcld-rt-bg, #fff); color: var(--qcld-rt-fg, #1b1f33); border-radius: var(--qcld-rt-radius, 12px); border-left: 3px solid var(--qcld-rt-accent, var(--qcld-wpbot-c, #3d8bd8)); box-shadow: 0 6px 20px rgba(15, 20, 60, .16); font-family: var(--qcld-rt-font, inherit); font-size: var(--qcld-rt-size, 14px); line-height: 1.45; text-align: left; animation: qcld-rt-in .28s cubic-bezier(.2, .9, .3, 1.15) both; }
.qcld-rt-card__msg p { margin: 0 0 6px; }
.qcld-rt-card__msg p:last-child { margin-bottom: 0; }
.qcld-rt-card__msg a { color: var(--qcld-rt-accent, var(--qcld-wpbot-c, #3d8bd8)); text-decoration: underline; }
.qcld-rt-card__x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .55; font: 400 18px/24px sans-serif; text-align: center; cursor: pointer; box-shadow: none; min-height: 0; }
.qcld-rt-card__x:hover, .qcld-rt-card__x:focus-visible { opacity: 1; background: rgba(127, 127, 127, .15); outline: none; }
.qcld-rt-card .qcld-automation-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qcld-rt-card .qcld-chatbot-automation-option { display: inline-block; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--qcld-rt-accent, var(--qcld-wpbot-c, #3d8bd8)); color: var(--qcld-rt-accent, var(--qcld-wpbot-c, #3d8bd8)); font-size: .92em; cursor: pointer; }
.qcld-rt-card .qcld-chatbot-automation-option:hover, .qcld-rt-card .qcld-chatbot-automation-option:focus-visible { background: var(--qcld-rt-accent, var(--qcld-wpbot-c, #3d8bd8)); color: #fff; outline: none; }
.qcld-rt-card .qcld-automation-products { margin: 8px 0 0; padding: 0 0 0 16px; }
.qcld-rt-card .qcld-automation-offer { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(127, 127, 127, .1); }
@keyframes qcld-rt-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .qcld-rt-card { animation: none; } }
