.mmdb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.mmdb-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    background: #fff;
}
.mmdb-card-thumb {
    position: relative;
    cursor: pointer;
    display: block;
    margin-bottom: 6px;
}
.mmdb-card-thumb img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}
.mmdb-card-thumb::after {
    content: '▶';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #fff;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
    pointer-events: none;
}
.mmdb-card-username {
    font-weight: 600;
    margin-bottom: 4px;
}
.mmdb-card-status {
    font-size: 12px;
    margin-bottom: 6px;
}
.mmdb-card-status-online {
    color: #0a8a0a;
}
.mmdb-card-status-offline {
    color: #999;
}
.mmdb-pagination {
    margin-top: 16px;
    text-align: center;
}
.mmdb-page-links {
    margin-top: 8px;
}
.mmdb-page-links button {
    margin: 0 4px;
    padding: 4px 8px;
    cursor: pointer;
}
.mmdb-page-links button.mmdb-current {
    font-weight: 700;
    background: #333;
    color: #fff;
}

/* Модалка */
#mmdb-video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#mmdb-video-modal.mmdb-open {
    display: flex;
}
.mmdb-video-inner {
    background: #000;
    padding: 10px;
    border-radius: 6px;
    max-width: 1200px;
    width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    color: #fff;
    box-sizing: border-box;
}
.mmdb-video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.mmdb-video-title {
    font-size: 14px;
    font-weight: 600;
}
.mmdb-video-close {
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
}
.mmdb-video-top-text,
.mmdb-video-bottom-text {
    font-size: 14px;
    margin-bottom: 8px;
}
.mmdb-video-bottom-text {
    margin-top: 8px;
}
.mmdb-video-layout {
    display: flex;
    gap: 10px;
    box-sizing: border-box;
}
.mmdb-video-left,
.mmdb-video-right {
    flex: 1 1 50%;
    min-width: 0;
}
.mmdb-video-left video {
    width: 100%;
    height: auto;
    max-height: 60vh;
    display: block;
    background: #000;
}
.mmdb-video-right {
    background: #111;
    border-radius: 4px;
    padding: 4px;
    overflow: auto;
}

/* ===== ЛОКАЛЬНЫЙ ЧАТ ===== */

.mmdb-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.mmdb-chat-messages {
    flex: 1 1 auto;
    padding: 8px;
    border: 1px solid #333;
    background: #000;
    color: #eee;
    font-size: 13px;
    line-height: 1.4;
    overflow-y: auto;
    max-height: 60vh;
    box-sizing: border-box;
}
.mmdb-chat-row {
    margin-bottom: 4px;
}
.mmdb-chat-name {
    font-weight: 600;
    color: #4caf50;
}
.mmdb-chat-text {
    margin-left: 4px;
}
.mmdb-chat-time {
    margin-left: 6px;
    font-size: 11px;
    color: #777;
}
.mmdb-chat-empty {
    font-size: 13px;
    color: #aaa;
}

.mmdb-chat-form {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#mmdb-chat-name,
#mmdb-chat-message {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #444;
    background: #000;
    color: #eee;
    font-size: 13px;
    box-sizing: border-box;
}
#mmdb-chat-message {
    min-height: 60px;
    resize: vertical;
}
.mmdb-chat-form button {
    align-self: flex-end;
    padding: 6px 12px;
    border: 0;
    background: #e91e63;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    border-radius: 3px;
}
.mmdb-chat-form button:hover {
    background: #ff4081;
}

/* Мобилка */
@media (max-width: 767px) {
    .mmdb-video-layout {
        flex-direction: column;
        max-height: none;
    }
    .mmdb-video-left,
    .mmdb-video-right {
        flex: 1 1 auto;
        width: 100%;
    }
    .mmdb-chat-messages {
        max-height: 40vh;
    }
}

/* ===== ЧАТ: вкладки + пользователи ===== */

.mmdb-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mmdb-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.mmdb-chat-model {
    color: #ccc;
}

.mmdb-chat-tabs {
    display: flex;
    gap: 4px;
}

.mmdb-chat-tab {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #444;
    background: #000;
    color: #ccc;
    cursor: pointer;
    border-radius: 3px;
}
.mmdb-chat-tab-active {
    background: #e91e63;
    color: #fff;
    border-color: #e91e63;
}

.mmdb-chat-body {
    display: flex;
    gap: 6px;
    height: 100%;
}

.mmdb-chat-main {
    flex: 3 1 0;
    display: flex;
    flex-direction: column;
}

.mmdb-chat-sidebar {
    flex: 1 1 0;
    border-left: 1px solid #333;
    padding-left: 6px;
    font-size: 12px;
    color: #ddd;
    box-sizing: border-box;
}

.mmdb-chat-users-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.mmdb-chat-users {
    max-height: 60vh;
    overflow-y: auto;
}

.mmdb-chat-user-row {
    margin-bottom: 2px;
}

.mmdb-chat-user-name-model {
    color: #ffeb3b;
    font-weight: 600;
}
.mmdb-chat-user-name {
    color: #fff;
}

/* уже существующие стили чата можно использовать дальше, либо так: */
.mmdb-chat-messages {
    flex: 1 1 auto;
    padding: 8px;
    border: 1px solid #333;
    background: #000;
    color: #eee;
    font-size: 13px;
    line-height: 1.4;
    overflow-y: auto;
    max-height: 60vh;
    box-sizing: border-box;
}

.mmdb-chat-form {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#mmdb-chat-name,
#mmdb-chat-message {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #444;
    background: #000;
    color: #eee;
    font-size: 13px;
    box-sizing: border-box;
}

#mmdb-chat-message {
    min-height: 60px;
    resize: vertical;
}

.mmdb-chat-form button {
    align-self: flex-end;
    padding: 6px 12px;
    border: 0;
    background: #e91e63;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    border-radius: 3px;
}

.mmdb-chat-form button:hover {
    background: #ff4081;
}

/* Мобилка: колонка пользователей уходит вниз */
@media (max-width: 767px) {
    .mmdb-chat-body {
        flex-direction: column;
    }
    .mmdb-chat-sidebar {
        border-left: 0;
        border-top: 1px solid #333;
        padding-left: 0;
        padding-top: 6px;
    }
}