/* AI chat widget (assets/js/chat.js) */
.chat-launcher{position:fixed;right:24px;bottom:24px;z-index:50;width:60px;height:60px;border-radius:50%;border:0;display:flex;align-items:center;justify-content:center;background:var(--navy);color:#fff;cursor:pointer;box-shadow:0 12px 30px rgba(11,24,64,.35),0 0 0 3px rgba(255,255,255,.9);transition:transform .2s,background .2s}
.chat-launcher:hover{background:var(--accent-dark);transform:translateY(-2px)}
.chat-launcher svg+svg,.chat-launcher.is-open svg:first-child{display:none}
.chat-launcher.is-open svg+svg{display:block}
.chat-launcher::after{content:"";position:absolute;top:4px;right:4px;width:12px;height:12px;border-radius:50%;background:var(--green);border:2px solid #fff}
.chat-launcher.is-open::after{display:none}

.chat-panel{position:fixed;right:24px;bottom:96px;z-index:50;width:380px;height:min(600px,calc(100dvh - 120px));display:flex;flex-direction:column;background:#fff;border-radius:22px;box-shadow:0 24px 60px rgba(11,24,64,.25);overflow:hidden;animation:chat-in .25s cubic-bezier(.2,.7,.2,1)}
.chat-panel[hidden]{display:none}
@keyframes chat-in{from{opacity:0;transform:translateY(12px) scale(.98)}}

.chat-head{display:flex;align-items:center;gap:12px;padding:16px 16px 16px 20px;background:var(--navy);color:#fff}
.chat-head img{width:32px;height:32px}
.chat-head div{flex:1;display:flex;flex-direction:column;line-height:1.3}
.chat-head small{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted-on-dark)}
.chat-head .dot{width:7px;height:7px;border-radius:50%;background:var(--green)}
.chat-close{width:36px;height:36px;border-radius:50%;border:0;background:transparent;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.chat-close:hover{background:rgba(255,255,255,.12)}

.chat-log{flex:1;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:10px;background:#F5F8FF}
.chat-msg{max-width:85%;padding:10px 14px;border-radius:18px;font-size:14px;line-height:1.55;overflow-wrap:anywhere}
.chat-msg a{color:inherit;text-decoration:underline}
.chat-msg p,.chat-msg ul,.chat-msg ol{margin:0}
.chat-msg>:not(:first-child){margin-top:8px}
.chat-msg ul,.chat-msg ol{padding-left:20px}
.chat-msg li+li{margin-top:4px}
.chat-msg strong{font-weight:700}
.chat-msg.is-bot{align-self:flex-start;background:#fff;color:var(--navy);border:1px solid var(--tint);border-bottom-left-radius:6px}
.chat-msg.is-bot a{color:var(--accent)}
.chat-msg.is-user{white-space:pre-wrap;align-self:flex-end;background:var(--accent);color:#fff;border-bottom-right-radius:6px}
.chat-msg.is-error{border-color:#F5C2C2;background:#FFF6F6}
.chat-msg.is-typing{display:flex;gap:4px;padding:14px 16px}
.chat-msg.is-typing span{width:7px;height:7px;border-radius:50%;background:var(--sky-2);animation:chat-dot 1s infinite}
.chat-msg.is-typing span:nth-child(2){animation-delay:.15s}
.chat-msg.is-typing span:nth-child(3){animation-delay:.3s}
@keyframes chat-dot{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-3px)}}

.chat-suggest{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 12px;background:#F5F8FF}
.chat-suggest[hidden]{display:none}
.chat-suggest button{padding:8px 12px;border-radius:999px;border:1px solid var(--tint);background:#fff;color:var(--accent);font-family:inherit;font-size:13px;font-weight:600;line-height:1.2;cursor:pointer}
.chat-suggest button:hover{border-color:var(--accent)}

.chat-form{display:flex;align-items:flex-end;gap:8px;padding:12px 12px 6px 16px;border-top:1px solid var(--tint)}
.chat-form:focus-within{border-top-color:var(--accent)}
.chat-form textarea{flex:1;resize:none;border:0;outline:0;padding:9px 0;font:inherit;font-size:14px;line-height:1.5;color:var(--navy);max-height:120px}
.chat-form button{flex:none;width:40px;height:40px;border-radius:50%;border:0;background:var(--accent);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center}
.chat-form button:disabled{opacity:.5;cursor:default}
.chat-note{margin:0;padding:0 16px 10px;font-size:11px;color:var(--text-2);opacity:.75}

@media (max-width:520px){
  .chat-launcher{right:16px;bottom:16px}
  .chat-launcher.is-open{display:none}
  .chat-panel{right:0;bottom:0;width:100%;height:100dvh;border-radius:0}
}
