:root {
    --bg-dark: #0a0a0f;
    --card-bg: rgba(20, 20, 25, 0.7);
    --primary: #00d2ff;
    --primary-hover: #00b4db;
    --primary-glow: rgba(0, 210, 255, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --system-msg: #fbbf24;
    --danger: #ff4b4b;
    --own-msg-bg: linear-gradient(135deg, #00d2ff, #3a7bd5);
    --other-msg-bg: rgba(40, 40, 50, 0.8);
    --input-bg: rgba(10, 10, 15, 0.7);
    --sidebar-bg: rgba(15, 15, 20, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #050505;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    font-family: 'Outfit', sans-serif;
}

/* Stunning Dynamic Mesh Background */
.bg-animation {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background-color: #050508;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(14, 165, 233, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 20% 90%, rgba(139, 92, 246, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 40%);
    filter: blur(60px);
    animation: rotateBg 40s linear infinite, colorPulse 20s ease-in-out infinite alternate;
    z-index: -2;
}

/* Subtle overlay grid for tech vibe */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes colorPulse {
    0% { filter: hue-rotate(0deg) blur(60px) brightness(1); }
    100% { filter: hue-rotate(45deg) blur(70px) brightness(1.2); }
}

/* Floating Snowflakes / Particles */
#particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}
.particle {
    position: absolute;
    bottom: -10px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white, 0 0 20px rgba(255,255,255,0.5);
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-105vh) translateX(20px); opacity: 0; }
}

#app { width: 100%; max-width: 1000px; height: 100vh; padding: 20px; display: flex; justify-content: center; align-items: center; }

.screen { display: none; width: 100%; height: 100%; animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.screen.active { display: flex; justify-content: center; align-items: center; }
.hidden { display: none !important; }

.glass-card {
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.75), rgba(10, 10, 15, 0.85));
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    box-shadow: 
        0 40px 80px -20px rgba(0, 0, 0, 0.95),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.premium-card { padding: 40px; width: 100%; max-width: 450px; text-align: center; max-height: 95vh; overflow-y: auto; }
.premium-card::-webkit-scrollbar { width: 5px; }
.premium-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.logo-icon { font-size: 2.5rem; animation: float 3s ease-in-out infinite; margin-bottom:5px;}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
h1 { font-size: 2.5rem; font-weight: 600; background: linear-gradient(to right, #fff, #aaa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 25px; }

/* Spinners */
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Inputs & Buttons */
.input-group { margin-bottom: 15px; }
input[type="text"] {
    width: 100%; padding: 14px 20px; background: var(--input-bg); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px; color: white; font-size: 1rem; outline: none; transition: 0.3s;
}
input[type="text"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.action-buttons { display: flex; gap: 10px; margin-bottom: 20px; }
.btn { flex: 1; padding: 12px; border: none; border-radius: 12px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: 0.2s; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--primary); color: #000; font-weight: 600;}
.btn.primary:hover { background: var(--primary-hover); }
.btn.glow { box-shadow: 0 0 15px var(--primary-glow); }
.btn.secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.btn.secondary:hover { background: rgba(255,255,255,0.1); }
.global-btn { background: linear-gradient(135deg, #00d2ff, #3a7bd5); width: 100%; color: white; }

/* Avatar Pickers */
.avatar-upload-container { display: flex; justify-content: center; margin-bottom: 20px; }
.avatar-preview { width: 80px; height: 80px; border-radius: 50%; border: 2px dashed rgba(255,255,255,0.2); display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; position: relative; overflow: hidden; }
.avatar-preview img { position: absolute; top:0; left:0; width: 100%; height: 100%; object-fit: cover; }
.avatar-preview .upload-text { font-size: 0.7rem; color: var(--text-muted); }

/* Chat Layout */
#chat-screen { align-items: stretch; }
.premium-chat { width: 100%; max-width: 100%; display: flex; flex-direction: column; overflow: hidden; }
.chat-main { display: flex; flex: 1; overflow: hidden; }
.messages-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative;}

/* Chat Header */
.chat-header { padding: 15px 25px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; background: rgba(10,10,15,0.6); }
.room-info { display: flex; align-items: center; gap: 15px; }
.group-pic-wrapper { width: 45px; height: 45px; border-radius: 12px; background: rgba(255,255,255,0.1); overflow: hidden; position: relative; }
.group-pic-wrapper img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.room-titles h2 { font-size: 1.1rem; font-weight: 500; display: flex; align-items: center; margin-bottom: 2px; }
.pulse-dot { display: inline-block; width: 8px; height: 8px; background: #22c55e; border-radius: 50%; margin-right: 8px; box-shadow: 0 0 8px #22c55e; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.secure-badge { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; }

.header-actions { display: flex; gap: 8px; }
.icon-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; transition: 0.2s; font-size: 1rem; }
.icon-btn:hover { background: rgba(255,255,255,0.15); }
.icon-btn.danger:hover { background: rgba(255,75,75,0.2); color: var(--danger); border-color: rgba(255,75,75,0.5); }
.icon-btn.active { background: var(--primary); color: #000; border-color: var(--primary); }

/* Sidebar */
.members-sidebar { width: 250px; background: var(--sidebar-bg); border-left: 1px solid rgba(255,255,255,0.05); padding: 20px; overflow-y: auto; transition: 0.3s; }
.members-sidebar.hidden { display: none; }
.members-sidebar h3 { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.mobile-only { display: none !important; }
.member-item { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.member-avatar { width: 35px; height: 35px; border-radius: 50%; background: rgba(255,255,255,0.1); overflow: hidden; display: flex; justify-content: center; align-items: center; }
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-name { font-size: 0.9rem; font-weight: 500; }
.member-owner-badge { font-size: 0.7rem; background: var(--primary); color: #000; padding: 2px 6px; border-radius: 10px; margin-left: auto; font-weight: bold;}

/* Messages */
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; overflow-x: visible; display: flex; flex-direction: column; gap: 25px; scroll-behavior: smooth; }
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.message { display: flex; flex-direction: column; position: relative; max-width: 80%; animation: msgPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); margin-bottom: 12px; }
@keyframes msgPop { 0% { opacity: 0; transform: translateY(10px) scale(0.98); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.message.own { align-self: flex-end; }
.message.other { align-self: flex-start; }
.message-content-wrapper { display: flex; gap: 10px; align-items: flex-end; position: relative; overflow: visible; }
.message.own .message-content-wrapper { flex-direction: row-reverse; }

.message-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.1); overflow: hidden; display: flex; justify-content: center; align-items: center; flex-shrink: 0;}
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }

.message-bubble { padding: 10px 14px; border-radius: 18px; position: relative; font-size: 0.95rem; line-height: 1.4; box-shadow: 0 4px 15px rgba(0,0,0,0.2); overflow: visible; }
.message.own .message-bubble { background: var(--own-msg-bg); border-bottom-right-radius: 4px; color: #fff;}
.message.other .message-bubble { background: var(--other-msg-bg); border-bottom-left-radius: 4px; border: 1px solid rgba(255,255,255,0.05); }

/* Message Image Attachments */
.msg-image { max-width: 100%; border-radius: 12px; margin-bottom: 8px; cursor: pointer; }

/* Markdown Styles */
.message-bubble .text strong { font-weight: 700 !important; }
.message-bubble .text em { font-style: italic !important; }
.message-bubble .text del { text-decoration: line-through; }
.message-bubble .text code { background: rgba(0,0,0,0.35); padding: 2px 7px; border-radius: 4px; font-family: monospace; font-size: 0.85em; }

/* Reactions */
.reactions-bar { display: flex; flex-wrap: wrap; gap: 4px; position: absolute; bottom: -24px; right: 10px; z-index: 10; }
.message.own .reactions-bar { right: auto; left: 10px; }
.reaction-badge { background: rgba(20,20,25,0.97); border: 1px solid rgba(255,255,255,0.15); border-radius: 12px; padding: 2px 8px; font-size: 0.75rem; cursor: pointer; display: flex; align-items: center; gap: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.6);}

/* Reply/React Action Buttons - sit to the side, NOT on top */
.msg-actions { position: absolute; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; z-index: 10; pointer-events: none; }
.message.own .msg-actions { right: 100%; left: auto; padding-right: 8px; }
.message.other .msg-actions { left: 100%; right: auto; padding-left: 8px; }
.message-content-wrapper:hover .msg-actions { opacity: 1; pointer-events: all; }
.action-icon { background: rgba(30,30,40,0.9); border: 1px solid rgba(255,255,255,0.12); color: white; height: 30px; min-width: 30px; padding: 0 8px; border-radius: 15px; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 0.8rem; backdrop-filter: blur(5px); white-space: nowrap; transition: 0.2s; }
.action-icon:hover { background: rgba(255,255,255,0.25); transform: scale(1.15); }

/* System Message */
.message.system { align-self: center; background: transparent; color: var(--text-muted); font-size: 0.8rem; padding: 4px 12px; max-width: 90%; text-align: center; margin: 5px 0; font-style: italic; }

/* Read Receipt */
.read-receipt { font-size: 0.6rem; color: #4ade80; margin-left: 5px;}

/* Input Area */
.chat-input-area { padding: 15px 20px; background: rgba(15, 15, 20, 0.8); border-top: 1px solid rgba(255,255,255,0.05); display: flex; gap: 10px; align-items: center; position: relative; }
.attach-btn { cursor: pointer; font-size: 1.2rem; opacity: 0.7; transition: 0.2s; padding: 5px;}
.attach-btn:hover { opacity: 1; transform: scale(1.1); }
#attachment-preview-wrapper { position: absolute; bottom: 80px; left: 20px; background: var(--card-bg); padding: 5px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); display: flex; align-items:flex-start; gap: 5px; max-width: 250px;}
#attachment-preview-wrapper img { max-height: 80px; border-radius: 5px; max-width: 100%;}
#attachment-preview-wrapper video { max-height: 80px; border-radius: 5px; max-width: 100%;}
.file-preview { padding: 10px; background: rgba(0,0,0,0.5); border-radius: 5px; font-size: 0.8rem; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
#remove-attachment-btn { background: rgba(255,0,0,0.5); border: none; color: white; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 0.7rem; }

/* Emoji Picker */
.emoji-picker { position: absolute; bottom: 80px; right: 20px; width: 300px; height: 350px; background: rgba(20, 20, 25, 0.95); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; display: flex; flex-direction: column; z-index: 1000; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: scaleIn 0.2s ease-out; }
.emoji-picker.hidden { display: none; }
#emoji-search { margin: 10px; padding: 8px 12px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; color: white; outline: none; }
.emoji-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; padding: 10px; padding-top: 0; align-content: start;}
.emoji-grid::-webkit-scrollbar { width: 4px; }
.emoji-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.emoji-item { font-size: 1.5rem; text-align: center; cursor: pointer; border-radius: 8px; padding: 5px; transition: 0.1s; display: flex; justify-content: center; align-items: center;}
.emoji-item:hover { background: rgba(255,255,255,0.1); transform: scale(1.2); }
.emoji-item.animated { animation: bounce 2s infinite; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } 60% { transform: translateY(-3px); } }

/* Attachment inside Message */
.msg-attachment { margin-top: 8px; border-radius: 8px; overflow: hidden; max-width: 100%; display: block;}
.msg-attachment img { max-width: 100%; border-radius: 8px; cursor: pointer; }
.msg-attachment video { max-width: 100%; border-radius: 8px; }
.msg-attachment a.file-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; background: rgba(0,0,0,0.3); border-radius: 8px; color: white; text-decoration: none; border: 1px solid rgba(255,255,255,0.1); }
.msg-attachment a.file-link:hover { background: rgba(255,255,255,0.1); }

.chat-input-area input[type="text"] { flex: 1; border-radius: 20px; padding: 12px 18px; border: none; background: rgba(255,255,255,0.05); margin:0;}
.send-btn { background: var(--primary); color: #000; border: none; width: 44px; height: 44px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s; box-shadow: 0 0 10px var(--primary-glow); }
.send-btn:hover { transform: scale(1.05); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Approvals Toast Container */
.approvals-container { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 2000; }
.approval-toast { background: var(--card-bg); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); padding: 15px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 10px; animation: slideInRight 0.3s ease-out; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.approval-header { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.approval-actions { display: flex; gap: 10px; }
.approval-actions button { flex:1; padding: 6px; border-radius: 6px; border: none; cursor: pointer; font-weight: bold;}
.acc-btn { background: #22c55e; color: white; }
.rej-btn { background: #ef4444; color: white; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: #22c55e; color: white; padding: 10px 20px; border-radius: 50px; font-weight: 500; font-size: 0.9rem; transition: 0.3s; z-index: 1000; }
.toast.show { transform: translateX(-50%) translateY(0); }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Typing & Reply Indicator */
.typing-wrapper { padding: 0 20px; margin-bottom: 5px; }
.typing-wrapper.hidden { display: none; }
.typing-text { font-size: 0.75rem; color: var(--primary); font-style: italic; }
.reply-indicator { padding: 8px 20px; background: rgba(0, 0, 0, 0.4); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05);}
.reply-indicator.hidden { display: none; }
.reply-context { border-left: 3px solid var(--primary); padding-left: 10px; }
#reply-author { font-size: 0.8rem; font-weight: 600; color: var(--primary); display:block; }
#reply-text { font-size: 0.8rem; opacity: 0.8; }
#cancel-reply-btn { background: none; border: none; color: white; cursor: pointer; font-size: 1rem; opacity: 0.6; }


/* Language Selector */
.lang-selector-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
.lang-selector {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
    font-family: 'Outfit', sans-serif;
    transition: 0.2s;
}
.lang-selector:hover { background: rgba(255,255,255,0.13); }
.lang-selector option { background: #1a1a2e; color: white; }

/* Maintenance Overlay */
.maintenance-overlay {
    position: fixed; inset: 0;
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
    background: #0b0b14;
}
.maintenance-overlay.hidden { display: none !important; }

.maintenance-card {
    padding: 50px 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.maintenance-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    animation: maintSpin 3s linear infinite;
}
@keyframes maintSpin {
    0%,100% { transform: rotate(-15deg) scale(1); }
    25% { transform: rotate(15deg) scale(1.05); }
    50% { transform: rotate(-10deg) scale(1); }
    75% { transform: rotate(10deg) scale(1.05); }
}
.maintenance-title {
    font-size: 2rem; font-weight: 600;
    background: linear-gradient(135deg, #00d2ff, #a855f7, #f97316);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}
.maintenance-subtitle {
    color: var(--text-muted); font-size: 0.95rem;
    line-height: 1.7; margin-bottom: 30px;
}
.maintenance-progress {
    height: 4px; background: rgba(255,255,255,0.08);
    border-radius: 10px; overflow: hidden; margin-bottom: 12px;
}
.maintenance-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #a855f7, #f97316);
    border-radius: 10px;
    animation: progressPulse 2.5s ease-in-out infinite;
    width: 60%;
}
@keyframes progressPulse {
    0% { width: 30%; margin-left: 0; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 30%; margin-left: 70%; }
}
.maintenance-eta {
    font-size: 0.8rem; color: rgba(255,255,255,0.35);
    margin-bottom: 25px; font-style: italic;
}
.maintenance-admin-btn {
    max-width: 220px; margin: 0 auto;
    background: rgba(255,255,255,0.05) !important;
    color: rgba(255,255,255,0.4) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    font-size: 0.8rem !important;
    box-shadow: none !important;
    padding: 8px 20px !important;
}
.maintenance-admin-btn:hover {
    background: rgba(255,255,255,0.12) !important;
    color: white !important;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    body { overflow-y: auto; align-items: flex-start; }
    #app { padding: 0; height: auto; min-height: 100vh; align-items: flex-start; }

    .screen { height: auto; min-height: 100vh; }
    .screen.active { align-items: flex-start; }

    .glass-card { border-radius: 0; border-left: none; border-right: none; max-width: 100%; width: 100%; }
    .premium-card { padding: 24px 18px; max-width: 100%; max-height: none; border-radius: 0; }

    h1 { font-size: 1.9rem; }
    .subtitle { font-size: 0.85rem; }

    /* Chat full height on mobile */
    #chat-screen { align-items: stretch; height: 100vh; }
    .premium-chat { border-radius: 0; height: 100vh; }

    .chat-header { padding: 10px 14px; }
    .room-titles h2 { font-size: 0.95rem; }
    .secure-badge { display: none; }
    .group-pic-wrapper { width: 36px; height: 36px; }

    /* Shrink header buttons on mobile */
    .header-actions { gap: 5px; flex-wrap: wrap; }
    .icon-btn { width: 30px; height: 30px; font-size: 0.85rem; border-radius: 8px; }

    /* Members sidebar slides over content */
    .members-sidebar { position: absolute; right: 0; top: 0; height: 100%; z-index: 100; transform: translateX(100%); transition: transform 0.3s; width: 220px; }
    .members-sidebar.show { transform: translateX(0); display: flex; flex-direction: column; }
    .members-sidebar.hidden { transform: translateX(100%); display: flex !important; }

    /* Chat messages */
    .chat-messages { padding: 12px; gap: 16px; }
    .message { max-width: 88%; }
    .message-bubble { font-size: 0.9rem; padding: 9px 12px; }

    .mobile-only { display: block !important; }
    
    /* Input area */
    .chat-input-area { padding: 10px 12px; gap: 7px; }
    .chat-input-area input[type="text"] { font-size: 0.9rem; padding: 10px 14px; }
    .send-btn { width: 38px; height: 38px; }

    /* Emoji picker full width on mobile */
    .emoji-picker { width: calc(100vw - 20px); right: 10px; left: 10px; }

    /* Admin modal full width */
    #admin-modal .glass-card { max-width: 100%; border-radius: 0; }

    /* Maintenance card */
    .maintenance-card { padding: 40px 24px; }
    .maintenance-title { font-size: 1.6rem; }

    /* Approvals */
    .approvals-container { top: 10px; right: 10px; left: 10px; }
    .approval-toast { font-size: 0.85rem; }
}

@media (max-width: 400px) {
    .header-actions { gap: 3px; }
    .icon-btn { width: 28px; height: 28px; font-size: 0.75rem; }
    .premium-card { padding: 20px 14px; }
    .action-buttons { flex-direction: column; }
    .action-buttons .btn { width: 100%; }
}
