.ep-chat-root {
  --epc-navy: #0d2d56;
  --epc-teal: #2db8bc;
  --epc-blue: #0e7caf;
  --epc-bg: #f5fafb;
  --epc-ink: #0d2d56;
  --epc-muted: #7a919e;
  --epc-border: #d7e6eb;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  /* Full-viewport layer above hero transforms / site chrome */
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
}
.ep-chat-root > * {
  pointer-events: auto;
}
.ep-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483001;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, var(--epc-teal), var(--epc-blue));
  box-shadow: 0 12px 28px rgba(14,124,175,.35);
  display: grid;
  place-items: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.ep-chat-launcher:hover { transform: translateY(-2px) scale(1.03); }
.ep-chat-launcher[aria-expanded="true"] { background: var(--epc-navy); }
.ep-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  place-items: center;
}
.ep-chat-badge.is-on { display: grid; }

.ep-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 2147483001;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  background: #fff;
  border: 1px solid var(--epc-border);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(13,45,86,.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.ep-chat-panel.is-open { display: flex; }

.ep-chat-head {
  padding: 14px 16px;
  background: linear-gradient(135deg, #0b2748, #0e5f7a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ep-chat-head strong { display: block; font-size: 14px; }
.ep-chat-head span { display: block; font-size: 12px; opacity: .75; margin-top: 2px; }
.ep-chat-close {
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.ep-chat-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(46,184,188,.08), transparent 60%),
    var(--epc-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ep-chat-msg {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ep-chat-msg small {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
  opacity: .65;
}
.ep-chat-msg.visitor {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--epc-teal), var(--epc-blue));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ep-chat-msg.agent {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--epc-border);
  color: var(--epc-ink);
  border-bottom-left-radius: 4px;
}
.ep-chat-msg.system {
  align-self: center;
  background: transparent;
  color: var(--epc-muted);
  font-size: 12px;
  text-align: center;
  max-width: 95%;
  padding: 4px 8px;
}

.ep-chat-prefill, .ep-chat-compose {
  border-top: 1px solid var(--epc-border);
  padding: 12px;
  background: #fff;
}
.ep-chat-prefill {
  display: grid;
  gap: 8px;
}
.ep-chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.ep-chat-prefill input,
.ep-chat-compose textarea,
.ep-chat-prefill textarea {
  width: 100%;
  border: 1px solid var(--epc-border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--epc-ink);
  background: #fbfcff;
  resize: none;
}
.ep-chat-compose textarea {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.4;
  padding: 11px 12px;
}
.ep-chat-prefill input:focus,
.ep-chat-compose textarea:focus,
.ep-chat-prefill textarea:focus {
  outline: none;
  border-color: var(--epc-teal);
  box-shadow: 0 0 0 3px rgba(14,124,175,.14);
}
.ep-chat-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ep-chat-send {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--epc-teal), var(--epc-blue));
  cursor: pointer;
  flex-shrink: 0;
}
.ep-chat-compose .ep-chat-send {
  height: 42px;
  padding: 0 18px;
}
.ep-chat-send:disabled { opacity: .6; cursor: not-allowed; }
.ep-chat-hint { margin: 0; font-size: 11.5px; color: var(--epc-muted); }

@media (max-width: 520px) {
  .ep-chat-launcher { right: 14px; bottom: 14px; }
  .ep-chat-panel { right: 12px; bottom: 80px; height: min(70vh, 560px); }
}

body.nav-lock .ep-chat-root {
  visibility: hidden !important;
  pointer-events: none !important;
}
