.wdc-widget {
  position: fixed;
  left: 14px;
  bottom: 90px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wdc-launcher {
  border: 0;
  background: linear-gradient(135deg, var(--wdc-accent), #171717);
  color: #fff;
  width: 68px;
  height: 68px;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0;
  transition: opacity .2s ease, transform .2s ease;
}

.wdc-launcher.wdc-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(.92);
}

.wdc-avatar, .wdc-header-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.wdc-avatar-fallback, .wdc-header-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
}

.wdc-header-avatar, .wdc-header-avatar-fallback {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  flex: 0 0 54px;
}

.wdc-panel {
  width: min(330px, calc(100vw - 20px));
  height: min(560px, calc(100vh - 30px));
  background: #0f1115;
  color: #fff;
  border-radius: 100px;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.08);
}

.wdc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.wdc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wdc-header strong, .wdc-header small { display: block; }
.wdc-header strong { font-size: 14px; line-height: 1.2; }
.wdc-header small { color: rgba(255,255,255,.76); font-size: 11px; }

.wdc-close {
  border: 0;
  background: rgba(255,255,255,.08);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.wdc-messages {
  height: calc(100% - 138px);
  overflow-y: auto;
  padding: 12px;
  background: linear-gradient(180deg, #131722 0%, #0d1118 100%);
}

.wdc-msg {
  display: flex;
  margin-bottom: 10px;
}

.wdc-msg.user { justify-content: flex-end; }

.wdc-bubble {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 14px;
  word-break: break-word;
}

.wdc-msg.assistant .wdc-bubble {
  background: #1a2232;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,.10);
}

.wdc-msg.user .wdc-bubble {
  background: var(--wdc-accent);
  color: #fff;
}

.wdc-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 5px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #0c1017;
}

.wdc-form textarea {
  resize: none;
  min-height: 42px;
  max-height: 110px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: #fff;
  padding: 11px 13px;
  outline: none;
}

.wdc-form textarea::placeholder { color: rgba(255,255,255,.55); }

.wdc-form button {
  border: 0;
  background: var(--wdc-accent);
  color: #fff;
  border-radius: 14px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700;
}

.wdc-msg.typing .wdc-bubble {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.wdc-msg.typing .wdc-bubble span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  animation: wdc-bounce 1.2s infinite ease-in-out;
}
.wdc-msg.typing .wdc-bubble span:nth-child(2) { animation-delay: .15s; }
.wdc-msg.typing .wdc-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes wdc-bounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 640px) {
  .wdc-widget { left: 10px; bottom: 10px; }
  .wdc-panel { width: calc(100vw - 20px); height: min(70vh, 540px); }
}


/* 1.0.5 visual fix */
.wdc-launcher { overflow: hidden; }
.wdc-avatar {
  object-fit: contain;
  object-position: center top;
  transform: translateY(-40px) scale(1.18);
}
.wdc-header-avatar {
  object-fit: contain;
  object-position: center top;
  transform: translateY(-12px) scale(1.08);
}
.wdc-msg.assistant .wdc-bubble, .wdc-msg.user .wdc-bubble, .wdc-form textarea, .wdc-header, .wdc-panel {
  color: #fff;
}
.wdc-panel[hidden] { display:none !important; }


/* Ajuste para no tapar el botón de WhatsApp */
.wdc-widget {
  bottom: 90px !important;
}
.wdc-avatar {
  transform: translateY(-40px) !important;
}
.wdc-launcher {
  overflow: visible !important;
}

.chat-bubble{
  background:#111 !important;
  color:#fff !important;
  font-size:14px;
  line-height:1.4;
}

.chat-avatar img{
  width:60px;
  height:60px;
  object-fit:contain;
  border-radius:0 !important;
}

.chat-launcher{
  position:fixed !important;
  bottom:120px !important;
  right:20px !important;
  z-index:9999 !important;
}


/* 1.0.7 final readability redesign */
.wdc-widget{bottom:120px !important;}
.wdc-panel{background:#0b0f16 !important;border:1px solid rgba(255,255,255,.10) !important;border-radius:24px !important;box-shadow:0 24px 70px rgba(0,0,0,.55) !important;backdrop-filter:blur(8px);}
.wdc-header{padding:14px 14px 12px !important;background:linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03)) !important;}
.wdc-header strong{font-size:15px !important;color:#fff !important;}
.wdc-header small{font-size:11px !important;color:rgba(255,255,255,.82) !important;}
.wdc-messages{padding:14px !important;background:linear-gradient(180deg,#101621 0%,#0a0f17 100%) !important;}
.wdc-msg{margin-bottom:12px !important;}
.wdc-bubble{max-width:90% !important;padding:12px 14px !important;border-radius:18px !important;font-size:14px !important;line-height:1.55 !important;font-weight:500 !important;letter-spacing:.01em;}
.wdc-bubble, .wdc-bubble *, .wdc-bubble p, .wdc-bubble span, .wdc-bubble strong, .wdc-bubble a, .wdc-bubble li{color:#fff !important;}
.wdc-msg.assistant .wdc-bubble{background:linear-gradient(180deg,#202b3f 0%,#182235 100%) !important;border:1px solid rgba(255,255,255,.10) !important;box-shadow:0 8px 24px rgba(0,0,0,.22) !important;}
.wdc-msg.user .wdc-bubble{background:linear-gradient(135deg,var(--wdc-accent),#ff78bb) !important;border:none !important;box-shadow:0 8px 24px rgba(255,79,163,.22) !important;}
.wdc-form{padding:12px !important;gap:10px !important;background:#0b0f16 !important;}
.wdc-form textarea{min-height:44px !important;border-radius:16px !important;background:#121927 !important;color:#fff !important;border:1px solid rgba(255,255,255,.12) !important;box-shadow:none !important;}
.wdc-form textarea::placeholder{color:rgba(255,255,255,.62) !important;}
.wdc-form button{border-radius:16px !important;padding:0 16px !important;min-width:84px;background:linear-gradient(135deg,var(--wdc-accent),#ff78bb) !important;color:#fff !important;box-shadow:0 10px 20px rgba(255,79,163,.20) !important;}
.wdc-launcher{width:74px !important;height:74px !important;border-radius:100px !important;background:linear-gradient(135deg,#ff4fa3,#171717) !important;box-shadow:0 16px 34px rgba(0,0,0,.38) !important;}
.wdc-avatar{object-fit:contain !important;object-position:center top !important;transform:translateY(-6px) scale(1.13) !important;}
.wdc-header-avatar{object-fit:contain !important;object-position:center top !important;transform:translateY(-6px) scale(1.03) !important;}
.wdc-close{background:rgba(255,255,255,.10) !important;}
@media (max-width:640px){.wdc-widget{left:10px !important;bottom:108px !important;}.wdc-panel{width:calc(100vw - 20px) !important;height:min(68vh,540px) !important;}}


/* 1.0.8 compact input + cleaner UI */
.wdc-widget{
  left: 14px !important;
  bottom: 100px !important;
}

.wdc-panel{
  width: min(340px, calc(100vw - 20px)) !important;
  height: min(540px, calc(100vh - 40px)) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, #0f131b 0%, #0b0f16 100%) !important;
}

.wdc-header{
  padding: 14px !important;
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.03)) !important;
  backdrop-filter: blur(10px);
}

.wdc-header strong{
  font-size: 15px !important;
  letter-spacing: .2px;
}

.wdc-header small{
  font-size: 11px !important;
  color: rgba(255,255,255,.78) !important;
}

.wdc-messages{
  padding: 14px !important;
  height: calc(100% - 142px) !important;
}

.wdc-bubble{
  font-size: 14px !important;
  line-height: 1.45 !important;
  border-radius: 18px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.wdc-msg.assistant .wdc-bubble{
  background: #182131 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}

.wdc-msg.user .wdc-bubble{
  color: #fff !important;
  background: linear-gradient(135deg, var(--wdc-accent), #ff6eb4) !important;
}

.wdc-form{
  grid-template-columns: 1fr auto !important;
  align-items: end !important;
  gap: 8px !important;
  padding: 5px !important;
  background: rgba(10,14,21,.98) !important;
}

.wdc-form textarea{
  display: block !important;
  width: 100% !important;
  min-height: 48px !important;
  height: 48px !important;
  max-height: 48px !important;
  overflow-y: auto !important;
  resize: none !important;
  padding: 12px 14px !important;
  line-height: 1.25 !important;
  font-size: 14px !important;
  color: #fff !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 16px !important;
  box-sizing: border-box !important;
}

.wdc-form textarea::placeholder{
  color: rgba(255,255,255,.52) !important;
}

.wdc-form textarea:focus{
  border-color: rgba(255,255,255,.24) !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,.05) !important;
}

.wdc-form button{
  height: 48px !important;
  min-width: 52px !important;
  padding: 0 16px !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

@media (max-width: 640px){
  .wdc-widget{ bottom: 100px !important; }
  .wdc-panel{ height: min(68vh, 520px) !important; }
}
