/* ===== BUNKER â€” temas claro e escuro =====
   O tema Ã© escolhido em js/theme.js (Sistema / Claro / Escuro) e fica em <html data-theme="...">.
   Toda cor da interface vem destas variÃ¡veis: pra mudar o visual, mexa sÃ³ aqui. */
:root,
:root[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-side: #0f131b;
  --panel: #121722;
  --panel-2: #181e2b;
  --panel-3: #202838;
  --line: #1c2331;
  --line-2: #2a3345;
  --text: #e7ebf3;
  --muted: #99a3b7;
  --faint: #687287;
  --input-bg: #0b0e14;
  --btn-bg: #181e2b;
  --btn-hover: #202838;
  --active-bg: #1c2434;

  --accent: #2b5bd7;          /* azul escuro (botÃµes, seleÃ§Ã£o) */
  --accent-hover: #3567e3;
  --accent-ink: #ffffff;
  --accent-soft: rgba(70, 115, 235, .15);
  --accent-line: rgba(90, 135, 245, .45);
  --accent-text: #8eabff;     /* azul em texto/Ã­cone sobre fundo escuro (legÃ­vel) */
  --link: #8eabff;

  --live: #e5484d;
  --ok: #30c48d;
  --warn: #e8a93c;
  --warn-soft: rgba(232, 169, 60, .15);
  --bad: #ef6b6b;
  --bad-text: #ff9b9b;
  --danger-soft: rgba(229, 72, 77, .13);
  --danger-soft-2: rgba(229, 72, 77, .22);
  --danger-line: rgba(229, 72, 77, .45);
  --danger-strong: #2a1115;

  --msg-text: #d8dde7;
  --hover-row: rgba(255, 255, 255, .028);
  --tile-bg: #07090d;
  --savebar-bg: #0a0d13;
  --overlay: rgba(4, 6, 11, .72);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .38);
  --shadow-lg: 0 28px 72px rgba(0, 0, 0, .5);
  --scroll: #2a3242;
  --on-dark: #e8ebf2;        /* texto em cima de fundo sempre escuro (vídeo, telona) */
  --on-dark-muted: #aab2c3;

  --radius: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f6fa;
  --bg-side: #eceff5;
  --panel: #ffffff;
  --panel-2: #f3f5f9;
  --panel-3: #e6eaf1;
  --line: #e1e5ed;
  --line-2: #d0d6e0;
  --text: #0f1626;
  --muted: #545e72;
  --faint: #858ea1;
  --input-bg: #ffffff;
  --btn-bg: #ffffff;
  --btn-hover: #f1f3f8;
  --active-bg: #dfe5f1;

  --accent: #1e3f9a;          /* azul-marinho */
  --accent-hover: #19357f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(30, 63, 154, .09);
  --accent-line: rgba(30, 63, 154, .35);
  --accent-text: #1e3f9a;
  --link: #2148b5;

  --live: #d93542;
  --ok: #12996a;
  --warn: #b4761b;
  --warn-soft: rgba(180, 118, 27, .12);
  --bad: #d14343;
  --bad-text: #c0302f;
  --danger-soft: rgba(217, 53, 66, .08);
  --danger-soft-2: rgba(217, 53, 66, .14);
  --danger-line: rgba(217, 53, 66, .35);
  --danger-strong: #fdecee;

  --msg-text: #1d2535;
  --hover-row: rgba(15, 22, 38, .03);
  --tile-bg: #0b0e14;
  --savebar-bg: #ffffff;
  --overlay: rgba(15, 22, 38, .38);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, .1), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);
  --scroll: #c9d0dc;
  --on-dark: #e8ebf2;
  --on-dark-muted: #aab2c3;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.spacer { flex: 1; }
.mono { font-family: var(--mono); font-size: 13px; }

.ico { display: inline-flex; flex: none; }
.ico svg { display: block; }

/* ===== BotÃµes e campos ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent-text); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--bad-text); }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft-2); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  width: 36px; height: 36px; flex: none;
  border-radius: var(--radius-sm); border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.sm { width: 28px; height: 28px; }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

.input, .select {
  height: 38px; padding: 0 12px; min-width: 0;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input { width: 100%; }
.input:focus, .select:focus, .chat-input:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { padding-right: 8px; cursor: pointer; background: var(--panel-2); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input:focus-visible, .select:focus-visible, .chat-input:focus-visible { outline: none; }

.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.check input { accent-color: var(--accent-text); width: 16px; height: 16px; margin: 0; }

.row { display: flex; gap: 8px; align-items: center; }

/* ===== Etiquetas ===== */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.pill.live { background: var(--live); color: #fff; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.sm { height: 18px; padding: 0 6px; font-size: 10px; }
.tag { font-size: 11px; color: var(--accent-text); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; font-weight: 700; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 6px; background: rgba(8, 9, 12, .72); color: #e5e7eb; font-size: 12px; font-weight: 600;
  /* sem backdrop-filter: em cima de vÃ­deo ele forÃ§a a placa a redesenhar a cada quadro */
}
.chip.stats { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; color: #14110f; font-weight: 700; user-select: none;
}
.avatar { position: relative; overflow: hidden; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); }

/* ===== Login ===== */
#auth { height: 100%; overflow-y: auto; }
.auth {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(800px 400px at 50% -10%, var(--accent-soft), transparent 70%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand-mark { display: block; width: 30px; height: 30px; flex: none; }
.brand-lg { font-size: 26px; }
.brand-lg .brand-mark { width: 48px; height: 48px; }
.auth-tag { color: var(--muted); margin: 10px 0 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-lg); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input.lg { height: 46px; font-size: 16px; padding: 0 14px; }
.btn.lg { height: 46px; font-size: 15px; }
.form-error { color: var(--bad); font-size: 13px; margin: -4px 0 12px; }
.auth-foot { color: var(--faint); font-size: 12.5px; text-align: center; margin-top: 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.seg button { height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--panel-3); color: var(--text); }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.input-prefix:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-prefix > span { padding-left: 12px; color: var(--faint); font-weight: 600; }
.input-prefix > .input { border: 0; background: transparent; padding-left: 4px; box-shadow: none !important; }
.pw-field { position: relative; }
.pw-field > .input { padding-right: 40px; }
.pw-eye { position: absolute; right: 5px; top: 5px; }
.form-msg { font-size: 13px; color: var(--bad); margin: -4px 0 0; }
.form-msg.ok { color: var(--ok); }
.server-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding: 6px 10px;
  border: 0; border-radius: 8px; background: none; color: var(--faint); font-size: 12px; cursor: pointer;
}
.server-btn:hover { color: var(--muted); background: var(--panel); }
.app-version { color: var(--faint); font-size: 11px; margin-top: 4px; opacity: .7; }
.input.invite-code { font-size: 18px; letter-spacing: .08em; text-align: center; height: 44px; }

/* ===== Estrutura do app ===== */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100dvh; }
.view { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.sidebar { background: var(--bg-side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 14px 10px 10px; }
.sidebar .brand { padding: 2px 8px 14px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 10px; color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.room-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.side-empty { color: var(--faint); font-size: 13px; padding: 6px 10px; }
.room-link {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px;
  border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 500;
}
.room-link:hover { background: var(--panel-2); color: var(--text); }
.room-link.active { background: var(--panel-3); color: var(--text); }
.room-link.active .room-ico { color: var(--accent-text); }
.room-ico { display: inline-flex; color: var(--faint); }
.room-ico.lg { color: var(--accent-text); }
.room-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-online { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--faint); }

/* Quem estÃ¡ na sala aberta (embaixo do nome dela, na barra lateral) */
.room-people { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 19px; padding-left: 9px; border-left: 1px solid var(--line-2); }
.room-people:empty { display: none; }
.rp-row { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 6px; border-radius: 7px; color: var(--muted); }
.rp-row:hover { background: var(--panel-2); color: var(--text); }
.rp-row.off { opacity: .45; }
.rp-av { display: inline-flex; border-radius: 50%; transition: box-shadow .12s; }
/* Anel verde de quem estÃ¡ falando */
.rp-row.speaking .rp-av,
.me.speaking .avatar { box-shadow: 0 0 0 2px var(--bg-side), 0 0 0 4px var(--ok), 0 0 12px rgba(52, 211, 153, .45); }
.me .avatar { transition: box-shadow .12s; }
.rp-row.speaking .rp-name { color: var(--text); }
.rp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; }
.rp-you { color: var(--faint); font-weight: 400; }
.rp-icons { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); flex: none; }
.rp-icons > span { display: inline-flex; }
.rp-icons .bad { color: var(--bad-text); }
.rp-owner { color: var(--warn); }
.pill.as-btn { border: 0; cursor: pointer; font-family: inherit; }
.pill.as-btn:hover { filter: brightness(1.15); }
.rp-toggle { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.rp-toggle:hover { color: var(--muted); }

.side-actions { padding: 8px 0; }
.me { display: flex; align-items: center; gap: 6px; padding: 8px 4px 0 2px; border-top: 1px solid var(--line); }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 5px 6px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.me-btn:hover { background: var(--panel-2); }
.me-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-user { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scrim { display: none; }
.only-mobile, .only-mobile-flex, .only-narrow { display: none !important; }

.topbar { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.topbar-title { font-weight: 700; }

/* ===== InÃ­cio ===== */
.lobby { overflow-y: auto; height: 100%; }
.lobby-inner { max-width: 880px; margin: 0 auto; padding: 56px 24px 40px; }
.lobby h1 { font-size: 30px; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 15.5px; margin: 8px 0 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.card h2 { font-size: 17px; margin: 14px 0 6px; }
.card p { margin-bottom: 16px; }
.card-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.section-title { color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 36px 0 12px; }
.room-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.room-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.room-card:hover { border-color: var(--line-2); background: var(--panel-2); }
.room-card-ico { color: var(--accent-text); }
.room-card-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }

.center-page { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.center-page > .topbar { position: absolute; top: 0; left: 0; right: 0; border: 0; }
.invite-card { width: 100%; max-width: 400px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px; }
.invite-card h1 { font-size: 24px; margin-bottom: 4px; }
.invite-card .btn { margin-top: 16px; }
.invite-ico { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 8px; }
.invite-ico.bad { background: var(--danger-soft); color: var(--bad); }

/* ===== Sala ===== */
.room { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.room-header { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.room-title-text { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.room-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }

.stage-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; position: relative; display: flex; flex-direction: column; }

.stage-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 360px; padding: 24px; }
.stage-empty h2 { font-size: 18px; }
.empty-ico { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 18px; background: var(--panel-2); color: var(--muted); margin-bottom: 8px; }

.audio-hint {
  position: absolute; left: 50%; top: 20px; transform: translateX(-50%); z-index: 5;
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-md);
}

/* Grade de transmissÃµes */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-content: start; }
.tiles.count-0 { display: none; }
/* Todas cabem no palco: o JS (layoutTiles) calcula colunas x linhas e passa o tamanho em --tw/--th */
.tiles.fit { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; overflow: hidden; }
.tiles.fit .tile { width: var(--tw); height: var(--th); aspect-ratio: auto; flex: none; }
.tiles.fit.stacked { align-content: flex-start; overflow-y: auto; }
.tiles.fit.stacked .tile { width: 100%; height: auto; aspect-ratio: 16 / 9; }
/* Focar: uma transmissão grande e as outras em miniatura embaixo (clique troca) */
.tiles.has-focus { flex: 1; min-height: 0; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); grid-template-rows: minmax(0, 1fr); grid-auto-rows: 94px; justify-content: center; align-content: stretch; }
.tiles.has-focus .tile.focused { grid-column: 1 / -1; order: -1; aspect-ratio: auto; min-height: 0; }
.tiles.has-focus .tile:not(.focused) { aspect-ratio: auto; width: 168px; justify-self: center; cursor: pointer; }
.tiles.has-focus .tile:not(.focused):hover { border-color: var(--accent-line); }
.tiles.has-focus .tile:not(.focused) .tile-controls,
.tiles.has-focus .tile:not(.focused) .tile-top .chip,
.tiles.has-focus .tile:not(.focused) .tile-cover p,
.tiles.has-focus .tile:not(.focused) .tile-cover .cover-av { display: none; }
.tiles.has-focus .tile:not(.focused) .tile-top { padding: 6px; }
.tiles.has-focus .tile:not(.focused) .tile-name { max-width: 100%; font-size: 12px; }
.tiles.has-focus .tile:not(.focused) .tile-cover { padding: 6px; }
.tiles.has-focus .tile:not(.focused) .tile-cover .btn { height: 28px; padding: 0 10px; font-size: 12px; margin-top: 18px; }
.tile-focus.with-label { width: auto; padding: 0 10px; gap: 6px; font-weight: 600; font-size: 13px; }
.tile-volume-slot { display: flex; align-items: center; gap: 4px; min-width: 0; }

.tile {
  position: relative; aspect-ratio: 16 / 9; min-width: 0;
  background: #000; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
}
.tile.self { border-color: var(--accent-line); }
.tile:fullscreen { border-radius: 0; border: 0; width: 100%; height: 100%; }
.tile:fullscreen .tile-controls { padding: 12px 16px; }
.tile-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.tile:not(.watching) .tile-video { visibility: hidden; }

.tile-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--c) 26%, transparent), transparent 62%), var(--tile-bg);
}
.tile.watching .tile-cover { display: none; }
.cover-title { font-size: 15px; }
.tile-cover .btn { margin-top: 6px; }

.tile-spinner { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--accent-text); animation: spin .8s linear infinite; display: none; }
.tile.watching:not(.has-frames) .tile-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.tile-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 10px; pointer-events: none; flex-wrap: wrap; }
.tile.watching .tile-top { background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.tile.watching .tile-name { color: #f3f4f6; }
.tile-name { font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); margin-right: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }

.tile-controls {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 4px; padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  opacity: 0; transition: opacity .2s;
}
.tile.watching:hover .tile-controls, .tile.watching:focus-within .tile-controls { opacity: 1; }
.tile:not(.watching) .tile-controls { display: none; }
.tile-controls .icon-btn { color: #f3f4f6; }
.tile-controls .icon-btn:hover { background: rgba(255, 255, 255, .14); }
.audio-ctl { display: flex; align-items: center; gap: 4px; }
.volume { width: 96px; accent-color: var(--accent-text); }
@media (hover: none) { .tile.watching .tile-controls { opacity: 1; } }

/* Barra de controles */
.controls {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg-side); flex: none;
}
.ctl-left { min-width: 0; }
.ctl-center { display: flex; align-items: center; gap: 12px; }
.ctl-right { display: flex; justify-content: flex-end; }
.ctl-sep { width: 1px; height: 28px; background: var(--line-2); }
.conn { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.conn.ok .dot { background: var(--ok); }
.conn.warn .dot { background: var(--warn); }
.conn.bad .dot { background: var(--bad); }
.live-info { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

/* BotÃµes de voz (microfone, fone, cÃ¢mera) */
.voice-ctl { display: flex; align-items: center; gap: 8px; }
.share-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctl-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.ctl-btn:hover:not(:disabled) { background: var(--panel-3); }
.ctl-btn:disabled { opacity: .45; cursor: not-allowed; }
.ctl-btn.off { background: var(--danger-soft); border-color: var(--danger-line); color: var(--bad-text); }
.ctl-btn.off:hover:not(:disabled) { background: var(--danger-soft-2); }
.ctl-btn[data-ctl="cam"].is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.ctl-btn.leave { width: 56px; border-radius: 22px; background: var(--live); border-color: var(--live); color: #fff; }
.ctl-btn.leave:hover { background: color-mix(in srgb, var(--live) 86%, #000); }

/* CÃ¢meras ligadas (no palco) */
.cam-grid { display: grid; gap: 12px; width: 100%; }
.cam-grid.main { flex: 1; align-content: center; justify-content: center; }
.cam-grid.main.n-1 { grid-template-columns: minmax(0, 720px); }
.cam-grid.main.n-2 { grid-template-columns: repeat(2, minmax(0, 560px)); }
.cam-grid.main.n-3, .cam-grid.main.n-4 { grid-template-columns: repeat(2, minmax(0, 460px)); }
.cam-grid.main.n-many { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-content: start; }
.cam-grid.strip { display: flex; gap: 8px; overflow-x: auto; flex: none; margin-top: 12px; padding-bottom: 2px; }
.cam-grid.strip .ptile { width: 200px; flex: none; }

.ptile {
  position: relative; aspect-ratio: 16 / 9; min-width: 0; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2);
  transition: box-shadow .12s, border-color .12s;
}
.ptile.speaking { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok), 0 0 22px rgba(52, 211, 153, .22); }
.ptile-avatar {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--c) 20%, transparent), transparent 62%), var(--panel-2);
}
.ptile-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
.ptile.cam-on .ptile-video { display: block; }
.ptile.cam-on .ptile-avatar { display: none; }
.ptile.local .ptile-video { transform: scaleX(-1); } /* espelho, como num espelho de verdade */
.ptile-label {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px);
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px;
  border-radius: 6px; background: rgba(8, 9, 12, .72);
  font-size: 12.5px; font-weight: 600;
}
.ptile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptile-ico { display: inline-flex; color: var(--bad-text); }
.ptile-fs { position: absolute; top: 6px; right: 6px; display: none; color: #fff; background: rgba(0, 0, 0, .45); }
.ptile.cam-on:hover .ptile-fs { display: inline-flex; }
.ptile:fullscreen { border-radius: 0; border: 0; }
.ptile:fullscreen .ptile-video { object-fit: contain; }

.select.block { width: 100%; }
.settings { width: 480px; gap: 10px; }
.settings .field { margin-bottom: 4px; }
.settings-title { color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 8px; }
.settings .check { white-space: normal; align-items: flex-start; line-height: 1.4; }
.settings .check input { margin-top: 1px; flex: none; }
.settings { max-height: calc(100dvh - 48px); overflow-y: auto; }

/* Painel da direita: chat */
.panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
.panel-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); flex: none; color: var(--muted); font-weight: 700; font-size: 13px; }
.panel-close { margin-left: auto; }

.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 0; }
.chat-start { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 24px 20px; }
.msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 6px 16px 2px; }
.msg:hover, .msg.cont:hover { background: var(--hover-row); }
.msg.cont { padding-top: 1px; padding-bottom: 1px; position: relative; }
.msg-time-side { font-size: 10.5px; color: var(--faint); opacity: 0; text-align: right; padding-top: 3px; font-variant-numeric: tabular-nums; }
.msg.cont:hover .msg-time-side { opacity: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-name { font-weight: 700; }
.msg-time { font-size: 11.5px; color: var(--faint); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--msg-text); }
.msg-text a { color: var(--link); }
.sys { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 6px 16px; padding: 6px 10px; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 12.5px; }

.composer { display: flex; align-items: flex-end; gap: 6px; margin: 10px 12px 12px; padding: 6px 6px 6px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); }
.composer:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-input { flex: 1; resize: none; border: 0; outline: none; background: transparent; padding: 7px 0; max-height: 140px; line-height: 1.4; }
.chat-input:focus { box-shadow: none; }
.icon-btn.send { color: var(--accent-text); }


/* ===== Modal, menu e avisos ===== */
.modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); }
.modal::backdrop { background: var(--overlay); }
.modal-box { width: 440px; max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.modal-box h2 { font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal-actions.start { justify-content: flex-start; margin-top: 0; }

.menu { position: fixed; z-index: 50; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-md); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--panel-3); }
.menu-item.danger { color: var(--bad-text); }

.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 10px 16px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow-md); animation: toast-in .2s ease-out; transition: opacity .4s, transform .4s; }
.toast.error { border-color: var(--danger-line); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.dot-badge { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--live); }

/* Aviso de versÃ£o nova */
.update-bar {
  position: fixed; z-index: 90; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; max-width: calc(100vw - 32px);
  border-radius: 12px; background: var(--panel-2); border: 1px solid var(--accent-line);
  box-shadow: var(--shadow-md); color: var(--text); font-size: 13px;
  animation: toast-in .2s ease-out;
}
.update-bar > .ico { color: var(--accent-text); }
.update-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Telas menores ===== */
@media (max-width: 1000px) {
  .only-narrow { display: inline-flex !important; }
  .room-body { grid-template-columns: minmax(0, 1fr); }
  .panel {
    position: absolute; z-index: 20; top: 56px; right: 0; bottom: 0; width: min(380px, 100%);
    transform: translateX(100%); transition: transform .2s ease, visibility .2s; box-shadow: var(--shadow-lg);
    visibility: hidden;
  }
  .panel-open .panel { transform: none; visibility: visible; }
  .room-body { overflow: clip; }
}
@media (max-width: 760px) {
  .panel { width: 100%; }
}

@media (max-width: 760px) {
  .only-mobile { display: inline-flex !important; }
  .only-mobile-flex { display: flex !important; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 280px; max-width: 86vw;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .drawer-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .55); }
  .drawer-open .scrim { display: block; }
  .room-header { padding: 0 8px; gap: 6px; }
  .room-header .room-ico { display: none; }
  .hide-xs { display: none; }
  .stage { padding: 10px; }
  /* Barra de baixo no celular: status em cima, todos os botÃµes numa linha centralizada */
  .controls {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  }
  .ctl-left { width: 100%; display: flex; justify-content: center; }
  .conn, .live-info { font-size: 12px; }
  .ctl-center { gap: 10px; flex-wrap: nowrap; }
  .voice-ctl { gap: 10px; }
  .ctl-sep { display: none; }
  .ctl-btn { width: 46px; height: 46px; }
  .share-ctl { gap: 6px; flex-wrap: nowrap; }
  .share-btn { width: 46px; height: 46px; padding: 0; border-radius: 50%; justify-content: center; }
  .share-btn .btn-label { display: none; }
  .ctl-right { position: absolute; right: 8px; top: 4px; }
  .controls { position: relative; }
  .settings-btn { width: 34px; height: 34px; }
  .room-header { padding-top: env(safe-area-inset-top); }
  .composer { margin-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .cam-grid.main.n-2, .cam-grid.main.n-3, .cam-grid.main.n-4, .cam-grid.main.n-many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cam-grid.main.n-1 { grid-template-columns: minmax(0, 1fr); }
  .lobby-inner { padding: 28px 16px; }
  .lobby h1 { font-size: 24px; }
  .row { flex-wrap: wrap; }
  .row .btn { flex: 1; }
  .volume { width: 70px; }
  .tile-name { max-width: 30%; }
  .tiles.has-focus { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-auto-rows: 68px; }
  .tiles.has-focus .tile:not(.focused) { width: 120px; }
}

/* ===== ConfiguraÃ§Ãµes de usuÃ¡rio (perfil e conta) ===== */
.uset-modal { width: 940px; max-width: calc(100vw - 32px); }
.uset {
  display: grid; grid-template-columns: 210px 1fr; height: min(640px, calc(100dvh - 48px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.uset-nav { display: flex; flex-direction: column; gap: 2px; padding: 20px 10px; background: var(--bg-side); border-right: 1px solid var(--line); }
.uset-navtitle { padding: 0 10px 8px; color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.uset-tab {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; text-align: left;
}
.uset-tab:hover { background: var(--panel-2); color: var(--text); }
.uset-tab.on { background: var(--panel-3); color: var(--text); }
.uset-tab.danger { color: var(--bad-text); }
.uset-tab.danger:hover { background: var(--danger-soft); }
.uset-main { position: relative; display: flex; flex-direction: column; min-width: 0; }
.uset-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.uset-head h2 { font-size: 19px; }
.uset-body { flex: 1; overflow-y: auto; padding: 22px 22px 90px; }
.uset-sec { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.uset-label { color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.uset-h { font-size: 15px; }
.row-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.profile-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.input-count { position: relative; }
.input-count .input { padding-right: 56px; }
.input-count .count { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 12px; pointer-events: none; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; cursor: pointer;
  background: var(--panel-3); color: var(--muted); transition: transform .12s, border-color .12s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch .ico { opacity: 0; }
.swatch.on { border-color: var(--text); }
.swatch.on .ico, .swatch.custom .ico { opacity: 1; }
.swatch.custom { border: 2px dashed var(--line-2); }
.swatch.custom.on { border-style: solid; border-color: var(--text); }
.swatch-custom { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* CartÃ£o de perfil (prÃ©via de como os outros te veem) */
.pcard { --c: var(--accent); position: relative; border-radius: 14px; overflow: hidden; background: var(--bg-side); border: 1px solid var(--line); }
.pcard-banner { height: 88px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 45%, var(--bg))); }
.pcard.big .pcard-banner { height: 110px; }
.pcard-av { position: absolute; left: 16px; top: 44px; border-radius: 50%; padding: 5px; background: var(--bg-side); }
.pcard.big .pcard-av { top: 58px; }
.pcard-av .avatar { display: flex; }
.pcard-av-edit {
  position: absolute; inset: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 700;
  opacity: 0; cursor: pointer; transition: opacity .15s;
}
.pcard-av:hover .pcard-av-edit, .pcard-av-edit:focus-visible { opacity: 1; }
.pcard-body { display: flex; flex-direction: column; gap: 2px; padding: 56px 16px 16px; }
.pcard.big .pcard-body { padding-top: 62px; }
.pcard-name { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-user { color: var(--muted); }
.pcard-sec { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.pcard-label { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* Minha conta */
.acct { display: flex; flex-direction: column; gap: 18px; }
.acct-box { display: flex; flex-direction: column; gap: 18px; padding: 16px; border-radius: 12px; background: var(--bg-side); border: 1px solid var(--line); }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-row > div { min-width: 0; }
.acct-val { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass-form { display: flex; flex-direction: column; gap: 2px; max-width: 360px; }
.pass-form .field { margin-bottom: 8px; }

/* Barra "alteraÃ§Ãµes nÃ£o salvas" */
.savebar {
  position: absolute; left: 18px; right: 18px; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--savebar-bg); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-md); font-weight: 600; animation: savebar-in .18s ease-out;
}
.savebar .link-btn { color: var(--text); }
.savebar.shake { animation: savebar-shake .4s; border-color: var(--live); background: var(--danger-strong); }
@keyframes savebar-in { from { transform: translateY(12px); opacity: 0; } }
@keyframes savebar-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Recorte da foto */
.cropper { width: 380px; align-items: stretch; }
.crop-stage { position: relative; width: 300px; height: 300px; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #000; }
.crop-canvas { display: block; width: 300px; height: 300px; cursor: grab; touch-action: none; }
.crop-canvas.grabbing { cursor: grabbing; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; box-shadow: 0 0 0 200px rgba(0, 0, 0, .6); outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -2px; }
.crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 0 8px; }
.crop-zoom input { flex: 1; accent-color: var(--accent-text); }

@media (max-width: 860px) {
  .uset { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - 32px); }
  .uset-nav { flex-direction: row; gap: 4px; padding: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .uset-tab { flex: none; height: 36px; white-space: nowrap; }
  .uset-main { min-height: 0; }
  .uset-navtitle, .uset-nav .spacer { display: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-side { position: static; }
}

/* ===== Setinha de aparelhos e medidor do microfone ===== */
.ctl-split { position: relative; display: inline-flex; }
.ctl-caret {
  position: absolute; right: -5px; bottom: -4px; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 0;
  background: var(--panel-3); color: var(--text); cursor: pointer;
  box-shadow: 0 0 0 2px var(--bg-side); transition: background .15s, color .15s, transform .15s;
}
.ctl-caret:hover { background: var(--accent); color: var(--accent-ink); }
.ctl-split.menu-open .ctl-caret { background: var(--accent); color: var(--accent-ink); transform: rotate(180deg); }

.dev-menu {
  position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 16px); padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-md);
  animation: dev-in .12s ease-out;
}
@keyframes dev-in { from { transform: translateY(6px); opacity: 0; } }
.dev-title { padding: 4px 8px 2px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dev-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.dev-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; text-align: left;
}
.dev-item:hover { background: var(--panel-3); }
.dev-radio { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); }
.dev-item.on .dev-radio { border-color: var(--accent-text); background: var(--accent); box-shadow: inset 0 0 0 3px var(--panel-2); }
.dev-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-hint { padding: 0 8px; }
.dev-meter { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 4px; }
.dev-meter .dev-title { padding: 0; }
.dev-sep { height: 1px; background: var(--line); margin: 4px 0; }
.dev-foot {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer;
}
.dev-foot:hover { background: var(--panel-3); color: var(--text); }

.meter { height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.meter > i { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--faint); transition: width .06s linear, background .15s; }
.meter.hot > i { background: var(--ok); }
.meter.err { background: var(--danger-soft-2); }
.settings-meter { display: flex; flex-direction: column; gap: 6px; margin: -2px 0 6px; }

/* ===== Acabamento (visual limpo; vem por Ãºltimo pra valer sobre o resto) ===== */
body { font-size: 14px; line-height: 1.5; letter-spacing: -.003em; transition: background-color .2s; }
h1, h2 { font-family: var(--font-display); letter-spacing: -.02em; font-weight: 650; }
h3, h4 { font-weight: 650; }
::selection { background: var(--accent-soft); }

/* Barras de rolagem finas e discretas */
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--faint); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }

/* BotÃµes e campos */
.btn { height: 36px; padding: 0 14px; font-weight: 600; background: var(--btn-bg); border-color: var(--line-2); }
.btn:hover { background: var(--btn-hover); }
.btn.primary { box-shadow: 0 1px 2px rgba(10, 20, 50, .25), inset 0 1px 0 rgba(255, 255, 255, .08); }
.btn.lg { height: 44px; }
.btn.sm { height: 30px; }
.icon-btn:hover { background: var(--btn-hover); }
.input, .select { height: 36px; background: var(--input-bg); }
.select { background: var(--btn-bg); }
.input.lg { height: 44px; font-size: 15px; }
.input-prefix, .composer { background: var(--input-bg); }
.input::placeholder, .chat-input::placeholder { color: var(--faint); }

/* RÃ³tulos em caixa alta: mais leves */
.side-head, .section-title, .settings-title, .uset-navtitle, .uset-label, .pcard-label, .dev-title, .rp-toggle {
  font-weight: 650; letter-spacing: .07em; font-size: 11px;
}

/* Login */
.auth { background: radial-gradient(900px 420px at 50% -12%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { border-radius: 16px; padding: 28px; box-shadow: var(--shadow-lg); }
.seg { background: var(--panel-2); border: 1px solid var(--line); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* Barra lateral */
.sidebar { border-right-color: var(--line); }
.room-link { min-height: 36px; font-weight: 500; position: relative; }
.room-link:hover { background: var(--hover-row); background: color-mix(in srgb, var(--panel-3) 60%, transparent); }
.room-link.active { background: var(--active-bg); color: var(--text); font-weight: 600; }
.room-link.active::before {
  content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.rp-row:hover { background: color-mix(in srgb, var(--panel-3) 60%, transparent); }
.me { border-top-color: var(--line); }
.me-btn:hover { background: color-mix(in srgb, var(--panel-3) 60%, transparent); }

/* CabeÃ§alhos e painÃ©is */
.room-header, .topbar { height: 52px; background: var(--bg); }
.room-title-text { font-size: 15px; font-weight: 650; }
.panel { background: var(--panel); }
.panel-head { height: 46px; font-weight: 650; }
.controls { background: var(--bg-side); }

/* CartÃµes */
.card, .room-card { border-radius: 14px; }
.card { box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.room-card:hover { border-color: var(--accent-line); background: var(--panel); }

/* Chamada */
.ctl-btn { background: var(--btn-bg); border-color: var(--line-2); }
.ctl-btn:hover:not(:disabled) { background: var(--btn-hover); }
.tile, .ptile { border-color: var(--line); }

/* Chat */
.msg-name { font-weight: 650; }
.composer { border-radius: 12px; }

/* Janelas, menus e avisos */
.modal-box, .uset, .auth-card { border-color: var(--line); }
.menu, .dev-menu { background: var(--panel); box-shadow: var(--shadow-md); }
.menu-item:hover, .dev-item:hover, .dev-foot:hover { background: var(--panel-2); }
.toast { background: var(--panel); box-shadow: var(--shadow-md); }
.uset-tab.on { background: var(--active-bg); }
.uset-nav { background: var(--bg-side); }
.pcard { background: var(--panel-2); }
.pcard-av { background: var(--panel-2); }
.pcard-banner { background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 40%, var(--bg))); }
.acct-box { background: var(--panel-2); }
.savebar { color: var(--text); }
.chip, .ptile-label { color: #e8ebf2; }

/* ===== AparÃªncia (escolha do tema nas configuraÃ§Ãµes) ===== */
.theme-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 560px; }
.theme-opt {
  display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text); text-align: left; font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.theme-opt:hover { border-color: var(--accent-line); }
.theme-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-opt-label { display: flex; align-items: center; gap: 8px; }
.theme-opt-radio { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); }
.theme-opt.on .theme-opt-radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--panel); }
.theme-mini { display: grid; grid-template-columns: 26% 1fr; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(127, 127, 127, .2); }
.theme-mini > i { display: block; }
.theme-mini.dark > i:first-child { background: #0f131b; }
.theme-mini.dark > i:last-child { background: linear-gradient(#2b5bd7, #2b5bd7) 12px 12px / 40% 8px no-repeat, linear-gradient(#202838, #202838) 12px 28px / 70% 6px no-repeat, linear-gradient(#202838, #202838) 12px 40px / 55% 6px no-repeat, #0b0e14; }
.theme-mini.light > i:first-child { background: #eceff5; }
.theme-mini.light > i:last-child { background: linear-gradient(#1e3f9a, #1e3f9a) 12px 12px / 40% 8px no-repeat, linear-gradient(#dfe4ec, #dfe4ec) 12px 28px / 70% 6px no-repeat, linear-gradient(#dfe4ec, #dfe4ec) 12px 40px / 55% 6px no-repeat, #ffffff; }
.theme-mini.system { grid-template-columns: 1fr 1fr; }
.theme-mini.system > i:first-child { background: linear-gradient(#1e3f9a, #1e3f9a) 10px 12px / 60% 8px no-repeat, linear-gradient(#dfe4ec, #dfe4ec) 10px 28px / 70% 6px no-repeat, #ffffff; }
.theme-mini.system > i:last-child { background: linear-gradient(#2b5bd7, #2b5bd7) 10px 12px / 60% 8px no-repeat, linear-gradient(#202838, #202838) 10px 28px / 70% 6px no-repeat, #0b0e14; }
@media (max-width: 560px) {
  .theme-opts { grid-template-columns: 1fr; }
  /* Celular: configuraÃ§Ãµes de usuÃ¡rio em tela cheia */
  .uset-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .uset { height: 100dvh; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .uset-head { padding: 14px 16px 12px; }
  .uset-body { padding: 18px 16px 90px; }
}
.empty-ico, .invite-ico:not(.bad) { border: 1px solid var(--line); }
.empty-ico { background: var(--panel); }
.noise-hint { margin: -6px 0 4px; line-height: 1.4; }

/* ===== Menu do botão direito numa pessoa (volume só pra mim) ===== */
.user-menu { width: 260px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.um-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); }
.um-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.um-names b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-sec { display: flex; flex-direction: column; gap: 6px; padding: 6px 4px; }
.um-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.um-val { color: var(--text); font-variant-numeric: tabular-nums; }
.um-range { width: 100%; accent-color: var(--accent); }
.um-foot { padding: 2px 4px 0; }
.audio-ctl.no-audio { opacity: .55; }
.tile-controls .volume { width: 110px; }
.uset-voice .voice-settings { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.uset-voice .settings-title:first-child { margin-top: 0; }
