/* [ep_chat] - loaded only on pages with the shortcode.
   --ep-chat-primary (setting "accent color") = accent: launcher, user bubbles, starter questions. Light blue fails 4.5:1
   with white text, so text on it is dark (--ep-chat-on-accent). The header bar and text/focus on white use --ep-chat-dark. */
.ep-chat {
  --ep-chat-accent: var(--ep-chat-primary, #78abc8);
  --ep-chat-on-accent: #10293a;
  --ep-chat-dark: #0b5c8e;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 1em 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
.ep-chat *, .ep-chat *::before, .ep-chat *::after { box-sizing: border-box; }

/* header: icon, title + subtitle, "+" (new conversation), x (overlay) */
.ep-chat__header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px 10px 12px 16px;
  background: var(--ep-chat-dark);
  color: #fff;
  border-radius: 12px 12px 0 0;
}
.ep-chat__icon { flex: 0 0 auto; }
.ep-chat__titles { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.ep-chat__title { display: block; font-size: 1.3em; font-weight: 500; line-height: 1.3; color: #fff; }
.ep-chat__subtitle { display: block; font-size: 0.95em; line-height: 1.35; color: #fff; opacity: 0.9; }
.ep-chat__new,
.ep-chat__close {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #fff;
  cursor: pointer;
}
.ep-chat__new:hover, .ep-chat__close:hover { background: rgba(255, 255, 255, 0.18); }
.ep-chat__new:focus-visible, .ep-chat__close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* inline: header + chat form one box */
.ep-chat__box {
  max-width: 100%;
  border: 1px solid #c9d0d6;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.ep-chat__box .ep-chat__header { border-radius: 0; }
.ep-chat__chat {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  max-height: 85dvh;
  border: 0;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}
.ep-chat__privacy { margin: 6px 0 0; font-size: 0.8125em; line-height: 1.4; color: #5a636b; }
@media (max-width: 600px) {
  .ep-chat { margin: 0.5em 0; }
  .ep-chat__box { width: 100% !important; }
}

/* Overlay mode: fixed launcher bottom right + panel. z-index above Enfold's header (~10000); EP Popup uses far higher values and stays on top. */
.ep-chat--overlay { margin: 0; width: auto; max-width: none; }
.ep-chat__launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ep-chat-accent);
  color: var(--ep-chat-on-accent);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.ep-chat__launcher:hover { filter: brightness(1.1); }
.ep-chat__launcher:focus-visible { outline: 3px solid var(--ep-chat-dark); outline-offset: 3px; }
.ep-chat__panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 120px);
  padding: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  color: #1b1f23;
}
.ep-chat__panel[hidden] { display: none; }
.ep-chat__panel:focus { outline: none; }
/* Deep Chat's inner #container uses height:inherit: with height:auto it grows with the messages and the host clips the input */
.ep-chat__panel .ep-chat__chat { flex: 1 1 auto; min-height: 0; width: 100%; height: 100%; max-height: none; }
.ep-chat__panel .ep-chat__privacy { flex: 0 0 auto; margin: 0; padding: 4px 16px 10px; }
@media (max-width: 600px) {
  .ep-chat__panel {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .ep-chat__panel .ep-chat__header { border-radius: 0; }
  .ep-chat--open .ep-chat__launcher { display: none; }
}
