/*
 * The chat bubble on the mirrored pages. Prefixed and reset locally, because
 * it lands inside the old template stylesheet, which has an opinion about every
 * element on the page.
 */
.eslchat,
.eslchat * {
  box-sizing: border-box;
}

.eslchat {
  font-family: Figtree, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.eslchat__bubble {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #0040bc;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(0, 64, 188, 0.8);
  animation: eslchat-nudge 7s ease-in-out infinite;
}
.eslchat__bubble:hover {
  background: #001a4d;
}
.eslchat__bubble.is-open {
  animation: none;
}
.eslchat__bubble svg {
  position: relative;
  width: 24px;
  height: 24px;
}
.eslchat__bubble svg[hidden] { display: none; }

.eslchat__ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #0040bc;
  animation: eslchat-ring 2.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.eslchat__bubble.is-open .eslchat__ring {
  display: none;
}

@keyframes eslchat-nudge {
  0%, 82%, 100% { transform: rotate(0deg) scale(1); }
  85%           { transform: rotate(-11deg) scale(1.06); }
  88%           { transform: rotate(9deg) scale(1.06); }
  91%           { transform: rotate(-7deg) scale(1.04); }
  94%           { transform: rotate(5deg) scale(1.02); }
  97%           { transform: rotate(-2deg) scale(1); }
}
@keyframes eslchat-ring {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .eslchat__bubble,
  .eslchat__ring { animation: none; }
  .eslchat__ring { opacity: 0; }
}

.eslchat__teaser {
  position: fixed;
  bottom: 84px;
  left: 20px;
  z-index: 9998;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: min(19rem, calc(100vw - 2.5rem));
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 18px 40px -24px rgba(0, 26, 77, 0.55);
}
.eslchat__teaser[hidden] { display: none; }
.eslchat__teaser p {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: #1b1f2a;
}
.eslchat__teaser-x {
  flex-shrink: 0;
  padding: 0 0 0 0.25rem;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: #636b7a;
  cursor: pointer;
}

.eslchat__panel {
  position: fixed;
  bottom: 92px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 2.5rem));
  height: min(560px, 75vh);
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 30px 60px -30px rgba(0, 26, 77, 0.55);
}
.eslchat__panel[hidden] { display: none; }

.eslchat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #0040bc;
  color: #fff;
}
/* The X duplicates what the bubble already does, because a window closes
   with an X in its corner (P'Doy, 22 Aug). 44px: an older thumb's target. */
.eslchat__head-x {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 9999px;
  background: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}
.eslchat__head-x:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.eslchat__head-x svg { width: 24px; height: 24px; }
.eslchat__head p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.eslchat__head span {
  font-size: 12px;
  opacity: 0.8;
}

.eslchat__log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.eslchat__turn { margin-bottom: 0.75rem; }
.eslchat__turn p {
  display: inline-block;
  max-width: 85%;
  margin: 0;
  padding: 0.6rem 0.85rem;
  font-size: 14px;
  line-height: 1.5;
}
.eslchat__turn.is-hope p {
  background: #f5f8ff;
  color: #1b1f2a;
}
.eslchat__turn.is-you {
  text-align: right;
}
.eslchat__turn.is-you p {
  background: #0040bc;
  color: #fff;
  text-align: left;
}
.eslchat__turn a {
  display: block;
  margin-top: 0.35rem;
  font-size: 13px;
  font-weight: 600;
  color: #0040bc;
  text-decoration: none;
}
.eslchat__turn a:hover { text-decoration: underline; }

.eslchat__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
}
.eslchat__form input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid #d1d5db;
  background: none;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.eslchat__form input:focus { border-color: #0040bc; }
.eslchat__form button {
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  border: 0;
  background: #0040bc;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}
.eslchat__form button:hover { background: #001a4d; }

/* "Talk to a person instead" — same flow as the React widget: the email row
   opens above the message box, the toggle reports its own state. */
.eslchat__person {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
}
.eslchat__person[hidden] { display: none; }
.eslchat__person label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #636b7a;
}
.eslchat__person div {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.eslchat__person input {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0;
  border: 0;
  border-bottom: 1px solid #d1d5db;
  background: none;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.eslchat__person input:focus { border-color: #0040bc; }
.eslchat__person button {
  flex-shrink: 0;
  padding: 0.35rem 1rem;
  border: 0;
  border-radius: 9999px;
  background: #0040bc;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}
.eslchat__person button:hover { background: #001a4d; }

.eslchat__human {
  width: 100%;
  padding: 0.5rem;
  border: 0;
  border-top: 1px solid #f3f4f6;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #0040bc;
  cursor: pointer;
}
.eslchat__human:hover { background: #eff4ff; }
.eslchat__human.is-on { background: #eff4ff; color: #001a4d; }
