:root {
  --bg-primary: #313338;
  --bg-secondary: #2b2d31;
  --bg-tertiary: #1e1f22;
  --bg-floating: #111214;
  --bg-mod: #1e1f22;
  --bg-input: #1e1f22;
  --bg-hover: #35373c;
  --bg-active: #3f4147;
  --bg-msg-hover: #2e3035;
  --text: #dbdee1;
  --text-muted: #949ba4;
  --text-link: #00a8fc;
  --header: #f2f3f5;
  --brand: #5865f2;
  --brand-hover: #4752c4;
  --green: #23a559;
  --green-online: #23a559;
  --red: #f23f43;
  --yellow: #f0b232;
  --idle: #f0b232;
  --dnd: #f23f43;
  --channel: #80848e;
  --interactive: #b5bac1;
  --scrollbar: #1a1b1e;
  --mention: #5865f24d;
  --radius: 8px;
  --font: "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg-tertiary);
  color: var(--text);
  overflow: hidden;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--text-link); }

.login-view {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 10% -10%, #3d46a8 0%, transparent 50%),
    radial-gradient(900px 500px at 110% 110%, #1a3d4d 0%, transparent 45%),
    #1e1f22;
}
.login-card {
  width: min(440px, calc(100% - 32px));
  background: #313338;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
}
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.login-brand h1 { margin: 0; font-size: 24px; color: #fff; letter-spacing: .3px; }
.login-lead { text-align: center; color: var(--text-muted); margin: 8px 0 24px; }
#auth-form { display: flex; flex-direction: column; gap: 14px; }
#auth-form label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
#auth-form input {
  background: var(--bg-input); border: none; color: var(--text);
  padding: 10px; border-radius: 4px; font-size: 16px; outline: none;
  pointer-events: auto; position: relative; z-index: 1;
}
#auth-form input:focus { box-shadow: 0 0 0 2px var(--brand); }
#auth-submit {
  margin-top: 8px; background: var(--brand); color: #fff; border: none;
  border-radius: 4px; padding: 12px; font-size: 16px; font-weight: 600;
}
#auth-submit:hover { background: var(--brand-hover); }
.login-switch { margin: 16px 0 0; color: var(--text-muted); font-size: 14px; }
button.link { background: none; border: none; color: var(--text-link); padding: 0; font-size: 14px; }
.form-error { color: #fa777c; font-size: 13px; margin: 0; }

.app {
  display: grid;
  grid-template-columns: 72px 240px 1fr 240px;
  height: 100%;
}
.app.no-members { grid-template-columns: 72px 240px 1fr 0; }
.app.no-members .members { display: none; }

.servers {
  background: var(--bg-tertiary);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 8px; overflow-y: auto;
}
.servers::-webkit-scrollbar { width: 0; }
.server-pill {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-primary); color: #fff; border: none;
  font-weight: 700; font-size: 16px; position: relative;
  transition: border-radius .15s, background .15s;
}
.server-pill:hover, .server-pill.active { border-radius: 16px; }
.server-pill.active { background: var(--brand); }
.server-pill.home { font-size: 20px; }
.server-pill.add { color: var(--green); background: var(--bg-primary); font-size: 24px; }
.server-pill.add:hover { background: var(--green); color: #fff; }
.server-sep { width: 32px; height: 2px; background: #35363c; border-radius: 1px; }
.unread-dot {
  position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; background: #fff; border-radius: 4px;
}

.sidebar { background: var(--bg-secondary); display: flex; flex-direction: column; min-width: 0; }
.sidebar-head {
  height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 0 rgba(0,0,0,.2); font-weight: 700; color: #fff; font-size: 16px;
}
.sidebar-head button { background: none; border: none; color: var(--interactive); font-size: 20px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }

.cat { margin: 16px 8px 4px; font-size: 12px; font-weight: 700; color: var(--channel); text-transform: uppercase; letter-spacing: .4px; }
.ch {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 4px; color: var(--channel);
  background: none; border: none; width: 100%; text-align: left; font-size: 16px;
}
.ch:hover { background: var(--bg-hover); color: var(--interactive); }
.ch.active { background: var(--bg-active); color: #fff; }
.ch.unread { color: #fff; font-weight: 600; }
.ch svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .8; }
.voice-users { padding: 0 8px 4px 36px; display: flex; flex-direction: column; gap: 2px; }
.voice-user {
  display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 4px;
  font-size: 13px; color: var(--interactive); background: none; border: none; width: 100%; text-align: left;
}
.voice-user.speaking { color: #fff; }
.voice-user.speaking .mini-av { box-shadow: 0 0 0 2px var(--green); }
.mini-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; overflow: hidden; }
.mini-av img { width: 100%; height: 100%; object-fit: cover; }

.dm-item { display: flex; align-items: center; gap: 10px; }
.dm-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.voice-bar {
  background: #232428; padding: 8px; margin: 0 8px 8px; border-radius: 8px;
  border-top: 1px solid #3c3f45;
}
.voice-bar .status { color: var(--green); font-size: 13px; font-weight: 700; }
.voice-bar .room { color: var(--text-muted); font-size: 12px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-actions { display: flex; gap: 3px; }
.voice-actions button {
  width: 32px; height: 32px; background: #313338; border: none; color: var(--text);
  border-radius: 4px; padding: 0; display: flex; align-items: center; justify-content: center;
}
.voice-actions button:hover { background: #3f4147; }
.voice-actions button.danger { color: #fff; background: var(--red); }
.voice-actions button.on { background: var(--brand); color: #fff; }
.voice-actions button svg { width: 16px; height: 16px; }

.conn-quality {
  display: inline-flex; align-items: flex-end; gap: 1px; margin-left: 6px; vertical-align: middle; height: 12px;
}
.conn-quality .cq-bar {
  width: 3px; border-radius: 1px; background: #4e5058;
}
.conn-quality.q-good .cq-bar:nth-child(1) { height: 4px; background: var(--green); }
.conn-quality.q-good .cq-bar:nth-child(2) { height: 7px; background: var(--green); }
.conn-quality.q-good .cq-bar:nth-child(3) { height: 10px; background: var(--green); }
.conn-quality.q-ok .cq-bar:nth-child(1) { height: 4px; background: #faa61a; }
.conn-quality.q-ok .cq-bar:nth-child(2) { height: 7px; background: #faa61a; }
.conn-quality.q-ok .cq-bar:nth-child(3) { height: 10px; background: #4e5058; }
.conn-quality.q-bad .cq-bar:nth-child(1) { height: 4px; background: var(--red); }
.conn-quality.q-bad .cq-bar:nth-child(2) { height: 7px; background: #4e5058; }
.conn-quality.q-bad .cq-bar:nth-child(3) { height: 10px; background: #4e5058; }

.share-quality-menu {
  position: absolute; bottom: 100%; left: 0; margin-bottom: 4px;
  background: #2b2d31; border: 1px solid #3c3f45; border-radius: 6px;
  padding: 8px; min-width: 180px; z-index: 100;
}
.share-quality-menu label {
  display: block; color: var(--text-muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; margin-bottom: 4px; padding: 0 2px;
}
.share-quality-menu select {
  width: 100%; background: #1e1f22; color: #fff; border: 1px solid #3c3f45;
  border-radius: 4px; padding: 4px 6px; font-size: 13px; margin-bottom: 6px; cursor: pointer;
}
.share-quality-menu .sq-start {
  width: 100%; background: var(--brand); color: #fff; border: none; border-radius: 4px;
  padding: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.share-quality-menu .sq-start:hover { filter: brightness(1.1); }

.user-panel {
  height: 52px; background: #232428; display: flex; align-items: center; gap: 8px; padding: 0 8px;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta .name { font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta .sub { font-size: 12px; color: var(--text-muted); }
.user-actions { display: flex; }
.icon-btn {
  width: 32px; height: 32px; border: none; background: transparent; color: var(--interactive);
  border-radius: 4px; font-size: 16px; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--bg-hover); color: #fff; }
.icon-btn.muted { color: var(--red); }

.main { background: var(--bg-primary); display: flex; flex-direction: column; min-width: 0; }
.chat-head {
  height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.2); color: #fff; font-weight: 700;
}
.chat-head .hash { color: var(--channel); font-size: 22px; font-weight: 400; }
.chat-head .topic { color: var(--text-muted); font-weight: 400; font-size: 14px; margin-left: 8px; border-left: 1px solid #3f4147; padding-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 0 8px; min-height: 0; }
.chat-body.voice-active { overflow: hidden; padding: 0; }
.chat-body::-webkit-scrollbar { width: 8px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }

.friends-page { padding: 16px 20px; }
.friends-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.friends-tabs button {
  background: none; border: none; color: var(--interactive); padding: 6px 12px; border-radius: 4px; font-weight: 600;
}
.friends-tabs button.active { background: var(--bg-active); color: #fff; }
.friend-row {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px;
  background: none; border: none; width: 100%; color: var(--text); text-align: left;
}
.friend-row:hover { background: var(--bg-hover); }
.friend-row .grow { flex: 1; }
.friend-row .uname { font-weight: 600; color: #fff; }
.pill { background: var(--brand); color: #fff; border: none; border-radius: 4px; padding: 6px 10px; font-size: 13px; }
.pill.gray { background: #4e5058; }
.pill.green { background: var(--green); }
.pill.red { background: var(--red); }

.date-sep { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; font-weight: 600; margin: 16px 16px 8px; text-transform: uppercase; }
.date-sep::before, .date-sep::after { content: ""; flex: 1; height: 1px; background: #3f4147; }

.msg { display: grid; grid-template-columns: 56px 1fr; padding: 2px 16px; position: relative; }
.msg:hover { background: var(--bg-msg-hover); }
.msg.compact { padding-top: 0; padding-bottom: 0; min-height: 22px; }
.msg.compact .av { visibility: hidden; }
.av {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: #fff; margin-top: 2px; overflow: hidden; flex-shrink: 0;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-weight: 600; color: #fff; }
.msg-time { font-size: 12px; color: var(--text-muted); }
.msg-content { white-space: pre-wrap; word-break: break-word; line-height: 1.375; }
.msg-content a { color: var(--text-link); }
.msg-content code { background: #1e1f22; padding: 2px 4px; border-radius: 4px; font-size: 13px; }
.msg-content .mention { background: var(--mention); color: #c9cdfb; border-radius: 4px; padding: 0 2px; }
.edited { font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.reply-ref { font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.reply-ref span { color: #fff; }
.att-img { max-width: min(420px, 100%); border-radius: 8px; margin-top: 8px; display: block; }
.att-file { display: inline-flex; gap: 8px; margin-top: 8px; background: #2b2d31; padding: 8px 12px; border-radius: 8px; color: var(--text-link); }

.welcome { padding: 16px; color: var(--text-muted); }
.welcome h2 { color: #fff; margin: 0 0 8px; }

.typing { height: 22px; padding: 0 16px; font-size: 13px; color: var(--text-muted); font-style: italic; }

.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 0 16px 24px;
}
.composer-main { flex: 1; background: #383a40; border-radius: 8px; padding: 0 12px; }
#composer-input {
  width: 100%; background: transparent; border: none; color: var(--text);
  padding: 11px 0; font-size: 16px; outline: none;
}
.send-btn { background: var(--brand); color: #fff; border: none; border-radius: 4px; padding: 10px 14px; font-weight: 600; }
.send-btn:hover { background: var(--brand-hover); }
.reply-bar, .attach-preview { font-size: 13px; color: var(--text-muted); padding-top: 8px; display: flex; justify-content: space-between; }
.reply-bar button, .attach-preview button { background: none; border: none; color: var(--text-muted); }

.members { background: var(--bg-secondary); overflow-y: auto; padding: 16px 8px; }
.members h3 { margin: 16px 8px 8px; font-size: 12px; color: var(--channel); text-transform: uppercase; letter-spacing: .4px; }
.member {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px;
  background: none; border: none; width: 100%; color: var(--interactive); text-align: left; font-size: 15px;
}
.member:hover { background: var(--bg-hover); color: #fff; }
.av-wrap { position: relative; }
.status-dot {
  position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px;
  border-radius: 50%; border: 3px solid var(--bg-secondary); background: #80848e;
}
.status-dot.online { background: var(--green-online); }
.status-dot.idle { background: var(--idle); }
.status-dot.dnd { background: var(--dnd); }

.voice-stage { display: flex; flex-wrap: wrap; gap: 16px; padding: 24px; align-content: start; height: 100%; overflow-y: auto; }
.tile {
  width: 280px; min-height: 160px; background: #232428; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden; cursor: pointer;
}
.tile.speaking { box-shadow: 0 0 0 3px var(--green); }
.tile video { width: 100%; height: 180px; object-fit: cover; background: #000; }
.tile .label { position: absolute; left: 8px; bottom: 8px; background: #0008; padding: 2px 8px; border-radius: 4px; font-size: 13px; z-index: 2; }
.tile-fs {
  position: absolute; right: 8px; top: 8px; z-index: 3; width: 32px; height: 32px;
  border: none; border-radius: 6px; background: #0008; color: #fff; display: grid; place-items: center;
  opacity: 0; transition: opacity .15s;
}
.tile-fs svg { width: 18px; height: 18px; }
.tile:hover .tile-fs { opacity: 1; }
.voice-stage.focus-mode { display: grid; grid-template-columns: 1fr 160px; grid-template-rows: 1fr; gap: 12px; padding: 12px; }
.voice-stage.focus-mode .tile { width: 100%; min-height: 72px; height: 90px; }
.voice-stage.focus-mode .tile.focused {
  grid-row: 1; grid-column: 1; height: 100%; min-height: 0;
}
.voice-stage.focus-mode .tile.focused video { height: 100%; object-fit: contain; background: #111; }
.voice-stage.focus-mode .tile:not(.focused) { grid-column: 2; }
.voice-stage.focus-mode .tile.has-video:not(.focused) video { height: 80px; }

.voice-stage-toolbar {
  display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid #3c3f45;
}
.vst-btn {
  display: flex; align-items: center; gap: 4px; background: none; border: none;
  color: var(--text-muted); font-size: 13px; font-weight: 600; padding: 6px 10px;
  border-radius: 4px; cursor: pointer;
}
.vst-btn:hover { background: var(--bg-hover); color: #fff; }
.vst-btn.active { background: var(--bg-active); color: #fff; }
.vst-btn svg { width: 14px; height: 14px; }

.voice-participants {
  padding: 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; height: 100%;
}
.vp-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px;
  background: var(--bg-secondary);
}
.vp-row.speaking { box-shadow: 0 0 0 2px var(--green); }
.vp-row .av { width: 36px; height: 36px; flex-shrink: 0; }
.vp-info { flex: 1; min-width: 0; }
.vp-name { font-size: 14px; font-weight: 600; color: #fff; }
.vp-status { font-size: 12px; color: var(--text-muted); }
.vp-row.speaking .vp-status { color: var(--green); }
.vp-controls { display: flex; align-items: center; gap: 6px; }
.vp-vol {
  width: 80px; height: 4px; -webkit-appearance: none; appearance: none;
  background: #4e5058; border-radius: 2px; outline: none; cursor: pointer;
}
.vp-vol::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; cursor: pointer;
}
.vp-mute {
  width: 28px; height: 28px; border: none; background: none; color: var(--interactive);
  border-radius: 4px; display: grid; place-items: center; cursor: pointer;
}
.vp-mute:hover { background: var(--bg-hover); color: #fff; }
.vp-mute.muted { color: var(--red); }
.vp-mute svg { width: 16px; height: 16px; }

.mobile-bar { display: none; }

.settings-root {
  position: fixed; inset: 0; z-index: 80; background: #313338;
}
.settings { display: grid; grid-template-columns: 218px 1fr; height: 100%; max-width: 1100px; margin: 0 auto; }
.settings-nav {
  background: #2b2d31; padding: 60px 12px 24px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.sn-label { font-size: 12px; font-weight: 700; color: var(--channel); text-transform: uppercase; padding: 0 10px 8px; }
.settings-nav button {
  text-align: left; background: none; border: none; color: var(--interactive);
  padding: 8px 10px; border-radius: 4px; font-size: 16px; font-weight: 500;
}
.settings-nav button:hover { background: var(--bg-hover); color: #fff; }
.settings-nav button.active { background: var(--bg-active); color: #fff; }
.sn-spacer { flex: 1; }
.sn-close { color: var(--text-muted) !important; font-size: 12px !important; font-weight: 700 !important; }
.settings-body { padding: 60px 40px; overflow-y: auto; }
.settings-body h2 { margin: 0 0 20px; color: #fff; }
.settings-body label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 16px; }
.settings-body input, .settings-body select {
  background: var(--bg-input); border: none; color: var(--text); padding: 10px; border-radius: 4px; font-size: 16px; text-transform: none; font-weight: 400;
}
.set-card {
  display: flex; align-items: center; gap: 16px; background: #2b2d31; border-radius: 8px; padding: 16px; margin-bottom: 16px;
}
.set-profile .av.lg, .av.lg { width: 72px; height: 72px; font-size: 28px; }
.set-name { color: #fff; font-weight: 700; font-size: 18px; }
.set-sub { color: var(--text-muted); font-size: 13px; }
.set-actions { margin-top: 32px; }
.danger-text { background: none; border: none; color: #fa777c; font-weight: 600; padding: 0; }
.ghost-btn { background: #4e5058; color: #fff; border: none; border-radius: 4px; padding: 8px 12px; font-weight: 600; margin-bottom: 12px; }
.slider-row { display: flex; align-items: center; gap: 12px; text-transform: none; font-weight: 600; color: #fff; }
.slider-row input[type=range] { flex: 1; accent-color: var(--brand); }
.set-hint { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; text-transform: none; font-weight: 400; }
.check-row { flex-direction: row !important; align-items: center; text-transform: none !important; font-weight: 500 !important; color: var(--text) !important; font-size: 16px !important; }
.check-row input { width: auto; }
.mic-meter { height: 8px; background: #1e1f22; border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.mic-meter div { height: 100%; width: 0; background: var(--green); }
kbd {
  background: #1e1f22; border: 1px solid #3f4147; border-radius: 4px; padding: 4px 8px;
  font-family: inherit; font-size: 13px; color: #fff; margin: 0 2px;
}

.modal-root {
  position: fixed; inset: 0; background: #0009; display: grid; place-items: center; z-index: 50;
}
.modal {
  width: min(440px, calc(100% - 32px)); background: #313338; border-radius: 8px; padding: 24px;
  box-shadow: 0 8px 32px #0008;
}
.modal h2 { margin: 0 0 8px; color: #fff; }
.modal p { color: var(--text-muted); margin: 0 0 16px; }
.modal label { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.modal input, .modal select {
  background: var(--bg-input); border: none; color: var(--text); padding: 10px; border-radius: 4px; font-size: 16px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-actions button { border: none; border-radius: 4px; padding: 10px 16px; font-weight: 600; }
.modal-actions .ghost { background: none; color: #fff; }
.modal-actions .primary { background: var(--brand); color: #fff; }
.invite-code { background: #1e1f22; padding: 12px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; color: #fff; user-select: all; }

.ctx-menu {
  position: fixed; z-index: 60; background: #111214; border-radius: 4px; padding: 6px 0;
  min-width: 160px; box-shadow: 0 8px 16px #0008;
}
.ctx-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); padding: 8px 12px; font-size: 14px;
}
.ctx-menu button:hover { background: var(--brand); color: #fff; }
.ctx-menu button.danger { color: #fa777c; }
.ctx-menu button.danger:hover { background: var(--red); color: #fff; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111214; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 70;
}

.empty { color: var(--text-muted); padding: 16px 8px; font-size: 14px; }

@media (max-width: 980px) {
  .app { grid-template-columns: 72px 200px 1fr; }
  .members { display: none; }
  .app.show-members .members { display: block; position: fixed; right: 0; top: 0; bottom: 0; width: 240px; z-index: 40; }
  .voice-stage.focus-mode { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .voice-stage.focus-mode .tile:not(.focused) { grid-column: 1; }
}

@media (max-width: 720px) {
  html, body { height: 100dvh; }
  .mobile-bar {
    display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px;
    background: var(--bg-tertiary); grid-column: 1 / -1;
  }
  .mobile-bar button { background: none; border: none; color: #fff; font-size: 20px; width: 36px; height: 36px; }
  .mobile-bar span { flex: 1; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 48px 1fr;
  }
  .servers, .sidebar, .members { display: none; }
  .app.show-servers .servers {
    display: flex; position: fixed; left: 0; top: 48px; bottom: 0; z-index: 40; width: 72px;
  }
  .app.show-sidebar .sidebar {
    display: flex; position: fixed; left: 0; top: 48px; bottom: 0; z-index: 40; width: min(280px, 85vw);
  }
  .app.show-members .members {
    display: block; position: fixed; right: 0; top: 48px; bottom: 0; z-index: 40; width: min(240px, 80vw);
  }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { padding: 16px 12px; flex-direction: row; flex-wrap: wrap; }
  .settings-body { padding: 20px 16px; }
}
