#vakta-chat-widget {
  --vc-primary: #1a1a2e;
  --vc-accent: #4f7cff;
  --vc-bg: #ffffff;
  --vc-surface: #f5f5f7;
  --vc-border: #e0e0e0;
  --vc-text: #1a1a1a;
  --vc-text-muted: #666;
  --vc-radius: 12px;
  --vc-shadow: 0 8px 32px rgba(0,0,0,0.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--vc-text);
  box-sizing: border-box;
}

#vakta-chat-widget *,
#vakta-chat-widget *::before,
#vakta-chat-widget *::after {
  box-sizing: inherit;
}

/* Trigger button */
#vakta-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--vc-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--vc-shadow);
  transition: transform 0.2s, background 0.2s;
}

#vakta-chat-trigger:hover {
  background: var(--vc-accent);
  transform: scale(1.08);
}

#vakta-chat-trigger svg {
  width: 26px;
  height: 26px;
  pointer-events: none;
}

/* Drawer overlay */
#vakta-chat-drawer {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 9999;
  width: 380px;
  max-width: 100vw;
  height: 580px;
  max-height: 90vh;
  background: var(--vc-bg);
  border-radius: var(--vc-radius) var(--vc-radius) 0 0;
  box-shadow: var(--vc-shadow);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#vakta-chat-drawer.open {
  transform: translateY(0);
}

/* Header */
#vakta-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--vc-primary);
  color: #fff;
  flex-shrink: 0;
}

#vakta-chat-header-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
}

#vakta-chat-header-sub {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 1px;
}

#vakta-chat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  opacity: 0.8;
  transition: opacity 0.15s;
}

#vakta-chat-close:hover {
  opacity: 1;
}

/* Messages area */
#vakta-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

#vakta-chat-messages::-webkit-scrollbar {
  width: 4px;
}

#vakta-chat-messages::-webkit-scrollbar-thumb {
  background: var(--vc-border);
  border-radius: 2px;
}

.vc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.vc-msg.user {
  align-self: flex-end;
  background: var(--vc-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.vc-msg.assistant {
  align-self: flex-start;
  background: var(--vc-surface);
  color: var(--vc-text);
  border-bottom-left-radius: 4px;
}

.vc-msg.assistant.streaming::after {
  content: '▋';
  display: inline-block;
  animation: vc-blink 0.7s step-end infinite;
  margin-left: 2px;
  color: var(--vc-accent);
}

@keyframes vc-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Welcome / empty state */
#vakta-chat-welcome {
  align-self: flex-start;
  font-size: 14px;
  color: var(--vc-text-muted);
  background: var(--vc-surface);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  max-width: 85%;
}

/* Input row */
#vakta-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--vc-border);
  background: var(--vc-bg);
  flex-shrink: 0;
}

#vakta-chat-input {
  flex: 1;
  border: 1px solid var(--vc-border);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: var(--vc-surface);
  color: var(--vc-text);
  max-height: 100px;
  line-height: 1.4;
  transition: border-color 0.15s;
  overflow-y: auto;
}

#vakta-chat-input:focus {
  border-color: var(--vc-accent);
}

#vakta-chat-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--vc-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}

#vakta-chat-send:hover:not(:disabled) {
  background: #3a6ae0;
  transform: scale(1.05);
}

#vakta-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#vakta-chat-send svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Footer note */
#vakta-chat-footer {
  text-align: center;
  font-size: 11px;
  color: var(--vc-text-muted);
  padding: 6px 12px 10px;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  #vakta-chat-drawer {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  #vakta-chat-trigger {
    bottom: 16px;
    right: 16px;
  }
}
