* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg-primary: #0c0e14; --bg-secondary: #141720; --bg-tertiary: #1a1e2a;
  --bg-hover: #222638; --bg-raised: #1e2230; --bg-inset: #0a0c12;
  --border: #262a3a; --border-light: #2e3348; --border-dark: #1a1d2a;
  --text-primary: #e4e6f0; --text-muted: #8890a8;
  --accent: #5b8af5; --accent-hover: #4a78e0; --accent-glow: rgba(91,138,245,0.15);
  --danger: #e05555; --green: #43b581; --green-glow: rgba(67,181,129,0.2);
  --yellow: #f0b232; --radius: 8px; --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.3);
  --highlight: inset 0 1px 0 rgba(255,255,255,0.04);
}
html, body { height: 100%; font-family: 'Outfit', sans-serif; background: var(--bg-primary); color: var(--text-primary); }
.hidden { display: none !important; }

/* Login */
#login-screen { display: flex; align-items: center; justify-content: center; height: 100%; background: radial-gradient(ellipse at center, #141720, #0c0e14 70%); }
.login-box { text-align: center; background: var(--bg-secondary); padding: 3rem 2.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border-light); width: 380px; box-shadow: var(--shadow-lg), var(--highlight); }
.login-box h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
.login-box input { width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius); border: 1px solid var(--border-dark); background: var(--bg-inset); color: var(--text-primary); font-family: inherit; font-size: 1rem; outline: none; margin-bottom: 0.75rem; box-shadow: var(--shadow-inset); transition: border-color 0.15s, box-shadow 0.15s; }
.login-box input:focus { border-color: var(--accent); box-shadow: var(--shadow-inset), 0 0 0 2px var(--accent-glow); }
.login-box button#join-btn { width: 100%; padding: 0.75rem; border-radius: var(--radius); border: none; background: linear-gradient(180deg, #6b96f7, #4a78e0); color: #fff; font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.15); }
.login-box button#join-btn:active { transform: translateY(1px); }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-bottom: 0.5rem; }
.success-msg { color: var(--green); font-size: 0.85rem; margin-bottom: 0.5rem; }
.login-tabs { display: flex; margin-bottom: 1.25rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.login-tab { flex: 1; padding: 0.55rem; border: none; background: var(--bg-inset); color: var(--text-muted); font-family: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.login-tab.active { background: var(--bg-tertiary); color: var(--text-primary); }

/* App */
#app { display: flex; height: calc(100% - 34px); }
#channel-bar { width: 260px; min-width: 260px; background: var(--bg-secondary); border-right: 1px solid var(--border-dark); display: flex; flex-direction: column; overflow-y: auto; box-shadow: 2px 0 10px rgba(0,0,0,0.25); position: relative; z-index: 2; }
.cb-header { padding: 0.75rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.4rem; background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent); }
.cb-header h2 { font-size: 1rem; font-weight: 700; flex: 1; }
.cb-icon-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; display: flex; align-items: center; }
.cb-icon-btn:hover { color: var(--text-primary); }
#status-select { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); font-size: 0.75rem; padding: 1px 2px; outline: none; cursor: pointer; }
.dot-connected { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green-glow); flex-shrink: 0; }
.dot-disconnected { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.status-dot-sm { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cb-section { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.cb-section:last-child { border-bottom: none; flex: 1; overflow-y: auto; }
.cb-section-head { display: flex; align-items: center; justify-content: space-between; padding: 0.3rem 0.75rem; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.cb-add { width: 20px; height: 20px; border-radius: 4px; border: none; background: transparent; color: var(--text-muted); font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cb-add:hover { color: var(--text-primary); background: var(--bg-hover); }

/* Channels */
.channel-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; margin: 1px 0.4rem; border-radius: 6px; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; transition: all 0.1s; position: relative; }
.channel-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.channel-item.active { background: var(--bg-raised); color: var(--text-primary); font-weight: 500; box-shadow: var(--shadow-sm), var(--highlight); border: 1px solid var(--border); }
.channel-item.muted-ch { opacity: 0.5; }
.ch-hash { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }
.ch-delete { margin-left: auto; opacity: 0; font-size: 0.75rem; color: var(--text-muted); cursor: pointer; padding: 2px 4px; }
.channel-item:hover .ch-delete { opacity: 1; }
.unread-badge { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--accent); color: #fff; font-size: 0.6rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* Voice */
.vc-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem; margin: 1px 0.4rem; border-radius: 6px; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; transition: all 0.1s; }
.vc-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.vc-item.active { background: var(--bg-raised); color: var(--green); font-weight: 500; box-shadow: var(--shadow-sm), var(--highlight); border: 1px solid var(--border); }
.vc-delete { margin-left: auto; opacity: 0; font-size: 0.75rem; color: var(--text-muted); cursor: pointer; }
.vc-item:hover .vc-delete { opacity: 1; }
.vc-users { padding: 2px 10px 4px 30px; }
.vc-user { display: flex; align-items: center; gap: 5px; padding: 2px 0; font-size: 0.78rem; }
.vc-user .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; transition: box-shadow 0.2s, transform 0.2s; }
.sharing-badge { font-size: 0.65rem; color: var(--accent); margin-left: auto; background: var(--accent-glow); padding: 1px 5px; border-radius: 3px; }
.voice-controls { padding: 0.3rem 0.75rem; display: flex; gap: 0.3rem; }
.voice-controls button { flex: 1; min-width: 55px; display: flex; align-items: center; justify-content: center; gap: 0.25rem; padding: 0.3rem 0.4rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); font-family: inherit; font-size: 0.72rem; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-sm); }
.voice-controls button:hover { background: var(--bg-hover); border-color: var(--accent); }
.voice-controls button:active { transform: translateY(1px); box-shadow: none; }
.voice-controls button.danger { border-color: var(--danger); color: var(--danger); }
.voice-controls button.active-share { border-color: var(--danger); color: var(--danger); }
.audio-settings-btn { display: block; width: calc(100% - 1.5rem); margin: 0.2rem 0.75rem; padding: 0.25rem; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-muted); font-family: inherit; font-size: 0.68rem; cursor: pointer; text-align: center; }
.audio-settings-btn:hover { color: var(--text-primary); border-color: var(--accent); }
#audio-devices { padding: 0.3rem 0.75rem; }
.device-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin: 4px 0 2px; }
.device-select { width: 100%; padding: 0.25rem 0.4rem; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-primary); font-family: inherit; font-size: 0.72rem; outline: none; }

/* Soundboard */
.sound-btn { padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-muted); font-family: inherit; font-size: 0.68rem; cursor: pointer; margin: 2px; }
.sound-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent); }
#sound-buttons { padding: 0 0.75rem 0.3rem; display: flex; flex-wrap: wrap; gap: 2px; }

/* DMs */
.dm-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem; margin: 1px 0.4rem; border-radius: 6px; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; position: relative; }
.dm-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dm-item.active { background: var(--bg-raised); color: var(--text-primary); font-weight: 500; }

/* New channel forms */
#new-channel-form, #new-voice-channel-form { padding: 0.4rem 0.75rem; }
#new-channel-name, #new-voice-channel-name { width: 100%; padding: 0.35rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-primary); font-family: inherit; font-size: 0.82rem; outline: none; margin-bottom: 0.3rem; box-shadow: var(--shadow-inset); }
.ncf-btns { display: flex; gap: 0.3rem; justify-content: flex-end; }
button.sm { padding: 0.25rem 0.6rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); font-family: inherit; font-size: 0.75rem; cursor: pointer; }
button.sm.primary { border: none; background: linear-gradient(180deg, #6b96f7, #4a78e0); color: #fff; }

/* Users */
.cb-users { overflow-y: auto; }
#users { list-style: none; padding: 0 0.75rem; }
#users li { padding: 0.3rem 0; font-size: 0.82rem; display: flex; align-items: center; gap: 0.4rem; position: relative; }
.user-avatar { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.55rem; font-weight: 700; color: #fff; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.user-name { flex: 1; display: flex; align-items: center; gap: 0.2rem; }
.crown { color: var(--yellow); font-size: 0.7rem; }
.shield { font-size: 0.6rem; }
.user-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
#users li:hover .user-actions { opacity: 1; }
.ua-btn { padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-muted); font-family: inherit; font-size: 0.58rem; cursor: pointer; white-space: nowrap; }
.ua-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent); }
.ua-kick { border-color: var(--danger); color: var(--danger); }
.ua-dm { border-color: var(--accent); color: var(--accent); }

/* Chat */
#chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
#chat-header { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg-secondary); font-weight: 600; font-size: 0.95rem; box-shadow: 0 2px 6px rgba(0,0,0,0.15); position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.header-actions { display: flex; gap: 4px; }
.header-btn { background: none; border: 1px solid var(--border); border-radius: 5px; color: var(--text-muted); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.header-btn:hover { color: var(--text-primary); border-color: var(--accent); background: var(--bg-hover); }

/* Search */
#search-bar { display: flex; gap: 6px; padding: 6px 1rem; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
#search-input { flex: 1; padding: 0.4rem 0.75rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-primary); font-family: inherit; font-size: 0.9rem; outline: none; box-shadow: var(--shadow-inset); }
#search-input:focus { border-color: var(--accent); }
#search-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; padding: 0 6px; }
#search-results { padding: 8px 1rem; border-bottom: 1px solid var(--border); background: var(--bg-tertiary); max-height: 200px; overflow-y: auto; font-size: 0.82rem; }

/* Pinned */
#pinned-bar { padding: 6px 1rem; border-bottom: 1px solid var(--border); background: var(--bg-tertiary); max-height: 120px; overflow-y: auto; font-size: 0.8rem; }
.pinned-header { font-weight: 500; font-size: 0.75rem; margin-bottom: 4px; color: var(--text-muted); }
.pinned-msg { padding: 3px 0; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.pinned-msg:last-child { border-bottom: none; }

/* Video */
#video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 6px; padding: 8px; background: var(--bg-inset); max-height: 55vh; overflow-y: auto; }
.video-container { position: relative; background: var(--bg-inset); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/9; box-shadow: var(--shadow-md); }
.video-container video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-label { position: absolute; bottom: 6px; left: 6px; padding: 2px 8px; background: rgba(0,0,0,0.7); border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.video-container.self { border-color: var(--accent); }

/* Messages */
#messages { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; }
.msg { max-width: 85%; padding: 0.15rem 4px; line-height: 1.5; font-size: 0.92rem; position: relative; border-radius: 4px; }
.msg:hover { background: rgba(255,255,255,0.02); }
.msg-header { display: flex; align-items: center; gap: 0.35rem; }
.msg-avatar { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.5rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.msg .msg-author { font-weight: 600; color: var(--accent); font-size: 0.82rem; }
.msg .msg-time { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--text-muted); }
.msg .msg-text { margin-left: 25px; }
.msg-edited { color: var(--text-muted); font-size: 0.7rem; font-style: italic; }
.msg-system { color: var(--text-muted); font-size: 0.78rem; font-style: italic; padding: 0.2rem 0; white-space: pre-wrap; }
.msg-link { color: var(--accent); }
.msg-reply-ref { margin-left: 25px; padding: 2px 8px; margin-bottom: 2px; border-left: 2px solid var(--accent); font-size: 0.75rem; color: var(--text-muted); cursor: pointer; }
.msg-reply-ref:hover { background: var(--bg-hover); }
.msg-reply-ref strong { color: var(--accent); font-weight: 500; }

/* Markdown */
.md-code { background: var(--bg-tertiary); color: var(--green); padding: 1px 4px; border-radius: 3px; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.md-code-block { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin: 4px 0; font-family: 'JetBrains Mono', monospace; font-size: 0.82em; overflow-x: auto; white-space: pre; }

/* Message actions */
.msg-actions { position: absolute; right: 4px; top: -2px; display: none; gap: 2px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 4px; padding: 2px; box-shadow: var(--shadow-sm); }
.msg:hover .msg-actions { display: flex; }
.msg-action-btn { width: 24px; height: 22px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 3px; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; }
.msg-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.msg-delete-btn:hover { color: var(--danger) !important; }

/* Reactions */
.msg-reactions { margin-left: 25px; display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; }
.reaction-pill { display: flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-tertiary); font-size: 0.72rem; cursor: pointer; }
.reaction-pill:hover { border-color: var(--accent); background: var(--accent-glow); }
.reaction-pill.mine { border-color: var(--accent); background: var(--accent-glow); }
.reaction-pill .r-count { color: var(--text-muted); font-size: 0.65rem; }
.reaction-picker { position: absolute; right: 4px; top: -36px; display: flex; gap: 2px; background: var(--bg-raised); border: 1px solid var(--border-light); border-radius: 8px; padding: 4px 6px; box-shadow: var(--shadow-md); z-index: 5; }
.reaction-picker button { width: 26px; height: 24px; border: none; background: transparent; font-size: 0.95rem; cursor: pointer; border-radius: 4px; }
.reaction-picker button:hover { background: var(--bg-hover); }

/* Attachments */
.msg-attachment { margin-left: 25px; margin-top: 4px; }
.msg-attachment img { max-width: 320px; max-height: 300px; border-radius: var(--radius); cursor: pointer; box-shadow: var(--shadow-sm); }
.msg-attachment img:hover { opacity: 0.85; }
.msg-file-link { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.65rem; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius); color: var(--accent); text-decoration: none; font-size: 0.82rem; box-shadow: var(--shadow-sm); }
.msg-file-link:hover { background: var(--bg-hover); }
.file-size { color: var(--text-muted); font-size: 0.72rem; }

/* Typing indicator */
#typing-indicator { padding: 2px 1rem; font-size: 0.75rem; color: var(--text-muted); font-style: italic; min-height: 0; }

/* Reply/Edit bar */
#reply-bar, #edit-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.35rem 1rem; background: var(--bg-tertiary); border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-muted); }
#reply-bar strong, #edit-bar strong { color: var(--accent); }
#reply-cancel, #edit-cancel { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 2px 6px; }

/* Input bar */
#chat-input-bar { display: flex; gap: 0.4rem; padding: 0.6rem 1rem; border-top: 1px solid var(--border); background: var(--bg-secondary); align-items: center; box-shadow: 0 -2px 8px rgba(0,0,0,0.15); }
.icon-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-muted); cursor: pointer; flex-shrink: 0; box-shadow: var(--shadow-sm), var(--highlight); }
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--accent); }
.icon-btn:active { box-shadow: none; transform: translateY(1px); }
.gif-label { font-size: 0.6rem; font-weight: 700; }
#chat-input { flex: 1; padding: 0.5rem 0.8rem; border-radius: var(--radius); border: 1px solid var(--border-dark); background: var(--bg-inset); color: var(--text-primary); font-family: inherit; font-size: 0.9rem; outline: none; box-shadow: var(--shadow-inset); }
#chat-input:focus { border-color: var(--accent); box-shadow: var(--shadow-inset), 0 0 0 2px var(--accent-glow); }
#send-btn { padding: 0.5rem 1rem; border-radius: var(--radius); border: none; background: linear-gradient(180deg, #6b96f7, #4a78e0); color: #fff; font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; flex-shrink: 0; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.15); }
#send-btn:active { transform: translateY(1px); }

/* GIF picker */
#gif-picker { position: absolute; bottom: 55px; left: 1rem; right: 1rem; max-height: 380px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg); display: flex; flex-direction: column; z-index: 10; overflow: hidden; box-shadow: var(--shadow-lg); }
.gif-picker-header { display: flex; gap: 0.4rem; padding: 0.6rem; border-bottom: 1px solid var(--border); }
.gif-picker-header input { flex: 1; padding: 0.4rem 0.6rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-primary); font-family: inherit; font-size: 0.85rem; outline: none; }
.gif-picker-header button { width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-muted); font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#gif-results { flex: 1; overflow-y: auto; padding: 0.4rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 5px; max-height: 280px; }
#gif-results img { width: 100%; border-radius: 6px; cursor: pointer; }
.gif-footer { padding: 0.3rem; text-align: center; font-size: 0.65rem; color: var(--text-muted); border-top: 1px solid var(--border); }

/* Upload preview */
#upload-preview { position: absolute; bottom: 55px; left: 1rem; right: 1rem; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg); z-index: 10; overflow: hidden; box-shadow: var(--shadow-lg); }
#upload-preview-content { padding: 1rem; display: flex; align-items: center; justify-content: center; min-height: 70px; max-height: 280px; overflow: hidden; }
#upload-preview-content img { max-width: 100%; max-height: 260px; border-radius: var(--radius); }
.upload-preview-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.8rem; border-top: 1px solid var(--border); }
.upload-preview-bar span { flex: 1; font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview-bar button { padding: 0.35rem 0.8rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); font-family: inherit; font-size: 0.82rem; cursor: pointer; }
.upload-preview-bar button.primary { border: none; background: var(--accent); color: #fff; }

/* Drag overlay */
#drag-overlay { position: absolute; inset: 0; z-index: 20; background: rgba(12,14,20,0.92); display: flex; align-items: center; justify-content: center; border: 3px dashed var(--accent); border-radius: var(--radius-lg); margin: 8px; }
.drag-text { font-size: 1.2rem; font-weight: 600; color: var(--accent); }

/* Lightbox */
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.88); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: pointer; }
#lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: var(--shadow-lg); }

/* Status bar */
#status-bar { display: flex; align-items: center; justify-content: space-between; padding: 3px 10px; background: linear-gradient(180deg, #151820, #0e1016); border-top: 1px solid var(--border); position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: 34px; box-shadow: 0 -2px 8px rgba(0,0,0,0.2); }
.sb-left, .sb-right { display: flex; align-items: center; gap: 4px; }
.sb-btn { display: flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-muted); font-family: inherit; font-size: 0.7rem; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-sm); }
.sb-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.sb-stream { border-color: var(--green); color: var(--green); }
.sb-stream:hover { background: var(--green-glow); }
.sb-icon-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 5px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; }
.sb-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Panels */
.panel-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.5); }
.panel-box { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg); width: 340px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg), var(--highlight); }
.panel-box-wide { width: 480px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 500; font-size: 14px; }
.panel-close { width: 28px; height: 28px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.panel-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.panel-body { padding: 10px 14px; overflow-y: auto; flex: 1; }
.panel-input { width: 100%; padding: 0.5rem 0.75rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-primary); font-family: inherit; font-size: 0.9rem; outline: none; margin-bottom: 0.5rem; box-shadow: var(--shadow-inset); }
.panel-input:focus { border-color: var(--accent); }
.panel-btn-primary { width: 100%; padding: 0.5rem; border-radius: 6px; border: none; background: linear-gradient(180deg, #6b96f7, #4a78e0); color: #fff; font-family: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.stat-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.stat-label { flex: 1; color: var(--text-muted); }
.stat-value { color: var(--text-primary); font-weight: 500; min-width: 70px; text-align: right; }
.stat-bar { height: 3px; background: var(--bg-inset); border-radius: 2px; margin: 1px 0 6px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s; width: 100%; }
.stat-bar-fill.good { background: var(--green); }
.stat-bar-fill.warn { background: var(--yellow); }
.stat-bar-fill.bad { background: var(--danger); }
.event-row { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--bg-tertiary); font-size: 11px; }
.event-row:last-child { border-bottom: none; }
.event-msg { flex: 1; color: #c8cad4; }
.event-time { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 10px; white-space: nowrap; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
@media (max-width: 700px) { #channel-bar { width: 200px; min-width: 200px; } }
