:root {
  --cw-vh: 100vh;
  --cw-safe-bottom: env(safe-area-inset-bottom, 0px)
}
@supports (height: 100dvh) {
  :root {
    --cw-vh: 100dvh
  }
}
.cw-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f7dff, #1a5fd6);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(47, 125, 255, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease,box-shadow 0.2s ease
}
.cw-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(47, 125, 255, 0.46)
}
.cw-launcher svg {
  width: 26px;
  height: 26px
}
.cw-launcher.cw-hidden {
  display: none
}
.cw-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(var(--cw-vh) - 48px);
  display: none;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(44, 125, 255, 0.18);
  box-shadow: 0 24px 60px rgba(7, 27, 51, 0.18);
  font-family: inherit
}
.cw-panel.cw-open {
  display: flex
}
.cw-header {
  flex: 0 0 auto;
  padding: 14px 16px;
  background: linear-gradient(135deg, #2f7dff, #1a5fd6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between
}
.cw-header-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px
}
.cw-header-sub {
  font-size: 12px;
  opacity: 0.82;
  margin-top: 2px
}
.cw-close {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1
}
.cw-close:hover {
  background: rgba(255, 255, 255, 0.3)
}
.cw-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  background: #f7fafd
}
.cw-msg {
  display: flex;
  margin-bottom: 12px
}
.cw-msg-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word
}
.cw-msg.cw-user {
  justify-content: flex-end
}
.cw-msg.cw-user .cw-msg-bubble {
  background: #2f7dff;
  color: #fff;
  border-bottom-right-radius: 4px
}
.cw-msg.cw-bot .cw-msg-bubble {
  background: #fff;
  color: #14304d;
  border: 1px solid rgba(44, 125, 255, 0.16);
  border-bottom-left-radius: 4px
}
.cw-msg.cw-error .cw-msg-bubble {
  background: #fff4f4;
  color: #b3261e;
  border: 1px solid rgba(179, 38, 30, 0.22)
}
.cw-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 18px
}
.cw-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(47, 125, 255, 0.6);
  animation: cw-blink 1.2s infinite ease-in-out
}
.cw-typing span:nth-child(2) {
  animation-delay: 0.2s
}
.cw-typing span:nth-child(3) {
  animation-delay: 0.4s
}
@keyframes cw-blink {
  0%,
  100%,
  80% {
    opacity: 0.25;
    transform: translateY(0)
  }
  40% {
    opacity: 1;
    transform: translateY(-3px)
  }
}
.cw-footer {
  flex: 0 0 auto;
  border-top: 1px solid rgba(44, 125, 255, 0.14);
  background: #fff;
  padding: 10px 12px 12px
}
.cw-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end
}
.cw-input {
  flex: 1 1 auto;
  resize: none;
  min-height: 40px;
  max-height: 110px;
  padding: 10px 12px;
  border: 1px solid rgba(44, 125, 255, 0.24);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  color: #14304d;
  outline: none
}
.cw-input:focus {
  border-color: #2f7dff
}
.cw-send {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: #2f7dff;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer
}
.cw-send:disabled {
  background: rgba(47, 125, 255, 0.4);
  cursor: not-allowed
}
.cw-meta {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(35, 75, 105, 0.6);
  display: flex;
  justify-content: space-between
}
@media (max-width: 640px) {
  .cw-panel {
    right: 8px;
    left: 8px;
    bottom: calc(8px + var(--cw-safe-bottom));
    width: auto;
    height: calc(var(--cw-vh) - 16px - var(--cw-safe-bottom));
    max-height: calc(var(--cw-vh) - 16px - var(--cw-safe-bottom));
    border-radius: 14px
  }
  .cw-launcher {
    right: 16px;
    bottom: calc(16px + var(--cw-safe-bottom))
  }
}