.covt-chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #00416A;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 65, 106, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 9999;
}

.covt-chatbot-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 65, 106, 0.3);
}

.covt-chatbot-toggle:hover {
  transform: scale(1.05);
}

.covt-chatbot-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 420px;
  height: 580px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.covt-chatbot-panel.hidden {
  display: none;
}

.covt-chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #00A0AE, #00416A);
  color: #ffffff;
}

.covt-chatbot-title {
  font-size: 16px;
  font-weight: 600;
}

.covt-chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.covt-chatbot-new-chat {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.covt-chatbot-new-chat:hover {
  background: rgba(255, 255, 255, 0.2);
}

.covt-chatbot-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}

.covt-chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.covt-chatbot-message {
  margin-bottom: 12px;
  line-height: 1.5;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 80%;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
  word-break: break-word;
}

.covt-chatbot-message.user {
  background: #00416A;
  color: #ffffff;
  align-self: flex-end;
}

.covt-chatbot-message.bot {
  background: #ffffff;
  color: #00416A;
}

.covt-chatbot-message-text p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.covt-chatbot-message-text p:last-child {
  margin-bottom: 0;
}

.covt-chatbot-citations {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.covt-chatbot-citations.collapsed {
  display: none;
}

.covt-chatbot-citation {
  font-size: 12px;
  color: #00416A;
  transition: background 0.2s ease;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
  padding: 4px 0;
}

.covt-chatbot-citation-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  color: #00A0AE;
  background: rgba(0, 160, 174, 0.12);
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  margin-right: 6px;
  flex-shrink: 0;
}

.covt-chatbot-citation-link,
.covt-chatbot-citation-title {
  font-weight: 600;
  color: #00416A;
}

.covt-chatbot-citation-link {
  text-decoration: none;
}

.covt-chatbot-citation-link:hover {
  text-decoration: underline;
}

.covt-chatbot-citation-snippet {
  margin: 4px 0 0;
  color: #5C6670;
  line-height: 1.5;
}

.covt-chatbot-citation-snippet--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.covt-chatbot-snippet-toggle {
  border: none;
  background: transparent;
  color: #00A0AE;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
}

.covt-chatbot-snippet-toggle:hover {
  text-decoration: underline;
}

.covt-chatbot-citation-icon {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  vertical-align: middle;
}

.covt-chatbot-citation--highlight {
  background: rgba(0, 160, 174, 0.12);
  border-radius: 8px;
  padding: 4px;
}

.covt-chatbot-inline-citation {
  border: none;
  background: rgba(0, 160, 174, 0.15);
  color: #00A0AE;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  margin: 0 1px;
  cursor: pointer;
  vertical-align: super;
  line-height: 16px;
  text-align: center;
}

.covt-chatbot-inline-citation:hover {
  background: rgba(0, 160, 174, 0.3);
}

.covt-chatbot-citations-toggle {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: #00A0AE;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
}

.covt-chatbot-citations-toggle:hover {
  text-decoration: underline;
}

.covt-chatbot-footer {
  display: flex;
  align-items: flex-end;
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  transition: opacity 0.2s ease;
}

.covt-chatbot-footer--sending {
  opacity: 0.55;
  pointer-events: none;
}

.covt-chatbot-input {
  flex: 1;
  border: 1px solid #b0b8c1;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  overflow-y: auto;
  min-height: 38px;
  max-height: 120px;
  line-height: 1.4;
}

.covt-chatbot-send {
  margin-left: 8px;
  border: none;
  border-radius: 999px;
  background: #00416A;
  color: #ffffff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.covt-chatbot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.covt-chatbot-send--loading {
  position: relative;
  min-width: 56px;
}

.covt-chatbot-send--loading::after {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: covt-spin 0.6s linear infinite;
}

@keyframes covt-spin {
  to { transform: rotate(360deg); }
}

.covt-chatbot-status {
  font-size: 12px;
  color: #5C6670;
  margin-top: 4px;
}

/* Typing indicator */
.covt-chatbot-typing {
  padding: 10px 14px;
  max-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.covt-chatbot-typing-label {
  font-size: 13px;
  color: #5C6670;
  white-space: nowrap;
}

.covt-chatbot-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}

.covt-chatbot-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5C6670;
  animation: covt-bounce 1.4s ease-in-out infinite;
}

.covt-chatbot-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.covt-chatbot-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes covt-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}
