:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --sidebar-width: 280px;
    --shadow: rgba(0, 0, 0, 0.15);
    --overlay: rgba(0, 0, 0, 0.5);
    --primary-alpha-06: rgba(37, 99, 235, 0.06);
    --primary-alpha-08: rgba(37, 99, 235, 0.08);
    --primary-alpha-10: rgba(37, 99, 235, 0.1);
    --primary-alpha-12: rgba(37, 99, 235, 0.12);
    --primary-alpha-15: rgba(37, 99, 235, 0.15);
    --primary-alpha-20: rgba(37, 99, 235, 0.2);
    --danger-alpha-08: rgba(220, 38, 38, 0.08);
    --danger-alpha-40: rgba(220, 38, 38, 0.4);
    --danger-alpha-00: rgba(220, 38, 38, 0);
    --success-alpha-06: rgba(22, 163, 106, 0.06);
    color-scheme: light;
}

html.dark {
    --primary: #60a5fa;
    --primary-hover: #93bbfd;
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
    --danger: #f87171;
    --danger-hover: #ef4444;
    --success: #4ade80;
    --shadow: rgba(0, 0, 0, 0.4);
    --overlay: rgba(0, 0, 0, 0.7);
    --primary-alpha-06: rgba(96, 165, 250, 0.1);
    --primary-alpha-08: rgba(96, 165, 250, 0.12);
    --primary-alpha-10: rgba(96, 165, 250, 0.15);
    --primary-alpha-12: rgba(96, 165, 250, 0.18);
    --primary-alpha-15: rgba(96, 165, 250, 0.2);
    --primary-alpha-20: rgba(96, 165, 250, 0.28);
    --danger-alpha-08: rgba(248, 113, 113, 0.12);
    --danger-alpha-40: rgba(248, 113, 113, 0.4);
    --danger-alpha-00: rgba(248, 113, 113, 0);
    --success-alpha-06: rgba(74, 222, 128, 0.1);
    color-scheme: dark;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 480px; margin: 80px auto; padding: 0 16px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
}

.card h1 { font-size: 24px; margin-bottom: 8px; }
.card p.subtitle { color: var(--text-muted); margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.form-group input {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 14px; outline: none;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-alpha-10); }
.form-group input {
    background: var(--surface);
    color: var(--text);
}

.btn {
    display: inline-block; padding: 10px 20px;
    background: var(--primary); color: white;
    border: none; border-radius: 6px;
    font-size: 14px; font-weight: 500;
    cursor: pointer; width: 100%;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-danger { background: var(--danger); }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; }
.success-msg { color: var(--success); font-size: 13px; margin-top: 8px; }

/* Layout */
.app-layout { display: flex; height: 100vh; }

.sidebar {
    width: var(--sidebar-width); background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 18px;
}

.sidebar-section { padding: 8px 0; }
.sidebar-section-title { padding: 8px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }

.sidebar-item {
    display: block; padding: 8px 16px; color: var(--text);
    font-size: 14px; cursor: pointer; text-decoration: none;
}
.sidebar-item:hover { background: var(--bg); text-decoration: none; }
.sidebar-item.active { background: var(--primary-alpha-08); color: var(--primary); font-weight: 500; }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.content-header {
    padding: 16px 24px; border-bottom: 1px solid var(--border);
    background: var(--surface); font-weight: 600; font-size: 16px;
}

.content-body { flex: 1; overflow-y: auto; padding: 24px; }

/* Messages */
.messages-container { flex: 1; overflow-y: auto; padding: 16px 24px; }

.message { margin-bottom: 16px; }
.message-header { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.message-sender { font-weight: 600; font-size: 14px; }
.message-time { font-size: 12px; color: var(--text-muted); }
.message-body { font-size: 14px; }
.message:hover .message-actions { opacity: 1 !important; }

.message-input-area {
    padding: 16px 24px; border-top: 1px solid var(--border);
    background: var(--surface); display: flex; gap: 8px;
}
.message-input-area input {
    flex: 1; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 14px; outline: none;
    background: var(--surface); color: var(--text);
}
.message-input-area button { padding: 10px 20px; background: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }

/* User info in sidebar */
.sidebar-footer {
    margin-top: auto; padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 13px; color: var(--text-muted);
}

/* Hamburger menu button - hidden on desktop */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 24px;
    padding: 8px 12px;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 1001;
}

/* Sidebar overlay - hidden by default */
.sidebar-overlay {
    display: none;
}

/* Touch-friendly: minimum 44px touch targets */
@media (pointer: coarse) {
    .btn, button, .sidebar-item, .record-btn, .load-more-btn,
    .reaction-badge, .add-reaction-btn, .emoji-picker-item,
    .reply-btn, .meeting-card {
        min-height: 44px;
        min-width: 44px;
    }
    .sidebar-item {
        padding: 12px 16px;
    }
    .form-group input, .message-input-area input, input, select, textarea {
        min-height: 44px;
        padding: 12px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    .message-input-area button {
        min-height: 44px;
        padding: 12px 20px;
    }
    a {
        padding: 4px 0;
    }
}

/* Smooth touch scrolling */
.sidebar, .messages-container, .content-body, .recordings-panel {
    -webkit-overflow-scrolling: touch;
}

/* Mobile responsive: tablet and below */
@media (max-width: 768px) {
    /* Hamburger visible */
    .hamburger-btn {
        display: flex;
    }

    /* Sidebar: collapsible, full-screen overlay on mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        background: var(--surface);
    }
    .sidebar.open {
        left: 0;
    }

    /* Sidebar overlay when open */
    .sidebar-overlay.active {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--overlay);
        z-index: 999;
    }

    /* Main content: full width */
    .main-content, .dashboard-content {
        margin-left: 0;
        padding: 0;
        width: 100%;
    }

    .content-header {
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .content-body {
        padding: 16px;
    }

    /* Messages: tighter spacing */
    .message {
        padding: 0.5rem 0;
    }
    .message-actions {
        opacity: 1 !important; /* Always visible on mobile (no hover) */
    }
    .add-reaction-btn {
        opacity: 1 !important; /* Always visible - no hover on touch */
    }

    .messages-container {
        padding: 12px 16px;
    }

    .message-input-area {
        padding: 12px 16px;
    }

    /* Calendar grid: smaller */
    .calendar-grid {
        font-size: 0.85rem;
    }
    .calendar-day {
        min-height: 40px;
        padding: 0.25rem;
    }

    /* Forms: full width */
    input, select, textarea, button {
        max-width: 100%;
    }

    /* Room header: stack elements */
    .room-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Meeting form: single column */
    .meeting-form {
        grid-template-columns: 1fr;
    }

    /* Contacts grid: single column */
    .contacts-list {
        grid-template-columns: 1fr;
    }

    /* Notification banner: stack on narrow screens */
    .notification-banner {
        flex-wrap: wrap;
        padding: 10px 16px;
    }

    /* Reply preview: tighter padding */
    .reply-preview {
        padding: 8px 16px;
    }

    /* Sidebar footer links */
    .sidebar-footer {
        padding: 12px 16px;
        text-align: center;
    }

    /* Emoji picker: reposition for mobile */
    .emoji-picker {
        left: auto;
        right: 0;
    }
}

/* Small mobile (phones in portrait) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .sidebar {
        width: 100%;
        left: -100%;
    }
    .room-header h2 {
        font-size: 1rem;
    }
    .content-header {
        font-size: 14px;
        padding: 10px 12px;
    }
    .content-body {
        padding: 12px;
    }
    .container {
        padding: 0 12px;
        margin: 40px auto;
    }
    .card {
        padding: 20px;
    }
    /* Notification dropdown: full width on small mobile */
    .notification-banner span {
        font-size: 12px;
    }
}

/* Reactions */
.reactions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    align-items: center;
}

.reaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    font-size: 13px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s;
}
.reaction-badge:hover {
    background: var(--border);
}
.reaction-badge.mine {
    border-color: var(--primary);
    background: var(--primary-alpha-10);
}
.reaction-badge.mine:hover {
    background: var(--primary-alpha-20);
}

.add-reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: 14px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}
.message:hover .add-reaction-btn {
    opacity: 1;
}
.add-reaction-btn:hover {
    background: var(--border);
    color: var(--text);
}

.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 100;
    white-space: nowrap;
}

.emoji-picker-item {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s;
}
.emoji-picker-item:hover {
    background: var(--bg);
}

/* Load more button */
.load-more-btn {
    display: inline-block;
    padding: 6px 18px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.load-more-btn:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--primary);
}
.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s;
}
.calendar-day:hover {
    background: var(--bg);
}
.calendar-day.selected {
    border-color: var(--primary);
    background: var(--primary-alpha-08);
    font-weight: 600;
}
.calendar-day.has-meeting {
    background: var(--success-alpha-06);
}
.calendar-day.has-meeting.selected {
    background: var(--primary-alpha-12);
}

.meeting-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 4px;
}

.meeting-form {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.meeting-card {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.meeting-card:hover {
    background: var(--bg);
    border-color: var(--primary);
}

/* Recording */
.record-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--danger);
    background: none;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.record-btn:hover {
    background: var(--danger-alpha-08);
}
.record-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.record-btn.recording {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    animation: record-pulse 1.5s ease-in-out infinite;
}
.record-btn.recording:hover {
    background: var(--danger-hover);
}

@keyframes record-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--danger-alpha-40); }
    50% { box-shadow: 0 0 0 6px var(--danger-alpha-00); }
}

.recording-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
}
.recording-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    animation: recording-blink 1s ease-in-out infinite;
}
@keyframes recording-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.recordings-panel {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    max-height: 250px;
    overflow-y: auto;
}

/* Reply */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    background: var(--primary-alpha-06);
    border-top: 1px solid var(--primary-alpha-15);
    border-left: 3px solid var(--primary);
    font-size: 13px;
    color: var(--text);
}

.reply-context {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    margin-bottom: 4px;
    border-left: 3px solid var(--border);
    background: var(--bg);
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    color: var(--text-muted);
}

.reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    transition: color 0.15s;
}
.reply-btn:hover {
    color: var(--primary);
}

/* Branding */
.branding-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.color-preview {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.branding-preview {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

/* ===== Call Layout: Gallery & Speaker Views ===== */

/* Gallery view: equal-size CSS grid that adapts to participant count */
.call-gallery {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* Speaker view container */
.call-speaker {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Speaker view: large active speaker area (~80% of space) */
.call-speaker-main {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-speaker-main .participant-tile {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Speaker view: horizontal thumbnail strip at bottom */
.call-speaker-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    flex-shrink: 0;
    height: 140px;
    -webkit-overflow-scrolling: touch;
}

.call-speaker-strip .participant-tile {
    width: 180px;
    min-width: 180px;
    height: 100%;
    flex-shrink: 0;
}

/* Participant tile shared styles */
.participant-tile {
    background: #1a1a2e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    transition: border 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

/* Active speaker highlight (green glow) */
.participant-tile.active-speaker {
    border-color: #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
}

/* Participant tile label */
.participant-tile .tile-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    color: #fff;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 4px;
}

/* View toggle button */
.view-toggle-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: #555;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
}
.view-toggle-btn:hover {
    background: #666;
}
.view-toggle-btn.active {
    background: #3498db;
}

/* Mobile adjustments for call layouts */
@media (max-width: 768px) {
    .call-gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 8px;
        padding: 8px;
    }
    .call-gallery .participant-tile {
        min-height: 140px;
    }
    .call-speaker {
        padding: 8px;
        gap: 8px;
    }
    .call-speaker-strip {
        height: 100px;
    }
    .call-speaker-strip .participant-tile {
        width: 130px;
        min-width: 130px;
    }
}

@media (max-width: 480px) {
    .call-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
        padding: 6px;
    }
    .call-gallery .participant-tile {
        min-height: 100px;
    }
    .call-speaker-strip {
        height: 80px;
    }
    .call-speaker-strip .participant-tile {
        width: 100px;
        min-width: 100px;
    }
}

/* Notification banner */
.notification-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 24px;
    background: var(--primary-alpha-06);
    border-bottom: 1px solid var(--primary-alpha-15);
    font-size: 13px;
    color: var(--text);
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}
.theme-toggle:hover {
    background: var(--bg);
    border-color: var(--primary);
}

/* Dark mode input overrides */
html.dark input,
html.dark select,
html.dark textarea {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
html.dark input::placeholder,
html.dark textarea::placeholder {
    color: var(--text-muted);
}

/* Smooth transitions for theme switching */
body,
.sidebar,
.content-header,
.message-input-area,
.card,
.emoji-picker,
.meeting-form,
.recordings-panel,
.reply-preview,
.notification-banner {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ========================================
   Accessibility: WCAG 2.1 AA Compliance
   ======================================== */

/* Visually hidden: content accessible to screen readers only */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-content link: visible only on focus */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 12px 24px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-to-content:focus {
    top: 0;
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

/* Focus indicators: visible outlines on :focus-visible for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.sidebar-item:focus-visible,
.calendar-day:focus-visible,
.meeting-card:focus-visible,
.reaction-badge:focus-visible,
.add-reaction-btn:focus-visible,
.emoji-picker-item:focus-visible,
.record-btn:focus-visible,
.reply-btn:focus-visible,
.load-more-btn:focus-visible,
.hamburger-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High-contrast focus for dark backgrounds (call page controls) */
.call-controls button:focus-visible,
.participant-tile button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Live region for dynamic announcements (screen readers) */
.sr-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Keyboard Shortcut Hints & Help Overlay
   ======================================== */

/* Wrapper for call control button + shortcut hint */
.call-control-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Small shortcut hint label below toolbar buttons */
.shortcut-hint {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    padding: 1px 6px;
    line-height: 1.4;
    letter-spacing: 0.5px;
    pointer-events: none;
    user-select: none;
}

/* Hand raised indicator bar */
.hand-raised-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(243, 156, 18, 0.15);
    border-top: 1px solid rgba(243, 156, 18, 0.3);
    color: #f39c12;
    font-size: 13px;
    font-weight: 600;
}

/* Shortcuts help overlay (backdrop) */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Shortcuts help panel */
.shortcuts-panel {
    background: #1a1a2e;
    border: 1px solid #3a3a4e;
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.shortcuts-header h3 {
    color: #eee;
    font-size: 16px;
    margin: 0;
}

.shortcuts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shortcuts-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ccc;
    font-size: 14px;
}

.shortcuts-list li:last-child {
    border-bottom: none;
}

.shortcuts-list kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.shortcuts-note {
    margin: 16px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* Hide shortcut hints on mobile (no physical keyboard) */
@media (max-width: 768px) {
    .shortcut-hint {
        display: none;
    }
}

/* ========================================
   Noise Suppression Toggle
   ======================================== */

.noise-suppression-toggle {
    position: relative;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.noise-suppression-toggle:hover {
    opacity: 0.9;
}

/* Subtle glow when active to indicate processing is running */
.noise-suppression-toggle[style*="background: #1abc9c"] {
    box-shadow: 0 0 8px rgba(26, 188, 156, 0.4);
}

/* ========================================
   Picture-in-Picture Toggle
   ======================================== */

.pip-toggle-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: #555;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.pip-toggle-btn:hover {
    background: #666;
}

/* Highlighted state when PiP is active */
.pip-toggle-btn.pip-active {
    background: #9b59b6;
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.4);
}

.pip-toggle-btn.pip-active:hover {
    background: #8e44ad;
}

/* ========================================
   Screen Share Controls & Audio Option
   ======================================== */

.screen-share-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.share-audio-option {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.share-audio-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: #3498db;
}

.share-audio-option span {
    line-height: 1;
}

.share-audio-option:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* Mobile: hide share audio label on very small screens */
@media (max-width: 480px) {
    .share-audio-option span {
        display: none;
    }
    .share-audio-option {
        gap: 0;
    }
}

/* ========================================
   Onboarding Modal (Issue #69)
   ======================================== */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 16px;
}

.onboarding-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px var(--shadow);
    outline: none;
    animation: onboarding-fade-in 0.25s ease;
}

@keyframes onboarding-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.onboarding-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.onboarding-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.onboarding-step-indicator {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 16px;
}

.onboarding-step {
    min-height: 120px;
    display: flex;
    align-items: center;
}

.onboarding-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.onboarding-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.onboarding-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    gap: 8px;
}

.onboarding-nav-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.onboarding-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s;
    min-height: 44px;
}

.onboarding-btn-next {
    background: var(--primary);
    color: #ffffff;
}
.onboarding-btn-next:hover {
    background: var(--primary-hover);
}

.onboarding-btn-back {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.onboarding-btn-back:hover {
    background: var(--border);
}

.onboarding-btn-skip {
    background: none;
    color: var(--text-muted);
    padding: 10px 12px;
}
.onboarding-btn-skip:hover {
    color: var(--text);
}

/* Focus styles within onboarding modal */
.onboarding-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========================================
   Drag-and-Drop File Upload (Issue #69)
   ======================================== */

.drop-zone-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drop-zone-overlay.drop-zone-active {
    display: flex;
    background: var(--primary-alpha-10);
    border: 3px dashed var(--primary);
    border-radius: 8px;
    pointer-events: none;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.drop-zone-icon {
    font-size: 36px;
}

/* Upload progress bar */
.upload-progress-bar {
    padding: 8px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.upload-progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    gap: 12px;
}

.upload-filename {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-status {
    flex-shrink: 0;
    font-weight: 500;
}

/* ========================================
   Mobile Responsive Improvements (Issue #69)
   ======================================== */

/* Landscape orientation: video grid wider tiles */
@media (orientation: landscape) and (max-width: 1024px) {
    .call-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 8px;
        padding: 8px;
    }
    .call-speaker {
        flex-direction: row;
    }
    .call-speaker-strip {
        flex-direction: column;
        width: 140px;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .call-speaker-strip .participant-tile {
        width: 100%;
        min-width: unset;
        height: 100px;
    }
}

/* Ensure call toolbar buttons are touch-friendly on mobile */
@media (max-width: 768px) {
    .call-controls button,
    .call-control-btn-wrap button,
    .view-toggle-btn,
    .record-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 10px 14px;
        font-size: 16px;
    }

    /* No horizontal scroll anywhere */
    body, .app-layout, .main-content {
        overflow-x: hidden;
    }

    /* Ensure video grid adapts to portrait */
    .call-gallery {
        grid-template-columns: 1fr 1fr;
    }

    /* Stack call controls on very small widths */
    .call-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    /* Onboarding modal: full width on mobile */
    .onboarding-modal {
        max-width: 100%;
        padding: 24px 20px;
        border-radius: 8px;
    }
    .onboarding-title {
        font-size: 18px;
    }
}

@media (max-height: 900px) {
    /* Compact pre-join for medium-height viewports (e.g., MacBook Air 1440x900) */
    .prejoin-screen {
        gap: 12px;
        padding: 16px 24px;
    }
    .prejoin-preview-container {
        height: 180px;
    }
}

@media (max-width: 480px) {
    /* Single column video grid on small phones */
    .call-gallery {
        grid-template-columns: 1fr;
    }

    /* Stack call toolbar controls vertically if many buttons */
    .call-control-btn-wrap {
        gap: 2px;
    }

    /* Compact onboarding on small screens */
    .onboarding-modal {
        padding: 20px 16px;
    }
    .onboarding-step {
        min-height: 80px;
    }
    .onboarding-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Compact pre-join on small screens */
    .prejoin-screen {
        padding: 20px 16px;
    }
    .prejoin-preview-container {
        height: 150px;
    }
}

/* ========================================
   Pre-join Device Selection (Issue #63)
   ======================================== */

.prejoin-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

.prejoin-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.prejoin-room-label {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.prejoin-preview-container {
    width: 100%;
    max-width: 480px;
    height: 200px;
    background: var(--bg-tertiary, #1a1a2e);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.prejoin-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.prejoin-no-camera {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
}

.prejoin-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prejoin-no-camera-text {
    font-size: 14px;
}

.prejoin-meter-section {
    width: 100%;
    max-width: 480px;
}

.prejoin-meter-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.mic-level-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.mic-level-bar {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 4px;
    transition: width 0.08s ease-out;
    min-width: 0;
}

.prejoin-controls {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prejoin-device-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prejoin-device-row label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.prejoin-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.prejoin-select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.prejoin-test-speaker-btn {
    margin-top: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-start;
}

.prejoin-test-speaker-btn:hover {
    background: var(--bg-tertiary, #2d2d44);
}

.prejoin-test-speaker-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.prejoin-join-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    background: var(--primary, #5865f2);
    color: white;
    transition: background 0.2s;
}

.prejoin-join-btn:hover {
    background: #27ae60;
}

.prejoin-join-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prejoin-back-link {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
}

.prejoin-back-link:hover {
    text-decoration: underline;
}

.prejoin-permission-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    padding: 16px;
    color: #e74c3c;
    width: 100%;
    max-width: 480px;
}

.prejoin-permission-hint {
    font-size: 13px;
    margin-top: 8px;
    color: var(--text-muted);
}

/* ========================================
   Network Quality Indicator (Issue #67)
   ======================================== */

.network-quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}

.quality-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.quality-good {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}
.quality-good .quality-dot {
    background: #2ecc71;
    box-shadow: 0 0 4px rgba(46, 204, 113, 0.5);
}

.quality-fair {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
}
.quality-fair .quality-dot {
    background: #f1c40f;
    box-shadow: 0 0 4px rgba(241, 196, 15, 0.5);
}

.quality-poor {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}
.quality-poor .quality-dot {
    background: #e74c3c;
    box-shadow: 0 0 4px rgba(231, 76, 60, 0.5);
}

.quality-downgraded-hint {
    font-size: 11px;
    opacity: 0.8;
}

.video-quality-selector {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
    cursor: pointer;
}

.video-quality-selector:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* ========================================
   Background Effects (Issue #60)
   ======================================== */

/* Toolbar button for background effects */
.bg-effects-btn {
    position: relative;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.bg-effects-btn:hover {
    opacity: 0.9;
}

/* Subtle glow when background effect is active */
.bg-effects-btn[style*="background: #e67e22"] {
    box-shadow: 0 0 8px rgba(230, 126, 34, 0.4);
}

/* Floating panel that appears above the background effects button */
.bg-effects-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid #3a3a4e;
    border-radius: 12px;
    padding: 12px;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 200;
    animation: bg-panel-fade-in 0.15s ease;
}

@keyframes bg-panel-fade-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.bg-effects-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #eee;
    font-size: 13px;
    font-weight: 600;
}

/* Grid of effect option buttons */
.bg-effects-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* Individual effect option button */
.bg-effect-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.bg-effect-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Highlighted state for the currently selected effect */
.bg-effect-option.bg-effect-active {
    border-color: #e67e22;
    background: rgba(230, 126, 34, 0.15);
}

/* Small preview thumbnail for each effect */
.bg-effect-thumbnail {
    width: 48px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
}

/* "Off" thumbnail — transparent look */
.bg-effect-none-thumb {
    background: rgba(255, 255, 255, 0.08);
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* Blur thumbnails — visual hint of blur effect */
.bg-effect-blur-light-thumb {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.bg-effect-blur-heavy-thumb {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Label text below the thumbnail */
.bg-effect-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
    text-align: center;
}

.bg-effect-option.bg-effect-active .bg-effect-label {
    color: #e67e22;
    font-weight: 600;
}

/* Focus styles for background effect buttons */
.bg-effect-option:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Mobile: 3 columns instead of 4 on small screens */
@media (max-width: 480px) {
    .bg-effects-panel {
        min-width: 220px;
        padding: 10px;
    }
    .bg-effects-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .bg-effect-thumbnail {
        width: 40px;
        height: 30px;
    }
}

/* Position panel above toolbar on landscape mobile */
@media (orientation: landscape) and (max-width: 1024px) {
    .bg-effects-panel {
        bottom: calc(100% + 8px);
    }
}

/* ============================================
   Polls & Voting System (Issue #74)
   ============================================ */

.poll-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -4px 0 16px var(--shadow);
    overflow-y: auto;
}

.poll-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.poll-create-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.poll-create-btn:hover {
    background: var(--primary-hover);
}

.poll-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Poll card */
.poll-card {
    margin: 8px 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: box-shadow 0.15s;
}

.poll-card:hover {
    box-shadow: 0 2px 8px var(--shadow);
}

.poll-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.poll-question {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.poll-type-badge {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--primary-alpha-10);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Poll choices */
.poll-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.poll-choice {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.poll-choice-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    padding: 4px 0;
}

.poll-choice-label input[type="radio"],
.poll-choice-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.poll-choice-text {
    font-size: 13px;
    color: var(--text);
}

/* Poll result bar chart */
.poll-bar {
    position: relative;
    height: 22px;
    background: var(--primary-alpha-06);
    border-radius: 4px;
    overflow: hidden;
}

.poll-bar-fill {
    height: 100%;
    background: var(--primary);
    opacity: 0.25;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 0;
}

.poll-bar-label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}

/* Vote button */
.poll-vote-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.15s;
}

.poll-vote-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.poll-vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Poll card footer */
.poll-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.poll-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.poll-status-open {
    color: var(--success);
    background: var(--success-alpha-06);
}

.poll-status-closed {
    color: var(--danger);
    background: var(--danger-alpha-08);
}

.poll-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.poll-action-btn {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.poll-action-btn:hover {
    background: var(--primary-alpha-06);
    color: var(--primary);
    border-color: var(--primary);
}

.poll-action-delete:hover {
    background: var(--danger-alpha-08);
    color: var(--danger);
    border-color: var(--danger);
}

/* Poll create form */
.poll-create-form {
    padding: 14px;
    margin: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.poll-form-field {
    margin-bottom: 12px;
}

.poll-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poll-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.poll-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha-15);
}

.poll-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.poll-add-choice {
    padding: 4px 10px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s;
}

.poll-add-choice:hover {
    background: var(--primary-alpha-06);
}

.poll-remove-choice {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--danger);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.poll-remove-choice:hover {
    background: var(--danger-alpha-08);
}

.poll-form-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.poll-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px !important;
    color: var(--text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    white-space: nowrap;
}

.poll-checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.poll-submit-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.poll-submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.poll-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile responsiveness for poll panel */
@media (max-width: 480px) {
    .poll-panel {
        width: 100vw;
    }

    .poll-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

/* ========================================
   Channel Categories & Organisation (#77)
   ======================================== */

/* Category container */
.channel-category {
    margin-bottom: 2px;
}

/* Collapsible category header */
.category-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s, background 0.15s;
}

.category-header:hover {
    color: var(--text);
    background: var(--bg);
}

/* Expand/collapse indicator via ::before pseudo-element */
.category-header::before {
    content: "\25BE"; /* down-pointing triangle */
    display: inline-block;
    font-size: 10px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    width: 12px;
    text-align: center;
}

/* Rotated icon when collapsed */
.category-header.collapsed::before {
    transform: rotate(-90deg);
}

/* Channel list within a category */
.category-channels {
    animation: category-expand 0.15s ease;
}

@keyframes category-expand {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

/* Drag handle indicator */
.drag-handle {
    opacity: 0;
    transition: opacity 0.15s;
    cursor: grab;
}

.sidebar-item:hover .drag-handle {
    opacity: 0.6;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Drop target highlight */
.drop-zone {
    transition: background 0.15s, border-color 0.15s;
    border: 2px solid transparent;
    border-radius: 4px;
}

.drop-zone.active {
    background: var(--primary-alpha-10);
    border-color: var(--primary);
}

/* Focus-visible for category headers */
.category-header:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   Raise Hand & Hand Queue (Issue #76)
   ============================================ */

/* Raise hand toolbar button */
.raise-hand-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: #555;
    color: white;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.raise-hand-btn:hover {
    background: #666;
}

.raise-hand-btn.active {
    background: #f39c12;
    color: white;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.4);
}

.raise-hand-btn.active:hover {
    background: #e67e22;
}

/* Hand icon overlay on participant video tile */
.hand-icon-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(243, 156, 18, 0.9);
    color: white;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: hand-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes hand-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(243, 156, 18, 0); }
}

/* Hand queue sidebar panel (host view) */
.hand-queue-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    max-width: 100vw;
    background: #1a1a2e;
    border-left: 1px solid #3a3a4e;
    display: flex;
    flex-direction: column;
    z-index: 150;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
}

.hand-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #3a3a4e;
}

.hand-queue-title {
    color: #eee;
    font-size: 15px;
    font-weight: 600;
}

.hand-queue-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
}

.hand-queue-close:hover {
    color: #ccc;
}

.hand-queue-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.hand-queue-empty {
    color: #666;
    font-size: 13px;
    text-align: center;
    padding: 24px 16px;
}

.hand-queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hand-queue-item:last-child {
    border-bottom: none;
}

.hand-queue-name {
    color: #ccc;
    font-size: 14px;
}

.hand-queue-dismiss-btn {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.hand-queue-dismiss-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
}

.hand-queue-footer {
    padding: 12px 16px;
    border-top: 1px solid #3a3a4e;
}

.hand-queue-lower-all-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #e74c3c;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.hand-queue-lower-all-btn:hover {
    background: #c0392b;
}

/* Mobile: full-width hand queue */
@media (max-width: 480px) {
    .hand-queue-panel {
        width: 100vw;
    }
}

/* ============================================
   Live Captions & Transcript (Issue #76)
   ============================================ */

/* Caption toggle toolbar button */
.caption-toggle-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: #555;
    color: white;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.caption-toggle-btn:hover {
    background: #666;
}

.caption-toggle-btn.active {
    background: #2ecc71;
    color: white;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.caption-toggle-btn.active:hover {
    background: #27ae60;
}

.caption-toggle-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Caption overlay at bottom of call */
.caption-overlay {
    position: relative;
    background: rgba(0, 0, 0, 0.75);
    padding: 12px 20px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.caption-lines {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Individual caption line */
.caption-line {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 2px 0;
    font-size: 15px;
    line-height: 1.4;
    color: #fff;
    transition: opacity 0.3s ease;
}

/* Interim (in-progress) caption styling */
.caption-line.caption-interim {
    opacity: 0.6;
    font-style: italic;
}

/* Speaker name label */
.caption-speaker {
    color: #f39c12;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    white-space: nowrap;
}

.caption-text {
    color: #fff;
}

/* Save transcript button */
.transcript-save-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    align-self: flex-end;
}

.transcript-save-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.35);
}

/* Mobile: tighter caption overlay */
@media (max-width: 768px) {
    .caption-overlay {
        padding: 8px 12px;
    }
    .caption-line {
        font-size: 13px;
    }
    .caption-speaker {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .caption-line {
        font-size: 12px;
        flex-wrap: wrap;
    }
}

/* ============================================
   Whiteboard (Issue #73)
   ============================================ */

.whiteboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.85);
}

.whiteboard-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #1a1a2e;
    border-bottom: 1px solid #3a3a4e;
    flex-wrap: wrap;
    z-index: 1110;
}

.whiteboard-tool-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #555;
    background: #2a2a3e;
    color: #ddd;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s;
}

.whiteboard-tool-btn:hover {
    background: #3a3a5e;
}

.whiteboard-tool-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.whiteboard-color-picker {
    display: flex;
    align-items: center;
    gap: 4px;
}

.whiteboard-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #555;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s, transform 0.1s;
}

.whiteboard-color-swatch:hover {
    transform: scale(1.15);
}

.whiteboard-color-swatch.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--primary);
}

.whiteboard-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.whiteboard-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.whiteboard-export-btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #3a7;
    background: #1a4a2e;
    color: #8fd;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
}

.whiteboard-export-btn:hover {
    background: #2a6a3e;
}

.whiteboard-text-input {
    position: absolute;
    z-index: 1120;
    background: var(--surface);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 16px var(--shadow);
}

.whiteboard-text-input textarea {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--primary);
    font-family: inherit;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .whiteboard-toolbar {
        padding: 6px 8px;
        gap: 6px;
    }
    .whiteboard-tool-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    .whiteboard-color-swatch {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   Polls & Voting System (Issue #74)
   ============================================ */

.poll-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -4px 0 16px var(--shadow);
    overflow-y: auto;
}

.poll-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.poll-create-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.poll-create-btn:hover {
    background: var(--primary-hover);
}

.poll-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.poll-card {
    margin: 8px 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: box-shadow 0.15s;
}

.poll-card:hover {
    box-shadow: 0 2px 8px var(--shadow);
}

.poll-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.poll-question {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.poll-type-badge {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--primary-alpha-10);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.poll-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.poll-choice {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.poll-choice-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    padding: 4px 0;
}

.poll-choice-label input[type="radio"],
.poll-choice-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.poll-choice-text {
    font-size: 13px;
    color: var(--text);
}

.poll-bar {
    position: relative;
    height: 22px;
    background: var(--primary-alpha-06);
    border-radius: 4px;
    overflow: hidden;
}

.poll-bar-fill {
    height: 100%;
    background: var(--primary);
    opacity: 0.25;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 0;
}

.poll-bar-label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}

.poll-vote-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.15s;
}

.poll-vote-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.poll-vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.poll-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.poll-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.poll-status-open {
    color: var(--success);
    background: var(--success-alpha-06);
}

.poll-status-closed {
    color: var(--danger);
    background: var(--danger-alpha-08);
}

.poll-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.poll-action-btn {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.poll-action-btn:hover {
    background: var(--primary-alpha-06);
    color: var(--primary);
    border-color: var(--primary);
}

.poll-action-delete:hover {
    background: var(--danger-alpha-08);
    color: var(--danger);
    border-color: var(--danger);
}

.poll-create-form {
    padding: 14px;
    margin: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.poll-form-field {
    margin-bottom: 12px;
}

.poll-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.poll-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.poll-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha-15);
}

.poll-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.poll-add-choice {
    padding: 4px 10px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s;
}

.poll-add-choice:hover {
    background: var(--primary-alpha-06);
}

.poll-remove-choice {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--danger);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.poll-remove-choice:hover {
    background: var(--danger-alpha-08);
}

.poll-form-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.poll-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px !important;
    color: var(--text) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    white-space: nowrap;
}

.poll-checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.poll-submit-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.poll-submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.poll-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .poll-panel {
        width: 100vw;
    }

    .poll-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

/* ============================================
   Pinned Messages, Bookmarks & Read Receipts
   (Issue #78)
   ============================================ */

/* Pinned messages panel */
.pinned-messages-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -4px 0 16px var(--shadow);
    overflow-y: auto;
}

.pinned-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.pinned-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.pinned-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 12px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: box-shadow 0.15s;
}

.pinned-item:hover {
    box-shadow: 0 2px 8px var(--shadow);
}

.pinned-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.pinned-item-msg-id {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pinned-item-time {
    font-size: 11px;
    color: var(--text-muted);
}

.pinned-unpin-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
    transition: all 0.15s;
}

.pinned-unpin-btn:hover {
    background: var(--danger-alpha-08);
    color: var(--danger);
    border-color: var(--danger);
}

/* Bookmarks panel */
.bookmarks-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -4px 0 16px var(--shadow);
    overflow-y: auto;
}

.bookmarks-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.bookmarks-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.bookmark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 12px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: box-shadow 0.15s;
}

.bookmark-item:hover {
    box-shadow: 0 2px 8px var(--shadow);
}

.bookmark-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.bookmark-item-msg-id {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-item-channel {
    font-size: 11px;
    color: var(--primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-item-time {
    font-size: 11px;
    color: var(--text-muted);
}

.bookmark-remove-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
    transition: all 0.15s;
}

.bookmark-remove-btn:hover {
    background: var(--danger-alpha-08);
    color: var(--danger);
    border-color: var(--danger);
}

/* Read receipt avatars */
.read-receipt-avatars {
    display: inline-flex;
    align-items: center;
}

.read-receipt-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.read-receipt-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-alpha-15);
    color: var(--primary);
    font-size: 9px;
    font-weight: 700;
    border: 2px solid var(--surface);
    margin-left: -6px;
    cursor: default;
    transition: transform 0.15s;
}

.read-receipt-avatar:first-child {
    margin-left: 0;
}

.read-receipt-avatar:hover {
    transform: scale(1.15);
    z-index: 1;
}

/* Mobile responsiveness for pins & bookmarks */
@media (max-width: 480px) {
    .pinned-messages-panel,
    .bookmarks-panel {
        width: 100vw;
    }
}

/* ============================================
   Custom Emoji Manager & Picker (Issue #79)
   ============================================ */

/* Emoji Manager panel */
.emoji-manager {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.emoji-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.emoji-counter {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--primary-alpha-10);
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Upload form */
.emoji-upload-form {
    padding: 14px;
    margin: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.emoji-form-field {
    margin-bottom: 12px;
}

.emoji-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emoji-shortcode-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.emoji-shortcode-prefix,
.emoji-shortcode-suffix {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
    user-select: none;
}

.emoji-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.emoji-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha-15);
}

.emoji-shortcode-preview {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.emoji-file-input {
    width: 100%;
    font-size: 13px;
    color: var(--text);
    padding: 6px 0;
}

.emoji-upload-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.emoji-upload-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.emoji-upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Emoji grid */
.emoji-grid-section {
    padding: 8px 0;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    padding: 8px 12px;
}

.emoji-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    position: relative;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.emoji-grid-item:hover {
    box-shadow: 0 2px 8px var(--shadow);
    border-color: var(--primary-alpha-20);
}

.emoji-grid-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    image-rendering: pixelated;
}

.emoji-grid-shortcode {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.emoji-grid-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.emoji-grid-item:hover .emoji-grid-delete {
    opacity: 1;
}

.emoji-grid-delete:hover {
    background: var(--danger-alpha-08);
    color: var(--danger);
    border-color: var(--danger);
}

/* Emoji picker (compact inline picker) */
.emoji-picker-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    min-width: 200px;
    max-width: 320px;
}

.emoji-picker-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.emoji-picker-empty {
    padding: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
}

.emoji-picker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 4px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s;
}

.emoji-picker-btn:hover {
    background: var(--primary-alpha-10);
}

.emoji-picker-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
}

/* Focus-visible for emoji components */
.emoji-upload-btn:focus-visible,
.emoji-grid-delete:focus-visible,
.emoji-picker-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Mobile: adjust emoji grid */
@media (max-width: 480px) {
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }

    .emoji-grid-img {
        width: 36px;
        height: 36px;
    }

    .emoji-grid-delete {
        opacity: 1;
    }

    .emoji-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    }

    .emoji-picker-btn {
        width: 36px;
        height: 36px;
    }

    .emoji-picker-img {
        width: 28px;
        height: 28px;
    }
}

/* ============================================
   Meeting Notes (Issue #80)
   ============================================ */

/* Notes panel: fixed right sidebar, matching poll-panel pattern */
.notes-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -4px 0 16px var(--shadow);
}

.notes-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

/* Sync status indicator */
.notes-sync-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.notes-sync-saved {
    color: var(--success);
    background: var(--success-alpha-06);
}

.notes-sync-syncing {
    color: var(--primary);
    background: var(--primary-alpha-10);
}

.notes-sync-conflict {
    color: var(--danger);
    background: var(--danger-alpha-08);
}

/* Action buttons in header */
.notes-action-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.notes-action-btn:hover {
    background: var(--primary-alpha-06);
    color: var(--primary);
    border-color: var(--primary);
}

.notes-export-btn:hover {
    background: var(--success-alpha-06);
    color: var(--success);
    border-color: var(--success);
}

/* Editor container */
.notes-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Markdown textarea */
.notes-textarea {
    flex: 1;
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.notes-textarea:focus {
    background: var(--bg);
}

.notes-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Action items summary */
.notes-action-items {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: var(--bg);
    max-height: 200px;
    overflow-y: auto;
    flex-shrink: 0;
}

.notes-action-items-header {
    margin-bottom: 8px;
}

.notes-action-items-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notes-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    font-size: 13px;
    color: var(--text);
    border-radius: 4px;
    transition: background 0.15s;
}

.notes-action-item:hover {
    background: var(--primary-alpha-06);
}

.notes-action-done {
    opacity: 0.6;
    text-decoration: line-through;
}

.notes-action-check {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.notes-action-assignee {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

.notes-action-desc {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-action-due {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--primary-alpha-06);
    padding: 1px 6px;
    border-radius: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* History container */
.notes-history-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-history-split {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.notes-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 12px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: box-shadow 0.15s;
}

.notes-history-item:hover {
    box-shadow: 0 2px 8px var(--shadow);
}

.notes-history-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    cursor: pointer;
}

.notes-history-version {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.notes-history-date {
    font-size: 11px;
    color: var(--text-muted);
}

.notes-history-snippet {
    font-size: 12px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
    opacity: 0.7;
}

.notes-history-restore-btn {
    padding: 4px 12px;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 8px;
    transition: all 0.15s;
}

.notes-history-restore-btn:hover {
    background: var(--primary);
    color: white;
}

/* History preview pane */
.notes-history-preview {
    border-top: 1px solid var(--border);
    max-height: 250px;
    overflow-y: auto;
    padding: 12px 16px;
    background: var(--bg);
    flex-shrink: 0;
}

.notes-history-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notes-history-preview-content {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* Focus-visible for notes components */
.notes-action-btn:focus-visible,
.notes-history-restore-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Mobile responsiveness for notes panel */
@media (max-width: 768px) {
    .notes-panel {
        width: 100vw;
    }

    .notes-history-snippet {
        max-width: 160px;
    }
}

@media (max-width: 480px) {
    .notes-panel-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .notes-textarea {
        font-size: 14px; /* Prevents iOS zoom */
    }
}

/* ============================================================
   CategoryManager - Admin panel for managing channel categories
   ============================================================ */

.category-manager {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.category-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.category-counter {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--primary-alpha-10);
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Category list */
.category-list-section {
    padding: 8px 0;
}

.category-items {
    padding: 0;
}

.category-item {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item:hover {
    background: var(--primary-alpha-06);
}

.category-item-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    padding: 4px 0;
    border-radius: 4px;
    transition: background 0.15s;
}

.category-item-name:hover {
    background: var(--primary-alpha-10);
    padding-left: 6px;
}

.category-item-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.category-item-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    opacity: 0;
}

.category-item:hover .category-item-delete-btn {
    opacity: 1;
}

.category-item-delete-btn:hover {
    color: var(--danger);
    background: var(--danger-alpha-08);
}

/* Inline edit mode */
.category-item-edit {
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-item-confirm {
    padding: 4px 0;
}

.category-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.category-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha-15);
}

.category-save-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.category-save-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.category-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.category-cancel-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.category-cancel-btn:hover {
    background: var(--bg);
}

.category-delete-confirm-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--danger);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.category-delete-confirm-btn:hover:not(:disabled) {
    background: var(--danger-hover);
}

.category-delete-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Create form */
.category-create-form {
    padding: 14px;
    margin: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.category-create-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.category-create-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.category-create-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Channel-to-category assignment */
.category-assign-section {
    padding: 14px;
    margin: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.category-assign-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-assign-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.category-assign-row:last-child {
    border-bottom: none;
}

.category-assign-channel {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-assign-select {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    min-width: 130px;
}

.category-assign-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha-15);
}

/* ============================================================
   Drag-and-drop visual feedback
   ============================================================ */

.channel-category.drag-over {
    background: var(--primary-alpha-10);
    border-left: 3px solid var(--primary);
    transition: background 0.15s, border-color 0.15s;
}

.channel-category.drag-over .category-header {
    color: var(--primary);
}

/* Dragging channel highlight */
.sidebar-item[draggable="true"] {
    transition: opacity 0.15s;
}

.sidebar-item[draggable="true"]:active {
    opacity: 0.5;
}

/* Category dragging */
.channel-category[draggable="true"] {
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
    cursor: grab;
}

.channel-category[draggable="true"]:active {
    opacity: 0.6;
    cursor: grabbing;
}

/* Responsive: category manager */
@media (max-width: 768px) {
    .category-manager {
        border-radius: 8px;
    }

    .category-assign-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .category-assign-select {
        width: 100%;
    }
}

/* ========================================
   Enterprise UI Overhaul
   ======================================== */

/* Sidebar-specific dark theme (always dark regardless of light/dark mode) */
.sidebar {
    --sidebar-bg: #1e1f22;
    --sidebar-text: #b5bac1;
    --sidebar-text-bright: #f2f3f5;
    --sidebar-hover: #2b2d31;
    --sidebar-active: #404249;
    --sidebar-section-text: #949ba4;
    --sidebar-border: #2b2d31;
    --sidebar-header-bg: #1e1f22;

    background: var(--sidebar-bg) !important;
    border-right: none !important;
    color: var(--sidebar-text);
}

.sidebar-header {
    background: var(--sidebar-header-bg) !important;
    border-bottom: 1px solid var(--sidebar-border) !important;
    color: var(--sidebar-text-bright) !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    height: 48px;
    display: flex !important;
    align-items: center !important;
}

.sidebar-section-title {
    color: var(--sidebar-section-text) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    text-transform: uppercase !important;
    padding: 16px 12px 4px 12px !important;
}

.sidebar-item {
    color: var(--sidebar-text) !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    margin: 1px 8px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: background 0.1s, color 0.1s;
}
.sidebar-item:hover {
    background: var(--sidebar-hover) !important;
    color: var(--sidebar-text-bright) !important;
    text-decoration: none !important;
}
.sidebar-item.active {
    background: var(--sidebar-active) !important;
    color: #fff !important;
}

.sidebar-footer {
    background: #1a1b1e !important;
    border-top: 1px solid var(--sidebar-border) !important;
    color: var(--sidebar-text) !important;
    padding: 8px 12px !important;
}

/* User profile strip at bottom of sidebar */
.user-profile-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #1a1b1e;
    border-top: 1px solid #2b2d31;
    margin-top: auto;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
    position: relative;
}

.user-avatar.size-sm { width: 24px; height: 24px; font-size: 10px; }
.user-avatar.size-md { width: 32px; height: 32px; font-size: 13px; }
.user-avatar.size-lg { width: 40px; height: 40px; font-size: 15px; }

.user-avatar .presence-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #1a1b1e;
}
.presence-dot.online { background: #23a55a; }
.presence-dot.away { background: #f0b232; }
.presence-dot.offline { background: #80848e; }

.user-profile-info {
    flex: 1;
    min-width: 0;
}
.user-profile-name {
    font-size: 13px;
    font-weight: 600;
    color: #f2f3f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-profile-status {
    font-size: 11px;
    color: #949ba4;
}
.user-profile-strip .settings-btn {
    background: none;
    border: none;
    color: #b5bac1;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    transition: color 0.1s, background 0.1s;
}
.user-profile-strip .settings-btn:hover {
    color: #f2f3f5;
    background: #404249;
}

/* Sidebar navigation items */
.sidebar-nav {
    padding: 8px 8px 4px;
    border-bottom: 1px solid #2b2d31;
}
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    color: #b5bac1;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}
.sidebar-nav-item:hover {
    background: #2b2d31;
    color: #f2f3f5;
    text-decoration: none;
}
.sidebar-nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* Enhanced DM list */
.dm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    margin: 1px 8px;
    border-radius: 4px;
    color: #b5bac1;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
    cursor: pointer;
}
.dm-item:hover {
    background: #2b2d31;
    color: #f2f3f5;
    text-decoration: none;
}
.dm-item .dm-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dm-item .dm-badge {
    background: #da373c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Login split layout */
.login-split {
    display: flex;
    min-height: 100vh;
}
.login-brand-panel {
    flex: 1;
    background: linear-gradient(135deg, #1e1f22 0%, #2b2d31 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: #f2f3f5;
}
.login-brand-panel .brand-logo {
    font-size: 48px;
    margin-bottom: 24px;
}
.login-brand-panel h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}
.login-brand-panel .brand-tagline {
    font-size: 16px;
    color: #b5bac1;
    text-align: center;
    max-width: 320px;
    line-height: 1.6;
}
.login-brand-features {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.login-brand-features .feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #b5bac1;
}
.login-brand-features .feature-icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
}
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--bg);
}
.login-form-panel .card {
    width: 100%;
    max-width: 400px;
    border: none;
    box-shadow: none;
    background: transparent;
}
@media (max-width: 768px) {
    .login-split { flex-direction: column; }
    .login-brand-panel { padding: 32px 24px; min-height: auto; }
    .login-brand-panel h1 { font-size: 24px; }
    .login-brand-features { display: none; }
    .login-form-panel { padding: 24px; }
}

/* Enhanced message layout */
.message-group {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    margin: 0 -8px;
    padding: 2px 8px;
    border-radius: 4px;
}
.message-group:hover {
    background: var(--primary-alpha-06);
}
.message-group .msg-avatar {
    flex-shrink: 0;
    padding-top: 2px;
}
.message-group .msg-content {
    flex: 1;
    min-width: 0;
}
.message-group .msg-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}
.message-group .msg-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.message-group .msg-timestamp {
    font-size: 11px;
    color: var(--text-muted);
}
.message-group .msg-body {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    word-wrap: break-word;
}
/* Continuation message (same sender, no avatar/header) */
.message-continuation {
    padding: 1px 0 1px 44px;
    margin: 0 -8px;
    padding-left: 52px;
    padding-right: 8px;
    border-radius: 4px;
}
.message-continuation:hover {
    background: var(--primary-alpha-06);
}
.message-continuation .msg-body {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
}

/* Hover action bar on messages */
.msg-actions {
    position: absolute;
    top: -12px;
    right: 4px;
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--shadow);
    padding: 2px;
    gap: 2px;
    z-index: 10;
}
.message-group:hover .msg-actions,
.message-continuation:hover .msg-actions {
    display: flex;
}
.msg-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1;
    transition: background 0.1s, color 0.1s;
}
.msg-actions button:hover {
    background: var(--bg);
    color: var(--text);
}

/* Dashboard content area */
.dashboard-welcome {
    padding: 32px;
}
.dashboard-welcome h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}
.dashboard-welcome .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Quick actions grid */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}
.quick-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.quick-action-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--shadow);
    text-decoration: none;
}
.quick-action-card .action-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-alpha-08);
    border-radius: 8px;
    flex-shrink: 0;
}
.quick-action-card .action-label {
    font-size: 14px;
    font-weight: 500;
}
.quick-action-card .action-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Recent activity section */
.recent-section {
    margin-bottom: 24px;
}
.recent-section h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none;
    color: var(--text);
}
.recent-item:hover {
    background: var(--primary-alpha-06);
    text-decoration: none;
}
.recent-item .recent-name {
    font-size: 14px;
    font-weight: 500;
}
.recent-item .recent-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Call page enterprise styling */
.call-page {
    background: #111214;
    color: #f2f3f5;
    display: flex;
    flex-direction: column;
    height: 100vh;
}
.call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #1e1f22;
    border-bottom: 1px solid #2b2d31;
    min-height: 48px;
}
.call-header .call-room-name {
    font-size: 14px;
    font-weight: 600;
    color: #f2f3f5;
}
.call-header .call-duration {
    font-size: 13px;
    color: #949ba4;
}

/* Floating call controls */
.call-controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #1e1f22;
    border-top: 1px solid #2b2d31;
}
.call-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, transform 0.1s;
    color: #f2f3f5;
    background: #404249;
    white-space: nowrap;
}
.call-control-btn:hover {
    background: #4e5058;
    transform: scale(1.05);
}
.call-control-btn.active {
    background: #fff;
    color: #1e1f22;
}
.call-control-btn.danger {
    background: #da373c;
}
.call-control-btn.danger:hover {
    background: #c53030;
}
.call-control-btn.muted {
    background: #da373c;
}

/* Participant tile name overlay */
.participant-tile .tile-name {
    position: absolute;
    bottom: 8px;
    left: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}
.participant-tile .tile-mute-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    color: #da373c;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Contacts page with sidebar layout */
.contacts-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.contacts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.contacts-header h2 {
    font-size: 16px;
    font-weight: 600;
}
.contacts-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}
.contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.1s;
}
.contact-card:hover {
    background: var(--primary-alpha-06);
}
.contact-card .contact-info {
    flex: 1;
    min-width: 0;
}
.contact-card .contact-name {
    font-size: 14px;
    font-weight: 600;
}
.contact-card .contact-email {
    font-size: 12px;
    color: var(--text-muted);
}
.contact-card .contact-actions {
    display: flex;
    gap: 6px;
}
.contact-card .contact-actions button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
}
.btn-primary-sm {
    background: var(--primary);
    color: #fff;
}
.btn-primary-sm:hover {
    background: var(--primary-hover);
}
.btn-danger-sm {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger) !important;
}
.btn-danger-sm:hover {
    background: var(--danger-alpha-08);
}
.btn-success-sm {
    background: var(--success);
    color: #fff;
}
.btn-success-sm:hover {
    opacity: 0.9;
}

/* Add contact form inline */
.add-contact-form {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.add-contact-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    outline: none;
}
.add-contact-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-alpha-10);
}
.add-contact-form button {
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

/* Section headers */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    padding: 16px 0 8px;
}

/* Enhanced message input */
.message-input-area {
    padding: 12px 16px !important;
    background: var(--surface) !important;
    border-top: 1px solid var(--border) !important;
}
.message-input-bar {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 4px 4px 12px;
    transition: border-color 0.15s;
}
.message-input-bar:focus-within {
    border-color: var(--primary);
}
.message-input-bar input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 8px 0 !important;
    font-size: 14px;
    outline: none;
}
.message-input-bar .input-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: color 0.1s, background 0.1s;
}
.message-input-bar .input-action:hover {
    color: var(--text);
    background: var(--primary-alpha-08);
}
.message-input-bar .send-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.message-input-bar .send-btn:hover {
    background: var(--primary-hover);
}

/* Content header with room info */
.room-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    min-height: 48px;
}
.room-content-header .room-name {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.room-content-header .room-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.room-content-header .room-actions button,
.room-content-header .room-actions a {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.room-content-header .room-actions button:hover,
.room-content-header .room-actions a:hover {
    background: var(--primary-alpha-08);
    color: var(--text);
}
.room-content-header .room-actions .call-btn {
    background: var(--success);
    color: #fff;
    border-radius: 4px;
    padding: 6px 14px;
}
.room-content-header .room-actions .call-btn:hover {
    opacity: 0.9;
}

/* Avatar background colors based on data-color attribute */
.user-avatar[data-color="0"] { background: #5865f2; }
.user-avatar[data-color="1"] { background: #57f287; color: #1e1f22; }
.user-avatar[data-color="2"] { background: #fee75c; color: #1e1f22; }
.user-avatar[data-color="3"] { background: #eb459e; }
.user-avatar[data-color="4"] { background: #ed4245; }
.user-avatar[data-color="5"] { background: #f47b67; }
.user-avatar[data-color="6"] { background: #3ba55c; }
.user-avatar[data-color="7"] { background: #faa61a; color: #1e1f22; }
/* Keyboard Shortcuts Modal */
.keyboard-shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 16px;
}

.keyboard-shortcuts-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
    outline: none;
    animation: shortcuts-fade-in 0.25s ease;
    display: flex;
    flex-direction: column;
}

@keyframes shortcuts-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
}

.shortcuts-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.shortcuts-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s;
}

.shortcuts-close:hover {
    background: var(--primary-alpha-08);
    color: var(--text);
}

.shortcuts-content {
    padding: 24px 32px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.shortcuts-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcuts-section h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
}

.shortcut-key {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    text-align: center;
}

.shortcut-description {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

@media (max-width: 768px) {
    .shortcuts-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .keyboard-shortcuts-modal {
        max-height: 90vh;
    }

    .shortcuts-header,
    .shortcuts-content {
        padding: 20px 24px;
    }

    .shortcut-key {
        min-width: 80px;
        font-size: 11px;
    }

    .shortcut-description {
        font-size: 13px;
    }
}

/* ========================================
   Sidebar active state & channel removal
   ======================================== */

.sidebar-nav-item.active {
    background: var(--sidebar-active, #404249);
    color: var(--sidebar-text-bright, #f2f3f5);
    font-weight: 600;
}

.channel-link {
    display: block;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--sidebar-section-text, #949ba4);
    font-size: 13px;
    transition: background 0.1s, color 0.1s;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-link:hover {
    background: var(--sidebar-hover, #2b2d31);
    color: var(--sidebar-text-bright, #f2f3f5);
    text-decoration: none;
}
.channel-link.active {
    background: var(--sidebar-active, #404249);
    color: var(--sidebar-text-bright, #f2f3f5);
    font-weight: 600;
}

.dm-item.active {
    background: var(--sidebar-active, #404249) !important;
    color: var(--sidebar-text-bright, #f2f3f5) !important;
    font-weight: 600;
}

.sidebar-org-group {
    padding: 4px 8px;
}
.sidebar-channel-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 4px;
}

/* Channel item with remove button */
.channel-item,
.dm-item-wrap {
    display: flex;
    align-items: center;
    position: relative;
}
.channel-item:hover .channel-remove-btn,
.dm-item-wrap:hover .channel-remove-btn {
    opacity: 1;
}
.channel-remove-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--sidebar-section-text, #949ba4);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: opacity 0.15s, color 0.1s, background 0.1s;
    flex-shrink: 0;
}
.channel-remove-btn:hover {
    color: #da373c;
    background: rgba(218, 55, 60, 0.1);
}

.channel-remove-confirm {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--sidebar-section-text, #949ba4);
    flex-shrink: 0;
}
.channel-remove-yes,
.channel-remove-no {
    background: none;
    border: 1px solid var(--sidebar-section-text, #949ba4);
    color: var(--sidebar-section-text, #949ba4);
    cursor: pointer;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
}
.channel-remove-yes:hover {
    background: #da373c;
    border-color: #da373c;
    color: #fff;
}
.channel-remove-no:hover {
    background: var(--sidebar-hover, #2b2d31);
}

/* ========================================
   Pre-join voice-only button
   ======================================== */

.prejoin-join-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.prejoin-voice-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--primary, #5865f2);
    background: transparent;
    color: var(--primary, #5865f2);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.prejoin-voice-btn:hover {
    background: var(--primary, #5865f2);
    color: #fff;
}
.prejoin-voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Device settings page styles
   ======================================== */

.device-settings {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.device-setting-row {
    margin-bottom: 12px;
}
.device-setting-row select {
    margin-top: 4px;
}
