:root {
  --bg: #0b0a12;
  --surface: #14121f;
  --surface-2: #1c1930;
  --surface-3: #272342;
  --line: #2f2a4c;
  --text: #f1eefb;
  --muted: #a39cc0;
  --accent: #a855f7;
  --accent-2: #22d3ee;
  --accent-ink: #0b0a12;
  --danger: #ff4d6d;
  --warn: #facc15;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); overflow: hidden; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; background: rgba(8, 9, 18, .72); padding: 16px; }
.sub { color: var(--muted); margin: 4px 0 0; line-height: 1.45; }
.note { color: var(--warn); min-height: 1em; margin: 0; font-size: 13px; line-height: 1.4; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; }

.primary { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700; }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .6; cursor: progress; }
.primary.big { padding: 13px 18px; font-size: 15px; width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.danger:hover { border-color: var(--danger); color: var(--danger); }
.chip svg { width: 16px; height: 16px; }
.close { background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; width: 36px; height: 36px; border-radius: 10px; }
.close:hover { background: var(--surface-3); color: var(--text); }

.field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.field input, .field select, select#tb-status, #chat-to {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }

/* ---------- entrada ---------- */
.setup { background: radial-gradient(1000px 560px at 15% 5%, #261a3d 0%, transparent 60%), radial-gradient(900px 600px at 95% 95%, #142a33 0%, transparent 55%), var(--bg); overflow: auto; }
.setup-card { box-shadow: var(--shadow); }
.setup.editing { background: rgba(8, 9, 18, .78); }
.setup-card { width: min(920px, 100%); padding: 28px; margin: auto; }
.setup-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.logo { margin: 0; font-family: Orbitron, Inter, "Segoe UI", sans-serif; font-weight: 900; font-size: 38px; letter-spacing: 2px; color: #fff; text-shadow: 0 0 10px rgba(168, 85, 247, .35); display: flex; align-items: center; gap: 12px; }
.logo::before { content: ""; width: 26px; height: 26px; border-radius: 7px; border: 3px solid var(--accent); }
#space-hint { color: var(--accent-2); }
.setup-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.setup-media, .setup-profile { display: grid; gap: 14px; align-content: start; }
.preview { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: #0c0d17; border: 1px solid var(--line); }
.preview video { width: 100%; height: 100%; object-fit: cover; }
.preview video.mirror { transform: scaleX(-1); }
.novideo { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.preview-controls { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); display: grid; place-items: center; backdrop-filter: blur(6px); }
.round:hover { background: rgba(255, 255, 255, .26); }
.round.off { background: var(--danger); color: #fff; }
.avatar-stage { display: grid; place-items: center; background: linear-gradient(180deg, #2a1f4a, #15112a); border: 1px solid var(--line); border-radius: 16px; padding: 6px; }
#avatar-preview { image-rendering: pixelated; }
#avatar-options { display: grid; gap: 8px; }
.opt-row { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 8px; }
.opt-label { color: var(--muted); font-size: 12px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts .chip { padding: 4px 10px; font-size: 12px; text-transform: capitalize; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; background: var(--c); padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.dice { justify-self: start; }
.left-card { padding: 32px; max-width: 420px; text-align: center; display: grid; gap: 14px; }
.left-card h2 { margin: 0; }

/* ---------- mundo ---------- */
#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: pointer; outline: none; }

#topbar { position: fixed; top: 12px; left: 12px; z-index: 10; pointer-events: none; }
#zone-label { display: inline-block; background: rgba(27, 29, 46, .88); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); }
#zone-label.private { border-color: var(--accent); color: var(--accent); }

#videobar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; max-width: calc(100vw - 340px); overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.tile { position: relative; flex: none; width: 176px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 2px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); cursor: zoom-in; transition: border-color .12s; }
.tile.speaking { border-color: var(--accent); }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile video.mirror { transform: scaleX(-1); }
.tile.screen { width: 230px; }
.tile.screen video { object-fit: contain; background: #000; }
.tile .previa-tela { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.28); pointer-events: none; }
.tile.screen .ph { padding-top: 20px; align-items: start; }
.tile.screen .assistir-tela { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -35%); background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.tile.screen.assistindo .assistir-tela { top: 6px; right: 6px; left: auto; transform: none; font-size: 11px; padding: 4px 8px; background: var(--surface-3); border-color: var(--line); }
.tile.screen.assistindo .waiting { top: 40px; }
.tile .ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, #2a1f4a, #15112a); }
.tile .ph canvas { width: 66px; height: 66px; border-radius: 50%; background: #3b2a5a; image-rendering: pixelated; }
.tile .label { position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; align-items: center; gap: 4px; }
.tile .name { background: rgba(10, 11, 22, .72); padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mic-off { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--danger); color: #fff; flex: none; }
.mic-off svg { width: 13px; height: 13px; }
.tile .waiting { position: absolute; top: 6px; left: 6px; font-size: 11px; background: rgba(10, 11, 22, .72); padding: 2px 8px; border-radius: 999px; color: var(--warn); }

#hint { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); background: rgba(27, 29, 46, .92); border: 1px solid var(--accent); border-radius: 999px; padding: 8px 16px; z-index: 10; font-size: 13px; }
kbd { background: var(--surface-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; font-family: inherit; font-weight: 700; }

/* ---------- barra de ferramentas ---------- */
#toolbar { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 7px; background: rgba(27, 29, 46, .94); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px); z-index: 20; max-width: calc(100vw - 16px); overflow-x: auto; }
.tool { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; color: var(--text); flex: none; }
.tool:hover { background: var(--surface-3); }
.tool.active { background: rgba(168, 85, 247, .16); color: var(--accent); }
.tool.off { background: rgba(255, 77, 109, .16); color: var(--danger); }
.tool.danger:hover { color: var(--danger); }
.sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; flex: none; }
.profile-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; border-radius: 12px; padding: 4px 10px 4px 4px; max-width: 170px; flex: none; }
.profile-btn:hover { background: var(--surface-3); }
.profile-btn canvas { width: 30px; height: 30px; border-radius: 50%; background: #3b2a5a; image-rendering: pixelated; flex: none; }
#tb-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
select#tb-status { width: auto; padding: 8px 10px; border-radius: 10px; flex: none; }
select#tb-status option[value="available"] { color: var(--accent); }
.badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.count-badge { position: absolute; bottom: 2px; right: 2px; font-size: 10px; font-weight: 700; color: var(--muted); }

.popover { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); z-index: 30; }
.emotes { display: grid; grid-template-columns: repeat(8, 44px); gap: 4px; padding: 8px; }
.emotes button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; font-size: 24px; }
.emotes button:hover { background: var(--surface-3); transform: scale(1.1); }
.help { width: min(380px, calc(100vw - 24px)); padding: 16px 18px; }
.help h3 { margin: 0 0 10px; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; }
.help dt { font-weight: 700; color: var(--accent); }
.help dd { margin: 0; color: var(--muted); }
.help p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.help strong { color: var(--text); }

/* ---------- painel lateral ---------- */
#panel { position: fixed; top: 12px; right: 12px; bottom: 80px; width: 330px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); z-index: 15; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tabs [data-tab] { background: transparent; border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 600; color: var(--muted); }
.tabs [data-tab].active { background: var(--surface-3); color: var(--text); }
.tabs .close { margin-left: auto; }
.count { color: var(--muted); font-weight: 500; }
.tab-body { flex: 1; overflow: auto; }
#people { list-style: none; margin: 0; padding: 6px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.person:hover { background: var(--surface-2); }
.portrait { border-radius: 50%; background: #3b2a5a; image-rendering: pixelated; flex: none; }
.who { flex: 1; min-width: 0; }
.pname { font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psub { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.pactions { display: flex; gap: 2px; opacity: .55; }
.person:hover .pactions, .pactions:focus-within { opacity: 1; }
.mini { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; font-size: 15px; color: var(--text); }
.mini:hover { background: var(--surface-3); }
.mini svg { width: 16px; height: 16px; }

.chat { display: flex; flex-direction: column; }
#messages { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg .body { min-width: 0; }
.msg .meta { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); }
.msg .meta strong { color: var(--text); font-size: 13px; }
.msg.mine .meta strong { color: var(--accent); }
.msg .text { margin-top: 2px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.tag { background: var(--surface-3); border-radius: 6px; padding: 0 6px; font-size: 11px; }
.tag.dm { background: rgba(168, 85, 247, .16); color: var(--accent); }
#chat-form { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; }
#chat-to { padding: 7px 10px; font-size: 13px; }
.compose { display: flex; gap: 8px; align-items: flex-end; }
#chat-input { flex: 1; resize: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; max-height: 120px; line-height: 1.4; }
#chat-input:focus { border-color: var(--accent); outline: none; }

/* ---------- avisos ---------- */
#toasts { position: fixed; bottom: 86px; right: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(360px, calc(100vw - 28px)); }
body.panel-open #toasts { right: 356px; }
.toast { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); animation: pop .2s ease-out; transition: opacity .35s, transform .35s; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
#banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: #4a2330; border: 1px solid var(--danger); border-radius: 12px; padding: 8px 14px; z-index: 70; display: flex; gap: 12px; align-items: center; }

/* ---------- destaque e quadro ---------- */
.spotlight { background: rgba(5, 6, 12, .92); cursor: zoom-out; }
.spotlight video { max-width: 94vw; max-height: 86vh; border-radius: 14px; background: #000; }
.spotlight video.mirror { transform: scaleX(-1); }
.spot-name { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); font-weight: 600; background: rgba(10, 11, 22, .8); padding: 6px 14px; border-radius: 999px; }
.spotlight .close { position: fixed; top: 16px; right: 16px; }

.board-card { width: min(1280px, 96vw); padding: 12px; display: grid; gap: 10px; }
.board-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-bar strong { margin-right: auto; }
.tool-group { display: flex; gap: 6px; align-items: center; }
.size { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-3); display: grid; place-items: center; padding: 0; }
.size span { background: var(--text); border-radius: 50%; display: block; }
.size.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
#board-canvas { width: 100%; aspect-ratio: 16 / 9; height: auto; background: #fff; border-radius: 10px; cursor: crosshair; touch-action: none; max-height: calc(100vh - 140px); object-fit: contain; }

.help p + p, .help button { margin-top: 10px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
.spacer { flex: 1; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chip:disabled { opacity: .45; cursor: default; }
.chip:disabled:hover { border-color: var(--line); }

/* ---------- diálogos ---------- */
.dialog-overlay { z-index: 80; }
.dialog { width: min(440px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.dialog.wide { width: min(560px, 100%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 8px; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-body { padding: 8px 18px 4px; display: grid; gap: 14px; overflow: auto; }
.dialog-body textarea, .dialog-body .field input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); width: 100%; resize: vertical; }
.dialog-body textarea:focus { border-color: var(--accent); outline: none; }
.dialog-actions { display: flex; gap: 8px; align-items: center; padding: 14px 18px 18px; }
.notes { display: grid; gap: 8px; max-height: 220px; overflow: auto; color: var(--text); }
.note-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.note-item .meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.note-item .meta strong { color: var(--text); }
.note-item .text { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.desk-note { margin: 0; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 8px; color: var(--text); }

/* ---------- editor do escritório ---------- */
#editor { position: fixed; top: 12px; left: 12px; bottom: 80px; width: 300px; z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
body.editing #topbar, body.editing #hint { display: none; }
body.editing #world { cursor: crosshair; }
.editor-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 16px; }
.editor-head h2 { margin: 0; font-size: 16px; }
.editor-tabs { display: flex; gap: 4px; padding: 6px 10px 10px; border-bottom: 1px solid var(--line); }
.editor-tabs button { flex: 1; background: transparent; border: 0; border-radius: 10px; padding: 7px 4px; color: var(--muted); font-weight: 600; font-size: 13px; }
.editor-tabs button.active { background: var(--surface-3); color: var(--text); }
.editor-body { flex: 1; overflow: auto; padding: 12px; display: grid; gap: 12px; align-content: start; }
.editor-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.editor-foot .muted { width: 100%; font-size: 12px; }
.palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile-btn { display: grid; justify-items: center; gap: 4px; padding: 6px 4px; background: var(--surface-2); border: 2px solid transparent; border-radius: 10px; font-size: 11px; color: var(--muted); }
.tile-btn canvas { width: 40px; height: 40px; image-rendering: pixelated; border-radius: 4px; }
.tile-btn:hover { border-color: var(--line); color: var(--text); }
.tile-btn.active { border-color: var(--accent); color: var(--text); }
.zone-list { display: grid; gap: 8px; }
.zone-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 6px; }
.zone-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.zone-row { display: flex; gap: 6px; align-items: center; }
.zone-row input:not([type]), .zone-row select { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.check input { accent-color: var(--accent); }
.size-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#editor hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 4px 0; }
.primary.pulse { box-shadow: 0 0 0 0 rgba(168, 85, 247, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(168, 85, 247, 0); } 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); } }

/* ---------- login ---------- */
.login-card { width: min(420px, 100%); padding: 32px 28px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.login-card .logo { justify-content: center; }
#gsi-button { min-height: 44px; }
#dev-login { display: grid; gap: 10px; width: 100%; }
#dev-login input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); }
button.link { background: none; border: 0; padding: 0; color: var(--accent-2); text-decoration: underline; cursor: pointer; font-size: inherit; }
.mini.danger:hover { color: var(--danger); }
.people-admin { list-style: none; padding: 8px; }

/* ---------- lista de salas (estilo Discord) ---------- */
#channels { position: fixed; top: 52px; left: 12px; bottom: 80px; width: 244px; z-index: 12; background: rgba(20, 18, 31, .95); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(8px); }
.server-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.server-name { font-family: Orbitron, Inter, sans-serif; font-weight: 900; font-size: 18px; letter-spacing: 1px; color: #fff;  }
.server-sub { color: var(--muted); font-size: 12px; }
#channel-list { flex: 1; overflow: auto; padding: 4px 6px 12px; }
.ch-title { text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .07em; color: var(--muted); padding: 12px 8px 4px; }
.ch-name { width: 100%; display: flex; align-items: center; gap: 6px; background: transparent; border: 0; border-radius: 8px; padding: 6px 8px; color: var(--muted); font-weight: 600; text-align: left; }
.ch-name:hover { background: var(--surface-3); color: var(--text); }
.channel.current > .ch-name { background: rgba(168, 85, 247, .2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.ch-icon { display: grid; place-items: center; }
.ch-icon svg { width: 16px; height: 16px; }
.ch-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-count { font-size: 11px; background: var(--surface-3); color: var(--text); border-radius: 999px; padding: 0 7px; }
.ch-members { list-style: none; margin: 2px 0 6px; padding: 0 0 0 20px; display: grid; gap: 1px; }
.ch-group > .ch-members { padding-left: 4px; }
.member { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.member:hover { background: var(--surface-2); color: var(--text); }
.member .avatar-ring { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; display: grid; place-items: center; flex: none; transition: border-color .1s, box-shadow .1s; }
.member.speaking .avatar-ring { border-color: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, .7); }
.member .portrait { width: 22px; height: 22px; }
.member .dot { position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border: 2px solid var(--surface); }
.m-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-muted { color: var(--danger); display: grid; place-items: center; }
.m-muted svg { width: 14px; height: 14px; }
body.editing #channels { display: none; }
.tag.room { background: rgba(34, 211, 238, .15); color: var(--accent-2); }
.tile.speaking { border-color: #4ade80; box-shadow: 0 0 14px rgba(74, 222, 128, .45); }
#zone-label.private { border-color: var(--accent); color: #e9d5ff; }

/* ---------- configurações pessoais ---------- */
.dialog.settings-dialog { width: min(700px, 100%); }
.settings-dialog .dialog-body { gap: 12px; padding-bottom: 12px; }
.settings-dialog .note { color: var(--muted); }
.settings-intro { margin: 0; }
.settings-tabs { display: flex; gap: 4px; padding: 5px; border-radius: 12px; background: var(--surface-2); position: sticky; top: -8px; z-index: 2; }
.settings-tabs button { flex: 1; border: 0; border-radius: 8px; padding: 10px 6px; background: transparent; color: var(--muted); }
.settings-tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px var(--accent-2); }
.settings-page { display: grid; gap: 16px; }
.settings-section { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.settings-section h3 { margin: 0 0 2px; font-size: 14px; color: var(--accent-2); }
.settings-section .note { margin: 0; line-height: 1.5; }
.settings-field { margin: 0; min-width: 0; }
.settings-field select { width: 100%; }
.settings-field small, .settings-toggle small { display: block; color: var(--muted); font-size: 12px; font-weight: normal; line-height: 1.5; margin-top: 4px; }
.settings-toggle { display: flex; justify-content: space-between; align-items: center; gap: 20px; cursor: pointer; padding: 6px 0; }
.settings-toggle strong, .settings-field strong { font-size: 13px; font-weight: 600; }
.settings-toggle input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--accent); }
.settings-field input[type="range"] { width: 100%; accent-color: var(--accent-2); padding: 0; }
.settings-field output { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.settings-meter { display: grid; gap: 6px; }
.settings-meter meter { width: 100%; height: 14px; accent-color: #4ade80; }
.settings-preview { max-width: 420px; width: 100%; justify-self: center; aspect-ratio: 16 / 9; }
.settings-section audio { width: 100%; }
.settings-section > button { justify-self: start; }
.settings-status { min-height: 20px; margin: 0; }
.settings-dialog :focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- telas pequenas ---------- */
@media (max-width: 820px) {
  .settings-dialog .dialog-body { padding-left: 12px; padding-right: 12px; }
  .settings-tabs { flex-wrap: wrap; }
  .settings-tabs button { flex-basis: 40%; }
  .setup-grid { grid-template-columns: 1fr; }
  .setup-card { padding: 18px; }
  #videobar { max-width: calc(100vw - 24px); left: 12px; transform: none; top: 52px; }
  .tile { width: 132px; }
  #panel { left: 8px; right: 8px; width: auto; top: 8px; }
  body.panel-open #toasts { right: 14px; }
  .emotes { grid-template-columns: repeat(4, 44px); }
  #channels, #editor { left: 8px; right: 8px; width: auto; top: 52px; bottom: auto; max-height: 55vh; }
}
