.cvip-it-widget,
.cvip-it-widget * {
  box-sizing: border-box;
}

.cvip-it-widget {
  --cvip-primary: #0b5cff;
  --cvip-header: #10131a;
  --cvip-header-text: #fff;
  position: fixed;
  bottom: 22px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #172033;
}

.cvip-position-right { right: 22px; }
.cvip-position-left { left: 22px; }

.cvip-chat-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 7px 17px 7px 7px;
  border: 0;
  border-radius: 999px;
  background: var(--cvip-header);
  color: var(--cvip-header-text);
  box-shadow: 0 14px 38px rgba(0,0,0,.28);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease;
}

.cvip-chat-toggle:hover,
.cvip-chat-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 17px 44px rgba(0,0,0,.32);
  outline: 3px solid color-mix(in srgb, var(--cvip-primary) 35%, transparent);
}

.cvip-toggle-badge,
.cvip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--cvip-primary), #68a4ff);
  color: #fff;
  font-weight: 900;
  letter-spacing: -.4px;
}

.cvip-toggle-badge { width: 44px; height: 44px; font-size: 13px; }
.cvip-avatar { width: 42px; height: 42px; font-size: 12px; }

.cvip-chat-panel {
  position: absolute;
  bottom: 72px;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 120px));
  min-height: 480px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
  transform-origin: bottom right;
  animation: cvip-pop .2s ease-out;
}

.cvip-position-right .cvip-chat-panel { right: 0; }
.cvip-position-left .cvip-chat-panel { left: 0; transform-origin: bottom left; }

@keyframes cvip-pop {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cvip-chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 74px;
  padding: 14px 14px 14px 16px;
  background: var(--cvip-header);
  color: var(--cvip-header-text);
}

.cvip-heading { min-width: 0; flex: 1; }
.cvip-heading strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.cvip-heading span { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; opacity: .86; }
.cvip-heading i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #35d07f; box-shadow: 0 0 0 3px rgba(53,208,127,.16); }

.cvip-chat-close,
.cvip-close-lead {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 29px;
  line-height: 1;
  padding: 5px;
  opacity: .82;
}
.cvip-chat-close:hover,
.cvip-close-lead:hover { opacity: 1; }

.cvip-chat-body {
  height: calc(100% - 174px);
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(11,92,255,.06), transparent 30%),
    #f4f6fa;
  scroll-behavior: smooth;
}

.cvip-chat-messages { display: flex; flex-direction: column; gap: 12px; }
.cvip-message-row { display: flex; flex-direction: column; align-items: flex-start; max-width: 88%; }
.cvip-message-row.cvip-user { align-self: flex-end; align-items: flex-end; margin-left: auto; }

.cvip-message {
  padding: 11px 13px;
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  color: #172033;
  box-shadow: 0 3px 12px rgba(15,23,42,.08);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cvip-user .cvip-message {
  border-radius: 16px 16px 5px 16px;
  background: var(--cvip-primary);
  color: #fff;
}

.cvip-message-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.cvip-message-actions a,
.cvip-message-actions button,
.cvip-quick-prompts button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(11,92,255,.22);
  border-radius: 999px;
  background: #fff;
  color: var(--cvip-primary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 10px;
  text-decoration: none;
}
.cvip-message-actions a:hover,
.cvip-message-actions button:hover,
.cvip-quick-prompts button:hover { background: #eef4ff; }

.cvip-quick-prompts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

.cvip-typing {
  position: absolute;
  left: 14px;
  bottom: 100px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(15,23,42,.12);
}
.cvip-typing[hidden] { display: none; }
.cvip-typing span { width: 5px; height: 5px; border-radius: 50%; background: #778197; animation: cvip-dot 1s infinite ease-in-out; }
.cvip-typing span:nth-child(2) { animation-delay: .12s; }
.cvip-typing span:nth-child(3) { animation-delay: .24s; }
.cvip-typing em { margin-left: 4px; color: #697386; font-size: 11px; font-style: normal; }
@keyframes cvip-dot { 0%,80%,100% { transform: translateY(0); opacity:.45; } 40% { transform: translateY(-3px); opacity:1; } }

.cvip-chat-form {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 31px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 69px;
  padding: 11px 12px;
  border-top: 1px solid #e5e9f1;
  background: #fff;
}

.cvip-chat-input {
  flex: 1;
  width: 100%;
  min-height: 43px;
  max-height: 110px;
  resize: none;
  border: 1px solid #ccd4e0;
  border-radius: 13px;
  background: #fff;
  color: #172033;
  font: inherit;
  line-height: 1.35;
  padding: 10px 11px;
  outline: none;
}
.cvip-chat-input:focus { border-color: var(--cvip-primary); box-shadow: 0 0 0 3px rgba(11,92,255,.12); }

.cvip-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  border: 0;
  border-radius: 13px;
  background: var(--cvip-primary);
  color: #fff;
  cursor: pointer;
}
.cvip-chat-send:disabled { opacity: .55; cursor: wait; }
.cvip-chat-send svg { width: 21px; height: 21px; fill: currentColor; }

.cvip-chat-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 31px;
  overflow: hidden;
  padding: 7px 12px;
  background: #fff;
  color: #7a8497;
  font-size: 9.5px;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cvip-lead-form {
  position: absolute;
  inset: 74px 0 31px;
  z-index: 5;
  overflow-y: auto;
  padding: 17px;
  background: #fff;
}
.cvip-lead-form[hidden] { display: none; }
.cvip-lead-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom: 12px; font-size: 17px; }
.cvip-close-lead { color:#172033; }
.cvip-lead-form label { display:block; margin-bottom: 10px; color:#38445a; font-size:12px; font-weight:700; }
.cvip-lead-form input,
.cvip-lead-form textarea {
  display:block;
  width:100%;
  margin-top:5px;
  border:1px solid #ccd4e0;
  border-radius:10px;
  background:#fff;
  color:#172033;
  font:inherit;
  font-size:14px;
  padding:9px 10px;
}
.cvip-lead-form input:focus,
.cvip-lead-form textarea:focus { outline:2px solid rgba(11,92,255,.18); border-color:var(--cvip-primary); }
.cvip-field-row { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.cvip-lead-submit { width:100%; border:0; border-radius:11px; background:var(--cvip-primary); color:#fff; cursor:pointer; font:inherit; font-weight:800; padding:11px; }
.cvip-lead-submit:disabled { opacity:.55; cursor:wait; }
.cvip-lead-status { min-height:20px; margin:9px 0 0; font-size:12px; }
.cvip-lead-status.cvip-success { color:#087a43; }
.cvip-lead-status.cvip-error { color:#b42318; }
.cvip-honeypot { position:absolute!important; left:-9999px!important; opacity:0!important; pointer-events:none!important; }

.cvip-inline-widget {
  position: relative;
  right: auto;
  left: auto;
  bottom: auto;
  width: 100%;
  max-width: 620px;
  min-height: 620px;
  margin: 20px auto;
}
.cvip-inline-widget .cvip-chat-panel {
  position: relative;
  right: auto;
  left: auto;
  bottom: auto;
  width: 100%;
  height: 620px;
  min-height: 520px;
}

@media (max-width: 600px) {
  .cvip-it-widget:not(.cvip-inline-widget) { right: 12px; left: 12px; bottom: 12px; }
  .cvip-hide-mobile:not(.cvip-inline-widget) { display:none!important; }
  .cvip-position-right .cvip-chat-panel,
  .cvip-position-left .cvip-chat-panel {
    right: 0;
    left: 0;
    bottom: 70px;
    width: 100%;
    height: min(650px, calc(100vh - 95px));
    border-radius: 17px;
  }
  .cvip-position-left .cvip-chat-toggle { margin-right:auto; }
  .cvip-position-right .cvip-chat-toggle { margin-left:auto; }
  .cvip-toggle-label { display:none; }
  .cvip-chat-toggle { padding:7px; }
  .cvip-field-row { grid-template-columns:1fr; gap:0; }
}

@media (prefers-reduced-motion: reduce) {
  .cvip-chat-panel,
  .cvip-chat-toggle,
  .cvip-typing span { animation:none!important; transition:none!important; }
}
