:root {
  --chat-bg: #ffffff;
  --chat-fg: #1e1e1e;
  --chat-accent: #4a6fa5;
  --chat-bubble-bot: #f4f6fb;
  --chat-bubble-user: #e8f0fe;
}
[data-theme="dark"] {
  --chat-bg: #1c1f26;
  --chat-fg: #ffffff;
  --chat-accent: #6c8fc7;
  --chat-bubble-bot: #2a2f3a;
  --chat-bubble-user: #25324a;
}
#ekds-chat-root {
  pointer-events: none;
}
.ekds-chat-fab,
.ekds-chat-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483647;
  pointer-events: auto;
}
.ekds-chat-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4a6fa5;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="dark"] .ekds-chat-fab {
  background: #6c8fc7;
  color: #fff;
}
.ekds-chat-panel {
  width: 360px;
  height: 520px;
  max-width: calc(100vw - 24px);
  max-height: 80vh;
  background: var(--chat-bg);
  color: var(--chat-fg);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hidden { display: none; }
.chat-header {
  background: var(--chat-accent);
  color: #fff;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: var(--chat-bg);
}
.msg { margin-bottom: 8px; display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg .bubble {
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 85%;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
}
.chat-bubble {
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
}
.msg.user .bubble { background: var(--chat-bubble-user); }
.msg.bot .bubble { background: var(--chat-bubble-bot); }
.chat-input {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid rgba(0,0,0,0.1);
}
.chat-input input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--chat-bg);
  color: var(--chat-fg);
}
.chat-input button {
  background: var(--chat-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
.chat-cta {
  margin-top: 4px;
  background: var(--chat-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
}
[data-theme="dark"] .chat-input {
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .chat-input input {
  border-color: rgba(255,255,255,0.2);
}
@media (max-width: 480px) {
  .ekds-chat-panel {
    width: calc(100vw - 24px);
    height: 70vh;
  }
}
