/* ═══════════════════════════════════════════════════════
   SayfeSpace v0.4.0 — Premium Modern Design System
   Nicht 0815. Einzigartig. Premium Dark Messenger.
   ═══════════════════════════════════════════════════════ */

:root {
    /* ─── Theme: Dark (default) ─── */
    --bg-void: #08060f;
    --bg-surface: #0e0b1a;
    --bg-panel: #13112a;
    --bg-elev: #1a1830;
    --bg-hover: #222040;
    --bg-input: #141228;
    --text-main: #ede9f5;
    --text-dim: #9088aa;
    --text-muted: #5a5278;
    --accent-lav: #b8a0e8;
    --accent-lav-bright: #d0c0f0;
    --accent-peach: #f0b8a0;
    --accent-mint: #90d8b8;
    --accent-rose: #e8a0c0;
    --accent-gold: #e0c090;
    --border: #1c1a38;
    --border-light: #282540;
    --danger: #e09090;
    --success: var(--accent-mint);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.45);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.55);
    --shadow-lav: 0 0 30px rgba(184,160,232,0.12);
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Theme: Blue ─── */
[data-theme="blue"] {
    --bg-void: #050c18; --bg-surface: #0b1425; --bg-panel: #111a30;
    --bg-elev: #182340; --bg-hover: #222b45; --bg-input: #111c2e;
    --text-main: #e0e8f5; --text-dim: #8090b0; --text-muted: #3d5070;
    --accent-lav: #70a0f0; --accent-lav-bright: #90c0ff;
    --accent-peach: #f0a880; --accent-mint: #70d8b0; --accent-rose: #d080a0;
    --accent-gold: #e0b870; --border: #1a2840; --border-light: #243050;
    --shadow-lav: 0 0 30px rgba(112,160,240,0.12);
}

/* ─── Theme: Purple ─── */
[data-theme="purple"] {
    --bg-void: #0a0614; --bg-surface: #130d20; --bg-panel: #1a1428;
    --bg-elev: #221a32; --bg-hover: #2e2440; --bg-input: #1a1428;
    --text-main: #ede5f2; --text-dim: #9070b0; --text-muted: #5a4070;
    --accent-lav: #c080f0; --accent-lav-bright: #d8a0ff;
    --accent-peach: #f09090; --accent-mint: #80d8b0; --accent-rose: #e090b8;
    --accent-gold: #d8b870; --border: #2a2040; --border-light: #362848;
    --shadow-lav: 0 0 30px rgba(192,128,240,0.12);
}

/* ─── Theme: Green ─── */
[data-theme="green"] {
    --bg-void: #05100a; --bg-surface: #0a1a10; --bg-panel: #0f2015;
    --bg-elev: #162a1a; --bg-hover: #203525; --bg-input: #0f2015;
    --text-main: #e0f0e5; --text-dim: #80a090; --text-muted: #406050;
    --accent-lav: #70c0a0; --accent-lav-bright: #90e0c0;
    --accent-peach: #e09070; --accent-mint: #60d0a0; --accent-rose: #d08090;
    --accent-gold: #c8b060; --border: #1a3020; --border-light: #244030;
}

/* ─── Theme: Red ─── */
[data-theme="red"] {
    --bg-void: #120308; --bg-surface: #1a0a10; --bg-panel: #221018;
    --bg-elev: #2c1420; --bg-hover: #3a1a28; --bg-input: #221018;
    --text-main: #f0e0e5; --text-dim: #a08090; --text-muted: #604050;
    --accent-lav: #e08090; --accent-lav-bright: #f0a0b0;
    --accent-peach: #f0a070; --accent-mint: #80d8b0; --accent-rose: #e090b0;
    --accent-gold: #d8b070; --border: #382030; --border-light: #442838;
}

/* ═══ BASE ═══ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; font-family:var(--font-stack); -webkit-tap-highlight-color:transparent; }
html { scrollbar-width:thin; scrollbar-color:var(--border) var(--bg-void); }
body { background:var(--bg-void); color:var(--text-main); font-size:14.5px; line-height:1.45; -webkit-font-smoothing:antialiased; min-height:100vh; overflow:hidden; }
::selection { background:rgba(184,160,232,0.2); color:var(--text-main); }
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:var(--bg-void); }
::-webkit-scrollbar-thumb { background:var(--border-light); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--text-muted); }

/* ═══ AUTH SCREEN ═══ */
#auth-screen { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:100vh; padding:20px; position:relative; overflow:hidden; }
.auth-hero { position:relative; display:flex; align-items:center; justify-content:center; margin-bottom:32px; }
.auth-orb { position:absolute; border-radius:50%; filter:blur(40px); opacity:0.5; }
.orb-1 { width:180px; height:180px; background:radial-gradient(circle, var(--accent-lav), transparent 70%); animation:orbFloat 6s ease-in-out infinite; }
.orb-2 { width:120px; height:120px; background:radial-gradient(circle, var(--accent-peach), transparent 70%); animation:orbFloat 7s ease-in-out infinite reverse; top:20px; left:60px; }
@keyframes orbFloat { 0%,100%{transform:translate(0,0) scale(1);} 33%{transform:translate(15px,-10px) scale(1.05);} 66%{transform:translate(-10px,8px) scale(0.95);} }
.auth-logo { position:relative; z-index:2; text-align:center; }
.auth-shield { font-size:4.5rem; margin-bottom:8px; filter:drop-shadow(0 0 20px var(--accent-lav)); animation:shieldPulse 3s ease-in-out infinite; }
@keyframes shieldPulse { 0%,100%{transform:scale(1); filter:drop-shadow(0 0 20px var(--accent-lav));} 50%{transform:scale(1.05); filter:drop-shadow(0 0 35px var(--accent-lav));} }
#auth-screen h1 { font-size:2.2rem; font-weight:800; letter-spacing:-0.5px; background:linear-gradient(135deg, var(--accent-lav-bright), var(--accent-peach)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.tagline { color:var(--text-dim); font-size:0.95rem; margin-top:4px; font-weight:400; }

.auth-card { width:min(380px, 92vw); background:var(--bg-panel); border:1px solid var(--border); border-radius:var(--radius-lg); padding:24px; box-shadow:var(--shadow-lg), var(--shadow-lav); position:relative; z-index:2; }
.tabs { display:flex; gap:8px; margin-bottom:20px; }
.tab-btn { flex:1; background:transparent; border:1px solid var(--border); color:var(--text-dim); padding:10px; border-radius:var(--radius-sm); font-size:0.85rem; font-weight:600; cursor:pointer; transition:var(--transition); }
.tab-btn:hover { color:var(--text-main); border-color:var(--border-light); }
.tab-btn.active { background:var(--accent-lav-soft, rgba(184,160,232,0.15)); border-color:rgba(184,160,232,0.3); color:var(--accent-lav); }

.form-panel { display:none; }
.form-panel.active { display:flex; flex-direction:column; gap:12px; }
.input-wrap { position:relative; }
.input-wrap input { width:100%; background:var(--bg-input); border:1px solid var(--border); padding:12px 14px; border-radius:var(--radius-sm); color:var(--text-main); font-size:0.9rem; outline:none; transition:var(--transition); }
.input-wrap input:focus { border-color:var(--accent-lav); box-shadow:0 0 0 3px rgba(184,160,232,0.1); }
.input-wrap label { position:absolute; top:-9px; left:10px; background:var(--bg-panel); padding:0 6px; font-size:0.65rem; color:var(--text-muted); opacity:0; transition:var(--transition); }
.input-wrap input:focus + label, .input-wrap input:not(:placeholder-shown) + label { opacity:1; }
.btn-glow { width:100%; padding:12px; background:linear-gradient(135deg, var(--accent-lav), #a080d0); border:none; border-radius:var(--radius-sm); color:#fff; font-weight:700; font-size:0.95rem; cursor:pointer; transition:var(--transition); box-shadow:0 4px 15px rgba(184,160,232,0.2); }
.btn-glow:hover { transform:translateY(-1px); box-shadow:0 6px 25px rgba(184,160,232,0.35); }
.btn-glow:active { transform:translateY(0); }
.error-msg { text-align:center; color:var(--danger); font-size:0.82rem; min-height:20px; }
.forgot-link { font-size:0.8rem; color:var(--accent-lav); text-decoration:none; opacity:0.8; transition:opacity 0.2s; }
.forgot-link:hover { opacity:1; }
#forgot-form, #reset-form { animation:fadeIn 0.3s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px);} to{opacity:1;transform:translateY(0);} }

/* ═══ APP HEADER ═══ */
#main-screen { display:none; flex-direction:column; height:100vh; }
#app { width:100%; height:100vh; }
.app-header { display:flex; align-items:center; justify-content:space-between; padding:8px 16px; background:var(--bg-surface); border-bottom:1px solid var(--border); flex-shrink:0; position:relative; z-index:100; }
.app-header::after { content:''; position:absolute; bottom:-1px; left:0; right:0; height:1px; background:linear-gradient(90deg, transparent, var(--accent-lav), transparent); opacity:0.3; }
.header-left { display:flex; align-items:center; gap:10px; }
.header-right { display:flex; align-items:center; gap:6px; }
.logo-glow { font-size:1.1rem; font-weight:800; letter-spacing:0.3px; background:linear-gradient(135deg, var(--accent-lav-bright), var(--accent-peach)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.header-btn { background:transparent; border:1px solid var(--border); border-radius:var(--radius-sm); padding:6px 10px; color:var(--text-dim); font-size:0.9rem; cursor:pointer; transition:var(--transition); }
.header-btn:hover { color:var(--accent-lav); border-color:var(--accent-lav); background:rgba(184,160,232,0.08); }
.user-chip { font-size:0.78rem; color:var(--text-muted); padding:4px 10px; border-radius:999px; border:1px solid var(--border); }

/* ═══ APP BODY / LAYOUT ═══ */
.app-body { display:flex; flex:1; overflow:hidden; }
#sidebar { width:320px; min-width:260px; max-width:380px; background:var(--bg-surface); border-right:1px solid var(--border); display:flex; flex-direction:column; transition:var(--transition-slow); flex-shrink:0; }
#sidebar.open { transform:translateX(0); }
.sidebar-tabs { display:flex; padding:8px; gap:6px; border-bottom:1px solid var(--border); }
.sidebar-tab { flex:1; background:transparent; border:none; color:var(--text-dim); padding:8px; border-radius:var(--radius-sm); font-size:0.8rem; font-weight:600; cursor:pointer; transition:var(--transition); position:relative; }
.sidebar-tab:hover { color:var(--text-main); background:var(--bg-hover); }
.sidebar-tab.active { color:var(--accent-lav); background:rgba(184,160,232,0.1); }
.sidebar-tab.active::after { content:''; position:absolute; bottom:-1px; left:20%; right:20%; height:2px; background:var(--accent-lav); border-radius:1px; }
.sidebar-tools { padding:10px; border-bottom:1px solid var(--border); display:flex; gap:6px; }
.sidebar-tools input { flex:1; background:var(--bg-input); border:1px solid var(--border); padding:8px 12px; border-radius:var(--radius-sm); color:var(--text-main); font-size:0.82rem; outline:none; transition:var(--transition); }
.sidebar-tools input:focus { border-color:var(--accent-lav); }
.sidebar-tools input::placeholder { color:var(--text-muted); }

/* ═══ CONTACT LIST ═══ */
.contact-list { flex:1; overflow-y:auto; padding:6px; }
.chat-item { display:flex; align-items:center; gap:12px; padding:10px; border-radius:var(--radius-md); cursor:pointer; transition:var(--transition); position:relative; }
.chat-item:hover { background:var(--bg-hover); }
.chat-item.active { background:rgba(184,160,232,0.08); border:1px solid rgba(184,160,232,0.15); }
.chat-item + .chat-item { margin-top:2px; }
.chat-avatar { width:44px; height:44px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:1rem; color:var(--accent-lav); border:2px solid var(--border); position:relative; flex-shrink:0; }
.chat-avatar .chat-unread { position:absolute; top:-2px; right:-2px; background:var(--accent-peach); color:#000; font-size:0.62rem; font-weight:700; padding:1px 6px; border-radius:999px; min-width:18px; text-align:center; }
.chat-info { flex:1; min-width:0; }
.chat-name { font-weight:600; font-size:0.86rem; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-lastmsg { font-size:0.78rem; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.chat-lastmsg .muted-icon { margin-left:4px; opacity:0.6; }
.chat-meta { display:flex; flex-direction:column; align-items:flex-end; gap:2px; flex-shrink:0; }
.chat-time { font-size:0.7rem; color:var(--text-muted); }
.online-dot { width:7px; height:7px; border-radius:50%; background:var(--accent-mint); box-shadow:0 0 6px var(--accent-mint); position:absolute; bottom:2px; right:2px; border:1.5px solid var(--bg-surface); }
.online-dot.offline { display:none; }

/* ═══ CHAT AREA ═══ */
#chat-area { flex:1; display:flex; flex-direction:column; background:var(--bg-void); position:relative; }
#chat-area::before { content:''; position:absolute; inset:0; background:var(--chat-wallpaper, none); background-size:cover; background-position:center; opacity:0.06; pointer-events:none; z-index:0; }
#chat-header { display:flex; align-items:center; justify-content:space-between; padding:8px 16px; background:var(--bg-surface); border-bottom:1px solid var(--border); position:relative; z-index:10; flex-shrink:0; }
.chat-header-left { display:flex; align-items:center; gap:12px; }
.back-btn { display:none; background:transparent; border:none; color:var(--text-dim); font-size:1.3rem; cursor:pointer; padding:4px; }
.chat-header-avatar { width:40px; height:40px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.95rem; color:var(--accent-lav); border:2px solid var(--border); position:relative; flex-shrink:0; }
.chat-header-avatar .online-ring { position:absolute; inset:-3px; border:2px solid var(--accent-mint); border-radius:50%; clip-path:polygon(0 0, 100% 0, 100% 100%, 0 100%); animation:ringSpin 2s linear infinite; }
.online-ring.away { border-color:var(--accent-gold); animation-duration:3s; }
@keyframes ringSpin { 0%{transform:rotate(0deg);} 100%{transform:rotate(360deg);} }
.chat-header-info #chat-title { font-weight:700; font-size:0.95rem; color:var(--text-main); }
.chat-header-info #chat-subtitle { font-size:0.78rem; color:var(--text-dim); display:block; }
.chat-actions { display:flex; gap:4px; }
.chat-action-btn { background:transparent; border:1px solid var(--border); border-radius:var(--radius-sm); padding:4px 8px; color:var(--text-dim); font-size:0.8rem; cursor:pointer; transition:var(--transition); }
.chat-action-btn:hover { color:var(--accent-lav); border-color:rgba(184,160,232,0.3); background:rgba(184,160,232,0.06); }

.messages { flex:1; overflow-y:auto; padding:12px 16px; display:flex; flex-direction:column; gap:3px; position:relative; z-index:1; }

/* ═══ BUBBLES ═══ */
.message-bubble { max-width:72%; padding:9px 13px; border-radius:var(--radius-md); font-size:0.88rem; line-height:1.35; position:relative; word-wrap:break-word; animation:msgIn 0.25s ease-out; }
@keyframes msgIn { from{opacity:0; transform:translateY(6px) scale(0.97);} to{opacity:1; transform:translateY(0) scale(1);} }
.message-bubble.sent { background:linear-gradient(135deg, #3a3060, #2e2450); color:var(--text-main); align-self:flex-end; border-bottom-right-radius:4px; box-shadow:0 2px 10px rgba(40,30,80,0.3); }
.message-bubble.received { background:var(--bg-elev); color:var(--text-main); align-self:flex-start; border-bottom-left-radius:4px; border:1px solid var(--border); }
.message-bubble.pinned { border:1px solid var(--accent-peach); box-shadow:0 0 12px rgba(240,184,160,0.15); }

/* Bubble styles */
[data-bubble="rounded"] .message-bubble { border-radius:20px 20px 20px 4px; }
[data-bubble="rounded"] .message-bubble.sent { border-radius:20px 20px 4px 20px; }
[data-bubble="sharp"] .message-bubble { border-radius:4px; }
[data-bubble="modern"] .message-bubble.sent { border-radius:16px 16px 4px 16px; clip-path:none; position:relative; }
[data-bubble="glass"] .message-bubble { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.06); }
[data-bubble="glass"] .message-bubble.sent { background:rgba(184,160,232,0.08); border-color:rgba(184,160,232,0.12); }

.pin-label { font-size:0.6rem; color:var(--accent-peach); display:flex; align-items:center; gap:3px; margin-bottom:3px; opacity:0.8; }
.msg-reply { background:rgba(0,0,0,0.12); border-radius:4px; padding:5px 8px; margin-bottom:5px; border-left:2px solid var(--accent-peach); }
.msg-reply-name { font-size:0.7rem; color:var(--accent-peach); font-weight:600; }
.msg-reply-text { font-size:0.75rem; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.msg-media { border-radius:8px; overflow:hidden; margin-bottom:4px; }
.msg-media img { max-width:100%; border-radius:8px; cursor:pointer; transition:var(--transition); }
.msg-media img:hover { transform:scale(1.01); }
.voice-msg { display:flex; align-items:center; gap:10px; background:rgba(0,0,0,0.15); border-radius:999px; padding:6px 14px; }
.voice-play-btn { background:var(--accent-lav); border:none; border-radius:50%; width:30px; height:30px; color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:0.7rem; transition:var(--transition); }
.voice-play-btn:hover { transform:scale(1.1); background:var(--accent-lav-bright); }
.voice-wave { display:flex; align-items:center; gap:2px; height:18px; }
.voice-bar { width:3px; background:var(--accent-lav); border-radius:999px; animation:wave 0.8s ease-in-out infinite; }
.voice-bar:nth-child(1){animation-delay:0s;height:8px;} .voice-bar:nth-child(2){animation-delay:0.1s;height:12px;} .voice-bar:nth-child(3){animation-delay:0.2s;height:16px;} .voice-bar:nth-child(4){animation-delay:0.15s;height:10px;} .voice-bar:nth-child(5){animation-delay:0.3s;height:14px;} .voice-bar:nth-child(6){animation-delay:0.05s;height:18px;} .voice-bar:nth-child(7){animation-delay:0.25s;height:9px;} .voice-bar:nth-child(8){animation-delay:0.1s;height:15px;} .voice-bar:nth-child(9){animation-delay:0.35s;height:7px;} .voice-bar:nth-child(10){animation-delay:0.2s;height:13px;}
@keyframes wave { 0%,100%{transform:scaleY(1)}; 50%{transform:scaleY(0.4)}; }
.msg-meta { font-size:0.68rem; color:var(--text-muted); margin-top:4px; text-align:right; }
.msg-status { display:inline-flex; gap:1px; }
.msg-status.sending { color:var(--text-muted); }
.msg-status.read { color:var(--accent-mint); font-weight:700; }
.msg-reactions { display:flex; gap:4px; margin-top:5px; flex-wrap:wrap; }
.reaction-chip { background:rgba(255,255,255,0.06); border:1px solid var(--border); border-radius:999px; padding:2px 8px; font-size:0.75rem; cursor:pointer; transition:var(--transition); }
.reaction-chip:hover { transform:scale(1.1); background:rgba(184,160,232,0.12); }
.day-divider { align-self:center; font-size:0.68rem; color:var(--text-muted); background:var(--bg-panel); padding:3px 12px; border-radius:999px; margin:8px 0; border:1px solid var(--border); }

/* ═══ INPUT AREA ═══ */
#chat-input-area { display:flex; align-items:center; gap:6px; padding:8px 12px; background:var(--bg-surface); border-top:1px solid var(--border); position:relative; z-index:10; flex-shrink:0; }
.reply-preview { display:none; flex-direction:column; gap:2px; padding:8px 14px; background:var(--bg-elev); border-top:1px solid var(--border); font-size:0.8rem; }
.reply-preview-inner { display:flex; align-items:center; gap:8px; overflow:hidden; }
.reply-label { color:var(--accent-peach); font-weight:600; flex-shrink:0; }
.reply-text { color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; }
.input-action-btn { background:none; border:1px solid var(--border); border-radius:50%; width:34px; height:34px; display:flex; align-items:center; justify-content:center; color:var(--text-dim); font-size:0.95rem; cursor:pointer; transition:var(--transition); flex-shrink:0; }
.input-action-btn:hover { color:var(--accent-lav); border-color:var(--accent-lav); background:rgba(184,160,232,0.06); }
.msg-wrap { flex:1; }
.msg-wrap input { width:100%; background:var(--bg-input); border:1px solid var(--border); padding:9px 14px; border-radius:999px; color:var(--text-main); font-size:0.9rem; outline:none; transition:var(--transition); }
.msg-wrap input:focus { border-color:var(--accent-lav); box-shadow:0 0 0 2px rgba(184,160,232,0.1); }
.btn-send { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg, var(--accent-lav), #a080d0); border:none; color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:0.8rem; transition:var(--transition); flex-shrink:0; box-shadow:0 2px 8px rgba(184,160,232,0.25); }
.btn-send:hover { transform:scale(1.1); box-shadow:0 3px 15px rgba(184,160,232,0.35); }
.btn-send:disabled { opacity:0.3; cursor:not-allowed; transform:none; box-shadow:none; }

/* ═══ SIDE PANELS (Settings, Contact Info, Profile) ═══ */
.side-panel { position:fixed; top:0; bottom:0; width:min(380px, 92vw); background:var(--bg-surface); border-right:1px solid var(--border); z-index:300; display:flex; flex-direction:column; animation:slideInLeft 0.3s ease-out; box-shadow:var(--shadow-lg); }
.side-panel.right { right:0; left:auto; border-right:none; border-left:1px solid var(--border); animation:slideInRight 0.3s ease-out; }
@keyframes slideInLeft { from{transform:translateX(-100%);} to{transform:translateX(0);} }
@keyframes slideInRight { from{transform:translateX(100%);} to{transform:translateX(0);} }
.side-panel-header { display:flex; align-items:center; gap:10px; padding:12px 16px; background:var(--bg-panel); border-bottom:1px solid var(--border); font-weight:700; font-size:0.92rem; }
.side-panel-header .close-btn { background:none; border:none; color:var(--text-dim); font-size:1.2rem; cursor:pointer; padding:4px; transition:var(--transition); }
.side-panel-header .close-btn:hover { color:var(--text-main); }
.side-panel-body { flex:1; overflow-y:auto; padding:12px; }
.panel-section { margin-bottom:14px; background:var(--bg-panel); border:1px solid var(--border); border-radius:var(--radius-md); padding:14px; }
.panel-section-title { font-size:0.72rem; font-weight:700; color:var(--accent-lav); text-transform:uppercase; letter-spacing:1px; margin-bottom:10px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.panel-row { padding:10px 0; font-size:0.85rem; color:var(--text-dim); cursor:pointer; transition:var(--transition); border-radius:6px; padding:8px 10px; }
.panel-row:hover { color:var(--text-main); background:var(--bg-hover); }
.panel-row.danger { color:var(--danger); }
.panel-row.danger:hover { background:rgba(224,144,144,0.08); }
.setting-row { display:flex; align-items:center; justify-content:space-between; padding:8px 0; font-size:0.85rem; color:var(--text-dim); border-bottom:1px solid rgba(255,255,255,0.03); }
.setting-row:last-child { border-bottom:none; }
.setting-row span { display:flex; align-items:center; gap:6px; }

/* Profile */
.profile-header { text-align:center; padding:16px; }
.profile-avatar { width:56px; height:56px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:1.2rem; color:var(--accent-lav); border:2px solid var(--border); margin:0 auto; }
.profile-avatar-xl { width:80px; height:80px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:1.6rem; color:var(--accent-lav); border:3px solid var(--border); box-shadow:0 0 20px rgba(184,160,232,0.1); }
.profile-name { font-weight:700; font-size:1.05rem; margin-top:10px; }
.profile-username { font-size:0.8rem; color:var(--text-dim); }
.profile-edit-header { display:flex; flex-direction:column; gap:12px; }

/* ═══ TOGGLE SWITCHES ═══ */
.switch { position:relative; display:inline-block; width:40px; height:22px; }
.switch input { opacity:0; width:0; height:0; }
.slider { position:absolute; cursor:pointer; top:0; left:0; right:0; bottom:0; background:var(--border); border-radius:22px; transition:var(--transition); }
.slider::before { position:absolute; content:''; height:16px; width:16px; left:3px; bottom:3px; background:var(--text-dim); border-radius:50%; transition:var(--transition); }
input:checked + .slider { background:rgba(184,160,232,0.3); }
input:checked + .slider::before { transform:translateX(18px); background:var(--accent-lav); box-shadow:0 0 8px var(--accent-lav); }

/* ═══ MODALS ═══ */
.modal-overlay { position:fixed; inset:0; background:rgba(7,5,16,0.75); z-index:500; display:flex; align-items:center; justify-content:center; padding:20px; }
.modal-overlay.hidden { display:none !important; }
.modal { background:var(--bg-panel); border:1px solid var(--border-light); border-radius:var(--radius-lg); width:min(440px, 92vw); max-height:80vh; overflow-y:auto; display:flex; flex-direction:column; box-shadow:var(--shadow-lg); }
.modal-sm { width:min(340px, 92vw); }
.modal-header { display:flex; justify-content:space-between; align-items:center; padding:14px 18px; border-bottom:1px solid var(--border); background:var(--bg-surface); border-radius:var(--radius-lg) var(--radius-lg) 0 0; }
.modal-title { font-weight:700; color:var(--accent-lav); font-size:0.95rem; }
.modal-close { background:none; border:none; color:var(--text-dim); font-size:1.4rem; cursor:pointer; transition:var(--transition); line-height:1; }
.modal-close:hover { color:var(--text-main); }
.modal-body { padding:16px 18px; }
.modal-footer { display:flex; justify-content:flex-end; gap:10px; padding:12px 18px; border-top:1px solid var(--border); }
.modal-input { width:100%; background:var(--bg-input); border:1px solid var(--border); padding:10px 12px; border-radius:var(--radius-sm); color:var(--text-main); font-size:0.85rem; outline:none; transition:var(--transition); margin-bottom:10px; }
.modal-input:focus { border-color:var(--accent-lav); box-shadow:0 0 0 2px rgba(184,160,232,0.1); }
.modal-input::placeholder { color:var(--text-muted); }
.modal-btn { padding:8px 16px; background:var(--bg-hover); border:1px solid var(--border); color:var(--text-dim); border-radius:var(--radius-sm); cursor:pointer; font-size:0.82rem; transition:var(--transition); }
.modal-btn:hover { color:var(--text-main); border-color:var(--border-light); }

.emoji-grid { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.emoji-grid span { font-size:1.5rem; cursor:pointer; padding:4px; border-radius:8px; transition:var(--transition); }
.emoji-grid span:hover { transform:scale(1.3); background:var(--bg-hover); }

/* ═══ CONTEXT MENU ═══ */
.context-menu { position:fixed; background:var(--bg-panel); border:1px solid var(--border-light); border-radius:var(--radius-sm); padding:6px 0; z-index:600; min-width:160px; box-shadow:var(--shadow-lg); animation:ctxIn 0.1s ease-out; }
@keyframes ctxIn { from{opacity:0; transform:scale(0.95);} to{opacity:1; transform:scale(1);} }
.context-item { padding:8px 14px; font-size:0.82rem; color:var(--text-dim); cursor:pointer; transition:var(--transition); display:flex; align-items:center; gap:8px; }
.context-item:hover { color:var(--text-main); background:var(--bg-hover); }

/* ═══ TOASTS ═══ */
.toast-container { position:fixed; top:16px; right:16px; z-index:700; display:flex; flex-direction:column; gap:8px; }
.toast { background:var(--bg-panel); border:1px solid var(--border-light); border-radius:var(--radius-md); padding:12px 18px; font-size:0.85rem; color:var(--text-main); box-shadow:var(--shadow-md); animation:toastIn 0.3s ease-out; max-width:320px; word-break:break-word; }
.toast-info { border-left:3px solid var(--accent-lav); }
.toast-success { border-left:3px solid var(--accent-mint); }
.toast-error { border-left:3px solid var(--danger); }
.toast-warning { border-left:3px solid var(--accent-gold); }
@keyframes toastIn { from{opacity:0; transform:translateX(30px);} to{opacity:1; transform:translateX(0);} }

/* ═══ FONT SIZES ═══ */
html[data-font="small"] { font-size:13px; }
html[data-font="large"] { font-size:16px; }

/* ═══ MOBILE ═══ */
@media (max-width: 768px) {
    #sidebar { position:fixed; left:0; top:0; bottom:0; z-index:200; transform:translateX(-100%); }
    #sidebar.open { transform:translateX(0); }
    #chat-area { width:100vw; }
    .back-btn { display:block !important; }
    .chat-actions .chat-action-btn { padding:3px 6px; font-size:0.72rem; }
    .message-bubble { max-width:82%; padding:7px 11px; font-size:0.84rem; }
    .app-header { padding:6px 10px; }
    .header-btn { padding:4px 7px; }
    #chat-input-area { padding:6px 8px; }
    .input-action-btn { width:30px; height:30px; }
}

/* ═══ SCREENS ═══ */
.screen { display:none; }
.screen.active { display:flex !important; }

/* ID-specific overrides for rock-solid screen switching */
#auth-screen:not(.active),
#main-screen:not(.active) { display:none !important; }
#auth-screen.active { display:flex !important; }
#main-screen.active { display:flex !important; }

/* ═══════════════════════════════════════════
   SAYFE VOICE — Discord Alternative CSS
   ═══════════════════════════════════════════ */

/* Mode Switch */
.mode-switch { display:flex; gap:6px; margin-left:16px; background:var(--bg-panel); border-radius:var(--radius-sm); padding:3px; border:1px solid var(--border); }
.mode-btn { background:transparent; border:none; color:var(--text-dim); padding:5px 12px; border-radius:var(--radius-sm); font-size:0.78rem; font-weight:600; cursor:pointer; transition:var(--transition); }
.mode-btn:hover { color:var(--text-main); }
.mode-btn.active { background:var(--accent-lav-soft, rgba(184,160,232,0.15)); color:var(--accent-lav); border:1px solid rgba(184,160,232,0.3); }

/* Voice Body Layout */
.voice-body { display:flex; flex:1; overflow:hidden; }

/* Server Bar (leftmost, like Discord server list) */
#server-bar { width:72px; background:var(--bg-void); border-right:1px solid var(--border); display:flex; flex-direction:column; align-items:center; padding:12px 0; gap:10px; flex-shrink:0; }
.server-header { display:flex; flex-direction:column; gap:8px; margin-bottom:8px; }
.server-header .btn-glow { width:42px; height:42px; border-radius:50%; padding:0; display:flex; align-items:center; justify-content:center; font-size:1.2rem; }
.server-list { display:flex; flex-direction:column; gap:10px; align-items:center; width:100%; overflow-y:auto; flex:1; }
.server-placeholder { font-size:0.65rem; color:var(--text-muted); text-align:center; padding:8px; }
.server-pill { width:48px; height:48px; border-radius:50%; background:var(--bg-panel); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:var(--transition); font-size:0.85rem; font-weight:700; color:var(--text-main); border:2px solid transparent; overflow:hidden; position:relative; }
.server-pill:hover { border-radius:16px; background:var(--accent-lav); color:#fff; }
.server-pill.active { border-radius:16px; background:var(--accent-lav); color:#fff; border-color:var(--accent-peach); }
.server-pill.home { width:48px; height:48px; border-radius:50%; background:var(--accent-peach-soft); color:var(--accent-peach); font-size:1.3rem; border:2px solid var(--accent-peach); }
.server-pill.home:hover { border-radius:16px; background:var(--accent-peach); color:#fff; }
.server-pill.home.active { border-radius:16px; background:var(--accent-peach); color:#fff; border-color:var(--accent-lav); }
.server-pill img { width:100%; height:100%; object-fit:cover; }
.server-pill.server { border-color: var(--accent-mint); }
.server-pill.server.active { background: var(--accent-mint); color: #05080f; }
.server-pill.community { border-color: var(--accent-lav); }
.pill-label { position:absolute; top:-6px; right:-4px; font-size:0.6rem; background:var(--bg-void); border-radius:4px; padding:0 3px; z-index:2; }

/* Server Bottom Tools */
.server-tools { display:flex; flex-direction:column; align-items:center; gap:8px; padding-bottom:12px; width:100%; }
.server-tool-pill { width:48px; height:48px; border-radius:50%; background:var(--bg-panel); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:var(--transition); font-size:1.2rem; font-weight:700; color:var(--accent-mint); border:2px solid var(--accent-mint); overflow:hidden; position:relative; }
.server-tool-pill:hover { border-radius:16px; background:var(--accent-mint); color:#05080f; transform:scale(1.05); }
.server-tool-pill[data-tip]::after { top:-30px; }

/* Friend Nav Items */
.friend-nav-item { display:flex; align-items:center; gap:10px; padding:8px 14px; border-radius:6px; cursor:pointer; transition:all .15s; color:var(--text-dim); font-size:0.85rem; font-weight:500; margin:2px 8px; }
.friend-nav-item:hover { background:rgba(160,144,208,0.08); color:var(--text-main); }
.friend-nav-item.active { background:var(--accent-lav); color:#fff; }
.friend-nav-item .ch-icon { font-size:0.9rem; width:22px; text-align:center; }

#user-bar-status { display:flex; align-items:center; gap:6px; font-size:0.75rem; color:var(--text-dim); transition:background .15s; padding:2px 6px; border-radius:8px; }
#user-bar-status:hover { background:rgba(160,144,208,0.1); }
.status-ring-wrap { width:16px; height:16px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; vertical-align:middle; }
.status-ring { width:16px; height:16px; border-radius:50%; border:2px solid transparent; display:flex; align-items:center; justify-content:center; }
.status-dot { width:8px; height:8px; border-radius:50%; }
.status-label { display:inline-block; vertical-align:middle; }
.status-dot.online { background:var(--accent-mint); box-shadow:0 0 0 2px var(--bg-panel); }
.status-dot.offline { background:rgba(255,255,255,0.12); box-shadow:0 0 0 2px var(--bg-panel); }
.status-dot.dnd { background:#e44; }
.status-dot.idle { background:var(--accent-peach); }

/* Channel Sidebar */
#channel-sidebar { width:240px; background:var(--bg-panel); border-right:1px solid var(--border); display:flex; flex-direction:column; flex-shrink:0; }
.channel-header { padding:14px 16px; font-weight:700; font-size:0.95rem; border-bottom:1px solid var(--border); color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ═══ Discord-Style Community Header ═══ */
.community-header-wrap { display:flex; align-items:center; padding:0; border-bottom:1px solid var(--border); position:relative; background:var(--bg-panel); }
.community-header-main { flex:1; padding:14px 16px; font-weight:700; font-size:0.9rem; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; user-select:none; transition:background .2s; }
.community-header-main:hover { background:rgba(160,144,208,0.08); }
.community-header-main::after { display:none; }
.community-settings-btn { background:none; border:none; color:var(--text-dim); font-size:1rem; cursor:pointer; padding:12px 14px; transition:color .2s; border-left:1px solid var(--border); }
.community-settings-btn:hover { color:var(--accent-lav); }
.community-dropdown { position:absolute; top:100%; left:8px; right:8px; background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:8px 0; z-index:50; box-shadow:0 12px 40px rgba(0,0,0,0.4); animation:ctxIn 0.15s ease; }
.dropdown-item { padding:10px 16px; font-size:0.85rem; color:var(--text-main); cursor:pointer; transition:background .15s; display:flex; align-items:center; gap:8px; }
.dropdown-item:hover { background:rgba(160,144,208,0.1); }
.dropdown-item.danger { color:var(--error); }
.dropdown-item.danger:hover { background:rgba(255,90,90,0.08); }
.dropdown-divider { height:1px; background:var(--border); margin:6px 12px; }
.channel-list { flex:1; overflow-y:auto; padding:8px 0; }
.channel-empty { padding:16px; color:var(--text-muted); font-size:0.8rem; text-align:center; }
.channel-row { display:flex; align-items:center; gap:8px; padding:7px 14px; margin:2px 8px; border-radius:var(--radius-sm); cursor:pointer; transition:var(--transition); color:var(--text-dim); font-size:0.85rem; }
.channel-row:hover { background:rgba(184,160,232,0.08); color:var(--text-main); }
.channel-row.active { background:rgba(184,160,232,0.15); color:var(--accent-lav); }
.channel-row.voice { color:var(--accent-peach); }
.channel-row.voice.active { background:rgba(232,176,144,0.15); color:var(--accent-peach); }
.ch-icon { font-size:0.9rem; width:18px; text-align:center; }
.ch-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Voice Controls Bar (bottom of channel sidebar) */
.voice-controls { display:flex; flex-direction:column; gap:6px; padding:10px 12px; border-top:1px solid var(--border); background:var(--bg-elev); }
.vc-user-bar { display:flex; align-items:center; gap:8px; }
.vc-avatar { width:32px; height:32px; border-radius:50%; background:var(--accent-lav); display:flex; align-items:center; justify-content:center; font-size:0.75rem; font-weight:700; color:#fff; }
.vc-name { font-size:0.8rem; font-weight:600; color:var(--text-main); }
.vc-buttons { display:flex; gap:6px; }
.vc-buttons button { width:32px; height:32px; border-radius:50%; background:var(--bg-panel); border:1px solid var(--border); color:var(--text-dim); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:0.9rem; transition:var(--transition); }
.vc-buttons button:hover { background:var(--accent-lav-soft); color:var(--accent-lav); }
.vc-buttons button.muted { background:var(--accent-red-soft, rgba(200,80,80,0.2)); color:#d44; }
.vc-buttons button.deafened { background:var(--accent-red-soft); color:#d44; }
.vc-buttons button.vc-leave { background:rgba(200,80,80,0.25); color:#e44; }
.vc-buttons button.vc-leave:hover { background:rgba(200,80,80,0.4); }

/* Voice Main Area */
#voice-main { flex:1; display:flex; flex-direction:column; background:var(--bg-void); position:relative; min-height:0; overflow:hidden; }
.voice-welcome { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; padding:40px; text-align:center; }
.welcome-orb { width:80px; height:80px; border-radius:50%; background:var(--accent-lav-soft); display:flex; align-items:center; justify-content:center; font-size:2.2rem; animation:pulse 3s infinite; }
.voice-welcome h2 { font-size:1.6rem; font-weight:700; color:var(--accent-lav); margin:0; }
.voice-welcome p { color:var(--text-dim); font-size:0.9rem; max-width:300px; }
.welcome-actions { display:flex; gap:12px; margin-top:8px; }
.voice-join-prompt { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:var(--bg-void); z-index:10; }
.voice-join-center { display:flex; flex-direction:column; align-items:center; gap:14px; text-align:center; }
.join-orb { width:64px; height:64px; border-radius:50%; background:var(--accent-peach-soft, rgba(232,176,144,0.15)); display:flex; align-items:center; justify-content:center; font-size:1.8rem; }
.join-voice-btn { padding:10px 24px; font-size:0.9rem; }

/* ═══════════════════════════════════════════
   DISCORD-STYLE VOICE ROOM
   ═══════════════════════════════════════════ */
#voice-room { flex:1; display:flex; flex-direction:column; padding:20px; overflow-y:auto; background:var(--bg-void); }

/* Voice Grid - Discord Style */
.voice-grid { 
    display:grid; 
    grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); 
    gap:20px; 
    padding:16px;
    max-width:900px;
    margin:0 auto;
    width:100%;
}

/* Voice User Card */
.voice-user { 
    display:flex; 
    flex-direction:column; 
    align-items:center; 
    gap:10px; 
    padding:20px 16px; 
    border-radius:var(--radius-lg); 
    background:var(--bg-panel); 
    border:2px solid var(--border); 
    transition:all 0.3s ease; 
    position:relative;
    cursor:pointer;
}
.voice-user:hover { 
    border-color:rgba(184,160,232,0.4); 
    transform:translateY(-2px);
    box-shadow:0 8px 32px rgba(0,0,0,0.3);
}
.voice-user.muted { opacity:0.5; }
.voice-user.self { 
    border-color:var(--accent-mint); 
    background:linear-gradient(135deg, var(--bg-panel), rgba(128,200,168,0.08));
}

/* Avatar - Large Discord Style */
.vu-avatar { 
    width:80px; 
    height:80px; 
    border-radius:50%; 
    background:linear-gradient(135deg, var(--accent-lav-soft), var(--bg-elev)); 
    display:flex; 
    align-items:center; 
    justify-content:center; 
    font-size:1.8rem; 
    font-weight:700; 
    color:var(--accent-lav); 
    overflow:hidden;
    position:relative;
    border:3px solid transparent;
    transition:all 0.3s ease;
}
.vu-avatar img { width:100%; height:100%; object-fit:cover; }

/* Speaking Ring - Discord Style Glow */
.voice-user.speaking .vu-avatar { 
    border-color:var(--accent-mint);
    box-shadow:0 0 0 4px rgba(128,200,168,0.3), 0 0 20px rgba(128,200,168,0.2);
    animation:speakPulse 1.5s ease-in-out infinite;
}
@keyframes speakPulse { 
    0%,100%{box-shadow:0 0 0 4px rgba(128,200,168,0.3), 0 0 20px rgba(128,200,168,0.2);} 
    50%{box-shadow:0 0 0 8px rgba(128,200,168,0.15), 0 0 30px rgba(128,200,168,0.3);} 
}

/* Username */
.vu-name { 
    font-size:0.85rem; 
    font-weight:600; 
    color:var(--text-main); 
    text-align:center; 
    white-space:nowrap; 
    overflow:hidden; 
    text-overflow:ellipsis; 
    max-width:100%;
    padding:0 4px;
}

/* Muted Icon Overlay */
.vu-muted { 
    position:absolute; 
    top:12px; 
    right:12px; 
    background:var(--danger); 
    color:#fff; 
    width:24px; 
    height:24px; 
    border-radius:50%; 
    display:flex; 
    align-items:center; 
    justify-content:center; 
    font-size:0.7rem;
    box-shadow:0 2px 8px rgba(0,0,0,0.4);
    z-index:5;
}

/* Deafened Icon */
.vu-deafened {
    position:absolute;
    top:12px;
    right:40px;
    background:#e8a0c0;
    color:#fff;
    width:24px;
    height:24px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:0.7rem;
    box-shadow:0 2px 8px rgba(0,0,0,0.4);
    z-index:5;
}

/* Video Placeholder */
.vu-video {
    width:80px;
    height:80px;
    border-radius:var(--radius-md);
    background:var(--bg-elev);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:2rem;
}

/* Role Badge in Grid */
.voice-user .role-badge {
    position:absolute;
    bottom:8px;
    left:50%;
    transform:translateX(-50%);
    font-size:0.55rem;
    padding:2px 8px;
    border-radius:4px;
    background:rgba(0,0,0,0.5);
}

/* Voice Chat Area (text channel inside community) */
#voice-chat-area { flex:1; display:flex; flex-direction:column; }
#voice-chat-header { padding:12px 16px; border-bottom:1px solid var(--border); font-weight:700; font-size:0.95rem; color:var(--accent-lav); }
#voice-chat-messages { flex:1; overflow-y:auto; padding:12px 16px; display:flex; flex-direction:column; gap:8px; }
.vc-msg { display:flex; gap:10px; align-items:flex-start; animation:msgIn 0.2s ease; }
.vc-msg-avatar { width:34px; height:34px; border-radius:50%; background:var(--accent-lav-soft); display:flex; align-items:center; justify-content:center; font-size:0.75rem; font-weight:700; color:var(--accent-lav); flex-shrink:0; overflow:hidden; }
.vc-msg-avatar img { width:100%; height:100%; object-fit:cover; }
.vc-msg-body { flex:1; min-width:0; }
.vc-msg-meta { display:flex; gap:8px; align-items:center; margin-bottom:2px; }
.vc-msg-name { font-weight:600; font-size:0.82rem; color:var(--text-main); }
.vc-msg-time { font-size:0.65rem; color:var(--text-muted); }
.vc-msg-text { font-size:0.85rem; color:var(--text-dim); line-height:1.4; word-break:break-word; }
#voice-chat-input { display:flex; gap:8px; padding:10px 14px; border-top:1px solid var(--border); background:var(--bg-panel); }
#voice-chat-input input { flex:1; background:var(--bg-input); border:1px solid var(--border); padding:9px 14px; border-radius:var(--radius-sm); color:var(--text-main); font-size:0.9rem; outline:none; }
#voice-chat-input input:focus { border-color:var(--accent-lav); }
#voice-chat-input button { width:36px; height:36px; border-radius:50%; background:var(--accent-lav); color:#fff; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:1rem; }

/* Mobile: hide server bar, collapse channel sidebar */
@media (max-width: 768px) {
    #server-bar { width:72px; padding:8px 0; display:flex; }
    .server-pill { width:40px; height:40px; font-size:0.75rem; }
    #channel-sidebar { width:200px; }
    .voice-grid { grid-template-columns:repeat(auto-fill, minmax(100px, 1fr)); gap:10px; }
    .vu-avatar { width:48px; height:48px; }
}

@media (max-width: 480px) {
    #server-bar { display:none; }
    #channel-sidebar { position:absolute; left:0; top:0; bottom:0; z-index:200; transform:translateX(-100%); transition:transform 0.3s ease; }
    #channel-sidebar.open { transform:translateX(0); }
    .mode-switch { margin-left:6px; }
    .mode-btn { padding:4px 8px; font-size:0.7rem; }
    .voice-grid { grid-template-columns:repeat(2, 1fr); }
}

/* Animation */
@keyframes pulse {
    0%, 100% { transform:scale(1); box-shadow:0 0 0 0 rgba(184,160,232,0.3); }
    50% { transform:scale(1.05); box-shadow:0 0 20px 4px rgba(184,160,232,0.15); }
}

/* ═══════════════════════════════════════════
   DISCORD-INSPIRED ENHANCEMENTS
   ═══════════════════════════════════════════ */

/* Channel Categories */
.channel-category { padding:16px 16px 4px; font-size:0.7rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; display:flex; align-items:center; gap:4px; cursor:pointer; user-select:none; }
.channel-category:hover { color:var(--text-dim); }
.channel-category::before { content:'▸'; font-size:0.65rem; transition:transform 0.2s; }
.channel-category.expanded::before { transform:rotate(90deg); }

/* Role Badges */
.role-badge { font-size:0.6rem; padding:2px 6px; border-radius:4px; font-weight:700; text-transform:uppercase; letter-spacing:0.3px; margin-left:auto; }
.role-badge.owner { background:var(--accent-peach-soft); color:var(--accent-peach); }
.role-badge.admin { background:rgba(128,200,168,0.15); color:var(--accent-mint); }
.role-badge.moderator { background:rgba(160,144,208,0.15); color:var(--accent-lav); }
.role-badge.member { background:var(--bg-elev); color:var(--text-muted); }

/* Member List (right sidebar in voice) */
#member-sidebar { width:200px; background:var(--bg-panel); border-left:1px solid var(--border); display:flex; flex-direction:column; flex-shrink:0; }
.member-header { padding:14px 12px; font-weight:700; font-size:0.85rem; border-bottom:1px solid var(--border); color:var(--text-main); }
.member-list { flex:1; overflow-y:auto; padding:8px; }
.member-row { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:var(--radius-sm); cursor:pointer; transition:var(--transition); }
.member-row:hover { background:rgba(184,160,232,0.08); }
.member-avatar { width:32px; height:32px; border-radius:50%; background:var(--accent-lav-soft); display:flex; align-items:center; justify-content:center; font-size:0.7rem; font-weight:700; color:var(--accent-lav); overflow:hidden; flex-shrink:0; }
.member-avatar img { width:100%; height:100%; object-fit:cover; }
.member-info { flex:1; min-width:0; }
.member-name { font-size:0.82rem; font-weight:600; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.member-status { font-size:0.65rem; color:var(--text-muted); }

/* Status Dots */
.status-dot { width:8px; height:8px; border-radius:50%; position:absolute; bottom:2px; right:2px; border:2px solid var(--bg-panel); }
.status-dot.online { background:var(--accent-mint); }
.status-dot.dnd { background:#e44; }
.status-dot.idle { background:var(--accent-peach); }
.status-dot.offline { background:var(--text-muted); }

/* Voice Member Sidebar — Speaking States */
.member-row.voice-member { position:relative; }
.member-row.voice-member.speaking .member-avatar { box-shadow:0 0 0 2px var(--accent-mint); animation:memberPulse 1.2s infinite; }
.member-row.voice-member.muted .member-status { color:var(--error); }
.member-row.voice-member .speaking-ring { position:absolute; inset:-4px; border-radius:50%; border:2px solid var(--accent-mint); animation:speakRing 1.5s infinite; pointer-events:none; }
.member-row.voice-member .muted-icon { position:absolute; bottom:-2px; right:-2px; font-size:0.6rem; background:var(--bg-panel); border-radius:50%; padding:1px; }
@keyframes memberPulse { 0%,100%{box-shadow:0 0 0 2px var(--accent-mint);} 50%{box-shadow:0 0 0 5px rgba(128,200,168,0.2);} }
@keyframes speakRing { 0%,100%{transform:scale(1);opacity:1;} 50%{transform:scale(1.15);opacity:0.5;} }

/* Server Dividers */
.server-divider { width:32px; height:2px; background:var(--border); border-radius:1px; margin:4px 0; }

/* Channel Unread Badge */
.ch-unread { width:6px; height:6px; border-radius:50%; background:#fff; margin-left:auto; flex-shrink:0; }

/* Voice Activity Bar */
.voice-activity-bar { height:3px; background:var(--accent-mint); border-radius:2px; position:absolute; bottom:0; left:8px; right:8px; transition:width 0.1s; }

/* Collapsible Sections */
.collapsible-section { overflow:hidden; transition:max-height 0.3s ease; }
.collapsible-section.collapsed { max-height:0; }

/* Tooltip (Discord-style) */
[data-tip] { position:relative; }
[data-tip]::after { content:attr(data-tip); position:absolute; left:50%; top:-30px; transform:translateX(-50%); background:#000; color:#fff; padding:4px 8px; border-radius:4px; font-size:0.7rem; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity 0.2s; z-index:1000; }
[data-tip]:hover::after { opacity:1; }

/* Boost Accent */
/* ─── Voice Channel User Avatars (Discord-Style) ─── */
.voice-ch-users { display:flex; align-items:center; margin-left:auto; padding-left:4px; }
.voice-ch-avatar-stack { display:flex; align-items:center; }
.voice-ch-avatar-stack img, 
.voice-ch-avatar-circle { 
    width:18px; height:18px; border-radius:50%; 
    background:var(--accent-lav-soft); 
    display:flex; align-items:center; justify-content:center; 
    font-size:0.55rem; font-weight:700; color:var(--accent-lav); 
    border:2px solid var(--bg-panel); 
    margin-left:-6px; 
    flex-shrink:0;
}
.voice-ch-avatar-stack img:first-child,
.voice-ch-avatar-circle:first-child { margin-left:0; }
.voice-ch-count { font-size:0.65rem; color:var(--text-muted); margin-left:4px; }
.boost-accent { background:linear-gradient(135deg, var(--accent-lav), var(--accent-peach)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-weight:700; }

/* ─── Discord-Style Voice Panel (Bottom Sidebar) ─── */
.voice-vc-panel { background:var(--bg-elev); border-top:1px solid var(--border); padding:10px 12px 14px; display:flex; flex-direction:column; gap:8px; animation:vcSlideUp .25s ease; }
@keyframes vcSlideUp { from{transform:translateY(20px);opacity:0;} to{transform:none;opacity:1;} }

.vc-panel-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:2px; }
.vc-panel-signal { display:flex; align-items:center; gap:8px; }
.vc-signal-icon { display:flex; align-items:flex-end; gap:2px; height:14px; }
.vc-sig-wave { width:2.5px; background:var(--accent-mint); border-radius:1px; animation:vcSigPulse 1s infinite ease-in-out; }
.vc-sig-wave:nth-child(1){ height:6px; animation-delay:0s; }
.vc-sig-wave:nth-child(2){ height:10px; animation-delay:.15s; }
.vc-sig-wave:nth-child(3){ height:14px; animation-delay:.3s; }
@keyframes vcSigPulse { 0%,100%{opacity:.5;transform:scaleY(.6);} 50%{opacity:1;transform:scaleY(1);} }

.vc-panel-info { display:flex; flex-direction:column; }
.vc-panel-status { font-size:.65rem; font-weight:700; color:var(--accent-mint); text-transform:uppercase; letter-spacing:.4px; }
.vc-panel-channel { font-size:.65rem; color:var(--text-muted); margin-top:1px; }
.vc-panel-channel span { color:var(--text-muted); }

.vc-panel-acts { display:flex; gap:6px; align-items:center; }
.vc-p-btn { width:28px; height:28px; border-radius:50%; background:var(--bg-hover); border:none; color:var(--text-dim); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:.15s; }
.vc-p-btn:hover { background:var(--bg-panel); color:var(--text-main); }
.vc-p-btn.muted { background:rgba(224,144,144,0.3) !important; color:var(--danger) !important; }
.vc-p-btn.vc-leave { background:rgba(128,200,168,0.2) !important; color:var(--accent-mint) !important; }
.vc-p-btn.vc-leave:hover { background:rgba(128,200,168,0.35) !important; }

.vc-panel-wave { height:2px; background:rgba(128,200,168,0.15); border-radius:2px; overflow:hidden; }
.vc-panel-wave::after { content:''; display:block; height:100%; width:0%; background:var(--accent-mint); border-radius:2px; transition:width .1s; }
.vc-panel-wave.active::after { width:var(--vol,30%); }

.vc-panel-grid { display:flex; gap:8px; justify-content:center; margin:4px 0; }
.vc-grid-btn { flex:1; height:32px; border-radius:8px; background:var(--bg-hover); border:1px solid var(--border); color:var(--text-dim); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:.15s; }
.vc-grid-btn:hover { background:var(--bg-panel); color:var(--text-main); }
.vc-grid-btn.on-video { background:var(--accent-lav) !important; color:#fff !important; }

.vc-panel-user { display:flex; align-items:center; gap:8px; padding:6px; border-radius:8px; background:var(--bg-panel); margin-top:2px; }
.vc-p-avatar { width:28px; height:28px; border-radius:50%; background:var(--accent-lav); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.75rem; color:#fff; }
.vc-p-name-wrap { flex:1; min-width:0; }
.vc-p-name { font-size:.75rem; font-weight:600; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vc-p-state { font-size:.6rem; color:var(--text-muted); }
.vc-p-settings { width:22px; height:22px; border-radius:50%; background:transparent; border:none; color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:.15s; }
.vc-p-settings:hover { background:var(--bg-hover); color:var(--text-dim); }

/* Voice Connected Mini Avatar Row */
.vc-participants { display:flex; gap:4px; padding:6px 0; justify-content:flex-start; overflow-x:auto; scrollbar-width:none; }
.vc-participants::-webkit-scrollbar { display:none; }
.vc-p-art { width:24px; height:24px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-size:.6rem; color:var(--text-dim); flex-shrink:0; overflow:hidden; }
.vc-p-art img { width:100%; height:100%; object-fit:cover; }
.vc-p-art.spk { box-shadow:0 0 0 2px var(--accent-mint); }

/* ─── Voice DM Chat ─── */
#voice-dm-chat-area { flex:1; display:flex; flex-direction:column; min-height:0; overflow:hidden; }
/* DM-Chat Header Discord-Style */
#voice-dm-chat-header { padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg-panel); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#voice-dm-back { font-size:1.2rem; cursor:pointer; transition:var(--transition); color: var(--text-dim); padding: 4px; border-radius: 8px; }
#voice-dm-back:hover { color:var(--accent-lav); background: rgba(184,160,232,0.08); }
#vc-dm-avatar { width: 36px; height: 36px; border-radius: 50%; font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; background: var(--bg-card); color: var(--text-main); flex-shrink: 0; overflow: hidden; }
#vc-dm-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#vc-dm-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
#vc-dm-name { font-weight: 700; font-size: 0.92rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#vc-dm-status { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#vc-dm-status.online { color: var(--accent-mint); }
#vc-dm-status.dnd { color: #e44; }
#vc-dm-status.idle { color: var(--accent-peach); }
#vc-dm-status.offline { color: var(--text-muted); }
#voice-dm-messages { flex:1; overflow-y:auto; padding:12px 16px; display:flex; flex-direction:column; gap:8px; min-height:0; }
#voice-dm-typing { padding:4px 16px; font-size:0.75rem; color:var(--text-muted); font-style:italic; display:flex; align-items:center; gap:6px; height:20px; }
.typing-dots { display:inline-flex; gap:3px; }
.typing-dots span { width:4px; height:4px; border-radius:50%; background:var(--text-muted); animation: typingDot 1.4s ease-in-out infinite; }
.typing-dots span:nth-child(1){animation-delay:0s}
.typing-dots span:nth-child(2){animation-delay:0.2s}
.typing-dots span:nth-child(3){animation-delay:0.4s}
@keyframes typingDot { 0%,60%,100%{transform:translateY(0);opacity:0.4} 30%{transform:translateY(-4px);opacity:1} }
#voice-dm-input { display:flex; gap:8px; padding:10px 14px; border-top:1px solid var(--border); background:var(--bg-panel); }
#voice-dm-input input { flex:1; background:var(--bg-input); border:1px solid var(--border); padding:9px 14px; border-radius:var(--radius-sm); color:var(--text-main); font-size:0.9rem; outline:none; }
#voice-dm-input input:focus { border-color:var(--accent-peach); }
#voice-dm-input button { width:36px; height:36px; border-radius:50%; background:var(--accent-peach); color:#fff; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:1rem; }

.dm-msg { display:flex; gap:10px; align-items:flex-start; animation:msgIn .2s ease; }
.dm-msg.own { flex-direction:row-reverse; }
.dm-msg-avatar { width:34px; height:34px; border-radius:50%; background:var(--accent-lav-soft); display:flex; align-items:center; justify-content:center; font-size:.75rem; font-weight:700; color:var(--accent-lav); flex-shrink:0; cursor:pointer; }
.dm-msg-avatar img { width:100%; height:100%; object-fit:cover; }
.dm-msg-body { flex:1; min-width:0; }
.dm-msg-name { font-weight:600; font-size:.82rem; color:var(--text-main); }
.dm-msg-text { font-size:.85rem; color:var(--text-dim); line-height:1.4; word-wrap:break-word; }
.dm-msg-time { font-size:.65rem; color:var(--text-muted); margin-top:2px; }
.dm-msg-pill { background:var(--bg-elev); border-radius:var(--radius-md); padding:8px 12px; display:inline-block; }
.dm-msg.own .dm-msg-pill { background:linear-gradient(135deg,rgba(160,144,208,.2),rgba(128,200,168,.15)); }

/* Friend List in Voice */
.friend-list { flex:1; overflow-y:auto; padding:8px; }
.friend-row { display:flex; align-items:center; gap:12px; padding:10px; border-radius:var(--radius-sm); cursor:pointer; transition:background .2s; position:relative; }
.friend-row:hover { background:rgba(160,144,208,.08); }
.friend-row.unread { border-left:3px solid var(--accent-peach); }
.friend-avatar { width:40px; height:40px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.9rem; color:var(--accent-lav); cursor:pointer; }
.friend-info { flex:1; min-width:0; }
.friend-name { font-weight:600; font-size:.85rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.friend-meta { font-size:.72rem; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.friend-status { width:8px; height:8px; border-radius:50%; background:var(--accent-mint); box-shadow:0 0 0 2px var(--bg-panel); }
.friend-status.offline { background:rgba(255,255,255,.12); }
.friend-status.away { background:var(--accent-peach); }
.friend-status.dnd { background:var(--danger); }
.friend-unread { background:var(--accent-peach); color:#000; font-size:.65rem; font-weight:700; padding:1px 6px; border-radius:999px; min-width:18px; text-align:center; }

.friend-section-header { font-size:.7rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; padding:12px 16px 8px; cursor:pointer; }
.friend-section-header::before { content:'▸ '; }
.friend-section-header.expanded::before { content:'▾ '; }

/* ═══════════════════════════════════════════
   DISCORD HOME / FRIENDS VIEW — Full Layout
   ═══════════════════════════════════════════ */

/* ─── Friend View Container ─── */
#friend-view { display:none; flex-direction:row; width:100%; height:100%; overflow:hidden; }
#friend-view.active { display:flex; }

/* ─── DM / Friends Sidebar (Channel Sidebar repurposed) ─── */
#channel-sidebar.friends-mode { display:flex; flex-direction:column; overflow:hidden; }
.dm-search-bar { padding:10px 12px; }
.dm-search-box { background:var(--bg-void); border-radius:4px; padding:6px 10px; font-size:0.78rem; color:var(--text-muted); cursor:text; display:flex; align-items:center; gap:6px; transition:all .15s; }
.dm-search-box:hover { background:var(--bg-hover); color:var(--text-dim); }
.dm-nav-list { flex:1; overflow-y:auto; padding:4px 8px; }
.dm-nav-item { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:4px; cursor:pointer; font-size:0.84rem; color:var(--text-dim); transition:background .15s, color .15s; margin-bottom:2px; }
.dm-nav-item:hover { background:rgba(160,144,208,0.08); color:var(--text-main); }
.dm-nav-item.active { background:rgba(160,144,208,0.12); color:var(--text-main); }
.dm-nav-icon { font-size:1rem; width:22px; text-align:center; }
.dm-nav-badge { margin-left:auto; background:var(--accent-peach); color:#000; font-size:0.6rem; font-weight:700; padding:1px 6px; border-radius:999px; }
.dm-section-header { display:flex; align-items:center; justify-content:space-between; padding:16px 12px 4px; font-size:0.68rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; }
.dm-section-header .plus-btn { font-size:1rem; color:var(--text-muted); cursor:pointer; padding:2px 6px; border-radius:4px; transition:all .15s; }
.dm-section-header .plus-btn:hover { color:var(--text-main); background:rgba(160,144,208,0.1); }
.dm-row { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:4px; cursor:pointer; transition:background .15s; margin-bottom:1px; position:relative; }
.dm-row:hover { background:rgba(160,144,208,0.06); }
.dm-row.active { background:rgba(160,144,208,0.1); }
.dm-row-avatar { width:32px; height:32px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-size:0.75rem; font-weight:700; color:var(--accent-lav); flex-shrink:0; overflow:hidden; }
.dm-row-avatar img { width:100%; height:100%; object-fit:cover; }
.dm-row-info { flex:1; min-width:0; }
.dm-row-name { font-size:0.8rem; font-weight:500; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dm-row-status { font-size:0.7rem; color:var(--text-muted); }
.dm-row-close { opacity:0; font-size:0.7rem; color:var(--text-muted); cursor:pointer; padding:2px 4px; border-radius:3px; transition:all .15s; }
.dm-row:hover .dm-row-close { opacity:1; }
.dm-row-close:hover { color:var(--error); background:rgba(255,90,90,0.1); }
.dm-unread-dot { position:absolute; left:0; top:50%; transform:translateY(-50%); width:4px; height:4px; border-radius:50%; background:var(--accent-peach); }

/* ─── Friends Main Content ─── */
.friends-main-content { flex:1; display:flex; flex-direction:column; background:var(--bg-void); min-width:0; overflow:hidden; }
.friends-main-header { display:flex; align-items:center; gap:16px; padding:16px 20px; flex-shrink:0; }
.friends-main-header .header-title { font-weight:700; font-size:0.95rem; color:var(--text-main); display:flex; align-items:center; gap:8px; }
.friends-main-header .header-tabs { display:flex; gap:4px; margin-left:auto; }
.friends-tab-btn { padding:6px 14px; border-radius:20px; font-size:0.82rem; color:var(--text-dim); cursor:pointer; transition:all .15s; border:none; background:transparent; font-weight:500; }
.friends-tab-btn:hover { background:rgba(160,144,208,0.08); color:var(--text-main); }
.friends-tab-btn.active { background:var(--bg-elev); color:var(--text-main); font-weight:600; }
.friends-add-btn { padding:5px 14px; border-radius:4px; font-size:0.78rem; color:#fff; cursor:pointer; border:none; background:var(--accent-lav); font-weight:600; transition:opacity .15s; }
.friends-add-btn:hover { opacity:0.85; }
.friends-search-box { display:flex; align-items:center; gap:8px; padding:0 20px 16px; flex-shrink:0; }
.friends-search-box input { flex:1; background:var(--bg-void); border:none; border-radius:4px; padding:8px 12px; font-size:0.85rem; color:var(--text-main); outline:none; }
.friends-search-box input:focus { background:var(--bg-surface); }
.friends-section-title { font-size:0.72rem; font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.5px; padding:12px 20px 6px; }
.friends-list-wrap { flex:1; overflow-y:auto; padding:0; }
.friends-section-title { padding:16px 16px 6px; font-size:0.7rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; }
.friend-card-full { display:flex; align-items:center; gap:12px; padding:10px 16px; margin:0 8px; border-radius:8px; cursor:pointer; transition:background .15s; border-bottom:1px solid rgba(255,255,255,0.03); }
.friend-card-full:hover { background:rgba(160,144,208,0.06); }
.friend-card-full .fc-avatar { width:40px; height:40px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-size:0.9rem; font-weight:700; color:var(--accent-lav); flex-shrink:0; overflow:hidden; position:relative; }
.friend-card-full .fc-avatar img { width:100%; height:100%; object-fit:cover; }
.fc-avatar .fc-status { position:absolute; bottom:-1px; right:-1px; width:14px; height:14px; border-radius:50%; border:2.5px solid var(--bg-void); }
.fc-avatar .fc-status.online { background:var(--accent-mint); }
.fc-avatar .fc-status.offline { background:rgba(255,255,255,.15); }
.fc-avatar .fc-status.away { background:var(--accent-peach); }
.fc-avatar .fc-status.dnd { background:var(--danger); }
.fc-avatar .fc-status.game { background:var(--accent-lav); }
.friend-card-full .fc-info { flex:1; min-width:0; }
.fc-info .fc-name { font-weight:600; font-size:0.88rem; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fc-info .fc-status-text { font-size:0.75rem; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:5px; }
.fc-info .fc-status-text .game-icon { font-size:0.8rem; }
.fc-actions { display:flex; gap:6px; opacity:0; transition:opacity .15s; }
.friend-card-full:hover .fc-actions { opacity:1; }
.fc-actions button { width:36px; height:36px; border-radius:50%; background:var(--bg-elev); border:none; color:var(--text-dim); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:0.9rem; transition:all .15s; }
.fc-actions button:hover { background:var(--accent-lav); color:#fff; }

/* ─── Activity Panel ─── */
#member-sidebar.activity-mode { display:flex; flex-direction:column; overflow:hidden; }
.activity-header { padding:16px; font-weight:700; font-size:0.85rem; color:var(--text-main); border-bottom:1px solid var(--border); flex-shrink:0; }
.activity-list { flex:1; overflow-y:auto; padding:8px 0; }
.activity-card { padding:12px 16px; border-bottom:1px solid rgba(255,255,255,0.03); }
.activity-card:hover { background:rgba(160,144,208,0.03); }
.activity-user { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.activity-user .au-avatar { width:32px; height:32px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-size:0.75rem; font-weight:700; color:var(--accent-lav); overflow:hidden; flex-shrink:0; }
.activity-user .au-avatar img { width:100%; height:100%; object-fit:cover; }
.activity-user .au-info { flex:1; min-width:0; }
.au-info .au-name { font-weight:600; font-size:0.82rem; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.au-info .au-detail { font-size:0.7rem; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.activity-game { display:flex; align-items:center; gap:10px; padding:8px; background:var(--bg-void); border-radius:8px; margin-top:6px; }
.activity-game .ag-icon { width:48px; height:48px; border-radius:8px; background:linear-gradient(135deg,rgba(160,144,208,0.2),rgba(128,200,168,0.15)); display:flex; align-items:center; justify-content:center; font-size:1.4rem; flex-shrink:0; }
.activity-game .ag-info { flex:1; min-width:0; }
.ag-info .ag-title { font-weight:600; font-size:0.82rem; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ag-info .ag-sub { font-size:0.7rem; color:var(--text-dim); }

/* ─── Responsive ─── */
.friends-activity-panel { width:300px; flex-shrink:0; border-left:1px solid var(--border); background:var(--bg-void); overflow:hidden; display:flex; flex-direction:column; }
@media (max-width: 1024px) {
    #member-sidebar.activity-mode { display:none; }
    .friends-activity-panel { display:none; }
}
@media (max-width: 768px) {
    .fc-actions { opacity:1; }
}

/* ═══ ENTERPAGE — Post-Login Portal ═══ */
.enterpage {
  position:fixed;
  inset:0;
  background:var(--bg-void);
  display:none;
  flex-direction:column;
  z-index:50;
  overflow-y:auto;
  padding:0 24px 40px;
}
.enterpage.active { display:flex; }

.enter-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
  border-bottom:1px solid var(--border);
  margin-bottom:32px;
  position:sticky;
  top:0;
  background:var(--bg-void);
  z-index:10;
}
.enter-header .logo-glow {
  font-size:1.4rem;
  font-weight:800;
  background:linear-gradient(135deg, var(--accent-lav-bright), var(--accent-peach));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

.enter-hero {
  text-align:center;
  margin-bottom:40px;
  animation:slideUp 0.6s ease-out;
}
.enter-orb {
  font-size:4rem;
  margin-bottom:16px;
  filter:drop-shadow(0 0 20px var(--accent-lav));
  animation:shieldPulse 3s ease-in-out infinite;
}
.enter-hero h1 {
  font-size:2rem;
  font-weight:800;
  letter-spacing:-0.5px;
  background:linear-gradient(135deg, var(--accent-lav-bright), var(--accent-peach));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  margin-bottom:8px;
}
.enter-tagline {
  color:var(--text-dim);
  font-size:1rem;
  max-width:420px;
  margin:0 auto;
}

.enter-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(300px, 1fr));
  gap:24px;
  max-width:840px;
  margin:0 auto;
  width:100%;
  animation:slideUp 0.8s ease-out;
}

.enter-card {
  background:var(--bg-surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:32px 28px;
  cursor:pointer;
  transition:var(--transition);
  position:relative;
  overflow:hidden;
}
.enter-card:hover {
  border-color:var(--border-light);
  transform:translateY(-4px);
  box-shadow:var(--shadow-md), var(--shadow-lav);
}
.enter-glow {
  position:absolute;
  top:-80px; right:-80px;
  width:160px; height:160px;
  border-radius:50%;
  filter:blur(60px);
  opacity:0.2;
  background:var(--accent-lav);
  pointer-events:none;
}
.voice-glow { background:var(--accent-peach); }

.enter-icon {
  font-size:3rem;
  margin-bottom:16px;
}
.enter-card h3 {
  font-size:1.3rem;
  font-weight:700;
  color:var(--text-main);
  margin-bottom:16px;
}
.enter-features {
  list-style:none;
  margin-bottom:24px;
}
.enter-features li {
  color:var(--text-dim);
  font-size:0.88rem;
  padding:6px 0;
  border-bottom:1px solid var(--border);
}
.enter-features li:last-child { border-bottom:none; }

.enter-btn {
  width:100%;
  padding:12px 20px;
  border-radius:var(--radius-md);
  font-weight:600;
  font-size:0.95rem;
  border:none;
  cursor:pointer;
  transition:var(--transition);
  position:relative;
  overflow:hidden;
}
.chat-btn {
  background:linear-gradient(135deg, #3a3060, #2e2450);
  color:var(--text-main);
  box-shadow:0 2px 10px rgba(40,30,80,0.3);
}
.chat-btn:hover { box-shadow:0 4px 20px rgba(40,30,80,0.5); transform:translateY(-2px); }
.voice-btn {
  background:linear-gradient(135deg, #5a2a30, #4a2020);
  color:var(--text-main);
  box-shadow:0 2px 10px rgba(80,30,30,0.3);
}
.voice-btn:hover { box-shadow:0 4px 20px rgba(80,30,30,0.5); transform:translateY(-2px); }

@media (max-width:600px) {
  .enter-grid { grid-template-columns:1fr; }
  .enter-header { padding:10px 0; }
  .enter-card { padding:24px 20px; }
}

/* ═══════════════════════════════════════════════
   DISCORD-STYLE USER BAR (Bottom of Sidebar)
   ═══════════════════════════════════════════════ */
.user-bar {
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  background:var(--bg-panel);
  border-top:1px solid var(--border);
  margin-top:auto;
  flex-shrink:0;
}
.user-bar-avatar {
  width:32px;
  height:32px;
  border-radius:50%;
  background:var(--accent-lav);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:0.8rem;
  color:#fff;
  flex-shrink:0;
  cursor:pointer;
  transition:transform .15s;
}
.user-bar-avatar:hover { transform:scale(1.08); }
.user-bar-info {
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:1px;
}
.user-bar-name {
  font-size:0.78rem;
  font-weight:600;
  color:var(--text-main);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  display:flex;
  align-items:center;
  gap:4px;
}
.user-bar-name .pro-badge {
  font-size:0.55rem;
  font-weight:700;
  background:linear-gradient(135deg, #a090d0, #80c8a8);
  color:#fff;
  padding:1px 5px;
  border-radius:4px;
  letter-spacing:0.03em;
  flex-shrink:0;
}
.user-bar-status {
  font-size:0.65rem;
  color:var(--accent-mint);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:pointer;
  transition:var(--transition);
  padding:2px 4px;
  border-radius:4px;
}
.user-bar-status:hover { color:var(--text-main); background:rgba(184,160,232,0.08); }
.status-edit-wrap { display:flex; gap:4px; align-items:center; width:140px; }
.status-emoji-input {
  width:24px; height:20px; background:var(--bg-void); border:1px solid var(--border);
  border-radius:4px; color:var(--text-main); font-size:0.75rem; text-align:center;
  padding:0; outline:none;
}
.status-text-input {
  flex:1; height:20px; background:var(--bg-void); border:1px solid var(--border);
  border-radius:4px; color:var(--text-main); font-size:0.7rem; padding:0 6px;
  outline:none; min-width:0;
}
.status-emoji-input:focus, .status-text-input:focus { border-color:var(--accent-lav); box-shadow:0 0 8px rgba(160,144,208,.2); }
.user-bar-actions {
  display:flex;
  gap:4px;
}
.user-bar-btn {
  width:28px;
  height:28px;
  border-radius:50%;
  background:transparent;
  border:none;
  color:var(--text-dim);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:0.85rem;
  transition:all .15s;
}
.user-bar-btn:hover {
  background:var(--bg-hover);
  color:var(--text-main);
}
.user-bar-btn.muted {
  background:rgba(224,144,144,0.25) !important;
  color:var(--danger) !important;
}
#sidebar .user-bar { margin-top: auto; }
#channel-sidebar .user-bar { margin-top: auto; border-top: 1px solid var(--border); }

.user-bar-btn.deafened {
  background:rgba(224,144,144,0.25) !important;
  color:var(--danger) !important;
}

/* ═══════════════════════════════════════════════
   DISCORD-STYLE SETTINGS MODAL
   ═══════════════════════════════════════════════ */
.settings-overlay {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.7);
  backdrop-filter:blur(8px);
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
  animation:fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }

.settings-modal {
  width:min(900px, 95vw);
  height:min(650px, 90vh);
  background:var(--bg-surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  display:flex;
  overflow:hidden;
  box-shadow:var(--shadow-lg);
  animation:scaleIn .25s ease;
}
@keyframes scaleIn { from{opacity:0;transform:scale(0.95);} to{opacity:1;transform:scale(1);} }

.settings-close {
  position:absolute;
  top:16px;
  right:16px;
  width:32px;
  height:32px;
  border-radius:50%;
  background:transparent;
  border:none;
  color:var(--text-dim);
  font-size:1.1rem;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .15s;
  z-index:10;
}
.settings-close:hover {
  background:var(--bg-hover);
  color:var(--text-main);
}

.settings-sidebar {
  width:220px;
  background:var(--bg-void);
  border-right:1px solid var(--border);
  padding:20px 0 16px;
  display:flex;
  flex-direction:column;
  flex-shrink:0;
  overflow-y:auto;
}
.settings-nav-title {
  font-size:1.1rem;
  font-weight:700;
  color:var(--text-main);
  padding:0 16px 16px;
}
.settings-nav-section {
  padding:12px 16px 4px;
}
.settings-nav-label {
  font-size:0.65rem;
  font-weight:700;
  color:var(--text-muted);
  text-transform:uppercase;
  letter-spacing:0.8px;
}
.settings-nav-item {
  padding:8px 16px;
  font-size:0.82rem;
  color:var(--text-dim);
  cursor:pointer;
  transition:all .15s;
  border-radius:4px;
  margin:1px 8px;
  display:flex;
  align-items:center;
  gap:8px;
}
.settings-nav-item:hover {
  background:rgba(160,144,208,0.08);
  color:var(--text-main);
}
.settings-nav-item.active {
  background:rgba(160,144,208,0.12);
  color:var(--text-main);
}
.settings-nav-item.danger:hover {
  background:rgba(224,80,80,0.1);
  color:var(--danger);
}

.settings-content {
  flex:1;
  overflow-y:auto;
  padding:24px 32px;
}
.settings-cat {
  animation:fadeIn .3s ease;
}
.settings-cat.hidden {
  display:none;
}
.settings-cat-header {
  font-size:1.3rem;
  font-weight:700;
  color:var(--text-main);
  margin-bottom:20px;
  padding-bottom:12px;
  border-bottom:1px solid var(--border);
}

.settings-card {
  background:var(--bg-panel);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:16px 20px;
  margin-bottom:16px;
}
.settings-card.danger-card {
  border-color:rgba(224,80,80,0.3);
}
.settings-card-title {
  font-size:0.9rem;
  font-weight:600;
  color:var(--text-main);
  margin-bottom:12px;
}
.settings-desc {
  font-size:0.78rem;
  color:var(--text-dim);
  line-height:1.5;
  margin-bottom:12px;
}
.settings-input-row {
  margin-bottom:10px;
}
.settings-input-row label {
  display:block;
  font-size:0.72rem;
  font-weight:600;
  color:var(--text-dim);
  margin-bottom:4px;
  text-transform:uppercase;
  letter-spacing:0.3px;
}
.settings-input {
  width:100%;
  background:var(--bg-void);
  border:1px solid var(--border);
  padding:9px 12px;
  border-radius:var(--radius-sm);
  color:var(--text-main);
  font-size:0.88rem;
  outline:none;
  transition:var(--transition);
}
.settings-input:focus {
  border-color:var(--accent-lav);
  box-shadow:0 0 0 3px rgba(184,160,232,0.1);
}
.settings-avatar-xl {
  width:80px;
  height:80px;
  border-radius:50%;
  background:var(--accent-lav);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:1.8rem;
  color:#fff;
  margin-bottom:16px;
  cursor:pointer;
  transition:transform .15s;
}
.settings-avatar-xl:hover {
  transform:scale(1.05);
}

.settings-toggle-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 0;
  border-bottom:1px solid var(--border);
}
.settings-toggle-row:last-child {
  border-bottom:none;
}
.settings-toggle-row span {
  font-size:0.85rem;
  color:var(--text-main);
}
.settings-slider-row {
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 0;
}
.settings-slider-row label {
  font-size:0.72rem;
  font-weight:600;
  color:var(--text-dim);
  text-transform:uppercase;
}
.settings-slider {
  width:100%;
  height:4px;
  -webkit-appearance:none;
  appearance:none;
  background:var(--bg-hover);
  border-radius:2px;
  outline:none;
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance:none;
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--accent-lav);
  cursor:pointer;
  border:2px solid var(--bg-panel);
}

/* Theme Grid */
.theme-grid {
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
}
.theme-option {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:12px;
  border-radius:var(--radius-sm);
  border:2px solid var(--border);
  cursor:pointer;
  transition:all .15s;
}
.theme-option:hover {
  border-color:var(--border-light);
}
.theme-option.active {
  border-color:var(--accent-lav);
  background:rgba(160,144,208,0.08);
}
.theme-preview {
  width:100%;
  height:50px;
  border-radius:var(--radius-sm);
  border:1px solid var(--border);
}
.theme-label {
  font-size:0.75rem;
  color:var(--text-dim);
}

/* Switch (re-use existing) */
.switch {
  position:relative;
  display:inline-block;
  width:40px;
  height:22px;
}
.switch input { opacity:0; width:0; height:0; }
.slider {
  position:absolute;
  cursor:pointer;
  inset:0;
  background:var(--bg-hover);
  transition:.2s;
  border-radius:22px;
}
.slider:before {
  position:absolute;
  content:"";
  height:16px;
  width:16px;
  left:3px;
  bottom:3px;
  background:var(--text-dim);
  transition:.2s;
  border-radius:50%;
}
input:checked + .slider { background:var(--accent-lav); }
input:checked + .slider:before {
  transform:translateX(18px);
  background:#fff;
}

/* Mobile Settings */
/* ═══ Discord-Style DM Sidebar ═══ */
.dm-search-bar { display:flex; align-items:center; gap:8px; padding:8px 12px; margin:8px; background:var(--bg-void); border-radius:4px; cursor:pointer; transition:background .15s; }
.dm-search-bar:hover { background:var(--bg-surface); }
.dm-search-icon { font-size:0.85rem; opacity:0.5; }
.dm-search-text { font-size:0.8rem; color:var(--text-dim); }
.dm-section-header { display:flex; align-items:center; justify-content:space-between; padding:8px 16px 4px; font-size:0.72rem; font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.5px; }
.dm-section-header .dm-add-btn { width:20px; height:20px; border-radius:4px; border:none; background:transparent; color:var(--text-dim); font-size:1rem; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.dm-section-header .dm-add-btn:hover { color:var(--accent-lav); background:rgba(160,144,208,0.1); }
.dm-row { display:flex; align-items:center; gap:10px; padding:6px 8px; margin:0 6px; border-radius:4px; cursor:pointer; transition:background .15s; }
.dm-row:hover { background:rgba(160,144,208,0.08); }
.dm-row.active { background:rgba(160,144,208,0.15); }
.dm-row .dm-avatar { width:32px; height:32px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-size:0.8rem; font-weight:700; color:var(--accent-lav); flex-shrink:0; position:relative; overflow:hidden; }
.dm-row .dm-avatar img { width:100%; height:100%; object-fit:cover; }
.dm-row .dm-avatar { box-shadow:0 0 0 2px transparent; transition:box-shadow .15s; }
.dm-row .dm-avatar.online { box-shadow:0 0 0 2px var(--accent-mint); }
.dm-row .dm-avatar.dnd { box-shadow:0 0 0 2px #e44; }
.dm-row .dm-avatar.idle { box-shadow:0 0 0 2px var(--accent-peach); }
.dm-row .dm-avatar.offline { box-shadow:0 0 0 2px rgba(255,255,255,0.15); }
.dm-row .dm-status { position:absolute; bottom:-1px; right:-1px; width:10px; height:10px; border-radius:50%; border:2px solid var(--bg-panel); }
.dm-row .dm-status.online { background:var(--accent-mint); }
.dm-row .dm-status.dnd { background:#e44; }
.dm-row .dm-status.idle { background:var(--accent-peach); }
.dm-row .dm-status.offline { background:rgba(255,255,255,0.15); }
.dm-row .dm-name { font-size:0.82rem; font-weight:500; color:var(--text-main); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; min-width:0; }

@media (max-width:768px) {
  .settings-modal {
    width:100vw;
    height:100vh;
    border-radius:0;
  }
  .settings-sidebar {
    width:180px;
  }
  .settings-content {
    padding:16px;
  }
  .theme-grid {
    grid-template-columns:repeat(2, 1fr);
  }
}

/* ═══════════════════════════════════════════
   DISCORD-STYLE USER PROFILE MODAL
   ═══════════════════════════════════════════ */
#profile-modal-overlay { z-index:2500; }
.profile-modal {
  width:340px; max-width:92vw;
  background:linear-gradient(180deg, var(--bg-elev) 0%, var(--bg-panel) 100%);
  border-radius:var(--radius-lg);
  border:1px solid var(--border);
  overflow:hidden;
  animation:modalIn .2s ease;
  box-shadow:0 25px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(160,144,208,.1);
}
.profile-banner {
  height:90px; position:relative; background:linear-gradient(135deg, var(--accent-lav), var(--accent-peach));
}
.profile-banner-gradient {
  position:absolute; inset:0;
  background:linear-gradient(180deg, transparent 40%, var(--bg-elev));
}
.profile-close {
  position:absolute; top:10px; right:10px;
  width:28px; height:28px; border-radius:50%;
  background:rgba(0,0,0,.4); color:#fff;
  border:none; font-size:.9rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:all .15s;
}
.profile-close:hover { background:rgba(200,80,80,.7); }
.profile-modal-body { padding:0 16px 16px; position:relative; }
.profile-avatar-ring {
  position:relative; margin-top:-42px; margin-bottom:10px;
  width:fit-content;
}
.profile-avatar-xl {
  width:84px; height:84px; border-radius:50%;
  background:var(--bg-card);
  display:flex; align-items:center; justify-content:center;
  font-size:2rem; font-weight:800; color:var(--text-main);
  border:6px solid var(--bg-elev);
  box-shadow:0 4px 20px rgba(0,0,0,.3);
  overflow:hidden;
}
.profile-avatar-wrap {
  position:relative;
  display:inline-block;
}
.profile-avatar-wrap .profile-avatar-xl {
  border:3px solid var(--bg-elev);
}
.profile-avatar-wrap.online .profile-status-dot { background:var(--accent-mint); }
.profile-avatar-wrap.dnd .profile-status-dot { background:var(--warn); }
.profile-avatar-wrap.idle .profile-status-dot { background:var(--accent-peach); }
.profile-avatar-wrap.offline .profile-status-dot { background:var(--text-muted); }
.profile-avatar-xl img { width:100%; height:100%; object-fit:cover; }
.profile-status-dot {
  position:absolute; bottom:6px; right:6px;
  width:18px; height:18px; border-radius:50%;
  background:var(--accent-mint);
  border:3px solid var(--bg-elev);
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}
.profile-status-dot.offline { background:var(--text-muted); }
.profile-status-dot.dnd { background:var(--warn); }
.profile-status-dot.away { background:var(--accent-peach); }
.profile-name-block { margin-bottom:12px; }
.profile-display-name {
  font-size:1.35rem; font-weight:800; color:var(--text-main);
  letter-spacing:.3px;
}
.profile-username {
  font-size:.85rem; color:var(--text-muted); font-weight:500;
  margin-top:2px;
}
.profile-badges { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.profile-badge {
  font-size:.65rem; font-weight:700; text-transform:uppercase;
  letter-spacing:1px; padding:3px 8px; border-radius:4px;
  background:linear-gradient(135deg, rgba(160,144,208,.2), rgba(232,176,144,.15));
  color:var(--accent-lav); border:1px solid rgba(160,144,208,.15);
}
.profile-divider {
  height:1px; background:var(--border);
  margin:12px 0;
}
.profile-section { margin-bottom:14px; }
.profile-section-title {
  font-size:.65rem; font-weight:700; text-transform:uppercase;
  letter-spacing:1.5px; color:var(--text-muted); margin-bottom:6px;
}
.profile-custom-status {
  font-size:.78rem; color:var(--accent-mint); font-weight:500;
  margin-top:4px; min-height:18px;
  display:flex; align-items:center; gap:4px;
}
.profile-custom-status:empty { display:none; }
.profile-about {
  font-size:.82rem; color:var(--text-dim); line-height:1.5;
  background:var(--bg-card); padding:10px 12px;
  border-radius:var(--radius-md); border:1px solid var(--border);
}
.profile-meta {
  font-size:.82rem; color:var(--text-dim);
}
.profile-shared-list { display:flex; flex-direction:column; gap:6px; }
.profile-shared-item {
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border-radius:var(--radius-sm);
  background:var(--bg-card); font-size:.8rem;
  color:var(--text-dim); border:1px solid var(--border);
}
.profile-shared-icon {
  width:28px; height:28px; border-radius:50%;
  background:var(--accent-lav-soft);
  display:flex; align-items:center; justify-content:center;
  font-size:.7rem; flex-shrink:0;
}
.profile-actions {
  display:flex; gap:10px; margin-top:16px;
}
.profile-btn {
  flex:1; padding:10px 14px; border-radius:var(--radius-md);
  background:var(--bg-card); color:var(--text-main);
  border:1px solid var(--border); font-size:.8rem; font-weight:600;
  cursor:pointer; transition:all .15s;
}
.profile-btn:hover { background:var(--bg-hover); border-color:var(--accent-lav); }
.profile-btn.primary {
  background:linear-gradient(135deg, var(--accent-lav), var(--accent-peach));
  color:#05080f; border:none; font-weight:700;
}
.profile-btn.primary:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(160,144,208,.3); }
@media(max-width:480px) {
  .profile-modal { width:100vw; border-radius:0; }
}
@keyframes modalIn {
  from { opacity:0; transform:scale(.95) translateY(10px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

.emoji-picker-btn{font-size:1.2rem;padding:4px 6px;cursor:pointer;opacity:0.6;transition:opacity .2s;line-height:1}
.emoji-picker-btn:hover{opacity:1}
.emoji-picker-panel{position:absolute;bottom:52px;left:12px;background:var(--card);border:1px solid var(--border);border-radius:12px;padding:10px;display:none;grid-template-columns:repeat(8,1fr);gap:4px;z-index:100;box-shadow:0 8px 24px rgba(0,0,0,.4);max-width:280px;max-height:220px;overflow-y:auto}
.emoji-picker-panel.open{display:grid}
.emoji-picker-panel span{cursor:pointer;font-size:1.3rem;padding:3px 2px;text-align:center;border-radius:6px;transition:background .15s}
.emoji-picker-panel span:hover{background:rgba(160,144,208,.25)}

#voice-dm-input{position:relative}
.emoji-picker-btn{font-size:1.3rem;padding:4px 6px;cursor:pointer;opacity:0.6;transition:opacity .2s;line-height:1;background:none;border:none;color:var(--text-muted)}
.emoji-picker-btn:hover{opacity:1;color:var(--text-main)}
.emoji-picker-panel{position:absolute;bottom:52px;left:12px;background:var(--card);border:1px solid var(--border);border-radius:12px;padding:10px;display:none;grid-template-columns:repeat(8,1fr);gap:4px;z-index:100;box-shadow:0 8px 24px rgba(0,0,0,.4);max-width:280px;max-height:220px;overflow-y:auto}
.emoji-picker-panel.open{display:grid}
.emoji-picker-panel span{cursor:pointer;font-size:1.3rem;padding:3px 2px;text-align:center;border-radius:6px;transition:background .15s}
.emoji-picker-panel span:hover{background:rgba(160,144,208,.25)}
.dm-bubble .msg-actions{position:absolute;right:4px;top:-10px;display:none;gap:2px;background:var(--card);border:1px solid var(--border);border-radius:6px;padding:2px;z-index:10}
.dm-bubble:hover .msg-actions{display:flex}
.msg-actions button{background:none;border:none;cursor:pointer;font-size:0.85rem;padding:2px 4px;color:var(--text-muted);border-radius:4px}
.msg-actions button:hover{color:var(--text-main);background:rgba(160,144,208,.15)}
.dm-bubble.editing{background:rgba(160,144,208,.12);border:1px dashed var(--accent-lavender)}
.msg-reactions{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.msg-reactions .reaction{background:rgba(255,255,255,.06);border:1px solid var(--border);border-radius:8px;padding:2px 6px;font-size:0.8rem;cursor:pointer;transition:background .2s}
.msg-reactions .reaction:hover{background:rgba(160,144,208,.2)}
.msg-reactions .reaction.me{background:rgba(160,144,208,.3);border-color:var(--accent-lavender)}
.call-btn{background:none;border:none;font-size:1.1rem;cursor:pointer;opacity:0.7;transition:opacity .2s;padding:4px 6px;color:var(--text-main)}
.call-btn:hover{opacity:1}
#p2p-call-overlay{position:fixed;inset:0;background:rgba(5,8,15,.92);z-index:500;display:none;align-items:center;justify-content:center;flex-direction:column;gap:20px}
#p2p-call-overlay.active{display:flex}
.p2p-avatar-ring{width:100px;height:100px;border-radius:50%;border:4px solid var(--accent-mint);display:flex;align-items:center;justify-content:center;font-size:2rem;color:#fff;position:relative;animation:p2pPulse 2s infinite}
@keyframes p2pPulse{0%{box-shadow:0 0 0 0 rgba(128,200,168,.4)}70%{box-shadow:0 0 0 20px rgba(128,200,168,0)}100%{box-shadow:0 0 0 0 rgba(128,200,168,0)}}
.p2p-status{color:var(--text-muted);font-size:0.9rem}
.p2p-controls{display:flex;gap:16px}
.p2p-controls button{width:56px;height:56px;border-radius:50%;border:none;cursor:pointer;font-size:1.4rem;display:flex;align-items:center;justify-content:center;transition:transform .15s}
.p2p-controls button:active{transform:scale(0.95)}
.p2p-red{background:#e44;color:#fff}
.p2p-green{background:var(--accent-mint);color:#fff}
|.p2p-gray{background:rgba(255,255,255,.1);color:#fff}

/* === SERVER MANAGEMENT UI === */

/* Context Menu (Discord-style right-click menu) */
.ctx-menu {
    position: fixed;
    z-index: 1000;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px 0;
    animation: ctxFade 0.12s ease;
}
@keyframes ctxFade { from { opacity:0; transform:scale(0.96); } to { opacity:1; transform:scale(1); } }
.ctx-header {
    padding: 8px 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.ctx-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-dim);
    transition: background .12s, color .12s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ctx-item:hover { background: var(--bg-hover); color: var(--text-main); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(224,144,144,.12); color: var(--danger); }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 10px; }

/* Server Settings Modal (Discord-style sidebar + content) */
.server-settings { display: flex !important; padding: 0 !important; align-items: stretch !important; }
.ss-sidebar {
    width: 210px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ss-side-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ss-tab {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s, transform .1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ss-tab:hover { background: var(--bg-hover); color: var(--text-main); }
.ss-tab.active { background: var(--accent-lav); color: #fff; font-weight: 600; transform: translateX(2px); box-shadow: 0 0 20px rgba(184,160,232,.2); }
.ss-tab.danger { color: var(--danger); }
.ss-tab.danger:hover { background: rgba(224,144,144,.12); color: var(--danger); }
.ss-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    min-height: 0;
}
.ss-pane h2 { margin: 0 0 20px; font-size: 1.1rem; font-weight: 600; color: var(--text-main); }

/* Form inside settings */
.ss-form { max-width: 500px; }
.ss-form label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    margin-bottom: 6px;
    margin-top: 18px;
}
.ss-form input[type="text"],
.ss-form input[type="url"],
.ss-form textarea,
.ss-form select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-stack);
    font-size: 0.92rem;
    transition: border-color .2s, box-shadow .2s;
    resize: vertical;
}
.ss-form input:focus,
.ss-form textarea:focus,
.ss-form select:focus {
    outline: none;
    border-color: var(--accent-lav);
    box-shadow: 0 0 0 3px rgba(184,160,232,.12);
}
.ss-actions { margin-top: 22px; }
.btn-save {
    background: var(--accent-lav);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 28px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
}
.btn-save:hover { background: var(--accent-lav-bright); box-shadow: 0 4px 14px rgba(184,160,232,.3); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-hover); color: var(--text-main); border:1px solid var(--border); border-radius:var(--radius-sm); padding:8px 14px; cursor:pointer; font-size:0.85rem; }
.btn-secondary:hover { background: var(--bg-elev); }
.btn-danger { background: var(--danger); color: #fff; border:none; border-radius:var(--radius-sm); padding:10px 20px; cursor:pointer; font-weight:600; }
.btn-danger:hover { background: #e06060; }
.btn-create { background: none; border: 1px dashed var(--border-light); color: var(--accent-lav); border-radius:var(--radius-sm); padding: 8px 14px; cursor:pointer; margin-top:10px; font-size:0.9rem; transition:all .2s; }
.btn-create:hover { border-color: var(--accent-lav); background: rgba(184,160,232,.06); transform: translateY(-1px); }
.btn-revoke { background: rgba(224,144,144,.1); color: var(--danger); border:1px solid rgba(224,144,144,.2); border-radius:var(--radius-sm); padding:8px 14px; cursor:pointer; margin-top:8px; font-size:0.85rem; }
.btn-revoke:hover { background: rgba(224,144,144,.2); }

/* Channel rows in settings */
.ss-channel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    margin-bottom: 6px;
    border: 1px solid var(--border);
    transition: background .2s, border-color .2s;
}
.ss-channel-row:hover { border-color: var(--border-light); background: var(--bg-hover); }
.ss-ch-type { font-size: 0.85rem; width: 24px; text-align: center; }
.ss-ch-name { flex: 1; font-size: 0.9rem; color: var(--text-main); }
.btn-small { background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-dim); border-radius: 6px; padding: 4px 10px; font-size: 0.78rem; cursor: pointer; transition:all .15s; }
.btn-small:hover { background: var(--bg-elev); color: var(--text-main); }
.btn-small.danger:hover { background: rgba(224,144,144,.15); color: var(--danger); border-color: rgba(224,144,144,.3); }

/* Members list */
.ss-member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: background .12s;
}
.ss-member-row:hover { background: var(--bg-hover); }
.ss-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ss-avatar-fallback {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-lav-soft), var(--bg-elev));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 600; color: var(--accent-lav); flex-shrink: 0;
}
.ss-member-info { flex: 1; }
.ss-member-name { font-size: 0.9rem; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.role-badge { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 10px; font-weight: 600; display: inline-block; }
.role-badge.owner { background: rgba(224,160,160,.18); color: var(--danger); border: 1px solid rgba(224,160,160,.25); }
.role-badge.admin { background: rgba(184,160,232,.18); color: var(--accent-lav); border: 1px solid rgba(184,160,232,.25); }
.role-badge.mod { background: rgba(240,200,160,.18); color: var(--accent-peach); border: 1px solid rgba(240,200,160,.25); }
.role-badge { background: rgba(255,255,255,.06); color: var(--text-muted); border: 1px solid var(--border); }
.role-select { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-main); border-radius: 6px; padding: 4px 8px; font-size: 0.82rem; cursor: pointer; }
.role-select:focus { outline: none; border-color: var(--accent-lav); }

/* Invite row */
.ss-invite-row { display: flex; gap: 8px; align-items: center; }
.ss-invite-row input { flex: 1; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--text-main); font-family: var(--font-stack); font-size: 0.9rem; }

/* Loading */
.ss-loading { color: var(--text-muted); padding: 20px; text-align: center; font-size: 0.9rem; }

/* Modal overlay close button position for wide panels */
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-muted); font-size: 1.6rem; cursor: pointer; z-index: 10; transition: color .2s; }
.modal-close:hover { color: var(--text-main); transform: scale(1.1); }

/* ═══════════════════════════════════════════
   DISCORD-STYLE SETTINGS OVERLAY
   ═══════════════════════════════════════════ */
@keyframes modalIn { from{opacity:0;transform:scale(0.96);} to{opacity:1;transform:scale(1);} }
.settings-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.75); z-index:500; display:none; align-items:center; justify-content:center; animation:fadeIn 0.22s ease; }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
.settings-frame { display:flex; width:min(960px,94vw); height:min(600px,88vh); border-radius:14px; overflow:hidden; box-shadow:0 20px 70px rgba(0,0,0,0.7); background:var(--bg-surface); border:1px solid var(--border-light); animation:modalIn 0.28s cubic-bezier(0.4,0,0.2,1); }

/* Sidebar */
.settings-sidebar { width:220px; min-width:200px; background:var(--bg-panel); display:flex; flex-direction:column; padding:12px 0; border-right:1px solid var(--border); flex-shrink:0; }
.settings-close-x { background:transparent; border:none; color:var(--text-muted); font-size:1.15rem; cursor:pointer; padding:6px 14px; text-align:right; align-self:flex-end; transition:var(--transition); line-height:1; }
.settings-close-x:hover { color:var(--text-main); }
.settings-nav-title { font-size:0.63rem; font-weight:800; color:var(--text-muted); padding:0 14px 8px; letter-spacing:0.09em; text-transform:uppercase; }
.settings-nav { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:2px; padding:0 8px; }
.settings-nav-item { background:transparent; border:none; color:var(--text-dim); padding:7px 10px; border-radius:5px; cursor:pointer; text-align:left; font-size:0.82rem; font-weight:500; transition:var(--transition); white-space:nowrap; display:flex; align-items:center; gap:8px; }
.settings-nav-item:hover { background:rgba(184,160,232,0.07); color:var(--text-main); }
.settings-nav-item.active { background:var(--bg-hover); color:var(--accent-lav); font-weight:600; }
.settings-nav-item.danger:hover { background:rgba(224,80,80,0.07); color:var(--danger); }
.settings-footer { display:flex; align-items:center; gap:10px; padding:10px 12px; margin:10px 10px 0; background:var(--bg-elev); border-radius:10px; border:1px solid var(--border); }
.settings-avatar-sm { width:34px; height:34px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:0.8rem; color:var(--accent-lav); border:2px solid var(--border); flex-shrink:0; }
.settings-username { font-weight:700; font-size:0.82rem; color:var(--text-main); }
.settings-usertag { font-size:0.72rem; color:var(--text-muted); }

/* Content */
.settings-content { flex:1; display:flex; flex-direction:column; min-width:0; background:var(--bg-surface); }
.settings-scroller { flex:1; overflow-y:auto; padding:24px 30px; }
.settings-section { display:none; animation:fadeIn 0.25s ease; max-width:500px; }
.settings-section.active { display:block; }
.settings-section h2 { font-size:1.12rem; font-weight:800; color:var(--text-main); margin-bottom:20px; padding-bottom:12px; border-bottom:1px solid var(--border); letter-spacing:-0.2px; }
.settings-avatar-lg { width:80px; height:80px; border-radius:50%; background:var(--bg-elev); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:2.2rem; color:var(--accent-lav); border:3px solid var(--border); flex-shrink:0; }

/* Rows */
.sett-row { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:16px 0; border-bottom:1px solid var(--border); min-height:50px; }
.sett-row:last-child { border-bottom:none; }
.sett-row label, .sett-row>span:first-child { color:var(--text-main); font-weight:600; font-size:0.87rem; min-width:140px; flex-shrink:0; }
.sett-row>div:not(.switch) { color:var(--text-dim); font-size:0.85rem; flex:1; text-align:right; }
.settings-input { background:var(--bg-input); border:1px solid var(--border); border-radius:8px; padding:9px 12px; color:var(--text-main); font-size:0.85rem; outline:none; width:220px; max-width:100%; transition:var(--transition); font-family:var(--font-stack); }
.settings-input:focus { border-color:var(--accent-lav); box-shadow:0 0 0 3px rgba(184,160,232,0.08); }
.settings-select { background:var(--bg-input); border:1px solid var(--border); border-radius:8px; padding:8px 10px; color:var(--text-main); font-size:0.85rem; outline:none; width:200px; cursor:pointer; transition:var(--transition); font-family:var(--font-stack); }
.settings-select:focus { border-color:var(--accent-lav); }

/* Mobile */
@media(max-width:600px) {
.settings-frame { flex-direction:column; width:100%; height:100vh; border-radius:0; }
.settings-sidebar { width:100%; max-width:none; border-right:none; border-bottom:1px solid var(--border); max-height:42vh; flex:none; overflow-y:auto; }
.settings-nav-title { padding:8px 14px 6px; }
.settings-footer { display:none; }
.settings-scroller { padding:16px 18px; }
}
