.kcb-root {
  --kcb-primary: #16a34a;
  --kcb-primary-dark: #15803d;
  --kcb-bg: #ffffff;
  --kcb-text: #111827;
  --kcb-muted: #6b7280;
  --kcb-border: rgba(17, 24, 39, 0.10);
  --kcb-bot: #f3f4f6;
  --kcb-user: linear-gradient(135deg, var(--kcb-primary), var(--kcb-primary-dark));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  z-index: 999999;
}

.kcb-floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
}

.kcb-inline {
  width: 100%;
  max-width: 420px;
  margin: 20px 0;
}

.kcb-launcher {
  width: 66px;
  height: 66px;
  border: 0;
  border-radius: 999px;
  background: var(--kcb-user);
  color: white;
  box-shadow: 0 18px 40px rgba(22, 163, 74, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: kcbPulse 2s infinite;
}

.kcb-launcher-icon {
  font-size: 30px;
}

.kcb-launcher-dot {
  width: 13px;
  height: 13px;
  background: #22c55e;
  border: 2px solid white;
  border-radius: 50%;
  position: absolute;
  right: 7px;
  top: 8px;
}

.kcb-panel {
  width: 390px;
  height: 570px;
  background: var(--kcb-bg);
  color: var(--kcb-text);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--kcb-border);
  flex-direction: column;
}

.kcb-panel-inline {
  width: 100%;
  max-width: 420px;
  height: 580px;
  display: flex;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.kcb-header {
  min-height: 76px;
  padding: 16px;
  background: var(--kcb-user);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kcb-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.kcb-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}

.kcb-status {
  font-size: 12px;
  opacity: 0.92;
  margin-top: 4px;
}

.kcb-status span {
  width: 8px;
  height: 8px;
  background: #bbf7d0;
  display: inline-block;
  border-radius: 50%;
  margin-right: 5px;
}

.kcb-close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.kcb-messages {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(22,163,74,0.08), transparent 32%),
    linear-gradient(180deg, #ffffff, #f9fafb);
}

.kcb-message {
  display: flex;
  margin-bottom: 14px;
  gap: 8px;
  animation: kcbIn 0.22s ease;
}

.kcb-user-message {
  justify-content: flex-end;
}

.kcb-bot-message {
  justify-content: flex-start;
  align-items: flex-end;
}

.kcb-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.kcb-bubble {
  max-width: 78%;
  padding: 11px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.kcb-bot-message .kcb-bubble {
  background: var(--kcb-bot);
  color: var(--kcb-text);
  border-bottom-left-radius: 6px;
}

.kcb-user-message .kcb-bubble {
  background: var(--kcb-user);
  color: white;
  border-bottom-right-radius: 6px;
}

.kcb-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  width: 52px;
  height: 22px;
}

.kcb-typing span {
  width: 7px;
  height: 7px;
  background: var(--kcb-muted);
  border-radius: 50%;
  animation: kcbTyping 1.2s infinite;
}

.kcb-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.kcb-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.kcb-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--kcb-border);
  background: #fff;
}

.kcb-suggestions button {
  white-space: nowrap;
  border: 1px solid var(--kcb-border);
  background: #f9fafb;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--kcb-text);
}

.kcb-suggestions button:hover {
  border-color: var(--kcb-primary);
  color: var(--kcb-primary-dark);
}

.kcb-composer {
  display: flex;
  gap: 10px;
  padding: 13px;
  background: white;
  border-top: 1px solid var(--kcb-border);
}

.kcb-input {
  flex: 1;
  border: 1px solid var(--kcb-border);
  border-radius: 16px;
  padding: 12px 13px;
  resize: none;
  outline: none;
  font-size: 14px;
  max-height: 110px;
  font-family: inherit;
}

.kcb-input:focus {
  border-color: var(--kcb-primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.kcb-send {
  border: 0;
  border-radius: 16px;
  background: var(--kcb-user);
  color: white;
  padding: 0 14px;
  min-width: 82px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.kcb-send:hover {
  transform: translateY(-1px);
}

.kcb-send.is-sending {
  opacity: 0.72;
  cursor: wait;
}

.kcb-send.is-sending .kcb-send-icon {
  animation: kcbSpin 0.8s linear infinite;
}

.kcb-footer {
  text-align: center;
  font-size: 11px;
  color: var(--kcb-muted);
  padding: 8px 10px 11px;
  background: white;
}

.kcb-skin-dark {
  --kcb-primary: #111827;
  --kcb-primary-dark: #030712;
  --kcb-bg: #0f172a;
  --kcb-text: #f9fafb;
  --kcb-muted: #cbd5e1;
  --kcb-border: rgba(255,255,255,0.12);
  --kcb-bot: #1e293b;
}

.kcb-skin-dark .kcb-messages,
.kcb-skin-dark .kcb-suggestions,
.kcb-skin-dark .kcb-composer,
.kcb-skin-dark .kcb-footer {
  background: #0f172a;
}

.kcb-skin-dark .kcb-input,
.kcb-skin-dark .kcb-suggestions button {
  background: #111827;
  color: white;
}

.kcb-skin-blue {
  --kcb-primary: #2563eb;
  --kcb-primary-dark: #1d4ed8;
}

.kcb-skin-orange {
  --kcb-primary: #f97316;
  --kcb-primary-dark: #ea580c;
}

.kcb-skin-glass .kcb-panel {
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(18px);
}

@keyframes kcbTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-5px); opacity: 1; }
}

@keyframes kcbIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes kcbPulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.35); }
  70% { box-shadow: 0 0 0 14px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

@keyframes kcbSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
  .kcb-floating {
    right: 14px;
    bottom: 14px;
  }

  .kcb-panel {
    width: calc(100vw - 28px);
    height: min(620px, calc(100vh - 110px));
    border-radius: 22px;
  }

  .kcb-launcher {
    width: 60px;
    height: 60px;
  }
}
.kcb-suggestions button {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.kcb-suggestions button.kcb-updating {
    opacity: 0;
    transform: translateY(4px);
}