/* EOS Live Chat: visitor widget. Every rule is scoped under .eos-chat to hold up against theme styles. */
.eos-chat {
  --eos-chat-accent: #1f4e8c;
  --eos-chat-ink: #1b1f24;
  --eos-chat-muted: #5b6470;
  --eos-chat-line: #dde1e6;
  --eos-chat-bg: #ffffff;
  --eos-chat-soft: #f3f5f8;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--eos-chat-ink);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.eos-chat[hidden], .eos-chat [hidden] { display: none !important; }
.eos-chat *, .eos-chat *::before, .eos-chat *::after { box-sizing: border-box; }

.eos-chat .eos-chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--eos-chat-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.eos-chat .eos-chat__launcher:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3); }
.eos-chat .eos-chat__launcher:focus-visible,
.eos-chat button:focus-visible,
.eos-chat input:focus-visible,
.eos-chat textarea:focus-visible { outline: 3px solid var(--eos-chat-accent); outline-offset: 2px; }
.eos-chat .eos-chat__launcher:focus-visible { outline-color: #fff; box-shadow: 0 0 0 5px var(--eos-chat-accent); }
.eos-chat .eos-chat__icon { display: inline-flex; line-height: 0; }
.eos-chat .eos-chat__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  border: 2px solid #fff;
}

.eos-chat .eos-chat__panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  background: var(--eos-chat-bg);
  border: 1px solid var(--eos-chat-line);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.eos-chat .eos-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--eos-chat-accent);
  color: #fff;
}
.eos-chat .eos-chat__title { font-weight: 700; font-size: 16px; }
.eos-chat .eos-chat__status { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: 0.92; }
.eos-chat .eos-chat__status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8ced6;
}
.eos-chat .eos-chat__status.is-online::before { background: #4ade80; }
.eos-chat .eos-chat__close {
  margin: 0;
  padding: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.eos-chat .eos-chat__close:hover { background: rgba(255, 255, 255, 0.15); }
.eos-chat .eos-chat__close:focus-visible { outline-color: #fff; }

.eos-chat .eos-chat__notice {
  margin: 0;
  padding: 8px 16px;
  background: #fff8e1;
  border-bottom: 1px solid #f1e3b5;
  color: #5c4a12;
  font-size: 13px;
}

.eos-chat .eos-chat__scroll { flex: 1; overflow-y: auto; padding: 16px; background: var(--eos-chat-soft); }
.eos-chat .eos-chat__log { display: flex; flex-direction: column; gap: 10px; }

.eos-chat .eos-chat__msg { display: flex; flex-direction: column; max-width: 85%; }
.eos-chat .eos-chat__msg--visitor { align-self: flex-end; align-items: flex-end; }
.eos-chat .eos-chat__msg--agent { align-self: flex-start; align-items: flex-start; }
.eos-chat .eos-chat__msg--system { align-self: center; align-items: center; max-width: 95%; }
.eos-chat .eos-chat__who { font-size: 12px; color: var(--eos-chat-muted); margin: 0 0 3px 4px; }
.eos-chat .eos-chat__bubble {
  padding: 9px 13px;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.eos-chat .eos-chat__msg--visitor .eos-chat__bubble { background: var(--eos-chat-accent); color: #fff; border-bottom-right-radius: 4px; }
.eos-chat .eos-chat__msg--agent .eos-chat__bubble { background: #fff; border: 1px solid var(--eos-chat-line); border-bottom-left-radius: 4px; }
.eos-chat .eos-chat__msg--system .eos-chat__bubble {
  background: transparent;
  color: var(--eos-chat-muted);
  font-size: 13px;
  text-align: center;
  padding: 4px 8px;
}
.eos-chat .eos-chat__time { font-size: 11px; color: var(--eos-chat-muted); margin: 3px 4px 0; }

.eos-chat .eos-chat__start { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.eos-chat .eos-chat__field { display: flex; flex-direction: column; gap: 4px; }
.eos-chat .eos-chat__field label { font-size: 13px; font-weight: 600; color: var(--eos-chat-ink); margin: 0; }
.eos-chat .eos-chat__field input,
.eos-chat .eos-chat__field textarea,
.eos-chat .eos-chat__compose textarea {
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #c3c9d1;
  border-radius: 10px;
  background: #fff;
  color: var(--eos-chat-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: none;
  resize: none;
}
.eos-chat .eos-chat__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.eos-chat .eos-chat__btn {
  margin: 0;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--eos-chat-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  cursor: pointer;
}
.eos-chat .eos-chat__btn:disabled { opacity: 0.6; cursor: default; }
.eos-chat .eos-chat__btn--ghost { background: #fff; color: var(--eos-chat-accent); border: 1px solid currentColor; }

.eos-chat .eos-chat__error { margin: 0; color: #b42318; font-size: 13px; }

.eos-chat .eos-chat__compose { padding: 10px 12px; border-top: 1px solid var(--eos-chat-line); background: #fff; }
.eos-chat .eos-chat__compose-row { display: flex; align-items: flex-end; gap: 8px; }
.eos-chat .eos-chat__compose textarea { flex: 1; max-height: 120px; overflow-y: hidden; }
.eos-chat .eos-chat__compose .eos-chat__error { margin-top: 6px; }
.eos-chat .eos-chat__send {
  flex: none;
  margin: 0;
  padding: 0;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--eos-chat-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.eos-chat .eos-chat__send:disabled { opacity: 0.6; cursor: default; }

.eos-chat .eos-chat__ended { padding: 12px 16px 16px; border-top: 1px solid var(--eos-chat-line); text-align: center; background: #fff; }
.eos-chat .eos-chat__ended p { margin: 0 0 10px; color: var(--eos-chat-muted); }

/* Phones: full-screen panel. */
@media (max-width: 480px) {
  .eos-chat { right: 16px; bottom: 16px; }
  .eos-chat.is-open { right: 0; bottom: 0; left: 0; top: 0; gap: 0; }
  .eos-chat.is-open .eos-chat__launcher { display: none; }
  .eos-chat .eos-chat__panel { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .eos-chat .eos-chat__field input,
  .eos-chat .eos-chat__field textarea,
  .eos-chat .eos-chat__compose textarea { font-size: 16px; } /* prevents iOS zoom on focus */
}

@media (prefers-reduced-motion: reduce) {
  .eos-chat .eos-chat__launcher { transition: none; }
}
