/* ELO · Chat widget */
.elo-chat { --c-bone: #FFFFFF; --c-bone-2: #EDEDEB; --c-beige: #ABADA9; --c-beige-deep: #482E2C; --c-ink: #0A0A0A; --c-muted: #5F605C;
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 80;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--c-ink); }

.elo-chat__toggle {
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--c-ink); color: var(--c-bone);
  font-family: inherit; font-weight: 500; font-size: .78rem; line-height: 1; letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(10,10,10,.22);
  transition: transform .4s cubic-bezier(.2,.7,.1,1), background .3s;
}
.elo-chat__toggle:hover { transform: translateY(-2px); background: #1E1C1B; }
.elo-chat__toggle:focus-visible { outline: 2px solid var(--c-beige-deep); outline-offset: 3px; }
.elo-chat__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-beige); box-shadow: 0 0 0 0 rgba(171,173,169,.7); animation: eloPulse 2.4s infinite; }
@keyframes eloPulse { 70% { box-shadow: 0 0 0 10px rgba(171,173,169,0); } 100% { box-shadow: 0 0 0 0 rgba(171,173,169,0); } }
.elo-chat.is-open .elo-chat__toggle { display: none; }

.elo-chat__panel {
  position: absolute; right: 0; bottom: 0;
  width: min(380px, calc(100vw - 40px)); height: min(560px, calc(100vh - 120px)); height: min(560px, calc(100dvh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--c-bone); border: 1px solid rgba(10,10,10,.1); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(10,10,10,.25);
  transform-origin: bottom right;
  opacity: 0; transform: translateY(14px) scale(.96); pointer-events: none; visibility: hidden;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.7,.1,1), visibility 0s .45s;
}
.elo-chat.is-open .elo-chat__panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }

.elo-chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 20px; background: var(--c-ink); color: var(--c-bone); }
.elo-chat__logo { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--c-bone); color: var(--c-ink); font-family: "Italiana", serif; font-size: .95rem; letter-spacing: .1em; flex: none; }
.elo-chat__title { flex: 1; min-width: 0; }
.elo-chat__title strong { display: block; font-weight: 500; font-size: .95rem; }
.elo-chat__title span { font-size: .72rem; color: var(--c-beige); letter-spacing: .06em; }
.elo-chat__close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--c-bone); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.elo-chat__close:hover { background: rgba(255,255,255,.12); }
.elo-chat__close:focus-visible { outline: 2px solid var(--c-beige); outline-offset: 2px; }

.elo-chat__log { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.elo-chat__msg { max-width: 85%; padding: 11px 15px; border-radius: 18px; font-size: .92rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.elo-chat__msg--model { align-self: flex-start; background: var(--c-bone-2); border-bottom-left-radius: 6px; }
.elo-chat__msg--user { align-self: flex-end; background: var(--c-ink); color: var(--c-bone); border-bottom-right-radius: 6px; }
.elo-chat__msg--error { align-self: flex-start; background: transparent; border: 1px solid rgba(72,46,44,.6); color: var(--c-muted); }

.elo-chat__typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 16px; background: var(--c-bone-2); border-radius: 18px; border-bottom-left-radius: 6px; }
.elo-chat__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-beige-deep); animation: eloTyping 1.2s infinite ease-in-out; }
.elo-chat__typing i:nth-child(2) { animation-delay: .15s; }
.elo-chat__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes eloTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.elo-chat__form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid rgba(10,10,10,.08); background: var(--c-bone); }
.elo-chat__input {
  flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px;
  border: 1px solid rgba(10,10,10,.15); border-radius: 14px; background: #fff; color: var(--c-ink);
  font-family: inherit; font-weight: 400; font-size: 16px; line-height: 1.4; /* 16px avoids iOS zoom */
}
.elo-chat__input:focus { outline: none; border-color: var(--c-beige-deep); box-shadow: 0 0 0 3px rgba(72,46,44,.2); }
.elo-chat__send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--c-ink); color: var(--c-bone); font-size: 1.1rem; cursor: pointer; transition: background .3s, opacity .3s; }
.elo-chat__send:hover { background: var(--c-beige-deep); }
.elo-chat__send:disabled { opacity: .4; cursor: default; }
.elo-chat__send:focus-visible { outline: 2px solid var(--c-beige-deep); outline-offset: 2px; }
.elo-chat__count { font-size: .68rem; color: var(--c-muted); text-align: right; padding: 0 14px 8px; background: var(--c-bone); }
.elo-chat__count.is-over { color: #A4442E; }
.elo-chat__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 560px) {
  .elo-chat { right: 14px; bottom: 14px; }
  .elo-chat.is-open { inset: 0; }
  .elo-chat.is-open .elo-chat__panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .elo-chat__toggle { height: 52px; padding: 0 18px 0 16px; }
}

/* Quick replies + links */
.elo-chat__quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.elo-chat__chip {
  padding: 9px 14px; border: 1px solid rgba(10,10,10,.18); border-radius: 999px; background: transparent;
  color: var(--c-ink); font-family: inherit; font-size: .82rem; cursor: pointer;
  transition: background .3s, color .3s, border-color .3s;
}
.elo-chat__chip:hover { background: var(--c-ink); color: var(--c-bone); border-color: var(--c-ink); }
.elo-chat__chip:focus-visible { outline: 2px solid var(--c-beige-deep); outline-offset: 2px; }
.elo-chat__msg a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.elo-chat__title .elo-mark { width: 2.2em; height: 1.35em; vertical-align: -.35em; color: var(--c-bone); }
.elo-chat__logo .elo-mark { width: 26px; height: 18px; vertical-align: middle; }
