.cbot { position: fixed; left: 0; top: 0; z-index: 45; display: flex; align-items: flex-start; gap: 4px; pointer-events: none; opacity: 0; transition: opacity .3s; font-family: 'Montserrat', sans-serif; color: #0b0b12; will-change: transform; }
.cbot.on, .cbot.docked { opacity: 1; }
.cbot.parked, .cbot.docked { pointer-events: auto; }

/* Esclabot */
.cbot-body { width: 64px; flex-shrink: 0; cursor: pointer; transform-style: preserve-3d; }
.cbot-float { position: relative; display: block; animation: cbot-float 3s ease-in-out infinite; }
.cbot-float { filter: drop-shadow(0 8px 14px rgba(60,30,120,.22)); }
.cbot-float img { display: block; width: 100%; }
.cbot-float .cbot-closed { position: absolute; inset: 0; opacity: 0; animation: cbot-blink 2s steps(1) infinite; }
.cbot.parked .cbot-float:hover { scale: 1.06; }
.cbot-float { transition: scale .2s; }
@keyframes cbot-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes cbot-blink { 0%, 92% { opacity: 0; } 92.5% { opacity: 1; } }

/* Bubble that unfolds into the chat window */
.cbot-panel { width: 290px; max-width: 186px; margin-top: 2px; background: #fff; border: 1px solid #ececf2; border-radius: 16px 16px 16px 4px; box-shadow: 0 10px 30px -10px rgba(11,11,18,.3); overflow: hidden; transition: max-width .25s ease, border-color .25s, box-shadow .25s; }
.cbot.open .cbot-panel { max-width: 290px; border-color: #d9ccff; box-shadow: 0 30px 70px -24px rgba(11,11,18,.4); }
.cbot.parked .cbot-panel { animation: cbot-pop .25s ease; }
@keyframes cbot-pop { 50% { transform: scale(1.05); } }
.cbot-bubble { padding: 9px 14px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.cbot.dead { display: none; }
.cbot-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.cbot-kill { position: relative; width: 22px; height: 22px; border: 1px solid #ececf2; border-radius: 50%; background: #fff; color: #6b6b78; box-shadow: 0 4px 10px -4px rgba(11,11,18,.25); cursor: pointer; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s, color .15s, border-color .15s; }
.cbot.parked .cbot-kill, .cbot.docked .cbot-kill { opacity: 1; transform: none; }
.cbot-kill::before, .cbot-kill::after { content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.cbot-kill::after { transform: translate(-50%, -50%) rotate(-45deg); }
.cbot-kill:hover { color: #0b0b12; border-color: #c9b8ff; }
.cbot.open .cbot-bubble { border-bottom: 1px solid #ececf2; }
.cbot.parked:not(.open) .cbot-bubble { cursor: pointer; }
.cbot.parked:not(.open) .cbot-panel:hover { background: #0b0b12; border-color: #0b0b12; color: #fff; }

.cbot-drawer { max-height: 0; opacity: 0; transition: max-height .25s ease, opacity .2s ease; }
.cbot.open .cbot-drawer { max-height: 340px; opacity: 1; }
.cbot-log { max-height: 240px; overflow-y: auto; padding: 12px 12px 0; display: flex; flex-direction: column; gap: 8px; }
.cbot-log:empty { display: none; }
.cmsg { max-width: 90%; font-size: 12px; line-height: 1.55; padding: 8px 11px; border-radius: 14px; animation: cmsg-in .25s ease; }
.cmsg.bot { align-self: flex-start; background: #f7f6fb; border-bottom-left-radius: 4px; }
.cmsg.me { align-self: flex-end; background: #0b0b12; color: #fff; border-bottom-right-radius: 4px; }
@keyframes cmsg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.cchips a, .cchips button { font: 600 10.5px 'Montserrat', sans-serif; color: #5b3fd6; background: #fff; border: 1px solid #e3dbff; border-radius: 999px; padding: 6px 10px; cursor: pointer; text-decoration: none; transition: background .15s; }
.cchips a:hover, .cchips button:hover { background: #f3efff; }
.ctyping { display: inline-flex; gap: 4px; padding: 3px 0; }
.ctyping i { width: 6px; height: 6px; border-radius: 50%; background: #b9b0d6; animation: ctype 1s infinite; }
.ctyping i:nth-child(2) { animation-delay: .15s; }
.ctyping i:nth-child(3) { animation-delay: .3s; }
@keyframes ctype { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.cbot-form { display: flex; gap: 6px; padding: 10px; }
.cbot-form input { flex: 1; min-width: 0; border: 1px solid #ececf2; border-radius: 10px; padding: 9px 11px; font: 500 12px 'Montserrat', sans-serif; outline: none; transition: border-color .2s; }
.cbot-form input:focus { border-color: #8b5cf6; }
.cbot-form button { width: 36px; flex-shrink: 0; border: 0; border-radius: 10px; background: linear-gradient(135deg, #3b5bfd, #8b5cf6); cursor: pointer; position: relative; }
.cbot-form button::before { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-top: 2px solid #fff; border-right: 2px solid #fff; transform: translate(-65%, -50%) rotate(45deg); }

/* Touch devices: docked bottom-right, grows upward */
.cbot.docked { left: auto; top: auto; right: 12px; bottom: 12px; transform: none !important; flex-direction: row-reverse; align-items: flex-end; }
.cbot.docked .cbot-panel { border-radius: 16px 16px 4px 16px; display: flex; flex-direction: column-reverse; }
/* En el celular: sin el globo "¿Cómo puedo apoyarte?" ni la X para ocultarlo. Se abre tocando a Esclabot. */
.cbot.docked .cbot-bubble, .cbot.docked .cbot-kill { display: none; }
.cbot.docked:not(.open) .cbot-panel { display: none; }
/* Chat abierto: la página de fondo queda quieta; solo se desplaza la conversación. */
html.cbot-lock, html.cbot-lock body { overflow: hidden; }
.cbot-log { overscroll-behavior: contain; }
.cbot-veil { position: fixed; inset: 0; z-index: 44; background: rgba(10,13,31,.35); opacity: 0; pointer-events: none; transition: opacity .25s; }
.cbot-veil.on { opacity: 1; pointer-events: auto; }
/* iPhone agranda la página al tocar un campo con letra menor a 16 px: en táctil el campo del chat va a 16 px. */
.cbot.docked .cbot-form input { font-size: 16px; padding: 8px 11px; }
@media (max-width: 400px) { .cbot.docked.open .cbot-panel { max-width: calc(100vw - 96px); } }
