#csa-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 999999;
  font-size: 26px;
  border: none;
}

#csa-window {
  position: fixed;
  bottom: 92px;
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#csa-window.csa-open {
  display: flex;
}

#csa-header {
  background: #1f2937;
  color: #fff;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#csa-close {
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

#csa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
}

.csa-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  font-size: 13.5px;
}

.csa-msg.csa-user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.csa-msg.csa-agent {
  align-self: flex-start;
  background: #f1f5f9;
  color: #111827;
  border-bottom-left-radius: 4px;
}

.csa-lead-banner {
  align-self: center;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 8px;
  text-align: center;
}

#csa-input-row {
  display: flex;
  border-top: 1px solid #e5e7eb;
  padding: 8px;
  gap: 6px;
  background: #fff;
}

#csa-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
}

#csa-send {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13.5px;
}

#csa-send:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 480px) {
  #csa-window {
    right: 10px;
    bottom: 84px;
    width: calc(100vw - 20px);
  }
  #csa-bubble {
    right: 14px;
    bottom: 14px;
  }
}
