:root {
  --bg0: #1e1f22; --bg1: #2b2d31; --bg2: #313338; --bg3: #383a40; --bg4: #404249;
  --text: #f2f3f5; --text2: #b5bac1; --text3: #80848e;
  --accent: #f0883e; --accent2: #ffb366; --accent-ink: #1b1209;
  --green: #23a55a; --yellow: #f0b232; --red: #f23f43;
  --mention: rgba(240, 178, 50, .10); --mention-bar: #f0b232;
  --radius: 10px;
  --app-bg: var(--bg2);
  font-family: "gg sans", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg0: #e3e5e8; --bg1: #f2f3f5; --bg2: #ffffff; --bg3: #ebedef; --bg4: #dfe1e5;
  --text: #060607; --text2: #4e5058; --text3: #6d6f78; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg0); color: var(--text); overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent2); }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--text2); }
.small { font-size: 13px; }
.error { color: var(--red); min-height: 1.2em; font-size: 14px; margin: 4px 0; }
svg.i { width: 20px; height: 20px; flex: none; }

/* ---------- Buttons & fields ---------- */
.btn { border: 0; border-radius: 8px; padding: 10px 16px; background: var(--bg4); cursor: pointer; font-weight: 600; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; color: var(--text2); font-size: 18px; flex: none; }
.icon-btn:hover { background: var(--bg4); color: var(--text); }
.icon-btn.active { color: var(--red); }
.icon-btn.danger:hover { color: var(--red); }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; background: var(--bg0); border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; outline: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Auth ---------- */
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(240,136,62,.35), transparent 60%),
              radial-gradient(900px 600px at 90% 90%, rgba(235,69,158,.25), transparent 60%), var(--bg0); }
.auth-card { width: min(420px, 100%); background: var(--bg2); padding: 32px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.45); text-align: center; }
.auth-card .field { text-align: left; }
.auth-logo { display: flex; gap: 10px; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; }
.auth-logo img { width: 40px; height: 40px; }
.auth-card h1 { margin: 16px 0 4px; font-size: 24px; }
.auth:not(.signup) .signup-only { display: none; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 260px 1fr 240px; height: 100dvh; background: var(--app-bg); }
.app.no-members { grid-template-columns: 260px 1fr 0; }
.app.no-members .members { display: none; }
.sidebar { background: var(--bg1); display: flex; flex-direction: column; min-height: 0; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg2); }
[data-gradient] .main { background: transparent; }
[data-gradient] .sidebar, [data-gradient] .members { background: rgba(0,0,0,.22); }
.members { background: var(--bg1); overflow-y: auto; padding: 16px 8px; }

.family-header { display: flex; align-items: center; gap: 10px; padding: 12px 12px; height: 52px; border-bottom: 1px solid rgba(0,0,0,.25); }
.family-icon { width: 28px; height: 28px; }
.family-name { font-weight: 800; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.channel-list { flex: 1; overflow-y: auto; padding: 8px; }
.cat { display: flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; padding: 16px 8px 4px; }
.cat:first-child { padding-top: 4px; }
.ch { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--text3); padding: 7px 8px; border-radius: 6px; cursor: pointer; text-align: left; font-size: 15px; position: relative; }
.ch:hover { background: var(--bg3); color: var(--text2); }
.ch.active { background: var(--bg4); color: var(--text); }
.ch.unread { color: var(--text); font-weight: 600; }
.ch.unread::before { content: ""; position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); }
.ch .hash { font-size: 20px; width: 20px; text-align: center; opacity: .8; }
.ch .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .del { display: none; }
.ch:hover .del { display: inline-grid; }
.ch .del { width: 22px; height: 22px; font-size: 13px; }
.vmembers { padding: 2px 0 6px 34px; }
.vmember { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; font-size: 14px; color: var(--text2); cursor: pointer; }
.vmember:hover { background: var(--bg3); }
.vmember .avatar { width: 24px; height: 24px; font-size: 11px; }
.vmember .flags { margin-left: auto; display: flex; gap: 3px; font-size: 12px; align-items: center; }
.live { background: var(--red); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; letter-spacing: .04em; }

.voice-panel { border-top: 1px solid rgba(0,0,0,.25); padding: 10px; background: var(--bg1); }
.vp-status { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.vp-title { color: var(--green); font-weight: 700; font-size: 14px; }
.vp-sub { color: var(--text2); font-size: 12px; }
.vp-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.vp-btn { border: 0; border-radius: 8px; background: var(--bg3); padding: 7px 4px; cursor: pointer; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text2); }
.vp-btn:hover { background: var(--bg4); color: var(--text); }
.vp-btn.on { background: var(--accent); color: var(--accent-ink); }

.user-panel { display: flex; align-items: center; gap: 6px; padding: 8px; background: var(--bg0); }
.me { flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px; border-radius: 8px; cursor: pointer; min-width: 0; text-align: left; }
.me:hover { background: var(--bg3); }
.me .who { min-width: 0; }
.me .dn { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .st { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-controls { display: flex; }

/* ---------- Avatars ---------- */
.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 16px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg1); background: var(--text3); }
.avatar .dot.online { background: var(--green); }
.avatar .dot.idle { background: var(--yellow); }
.avatar .dot.dnd { background: var(--red); }
.avatar.speaking { box-shadow: 0 0 0 2px var(--bg1), 0 0 0 4px var(--green); }

/* ---------- Header ---------- */
.main-header { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid rgba(0,0,0,.25); flex: none; }
.mh-title { font-weight: 800; white-space: nowrap; }
.mh-topic { color: var(--text2); font-size: 14px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; border-left: 1px solid var(--bg4); }
.mh-topic:empty { border: 0; }
.mobile-only { display: none; }

/* ---------- Chat ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; overscroll-behavior: contain; }
.welcome { padding: 16px 16px 24px; }
.welcome .big { width: 68px; height: 68px; border-radius: 50%; background: var(--bg4); display: grid; place-items: center; font-size: 36px; margin-bottom: 8px; }
.welcome h2 { margin: 0 0 4px; font-size: 28px; }
.load-more { display: block; margin: 0 auto 12px; }
.day { display: flex; align-items: center; gap: 8px; margin: 16px 16px 8px; color: var(--text3); font-size: 12px; font-weight: 600; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--bg4); }
.msg { position: relative; display: grid; grid-template-columns: 56px 1fr; padding: 2px 48px 2px 0; }
.msg.first { margin-top: 14px; }
.msg:hover { background: rgba(0,0,0,.08); }
.msg.mention { background: var(--mention); box-shadow: inset 3px 0 0 var(--mention-bar); }
.msg.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 40% { background: rgba(240,136,62,.25); } 100% { background: transparent; } }
.msg .gutter { display: flex; justify-content: center; padding-top: 2px; }
.msg .gutter .avatar { cursor: pointer; }
.msg .gutter .time { visibility: hidden; font-size: 11px; color: var(--text3); padding-top: 4px; }
.msg:hover .gutter .time { visibility: visible; }
.msg .head { display: flex; gap: 8px; align-items: baseline; }
.msg .author { font-weight: 700; cursor: pointer; }
.msg .author:hover { text-decoration: underline; }
.msg .stamp { font-size: 12px; color: var(--text3); }
.msg .body { line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; white-space: normal; }
.msg .edited { font-size: 11px; color: var(--text3); margin-left: 4px; }
.msg .body.jumbo .emoji, .msg .body.jumbo { font-size: 44px; line-height: 1.2; }
.msg .body.jumbo img.cemoji { width: 48px; height: 48px; }
.reply-ref { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); margin: 2px 0 2px 0; cursor: pointer; grid-column: 2; }
.reply-ref::before { content: ""; width: 26px; height: 10px; border-left: 2px solid var(--bg4); border-top: 2px solid var(--bg4); border-top-left-radius: 6px; margin-left: -34px; margin-top: 8px; }
.reply-ref .avatar { width: 16px; height: 16px; font-size: 8px; }
.reply-ref .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px; }
.body code { background: var(--bg0); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-size: 85%; }
.body pre { background: var(--bg0); padding: 10px; border-radius: 6px; overflow-x: auto; margin: 4px 0; }
.body pre code { background: none; padding: 0; }
.body blockquote { margin: 2px 0; padding-left: 10px; border-left: 4px solid var(--bg4); }
.body .spoiler { background: var(--bg0); color: transparent; border-radius: 4px; cursor: pointer; padding: 0 2px; }
.body .spoiler.shown { background: var(--bg4); color: inherit; }
.body .mention-pill { background: rgba(240,136,62,.25); color: var(--accent2); border-radius: 4px; padding: 0 3px; font-weight: 600; }
img.cemoji { width: 22px; height: 22px; vertical-align: -5px; object-fit: contain; }
.attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; align-items: flex-start; }
.attachments img, .attachments video { max-width: min(420px, 100%); max-height: 340px; border-radius: 8px; cursor: zoom-in; background: var(--bg0); }
.attachments video { cursor: auto; }
.file-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg1); border: 1px solid var(--bg4); border-radius: 8px; max-width: 420px; }
.file-card .fi { font-size: 28px; }
.file-card a { font-weight: 600; word-break: break-all; }
.file-card .sz { font-size: 12px; color: var(--text3); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 8px; background: var(--bg1); border: 1px solid transparent; cursor: pointer; font-size: 14px; }
.reaction:hover { border-color: var(--bg4); }
.reaction.mine { background: rgba(240,136,62,.15); border-color: var(--accent); }
.reaction.super { background: linear-gradient(135deg, rgba(235,69,158,.25), rgba(88,101,242,.25)); }
.reaction.super.mine { border-color: #eb459e; }
.reaction .count { font-size: 13px; font-weight: 600; color: var(--text2); }
.reaction img.cemoji { width: 18px; height: 18px; }
.msg-tools { position: absolute; right: 16px; top: -14px; display: none; background: var(--bg2); border: 1px solid var(--bg4); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 2; }
.msg:hover .msg-tools { display: flex; }
.msg-tools button { width: 32px; height: 30px; font-size: 15px; border-radius: 6px; }
.edit-box textarea { width: 100%; background: var(--bg0); border: 0; border-radius: 8px; padding: 8px 10px; resize: vertical; outline: none; }
.edit-box .hint { font-size: 12px; color: var(--text3); }

.typing { height: 22px; padding: 0 16px; font-size: 13px; color: var(--text2); }
.composer-wrap { padding: 0 16px 16px; }
.composer { display: flex; align-items: flex-end; gap: 4px; background: var(--bg3); border-radius: var(--radius); padding: 6px 8px; }
.composer textarea { flex: 1; background: transparent; border: 0; outline: none; resize: none; max-height: 40vh; padding: 7px 4px; line-height: 1.375; }
.char-count { font-size: 12px; color: var(--text3); align-self: center; }
.char-count.over { color: var(--red); }
.reply-bar { display: flex; align-items: center; gap: 8px; background: var(--bg1); border-radius: var(--radius) var(--radius) 0 0; padding: 8px 12px; font-size: 13px; color: var(--text2); }
.reply-bar b { color: var(--text); }
.pending-files { display: flex; gap: 8px; flex-wrap: wrap; }
.pending-files:not(:empty) { padding: 10px; background: var(--bg3); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--bg4); }
.pf { position: relative; width: 140px; background: var(--bg1); border-radius: 8px; padding: 8px; font-size: 12px; }
.pf .thumb { height: 80px; display: grid; place-items: center; background: var(--bg0); border-radius: 6px; overflow: hidden; font-size: 30px; }
.pf .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pf .nm { margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf .bar { height: 4px; background: var(--bg4); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.pf .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.pf .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--red); color: #fff; cursor: pointer; font-size: 12px; }

/* ---------- Members ---------- */
.mgroup { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; padding: 12px 8px 4px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.member:hover { background: var(--bg3); }
.member.offline { opacity: .4; }
.member .avatar { width: 34px; height: 34px; font-size: 14px; }
.member .nm { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .sub { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .who { min-width: 0; }
.crown { font-size: 12px; margin-left: 4px; }

/* ---------- Stage ---------- */
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #000; }
.stage-grid { flex: 1; display: grid; gap: 8px; padding: 8px; min-height: 0; grid-template-columns: repeat(var(--cols, 2), 1fr); grid-auto-rows: 1fr; }
.stage-grid.focused { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.stage-grid.focused .tile:not(.focus) { display: none; }
.stage-strip { display: flex; gap: 8px; overflow-x: auto; height: 110px; }
.stage-strip .tile { width: 180px; flex: none; display: flex !important; }
.tile { position: relative; background: var(--bg1); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; cursor: pointer; border: 2px solid transparent; }
.tile.speaking { border-color: var(--green); }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile.t-cam video { object-fit: cover; }
.tile.self.t-cam video { transform: scaleX(-1); }
.tile .avatar { width: 88px; height: 88px; font-size: 34px; }
.tile .label { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 13px; display: flex; gap: 6px; align-items: center; max-width: calc(100% - 16px); }
.tile .label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tools { position: absolute; right: 8px; top: 8px; display: none; gap: 4px; }
.tile:hover .tools { display: flex; }
.tile .tools button { background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 13px; }
.tile .q { position: absolute; left: 8px; top: 8px; }
.tile .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(30px) brightness(.5); transform: scale(1.2); }
.tile .waiting { position: relative; color: var(--text2); font-size: 14px; }
.stage-bar { display: flex; justify-content: center; gap: 12px; padding: 12px; flex-wrap: wrap; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--bg3); cursor: pointer; font-size: 20px; display: grid; place-items: center; color: var(--text); }
.round:hover { filter: brightness(1.15); }
.round.on { background: var(--accent); color: var(--accent-ink); }
.round.off { background: #fff; color: var(--red); }
.round.danger { background: var(--red); color: #fff; }

/* ---------- Overlays ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--bg2); border-radius: 14px; width: min(520px, 100%); max-height: 90dvh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal h2 { margin: 0 0 6px; }
.modal.wide { width: min(860px, 100%); padding: 0; display: grid; grid-template-columns: 200px 1fr; height: min(680px, 90dvh); overflow: hidden; }
.settings-nav { background: var(--bg1); padding: 16px 8px; overflow-y: auto; }
.settings-nav button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text2); }
.settings-nav button:hover { background: var(--bg3); }
.settings-nav button.active { background: var(--bg4); color: var(--text); }
.settings-nav .sep { height: 1px; background: var(--bg4); margin: 8px; }
.settings-body { padding: 22px; overflow-y: auto; position: relative; }
.settings-body .close { position: absolute; right: 14px; top: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.choice button { border: 2px solid var(--bg4); background: var(--bg1); border-radius: 10px; padding: 12px; cursor: pointer; text-align: left; }
.choice button.sel { border-color: var(--accent); }
.choice button b { display: block; }
.choice button small { color: var(--text2); }
.swatch { width: 100%; height: 46px; border-radius: 8px; margin-bottom: 8px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bg4); }
.toggle input { width: 40px; height: 22px; accent-color: var(--accent); }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: var(--bg1); margin-bottom: 6px; }
.list-item img { width: 32px; height: 32px; object-fit: contain; }
.list-item .nm { flex: 1; }
.preview-card { border-radius: 12px; overflow: hidden; background: var(--bg0); width: 300px; }
.badge { display: inline-block; background: linear-gradient(135deg, #eb459e, #f0883e); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 10px; letter-spacing: .03em; }

/* profile card */
.profile { width: 320px; border-radius: 12px; overflow: hidden; background: var(--bg0); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.profile .banner { height: 110px; background-size: cover; background-position: center; }
.profile .inner { padding: 0 16px 16px; position: relative; }
.profile .avatar { width: 84px; height: 84px; font-size: 32px; border: 6px solid var(--bg0); margin-top: -46px; }
.profile .avatar .dot { width: 22px; height: 22px; border-width: 4px; border-color: var(--bg0); right: 0; bottom: 0; }
.profile .card { background: var(--bg1); border-radius: 8px; padding: 12px; margin-top: 10px; }
.profile h3 { margin: 6px 0 0; }
.profile .un { color: var(--text2); font-size: 14px; }
.profile .sect { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text2); margin: 10px 0 4px; }
.profile .sect:first-child { margin-top: 0; }
.popover { position: fixed; z-index: 60; }

/* emoji picker */
.picker { width: 360px; height: 400px; background: var(--bg1); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.5); display: flex; flex-direction: column; overflow: hidden; }
.picker .top { padding: 10px; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--bg4); }
.picker input { flex: 1; background: var(--bg0); border: 0; border-radius: 6px; padding: 8px 10px; outline: none; }
.picker .grid { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }
.picker .sec { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; margin: 10px 2px 4px; }
.picker .cells { display: grid; grid-template-columns: repeat(9, 1fr); }
.picker .cells button { border: 0; background: transparent; font-size: 24px; padding: 4px; border-radius: 6px; cursor: pointer; height: 38px; display: grid; place-items: center; }
.picker .cells button:hover { background: var(--bg4); }
.picker .cells img { width: 28px; height: 28px; object-fit: contain; }
.super-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); white-space: nowrap; cursor: pointer; }
.super-toggle.on { color: #eb459e; font-weight: 700; }

/* soundboard */
.sounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.sound { border: 0; border-radius: 10px; background: var(--bg1); padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sound:hover { background: var(--bg4); }
.sound .e { font-size: 26px; }
.sound .n { font-size: 13px; font-weight: 600; text-align: center; word-break: break-word; }
.sound.playing { outline: 2px solid var(--accent); }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: grid; place-items: center; z-index: 70; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 6px; }
.lightbox a { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); }

/* toasts */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none; }
.toast { background: var(--bg0); color: var(--text); padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.4); font-size: 14px; animation: fade .2s; pointer-events: auto; }
.toast.err { border-left: 4px solid var(--red); }

.drop { position: fixed; inset: 0; background: rgba(240,136,62,.25); z-index: 80; display: grid; place-items: center; pointer-events: none; }
.drop div { background: var(--accent); color: var(--accent-ink); padding: 30px 50px; border-radius: 16px; font-size: 22px; font-weight: 800; }

/* super reaction burst */
.burst { position: fixed; pointer-events: none; z-index: 95; font-size: 32px; animation: burst 1.3s ease-out forwards; }
.burst img { width: 36px; height: 36px; }
@keyframes burst { 0% { transform: translate(0,0) scale(.4); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.4) rotate(var(--rot)); opacity: 0; } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg0); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .app, .app.no-members { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 85vw); z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 30px rgba(0,0,0,.4); }
  .app.nav-open .sidebar { transform: none; }
  .members { position: fixed; inset: 0 0 0 auto; width: min(280px, 85vw); z-index: 40; transform: translateX(100%); transition: transform .2s; box-shadow: -10px 0 30px rgba(0,0,0,.4); }
  .app.members-open .members { transform: none; display: block !important; }
  .app.no-members .members { display: block; }
  .mobile-only { display: inline-grid; }
  .msg { padding-right: 8px; }
  .modal.wide { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { display: flex; overflow-x: auto; padding: 8px; }
  .settings-nav button { white-space: nowrap; width: auto; }
  .settings-nav .sep { display: none; }
  .stage-grid { grid-template-columns: 1fr !important; grid-auto-rows: minmax(180px, 1fr); overflow-y: auto; }
  .picker { width: min(360px, 94vw); }
}
