.athena-chat-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #b78a35;
  border-radius: 999px;
  background: #071f49;
  color: #fff;
  padding: 12px 17px;
  box-shadow: 0 12px 30px rgba(7, 31, 73, .24);
  font: 600 14px/1.2 Georgia, "Times New Roman", serif;
  cursor: pointer;
  opacity: 1;
  transform: scale(1);
  transform-origin: bottom right;
  transition: opacity .16s ease, transform .16s ease;
}
.athena-chat-launcher[hidden] { display: none; }
.athena-chat-launcher:hover { background: #0d2d63; }
.athena-chat-launcher:focus-visible,
.athena-chat button:focus-visible,
.athena-chat textarea:focus-visible { outline: 3px solid #d7ae5b; outline-offset: 3px; }
.athena-chat-launcher svg { width: 21px; height: 21px; }

.athena-chat {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1001;
  width: min(410px, calc(100vw - 36px));
  height: min(590px, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
  background: #fbfaf7;
  border: 1px solid rgba(183, 138, 53, .55);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(7, 31, 73, .25);
  overflow: hidden;
  color: #13213a;
  font-family: Georgia, "Times New Roman", serif;
  opacity: 1;
  transform: scale(1) translateY(0);
  transform-origin: bottom right;
  transition: opacity .16s ease, transform .16s ease;
}
.athena-chat[hidden] { display: none; }
.athena-chat__header {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 12px 13px 15px;
  background: #071f49;
  color: #fff;
  border-bottom: 2px solid #b78a35;
}
.athena-chat__mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #d7ae5b; border-radius: 50%; color: #d7ae5b; font-size: 17px; }
.athena-chat__identity { min-width: 0; flex: 1; }
.athena-chat__identity strong,
.athena-chat__identity span { display: block; }
.athena-chat__identity strong { font-size: 18px; }
.athena-chat__identity span { font-size: 12px; opacity: .86; }
.athena-chat__reference { margin-top: 2px; color: #e7ca8c !important; font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; user-select: text; }
.athena-chat__header button { border: 0; background: transparent; color: #fff; width: 34px; height: 34px; border-radius: 8px; font-size: 20px; cursor: pointer; }
.athena-chat__header button:hover { background: rgba(255, 255, 255, .12); }
.athena-chat__messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 17px 14px 12px; scrollbar-gutter: stable; }
.athena-chat__message { display: flex; flex-direction: column; max-width: 84%; margin: 0 0 14px; }
.athena-chat__message--athena { align-items: flex-start; }
.athena-chat__message--customer { align-items: flex-end; margin-left: auto; }
.athena-chat__sender { margin: 0 7px 4px; color: #6c7280; font-size: 11px; }
.athena-chat__bubble { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px 13px; border-radius: 15px; background: #fff; border: 1px solid rgba(7, 31, 73, .12); line-height: 1.45; font-size: 14px; }
.athena-chat__message--customer .athena-chat__bubble { background: #071f49; color: #fff; border-color: #071f49; border-bottom-right-radius: 4px; }
.athena-chat__message--athena .athena-chat__bubble { border-bottom-left-radius: 4px; }
.athena-chat__time { margin: 4px 7px 0; color: #808591; font-size: 10px; }
.athena-chat__footer { flex: 0 0 auto; background: #fff; }
.athena-chat__typing,
.athena-chat__error { margin: 8px 14px 0; color: #6c7280; font-size: 12px; }
.athena-chat__error { padding: 9px 11px; border-radius: 9px; background: #fff3f0; color: #872c20; }
.athena-chat__error button { border: 0; background: none; color: #071f49; text-decoration: underline; cursor: pointer; }
.athena-chat__composer { display: flex; align-items: flex-end; gap: 8px; padding: 11px max(11px, env(safe-area-inset-right)) max(11px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid rgba(7, 31, 73, .12); }
.athena-chat__composer textarea { min-height: 42px; max-height: 112px; flex: 1; resize: none; border: 1px solid rgba(7, 31, 73, .25); border-radius: 12px; padding: 10px 11px; color: #13213a; background: #fff; font: 14px/1.4 Georgia, "Times New Roman", serif; }
.athena-chat__send,
.athena-chat__end { border: 0; border-radius: 10px; background: #b78a35; color: #071f49; padding: 11px 13px; font-weight: 700; cursor: pointer; }
.athena-chat__send:disabled { opacity: .45; cursor: not-allowed; }
.athena-chat__end { position: absolute; right: 92px; bottom: -29px; border: 1px solid rgba(7, 31, 73, .15); background: #fff; color: #071f49; padding: 5px 8px; font-size: 11px; box-shadow: 0 3px 10px rgba(7, 31, 73, .12); }

@media (max-width: 600px) {
  .athena-chat-launcher span { display: none; }
  .athena-chat-launcher { padding: 14px; }
  .athena-chat { inset: 0; width: 100%; height: 100dvh; max-width: none; border: 0; border-radius: 0; }
  .athena-chat__header { padding-top: max(14px, env(safe-area-inset-top)); }
  .athena-chat__end { bottom: -30px; }
  .athena-chat__composer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .athena-chat,
  .athena-chat-launcher { transition: none; }
  .athena-chat * { scroll-behavior: auto !important; }
}
