#efx-chat {
  --efx-accent: #1454d1;
  --efx-on-accent: #fff;
  --efx-edge: 24px;
  --efx-toggle-size: 58px;
  --efx-bottom: calc(var(--efx-edge) + env(safe-area-inset-bottom, 0px));
  position: fixed;
  z-index: 99999;
  right: calc(var(--efx-edge) + env(safe-area-inset-right, 0px));
  left: auto;
  bottom: var(--efx-bottom);
  margin: 0;
  color: #17253a;
  font: 400 15px/1.45 "Instrument Sans", "Helvetica Neue", sans-serif;
  letter-spacing: normal;
  text-align: left;
}

#efx-chat,
#efx-chat *,
#efx-chat *::before,
#efx-chat *::after { box-sizing: border-box; }
#efx-chat [hidden] { display: none !important; }

#efx-chat :is(.efx-chat__toggle, .efx-chat__close, .efx-chat__send) {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  letter-spacing: normal;
  text-align: center;
}

#efx-chat .efx-chat__toggle {
  width: var(--efx-toggle-size);
  height: var(--efx-toggle-size);
  border: 0;
  border-radius: 50%;
  background: var(--efx-accent);
  color: var(--efx-on-accent);
  font-size: 29px;
  box-shadow: 0 10px 28px rgba(17, 35, 68, .25);
  transition: transform .18s ease;
}

#efx-chat .efx-chat__toggle:hover { transform: translateY(-2px); }

#efx-chat .efx-chat__panel {
  position: absolute;
  right: 0;
  left: auto;
  bottom: calc(var(--efx-toggle-size) + 12px);
  display: flex;
  flex-direction: column;
  width: min(368px, calc(100vw - var(--efx-edge) * 2 - env(safe-area-inset-right, 0px)));
  height: min(550px, calc(100vh - var(--efx-bottom) - var(--efx-toggle-size) - 24px));
  height: min(550px, calc(100dvh - var(--efx-bottom) - var(--efx-toggle-size) - 24px));
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e0e5ee;
  border-radius: 19px 19px 13px 13px;
  box-shadow: 0 18px 52px rgba(19, 37, 64, .23);
}

#efx-chat .efx-chat__head {
  flex: none;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  background: var(--efx-accent);
  color: var(--efx-on-accent);
}

#efx-chat #efx-chat-title {
  color: inherit;
  font-family: inherit;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

#efx-chat .efx-chat__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
}

#efx-chat .efx-chat__close:hover { background: rgba(127, 127, 127, .23); }
#efx-chat .efx-chat__chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

#efx-chat .efx-chat__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--efx-accent);
  color: var(--efx-on-accent);
  font-size: 17px;
}

#efx-chat .efx-chat__head .efx-chat__avatar {
  width: 42px;
  height: 42px;
  border: 2px solid currentColor;
}

#efx-chat .efx-chat__icon {
  position: relative;
  display: block;
  width: .86em;
  height: .68em;
  flex: none;
  border: .08em solid currentColor;
}

#efx-chat :is(.efx-chat__icon--chat, .efx-chat__icon--double) { border-radius: .25em; }
#efx-chat :is(.efx-chat__icon--chat, .efx-chat__icon--double)::after {
  content: "";
  position: absolute;
  left: .10em;
  bottom: -.15em;
  width: .20em;
  height: .20em;
  border-left: .08em solid currentColor;
  transform: skewY(-37deg);
}

#efx-chat .efx-chat__icon--double { transform: translate(-.10em, .11em) scale(.76); }
#efx-chat .efx-chat__icon--double::before {
  content: "";
  position: absolute;
  top: -.29em;
  right: -.33em;
  width: .71em;
  height: .57em;
  border: .08em solid currentColor;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: .21em;
}
#efx-chat .efx-chat__icon--message { border-radius: .13em; overflow: hidden; }
#efx-chat .efx-chat__icon--message::after {
  content: "";
  position: absolute;
  top: -.30em;
  left: .10em;
  width: .51em;
  height: .51em;
  border-right: .08em solid currentColor;
  border-bottom: .08em solid currentColor;
  transform: rotate(45deg);
}

#efx-chat .efx-chat__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 15px;
}

#efx-chat .efx-chat__row { display: flex; align-items: flex-start; gap: 8px; }
#efx-chat .efx-chat__row + .efx-chat__row { margin-top: 12px; }
#efx-chat .efx-chat__row--visitor { justify-content: flex-end; }

#efx-chat .efx-chat__bubble {
  max-width: min(calc(100% - 42px), 295px);
  padding: 10px 12px 7px;
  border-radius: 3px 13px 13px 13px;
  background: #edf1f6;
  color: #17253a;
  overflow-wrap: anywhere;
}

#efx-chat .efx-chat__bubble--visitor {
  max-width: 88%;
  border-radius: 13px 3px 13px 13px;
  background: var(--efx-accent);
  color: var(--efx-on-accent);
}

#efx-chat .efx-chat__bubble :is(dl, dt, dd) { margin: 0; padding: 0; color: inherit; }
#efx-chat .efx-chat__bubble :is(dt, dd) { display: inline; }
#efx-chat .efx-chat__bubble dt { font-weight: 650; }
#efx-chat .efx-chat__bubble dl > div + div { margin-top: 5px; }
#efx-chat .efx-chat__reply { white-space: pre-line; }

#efx-chat .efx-chat__time {
  display: block;
  margin-top: 4px;
  font: inherit;
  font-size: 11px;
  color: inherit;
  opacity: .8;
  text-align: right;
}

#efx-chat .efx-chat__form {
  margin: 17px 0 0 40px;
  padding: 0;
  background: transparent;
  border: 0;
}

#efx-chat .efx-chat__fields {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid #e4e8ef;
  border-radius: 13px;
}

#efx-chat .efx-chat__fields input {
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 41px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #bdc9d9;
  border-radius: 8px;
  background: #fff;
  color: #17253a;
  font: inherit;
  font-size: 16px;
  box-shadow: none;
}

#efx-chat .efx-chat__fields input::placeholder { color: #526176; opacity: 1; }
#efx-chat .efx-chat__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#efx-chat .efx-chat__privacy { margin: 8px 0 10px; color: #45566c; font: inherit; font-size: 12px; }
#efx-chat .efx-chat__send-row { display: flex; justify-content: flex-end; }
#efx-chat .efx-chat__send {
  min-height: 42px;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 10px;
  background: var(--efx-accent);
  color: var(--efx-on-accent);
  font-weight: 650;
}
#efx-chat .efx-chat__send:hover { filter: brightness(.9); }
#efx-chat .efx-chat__send:disabled { cursor: wait; opacity: .65; }
#efx-chat .efx-chat__status:not(:empty) { margin: 9px 0 0 40px; font-size: 13px; }
#efx-chat .efx-chat__status[data-state="error"] { color: #9b2626; }
#efx-chat .efx-chat__status[data-state="confirmed"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

#efx-chat .efx-chat__transcript { margin-top: 13px; }
#efx-chat .efx-chat__destination {
  display: inline-block;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 650;
  color: #11469f;
  text-decoration: underline;
}

#efx-chat .efx-chat__footer {
  flex: none;
  margin: 0;
  padding: 9px;
  border-top: 1px solid #edf0f4;
  background: #fff;
  color: #45566c;
  font-size: 12px;
  text-align: center;
}
#efx-chat .efx-chat__footer strong { color: #17253a; }
#efx-chat :is(button, a, input):focus-visible { outline: 2px solid #2968cf; outline-offset: 2px; }
#efx-chat .efx-chat__close:focus-visible { outline-color: var(--efx-on-accent); }

@media (max-width: 480px) {
  #efx-chat { --efx-edge: 14px; --efx-toggle-size: 54px; }
  #efx-chat .efx-chat__panel { width: min(368px, calc(100vw - 28px - env(safe-area-inset-right, 0px))); }
}

@media (prefers-reduced-motion: reduce) {
  #efx-chat .efx-chat__toggle { transition: none; }
}
