.chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.chat-overlay.open {
    display: flex;
}
.chat-container {
    width: 90vw;
    max-width: 880px;
    height: 80vh;
    max-height: 680px;
    background: #0F1319;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex;
    overflow: hidden;
}
.chat-sidebar {
    width: 300px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    background: #0D1117;
}
.chat-sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-sidebar-header h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #E8ECF4;
}
.chat-close-btn {
    background: none;
    border: none;
    color: #606878;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}
.chat-close-btn:hover {
    color: #E8ECF4;
}
.chat-thread-list {
    flex: 1;
    overflow-y: auto;
}
.chat-thread-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}
.chat-thread-item:hover,
.chat-thread-item.active {
    background: rgba(255, 255, 255, 0.06);
}
.chat-thread-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(240, 180, 41, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.chat-thread-info {
    flex: 1;
    min-width: 0;
}
.chat-thread-name {
    font-weight: 700;
    font-size: 13px;
    color: #E8ECF4;
}
.chat-thread-preview {
    font-size: 12px;
    color: #606878;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.chat-thread-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.chat-thread-time {
    font-size: 11px;
    color: #606878;
}
.chat-unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #F0B429;
}
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #080B10;
}
.chat-main-header {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.chat-back-btn {
    background: none;
    border: none;
    color: #606878;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: none;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}
.chat-bubble.sent {
    align-self: flex-end;
    background: #075E54;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-bubble.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: #E8ECF4;
    border-bottom-left-radius: 4px;
}
.chat-bubble-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 3px;
}
.chat-bubble.sent .chat-bubble-time {
    text-align: right;
}
.chat-input-row {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
.chat-input-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 10px 18px;
    color: #E8ECF4;
    font-size: 13px;
    outline: none;
}
.chat-input-row input:focus {
    border-color: rgba(240, 180, 41, 0.4);
}
.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F0B429;
    border: none;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.chat-send-btn:hover {
    opacity: 0.85;
}
.chat-request-banner {
    background: rgba(240, 180, 41, 0.08);
    border: 1px solid rgba(240, 180, 41, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 0 20px 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #A0AAB8;
}
.chat-request-banner button {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}
.chat-request-banner .btn-accept {
    background: #0ECB81;
    color: #000;
}
.chat-request-banner .btn-decline {
    background: rgba(246, 70, 93, 0.15);
    color: #F6465D;
}
.chat-empty {
    text-align: center;
    color: #606878;
    padding: 60px 20px;
    font-size: 14px;
}
@media (max-width: 768px) {
    .chat-container {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    .chat-sidebar {
        width: 100%;
    }
    .chat-main {
        display: none;
    }
    .chat-main.mobile-active {
        display: flex;
    }
    .chat-sidebar.mobile-hidden {
        display: none;
    }
    .chat-back-btn {
        display: block;
    }
}
