html.ac-chats-page body { background: #070b14; color: #e8eefc; }
.ac-chat {
    --ac: #6ee7ff;
    --ac2: #a78bfa;
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    min-height: calc(100vh - 4.5rem);
    max-width: 1180px;
    margin: 0.75rem auto 1.5rem;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(1200px 400px at 10% -10%, rgba(110, 231, 255, 0.12), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(167, 139, 250, 0.14), transparent 50%),
        #0b1220;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
}
.ac-chat-side {
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.35);
}
.ac-chat-side-head { padding: 1rem 1rem 0.7rem; }
.ac-chat-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--ac) 80%, #fff);
}
.ac-chat-kicker i {
    width: 0.42rem; height: 0.42rem; border-radius: 50%;
    background: var(--ac);
    box-shadow: 0 0 10px var(--ac);
    animation: acPulse 1.8s ease-in-out infinite;
}
.ac-chat-side-head h1 {
    margin: 0.35rem 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 850;
}
.ac-chat-cap { margin: 0 0 0.7rem; font-size: 0.72rem; color: #94a3b8; line-height: 1.4; }
.ac-chat-search-wrap input,
.ac-chat-inspect input,
#acChatRefQ {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    outline: none;
}
.ac-chat-search-wrap input:focus,
.ac-chat-inspect input:focus,
#acChatRefQ:focus { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.15); }
.ac-chat-inspect { margin-top: 0.65rem; }
.ac-chat-inspect-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #a78bfa; margin-bottom: 0.3rem; }
.ac-chat-hits { margin-top: 0.35rem; display: grid; gap: 0.25rem; }
.ac-chat-hit, .ac-chat-thread, .ac-chat-mine {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0.45rem 0.55rem;
    border-radius: 0.8rem;
    cursor: pointer;
}
.ac-chat-hit:hover, .ac-chat-thread:hover, .ac-chat-mine:hover { background: rgba(110, 231, 255, 0.08); }
.ac-chat-mine { margin-top: 0.35rem; justify-content: center; border: 1px solid rgba(167, 139, 250, 0.35); color: #c4b5fd; font-weight: 700; font-size: 0.8rem; }
.ac-chat-threads { flex: 1; overflow-y: auto; padding: 0.4rem 0.55rem 0.8rem; }
.ac-chat-thread { position: relative; animation: acRise 0.35s ease both; animation-delay: calc(var(--i, 0) * 35ms); }
.ac-chat-thread.is-settled, .ac-msg.is-settled { animation: none; }
.ac-chat-thread.is-on { background: color-mix(in srgb, var(--ac) 16%, transparent); }
.ac-chat-thread img, .ac-chat-hit > img, .ac-chat-top img {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.ac-chat-thread b, .ac-chat-hit b { display: block; font-size: 0.9rem; }
.ac-chat-thread span:nth-of-type(2) { min-width: 0; flex: 1; }
.ac-chat-hit .ac-embed { margin: 0; pointer-events: none; width: 100%; }
.ac-embed-ph {
    width: 52px; height: 36px; border-radius: 0.45rem; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(110, 231, 255, 0.18), rgba(167, 139, 250, 0.22));
}
.ac-chat-err {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #fda4af;
    animation: acRise 0.25s ease both;
}
.ac-chat-thread.is-pair img { width: 30px; height: 30px; }
.ac-chat-thread.is-pair .ac-dot { display: none; }
.ac-chat-thread.is-pair b { font-size: 0.82rem; }
.ac-chat-thread small { display: block; color: #94a3b8; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ac-dot {
    width: 0.55rem; height: 0.55rem; border-radius: 50%;
    position: absolute; left: 2.15rem; top: 2.15rem;
    border: 2px solid #0b1220;
}
.ac-dot.is-online { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.ac-dot.is-recent { background: #fbbf24; }
.ac-dot.is-offline { background: #64748b; }
.ac-unread {
    margin-left: auto;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #f43f5e;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    animation: acPop 0.45s ease;
}
.ac-chat-main { display: flex; flex-direction: column; min-width: 0; }
.ac-chat-top {
    min-height: 4.2rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.ac-chat-top-empty { color: #94a3b8; }
.ac-chat-top a { color: inherit; text-decoration: none; font-weight: 800; }
.ac-chat-top .ac-presence { font-size: 0.75rem; color: #94a3b8; }
.ac-chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.1rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.ac-msg {
    max-width: min(78%, 36rem);
    align-self: flex-start;
    animation: acRise 0.28s ease both;
}
.ac-msg.is-mine { align-self: flex-end; }
.ac-bubble {
    border-radius: 1rem 1rem 1rem 0.3rem;
    padding: 0.55rem 0.75rem;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.14);
    white-space: pre-wrap;
    word-break: break-word;
}
.ac-msg.is-mine .ac-bubble {
    border-radius: 1rem 1rem 0.3rem 1rem;
    background: linear-gradient(180deg, rgba(14, 116, 144, 0.85), rgba(15, 23, 42, 0.92));
    border-color: rgba(110, 231, 255, 0.28);
}
.ac-msg time { display: block; font-size: 0.65rem; color: #64748b; margin-top: 0.2rem; }
.ac-msg.is-mine time { text-align: right; }
.ac-msg-who {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.22rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-decoration: none;
}
.ac-msg-who:hover { color: #e2e8f0; }
.ac-msg-who img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ac-msg.is-mine .ac-msg-who { justify-content: flex-end; }
.ac-msg.is-foreign.is-mine .ac-bubble {
    background: linear-gradient(180deg, rgba(109, 40, 217, 0.55), rgba(15, 23, 42, 0.92));
    border-color: rgba(167, 139, 250, 0.32);
}
.ac-embed {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.4rem;
    padding: 0.4rem;
    border-radius: 0.8rem;
    text-decoration: none;
    color: inherit;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.16);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.ac-embed:hover { transform: translateY(-1px); border-color: var(--ac); }
.ac-embed img { width: 52px; height: 36px; object-fit: cover; border-radius: 0.45rem; }
.ac-embed.is-player img, .ac-embed.is-medal img { width: 32px; height: 32px; border-radius: 50%; }
.ac-embed b img { width: 18px; height: 18px; border-radius: 0; vertical-align: -3px; }
.ac-embed b { display: block; font-size: 0.82rem; }
.ac-embed small { color: #94a3b8; font-size: 0.7rem; }
.ac-chat-composer {
    padding: 0.7rem 0.9rem 0.9rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(2, 6, 23, 0.28);
}
.ac-chat-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.4rem; }
.ac-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    border-radius: 999px; padding: 0.15rem 0.45rem 0.15rem 0.15rem;
    background: rgba(167, 139, 250, 0.16); font-size: 0.75rem;
}
.ac-chip img { width: 18px; height: 18px; object-fit: cover; border-radius: 50%; }
.ac-chip button { border: 0; background: transparent; color: #fda4af; cursor: pointer; }
.ac-chat-compose-row { display: flex; align-items: flex-end; gap: 0.45rem; }
.ac-chat-compose-row textarea {
    flex: 1; resize: none; min-height: 2.5rem; max-height: 7rem;
    border-radius: 0.9rem; border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.8); color: #e2e8f0; padding: 0.55rem 0.75rem;
}
.ac-chat-ref-btn, .ac-chat-send {
    border: 0; border-radius: 0.85rem; font-weight: 800; cursor: pointer;
}
.ac-chat-ref-btn { width: 2.5rem; height: 2.5rem; background: rgba(167, 139, 250, 0.18); color: #ddd6fe; }
.ac-chat-send { padding: 0.55rem 0.95rem; background: linear-gradient(180deg, #67e8f9, #22d3ee); color: #082f49; }
.ac-chat-send:disabled { opacity: 0.45; cursor: not-allowed; }
.ac-chat-ref-panel { margin-top: 0.55rem; padding: 0.55rem; border-radius: 0.9rem; background: rgba(15, 23, 42, 0.7); }
.ac-chat-ref-tabs { display: flex; gap: 0.3rem; margin-bottom: 0.4rem; }
.ac-chat-ref-tabs button {
    border: 1px solid rgba(148, 163, 184, 0.2); background: transparent; color: #cbd5e1;
    border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.75rem; cursor: pointer;
}
.ac-chat-ref-tabs button.is-on { background: rgba(110, 231, 255, 0.16); border-color: var(--ac); color: #fff; }
.ac-chat-ref-hits { display: grid; gap: 0.3rem; margin-top: 0.4rem; max-height: 12rem; overflow-y: auto; }
.ac-chat-compose-meta { font-size: 0.68rem; color: #64748b; margin-top: 0.35rem; text-align: right; }
.ac-banner { font-size: 0.75rem; color: #c4b5fd; }
.ac-empty { color: #64748b; text-align: center; padding: 1.2rem 0.5rem; }
.ac-msg { position: relative; }
.ac-msg-fwd {
    display: none;
    margin-top: 0.2rem;
    border: 0;
    background: transparent;
    color: #67e8f9;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}
.ac-msg:hover .ac-msg-fwd { display: inline-block; }
.ac-msg.is-mine .ac-msg-fwd { color: #a5f3fc; }
.ac-fwd {
    margin-top: 0.4rem;
    padding: 0.4rem 0.55rem;
    border-left: 3px solid var(--ac);
    border-radius: 0 0.6rem 0.6rem 0;
    background: rgba(2, 6, 23, 0.4);
    font-size: 0.8rem;
}
.ac-fwd b { display: block; font-size: 0.68rem; color: #67e8f9; margin-bottom: 0.15rem; }
.ac-fwd span { color: #cbd5e1; white-space: pre-wrap; word-break: break-word; }
.ac-yt {
    position: relative;
    display: block;
    width: min(100%, 22rem);
    aspect-ratio: 16 / 9;
    margin-top: 0.45rem;
    border: 0;
    padding: 0;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    background: #000;
}
.ac-yt img, .ac-yt iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}
.ac-yt-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.6rem;
    text-shadow: 0 4px 12px rgba(0,0,0,0.6);
    background: radial-gradient(circle, rgba(0,0,0,0.28), transparent 60%);
}
.ac-fwd-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(2, 6, 23, 0.55);
    display: grid;
    place-items: center;
    padding: 1rem;
}
.ac-fwd-overlay[hidden] { display: none !important; }
.ac-fwd-sheet {
    width: min(92vw, 22rem);
    max-height: min(70vh, 28rem);
    overflow: auto;
    border-radius: 1rem;
    padding: 0.9rem;
    background: #0f172a;
    color: #e2e8f0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.ac-fwd-title { font-weight: 800; margin-bottom: 0.55rem; }
.ac-fwd-list { display: grid; gap: 0.2rem; }
.ac-fwd-cancel {
    margin-top: 0.7rem;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: transparent;
    color: #cbd5e1;
    border-radius: 0.7rem;
    padding: 0.4rem;
    cursor: pointer;
}
@keyframes acPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes acRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes acPop { from { transform: scale(0.6); } to { transform: scale(1); } }
@media (max-width: 860px) {
    .ac-chat { grid-template-columns: 1fr; min-height: auto; }
    .ac-chat-side { max-height: 42vh; }
}
