/* Eventogy Help chat widget — self-contained, dependency-free.
   Scoped under .eha- so it can't collide with guide styles. */
.eha-root {
  --eha-accent: #593df3;
  --eha-accent-soft: #eef2ff;
  --eha-ink: #1a1d23;
  --eha-ink-soft: #4b5260;
  --eha-border: #e4e7ec;
  --eha-card: #ffffff;
  --eha-bg: #f8f9fb;
  /* Brand fonts — Geist for headings, Inter for body text. Both are loaded by the host page. */
  --eha-font-head: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --eha-font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: var(--eha-font-body);
}

/* Launcher bubble */
.eha-launcher {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: var(--eha-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.eha-launcher:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(79, 70, 229, 0.45); }
.eha-launcher:focus-visible { outline: 3px solid var(--eha-accent-soft); outline-offset: 2px; }
.eha-launcher svg { width: 26px; height: 26px; }
.eha-root.eha-open .eha-launcher { display: none; }

/* Panel */
.eha-panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 110px));
  background: var(--eha-card);
  border: 1px solid var(--eha-border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(20, 24, 36, 0.22);
  overflow: hidden;
}
.eha-root.eha-open .eha-panel { display: flex; }

.eha-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--eha-accent);
  color: #fff;
}
.eha-header .eha-title { font-size: 15px; font-weight: 600; flex: 1; font-family: var(--eha-font-head); }
.eha-header .eha-sub { font-size: 12px; opacity: 0.85; font-weight: 400; }
.eha-iconbtn {
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eha-iconbtn:hover { background: rgba(255, 255, 255, 0.28); }
.eha-iconbtn svg { width: 16px; height: 16px; }

/* Messages */
.eha-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--eha-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.eha-msg { max-width: 85%; font-size: 14px; line-height: 1.5; }
.eha-msg-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.eha-msg.user { align-self: flex-end; }
.eha-msg.user .eha-msg-bubble { background: var(--eha-accent); color: #fff; border-bottom-right-radius: 4px; }
.eha-msg.assistant { align-self: flex-start; }
.eha-msg.assistant .eha-msg-bubble {
  background: var(--eha-card);
  color: var(--eha-ink);
  border: 1px solid var(--eha-border);
  border-bottom-left-radius: 4px;
}
.eha-msg.assistant a { color: var(--eha-accent); font-weight: 600; }
.eha-msg-bubble strong { font-weight: 600; }

.eha-intro { color: var(--eha-ink-soft); font-size: 13.5px; line-height: 1.5; }
.eha-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.eha-chip {
  font: inherit;
  font-size: 12.5px;
  background: var(--eha-accent-soft);
  color: var(--eha-accent);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
}
.eha-chip:hover { border-color: var(--eha-accent); }

.eha-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.eha-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--eha-ink-soft); opacity: 0.5;
  animation: eha-bounce 1s infinite;
}
.eha-typing span:nth-child(2) { animation-delay: 0.15s; }
.eha-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes eha-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* Composer */
.eha-composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--eha-border);
  background: var(--eha-card);
}
.eha-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--eha-border);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
  color: var(--eha-ink);
  max-height: 110px;
  line-height: 1.4;
  /* Hidden by default — JS flips to auto only when content exceeds max-height,
     so a single line never shows a phantom scrollbar. */
  overflow-y: hidden;
}
.eha-input:focus { outline: none; border-color: var(--eha-accent); box-shadow: 0 0 0 3px var(--eha-accent-soft); }

/* Soften the scrollbars (input + messages) away from the chunky OS default. */
.eha-input, .eha-messages { scrollbar-width: thin; scrollbar-color: var(--eha-border) transparent; }
.eha-input::-webkit-scrollbar, .eha-messages::-webkit-scrollbar { width: 8px; }
.eha-input::-webkit-scrollbar-track, .eha-messages::-webkit-scrollbar-track { background: transparent; }
.eha-input::-webkit-scrollbar-thumb, .eha-messages::-webkit-scrollbar-thumb {
  background: var(--eha-border);
  border-radius: 999px;
  border: 2px solid var(--eha-card);
}
.eha-input::-webkit-scrollbar-thumb:hover, .eha-messages::-webkit-scrollbar-thumb:hover { background: #c8cdd6; }
.eha-send {
  border: none;
  background: var(--eha-accent);
  color: #fff;
  border-radius: 10px;
  width: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.eha-send:disabled { opacity: 0.45; cursor: default; }
.eha-send svg { width: 18px; height: 18px; }

.eha-footnote { text-align: center; font-size: 11px; color: var(--eha-ink-soft); padding: 0 12px 10px; background: var(--eha-card); }

@media (prefers-reduced-motion: reduce) {
  .eha-launcher, .eha-typing span { transition: none; animation: none; }
}
