/* EnMax — Teams-Style Design */
:root {
    --bg: #000;
    --bg-surface: #0a0a0a;
    --bg-elevated: #111;
    --bg-muted: #181818;
    --bg-subtle: #222;
    --text: #fff;
    --text-secondary: #999;
    --text-muted: #555;
    --accent: #fff;
    --border: #1a1a1a;
    --border-strong: #2a2a2a;
    --sent-bg: #111;
    --received-bg: #0a0a0a;
    --danger: #ff4466;
    --success: #888;
    --grid: #151515;
    --rail-bg: #0a0a0a;
    --rail-hover: #1a1a1a;
    --rail-active: #fff;
}

[data-theme="light"] {
    --bg: #fff;
    --bg-surface: #fafafa;
    --bg-elevated: #fff;
    --bg-muted: #f0f0f0;
    --bg-subtle: #e8e8e8;
    --text: #000;
    --text-secondary: #666;
    --text-muted: #999;
    --accent: #000;
    --border: #e0e0e0;
    --border-strong: #ccc;
    --sent-bg: #f0f0f0;
    --received-bg: #fafafa;
    --danger: #d33;
    --success: #666;
    --grid: #eee;
    --rail-bg: #f0f0f0;
    --rail-hover: #e0e0e0;
    --rail-active: #000;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Dot Logo */
.dot-logo {
    display: block;
    margin: 0 auto;
    cursor: pointer;
}
.dot-logo-dot {
    fill: var(--accent);
    opacity: 0.85;
    transition: r 0.3s ease, opacity 0.3s ease;
}
.rail-logo {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
}
.rail-logo .dot-logo {
    width: 36px !important;
    height: 36px !important;
}

/* Auth Screen — all styles are inline in HTML, nothing here */
/* btn-primary is reused in modals too */
.btn-primary {
    padding: 14px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: opacity 0.15s;
    width: 100%;
}
[data-theme="light"] .btn-primary { background: #000; color: #fff; }
.btn-primary:hover { opacity: 0.8; }
.btn-primary:active { opacity: 0.6; }
.btn-primary:disabled { opacity: 0.2; cursor: not-allowed; }

/* ==================== APP LAYOUT ==================== */
.app { display: flex; height: 100vh; background: var(--bg); }

/* ==================== ICON RAIL ==================== */
.icon-rail {
    width: 68px;
    min-width: 68px;
    background: var(--rail-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    overflow: hidden;
}
.icon-rail-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}
.icon-rail-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.rail-icon {
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    font-family: inherit;
}
.rail-icon:hover { background: var(--rail-hover); color: var(--text); }
.rail-icon.active { color: var(--accent); }
.rail-icon.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}
.rail-label { font-size: 10px; font-weight: 500; line-height: 1; }
.rail-avatar { cursor: pointer; }
.rail-avatar .avatar.avatar-sm { width: 32px; height: 32px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 320px;
    min-width: 320px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
}

.sidebar-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.sidebar-actions { display: flex; gap: 4px; }

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}
.btn-icon svg { display: block; }
.btn-icon:hover { color: var(--text); border-color: var(--border-strong); }

.sidebar-search { padding: 8px 16px; border-bottom: 1px solid var(--border); }
.sidebar-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search input:focus { border-color: var(--text-muted); }

/* ==================== CHAT LIST ==================== */
.chat-list { flex: 1; overflow-y: auto; overflow-x: hidden; }
.empty-list { padding: 24px 16px; text-align: center; font-size: 12px; color: var(--text-muted); }

.chat-item, .group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 8px;
    cursor: pointer;
    border-bottom: none;
    border-radius: 8px;
    transition: background 0.1s;
    position: relative;
}
.chat-item:hover, .group-item:hover { background: var(--bg-muted); }
.chat-item.active, .group-item.active { background: var(--bg-muted); }

.chat-item-info, .group-item-info { flex: 1; min-width: 0; }
.chat-item-name-row { display: flex; align-items: center; gap: 6px; }
.chat-item-name, .group-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-preview, .group-item-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-item-time { font-size: 10px; color: var(--text-muted); }

.unread-badge {
    background: var(--text);
    color: var(--bg);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 9px;
}

.chat-item-typing { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }

/* ==================== AVATARS ==================== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
}
.avatar.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Online status shown via .status-dot next to name */

/* ==================== CHAT AREA ==================== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    min-width: 0;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 16px;
    font-size: 14px;
}

/* ==================== CHAT HEADER ==================== */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    z-index: 10;
}

.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-header-text { display: flex; flex-direction: column; }
.chat-header-name-row { display: flex; align-items: center; gap: 6px; }
.chat-header-name { font-size: 14px; font-weight: 600; }
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    flex-shrink: 0;
}
.status-dot.online { background: #4f4; }
.chat-header-status { font-size: 11px; color: var(--text-muted); }
.chat-header-actions { display: flex; gap: 4px; }

/* Active Call Banner */
.active-call-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.08));
    border-bottom: 1px solid rgba(46, 204, 113, 0.2);
    animation: callBannerIn 0.3s ease-out;
}
@keyframes callBannerIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.active-call-banner-info { display: flex; align-items: center; gap: 10px; }
.active-call-banner-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #2ecc71;
    animation: callBannerPulse 1.5s ease-in-out infinite;
}
@keyframes callBannerPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.active-call-banner-text { font-size: 13px; color: var(--text); font-weight: 500; }
.active-call-banner-join {
    padding: 5px 16px;
    border: none;
    border-radius: 16px;
    background: #2ecc71;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.active-call-banner-join:hover { background: #27ae60; transform: scale(1.03); }
.active-call-banner-join:active { transform: scale(0.97); }

/* ==================== MESSAGES ==================== */
.messages-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 20px; overflow-anchor: none; }
.messages { display: flex; flex-direction: column; gap: 2px; min-height: 100%; justify-content: flex-end; }

.message {
    max-width: 70%;
    position: relative;
    animation: msgIn 0.15s ease-out;
    display: flex;
    gap: 8px;
    padding: 4px 0;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.message.sent { align-self: flex-end; flex-direction: row-reverse; }
.message.received { align-self: flex-start; }

/* Bubble sits inside .message-content */
.message-bubble {
    padding: 8px 12px;
}
.message.sent .message-bubble {
    background: var(--sent-bg);
    border: 1px solid var(--border-strong);
    border-radius: 16px 16px 4px 16px;
}
.message.received .message-bubble {
    background: var(--received-bg);
    border: 1px solid var(--border);
    border-radius: 16px 16px 16px 4px;
}

/* Avatar + content layout */
.message.with-avatar .message-content { flex: 1; min-width: 0; position: relative; }
.message-avatar {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 50%; overflow: hidden;
    background: var(--bg-subtle);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    margin-top: 2px;
}
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Header (name + time) sits ABOVE the bubble */
.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
    padding: 0 2px;
}
.message.sent .message-header { justify-content: flex-end; }
.message-sender { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.message-header .message-time { margin: 0; }
.message-text { font-size: 14px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; }
.message-time { font-size: 10px; color: var(--text-muted); }
.message-status { font-size: 11px; margin-left: 3px; letter-spacing: -2px; }
.message-status.sent { color: var(--text-muted); letter-spacing: normal; }
.message-status.delivered { color: var(--text-muted); }
.message-status.read { color: #4fc3f7; }
.reply-btn {
    position: absolute; bottom: 4px; right: -30px;
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
    padding: 4px; display: flex; align-items: center; border-radius: 50%;
    opacity: 0; transition: opacity 0.15s;
}
.message.sent .reply-btn { right: auto; left: -30px; }
.message:hover .reply-btn { opacity: 1; }
.reply-btn:hover { color: var(--text); border-color: var(--border-strong); }
.reply-btn svg { display: block; }

.message.highlight { background: var(--bg-subtle); transition: background 0.5s; }

.message-reply {
    padding: 6px 8px;
    margin-bottom: 6px;
    border-left: 2px solid var(--text-muted);
    background: var(--bg-muted);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Reply preview — sits inside .chat-input-wrapper as top strip */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 8px 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}
.reply-preview-bar {
    width: 3px;
    align-self: stretch;
    background: var(--text-secondary);
    border-radius: 2px;
    flex-shrink: 0;
}
.reply-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.reply-preview-info strong { font-size: 11px; color: var(--text); }
.reply-preview-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.reply-preview-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; display: flex; align-items: center; flex-shrink: 0; border-radius: 50%; }
.reply-preview-close:hover { color: var(--text); background: var(--bg-muted); }

/* When reply is active, wrapper becomes column-ish */
.chat-input-wrapper.has-reply {
    flex-wrap: wrap;
    border-radius: 20px;
    padding-top: 0;
}
.chat-input-wrapper.has-reply .reply-preview {
    padding: 10px 8px 8px 12px;
}

/* ==================== ATTACHMENTS ==================== */
.message-attachment {
    margin-top: 6px;
    padding: 8px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.1s;
}
.message-attachment:hover { background: var(--bg-subtle); }
.message-attachment-icon { display: flex; align-items: center; }
.message-attachment-icon svg { width: 20px; height: 20px; }
.message-attachment-info { flex: 1; min-width: 0; }
.message-attachment-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message-attachment-size { font-size: 10px; color: var(--text-muted); }

.loading-placeholder {
    padding: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.message-image { max-width: 300px; max-height: 300px; cursor: pointer; display: block; margin-top: 4px; border: 1px solid var(--border); border-radius: 4px; }
.message-video { max-width: 300px; max-height: 300px; margin-top: 4px; }

.file-preview { margin-top: 6px; max-height: 300px; overflow: auto; font-size: 12px; border: 1px solid var(--border); border-radius: 8px; }
.file-preview-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1;
}
.file-preview-name { font-size: 11px; font-weight: 600; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-actions { display: flex; gap: 2px; flex-shrink: 0; }
.file-preview-actions button {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid transparent; border-radius: 6px;
    color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.file-preview-actions button:hover { color: var(--text); background: var(--bg-muted); border-color: var(--border); }
.file-preview-actions button svg { display: block; }
.file-preview pre { margin: 0; padding: 10px; }
.file-preview-code { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; }
.file-preview-expand {
    display: block; width: 100%; padding: 6px;
    background: var(--bg-muted); border: none; border-top: 1px solid var(--border);
    color: var(--text-secondary); font-size: 11px; cursor: pointer; text-align: center;
    border-radius: 0 0 8px 8px;
}
.file-preview-expand:hover { background: var(--bg-subtle); }

.message-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
    margin-top: 4px;
}
.message-file:hover { background: var(--bg-subtle); }
.message-file .file-icon { flex-shrink: 0; color: var(--text-secondary); }
.message-file .file-name { font-size: 12px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-file .file-size { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
.message-file .file-download { flex-shrink: 0; color: var(--text-muted); display: flex; align-items: center; transition: color 0.15s; }
.message-file:hover .file-download { color: var(--text); }

/* ==================== DATE SEPARATOR ==================== */
.date-separator { text-align: center; padding: 12px 0; position: relative; }
.date-separator span {
    background: var(--bg);
    padding: 4px 14px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}
.date-separator::before {
    content: '';
    position: absolute;
    left: 10%; right: 10%; top: 50%;
    height: 1px;
    background: var(--border);
}

/* ==================== SCROLL TO BOTTOM ==================== */
.scroll-bottom-btn {
    position: sticky;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    z-index: 5;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    animation: scrollBtnIn 0.2s ease-out;
}
[data-theme="light"] .scroll-bottom-btn { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.scroll-bottom-btn:hover { color: var(--text); border-color: var(--text-muted); }
.scroll-bottom-btn svg { display: block; }
.scroll-badge {
    background: var(--text);
    color: var(--bg);
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 9px;
}
@keyframes scrollBtnIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }

/* ==================== TYPING INDICATOR ==================== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
}
.typing-indicator-name { font-weight: 500; color: var(--text-secondary); }
.typing-dots-anim { display: inline-flex; gap: 3px; align-items: center; margin-left: 2px; }
.typing-dots-anim span {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.4s infinite;
}
.typing-dots-anim span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots-anim span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* ==================== INPUT AREA ==================== */
.input-area {
    padding: 0 16px 16px;
    background: transparent;
    position: relative;
    z-index: 10;
}

/* Godray — upward glow on focus, applied via box-shadow to avoid clipping */

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 26px;
    padding: 4px 6px 4px 6px;
    transition: border-color 0.2s;
}
.chat-input-wrapper:focus-within {
    border-color: var(--text-muted);
    box-shadow: 0 -20px 60px -10px rgba(255, 255, 255, 0.06), 0 -8px 30px -5px rgba(255, 255, 255, 0.03);
}
[data-theme="light"] .chat-input-wrapper:focus-within {
    box-shadow: 0 -20px 60px -10px rgba(0, 0, 0, 0.04), 0 -8px 30px -5px rgba(0, 0, 0, 0.02);
}

#message-input {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 150px;
    min-height: 44px;
    line-height: 1.5;
}
#message-input::placeholder { color: var(--text-muted); }

.btn-send {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    background: var(--text) !important;
    color: var(--bg) !important;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.btn-send:hover { opacity: 0.8; }
.btn-send svg { width: 16px; height: 16px; }

.btn-attach { flex-shrink: 0; width: 40px; height: 40px; border: none !important; }
.btn-attach:hover { border: none !important; border-color: transparent !important; }
.btn-attach svg { width: 18px; height: 18px; }

.btn-emoji { flex-shrink: 0; width: 40px; height: 40px; opacity: 0.4; transition: opacity 0.15s; border: none !important; }
.btn-emoji:hover { opacity: 1; border: none !important; border-color: transparent !important; }
.btn-emoji svg { width: 20px; height: 20px; }

/* ==================== EMOJI PICKER ==================== */
.emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 6px;
    width: 340px;
    max-height: 380px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 100;
}
.emoji-picker.open {
    opacity: 1;
    transform: translateY(0) scale(1);
}
[data-theme="light"] .emoji-picker {
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.emoji-search-wrap {
    padding: 8px 10px 4px;
}
.emoji-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.emoji-search:focus { border-color: var(--text-muted); }
.emoji-search::placeholder { color: var(--text-muted); }

.emoji-tabs {
    display: flex;
    gap: 0;
    padding: 4px 6px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.emoji-tabs::-webkit-scrollbar { display: none; }
.emoji-tab {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
}
.emoji-tab:hover { opacity: 1; background: var(--bg); }
.emoji-tab.active { opacity: 1; background: var(--bg); }

.emoji-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    min-height: 200px;
    max-height: 280px;
}
.emoji-grid-container::-webkit-scrollbar { width: 4px; }
.emoji-grid-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}
.emoji-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
}
.emoji-item:hover {
    background: var(--bg);
    transform: scale(1.15);
}

.emoji-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}
.modal.active { display: flex; }

.modal-content {
    width: 400px;
    max-height: 80vh;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.15s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.modal-large { width: 500px; }
.modal-media { width: 600px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    color: var(--text-muted); font-size: 18px; cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.modal-body input:focus,
.modal-body textarea:focus { border-color: var(--text-muted); }
.modal-body input::placeholder,
.modal-body textarea::placeholder { color: var(--text-muted); }

/* ==================== SEARCH RESULTS ==================== */
.search-results { display: flex; flex-direction: column; gap: 4px; }
.search-result-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}
.search-result-item:hover { background: var(--bg-subtle); }
.search-result-item .username { font-size: 13px; font-weight: 500; }

/* ==================== MEMBER LIST ==================== */
.member-list { display: flex; flex-direction: column; gap: 4px; }
.member-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border); }
.member-item-name { font-size: 13px; }
.member-item-role { font-size: 10px; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

.group-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* ==================== PROFILE & GROUP INFO ==================== */
.avatar-large {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--bg-subtle);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: var(--text);
    overflow: hidden; flex-shrink: 0;
    border: 2px solid var(--border-strong);
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}
.avatar-large:hover { border-color: var(--text-muted); }
.avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.avatar-large .avatar-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
    border-radius: 50%;
}
.avatar-large:hover .avatar-overlay { opacity: 1; }

.profile-pic-actions { display: flex; gap: 8px; margin-top: 8px; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px;
    background: var(--bg-muted);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
    cursor: pointer; transition: all 0.15s;
    font-family: inherit;
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }
.btn-secondary svg { display: block; }

.btn-danger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
    cursor: pointer; transition: all 0.15s;
    font-family: inherit; width: 100%;
    justify-content: center;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm {
    padding: 4px 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font-size: 11px; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
    font-family: inherit;
}
.btn-sm:hover { color: var(--text); border-color: var(--text-muted); }

.group-info-header {
    display: flex; align-items: center; gap: 16px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.group-info-details { flex: 1; min-width: 0; }
.group-info-name-display { font-size: 18px; font-weight: 700; }
.group-info-desc-display { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.group-info-edit { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }

.member-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.member-name { font-size: 13px; font-weight: 500; }
.member-role { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }

/* ==================== MEDIA PREVIEW ==================== */
.media-caption { margin-top: 8px; }
.media-caption textarea {
    width: 100%; padding: 8px 10px;
    background: var(--bg-muted); border: 1px solid var(--border);
    color: var(--text); font-size: 13px; font-family: inherit; resize: none; outline: none;
}
.media-caption textarea:focus { border-color: var(--text-muted); }
#media-preview-content { text-align: center; }
#media-preview-content img,
#media-preview-content video { max-width: 100%; max-height: 400px; }

/* ==================== NOTIFICATION ==================== */
.toast-container {
    position: fixed; top: 16px; right: 16px;
    z-index: 2000;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
    max-width: 380px;
}
.toast {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text);
    font-size: 13px;
    animation: toastIn 0.25s ease-out;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
[data-theme="light"] .toast { box-shadow: 0 4px 24px rgba(0,0,0,0.1); }
.toast:hover { border-color: var(--text-muted); }
.toast.toast-out { opacity: 0; transform: translateX(30px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.toast-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-subtle);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: var(--text);
    overflow: hidden; flex-shrink: 0;
    border: 1px solid var(--border-strong);
}
.toast-avatar img { width: 100%; height: 100%; object-fit: cover; }
.toast-content { flex: 1; min-width: 0; }
.toast-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.toast-close {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    color: var(--text-muted); cursor: pointer;
    border-radius: 50%; flex-shrink: 0;
    transition: all 0.15s;
}
.toast-close:hover { color: var(--text); background: var(--bg-muted); }
.toast-error { border-color: var(--danger); }
.toast-error .toast-name { color: var(--danger); }

/* ==================== IMAGE FULLSCREEN ==================== */
.image-fullscreen {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(0, 0, 0, 0.95);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.image-fullscreen img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
.close-fullscreen {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%; color: #fff; cursor: pointer;
    transition: background 0.15s;
}
.close-fullscreen:hover { background: rgba(255,255,255,0.2); }
.close-fullscreen svg { display: block; }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

::selection { background: var(--text); color: var(--bg); }

/* ==================== MUTE ==================== */
.btn-icon.muted { color: var(--danger); }
.mute-icon {
    display: inline-flex; align-items: center;
    color: var(--text-muted); margin-left: 6px; flex-shrink: 0;
}
.mute-icon svg { display: block; }

/* ==================== CALL OVERLAY ==================== */
.call-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center; justify-content: center;
    animation: callFadeIn 0.3s ease-out;
    backdrop-filter: blur(20px);
}
.call-overlay.active { display: flex; }
.call-overlay.hiding { animation: callFadeOut 0.3s ease-in forwards; }

@keyframes callFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes callFadeOut { from { opacity: 1; } to { opacity: 0; } }

.call-screen {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Incoming / Outgoing Call */
.call-info {
    display: flex; flex-direction: column;
    align-items: center; gap: 16px;
    animation: callInfoIn 0.4s ease-out;
}
@keyframes callInfoIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: none; } }

.call-avatar-ringing {
    position: relative;
    width: 120px; height: 120px;
    display: flex; align-items: center; justify-content: center;
}

.call-avatar-circle {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: var(--bg-subtle);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 2px solid var(--border-strong);
    z-index: 1;
    position: relative;
}
.call-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.call-avatar-letter { font-size: 36px; font-weight: 700; color: #fff; }

.call-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: callRingPulse 2s ease-out infinite;
}
.call-ring-2 { animation-delay: 0.5s; }
.call-ring-3 { animation-delay: 1s; }

@keyframes callRingPulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.call-name { font-size: 22px; font-weight: 600; color: #fff; }
.call-status { font-size: 14px; color: rgba(255,255,255,0.5); }

.call-e2ee-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    font-size: 11px; color: rgba(255,255,255,0.5);
    letter-spacing: 0.3px;
}
.call-e2ee-badge.call-enmaxed {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    font-weight: 600;
    letter-spacing: 1.5px;
}
.call-e2ee-badge.call-enmaxed svg { stroke: #4ade80; opacity: 0.8; }
.call-e2ee-badge svg { opacity: 0.6; }

/* Call Action Buttons (Incoming: Accept/Decline) */
.call-actions-incoming {
    position: absolute; bottom: 80px;
    display: flex; gap: 40px;
}
.call-actions-single {
    position: absolute; bottom: 80px;
}

.call-action-btn {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.call-action-btn:hover { transform: scale(1.1); }
.call-action-btn:active { transform: scale(0.95); }

.call-accept-btn { background: #2ecc71; color: #fff; box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4); }
.call-decline-btn, .call-hangup-btn { background: #e74c3c; color: #fff; box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4); }

/* Active Call */
.call-screen-active { justify-content: space-between; padding: 0; }

.call-active-header {
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    z-index: 2;
}

.call-timer {
    font-size: 14px; color: rgba(255,255,255,0.6);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

/* Screen Share Zone (top) */
.call-screens-zone {
    width: 100%;
    display: none;
    gap: 4px;
    padding: 4px;
    overflow: hidden;
}
.call-screens-zone.has-screens {
    display: flex;
    flex: 1;
    min-height: 0;
}

.call-screen-share {
    position: relative;
    flex: 1;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    min-height: 0;
    cursor: pointer;
}
.call-screen-share:hover { outline: 2px solid rgba(255,255,255,0.3); }

.call-screen-video {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: #000;
}

.call-screen-label {
    position: absolute;
    top: 10px; left: 10px;
    font-size: 12px; color: #fff;
    background: rgba(0,0,0,0.7);
    padding: 4px 10px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    display: flex; align-items: center; gap: 6px;
}

/* Video Participants Zone (bottom) */
.call-videos-zone {
    flex: 1;
    width: 100%;
    display: flex;
    gap: 4px;
    padding: 4px;
    overflow: hidden;
    align-items: stretch;
    justify-content: center;
}
/* When screen shares are visible, make video zone compact (strip at bottom) */
.call-videos-zone.compact {
    flex: 0 0 auto;
    height: 160px;
    align-items: center;
    justify-content: center;
}

.call-participant {
    position: relative;
    flex: 1;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    min-height: 0;
    min-width: 0;
    cursor: pointer;
    animation: callParticipantIn 0.3s ease-out;
}
/* In compact mode, limit participant width to keep aspect ratio */
.call-videos-zone.compact .call-participant {
    flex: 0 1 auto;
    width: auto;
    height: 100%;
    aspect-ratio: 16 / 9;
    max-width: 300px;
}
.call-participant:hover { outline: 2px solid rgba(255,255,255,0.3); }

@keyframes callParticipantIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes callParticipantOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.8); } }

.call-video {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.call-participant-local .call-video { transform: scaleX(-1); }

.call-participant-avatar {
    display: flex; align-items: center; justify-content: center;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 2px solid rgba(255,255,255,0.1);
}
.call-videos-zone.compact .call-participant-avatar {
    width: 48px; height: 48px;
}
.call-participant-avatar .call-avatar-letter { font-size: 32px; }
.call-participant-avatar .call-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.call-videos-zone.compact .call-participant-avatar .call-avatar-letter { font-size: 20px; }

.call-participant-name {
    position: absolute;
    bottom: 8px; left: 10px;
    font-size: 12px; color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.call-participant-muted {
    position: absolute;
    top: 8px; right: 8px;
    width: 28px; height: 28px;
    background: rgba(231, 76, 60, 0.8);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}

/* Fullscreen Overlay */
.call-fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 10001;
    align-items: center; justify-content: center;
    cursor: pointer;
}
.call-fullscreen-overlay.active { display: flex; }

.call-fullscreen-video {
    width: 100%; height: 100%;
    object-fit: contain;
    background: #000;
}

.call-fullscreen-close {
    position: absolute;
    top: 20px; right: 24px;
    font-size: 14px; color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.6);
    padding: 6px 14px;
    border-radius: 8px;
    pointer-events: none;
}

/* Call Controls */
.call-controls {
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    z-index: 2;
}

.call-ctrl-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.call-ctrl-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.05); }
.call-ctrl-btn:active { transform: scale(0.95); }
.call-ctrl-btn.off { background: rgba(255, 255, 255, 0.12); color: rgba(255,255,255,0.4); }
.call-ctrl-btn.off:hover { background: rgba(231, 76, 60, 0.3); color: #e74c3c; }
.call-ctrl-btn.active { background: rgba(255, 255, 255, 0.25); color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.1); }
.call-hangup-ctrl { background: #e74c3c; }
.call-hangup-ctrl:hover { background: #c0392b; box-shadow: 0 4px 16px rgba(231,76,60,0.4); }

/* Minimize Button in Active Call Header */
.call-minimize-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.call-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.call-active-header { position: relative; }

/* PiP (minimized call widget) */
.call-pip {
    display: none;
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 3000;
    width: 320px;
    background: rgba(10, 10, 10, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    overflow: hidden;
    animation: callPipIn 0.3s ease-out;
    transition: box-shadow 0.2s;
}
.call-pip.active { display: block; }
.call-pip:hover { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.1); }

@keyframes callPipIn {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: none; }
}

.call-pip-drag {
    cursor: grab;
    user-select: none;
}
.call-pip-drag:active { cursor: grabbing; }

.call-pip-video-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background: #000;
    overflow: hidden;
}

.call-pip-video {
    width: 100%; height: 100%;
    object-fit: cover;
}

.call-pip-avatar {
    position: absolute; inset: 0;
    background: #111;
    display: flex;
    align-items: center; justify-content: center;
}
.call-pip-avatar .call-avatar-letter { font-size: 40px; color: #fff; font-weight: 700; }

.call-pip-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
}

.call-pip-enmaxed {
    display: flex; align-items: center; gap: 4px;
    font-size: 10px; color: #4ade80;
    font-weight: 600; letter-spacing: 1px;
}
.call-pip-enmaxed svg { stroke: #4ade80; }

.call-pip-timer {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.call-pip-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 14px 12px;
}

.call-pip-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}
.call-pip-btn:hover { transform: scale(1.1); }
.call-pip-btn:active { transform: scale(0.95); }

.call-pip-maximize {
    background: rgba(255, 255, 255, 0.12);
}
.call-pip-maximize:hover { background: rgba(255, 255, 255, 0.2); }

.call-pip-hangup {
    background: #e74c3c;
}
.call-pip-hangup:hover { background: #c0392b; box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .icon-rail { width: 48px; min-width: 48px; }
    .rail-label { display: none; }
    .sidebar { width: 280px; min-width: 280px; }
}
@media (max-width: 768px) {
    .icon-rail { display: none; }
    .sidebar { width: 100%; position: absolute; z-index: 100; }
    .chat-area { width: 100%; }
    .call-pip { width: 260px; bottom: 16px; right: 16px; }
    .call-pip-video-wrap { height: 146px; }
}
