/* PLACEHOLDER chat popup. Replace with the live eME chat bot later.
   Markup and behaviour live in theme/javascript/chat-popup.js */

.eme-chat-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; border: 0; border-radius: 999px;
  background: #0a1a33; color: #eef1f7;
  font: 500 15px/1 Jost, system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 10px 28px rgba(10, 26, 51, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.eme-chat-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(10, 26, 51, .34); }
.eme-chat-launch:focus-visible { outline: 3px solid #8fa8d8; outline-offset: 3px; }
.eme-chat-launch svg { width: 22px; height: 22px; flex: none; }
.eme-chat-launch[aria-expanded="true"] { display: none; }

.eme-chat {
  position: fixed; right: 22px; bottom: 22px; z-index: 901;
  width: 380px; max-width: calc(100vw - 24px);
  height: 560px; max-height: calc(100vh - 44px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #f7f6f4; color: #0a1a33; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(10, 26, 51, .32);
  font-family: Jost, system-ui, sans-serif;
}
.eme-chat[hidden] { display: none; }

.eme-chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 16px; background: #0a1a33; color: #eef1f7;
}
.eme-chat-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: #eef1f7; color: #0a1a33;
  font-weight: 500; font-size: 15px; letter-spacing: -.02em;
}
.eme-chat-title { flex: 1; min-width: 0; }
.eme-chat-title strong { display: block; font-weight: 500; font-size: 16px; }
.eme-chat-title span { display: block; font-size: 12.5px; color: #b4bfd3; }
.eme-chat-close {
  width: 34px; height: 34px; border: 0; border-radius: 8px; flex: none;
  background: transparent; color: #eef1f7; cursor: pointer; font-size: 22px; line-height: 1;
}
.eme-chat-close:hover { background: rgba(255, 255, 255, .1); }
.eme-chat-close:focus-visible { outline: 2px solid #8fa8d8; }

.eme-chat-log {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.eme-chat-msg {
  max-width: 85%; padding: 10px 13px; border-radius: 14px;
  font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.eme-chat-msg.bot { align-self: flex-start; background: #fff; border: 1px solid #d3d6dc; border-bottom-left-radius: 4px; }
.eme-chat-msg.me { align-self: flex-end; background: #14284f; color: #eef1f7; border-bottom-right-radius: 4px; }
.eme-chat-msg a { color: inherit; font-weight: 500; }

.eme-chat-prompts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.eme-chat-prompts button {
  border: 1px solid #c3c9d6; background: #fff; color: #14284f; border-radius: 999px;
  padding: 7px 12px; font: 400 13.5px/1.2 Jost, system-ui, sans-serif; cursor: pointer; text-align: left;
}
.eme-chat-prompts button:hover { border-color: #14284f; }
.eme-chat-prompts button:focus-visible { outline: 2px solid #3d5078; outline-offset: 2px; }

.eme-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #d3d6dc; background: #fff; }
.eme-chat-form input {
  flex: 1; min-width: 0; border: 1px solid #c3c9d6; border-radius: 10px;
  padding: 10px 12px; font: 400 15px Jost, system-ui, sans-serif; color: #0a1a33; background: #fff;
}
.eme-chat-form input:focus { outline: 2px solid #3d5078; outline-offset: 0; border-color: transparent; }
.eme-chat-form button {
  border: 0; border-radius: 10px; padding: 0 16px; background: #0a1a33; color: #eef1f7;
  font: 500 15px Jost, system-ui, sans-serif; cursor: pointer;
}
.eme-chat-form button:focus-visible { outline: 2px solid #8fa8d8; outline-offset: 2px; }

.eme-chat-note { margin: 0; padding: 0 12px 10px; background: #fff; font-size: 11.5px; color: #5d6a82; text-align: center; }

@media (max-width: 520px) {
  .eme-chat-launch { right: 14px; bottom: 14px; }
  .eme-chat { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .eme-chat-launch { transition: none; }
}
@media print { .eme-chat-launch, .eme-chat { display: none !important; } }
.eme-chat-avatar { position: relative; overflow: hidden; width: 40px; height: 40px; }
.eme-chat-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.eme-chat-launch-photo { width: 34px; height: 34px; margin: -6px 0 -6px -6px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #eef1f7; }
.eme-chat-launch-photo ~ svg { display: none; }
