/* Webiting · asistente de IA (estilo minimalista) */
#wbc-root {
  --wbc-ink: #1d1d1f;
  --wbc-muted: #86868b;
  --wbc-bubble: #f2f2f7;
  --wbc-accent: #0071e3;
  --wbc-line: rgba(0, 0, 0, .08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Urbanist", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Robot flotante */
#wbc-launch {
  position: fixed; right: 16px; bottom: 10px; z-index: 9995;
  width: 88px; height: 110px; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .18));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s;
  -webkit-tap-highlight-color: transparent;
}
#wbc-launch:focus-visible { outline: 3px solid rgba(0, 113, 227, .5); outline-offset: 4px; border-radius: 20px; }
.wbc-bot-svg { width: 100%; height: 100%; overflow: visible; }
.wbc-float { animation: wbcFloat 3.6s ease-in-out infinite; }
.wbc-shadow { transform-box: fill-box; transform-origin: center; animation: wbcShadow 3.6s ease-in-out infinite; }
.wbc-headg { transform-box: view-box; transform-origin: 60px 70px; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
#wbc-launch:hover .wbc-headg { transform: rotate(-7deg) translateY(-2px); }
#wbc-launch:active .wbc-headg { transform: scale(.94); }
.wbc-eyes path { transform-box: fill-box; transform-origin: center; animation: wbcBlink 4.2s infinite; }
.wbc-arm-r { transform-box: view-box; transform-origin: 99px 82px; }
#wbc-root.waving .wbc-arm-r { animation: wbcWave 2.2s ease-in-out; }
#wbc-root.is-open #wbc-launch { opacity: 0; transform: translateY(20px) scale(.6); pointer-events: none; }
@keyframes wbcFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes wbcShadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.82); opacity: .6; } }
@keyframes wbcBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes wbcPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes wbcWave { 0%, 100% { transform: rotate(0); } 18% { transform: rotate(-150deg); } 32%, 60% { transform: rotate(-120deg); } 46%, 74% { transform: rotate(-155deg); } 86% { transform: rotate(-140deg); } }

/* Globo de saludo */
.wbc-hint {
  position: fixed; right: 108px; bottom: 72px; z-index: 9995; max-width: 210px;
  background: #fff; color: var(--wbc-ink); font-size: 14px; line-height: 1.35; font-weight: 500;
  padding: 11px 15px; border-radius: 18px; border-bottom-right-radius: 6px; cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .05);
  opacity: 0; transform: translateY(8px) scale(.94); transform-origin: bottom right; pointer-events: none;
  transition: opacity .3s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
}
#wbc-root.hint-on .wbc-hint { opacity: 1; transform: none; pointer-events: auto; }

/* Ventana */
#wbc-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 9996;
  width: 380px; height: min(620px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 28px; border: 1px solid var(--wbc-line);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .18), 0 8px 24px rgba(0, 0, 0, .08);
  transform-origin: bottom right; transform: translateY(14px) scale(.96); opacity: 0; visibility: hidden;
  transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .25s ease, visibility 0s linear .38s;
}
#wbc-panel.open { transform: none; opacity: 1; visibility: visible; transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .25s ease; }

.wbc-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid var(--wbc-line); }
.wbc-avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 0 0 1px var(--wbc-line); flex: none; }
.wbc-avatar img { width: 22px; height: 22px; object-fit: contain; }
.wbc-title { flex: 1; min-width: 0; }
.wbc-title strong { display: block; font-size: 15px; font-weight: 600; color: var(--wbc-ink); letter-spacing: -.01em; }
.wbc-title span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--wbc-muted); }
.wbc-title span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34c759; }
.wbc-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .06); color: var(--wbc-ink); cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.wbc-x:hover { background: rgba(0, 0, 0, .1); }
.wbc-x svg { width: 14px; height: 14px; }

/* Mensajes */
.wbc-msgs { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth; }
.wbc-note { align-self: center; text-align: center; font-size: 11px; line-height: 1.45; color: var(--wbc-muted); margin: 0 12px 10px; }
.wbc-note a { color: var(--wbc-muted); text-decoration: underline; }
.wbc-msg { max-width: 82%; font-size: 15px; line-height: 1.42; padding: 9px 14px; border-radius: 20px; word-wrap: break-word; animation: wbcIn .32s cubic-bezier(.2, .8, .2, 1) both; }
.wbc-msg a { color: inherit; text-decoration: underline; }
.wbc-bot { align-self: flex-start; background: var(--wbc-bubble); color: var(--wbc-ink); border-bottom-left-radius: 6px; }
.wbc-user { align-self: flex-end; background: var(--wbc-accent); color: #fff; border-bottom-right-radius: 6px; }
.wbc-msg + .wbc-msg.wbc-user, .wbc-bot + .wbc-bot { margin-top: 0; }
.wbc-bot + .wbc-user, .wbc-user + .wbc-bot { margin-top: 8px; }
@keyframes wbcIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

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

.wbc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; animation: wbcIn .32s cubic-bezier(.2, .8, .2, 1) .1s both; }
.wbc-quick button { font: inherit; font-size: 13px; color: var(--wbc-accent); background: #fff; border: 1px solid rgba(0, 113, 227, .28); border-radius: 99px; padding: 6px 12px; cursor: pointer; transition: background .2s, border-color .2s; }
.wbc-quick button:hover { background: rgba(0, 113, 227, .06); border-color: rgba(0, 113, 227, .5); }

/* Composer */
.wbc-composer { padding: 10px 12px 8px; }
.wbc-field { display: flex; align-items: flex-end; gap: 6px; background: #fff; border: 1px solid var(--wbc-line); border-radius: 22px; padding: 5px 5px 5px 14px; transition: border-color .2s, box-shadow .2s; }
.wbc-field:focus-within { border-color: rgba(0, 113, 227, .45); box-shadow: 0 0 0 4px rgba(0, 113, 227, .1); }
#wbc-input { flex: 1; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 15px; line-height: 1.35; color: var(--wbc-ink); padding: 6px 0; max-height: 96px; }
#wbc-input::placeholder { color: #a1a1a6; }
#wbc-send { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 0; background: var(--wbc-accent); color: #fff; cursor: pointer; display: grid; place-items: center; transition: transform .2s, background .2s, opacity .2s; }
#wbc-send:hover { transform: scale(1.06); }
#wbc-send:disabled { background: #d2d2d7; cursor: default; transform: none; }
#wbc-send svg { width: 16px; height: 16px; }
.wbc-foot { text-align: center; font-size: 10.5px; color: var(--wbc-muted); padding: 2px 0 10px; }
.wbc-foot a { color: var(--wbc-muted); }

@media (max-width: 600px) {
  #wbc-launch { right: 10px; bottom: 8px; width: 70px; height: 88px; }
  .wbc-hint { right: 82px; bottom: 58px; max-width: 180px; font-size: 13px; }
  #wbc-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(82vh, calc(100dvh - 80px)); border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  #wbc-panel, #wbc-launch, .wbc-bot-svg, .wbc-headg, .wbc-eyes path, .wbc-float, .wbc-shadow, .wbc-arm-r, .wbc-hint, .wbc-msg, .wbc-quick, .wbc-typing i { transition: none !important; animation: none !important; }
}
