body {
    background: #f4f6fb;
    font-family: Arial, sans-serif;
}
.auth-card {
    max-width: 430px;
    margin: 60px auto;
}
.chat-wrapper {
    height: calc(100vh - 90px);
}
.user-list {
    height: 100%;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
}
.user-row {
    gap: 8px;
}
.min-width-0 {
    min-width: 0;
}
.chat-panel {
    height: 100%;
    background: #fff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}
.messages-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #eef2f8;
}
.message {
    max-width: 70%;
    padding: 10px 14px 6px;
    margin-bottom: 10px;
    border-radius: 14px;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.message.me {
    margin-left: auto;
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.message.other {
    margin-right: auto;
    background: #fff;
    color: #222;
    border-bottom-left-radius: 4px;
}
.message-meta {
    margin-top: 3px;
    font-size: 11px;
    opacity: .75;
    text-align: right;
}
.profile-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
    flex-shrink: 0;
}
.welcome-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
}
.profile-preview {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    background: #ddd;
}
.online-dot,
.offline-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 50%;
    margin-right: 4px;
}
.online-dot {
    background: #198754;
    box-shadow: 0 0 0 3px rgba(25,135,84,.12);
}
.offline-dot {
    background: #adb5bd;
}
.video-area {
    background: #111;
    border-radius: 16px;
    min-height: 520px;
    position: relative;
    overflow: hidden;
}
#remoteVideo {
    width: 100%;
    height: 520px;
    object-fit: cover;
    background: #222;
}
#localVideo {
    width: 220px;
    height: 150px;
    object-fit: cover;
    position: absolute;
    right: 20px;
    bottom: 90px;
    border: 3px solid #fff;
    border-radius: 12px;
    background: #333;
}
.call-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 12px;
}
.call-controls .btn {
    margin: 3px;
}
.incoming-call {
    position: fixed;
    inset: 0;
    background: rgba(7, 16, 31, .55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.incoming-call-card {
    width: min(360px, 100%);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd, #07101f);
}
@media (max-width: 768px) {
    .chat-wrapper {
        height: auto;
        min-height: calc(100vh - 90px);
    }
    .user-list {
        max-height: 330px;
    }
    .chat-panel {
        min-height: 70vh;
    }
    .message {
        max-width: 88%;
    }
    #remoteVideo {
        height: 420px;
    }
    .video-area {
        min-height: 420px;
    }
    #localVideo {
        width: 140px;
        height: 100px;
        right: 12px;
        bottom: 92px;
    }
}

.socket-warning-box {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 10000;
    background: #dc3545;
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    text-align: center;
}
.socket-warning-box small {
    color: rgba(255,255,255,.92);
}

/* v16.2 private chat image */
.chat-image-preview-wrap {
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #e9ecef;
}
.chat-image-preview-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: #f8f9fa;
}
.chat-image-preview-card img {
    width: 110px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}
.chat-message-image {
    display: block;
    max-width: min(320px, 100%);
    max-height: 360px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0,0,0,.08);
}
.message.me .chat-message-image {
    background: rgba(255,255,255,.15);
}
@media (max-width: 768px) {
    .chat-message-image {
        max-width: min(260px, 100%);
        max-height: 300px;
    }
}
