#launcher-container.kl-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.kl-chat-tooltip {
  display: none;
  background: rgba(12, 34, 70, 0.96);
  border: 1px solid rgba(255, 196, 14, 0.24);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  align-items: center;
  gap: 8px;
}

.kl-chat-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.kl-chat-launcher-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #ffc40e;
  color: #03132d;
  cursor: pointer;
  box-shadow: 0 18px 32px rgba(3, 19, 45, 0.36);
}

.kl-chat-launcher-icon {
  width: 24px;
  height: 24px;
}

.kl-chat-launcher-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: kl-chat-pulse 2.6s infinite;
  box-shadow: 0 0 0 0 rgba(255, 196, 14, 0.4);
}

.kl-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #03132d;
  transition: transform 0.2s ease;
}

.kl-chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 3001;
  width: min(410px, calc(100vw - 24px));
  height: min(580px, calc(100vh - 30px));
  background: #03132d;
  border: 1px solid rgba(12, 34, 70, 0.85);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(2, 13, 31, 0.58);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.kl-chat-widget.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.kl-chat-header {
  background: linear-gradient(90deg, #0c2246 0%, #03132d 100%);
  border-bottom: 1px solid rgba(12, 34, 70, 0.85);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.kl-chat-header-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.kl-chat-avatar-wrap {
  position: relative;
}

.kl-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #ffc40e;
  color: #03132d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kl-chat-avatar-icon {
  width: 18px;
  height: 18px;
}

.kl-chat-status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid #03132d;
  border-radius: 50%;
  background: #22c55e;
}

.kl-chat-header h4 {
  margin: 0;
  font-size: 14px;
  color: #fff;
}

.kl-chat-header p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #9ca3af;
}

.kl-chat-header-actions {
  display: flex;
  gap: 8px;
}

.kl-chat-header-actions button {
  border: 1px solid rgba(255, 196, 14, 0.35);
  background: transparent;
  color: #ffc40e;
  font-size: 11px;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.kl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: rgba(2, 13, 31, 0.45);
}

.kl-chat-msg {
  display: flex;
  margin-bottom: 12px;
}

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

.kl-chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 13px;
}

.kl-chat-msg-bot .kl-chat-bubble {
  background: #051937;
  border: 1px solid rgba(12, 34, 70, 0.8);
  color: #e5e7eb;
}

.kl-chat-msg-user .kl-chat-bubble {
  background: #0b2447;
  border: 1px solid rgba(12, 34, 70, 0.95);
  color: #fff;
}

.kl-chat-author {
  margin: 0 0 6px;
  font-size: 10px;
  color: #ffc40e;
  font-weight: 700;
}

.kl-chat-dynamic {
  display: contents;
}

.kl-chat-typing .kl-chat-bubble {
  display: flex;
  gap: 6px;
  align-items: center;
}

#typing-indicator[hidden] {
  display: none !important;
}

.kl-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ffc40e;
  animation: kl-chat-dot 1s infinite ease-in-out;
}

.kl-chat-typing span:nth-child(2) {
  animation-delay: 0.12s;
}
.kl-chat-typing span:nth-child(3) {
  animation-delay: 0.24s;
}

.kl-chat-quick-replies {
  padding: 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid rgba(12, 34, 70, 0.8);
  border-bottom: 1px solid rgba(12, 34, 70, 0.8);
  background: rgba(2, 13, 31, 0.55);
}

.kl-chat-quick-replies button {
  border: 1px solid rgba(12, 34, 70, 0.9);
  background: rgba(12, 34, 70, 0.7);
  color: #d1d5db;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

.kl-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #03132d;
}

.kl-chat-form input {
  flex: 1;
  border: 1px solid rgba(12, 34, 70, 0.95);
  background: rgba(12, 34, 70, 0.5);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}

.kl-chat-form input:focus {
  outline: none;
  border-color: #ffc40e;
}

.kl-chat-form button {
  border: 0;
  background: #ffc40e;
  color: #03132d;
  font-weight: 700;
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
}

.kl-chat-footer {
  background: #020d1f;
  color: #6b7280;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 8px;
}

@media (min-width: 768px) {
  .kl-chat-tooltip {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  #launcher-container.kl-chat-launcher,
  .kl-chat-widget {
    right: 12px;
    bottom: 12px;
  }

  .kl-chat-widget {
    width: calc(100vw - 24px);
    height: min(560px, calc(100vh - 24px));
  }
}

@keyframes kl-chat-dot {
  0%,
  80%,
  100% {
    transform: scale(0.85);
    opacity: 0.6;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes kl-chat-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 196, 14, 0.35);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(255, 196, 14, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 196, 14, 0);
  }
}
