

.live-chat { position: fixed; right: 24px; bottom: 24px; z-index: 9000; }

.chat-launcher { display: none; }
@media (min-width: 1024px) { .chat-launcher { display: flex; } }
@media (max-width: 1023px) {
    .live-chat { right: 12px; left: 12px; bottom: 12px; }
    .chat-panel { width: auto; height: min(78vh, 560px); }
}

.chat-launcher {
    width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--accent); color: #1B1C21;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s;
}
.chat-launcher:hover { transform: translateY(-2px); }
.chat-launcher.is-hidden { display: none; }

.chat-dot {
    position: absolute; top: 2px; right: 2px; width: 12px; height: 12px;
    border-radius: 50%; background: #FF5A5A; border: 2px solid #1B1C21;
}

.chat-panel {
    width: 360px; height: 520px; max-height: calc(100vh - 120px);
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 20px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.chat-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.chat-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-head-title { color: var(--text-main); font-size: 0.98rem; font-weight: 600; }
.chat-head-note { color: var(--text-muted); font-size: 0.76rem; }
.chat-close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.35rem; line-height: 1; padding: 4px 6px;
}
.chat-close:hover { color: var(--accent); }

.chat-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-intro { color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; }
.chat-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 0.88rem; line-height: 1.5; word-break: break-word; }
.chat-msg.you { align-self: flex-end; background: var(--accent); color: #1B1C21; border-bottom-right-radius: 5px; }
.chat-msg.support { align-self: flex-start; background: rgba(255,255,255,0.06); color: var(--text-main); border-bottom-left-radius: 5px; }
.chat-msg a { color: inherit; text-decoration: underline; }
.chat-sys { align-self: center; color: var(--text-muted); font-size: 0.78rem; text-align: center; }

.chat-foot { padding: 12px 14px; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.chat-row { display: flex; align-items: center; gap: 8px; }
.chat-input {
    flex: 1; min-width: 0; background: var(--input-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color); border-radius: 12px;
    padding: 11px 13px; color: var(--text-main); font-family: inherit; font-size: 0.88rem;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-btn {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; border: none;
    background: var(--accent); color: #1B1C21; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.chat-btn.ghost { background: rgba(255,255,255,0.06); color: var(--accent); }
.chat-btn:disabled { opacity: 0.45; cursor: default; }
.chat-hint { color: var(--text-muted); font-size: 0.72rem; margin-top: 8px; }
.chat-error { color: #FF7A7A; font-size: 0.76rem; margin-top: 8px; }

.chat-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.chat-avatar::after, .chat-msg-avatar::after {
    content: ""; display: block; background-color: #1B1C21;
    mask-image: url('app_icons/VectorSupport.svg');
    -webkit-mask-image: url('app_icons/VectorSupport.svg');
    mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat;
    mask-size: contain; -webkit-mask-size: contain;
    mask-position: center; -webkit-mask-position: center;
}
.chat-avatar::after { width: 20px; height: 20px; }

.chat-msg.support {
    display: flex; align-items: flex-start; gap: 8px;
    background: none; padding: 0; max-width: 90%;
}
.chat-msg-avatar {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.chat-msg-avatar::after { width: 13px; height: 13px; }
.chat-msg-body {
    background: rgba(255,255,255,0.06); color: var(--text-main);
    border-radius: 14px; border-bottom-left-radius: 5px;
    padding: 9px 13px; min-width: 0;
}
.chat-head-note.is-online { color: #6FD08C; }
.chat-head-note.is-online::before {
    content: ""; display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: #6FD08C; margin-right: 6px; vertical-align: middle;
}
.chat-from { display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 3px; }

.chat-spinner {
    width: 22px; height: 22px; margin: 24px auto; border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.12); border-top-color: var(--accent);
    animation: chat-spin 0.8s linear infinite;
}
@keyframes chat-spin { to { transform: rotate(360deg); } }
