.chat-launcher { padding: 0; font-family: var(--serif); animation: chat-nudge 5s ease-in-out infinite; }
.chat-launcher::before { content: ""; position: absolute; inset: -7px; border: 1px solid rgba(82,111,100,.25); border-radius: 50%; animation: chat-pulse 2.5s ease-out infinite; }
.chat-unread { position: absolute; top: -4px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border: 2px solid white; border-radius: 11px; color: white; background: #b86a5b; font: 700 10px/1 var(--sans); }
.chat-window { position: fixed; right: 24px; bottom: 100px; z-index: 110; width: 380px; height: min(600px, calc(100vh - 130px)); height: min(600px, calc(100dvh - 130px)); overflow: hidden; border: 1px solid rgba(34,51,46,.14); border-radius: 18px; background: #fbfaf7; box-shadow: 0 30px 80px rgba(34,51,46,.25); transform-origin: bottom right; animation: chat-in .25s ease-out; }
.chat-window[hidden] { display: none; }
.chat-launcher[aria-expanded="true"] { animation: none; }
.chat-header { height: 76px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: white; background: linear-gradient(135deg,#22332e,#526f64); }
.chat-agent { min-width: 0; display: flex; align-items: center; gap: 12px; }
.chat-avatar { flex: 0 0 46px; width: 46px; height: 46px; padding: 4px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.36); border-radius: 50%; background: rgba(255,255,255,.96); }
.chat-avatar img { width: 100%; height: 100%; display: block; object-fit: contain; }
.chat-agent strong { display: block; margin-bottom: 4px; font-size: 14px; }
.chat-agent small { display: flex; align-items: center; gap: 6px; color: #dce7e1; font-size: 10px; }
.chat-agent small i { width: 7px; height: 7px; border-radius: 50%; background: #9bd3ad; }
.chat-close { width: 34px; height: 34px; border: 0; border-radius: 50%; color: white; background: transparent; cursor: pointer; font-size: 26px; font-weight: 200; }
.chat-close:hover { background: rgba(255,255,255,.1); }
.chat-messages { height: calc(100% - 180px); padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.chat-message { display: flex; gap: 9px; margin-bottom: 15px; }
.chat-message.visitor { justify-content: flex-end; }
.chat-message .bubble-wrap { max-width: 78%; }
.chat-message.visitor .bubble-wrap { display: flex; align-items: flex-end; flex-direction: column; }
.chat-message .sender { margin: 0 0 5px 3px; color: #84908b; font-size: 9px; }
.chat-message .bubble { padding: 10px 13px; border-radius: 4px 15px 15px 15px; color: #43534c; background: #edf1ed; font-size: 13px; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.chat-message.visitor .bubble { border-radius: 15px 4px 15px 15px; color: white; background: #526f64; }
.chat-message time { display: block; margin-top: 5px; color: #9aa39f; font-size: 8px; }
.chat-form { position: absolute; inset: auto 0 0; padding: 10px 14px 12px; border-top: 1px solid rgba(34,51,46,.1); background: white; }
.chat-compose { display: grid; grid-template-columns: 1fr 58px; gap: 9px; }
.chat-compose textarea { width: 100%; height: 55px; padding: 9px 10px; resize: none; border: 1px solid rgba(34,51,46,.15); outline: none; color: #34443d; background: #fafaf8; font: 12px/1.55 var(--sans); }
.chat-compose textarea:focus { border-color: #718f82; }
.chat-compose button { border: 0; color: white; background: #22332e; cursor: pointer; font-size: 12px; }
.chat-compose button:hover { background: #526f64; }
.chat-compose button:disabled { cursor: wait; opacity: .55; }
.chat-connection { min-height: 12px; margin: 7px 0 0; color: #8a9690; font-size: 9px; }
.chat-connection.online { color: #5d806d; }
.chat-connection.offline { color: #a16960; }
@keyframes chat-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes chat-pulse { 0% { transform: scale(.88); opacity: .6; } 75%,100% { transform: scale(1.18); opacity: 0; } }
@keyframes chat-nudge { 0%,92%,100% { transform: translateX(0); } 94% { transform: translateX(-2px); } 96% { transform: translateX(2px); } 98% { transform: translateX(-1px); } }
@media (max-width:600px) { .chat-window { right: 10px; bottom: 10px; width: calc(100% - 20px); } }
