#cc-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: #1f2937;
  --cc-brand-blue: #1d74d2;
  --cc-bot-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2064%2064%22%3E%0A%20%20%3Ccircle%20cx%3D%2232%22%20cy%3D%2232%22%20r%3D%2220%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%224%22/%3E%0A%20%20%3Ccircle%20cx%3D%2226%22%20cy%3D%2230%22%20r%3D%224%22%20fill%3D%22white%22/%3E%0A%20%20%3Ccircle%20cx%3D%2238%22%20cy%3D%2230%22%20r%3D%224%22%20fill%3D%22white%22/%3E%0A%20%20%3Cpath%20d%3D%22M24%2042c2.5%203%206%205%208%205s5.5-2%208-5%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%224%22%20stroke-linecap%3D%22round%22/%3E%0A%20%20%3Cpath%20d%3D%22M12%2032a20%2020%200%200%201%2040%200%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%226%22%20stroke-linecap%3D%22round%22/%3E%0A%20%20%3Crect%20x%3D%228%22%20y%3D%2228%22%20width%3D%228%22%20height%3D%2214%22%20rx%3D%224%22%20fill%3D%22white%22/%3E%0A%20%20%3Crect%20x%3D%2248%22%20y%3D%2228%22%20width%3D%228%22%20height%3D%2214%22%20rx%3D%224%22%20fill%3D%22white%22/%3E%0A%3C/svg%3E");
}

#cc-chatbot * {
  box-sizing: border-box;
}

#cc-greeting-card {
  position: absolute;
  bottom: 98px;
  right: 0;
  width: 320px;
  padding: 24px 24px 20px;
  border-radius: 20px;
  background: #ffffff;
  background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#cc-greeting-card.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#cc-greeting-card .cc-icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
}

.cc-greeting-body {
  padding-top: 8px;
}

.cc-greeting-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.cc-greeting-title span {
  font-size: 26px;
}

.cc-greeting-text {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: #4b5563;
}

.cc-greeting-subtext {
  margin: 0;
  font-size: 14px;
  color: #2563eb;
  font-weight: 600;
}

.cc-start-button {
  margin-top: 18px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: #ffffff;
  color: #1e3a8a;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 16px 12px 12px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cc-start-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(59, 130, 246, 0.28);
}

.cc-start-button:active {
  transform: translateY(1px);
}

.cc-start-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  font-size: 15px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25);
}

.cc-icon-button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

#cc-greeting-close {
  background: #ffffff;
  color: #ef4444;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.2);
}

#cc-greeting-close:hover {
  background: #ef4444;
  color: #ffffff;
}

#cc-chat-close {
  background: transparent;
  color: #9ca3af;
}

#cc-chat-close:hover {
  color: #ef4444;
}

#cc-chat-toggle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #1d74d2;
  font-size: 26px;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.18);
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#cc-chat-toggle:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

#cc-chat-toggle .cc-toggle-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  position: relative;
  background: var(--cc-brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px #ffffff, 0 16px 28px rgba(29, 116, 210, 0.35);
  font-size: 0;
  overflow: hidden;
}

#cc-chat-toggle .cc-toggle-avatar::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 14px;
  background: var(--cc-bot-icon) no-repeat center/contain;
}

#cc-chat-toggle .cc-toggle-avatar::after {
  content: attr(data-agent-label);
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: #ffffff;
  text-transform: uppercase;
}

#cc-chatbot.open #cc-chat-toggle,
#cc-chatbot.cc-greeting-visible #cc-chat-toggle {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

#cc-chatbot.cc-greeting-dismissed:not(.open) #cc-chat-toggle {
  opacity: 1;
  pointer-events: auto;
}

#cc-chat-panel {
  position: absolute;
  bottom: 94px;
  right: 0;
  width: 340px;
  border-radius: 22px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#cc-chatbot.open #cc-chat-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cc-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.cc-chat-agent {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cc-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  background: var(--cc-brand-blue);
  box-shadow: 0 0 0 3px #ffffff, 0 8px 16px rgba(29, 116, 210, 0.32);
  overflow: hidden;
}

.cc-chat-avatar::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--cc-bot-icon) no-repeat center/contain;
}

.cc-chat-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cc-chat-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.cc-chat-status {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.cc-chat-window {
  max-height: 420px;
  overflow-y: auto;
  padding: 20px 20px 14px;
  background: #f5f7fb;
}

.cc-message {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.cc-message.user {
  flex-direction: row-reverse;
}

.cc-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.cc-message-avatar::before {
  content: "";
  position: absolute;
  inset: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: inherit;
}

.cc-message-avatar.cc-avatar-bot {
  background: var(--cc-brand-blue);
  box-shadow: 0 0 0 2px #ffffff, 0 4px 12px rgba(29, 116, 210, 0.28);
}

.cc-message-avatar.cc-avatar-bot::before {
  content: "";
  background: var(--cc-bot-icon) no-repeat center/contain;
}

.cc-message-avatar.cc-avatar-user {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #1f2937;
  box-shadow: 0 0 0 2px #ffffff, 0 4px 12px rgba(249, 115, 22, 0.25);
}

.cc-message-avatar.cc-avatar-user::before {
  content: "🙂";
  font-size: 18px;
}

.cc-message-bubble {
  max-width: 72%;
  background: #ffffff;
  border-radius: 16px 16px 16px 6px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #1f2937;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.cc-message.user .cc-message-bubble {
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
}

.cc-message.typing .cc-message-bubble {
  font-style: italic;
  opacity: 0.75;
}

.cc-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #ffffff;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

#cc-chat-input {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#cc-chat-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#cc-chat-send {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#cc-chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.35);
}

#cc-chat-send:active {
  transform: translateY(1px);
}

@media (max-width: 480px) {
  #cc-chatbot {
    right: 16px;
    left: 16px;
  }

  #cc-greeting-card,
  #cc-chat-panel {
    width: auto;
    right: 0;
    left: 0;
  }
}
