/* Site chat assistant. Loaded with chat.js; the script builds the markup. */
.chat-launch { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border: 0; border-radius: 999px; background: #398BFF; color: #04101F; font: 600 .95rem 'Instrument Sans', system-ui, sans-serif; cursor: pointer; box-shadow: 0 14px 34px -10px rgba(57,139,255,.55), 0 4px 14px rgba(0,0,0,.4); }
.chat-launch:hover { background: #7DB3FF; }
.chat-launch svg { width: 22px; height: 22px; }
.chat-launch[hidden] { display: none; }

.chat { position: fixed; right: 20px; bottom: 20px; z-index: 41; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 40px)); display: flex; flex-direction: column; background: #0A1A36; color: #EEF3FA; border: 1px solid #24406F; border-radius: 22px; overflow: hidden; box-shadow: 0 40px 90px -20px rgba(0,0,0,.85); font: 400 .97rem/1.5 'Instrument Sans', system-ui, sans-serif; }
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid #1B2E52; background: #071630; }
.chat-head img { width: 34px; height: 34px; border-radius: 9px; }
.chat-head div { flex: 1; min-width: 0; }
.chat-head strong { display: block; font: 600 .86rem 'Unbounded', 'Arial Black', sans-serif; }
.chat-head span { color: #93A3BF; font-size: .8rem; }
.chat-head button { background: none; border: 0; color: #93A3BF; padding: 8px; cursor: pointer; border-radius: 8px; font-size: .8rem; }
.chat-head button:hover { color: #EEF3FA; background: #12264A; }
.chat-head button svg { width: 18px; height: 18px; display: block; }

.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: #24406F transparent; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg a { color: #398BFF; }
.msg.bot { align-self: flex-start; background: #12264A; border: 1px solid #1B2E52; border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: #398BFF; color: #04101F; border-bottom-right-radius: 5px; }
.msg.me a { color: inherit; }
.msg.err { align-self: flex-start; color: #F2B84B; background: none; border: 1px dashed #5A4A22; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #93A3BF; animation: chat-dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.msg-act { align-self: flex-start; margin: -4px 0 2px; font: inherit; font-size: .84rem; font-weight: 600; color: #398BFF; background: none; border: 1px solid #24406F; border-radius: 999px; padding: 5px 12px; cursor: pointer; text-decoration: none; }
.msg-act:hover { border-color: #398BFF; }
.chat-tips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.chat-tips button { font: inherit; font-size: .86rem; color: #C6D1E4; background: none; border: 1px solid #24406F; border-radius: 999px; padding: 6px 12px; cursor: pointer; text-align: left; }
.chat-tips button:hover { border-color: #93A3BF; color: #fff; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #1B2E52; background: #071630; }
.chat-form textarea { flex: 1; resize: none; height: 44px; max-height: 120px; padding: 10px 12px; border-radius: 12px; border: 1px solid #24406F; background: #040D1F; color: inherit; font: inherit; outline: none; }
.chat-form textarea:focus { border-color: #398BFF; }
.chat-form button { border: 0; border-radius: 12px; padding: 0 16px; background: #398BFF; color: #04101F; font: 600 .92rem 'Instrument Sans', system-ui, sans-serif; cursor: pointer; }
.chat-form button:disabled { opacity: .5; cursor: default; }
.chat-note { margin: 0; padding: 0 14px 10px; background: #071630; color: #7F90AD; font-size: .74rem; text-align: center; }
.chat-note a { color: inherit; }
.chat :focus-visible, .chat-launch:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 520px) {
  .chat { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .chat-launch { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .7; } }
html:lang(zh) .chat, html:lang(zh) .chat-launch { font-family: 'Instrument Sans', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif; }
html:lang(hi) .chat, html:lang(hi) .chat-launch { font-family: 'Instrument Sans', 'Noto Sans Devanagari', 'Nirmala UI', sans-serif; }
