:root {
  --chatbutler-primary: #2563eb;
}

.chatbutler-root {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chatbutler-launcher {
  background: var(--chatbutler-primary);
  color: #fff;
  border-radius: 999px;
  border: none;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.3);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chatbutler-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.35);
  filter: brightness(0.88);
}

.chatbutler-launcher:focus-visible {
  outline: 2px solid #eff6ff;
  outline-offset: 2px;
}

.chatbutler-launcher-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.chatbutler-panel {
  position: absolute;
  right: 0;
  bottom: 4.25rem;
  width: 380px;
  height: 520px;
  max-height: none;
  background: #ffffff;
  color: #111827;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chatbutler-open .chatbutler-panel {
  display: flex;
}

/* Colored header */
.chatbutler-header {
  padding: 0.85rem 1rem;
  background: var(--chatbutler-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbutler-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.chatbutler-badge {
  display: none;
}

.chatbutler-header-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chatbutler-header-btn {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
}

.chatbutler-header-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}

.chatbutler-btn-close {
  color: #fecaca;
}

.chatbutler-messages {
  padding: 0.75rem 0.75rem 0.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: inherit;
}

.chatbutler-message {
  display: flex;
}

.chatbutler-message.chatbutler-user {
  justify-content: flex-end;
}

.chatbutler-bubble {
  max-width: 85%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.9rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.chatbutler-message.chatbutler-user .chatbutler-bubble {
  background: var(--chatbutler-primary);
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

.chatbutler-message.chatbutler-bot .chatbutler-bubble {
  background: #f3f4f6;
  border-bottom-left-radius: 0.2rem;
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-left: 3px solid var(--chatbutler-primary);
}

.chatbutler-footer {
  border-top: 1px solid rgba(229, 231, 235, 0.9);
  background: #f9fafb;
}

.chatbutler-disclaimer {
  padding: 0.4rem 0.75rem 0.3rem;
  font-size: 0.68rem;
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  border-bottom: 1px dashed rgba(209, 213, 219, 0.7);
}

.chatbutler-form {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem 0.45rem;
}

.chatbutler-input {
  flex: 1;
  resize: none;
  border-radius: 0.75rem;
  border: 1px solid rgba(209, 213, 219, 0.9);
  background: #ffffff;
  color: #111827;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  max-height: 4.2rem;
  font-family: inherit;
}

.chatbutler-input:focus-visible {
  outline: 2px solid var(--chatbutler-primary);
  outline-offset: 1px;
}

.chatbutler-send {
  background: var(--chatbutler-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.chatbutler-send:hover {
  filter: brightness(0.88);
}

.chatbutler-typing {
  padding: 0 0.6rem 0.35rem;
  font-size: 0.7rem;
  color: #6b7280;
}

.chatbutler-messages,
.chatbutler-input {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.chatbutler-input::placeholder {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 0.8rem;
  font-style: normal;
  color: #9ca3af;
}

.chatbutler-confirm {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.chatbutler-confirm-box {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  max-width: 280px;
  width: 86%;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
}

.chatbutler-confirm-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #111827;
}

.chatbutler-confirm-body {
  font-size: 0.8rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.chatbutler-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.chatbutler-confirm-btn {
  border-radius: 999px;
  border: none;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.chatbutler-confirm-cancel {
  background: #e5e7eb;
  color: #374151;
}

.chatbutler-confirm-confirm {
  background: #b91c1c;
  color: #ffffff;
}

@media (max-width: 600px) {
  .chatbutler-root {
    right: 1rem;
    left: 1rem;
  }

  .chatbutler-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 4rem;
    height: 75vh;
  }
}
