:root {
    --bg-base: #efeae2;
    --card: #ffffff;
    --card-glass: rgba(255, 255, 255, 0.92);
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --border-glass: rgba(0, 0, 0, 0.08);
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --bubble-me: #d9fdd3;
    --bubble-me-text: #111827;
    --bubble-other: #ffffff;
    --bubble-other-text: #111827;
    --badge-bg: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --mention-bg: #fef08a;
    --mention-color: #854d0e;
    --dot-color: rgba(0, 0, 0, 0.08);
    --bubble-font-size: 0.94rem;
    --action-hover: rgba(0,0,0,0.04);
    --time-color: #6b7280;
    --dropdown-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-base: #0b141a;
    --card: #111b21;
    --card-glass: rgba(17, 27, 33, 0.92);
    --text: #e9edef;
    --muted: #8696a0;
    --border: #202c33;
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent: #00a884;
    --accent-hover: #008f6f;
    --bubble-me: #005c4b;
    --bubble-me-text: #e9edef;
    --bubble-other: #202c33;
    --bubble-other-text: #e9edef;
    --shadow-md: 0 8px 30px rgba(0,0,0,0.4);
    --mention-bg: #854d0e;
    --mention-color: #fef08a;
    --dot-color: rgba(255, 255, 255, 0.05);
    --action-hover: rgba(255,255,255,0.05);
    --time-color: rgba(233,237,239,0.6);
    --dropdown-bg: #233138;
}

[data-theme="modern"] {
    --bg-base: #0f172a;
    --card: #1e293b;
    --card-glass: rgba(30, 41, 59, 0.92);
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --bubble-me: #312e81;
    --bubble-me-text: #f8fafc;
    --bubble-other: #1e293b;
    --bubble-other-text: #f8fafc;
    --shadow-md: 0 8px 30px rgba(0,0,0,0.6);
    --mention-bg: #4338ca;
    --mention-color: #e0e7ff;
    --dot-color: rgba(255, 255, 255, 0.04);
    --action-hover: rgba(255,255,255,0.05);
    --time-color: #94a3b8;
    --dropdown-bg: #1e293b;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
html, body { height: 100%; height: 100dvh; overflow: hidden; }

body { 
    background: url('background.jpg') no-repeat center center, #0f172a !important; 
    background-size: cover !important;
    display: flex; justify-content: center; align-items: center; 
    padding: 8px; position: relative;
}

body::before {
    content: ''; position: fixed; inset: 0; 
    background: rgba(15, 23, 42, 0.82); z-index: 0; pointer-events: none;
}

.split-app-wrapper {
    position: relative; z-index: 10; display: flex; width: 100%; height: calc(100dvh - 16px);
    max-height: 940px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45); background: var(--card); overflow: hidden;
}

/* PC BINNENWERK */
.sidebar-left { width: 320px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--card); flex-shrink: 0; z-index: 50; }
.chat-main-column { flex: 1; display: block; min-width: 0; width: 100%; background: var(--bg-base); position: relative; }
.sidebar-right { width: 290px; border-left: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; padding: 14px 12px; overflow-y: auto; flex-shrink: 0; z-index: 50; }

@media (max-width: 1100px) { .sidebar-right { display: none !important; } }

#confettiCanvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }

/* ZIJBALK NAVIGATIE & INBOX LIJSTEN */
.nav-section-title { font-size: 0.72rem; text-transform: uppercase; font-weight: 800; color: var(--muted); padding: 12px 14px 4px; }
.room-nav-btn { display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin: 2px 8px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 0.88rem; font-weight: 600; background: none; border: none; width: calc(100% - 16px); text-align: left; cursor: pointer; transition: background 0.15s; }
.room-nav-btn:hover { background: var(--action-hover); }
.room-nav-btn.active { background: rgba(37,99,235,0.12); color: var(--accent); font-weight: 700; }
.thread-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: inherit; margin: 2px 8px; cursor: pointer; transition: background 0.15s; }
.thread-row:hover { background: var(--action-hover); }
.thread-row.active { background: rgba(37, 99, 235, 0.12); border-left: 3px solid var(--accent); }
.thread-av { width: 38px; height: 38px; min-width: 38px; min-height: 38px; max-width: 38px; max-height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.online-user-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: inherit; cursor: pointer; transition: background 0.15s; }
.online-user-row:hover { background: var(--action-hover); }
.online-av { width: 32px; height: 32px; min-width: 32px; min-height: 32px; max-width: 32px; max-height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }

/* COMPACTE ZWEVENDE TOP HEADER (GLASSMORPHISM) */
.top-header-wrapper {
    position: absolute; top: 0; left: 0; right: 0; z-index: 40;
    background: var(--card-glass);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    padding-top: env(safe-area-inset-top);
}

.room-info-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 12px 0px; min-height: 24px;
}

.room-info-left { display: flex; align-items: center; position: relative; }
.room-title-trigger { display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.room-title-compact { font-weight: 800; font-size: 0.82rem; color: var(--text); letter-spacing: -0.2px; }
.room-caret { font-size: 0.7rem; color: var(--muted); }
.typing-badge { font-size: 0.65rem; color: var(--accent); font-weight: 600; font-style: italic; margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

.desktop-only { display: flex; align-items: center; gap: 10px; position: relative; }
@media (max-width: 768px) { .desktop-only { display: none !important; } }

.header-avatar-trigger { display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 6px; border-radius: 16px; transition: background 0.15s; }
.header-avatar-trigger:hover { background: var(--action-hover); }
.header-user-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

.room-dropdown { position: absolute; background: var(--dropdown-bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); display: none; flex-direction: column; z-index: 120; top: 100%; left: 0; margin-top: 8px; width: 220px; padding: 6px; }
.room-opt { display: flex; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text); text-decoration: none; cursor: pointer; border: none; background: none; text-align: left; width: 100%; }
.room-opt:hover { background: var(--action-hover); }
.room-opt.active { color: var(--accent); }
.room-count-badge { background: var(--border); color: var(--text); font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; margin-left: auto; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

.sys-banner { padding: 6px 12px; font-size: 0.8rem; font-weight: 600; text-align: center; flex-shrink: 0; border-bottom: 1px solid var(--border-glass); }
.banner-info { background: rgba(219, 234, 254, 0.9); color: #1e40af; }
.banner-success { background: rgba(220, 252, 231, 0.9); color: #166534; }

/* COMPACTE STORIES BAR MET LABEL */
.online-stories-wrapper {
    background: transparent;
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
}
.online-stories-header {
    font-size: 0.58rem; font-weight: 800; color: var(--muted); text-transform: uppercase;
    padding: 2px 12px 0; display: flex; align-items: center; gap: 4px; letter-spacing: 0.5px;
}
.online-stories-dot { width: 5px; height: 5px; background: #10b981; border-radius: 50%; display: inline-block; }

.online-stories-bar {
    display: flex; align-items: center; gap: 10px; padding: 2px 12px 4px; 
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-shrink: 0;
}
.online-stories-bar::-webkit-scrollbar { display: none; }

.story-user-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; flex: 0 0 42px; text-align: center; transition: transform 0.1s; }
.story-user-item:active { transform: scale(0.95); }
.story-avatar-wrap { position: relative; width: 34px; height: 34px; min-width: 34px; min-height: 34px; max-width: 34px; max-height: 34px; border-radius: 50%; padding: 1.5px; border: 1.5px solid #10b981; overflow: hidden; display: flex; justify-content: center; align-items: center; }
.story-avatar-wrap.me-ring { border-color: var(--accent); }
.story-avatar { width: 100%; height: 100%; min-width: 100%; min-height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.story-user-name { font-size: 0.6rem; font-weight: 700; color: var(--text); margin-top: 2px; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.9; }

/* CHAT CONTAINER */
.chat-container { 
    position: absolute; inset: 0; overflow-y: auto;
    padding: 70px 14px 140px; 
    display: flex; flex-direction: column; gap: 6px; -webkit-overflow-scrolling: touch;
    background-image: radial-gradient(var(--dot-color) 1px, transparent 1px); background-size: 20px 20px;
}
.chat-container.pm-mode { padding-top: 40px; }

@media (max-width: 768px) {
    .chat-container { 
        padding-top: calc(130px + env(safe-area-inset-top)); 
        padding-bottom: calc(125px + env(safe-area-inset-bottom)); 
        padding-left: 10px; padding-right: 10px; 
    }
    .chat-container.pm-mode { 
        padding-top: calc(56px + env(safe-area-inset-top)); 
    }
}

.load-more-btn { align-self: center; background: var(--card); border: 1px solid var(--border); padding: 6px 14px; border-radius: 16px; font-size: 0.75rem; font-weight: 700; color: var(--accent); cursor: pointer; margin-bottom: 6px; box-shadow: var(--shadow-sm); z-index: 10; }
.load-more-btn:hover { background: var(--border); }

/* COMPACTE BUBBLES */
.message-row { display: flex; gap: 8px; align-items: flex-end; position: relative; width: 100%; margin-top: 4px; z-index: 10; }
.message-row.me { justify-content: flex-end; }
.message-row.other { justify-content: flex-start; }

.chat-avatar-wrap { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; margin-bottom: 2px; }
.chat-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #ddd; border: 1px solid var(--border); }
.avatar-spacer { width: 28px; flex-shrink: 0; }

.bubble { max-width: 78%; padding: 6px 11px; border-radius: 18px; font-size: var(--bubble-font-size); line-height: 1.38; word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.06); position: relative; }
.bubble.me { background: var(--bubble-me); color: var(--bubble-me-text) !important; border-bottom-right-radius: 4px; }
.bubble.other { background: var(--bubble-other); color: var(--bubble-other-text) !important; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.vip-glow { border: 1.5px solid #f59e0b !important; box-shadow: 0 0 14px rgba(245, 158, 11, 0.3) !important; }

.guest-badge { background: #334155; color: #f8fafc; font-size: 0.65rem; font-weight: 800; padding: 1px 5px; border-radius: 8px; display: inline-flex; align-items: center; }
.reply-quote { background: rgba(0,0,0,0.06); border-left: 3px solid var(--accent); padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; margin-bottom: 6px; }

/* COMPACTE HEADER IN BUBBELS */
.msg-header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 1px; opacity: 0.75; }
.msg-author-link { font-size: 0.75rem; font-weight: 700; color: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.msg-author-link span { font-size: 0.65rem !important; }

.bubble-actions { display: inline-flex; align-items: center; gap: 4px; }
.act-btn { background: transparent; border: none; color: inherit; opacity: 0.6; border-radius: 6px; padding: 2px 4px; cursor: pointer; font-size: 0.7rem; transition: opacity 0.15s; }
.act-btn:hover { opacity: 1; background: rgba(0,0,0,0.05); }
.mention-tag { background: var(--mention-bg); color: var(--mention-color); font-weight: 700; padding: 1px 5px; border-radius: 6px; display: inline-block; }
.msg-footer { font-size: 0.65rem; margin-top: 1px; opacity: 0.7; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.chat-img { max-width: 100%; max-height: 250px; border-radius: 12px; margin-top: 4px; display: block; object-fit: cover; cursor: pointer; }

/* ZWEVENDE BOTTOM ACTIEBALK (GLASSMORPHISM) */
.bottom-action-wrapper {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--card-glass);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
    display: flex; flex-direction: column;
}

.reply-preview-bar { background: transparent; border-bottom: 1px solid var(--border-glass); padding: 8px 16px; display: none; align-items: center; justify-content: space-between; font-size: 0.85rem; color: var(--text); }
.reply-preview-bar span strong { color: var(--accent); }
.image-preview-bar { background: transparent; border-bottom: 1px solid var(--border-glass); padding: 8px 16px; display: none; align-items: center; gap: 10px; color: var(--text); }
.preview-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.preview-cancel { background: #ef4444; color: white; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; cursor: pointer; line-height: 22px; text-align: center; }

/* INVOER VELD */
.input-bar { padding: 10px 16px; display: flex; gap: 8px; align-items: flex-end; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

.tool-btn { background: none; border: none; font-size: 1.4rem; padding: 6px; cursor: pointer; color: var(--muted); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s; opacity: 0.7; }
.tool-btn:hover { color: var(--accent); opacity: 1; background: var(--action-hover); }

.input-bar textarea { flex: 1; min-height: 42px; max-height: 110px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 20px; background: rgba(255,255,255,0.4); color: var(--text); outline: none; font-size: 0.98rem; resize: none; box-shadow: inset 0 1px 3px rgba(0,0,0,0.02); }
[data-theme="dark"] .input-bar textarea, [data-theme="modern"] .input-bar textarea { background: rgba(0,0,0,0.15); border-color: rgba(255,255,255,0.05); }

.send-btn { background: var(--accent); color: white; border: none; padding: 0 20px; border-radius: 20px; font-weight: 700; cursor: pointer; height: 42px; font-size: 0.9rem; box-shadow: 0 4px 10px rgba(37,99,235,0.2); transition: transform 0.1s; }
.send-btn:active { transform: scale(0.95); }
.send-icon { display: none; }

/* Pickers */
.gif-picker, .emoji-picker { position: absolute; bottom: 100%; left: 10px; margin-bottom: 8px; background: var(--dropdown-bg); border: 1px solid var(--border); border-radius: 16px; padding: 12px; box-shadow: var(--shadow-md); z-index: 50; display: none; }
.picker-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 0.82rem; font-weight: 700; color: var(--text); }
.picker-close-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.emoji-picker { width: 290px; flex-direction: column; }
.emoji-grid-inner { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-height: 180px; overflow-y: auto; }
.emoji-item { font-size: 1.45rem; text-align: center; cursor: pointer; border-radius: 8px; padding: 4px; }
.gif-picker { width: 310px; max-height: 330px; flex-direction: column; gap: 8px; }
.gif-search-box { width: 100%; padding: 8px 14px; border: 1px solid var(--border); border-radius: 20px; font-size: 0.85rem; background: var(--bg-base); color: var(--text); outline: none; }
.gif-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; overflow-y: auto; max-height: 210px; }
.gif-item { width: 100%; height: 95px; object-fit: cover; border-radius: 8px; cursor: pointer; }

/* Scroll Bottom */
.scroll-bottom-btn { position: absolute; bottom: 85px; right: 16px; background: var(--card); border: 1px solid var(--border); width: 42px; height: 42px; border-radius: 50%; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-md); cursor: pointer; z-index: 30; font-size: 1.1rem; color: var(--accent); }
@media (max-width: 768px) { .scroll-bottom-btn { bottom: 125px; } }
.scroll-badge { position: absolute; top: -4px; right: -4px; background: #ef4444; color: white; font-size: 0.65rem; font-weight: 800; padding: 2px 6px; border-radius: 10px; display: none; }

/* MOBIELE ONDERBALK MET COLOR BADGE FIX */
.mobile-bottom-nav {
    display: none; height: 54px; background: transparent; border-top: 1px solid var(--border-glass);
    justify-content: space-around; align-items: center; flex-shrink: 0; z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 768px) {
    .mobile-bottom-nav { display: flex; }
    .input-bar { padding: 6px 8px 8px !important; gap: 6px !important; }
    .input-bar .tool-btn { font-size: 1.25rem !important; padding: 4px !important; }
    .input-bar textarea { padding: 8px 14px !important; font-size: 16px !important; min-height: 40px !important; }
    .input-bar .send-btn { width: 40px !important; height: 40px !important; min-width: 40px !important; padding: 0 !important; border-radius: 50% !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; font-size: 1.05rem !important; }
    .send-text { display: none; }
    .send-icon { display: inline-block; transform: translateX(1px); }
}

.mob-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 0.65rem; font-weight: 600; background: none; border: none; cursor: pointer; flex: 1; height: 100%; opacity: 0.7; transition: opacity 0.15s; }
.mob-nav-item:hover, .mob-nav-item.active { opacity: 1; color: var(--text); }
.mob-nav-item.active { font-weight: 700; color: var(--accent); }

.mob-nav-icon { font-size: 1.25rem; filter: grayscale(100%); transition: filter 0.15s; display: inline-block; line-height: 1; }
.mob-nav-item.active .mob-nav-icon { filter: grayscale(0%); }

.mob-badge { position: absolute; top: -3px; right: -8px; background: #ef4444; color: #ffffff; font-size: 0.6rem; font-weight: 800; padding: 1px 4px; border-radius: 10px; line-height: 1.2; box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4); z-index: 2; }

/* MOBIEL MENU PANEL (BOTTOM SHEET) */
.mobile-menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; display: none; align-items: flex-end; justify-content: center; }
@media (min-width: 769px) { .mobile-menu-overlay { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); } }
.mobile-menu-sheet { background: var(--card); width: 100%; border-radius: 20px 20px 0 0; padding: 20px; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); transform: translateY(100%); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); color: var(--text); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.mobile-menu-overlay.open .mobile-menu-sheet { transform: translateY(0); }
.mob-menu-header { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 1.1rem; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.mob-menu-body a { display: flex; align-items: center; padding: 14px 0; font-weight: 700; color: var(--text); text-decoration: none; font-size: 0.95rem; border-bottom: 1px solid var(--bg-base); }
.mob-menu-body a:last-child { border-bottom: none; }

/* Modals */
.mini-profile-modal, .lightbox-modal, .info-modal, .members-modal, .settings-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: none; align-items: center; justify-content: center; z-index: 999; padding: 16px; }
.mini-card, .info-card, .members-card { background: var(--dropdown-bg); border: 1px solid var(--border); border-radius: 24px; padding: 24px; max-width: 440px; width: 100%; box-shadow: var(--shadow-md); position: relative; color: var(--text); max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mini-avatar { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; display: block; border: 3px solid var(--border); }
.lightbox-img { max-width: 95vw; max-height: 90vh; border-radius: 12px; object-fit: contain; box-shadow: var(--shadow-md); }

.members-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.members-search-box { width: 100%; padding: 10px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-base); color: var(--text); font-size: 0.9rem; outline: none; margin-bottom: 12px; }
.filter-pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill { background: var(--bg-base); border: 1px solid var(--border); padding: 6px 14px; border-radius: 16px; font-size: 0.75rem; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.filter-pill.active { background: var(--accent); color: white; border-color: var(--accent); }

.members-hub-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; padding-right: 2px; }
.hub-user-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 14px; background: var(--bg-base); border: 1px solid var(--border); gap: 10px; transition: background 0.15s; }
.hub-user-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; cursor: pointer; }
.hub-avatar-wrap { position: relative; width: 42px; height: 42px; flex-shrink: 0; }
.hub-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.hub-status-dot { width: 12px; height: 12px; border-radius: 50%; position: absolute; bottom: -2px; right: -2px; border: 2px solid var(--card); }
.hub-status-dot.online { background: #10b981; }
.hub-status-dot.recent { background: #f59e0b; }
.hub-user-info { min-width: 0; flex: 1; }
.hub-user-name { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-user-sub { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.hub-btn { background: var(--card); border: 1px solid var(--border); border-radius: 10px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.05rem; text-decoration: none; color: var(--text); }

.pm-return-btn { background: var(--action-hover); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 0.8rem; font-weight: 700; color: var(--text); cursor: pointer; display: none; }

.profile-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 999; display: none; justify-content: flex-end; }
@media (min-width: 769px) { .profile-drawer-overlay { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); } }
.profile-drawer-panel { width: 100%; max-width: 540px; height: 100%; background: var(--card); border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(0,0,0,0.3); display: flex; flex-direction: column; overflow-y: auto; transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); -webkit-overflow-scrolling: touch; }
.profile-drawer-overlay.open .profile-drawer-panel { transform: translateX(0); }

/* Toasts - Veilig met z-index */
.custom-toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px); background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 12px 20px; border-radius: 14px; font-size: 0.88rem; font-weight: 600; z-index: 1000000; display: flex; align-items: center; gap: 10px; opacity: 0; pointer-events: none; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.custom-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.custom-confirm-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); z-index: 1000001; display: none; align-items: center; justify-content: center; padding: 16px; }
.custom-confirm-card { background: var(--dropdown-bg); border: 1px solid var(--border); border-radius: 20px; padding: 22px; max-width: 380px; width: 100%; box-shadow: var(--shadow-md); color: var(--text); text-align: center; }
.custom-confirm-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.custom-confirm-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.45; margin-bottom: 18px; }
.custom-confirm-actions { display: flex; gap: 10px; }
.confirm-btn-yes { flex: 1; height: 40px; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-weight: 700; font-size: 0.88rem; cursor: pointer; }
.confirm-btn-no { flex: 1; height: 40px; background: var(--bg-base); color: var(--text); border: 1px solid var(--border); border-radius: 12px; font-weight: 600; font-size: 0.88rem; cursor: pointer; }

/* Mobiele optimalisatie (Vastzetting scherm zonder foute padding) */
@media (max-width: 768px) {
    *, *::before, *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; -webkit-font-smoothing: auto !important; -webkit-perspective: none !important; perspective: none !important; }
    body { padding: 0 !important; margin: 0 !important; background-attachment: scroll !important; }
    html, body { scroll-behavior: auto !important; overflow: hidden !important; }
    .split-app-wrapper { width: 100% !important; max-width: 100% !important; height: 100dvh !important; max-height: 100dvh !important; box-shadow: none !important; border-radius: 0 !important; border: none !important; }
    
    .sidebar-left, .sidebar-right { display: none !important; }
    .chat-main-column { width: 100% !important; min-width: 100% !important; display: flex !important; flex-direction: column !important; }
    
    .members-modal { background: rgba(0, 0, 0, 0.9) !important; }
    .members-card { box-shadow: none !important; transform: none !important; animation: none !important; transition: none !important; }
    .members-hub-list { -webkit-overflow-scrolling: touch !important; transform: none !important; will-change: auto !important; }
    .hub-user-row { transform: none !important; transition: none !important; }
    .profile-drawer-overlay { background: rgba(0, 0, 0, 0.85) !important; }
}

/* ==========================================================================
   UITSLUITEND DESKTOP OVERRIDES (PC WEERGAVE: TRANSPARANT & VERGROOT)
   ========================================================================== */
@media (min-width: 769px) {
    body { 
        background-attachment: fixed !important; 
        padding: 24px; 
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    body::before { 
        backdrop-filter: blur(6px); 
        -webkit-backdrop-filter: blur(6px); 
        background: rgba(15, 23, 42, 0.55); 
    }

    /* Gecentreerde zwevende shell */
    .split-app-wrapper { 
        max-width: 1380px; 
        height: 92vh; 
        margin: 0 auto !important;
        border: 1px solid var(--border-glass);
        box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    /* Doorschijnende zijbalken op PC */
    .sidebar-left {
        background: rgba(255, 255, 255, 0.45) !important;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-right: 1px solid var(--border-glass);
    }
    [data-theme="dark"] .sidebar-left,
    [data-theme="modern"] .sidebar-left {
        background: rgba(17, 27, 33, 0.55) !important;
    }

    .sidebar-right {
        background: rgba(255, 255, 255, 0.45) !important;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-left: 1px solid var(--border-glass);
    }
    [data-theme="dark"] .sidebar-right,
    [data-theme="modern"] .sidebar-right {
        background: rgba(17, 27, 33, 0.55) !important;
    }

    .top-header-wrapper {
        background: var(--card-glass);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .bottom-action-wrapper {
        background: var(--card-glass);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding: 4px 8px;
    }

    /* Grotere profielfoto's bij 'Nu online' in de rechterzijbalk op PC */
    .sidebar-right .online-av {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
        border-radius: 50% !important;
    }
    .sidebar-right .online-user-row {
        padding: 8px 10px !important;
        gap: 12px !important;
    }

    /* Knoppen onderin de linkerzijbalk vergroten en verfraaien op PC */
    .sidebar-left .head-btn,
    .sidebar-left a.head-btn {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.15rem !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: 1px solid var(--border-glass) !important;
        transition: all 0.15s ease;
    }
    .sidebar-left .head-btn:hover,
    .sidebar-left a.head-btn:hover {
        background: var(--accent) !important;
        color: #ffffff !important;
        transform: scale(1.08);
        border-color: var(--accent) !important;
    }

    /* Rechterzijbalk knop 'Alle Leden' op PC */
    .sidebar-right .btn-view-all-members {
        padding: 6px 12px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid var(--border-glass);
        font-weight: 700;
        transition: all 0.15s ease;
    }
    .sidebar-right .btn-view-all-members:hover {
        background: var(--accent);
        color: #fff;
    }

    /* Grotere pictogrammen onderin de chat op PC */
    .input-bar {
        padding: 8px 16px;
        gap: 10px;
    }

    .tool-btn {
        width: 44px;
        height: 44px;
        font-size: 1.35rem;
        opacity: 0.85;
    }
    .tool-btn:hover {
        transform: scale(1.1);
        background: var(--action-hover);
        opacity: 1;
    }

    .input-bar textarea {
        min-height: 44px;
        padding: 11px 16px;
        font-size: 0.95rem;
    }

    .send-btn {
        height: 44px;
        padding: 0 22px;
        font-size: 0.92rem;
    }

    /* Rustigere chatstream breedte op PC */
    .bubble {
        max-width: 65%;
    }
    
    .bubble-actions {
        opacity: 0;
        transition: opacity 0.15s ease-in-out;
    }
    .message-row:hover .bubble-actions {
        opacity: 1;
    }

    /* Slanke moderne scrollbalken op PC */
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 10px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.6); }
    * { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.35) transparent; }
}