
#coralma-chatbot,
#coralma-chatbot *{
  box-sizing:border-box;
}

#coralma-chatbot{
  --ccb-primary:#193b78;
  --ccb-accent:#ff8a55;
  --ccb-bubble:#1f4a96;
  --ccb-bg:#f4f7fb;
  --ccb-text:#223047;
  --ccb-muted:#6f7e95;
  --ccb-border:#dfe6f1;
  position:fixed;
  bottom:22px;
  z-index:999999;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--ccb-text);
  line-height:1.4;
}

#coralma-chatbot.ccb-right{right:22px;}
#coralma-chatbot.ccb-left{left:22px;}

#coralma-chatbot .ccb-bubble{
  width:64px;
  height:64px;
  border:0 !important;
  border-radius:18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--ccb-primary) !important;
  box-shadow:0 18px 35px rgba(15,33,69,.30);
  padding:0;
  appearance:none;
  -webkit-appearance:none;
}

#coralma-chatbot .ccb-bubble:hover{
  transform:translateY(-1px);
  box-shadow:0 22px 40px rgba(15,33,69,.34);
}

#coralma-chatbot .ccb-bubble svg{
  width:29px;
  height:29px;
  fill:#fff;
}

#coralma-chatbot .ccb-panel{
  position:absolute;
  bottom:82px;
  width:min(390px,calc(100vw - 28px));
  height:min(640px,calc(100vh - 120px));
  border-radius:24px;
  background:var(--ccb-bg);
  box-shadow:0 32px 70px rgba(16,29,56,.24);
  overflow:hidden;
  border:1px solid rgba(25,59,120,.10);
  display:none;
  backdrop-filter:blur(12px);
}

#coralma-chatbot.ccb-right .ccb-panel{right:0;}
#coralma-chatbot.ccb-left .ccb-panel{left:0;}
#coralma-chatbot .ccb-panel.is-open{display:flex;flex-direction:column;}

#coralma-chatbot .ccb-header{
  min-height:82px;
  padding:16px 16px 14px 18px;
  background:var(--ccb-primary);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

#coralma-chatbot .ccb-identity{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

#coralma-chatbot .ccb-identity strong{
  display:block;
  font-size:18px;
  font-weight:700;
  color:#fff;
  line-height:1.2;
}

#coralma-chatbot .ccb-identity small{
  display:block;
  font-size:13px;
  color:rgba(255,255,255,.88);
  margin-top:3px;
  white-space:nowrap;
}

#coralma-chatbot .ccb-avatar{
  position:relative;
  width:46px;
  height:46px;
  min-width:46px;
  border-radius:50%;
  background:rgba(255,255,255,.12);
  border:2px solid rgba(255,255,255,.26);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:visible;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
}

#coralma-chatbot .ccb-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
}

#coralma-chatbot .ccb-avatar span{
  font-size:22px;
  color:#fff;
}

#coralma-chatbot .ccb-avatar i{
  position:absolute;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#2ed573;
  border:2px solid var(--ccb-primary);
  right:-1px;
  bottom:2px;
}

#coralma-chatbot .ccb-header-actions{
  display:flex;
  gap:8px;
}

#coralma-chatbot .ccb-header-actions button{
  width:34px !important;
  height:34px !important;
  min-width:34px;
  border:0 !important;
  border-radius:50% !important;
  background:rgba(255,255,255,.16) !important;
  color:#fff !important;
  font-size:18px !important;
  line-height:1 !important;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 !important;
  appearance:none;
  -webkit-appearance:none;
  box-shadow:none !important;
}

#coralma-chatbot .ccb-header-actions button:hover{
  background:rgba(255,255,255,.23) !important;
}

#coralma-chatbot .ccb-consent{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 18px;
  background:linear-gradient(180deg,#f8fbff 0%, #f2f6fb 100%);
}

#coralma-chatbot .ccb-consent-inner{
  width:100%;
  max-width:308px;
  background:#fff;
  border:1px solid #e7edf5;
  border-radius:20px;
  padding:24px 18px 18px;
  box-shadow:0 14px 30px rgba(24,40,76,.08);
  text-align:center;
}

#coralma-chatbot .ccb-consent h3{
  margin:0 0 14px;
  font-size:28px;
  line-height:1.15;
  font-weight:700;
  color:var(--ccb-primary);
}

#coralma-chatbot .ccb-consent p{
  margin:0 0 14px;
  font-size:14px;
  line-height:1.6;
  color:var(--ccb-muted);
}

#coralma-chatbot .ccb-sensitive-warning{
  margin:0 0 16px;
  padding:12px 13px;
  border-radius:12px;
  background:#fff6e8;
  border:1px solid #f1d6a3;
  color:#7a5821;
  font-size:12px;
  line-height:1.5;
  text-align:left;
}

#coralma-chatbot .ccb-check{
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:13px;
  line-height:1.55;
  color:#46536a;
  text-align:left;
  margin:0 0 18px;
}

#coralma-chatbot .ccb-check input{
  margin:4px 0 0;
  width:16px;
  height:16px;
  accent-color:var(--ccb-primary);
  flex:0 0 auto;
}

#coralma-chatbot .ccb-check a{
  color:var(--ccb-accent);
  text-decoration:none;
  font-weight:600;
}

#coralma-chatbot .ccb-check a:hover{
  text-decoration:underline;
}

#coralma-chatbot .ccb-consent-btn{
  width:100% !important;
  min-height:48px;
  border:0 !important;
  border-radius:12px !important;
  padding:14px 16px !important;
  background:var(--ccb-primary) !important;
  color:#fff !important;
  font-size:15px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  box-shadow:0 12px 24px rgba(25,59,120,.24);
  text-align:center;
}

#coralma-chatbot .ccb-consent-btn:hover:not(:disabled){
  transform:translateY(-1px);
  box-shadow:0 16px 30px rgba(25,59,120,.28);
}

#coralma-chatbot .ccb-consent-btn:disabled{
  opacity:.45 !important;
  cursor:not-allowed !important;
  box-shadow:none !important;
}

#coralma-chatbot .ccb-chat-view{
  display:none;
  flex-direction:column;
  flex:1;
  min-height:0;
  background:var(--ccb-bg);
}

#coralma-chatbot .ccb-messages{
  flex:1;
  overflow-y:auto;
  padding:18px 16px 12px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.95), rgba(244,247,251,.95)),
    var(--ccb-bg);
}

#coralma-chatbot .ccb-msg-row{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  margin-bottom:14px;
}

#coralma-chatbot .ccb-msg-row.is-user{
  align-items:flex-end;
}

#coralma-chatbot .ccb-msg{
  max-width:84%;
  padding:13px 15px;
  border-radius:18px;
  background:#fff;
  border:1px solid #e4ebf4;
  box-shadow:0 8px 18px rgba(31,52,91,.06);
  white-space:pre-wrap;
  word-wrap:break-word;
  line-height:1.5;
  font-size:14px;
  color:var(--ccb-text);
}

#coralma-chatbot .ccb-msg-row.is-user .ccb-msg{
  background:var(--ccb-primary);
  color:#fff;
  border-color:transparent;
  border-bottom-right-radius:7px;
}

#coralma-chatbot .ccb-msg-row.is-bot .ccb-msg{
  border-bottom-left-radius:7px;
}

#coralma-chatbot .ccb-msg-row time{
  font-size:10px;
  color:#98a5b9;
  margin-top:5px;
  padding:0 4px;
}

#coralma-chatbot .ccb-quick{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  padding:12px 12px 10px;
  background:#fff;
  border-top:1px solid #ebf0f6;
}

#coralma-chatbot .ccb-quick button{
  border:1px solid #d9e1ee !important;
  border-radius:999px !important;
  background:#fff !important;
  color:#46536a !important;
  font-size:12px !important;
  font-weight:600 !important;
  padding:8px 11px !important;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  box-shadow:none !important;
  line-height:1.2;
}

#coralma-chatbot .ccb-quick button:hover{
  border-color:#bfd0ea !important;
  background:#f7fbff !important;
  color:var(--ccb-primary) !important;
}

#coralma-chatbot .ccb-form{
  display:flex;
  gap:8px;
  padding:12px;
  background:#fff;
  border-top:1px solid #ebf0f6;
  align-items:center;
}

#coralma-chatbot .ccb-form input{
  flex:1;
  min-width:0;
  min-height:46px;
  border:1.5px solid #c7d4e7 !important;
  border-radius:999px !important;
  padding:12px 16px !important;
  font-size:14px !important;
  color:var(--ccb-text) !important;
  background:#fff !important;
  outline:none;
  box-shadow:none !important;
}

#coralma-chatbot .ccb-form input:focus{
  border-color:var(--ccb-primary) !important;
  box-shadow:0 0 0 3px rgba(25,59,120,.10) !important;
}

#coralma-chatbot .ccb-form button{
  width:46px !important;
  height:46px !important;
  min-width:46px;
  border:0 !important;
  border-radius:50% !important;
  background:var(--ccb-primary) !important;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:0 !important;
  box-shadow:0 10px 22px rgba(25,59,120,.22);
  appearance:none;
  -webkit-appearance:none;
}

#coralma-chatbot .ccb-form button svg{
  width:20px;
  height:20px;
  fill:#fff;
}

#coralma-chatbot .ccb-branding{
  text-align:center;
  background:#fff;
  color:#a5b0c0;
  font-size:11px;
  padding:0 12px 12px;
}

#coralma-chatbot .ccb-branding strong{
  font-weight:700;
  color:#8d9ab0;
}

#coralma-chatbot .ccb-typing{
  display:flex;
  gap:4px;
  padding:14px 16px;
}

#coralma-chatbot .ccb-typing span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#9aa7bd;
  animation:ccbBounce 1s infinite ease-in-out;
}

#coralma-chatbot .ccb-typing span:nth-child(2){animation-delay:.12s;}
#coralma-chatbot .ccb-typing span:nth-child(3){animation-delay:.24s;}

@keyframes ccbBounce{
  0%,70%,100%{transform:translateY(0)}
  35%{transform:translateY(-5px)}
}

#coralma-chatbot .ccb-open-inline{
  border:0;
  border-radius:10px;
  background:var(--ccb-primary);
  color:#fff;
  padding:11px 16px;
  cursor:pointer;
  font-weight:600;
}

@media(max-width:520px){
  #coralma-chatbot{
    right:12px !important;
    left:auto !important;
    bottom:12px;
  }

  #coralma-chatbot .ccb-panel{
    position:fixed;
    left:8px !important;
    right:8px !important;
    bottom:84px;
    width:auto;
    height:76vh;
    border-radius:20px;
  }

  #coralma-chatbot .ccb-consent-inner{
    max-width:none;
  }

  #coralma-chatbot .ccb-consent h3{
    font-size:24px;
  }
}

/* Coralma v0.3.2 - botón flotante minimalista */
#coralma-chatbot .ccb-bubble{
  width:58px !important;
  height:58px !important;
  border-radius:50% !important;
  background:#050505 !important;
  color:#fff !important;
  box-shadow:0 10px 24px rgba(0,0,0,.24) !important;
  transition:transform .18s ease, box-shadow .18s ease !important;
}
#coralma-chatbot .ccb-bubble:hover{
  transform:translateY(-2px) scale(1.02) !important;
  box-shadow:0 14px 30px rgba(0,0,0,.30) !important;
}
#coralma-chatbot .ccb-bubble svg{
  width:31px !important;
  height:31px !important;
  fill:none !important;
  color:#fff !important;
}


/* v0.3.7 - icono chat lineal azul */
#coralma-chatbot .ccb-bubble{
  width:60px !important;
  height:60px !important;
  border-radius:50% !important;
  background:var(--ccb-bubble) !important;
  color:#ffffff !important;
  box-shadow:0 12px 28px rgba(18, 49, 105, .28) !important;
}
#coralma-chatbot .ccb-bubble:hover{
  transform:translateY(-2px) scale(1.02) !important;
  box-shadow:0 16px 34px rgba(18, 49, 105, .34) !important;
}
#coralma-chatbot .ccb-bubble svg{
  width:26px !important;
  height:26px !important;
  color:#ffffff !important;
  fill:none !important;
}


#coralma-chatbot .ccb-bubble-custom-icon{
  width:26px;
  height:26px;
  object-fit:contain;
  display:block;
}


/* v0.5.0 - formulario de lead */
#coralma-chatbot .ccb-lead-box{
  margin:0 12px 10px;
  padding:12px;
  border:1px solid #dce5f1;
  border-radius:14px;
  background:#fff;
  box-shadow:0 10px 28px rgba(15,23,42,.08);
}
#coralma-chatbot .ccb-lead-box[hidden]{display:none!important}
#coralma-chatbot .ccb-lead-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
#coralma-chatbot .ccb-lead-head button{border:0;background:transparent;font-size:22px;cursor:pointer}
#coralma-chatbot .ccb-lead-box input,
#coralma-chatbot .ccb-lead-box textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid #d7dfeb;
  border-radius:9px;
  padding:9px 10px;
  margin:5px 0;
  font:inherit;
  background:#fff;
}
#coralma-chatbot .ccb-lead-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#coralma-chatbot .ccb-lead-submit{
  width:100%;
  margin-top:7px;
  border:0;
  border-radius:9px;
  padding:10px 12px;
  cursor:pointer;
  background:var(--ccb-primary);
  color:#fff;
  font-weight:700;
}
#coralma-chatbot .ccb-lead-box small{display:block;color:#8a97ac;margin-top:7px}
@media(max-width:480px){
  #coralma-chatbot .ccb-lead-grid{grid-template-columns:1fr}
}

/* v0.6.3 - oferta de lead en grupos completos/sin confirmar */
#coralma-chatbot .ccb-lead-offer-row{
  display:flex;
  justify-content:flex-start;
  padding:0 14px 10px;
}
#coralma-chatbot .ccb-lead-offer-btn{
  border:1px solid var(--ccb-primary);
  color:var(--ccb-primary);
  background:#fff;
  border-radius:999px;
  padding:8px 13px;
  font:inherit;
  font-weight:700;
  cursor:pointer;
}
#coralma-chatbot .ccb-lead-offer-btn:hover{
  background:rgba(25,59,120,.06);
}

/* v0.6.7 - color principal plano, sin mezcla con azul fijo */

/* v0.6.9 - contraste configurable */
#coralma-chatbot .ccb-header,#coralma-chatbot .ccb-user .ccb-bubble,#coralma-chatbot .ccb-send,#coralma-chatbot .ccb-consent-btn,#coralma-chatbot .ccb-lead-submit{color:var(--ccb-primary-text)!important;}
#coralma-chatbot .ccb-quick button:hover,#coralma-chatbot .ccb-quick button:focus-visible{background:var(--ccb-quick-hover)!important;color:var(--ccb-quick-hover-text)!important;border-color:var(--ccb-quick-hover-text)!important;}
#coralma-chatbot .ccb-lead-close{border:1px solid #d9e0ea!important;background:#fff!important;color:#4a5568!important;border-radius:999px!important;padding:5px 9px!important;font-size:12px!important;cursor:pointer!important;}
#coralma-chatbot .ccb-lead-close:hover{background:var(--ccb-quick-hover)!important;color:var(--ccb-quick-hover-text)!important;border-color:var(--ccb-quick-hover-text)!important;}
\n/* v0.6.10 - text color controls wired to frontend */
#coralma-chatbot .ccb-header,
#coralma-chatbot .ccb-header strong,
#coralma-chatbot .ccb-header .ccb-status,
#coralma-chatbot .ccb-header button,
#coralma-chatbot .ccb-user .ccb-bubble,
#coralma-chatbot .ccb-send,
#coralma-chatbot .ccb-consent-btn,
#coralma-chatbot .ccb-lead-submit{
  color:var(--ccb-primary-text)!important;
}


/* v0.6.11 - todos los elementos del header respetan el color de texto */
#coralma-chatbot .ccb-header,
#coralma-chatbot .ccb-identity strong,
#coralma-chatbot .ccb-identity small,
#coralma-chatbot .ccb-avatar span,
#coralma-chatbot .ccb-header-actions button,
#coralma-chatbot .ccb-header-actions button svg{
  color:var(--ccb-primary-text)!important;
}
#coralma-chatbot .ccb-identity small{
  opacity:.82;
}


/* v0.6.12 - completar color de texto sobre principal */
#coralma-chatbot .ccb-user .ccb-bubble,
#coralma-chatbot .ccb-user .ccb-bubble *,
#coralma-chatbot .ccb-send,
#coralma-chatbot .ccb-send *,
#coralma-chatbot .ccb-header,
#coralma-chatbot .ccb-header *,
#coralma-chatbot .ccb-avatar,
#coralma-chatbot .ccb-avatar *,
#coralma-chatbot .ccb-header button,
#coralma-chatbot .ccb-header button *{
  color:var(--ccb-primary-text)!important;
}

#coralma-chatbot .ccb-send svg,
#coralma-chatbot .ccb-send svg path,
#coralma-chatbot .ccb-send svg polygon,
#coralma-chatbot .ccb-send svg polyline,
#coralma-chatbot .ccb-send svg line{
  fill:var(--ccb-primary-text)!important;
  stroke:var(--ccb-primary-text)!important;
}

#coralma-chatbot .ccb-user .ccb-bubble{
  -webkit-text-fill-color:var(--ccb-primary-text)!important;
}

#coralma-chatbot .ccb-user .ccb-bubble a{
  color:var(--ccb-primary-text)!important;
  text-decoration:underline;
}


/* v0.6.13 - selectores reales del mensaje usuario y botón enviar */
#coralma-chatbot .ccb-msg-row.is-user .ccb-msg,
#coralma-chatbot .ccb-msg-row.is-user .ccb-msg *{
  color:var(--ccb-primary-text)!important;
  -webkit-text-fill-color:var(--ccb-primary-text)!important;
}

#coralma-chatbot .ccb-msg-row.is-user .ccb-msg a{
  color:var(--ccb-primary-text)!important;
  -webkit-text-fill-color:var(--ccb-primary-text)!important;
  text-decoration:underline;
}

#coralma-chatbot .ccb-form button,
#coralma-chatbot .ccb-form button *{
  color:var(--ccb-primary-text)!important;
}

#coralma-chatbot .ccb-form button svg,
#coralma-chatbot .ccb-form button svg path{
  fill:var(--ccb-primary-text)!important;
  stroke:var(--ccb-primary-text)!important;
}


/* v0.8.0 - legibilidad de respuestas */
#coralma-chatbot .ccb-msg-row.is-bot .ccb-msg{
  line-height:1.55;
  letter-spacing:0;
}

#coralma-chatbot .ccb-msg-row.is-bot .ccb-msg a{
  overflow-wrap:anywhere;
}

#coralma-chatbot .ccb-lead-box{
  scroll-margin-top:12px;
}


/* v0.8.9 - material visual */
#coralma-chatbot .ccb-visual-row{display:grid;gap:10px;margin:8px 18px 14px}
#coralma-chatbot .ccb-visual-card{
  display:block;text-decoration:none;border:1px solid #e0e6ee;border-radius:14px;
  overflow:hidden;background:#fff;box-shadow:0 5px 18px rgba(30,41,59,.08)
}
#coralma-chatbot .ccb-visual-card img{
  display:block;width:100%;max-height:360px;object-fit:contain;background:#f8fafc
}
#coralma-chatbot .ccb-visual-card span{
  display:block;padding:9px 12px;color:#475569;font-size:12px;font-weight:600
}
