/* Refúgio Hub (ALPHA) — layout do shell (Lime v2, REFUGIO_DESIGN.md)
   F1: view de login + shell de 3 colunas (canais | painel | membros). */

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    cursor: default;
}

button { font-family: inherit; }

[hidden] { display: none !important; }

/* scrollbar escura */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.10); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }
::-webkit-scrollbar-track { background: transparent; }

/* ── views ─────────────────────────────────────────────────────── */
/* `position: fixed; inset: 0` no lugar de `height: 100vh`: no WebView2 o vh do
   PRIMEIRO paint podia vir de um viewport ainda não assentado (janela criada
   por código) e o rodapé da sidebar nascia fora da tela até um maximizar/
   restaurar. Caixa fixa é medida na hora do layout e reancora em todo resize.
   O `position: relative` do #view-login saiu junto: fixed já é o bloco
   contentor do ::before (inset: 0). */
.view { display: none; position: fixed; inset: 0; }
#view-login.active { display: flex; align-items: center; justify-content: center; }
/* minmax(0, 1fr) na LINHA: sem isso a linha implícita é `auto` e o conteúdo de
   uma coluna (chat com vídeo, lista longa) empurra o grid para fora da janela. */
/* As larguras das colunas laterais saem de variáveis para que recolher uma
   delas seja mudar UM número, e não reescrever o template em cada estado
   (recolhida, teatro, as duas ao mesmo tempo). Recolhida não vira 0: sobra a
   fatia do trilho, que é como se volta atrás sem adivinhação. */
#view-main.active {
    display: grid;
    grid-template-columns: var(--col-esq, 260px) minmax(0, 1fr) var(--col-membros, 240px);
    grid-template-rows: minmax(0, 1fr);
}
body.coluna-esq-off { --col-esq: 26px; }
body.coluna-membros-off { --col-membros: 26px; }

/* ── acento da marca (gradient-text lime) ──────────────────────── */
.accent {
    background: linear-gradient(135deg, #CFFC09, #9BC700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ── badge ALPHA (padrão .rb-badge) ────────────────────────────── */
.rb-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(207, 252, 9, 0.25);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── botões (padrão .rb-btn) ───────────────────────────────────── */
.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.3s ease, border-color 0.2s ease;
}

.rb-btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--text);
}
.rb-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--line-strong);
}

/* ═══ LOGIN ═════════════════════════════════════════════════════ */

/* halo lime no topo, receita do fundo global do site */
#view-login::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 95% 55% at 50% -10%, rgba(207, 252, 9, 0.055), transparent 60%),
        radial-gradient(ellipse 90% 60% at 50% 115%, rgba(255, 255, 255, 0.018), transparent 55%);
}

.login-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 520px;
    padding: 2rem;
}

/* o letreiro da comunidade (o mesmo do launcher) */
.login-logo {
    display: block;
    width: min(300px, 78vw);
    height: auto;
    margin: 0 auto 0.6rem;
}

.login-title {
    font-size: clamp(2.8rem, 7vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.02;
    margin: 1.2rem 0 0.9rem;
}

.login-sub {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 2.2rem;
    max-width: 440px;
}

/* CTA único de entrada — cor da marca do Discord (#5865F2), que é o que a
   pessoa reconhece na hora. O halo lime do fundo continua sendo a assinatura
   do Refúgio; o botão é do serviço, não nosso. */
.btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 2rem;
    border-radius: 14px;
    border: none;
    background: #5865f2;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.2s ease;
}
.btn-discord:hover {
    transform: translateY(-2px);
    background: #4752c4;
    box-shadow: 0 12px 40px rgba(88, 101, 242, 0.35);
}
.btn-discord:active { transform: translateY(0); }
.btn-discord svg { width: 22px; height: 22px; flex: none; }

.login-hint {
    margin: 0.9rem 0 0;
    font-size: 0.82rem;
    color: var(--text-faint);
}

.login-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 2s; }
}

.login-status {
    color: var(--text-dim);
    font-size: 0.92rem;
    margin: 0;
}

.login-error {
    margin-top: 1.4rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff8585;
    font-size: 0.88rem;
    max-width: 440px;
    user-select: text;
}

/* ═══ SHELL — coluna 1: canais ══════════════════════════════════ */

/* min-height/min-width 0 + overflow hidden: item de grid nasce com
   `min-*: auto`, e aí o conteúdo (lista de canais, chat) estica a linha e
   empurra o rodapé para fora da janela em vez de rolar por dentro. */
.sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #0d0d0f;
    border-right: 1px solid var(--line);
}

.sidebar-head {
    flex: none;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--line);
}
.sidebar-head .badge-alpha { font-size: 0.58rem; padding: 0.16rem 0.5rem; }
.sidebar-logo { flex: none; display: block; height: 28px; width: auto; }


.channels {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.5rem 0.6rem 1rem;
}

.channels-group {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 1rem 0.5rem 0.4rem;
}

.channel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
}
.channel svg { width: 16px; height: 16px; flex: none; }
.channel-hash {
    width: 16px;
    text-align: center;
    color: var(--text-faint);
    font-weight: 600;
    flex: none;
}
.channel-placeholder { color: var(--text-faint); font-style: italic; }

/* rodapé da sidebar: painel de voz (F3) + voicebar do usuário */
.sidebar-foot {
    flex: none;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

/* F7: botão discreto de self-update (ui/hubupdate.js) */
.hub-update {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--accent-soft);
    color: var(--accent);
    border: none;
    border-bottom: 1px solid var(--line);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.hub-update:hover { background: rgba(207, 252, 9, 0.18); }
.hub-update:disabled { cursor: default; opacity: 0.85; }
.hub-update-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
    animation: hub-update-pulse 2s ease-in-out infinite;
}
@keyframes hub-update-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.hub-update-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* flex-wrap + min-width no bloco de identidade: avatar + nick + 5 botões não
   cabem em 260px. Sem isso o nick era espremido a "P..." e o status quebrava
   em três linhas; agora os botões descem para uma segunda linha. */
.voicebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
}

.voice-avatar,
.member-avatar,
.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: none;
    background-color: var(--accent-soft);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(207, 252, 9, 0.25);
}

.voice-id {
    flex: 1;
    min-width: 88px;   /* piso: abaixo disso o nick vira "P..." (ver .voicebar) */
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.voice-nick {
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.voice-status {
    font-size: 0.7rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-actions { display: flex; gap: 0.2rem; margin-left: auto; }

.icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.icon-btn:disabled { color: var(--text-faint); opacity: 0.55; cursor: not-allowed; }

/* ═══ SHELL — coluna 2: painel central ══════════════════════════ */

.content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--bg);
}

.content-head {
    flex: none;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--line);
}
.content-title { font-size: 0.95rem; font-weight: 700; }

/* estado vazio (receita .feed-empty do design system) */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
}
.empty-icon svg { width: 28px; height: 28px; }
.empty-state h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.45rem;
}
.empty-state p {
    color: var(--text-dim);
    font-size: 0.92rem;
    margin: 0;
    max-width: 400px;
}

/* ── INÍCIO (ui/inicio.js): o meio sem chat de texto aberto ───────────
   Pedido do dono (04/10): a tela padrão não abre chat. Fora de voz, o
   letreiro e uma linha (a recepção do aplicativo, sem a lista de canais); em
   voz, a SALA — um cartão por pessoa, em grade, como o palco do aplicativo. */
.inicio-logo { width: 200px; max-width: 60%; height: auto; margin-bottom: 1.2rem; }
.inicio-sala { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sala-cab { gap: 0.55rem; }
.sala-cab-ico { display: inline-flex; width: 18px; height: 18px; color: var(--accent); }
.sala-cab-ico svg { width: 100%; height: 100%; }
.sala-cab-conta { color: var(--text-faint); font-size: 0.8rem; }
.sala-aviso {
    display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
    margin: 1rem 1.25rem 0; padding: 0.6rem 0.9rem; border-radius: 12px;
    background: var(--accent-soft); border: 1px solid rgba(207, 252, 9, 0.3);
    font-size: 0.88rem;
}
.sala-grade {
    flex: 1; min-height: 0; overflow-y: auto;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    align-content: start; gap: 12px; padding: 1rem 1.25rem 1.25rem;
}
.sala-cartao {
    position: relative; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 1.5rem 0.75rem 1rem; border-radius: 16px;
    background: var(--bg-elev); border: 1px solid var(--line);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sala-cartao.clicavel { cursor: pointer; }
.sala-cartao.clicavel:hover { border-color: var(--line-strong); background: #17171b; }
.sala-cartao.falando { border-color: rgba(207, 252, 9, 0.45); }
.sala-avatar.voice-part-avatar { width: 72px; height: 72px; font-size: 1.35rem; border-width: 2px; }
.sala-nome {
    max-width: 100%; font-weight: 600; font-size: 0.92rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sala-voce { margin-top: -0.35rem; font-size: 0.72rem; color: var(--text-faint); }
.sala-selos { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 16px; }
.sala-selos .voice-part-state { margin-left: 0; }
.sala-selos .voice-ico { width: 16px; height: 16px; }
.sala-ao-vivo { position: absolute; top: 10px; left: 10px; }
.sala-radio-ico {
    width: 72px; height: 72px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
}
.sala-radio-ico svg { width: 30px; height: 30px; }
.sala-faixa {
    max-width: 100%; font-size: 0.78rem; color: var(--text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sala-radio.pausado .sala-faixa { color: var(--text-faint); }

/* ═══ SHELL — coluna 3: membros ═════════════════════════════════ */

/* .members-col é a COLUNA (fundo, borda, trilho e botão de ocultar);
   .members continua sendo a LISTA que ui/members.js redesenha inteira. */
.members-col {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #0d0d0f;
    border-left: 1px solid var(--line);
}

.members {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0.5rem 0.75rem 1rem;
    overflow-y: auto;
}

.members-group {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 1rem 0.45rem 0.5rem;
}

.member {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.45rem;
    border-radius: 8px;
}
.member:hover { background: rgba(255, 255, 255, 0.04); }
.member-avatar { width: 30px; height: 30px; font-size: 0.66rem; }
.member-nick {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══ F2 — canais (sidebar) ═════════════════════════════════════ */

.channel-text {
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.channel-text:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.channel-text.active { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.channel-text.active .channel-hash { color: var(--accent); }

.channel-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-voice { color: var(--text-faint); cursor: not-allowed; }

/* contador de gente no canal de voz ("Voz 1 — 2") */
.channel-count {
    flex: none;
    margin-left: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}
.channel-voice.active .channel-count { color: var(--accent); }

/* ═══ F2 — cabeçalho do chat ════════════════════════════════════ */

.head-hash { color: var(--text-faint); font-weight: 700; margin-right: 0.45rem; }

.chat-topic {
    margin-left: 0.9rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--line);
    color: var(--text-faint);
    font-size: 0.8rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══ F2 — mensagens ════════════════════════════════════════════ */

.chat {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.msgs {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.9rem 1.1rem 0.4rem;
}

.msgs-top { display: flex; justify-content: center; padding: 0.4rem 0 0.6rem; }
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }

.msgs-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-faint);
    font-size: 0.9rem;
}
.msgs-empty p { margin: 0; }
.msgs-empty-title {
    color: var(--text-dim);
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 0.3rem !important;
}

.msg-group {
    display: flex;
    gap: 0.7rem;
    padding: 0.25rem;
    margin-top: 0.7rem;
    border-radius: 8px;
}
.msg-avatar { width: 36px; height: 36px; font-size: 0.74rem; margin-top: 2px; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 0.5rem; }
.msg-author { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.msg-time { font-size: 0.7rem; color: var(--text-faint); }

.msg-line {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.92rem;
    line-height: 1.45;
    padding: 1px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: text;
    cursor: text;
}
.msg-line.pending { opacity: 0.45; }
.msg-edited {
    color: var(--text-faint);
    font-size: 0.68rem;
    margin-left: 0.35rem;
    user-select: none;
}

/* estados centrais do painel */
.chat-load { flex: 1; display: flex; align-items: center; justify-content: center; }
.chat-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 2rem;
    text-align: center;
}
.chat-error p { color: var(--text-dim); font-size: 0.92rem; margin: 0; max-width: 380px; }

/* ═══ F2 — composer ═════════════════════════════════════════════ */

.composer {
    flex: none;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem 1rem;
}

.composer textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    max-height: 180px;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.45;
}
.composer textarea::placeholder { color: rgba(255, 255, 255, 0.35); }
.composer textarea:focus { outline: none; border-color: var(--accent); }

.composer-send {
    flex: none;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #0a0a0b;                /* interação lime = texto escuro (design) */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.composer-send:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(207, 252, 9, 0.25); }
.composer-send svg { width: 17px; height: 17px; }

.composer-noperm {
    flex: none;
    margin: 0.6rem 1.1rem 1rem;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--text-faint);
    font-size: 0.85rem;
}

.composer-error {
    flex: none;
    margin: 0.2rem 1.1rem 0;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff8585;
    font-size: 0.82rem;
}

/* ═══ F2 — membros (presença) ═══════════════════════════════════ */

.member-avatar-wrap { position: relative; flex: none; }
.status-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--success);              /* online = verde, nunca lime */
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.45);
    border: 2.5px solid #0d0d0f;             /* recorte sobre o fundo da coluna */
}
.member.offline { opacity: 0.55; }
.member.offline .status-dot { background: rgba(255, 255, 255, 0.28); box-shadow: none; }

/* ═══ F2 — pill de status do gateway (Dynamic Island) ═══════════ */

.status-pill {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem;
    width: max-content;
    max-width: calc(100vw - 2rem);
    background: linear-gradient(180deg, rgba(18, 18, 21, 0.82), rgba(6, 6, 8, 0.86));
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 6px 16px rgba(0, 0, 0, 0.3);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    pointer-events: none;
}
.status-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 8px rgba(255, 217, 61, 0.55);
    animation: rb-dot-pulse 1.8s ease-in-out infinite;
}
.status-pill.dead .status-pill-dot {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.55);
}
@keyframes rb-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(1.5); }
}
@media (prefers-reduced-motion: reduce) {
    .status-pill-dot { animation: none; }
}

/* ═══ F2 — logout ═══════════════════════════════════════════════ */

.icon-btn-exit:hover:not(:disabled) {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.10);
}

/* ═══ F2b — composer: botão ＋ e chips de anexo pendente ═════════ */

.composer-attach {
    flex: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.composer-attach:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: var(--line-strong);
}
.composer-attach svg { width: 18px; height: 18px; }

.composer-chips {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.5rem 1.1rem 0;
}

/* chip pill (Lime v2) com thumb, nome+tamanho, barra de progresso e X */
.att-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 260px;
    padding: 0.3rem 0.55rem 0.3rem 0.35rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    overflow: hidden;
}
.att-chip-error {
    border-color: rgba(255, 107, 107, 0.45);
    background: rgba(255, 107, 107, 0.08);
}

.att-chip-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}
.att-chip-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.att-chip-icon svg { width: 15px; height: 15px; }

.att-chip-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.att-chip-name {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-chip-meta {
    font-size: 0.66rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-chip-error .att-chip-meta { color: var(--danger); }

.att-chip-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
}
.att-chip-fill {
    display: block;
    height: 100%;
    background: var(--accent);
    transition: width 0.15s ease;
}

.att-chip-x {
    flex: none;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.att-chip-x:hover { color: var(--danger); background: rgba(255, 107, 107, 0.12); }
.att-chip-x svg { width: 11px; height: 11px; }

/* ═══ F2b — anexos nas mensagens ════════════════════════════════ */

.msg-atts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.25rem 0;
}

.att-img {
    max-width: min(480px, 100%);
    max-height: 340px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    display: block;
    object-fit: contain;   /* com aspect-ratio reservado o layout não pula */
    cursor: zoom-in;
}

.att-video {
    max-width: min(520px, 100%);
    max-height: 340px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #000;
    display: block;
}

.att-audio { width: min(380px, 100%); display: block; }

/* cartão de download (cantos 18px = --radius-card, Lime v2) */
.att-file {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    max-width: min(420px, 100%);
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-card);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.att-file:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.att-file:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.att-file-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}
.att-file-icon svg { width: 17px; height: 17px; }

.att-file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}
.att-file-name {
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-file-meta { font-size: 0.72rem; color: var(--text-faint); }

/* ═══ F2b — overlay de drag&drop (janela toda) ══════════════════ */

.drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 6, 8, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;   /* o drop cai nos handlers de window */
}
.drop-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 2.2rem 3rem;
    border-radius: var(--radius-card);
    background: var(--bg-elev);
    border: 2px dashed rgba(207, 252, 9, 0.45);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.drop-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
}
.drop-icon svg { width: 24px; height: 24px; }
.drop-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.drop-sub { margin: 0; color: var(--text-dim); font-size: 0.88rem; }

/* ═══ F2b — lightbox de imagem ══════════════════════════════════ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 2.5rem;
    background: rgba(4, 4, 5, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.lightbox-img {
    max-width: calc(100vw - 5rem);
    max-height: calc(100vh - 8rem);
    max-height: calc(100dvh - 8rem);
    border-radius: 12px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
    user-select: none;
}
.lightbox-name {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.85rem;
    max-width: 80vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: text;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.12); }
.lightbox-close svg { width: 16px; height: 16px; }

/* ═══ F3 — canais de voz na sidebar ═════════════════════════════ */

.channel-voice.joinable {
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.channel-voice.joinable:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.channel-voice.active { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.channel-voice.active svg { color: var(--accent); }
.channel-voice.noperm { color: var(--text-faint); cursor: not-allowed; }
/* webcam ligada (voice/camera.js): ícone ao lado do nick */
.cam-badge { display: inline-flex; width: 15px; height: 15px; margin-left: .3rem; color: var(--accent); flex: 0 0 auto; }
.cam-badge svg { width: 100%; height: 100%; }
.cam-badge.clickable { cursor: pointer; }
.cam-badge.clickable:hover { filter: brightness(1.25); }
/* seção "Canais inativos" (3 dias sem ninguém): apagado, acende no hover */
.channel-voice.inativo { opacity: 0.55; }
.channel-voice.inativo:hover { opacity: 1; }

/* participantes sob o canal (voice_states do servidor — todos veem) */
.voice-parts {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 1px 0 3px 1.7rem;   /* indent alinhado ao nome do canal */
}

.voice-part {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.16rem 0.4rem;
    border-radius: 6px;
    min-width: 0;
}
.voice-part:hover { background: rgba(255, 255, 255, 0.04); }

.voice-part-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex: none;
    background-color: var(--accent-soft);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--accent);
    font-size: 0.52rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(207, 252, 9, 0.25);
}

/* anel lime pulsante em quem está falando (ActiveSpeakersChanged) */
.voice-part-avatar.speaking {
    border-color: transparent;
    animation: rb-speak-pulse 1.5s ease-in-out infinite;
}
@keyframes rb-speak-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(207, 252, 9, 0.95), 0 0 10px rgba(207, 252, 9, 0.35); }
    50%      { box-shadow: 0 0 0 2px rgba(207, 252, 9, 0.55), 0 0 3px rgba(207, 252, 9, 0.12); }
}
@media (prefers-reduced-motion: reduce) {
    .voice-part-avatar.speaking {
        animation: none;
        box-shadow: 0 0 0 2px rgba(207, 252, 9, 0.9);
    }
}

.voice-part-nick {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-part-muted {
    flex: none;
    display: flex;
    color: var(--danger); /* F6: server-muted = mic cortado VERMELHO (contrato) */
}
.voice-part-muted svg { width: 12px; height: 12px; }

/* entrada "N ao vivo · ver as duas": abre o mosaico direto da lista do canal.
   Fica sob os participantes, com o mesmo recuo, e só existe no MEU canal. */
.voice-mosaic-cta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 2px;
    padding: 0.18rem 0.4rem;
    border: 1px dashed rgba(207, 252, 9, 0.35);
    border-radius: 6px;
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: 0.72rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.voice-mosaic-cta:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.voice-mosaic-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.voice-mosaic-cta.on { border-style: solid; border-color: rgba(207, 252, 9, 0.55); background: var(--accent-soft); }
.voice-mosaic-n { flex: none; font-weight: 700; color: var(--accent); }
.voice-mosaic-act {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* badge "AO VIVO" (streaming = screen share publicado) */
.live-badge {
    flex: none;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 107, 107, 0.16);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: #ff8585;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

/* ═══ F3 — painel de conexão de voz (rodapé da sidebar) ═════════ */

.voice-conn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
}

.voice-conn-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.voice-conn-status {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}
.voice-conn[data-status="connecting"] .voice-conn-status,
.voice-conn[data-status="reconnecting"] .voice-conn-status {
    color: var(--warning);
    animation: rb-voice-blink 1.4s ease-in-out infinite;
}
@keyframes rb-voice-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
    .voice-conn[data-status="connecting"] .voice-conn-status,
    .voice-conn[data-status="reconnecting"] .voice-conn-status { animation: none; }
}

.voice-conn-channel {
    font-size: 0.7rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* barrinhas de qualidade (ConnectionQualityChanged do participante local) */
.voice-quality {
    flex: none;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    padding: 0 2px;
}
.voice-quality i {
    width: 3px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.18);
}
.voice-quality i:nth-child(1) { height: 5px; }
.voice-quality i:nth-child(2) { height: 8px; }
.voice-quality i:nth-child(3) { height: 12px; }
.voice-quality[data-q="excellent"] i { background: var(--accent); }
.voice-quality[data-q="good"] i:nth-child(-n+2) { background: var(--accent); }
.voice-quality[data-q="poor"] i:nth-child(1) { background: var(--warning); }
.voice-quality[data-q="lost"] i:nth-child(1) { background: var(--danger); }

/* erro transitório de voz */
.voice-error {
    margin: 0.5rem 0.75rem 0;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff8585;
    font-size: 0.78rem;
}

/* botões mute/deafen ativados (mutado/ensurdecido = vermelho) */
.icon-btn.toggled-off {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.10);
}
.icon-btn.toggled-off:hover:not(:disabled) {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.16);
}

/* ═══ F4: modal de configurações de voz ═══ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0bb8;
    backdrop-filter: blur(3px);
}

.modal-card {
    width: min(520px, calc(100vw - 48px));
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px); /* celular: desconta a barra do navegador */
    overflow-y: auto;
    background: var(--bg-elev, #131316);
    border: 1px solid #ffffff14;
    border-radius: var(--radius-card, 18px);
    box-shadow: 0 24px 64px #00000080;
    padding: 20px 22px 22px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.modal-head h2 {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-dim, #ffffff9e);
}

.field-hint {
    font-weight: 400;
    color: #ffffff5e;
}

.field select {
    background: #0a0a0b;
    color: inherit;
    border: 1px solid #ffffff1f;
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    font-size: .88rem;
}

.field select:focus {
    outline: none;
    border-color: var(--accent, #CFFC09);
}

.radio-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: .88rem;
}

.radio-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.radio-row input {
    accent-color: var(--accent, #CFFC09);
}

/* medidor de nível do mic (barra + marcador do limiar) */
.meter {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: #0a0a0b;
    border: 1px solid #ffffff14;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: #ffffff38;
    border-radius: 999px;
    transition: width 60ms linear;
}

.meter-fill.meter-open {
    background: var(--accent, #CFFC09);
}

.meter-mark {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: #ffffffb0;
}

#audio-threshold {
    width: 100%;
    accent-color: var(--accent, #CFFC09);
}

.ptt-row {
    display: flex;
    gap: 8px;
}

/* checkbox de linha inteira do modal (diferente do .perm-check da grade de
   cargos: aqui o rótulo é uma frase e precisa quebrar em vez de virar "…"). */
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
}
.check-row input {
    flex: none;
    margin-top: 3px;
    accent-color: var(--accent, #CFFC09);
}

.field-error {
    font-size: .8rem;
    color: var(--danger, #ff6b6b);
}

/* F4 — bloco da atenuação de comunicações do Windows (ducking): frase de
   estado em texto normal e aviso de "pronto" no acento. O aviso de ERRO deste
   bloco reusa .field-error (a classe é trocada no settings.js). */
/* passo a passo do "não abaixar o som dos outros programas" (texto fixo) */
.duck-status {
    font-size: .85rem;
    line-height: 1.45;
    color: var(--text-dim, #ffffff9e);
    margin: 0;
    user-select: text;   /* dá para copiar "mmsys.cpl" */
}
.duck-status b { color: var(--text); }

/* aviso de que a tecla de falar só vale com a janela em foco: é limitação
   sem conserto no site, então tem de ficar visível, não escondida. */
.ptt-warn {
    margin: 0;
    font-size: .8rem;
    line-height: 1.45;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    background: rgba(255, 176, 32, 0.10);
    border: 1px solid rgba(255, 176, 32, 0.28);
    color: #ffce7a;
}
.ptt-warn b { color: #ffe0a8; }

/* ═══ F5 — screen share: stage no painel central ════════════════ */

.stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

.stage-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    background: #0d0d0f;
    border-bottom: 1px solid var(--line);
}

.stage-streamer {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* botões compactos na barra do stage */
.stage-bar .rb-btn { padding: 0.32rem 0.85rem; font-size: 0.78rem; }

.stage-video-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.stage-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 16:9 dentro do painel sem cortar nem esticar */
}

.stage-wait {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.stage-wait p { margin: 0; }

/* Modo teatro: a coluna de jogadores some inteira (nem o trilho fica) e o palco
   ganha a largura. O teatro TEM A PALAVRA FINAL enquanto está ligado — a regra
   dupla `body.theater.coluna-membros-off` existe para vencer a preferência por
   especificidade, e não por ordem no arquivo. A preferência guardada no
   localStorage não é tocada: sair do teatro a devolve sozinha. */
body.theater { --col-membros: 0px; }
body.theater.coluna-membros-off { --col-membros: 0px; }
body.theater .members-col { display: none; }

/* badge AO VIVO clicável (sidebar F5): assistir / parar de assistir */
.live-badge.clickable { cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.live-badge.clickable:hover { background: rgba(255, 107, 107, 0.32); color: #ffb3b3; }
.live-badge.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Vários AO VIVO no mesmo canal: o que EU estou assistindo sai do vermelho de
   "está transmitindo" e vira LIME — o acento da marca marca a minha escolha. */
.live-badge.watching {
    background: var(--accent-soft);
    border-color: rgba(207, 252, 9, 0.55);
    color: var(--accent);
}
.live-badge.clickable.watching:hover { background: rgba(207, 252, 9, 0.2); color: var(--accent); }

/* posição na lista de transmissões do canal ("2 de 3"), ao lado do nome */
.stage-count {
    flex: none;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-faint);
    white-space: nowrap;
}

/* convite passageiro: uma SEGUNDA transmissão começou enquanto eu assisto a
   uma. Fica por cima do palco, no alto, e some sozinho em 12s — quem quiser
   depois ainda tem o botão "Mosaico" na barra e a entrada na sidebar. */
.stage-invite {
    position: absolute;
    left: 50%;
    top: 0.6rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: min(92%, 30rem);
    padding: 0.3rem 0.4rem 0.3rem 0.7rem;
    border: 1px solid rgba(207, 252, 9, 0.45);
    border-radius: 999px;
    background: rgba(10, 10, 11, 0.88);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    z-index: 3;
    animation: rb-invite-in 0.18s ease-out;
}
@keyframes rb-invite-in {
    from { opacity: 0; transform: translate(-50%, -0.35rem); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) { .stage-invite { animation: none; } }
.stage-invite-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    color: var(--text);
}
.stage-invite-act {
    flex: none;
    padding: 0.15rem 0.6rem;
    border: 1px solid rgba(207, 252, 9, 0.55);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.stage-invite-act:hover { background: rgba(207, 252, 9, 0.2); }
.stage-invite-close {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-faint);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}
.stage-invite-close:hover { color: var(--text); }

/* miniatura da MINHA tela enquanto assisto a transmissão de outra pessoa:
   <video> próprio, por cima do palco, no canto de baixo à direita */
.stage-self {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 18%;
    min-width: 150px;
    max-width: 260px;
    border: 1px solid rgba(207, 252, 9, 0.45);
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    cursor: pointer;
    z-index: 2;
}
.stage-self:hover { border-color: var(--accent); }
.stage-self video { display: block; width: 100%; height: auto; }
.stage-self-label {
    position: absolute;
    left: 0.35rem;
    bottom: 0.3rem;
    padding: 0.05rem 0.32rem;
    border-radius: 4px;
    background: rgba(10, 10, 11, 0.72);
    color: var(--accent);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.stage-self-close {
    position: absolute;
    right: 0.15rem;
    top: 0.1rem;
    width: 1.2rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(10, 10, 11, 0.6);
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}
.stage-self-close:hover { background: rgba(10, 10, 11, 0.9); color: var(--text); }

/* voicebar: "ASSISTINDO <nick>" — quem eu vejo agora, mesmo com o palco na
   janela flutuante (clique traz o palco de volta) */
.watch-pill {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 9rem;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(207, 252, 9, 0.4);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    overflow: hidden;
}
.watch-pill:hover { border-color: var(--accent); }
.watch-pill .watch-pill-nick {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* FAIXA DA MÚSICA — dentro da chamada, abaixo do painel de conexão.
   Volume e mudo a zero cliques: antes era preciso clicar no Rádio Refúgio e
   abrir um painel só para abaixar o som que já estava alto no ouvido. O que
   mexe no canal INTEIRO (pular, trocar, parar) continua atrás do título, para
   ninguém fazer isso sem querer enquanto procura o volume. */
.mus-faixa {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.25rem 0.5rem 0.35rem;
    border-bottom: 1px solid var(--border, #26262b);
}
.mus-faixa[hidden] { display: none; }
.mus-faixa-tit {
    flex: 1 1 auto; min-width: 0; text-align: left;
    background: none; border: 0; padding: 0; cursor: pointer;
    font-size: 0.7rem; color: var(--accent);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mus-faixa-tit::before { content: '♪ '; }
.mus-faixa-tit:hover { text-decoration: underline; }
.mus-faixa-alto {
    flex: 0 0 auto; width: 14px; height: 14px; display: inline-flex;
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--text-faint, #a1a1aa);
}
.mus-faixa-alto svg { width: 100%; height: 100%; }
.mus-faixa-alto:hover { color: var(--accent); }
.mus-faixa-alto.mudo { color: var(--danger, #ef4444); }
.mus-faixa-vol {
    /* width EXPLÍCITO junto do flex: só o flex-basis não segurava, porque a
       regra geral de input[type=range] do app dá largura a ele. Régua larga
       comia o nome da música, que é o que interessa ler de relance. */
    flex: 0 0 58px; width: 58px; min-width: 58px; height: 10px;
    accent-color: var(--text-faint, #a1a1aa);
}

/* SOM DO PC: interruptor do som do sistema na MINHA transmissão.
   Amarelo enquanto está indo — é um aviso, não um enfeite: esse som carrega
   as vozes do Hub e do Discord junto, e o navegador não separa. Apagado
   (cinza) quando a pessoa calou o som e só o vídeo está indo. */
.sompc-pill {
    flex: none;
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 196, 0, 0.5);
    background: rgba(255, 196, 0, 0.12);
    color: #ffc400;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    white-space: nowrap;
}
.sompc-pill:hover { border-color: #ffc400; }
.sompc-pill.off {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-faint, #a1a1aa);
}
.sompc-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* transmissão pelo APLICATIVO: o som do programa escolhido, com medidor */
.appsom-pill {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 11rem;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(207, 252, 9, 0.35);
    background: rgba(207, 252, 9, 0.08);
    color: var(--accent);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: default;
}
.appsom-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appsom-pill.conectando {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-faint, #a1a1aa);
}
.appsom-pill.mudo {
    border-color: rgba(255, 196, 0, 0.5);
    background: rgba(255, 196, 0, 0.12);
    color: #ffc400;
}
.appsom-medidor {
    flex: none;
    width: 28px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
.appsom-medidor > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.2s linear;
}

/* botão transmitir da voicebar enquanto EU estou AO VIVO */
.icon-btn.live {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.12);
}
.icon-btn.live:hover:not(:disabled) {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.18);
}

/* ═══ F6 — admin/cargos/moderação ═══════════════════════════════ */

/* botões sólidos (o design só tinha o ghost até aqui) */
.rb-btn-accent {
    background: var(--accent);
    color: #0a0a0b;                /* interação lime = texto escuro (design) */
}
.rb-btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(207, 252, 9, 0.25);
}
.rb-btn-danger {
    background: var(--danger);
    color: #0a0a0b;
    box-shadow: none;
}
.rb-btn-danger:hover {
    transform: translateY(-1px);
    background: #ff8585;
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.3);
}
.rb-btn-danger-ghost {
    color: var(--danger);
    border-color: rgba(255, 107, 107, 0.35);
}
.rb-btn-danger-ghost:hover {
    background: rgba(255, 107, 107, 0.10);
    border-color: rgba(255, 107, 107, 0.55);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}
.modal-actions .rb-btn-danger-ghost { margin-right: auto; } /* destrutivo à esquerda */

/* inputs de texto dos modais (mesma receita do select da F4).
   password entra na mesma receita para o form de login local não divergir. */
/* number entra na MESMA receita: o limite de pessoas do canal de voz e o
   unico campo numerico dos modais, e ele nao pode parecer de outro app. */
.field input[type="text"],
.field input[type="number"],
.field input[type="password"] {
    background: #0a0a0b;
    color: inherit;
    border: 1px solid #ffffff1f;
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    font-size: .88rem;
}
.field input[type="text"]::placeholder,
.field input[type="number"]::placeholder,
.field input[type="password"]::placeholder { color: rgba(255, 255, 255, 0.35); }
.field input[type="text"]:focus,
.field input[type="number"]:focus,
.field input[type="password"]:focus {
    outline: none;
    border-color: var(--accent, #CFFC09);
}
.field input[type="text"]:disabled,
.field input[type="number"]:disabled,
.field input[type="password"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── engrenagem de admin no header da sidebar ─────────────────── */
.sidebar-admin { margin-left: auto; }
/* engrenagem + recolher colados: cada pixel aqui é pixel do título */
.sidebar-admin + .sidebar-hide { margin-left: -0.35rem; }

/* ── seções recolhíveis (canais e jogadores) ───────────── */
/* O cabeçalho da seção continua sendo o mesmo rótulo minúsculo de sempre: ele
   só virou botão e ganhou uma seta. O botão toma a linha inteira (flex: 1) para
   o alvo de clique ser o cabeçalho todo, sobrando ao lado apenas o ＋ de
   administração, que tem clique próprio. */
.section-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.section-toggle {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: transparent;
    /* font: inherit não carrega caixa alta nem espaçamento: o rótulo tem de
       continuar idêntico ao que era quando o cabeçalho era um <div> */
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s ease;
}
.section-toggle:hover { color: var(--text-dim); }
.section-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.section-caret {
    flex: none;
    width: 12px;
    height: 12px;
    transition: transform 0.15s ease;
}
/* recolhida: a seta gira por transform, que não mexe no fluxo — nada pula */
.section-toggle[aria-expanded="false"] .section-caret { transform: rotate(-90deg); }
.section-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
    .section-caret { transition: none; }
}

/* ── colunas recolhíveis: botão de ocultar + trilho de voltar ── */
/* Ocultar mora DENTRO da coluna aberta; o trilho é o que sobra dela fechada.
   ui/collapse.js troca um pelo outro com o atributo hidden. */
/* Mais estreito que um .icon-btn comum e colado na borda: o cabeçalho tem
   52px e já carrega título, selo ALPHA e engrenagem — um botão de 30px a mais
   comia o "Refúgio Hub" até sobrar reticências. Ampliar não pode encolher o
   que já estava lá. */
.sidebar-hide {
    margin-left: auto;
    margin-right: -0.5rem;
    width: 22px;
    height: 26px;
    border-radius: 6px;
}
.sidebar-hide svg { width: 15px; height: 15px; }
.members-hide {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 22px;
    height: 22px;
    /* fundo próprio: a lista rola por baixo dele, e o ícone não pode sumir no
       meio de um nick */
    background: #0d0d0f;
    border-radius: 6px;
}
.members-hide svg { width: 15px; height: 15px; }

/* Com a coluna recolhida sobra só o trilho: os irmãos saem do fluxo para a
   fatia de 26px não virar um recorte esmagado do painel antigo. */
body.coluna-esq-off .sidebar > :not(.col-rail) { display: none; }
body.coluna-membros-off .members-col > :not(.col-rail) { display: none; }

.col-rail {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    /* alinhado com a faixa de 52px dos cabeçalhos: a seta nasce na altura em
       que o olho já está */
    padding: 17px 0 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.col-rail:hover { background: rgba(255, 255, 255, 0.05); color: var(--accent); }
.col-rail:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.col-rail svg { width: 16px; height: 16px; }

/* ── sidebar: botão ＋ das seções (MANAGE_CHANNELS) ────────────── */
.channels-group-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}
.group-add {
    flex: none;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-faint);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.group-add:hover { background: rgba(255, 255, 255, 0.08); color: var(--accent); }

/* ── sidebar: drag&drop de reordenação ─────────────────────────── */
.channel.dragging { opacity: 0.4; }
.channel.drop-above { box-shadow: 0 -2px 0 0 var(--accent); }
.channel.drop-below { box-shadow: 0 2px 0 0 var(--accent); }

/* ── menu de contexto ──────────────────────────────────────────── */
.ctx-menu {
    position: fixed;
    z-index: 1010;
    min-width: 170px;
    padding: 5px;
    background: var(--bg-elev, #131316);
    border: 1px solid #ffffff1f;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ctx-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}
.ctx-item:hover { background: rgba(255, 255, 255, 0.07); }
.ctx-item.ctx-danger { color: var(--danger); }
.ctx-item.ctx-danger:hover { background: rgba(255, 107, 107, 0.12); }

/* ── modal de administração (Cargos/Banidos) ───────────────────── */
.admin-card { width: min(680px, calc(100vw - 48px)); }

.admin-tabs { display: flex; gap: 6px; }
.admin-tab {
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.admin-tab:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.admin-tab.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(207, 252, 9, 0.25);
}

.admin-panel-roles {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 18px;
}

.roles-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.roles-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 340px;
    overflow-y: auto;
}
.role-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.role-row:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.role-row.active { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.role-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);   /* sem cor definida */
}
.role-row-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.role-admin-badge {
    flex: none;
    padding: 0.06rem 0.3rem;
    border-radius: 4px;
    background: var(--accent-soft);
    border: 1px solid rgba(207, 252, 9, 0.25);
    color: var(--accent);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.roles-new { padding: 0.45rem 0.8rem; font-size: 0.8rem; }

.role-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input { flex: 1; min-width: 0; }
.role-color-swatch {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: transparent;
}
.role-color-swatch.invalid { border-color: var(--danger); }

.perm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 14px;
}
.perm-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
    min-width: 0;
}
.perm-check span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.perm-check input { accent-color: var(--accent, #CFFC09); }
.perm-check input:disabled { cursor: not-allowed; }
.perm-check input:disabled + span { opacity: 0.45; }

.role-hint { font-size: 0.8rem; color: var(--text-faint); }

/* ── aba Banidos ───────────────────────────────────────────────── */
.bans-empty { color: var(--text-faint); font-size: 0.9rem; margin: 0.4rem 0; }
.bans-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 380px;
    overflow-y: auto;
}
.ban-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}
.ban-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.ban-nick { font-size: 0.88rem; font-weight: 600; }
.ban-meta {
    font-size: 0.72rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: text;
}
.ban-unban { flex: none; padding: 0.35rem 0.85rem; font-size: 0.78rem; }

/* ── card de membro ────────────────────────────────────────────── */
.member-card-box { width: min(400px, calc(100vw - 48px)); }
.member-card-box .rb-btn { padding: 0.45rem 0.95rem; font-size: 0.82rem; }

.mc-head { display: flex; align-items: center; gap: 0.85rem; }
.mc-avatar { width: 56px; height: 56px; font-size: 1.05rem; }
.mc-id {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mc-nick {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mc-muted-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--danger);
    font-size: 0.72rem;
    font-weight: 600;
}
.mc-muted-badge svg { width: 12px; height: 12px; flex: none; }
.mc-userid-row { display: flex; align-items: center; gap: 0.5rem; }
.mc-userid {
    font-size: 0.78rem;
    color: var(--text-faint);
    user-select: text;   /* dá para selecionar mesmo sem o botão copiar */
}
.mc-copy {
    border: none;
    background: transparent;
    padding: 0;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline dotted;
}
.mc-copy:hover { color: #e3ff66; }
.mc-profile { align-self: flex-start; }

#mc-volume { width: 100%; accent-color: var(--accent, #CFFC09); }
#mc-share { flex: 1; min-width: 0; accent-color: var(--accent, #CFFC09); }
.mc-share-row { display: flex; align-items: center; gap: 0.6rem; }
.mc-share-row .rb-btn { flex: none; padding: 0.25rem 0.7rem; font-size: 0.75rem; }

.mc-mod-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-ban-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.mc-ban-form input[type="text"] {
    background: #0a0a0b;
    color: inherit;
    border: 1px solid #ffffff1f;
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    font-size: .88rem;
}
.mc-ban-form input[type="text"]:focus { outline: none; border-color: var(--danger); }

/* mic cortado vermelho nas listas (contrato F6) */
.member-muted {
    flex: none;
    display: flex;
    color: var(--danger);
}
.member-muted svg { width: 12px; height: 12px; }
.voice-part-clickable { cursor: pointer; }

/* ── confirmação compartilhada (acima dos outros modais) ───────── */
.confirm-backdrop { z-index: 1100; }
.confirm-card { width: min(380px, calc(100vw - 48px)); }
.confirm-title {
    margin: 0 0 0.5rem;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.confirm-text {
    margin: 0 0 1.1rem;
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ── toast de erro transitório ─────────────────────────────────── */
.toast-error {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    max-width: calc(100vw - 2rem);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-pill);
    background: rgba(40, 10, 10, 0.92);
    border: 1px solid rgba(255, 107, 107, 0.45);
    color: #ff8585;
    font-size: 0.84rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* ── chat: ações de hover + edição inline ──────────────────────── */
.msg-item { position: relative; border-radius: 6px; }
.msg-item:hover { background: rgba(255, 255, 255, 0.025); }

.msg-actions {
    position: absolute;
    top: -12px;
    right: 6px;
    display: none;
    gap: 2px;
    padding: 2px;
    background: var(--bg-elev, #131316);
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.msg-item:hover .msg-actions { display: flex; }
.msg-act {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.msg-act svg { width: 13px; height: 13px; }
.msg-act:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.msg-act-danger:hover { background: rgba(255, 107, 107, 0.12); color: var(--danger); }

.msg-edit { padding: 3px 0; }
.msg-edit-input {
    width: 100%;
    resize: none;
    max-height: 180px;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.45;
}
.msg-edit-input:focus { outline: none; border-color: var(--accent); }
.msg-edit-input:disabled { opacity: 0.55; }
.msg-edit-hint {
    margin-top: 3px;
    font-size: 0.68rem;
    color: var(--text-faint);
}
.msg-edit-error {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--danger);
}

/* ═══ LOGIN — caixa do botão ══════════════════════════ */

/* Sobrou um botão só (Discord): a coluna continua porque a dica em pt-BR
   fica embaixo dele. O que morreu junto com o login por Steam/senha foi o
   CSS do formulário local, do botão "Entrar (dev)" e do indicador de backend
   — sem essas telas, era regra pendurada sem dono. */
.login-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Menu de contexto das mensagens (botão direito) */
.ctx-menu {
    position: fixed;
    z-index: 120;
    min-width: 168px;
    padding: 5px;
    background: var(--bg-elev, #131316);
    border: 1px solid #ffffff1f;
    border-radius: 12px;
    box-shadow: 0 16px 40px #000000a6;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ctx-item {
    all: unset;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: .86rem;
    color: #ffffffdb;
    cursor: pointer;
}

.ctx-item:hover {
    background: #ffffff14;
    color: #fff;
}

.ctx-item-danger {
    color: var(--danger, #ff6b6b);
}

.ctx-item-danger:hover {
    background: #ff6b6b1f;
    color: var(--danger, #ff6b6b);
}

/* ═══ LOTACAO DO CANAL DE VOZ (user_limit) ══════════════════════ */

/* O contador ja existia ("Voz 1 — 2"); com limite ele vira "— 2/5" e ganha
   AMARELO quando enche. Amarelo (--warning) e nao vermelho de proposito:
   canal cheio nao e erro de ninguem, e informacao de sala. */
.channel-count.cheio { color: var(--warning); }
.channel-voice.active .channel-count.cheio { color: var(--warning); }

/* A linha inteira do canal cheio fica um passo atras (menos contraste) para
   que "cheio" seja visivel de relance, sem ler o numero. Sem esconder nada:
   quem administra os canais entra assim mesmo, e precisa continuar clicando. */
.channel-voice.cheio .channel-name { color: var(--text-faint); }

/* limite de pessoas: a regua numerica ocupa a largura do campo do modal */
#channel-limit { width: 100%; }

/* ═══ RECADO NEUTRO (nao e erro) ════════════════════════════════ */

/* Gemeo do .toast-error, em lime: mesma posicao, mesma vida curta, cor de
   "deu certo, so fique sabendo". Fica ACIMA do toast de erro para os dois
   poderem aparecer juntos sem se cobrirem. */
.toast-note {
    position: fixed;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    max-width: min(520px, calc(100vw - 2rem));
    padding: 0.55rem 1rem;
    border-radius: var(--radius-pill);
    background: rgba(24, 28, 8, 0.94);
    border: 1px solid rgba(207, 252, 9, 0.45);
    color: var(--accent);
    font-size: 0.84rem;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* ═══ CONVITE PARA A VOZ ════════════════════════════════════════ */

/* Botao "Chamar para a voz" no card de membro: o campo so existe quando o
   convite faria sentido, entao ele nasce e some com o contexto. */
.mc-invite-field .rb-btn { width: 100%; }
.mc-invite-field .field-hint { font-size: 0.78rem; line-height: 1.4; }

/* Mover de ligacao (quem administra os canais): a lista de salas + o botao */
.mc-move-row { display: flex; align-items: center; gap: 0.6rem; }
.mc-move-row select { flex: 1; min-width: 0; }
.mc-move-row .rb-btn { flex: none; padding: 0.4rem 0.9rem; }
#mc-move-hint { font-size: 0.78rem; line-height: 1.4; }

/* Pilha de convites RECEBIDOS. Canto de baixo a direita: longe da barra de voz
   (onde se clica com pressa) e longe da coluna de canais. A altura NAO e 18px
   como a dos toasts de proposito: ali embaixo passa a caixa de escrever do
   chat, e cartao com botao por cima de campo de texto e clique roubado. */
.voice-invites {
    position: fixed;
    right: 18px;
    bottom: 96px;
    z-index: 1250;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(330px, calc(100vw - 2rem));
    pointer-events: none; /* o espaco vazio da pilha nao rouba clique nenhum */
}

.voice-invite {
    pointer-events: auto; /* ...mas o cartao em si e clicavel */
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border-radius: 14px;
    background: var(--bg-elev);
    border: 1px solid rgba(207, 252, 9, 0.4);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
    animation: voice-invite-in 0.18s ease-out;
}

@keyframes voice-invite-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* Quem nao quer movimento nenhum na tela nao ganha movimento nenhum. */
@media (prefers-reduced-motion: reduce) {
    .voice-invite { animation: none; }
}

.voice-invite-top { display: flex; align-items: flex-start; gap: 0.55rem; }

.voice-invite-avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    background-color: var(--accent-soft);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-invite-txt { min-width: 0; flex: 1; }

.voice-invite-line {
    font-size: 0.86rem;
    line-height: 1.35;
    color: var(--text-dim);
    overflow-wrap: anywhere; /* nick comprido nao estoura o cartao */
}
.voice-invite-line strong { color: var(--text); font-weight: 700; }
.voice-invite-canal { color: var(--accent); }

.voice-invite-sub {
    margin-top: 2px;
    font-size: 0.74rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums; /* a contagem nao pode tremer */
}

.voice-invite-acoes { display: flex; gap: 0.5rem; }
.voice-invite-acoes .rb-btn { flex: 1; padding: 0.45rem 0.8rem; font-size: 0.84rem; }

/* Telas estreitas: a pilha vira faixa de baixo, com a mesma folga dos lados. */
@media (max-width: 560px) {
    .voice-invites { left: 18px; right: 18px; width: auto; }
}

/* ── palco em TELA CHEIA (Fullscreen API) ─────────────────────────────
   O elemento que vai a tela cheia e o #stage inteiro, para a barra de
   controles continuar alcançável la dentro. Em tela cheia ele deixa de ser
   uma coluna do grid e passa a ocupar tudo, com fundo proprio: o navegador
   pinta o fundo do elemento em fullscreen de branco por padrao, e branco
   atras de um video de tela e um susto no escuro. */
#stage:fullscreen,
#stage.is-fullscreen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    background: var(--bg, #0a0a0b);
    padding: 0;
    border-radius: 0;
}
/* Em tela cheia fica SÓ a imagem (pedido do dono, 04/10: "deveria ficar só o
   conteúdo do vídeo, sem menus"): a barra deixa de ocupar lugar e vira uma
   camada POR CIMA do vídeo, com degradê, que some sozinha depois de 2,5 s sem
   toque/mouse e volta no próximo (stage.js: mostrarControles). Antes ela
   comia duas linhas no celular deitado e espremia o vídeo. */
#stage:fullscreen,
#stage.is-fullscreen {
    position: relative;
}
#stage:fullscreen .stage-bar,
#stage.is-fullscreen .stage-bar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 6;
    padding: 0.6rem 0.9rem 1.8rem;
    padding-top: calc(0.6rem + env(safe-area-inset-top));
    padding-left: calc(0.9rem + env(safe-area-inset-left));
    padding-right: calc(0.9rem + env(safe-area-inset-right));
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.5) 62%, rgba(0, 0, 0, 0));
    border-bottom: 0;
    transition: opacity 0.25s ease;
}
#stage.controles-ocultos .stage-bar { opacity: 0; pointer-events: none; }
/* parado, sem controles: o cursor também some (como em qualquer player) */
#stage.controles-ocultos,
#stage.controles-ocultos * { cursor: none !important; }
/* o vídeo/mosaico ocupa a tela inteira, por baixo da barra */
#stage:fullscreen .stage-video-wrap,
#stage.is-fullscreen .stage-video-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}
@media (prefers-reduced-motion: reduce) {
    #stage:fullscreen .stage-bar, #stage.is-fullscreen .stage-bar { transition: none; }
}

/* ── microfone à mão no palco (pedido do dono, 04/10) ─────────────────
   O botão da barra de voz + o medidor das Configurações, na barra do palco.
   Aparece onde a barra de voz não está à vista: em tela cheia (qualquer
   aparelho) e no toque (celular/tablet). No computador fora da tela cheia a
   barra de voz já tem o botão — duplicar só encheria a barra do palco. */
.stage-mic { display: none; align-items: center; gap: 0.4rem; }
#stage:fullscreen .stage-mic,
#stage.is-fullscreen .stage-mic { display: flex; }
.stage-mic-btn { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); }
.stage-mic-btn svg { width: 17px; height: 17px; }
.stage-mic-meter { display: block; width: 4.5rem; height: 8px; }
.stage-mic-meter .meter-fill { display: block; }

/* CELULAR (toque): sem Tela cheia, Modo teatro e zoom por botão na barra
   (pedido do dono, 04/10). A tela cheia é DOIS TOQUES na imagem (e o voltar do
   Android sai); o zoom é a PINÇA na imagem (stage-zoom.js). hover:none +
   pointer:coarse pega o aparelho de toque mesmo DEITADO, quando a largura já
   passa dos 700px das regras de celular e o palco usaria a barra do PC. */
@media (hover: none) and (pointer: coarse) {
    .stage-mic { display: flex; }
    #stage-theater,
    .stage-bar .stage-fs-btn,
    .stage-bar .stage-zoom,
    .stage-bar .stage-fit { display: none !important; }
}

/* ── "Configurações avançadas" (bloco recolhido) ──────────────────────
   A tela de voz acumulou explicação de mais. O que quase ninguém mexe fica
   aqui dentro, fechado, sem sumir: quem precisa acha, quem não precisa nem
   vê. <details> nativo — teclado e leitor de tela funcionam de graça. */
.adv-block { margin-top: 1rem; border-top: 1px solid var(--border, #26262b); padding-top: 0.75rem; }
.adv-block > summary,
.adv-sub > summary {
    cursor: pointer;
    list-style: none;
    color: var(--text-faint, #a1a1aa);
    font-size: 0.9rem;
    padding: 0.35rem 0;
    user-select: none;
}
.adv-block > summary::-webkit-details-marker,
.adv-sub > summary::-webkit-details-marker { display: none; }
.adv-block > summary::before,
.adv-sub > summary::before {
    content: '▸';
    display: inline-block;
    width: 1em;
    transition: transform 0.15s ease;
}
.adv-block[open] > summary::before,
.adv-sub[open] > summary::before { transform: rotate(90deg); }
.adv-block > summary:hover,
.adv-sub > summary:hover { color: var(--text, #e7e7ea); }
.adv-body { display: flex; flex-direction: column; gap: 1rem; padding-top: 0.5rem; }
.adv-sub { border: 1px solid var(--border, #26262b); border-radius: 8px; padding: 0.5rem 0.75rem; }
.adv-sub .duck-status { margin: 0.4rem 0 0; font-size: 0.88rem; line-height: 1.5; color: var(--text-faint, #a1a1aa); }

/* ── atalhos de qualidade da transmissão ──────────────────────────────
   Escolher pelo USO (jogo, texto, máxima) em vez de montar resolução +
   taxa + prioridade na cabeça. O custo de subida fica no cartão: a pessoa
   decide com o número à vista, não escondido. */
.preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
/* auto-fit criava uma coluna vazia sobrando (medido: 5 faixas para 4 cartões).
   São sempre quatro atalhos: fixar as colunas dá um resultado previsível. */
@media (max-width: 760px) { .preset-row { grid-template-columns: repeat(2, 1fr); } }
.preset-card {
    display: flex; flex-direction: column; gap: 0.15rem;
    text-align: left; padding: 0.6rem 0.7rem;
    background: var(--card, #131316);
    border: 1px solid var(--border, #26262b);
    border-radius: 10px; cursor: pointer;
    color: var(--text, #e7e7ea);
    transition: border-color 0.12s ease, background 0.12s ease;
}
.preset-card:hover { border-color: var(--accent-soft, #5a6b0d); }
.preset-card.is-on { border-color: var(--accent, #CFFC09); background: color-mix(in srgb, var(--accent, #CFFC09) 8%, var(--card, #131316)); }
.preset-title { font-weight: 600; font-size: 0.95rem; }
.preset-desc { font-size: 0.8rem; color: var(--text-faint, #a1a1aa); line-height: 1.35; }
.preset-cost { font-size: 0.75rem; color: var(--text-faint, #a1a1aa); margin-top: 0.2rem; }
.preset-card.is-on .preset-cost { color: var(--accent, #CFFC09); }

/* ── janela de Configurações de voz: mais larga e responsiva ──────────
   As outras janelas (confirmar, editar canal, editar cargo) são formulários
   curtos e 520px lhes cai bem — alargar todas deixaria um "Tem certeza?"
   atravessado na tela. Esta é a densa: dois seletores de dispositivo, quatro
   atalhos de qualidade em grade e o bloco avançado. Em 520px os cartões
   empilhavam em coluna única e a rolagem ficava longa à toa.
   Cresce com a janela e para em 880px: passar disso vira linha de texto
   larga demais para ler com conforto. */
#audio-settings .modal-card {
    width: min(880px, calc(100vw - 48px));
}

/* Telas largas: os dois seletores de dispositivo dividem a linha, porque são
   curtos e relacionados. O resto ocupa a largura inteira. */
@media (min-width: 760px) {
    #audio-settings .modal-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem 1.25rem;
        align-items: start;
    }
    #audio-settings .modal-body > * { grid-column: 1 / -1; }
    #audio-settings .modal-body > .field:nth-child(1),
    #audio-settings .modal-body > .field:nth-child(2) { grid-column: auto; }
}

/* Celular: a janela encosta nas bordas e o respiro diminui — em 360px de
   largura, 24px de padding de cada lado comem 13% da tela. */
@media (max-width: 640px) {
    #audio-settings .modal-card {
        width: calc(100vw - 20px);
        padding: 16px 14px 18px;
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
    }
    .preset-row { grid-template-columns: 1fr 1fr; }
}

/* ── microfone e áudio ao lado do nome, no canal de voz ───────────────
   Aberto fica discreto (é o estado normal — não pode competir com o nome);
   fechado fica vermelho, porque é a informação que a pessoa está procurando
   quando olha ("por que fulano não fala?"). */
.voice-part-state { display: inline-flex; align-items: center; gap: 0.2rem; margin-left: auto; flex: 0 0 auto; }
.voice-ico { display: inline-flex; width: 14px; height: 14px; color: var(--text-faint, #71717a); }
.voice-ico svg { width: 100%; height: 100%; }
.voice-ico.is-off { color: var(--danger, #ef4444); }

/* ── Rádio Refúgio: o tocador do servidor como participante ─────────
   Mesma linha de uma pessoa (o pedido foi "aparecer uma nova pessoa"), só
   que o avatar é uma nota musical em vez de foto, e o nome é discreto para
   ninguém confundir com gente na chamada. */
.voice-part-radio .voice-part-nick { color: var(--text-faint, #a1a1aa); }
.radio-avatar {
    background-color: rgba(207, 252, 9, 0.08);
    color: var(--accent);
    padding: 4px;
}
.radio-avatar svg { width: 100%; height: 100%; }
/* silenciado só para mim: o rádio "apaga" na lista, sem sumir dela */
.radio-avatar.is-mudo { color: var(--text-faint, #71717a); border-color: rgba(255, 255, 255, 0.12); opacity: 0.75; }
.voice-ico.radio-mudo { cursor: pointer; }
.voice-ico.radio-mudo:hover { color: var(--accent); }
.voice-ico.radio-mudo.is-off:hover { color: var(--danger, #ef4444); opacity: 0.8; }
.voice-ico.radio-mudo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* controles finos dentro da seção de qualidade */
.share-fino { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.25rem; }
/* seções do bloco avançado: uma embaixo da outra, respirando */
.adv-body > .adv-sub { margin: 0; }
.adv-body { gap: 0.5rem; }

/* ═══ RÁDIO REFÚGIO — o player grande (js/ui/music-panel.js) ═════════
   Substitui o balão de 290 px: controles com tamanho de dedo, fila inteira
   à vista e arrastável, e a LETRA do lado da fila. A barra de PROGRESSO é do
   canal (lima, larga); a de VOLUME é só sua (cinza, curta) — as duas nunca
   se parecem. As capas vêm do próprio Hub (/api/v1/radio/capa/…). */
.radio-fundo { z-index: 95; }
.radio-janela {
    width: min(1240px, calc(100vw - 32px));
    height: min(900px, calc(100vh - 40px));
    display: flex; flex-direction: column;
    background: var(--bg-elev, #131316);
    border: 1px solid #ffffff14;
    border-radius: var(--radius-card, 18px);
    box-shadow: 0 24px 64px #00000080;
    overflow: hidden;
}
/* sem barra de título: o × fica solto no canto de cima */
.radio-janela .radio-topo > .radio-fechar {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(10, 10, 11, 0.35); color: var(--text-dim);
    transition: background 0.15s ease, color 0.15s ease;
}
.radio-janela .radio-topo > .radio-fechar:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.radio-janela .radio-topo > .radio-fechar svg { width: 17px; height: 17px; }

/* topo: agora tocando + progresso + controles, sobre a capa desfocada */
.radio-topo { position: relative; overflow: hidden; }
.radio-topo > :not(.radio-topo-fundo) { position: relative; }
.radio-topo-fundo {
    position: absolute; inset: -40px; background-size: cover; background-position: center;
    filter: blur(46px) saturate(1.35); transform: scale(1.15); opacity: 0;
    transition: opacity 0.6s ease; pointer-events: none;
}
.radio-topo.com-fundo .radio-topo-fundo { opacity: 0.32; }
.radio-topo::after {
    /* escurece embaixo: os controles continuam legíveis em qualquer capa */
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(19, 19, 22, 0.1), rgba(19, 19, 22, 0.75));
}
.radio-topo > * { z-index: 1; }

.radio-agora {
    display: grid; grid-template-columns: 124px 1fr; gap: 20px; align-items: center;
    padding: 22px 64px 8px 24px; /* à direita: o × do canto */
}
.radio-capa {
    position: relative; width: 124px; height: 124px; border-radius: 16px;
    background: radial-gradient(120% 120% at 20% 10%, rgba(207, 252, 9, 0.22), rgba(207, 252, 9, 0.04) 60%, transparent),
        #0e0e10;
    border: 1px solid rgba(207, 252, 9, 0.18);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.radio-capa.com-capa { border-color: rgba(255, 255, 255, 0.10); }
.radio-capa-ico { color: var(--accent); opacity: 0.9; transition: opacity 0.3s ease; }
.radio-capa-ico svg { width: 44px; height: 44px; }
.radio-capa-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.radio-capa-img[hidden] { display: none; }
.radio-capa.com-capa .radio-capa-ico { opacity: 0; }
.radio-eq {
    position: absolute; left: 0; right: 0; bottom: 12px; height: 34px;
    display: flex; align-items: flex-end; justify-content: center; gap: 5px;
    opacity: 0; transition: opacity 0.3s ease;
}
.radio-eq i { width: 7px; height: 30%; border-radius: 3px; background: var(--accent); }
.radio-capa.tocando .radio-capa-ico { opacity: 0.18; }
.radio-capa.tocando .radio-eq { opacity: 1; }
/* com capa de verdade, o equalizador vira um selo no canto, sem cobrir a arte */
.radio-capa.com-capa .radio-eq {
    left: 8px; right: auto; bottom: 8px; height: 22px; gap: 3px; padding: 4px 6px;
    border-radius: 8px; background: rgba(10, 10, 11, 0.72);
}
.radio-capa.com-capa .radio-eq i { width: 4px; }
.radio-capa.tocando .radio-eq i { animation: radio-eq 1.1s ease-in-out infinite; }
.radio-capa.tocando .radio-eq i:nth-child(2) { animation-delay: -0.35s; }
.radio-capa.tocando .radio-eq i:nth-child(3) { animation-delay: -0.7s; }
.radio-capa.tocando .radio-eq i:nth-child(4) { animation-delay: -0.2s; }
@keyframes radio-eq { 0%, 100% { height: 22%; } 50% { height: 100%; } }
.radio-capa.com-capa.tocando .radio-eq i { animation-name: radio-eq-selo; }
@keyframes radio-eq-selo { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.radio-meta { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.radio-estado {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent);
}
.radio-estado:empty { display: none; }
.radio-estado-erro { color: var(--danger); }
.radio-titulo {
    font-size: 1.45rem; font-weight: 700; line-height: 1.22;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    overflow-wrap: anywhere;
}
.radio-sub { color: var(--text-dim); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0 10px; }
.radio-sub-autor { color: var(--text); opacity: 0.9; }
.radio-sub-album::before { content: '· '; }
.radio-sub-quem::before { content: '· '; }
.radio-sub-quem b { color: var(--text); font-weight: 600; }

/* progresso — do canal inteiro */
.radio-prog { display: flex; align-items: center; gap: 12px; padding: 8px 24px 0; }
.radio-tempo {
    flex: none; min-width: 3.2em; font-size: 0.8rem; color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}
.radio-tempo-fim { text-align: right; }
.radio-barra {
    flex: 1; min-width: 0; width: auto; height: 22px; margin: 0; background: transparent;
    -webkit-appearance: none; appearance: none; cursor: pointer; --pct: 0%;
}
.radio-barra:disabled { cursor: default; }
.radio-barra::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px;
    background: linear-gradient(to right, var(--accent) var(--pct), rgba(255, 255, 255, 0.14) var(--pct));
}
.radio-barra::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
.radio-barra::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.radio-barra::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -5px;
    border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(207, 252, 9, 0.25);
    transition: transform 0.12s ease;
}
.radio-barra::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0;
    box-shadow: 0 0 0 4px rgba(207, 252, 9, 0.25);
}
.radio-barra:hover:not(:disabled)::-webkit-slider-thumb { transform: scale(1.15); }
.radio-barra:disabled::-webkit-slider-thumb { background: rgba(255, 255, 255, 0.45); box-shadow: none; }
.radio-barra:disabled::-moz-range-thumb { background: rgba(255, 255, 255, 0.45); box-shadow: none; }
.radio-barra:disabled::-webkit-slider-runnable-track {
    background: linear-gradient(to right, rgba(207, 252, 9, 0.55) var(--pct), rgba(255, 255, 255, 0.10) var(--pct));
}
.radio-barra:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* controles */
.radio-ctrl {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
    padding: 10px 24px 10px;
}
.radio-ctrl-lado { display: flex; align-items: center; gap: 6px; }
.radio-ctrl-dir { justify-content: flex-end; gap: 12px; }
.radio-ctrl-meio { display: flex; align-items: center; gap: 14px; }
.radio-modo, .radio-transp, .radio-play, .radio-vol-btn {
    border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.radio-modo {
    position: relative; width: 42px; height: 42px; border-radius: 12px;
    background: transparent; color: var(--text-dim);
}
.radio-modo svg { width: 20px; height: 20px; }
.radio-modo:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.radio-modo.ligado { color: var(--accent); background: var(--accent-soft); }
.radio-modo-1 {
    position: absolute; right: 6px; bottom: 5px; min-width: 13px; height: 13px; border-radius: 7px;
    font-size: 9px; font-weight: 800; line-height: 13px; text-align: center;
    background: var(--accent); color: #0a0a0b;
}
.radio-modo-1[hidden] { display: none; }
.radio-transp {
    width: 48px; height: 48px; border-radius: 50%;
    background: transparent; color: var(--text);
}
.radio-transp svg { width: 24px; height: 24px; }
.radio-transp:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); }
.radio-play {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--accent); color: #0a0a0b;
    box-shadow: 0 8px 24px rgba(207, 252, 9, 0.18);
}
.radio-play svg { width: 28px; height: 28px; }
.radio-play:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 10px 28px rgba(207, 252, 9, 0.3); }
.radio-modo:disabled, .radio-transp:disabled, .radio-play:disabled { opacity: 0.32; cursor: not-allowed; box-shadow: none; }
.radio-modo:focus-visible, .radio-transp:focus-visible, .radio-play:focus-visible, .radio-vol-btn:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

/* volume — só seu */
.radio-vol { display: flex; align-items: center; gap: 8px; }
.radio-vol-btn { width: 34px; height: 34px; border-radius: 10px; background: transparent; color: var(--text-dim); }
.radio-vol-btn svg { width: 20px; height: 20px; }
.radio-vol-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.radio-vol-btn.mudo { color: var(--danger); }
.radio-vol-barra { width: 120px; flex: none; accent-color: #d4d4d8; cursor: pointer; }
.radio-vol-pct { min-width: 2.6em; font-size: 0.78rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.radio-parar { padding: 0.5rem 0.95rem; font-size: 0.82rem; white-space: nowrap; }
.radio-parar svg { width: 14px; height: 14px; }
.radio-parar.confirmando, .radio-limpar.confirmando { background: var(--danger); color: #0a0a0b; border-color: var(--danger); }
.radio-parar[hidden], .radio-limpar[hidden] { display: none; }

.radio-dono { padding: 0 24px 10px; font-size: 0.8rem; color: var(--text-dim); text-align: center; }
.radio-dono b { color: var(--text); }
.radio-dono[hidden] { display: none; }

/* colocar música */
.radio-add {
    padding: 14px 24px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015); display: flex; flex-direction: column; gap: 8px;
}
.radio-add-form { display: flex; align-items: center; gap: 12px; }
.radio-add-campo {
    flex: 1; min-width: 0; position: relative; display: flex; align-items: center;
}
.radio-add-ico { position: absolute; left: 14px; color: var(--text-faint); pointer-events: none; display: inline-flex; }
.radio-add-ico svg { width: 18px; height: 18px; }
.radio-add-entrada {
    width: 100%; height: 46px; padding: 0 14px 0 42px; border-radius: 12px;
    background: #0c0c0e; border: 1px solid var(--line-strong); color: var(--text);
    font: inherit; font-size: 0.95rem; outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.radio-add-entrada::placeholder { color: var(--text-faint); }
.radio-add-entrada:focus { border-color: rgba(207, 252, 9, 0.55); box-shadow: 0 0 0 3px rgba(207, 252, 9, 0.12); }
.radio-add-entrada:disabled { opacity: 0.6; }
.radio-add-seguir {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.82rem; color: var(--text-dim); cursor: pointer; white-space: nowrap; user-select: none;
}
.radio-add-seguir input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.radio-add-btn { flex: none; height: 46px; padding: 0 1.3rem; }
.radio-add-btn:disabled { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }
.radio-status { min-height: 1.1em; font-size: 0.82rem; color: var(--text-dim); }
.radio-status:empty { display: none; }
.radio-status-ok { color: var(--success); }
.radio-status-erro { color: var(--danger); }
.radio-status-ocupado { color: var(--accent); }
.radio-status-ocupado::before {
    content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
    border: 2px solid rgba(207, 252, 9, 0.25); border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.radio-escolha {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(207, 252, 9, 0.25);
}
.radio-escolha[hidden] { display: none; }
.radio-escolha-txt { flex: 1 1 260px; font-size: 0.86rem; }
.radio-escolha .rb-btn { padding: 0.5rem 1rem; font-size: 0.84rem; }
.radio-res { border: 1px solid var(--line-strong); border-radius: 12px; background: #0e0e10; overflow: hidden; }
.radio-res[hidden] { display: none; }
.radio-res-cab {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 8px 8px 14px; font-size: 0.78rem; color: var(--text-dim); border-bottom: 1px solid var(--line);
}
.radio-res-fechar {
    width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--text-dim);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.radio-res-fechar:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.radio-res-fechar svg { width: 15px; height: 15px; }
.radio-res-lista { max-height: 264px; overflow-y: auto; padding: 4px; }
.radio-res-item {
    display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 9px; cursor: pointer;
}
.radio-res-item:hover { background: rgba(255, 255, 255, 0.05); }
.radio-res-txt { flex: 1; min-width: 0; }
.radio-res-tit { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-res-sub { font-size: 0.76rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-res-tipo {
    display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; vertical-align: 1px;
    font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08); color: var(--text-dim);
}
.radio-res-tipo-musica { background: var(--accent-soft); color: var(--accent); }
.radio-res-btn { flex: none; padding: 0.35rem 0.7rem; font-size: 0.78rem; gap: 4px; }
.radio-res-btn svg { width: 14px; height: 14px; }
.radio-res-posta-ico { display: none; color: var(--success); }
.radio-res-posta-ico svg { width: 18px; height: 18px; }
.radio-res-posta .radio-res-posta-ico { display: inline-flex; }
.radio-res-posta .radio-res-tit { color: var(--success); }

/* miniatura (capa) quadrada: o centro da imagem 16:9 do YouTube — nas faixas
   oficiais, exatamente a capa do álbum */
.radio-mini {
    position: relative; flex: none; width: 40px; height: 40px; border-radius: 7px; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: #1b1b1f; color: rgba(255, 255, 255, 0.22);
}
.radio-mini > svg { width: 18px; height: 18px; }
.radio-mini-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* embaixo: fila | letra */
.radio-baixo {
    flex: 1; min-height: 0;
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
}
.radio-abas { display: none; }
.radio-fila, .radio-letra { min-height: 0; display: flex; flex-direction: column; }
.radio-letra { border-left: 1px solid var(--line); background: rgba(255, 255, 255, 0.012); }
.radio-fila-cab {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 52px; padding: 10px 20px 6px 24px;
}
.radio-fila-tit { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.radio-fila-nome { font-weight: 700; font-size: 0.95rem; }
.radio-fila-nome + .radio-fila-info:not(:empty)::before { content: '· '; }
.radio-fila-info {
    color: var(--text-dim); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.radio-limpar { padding: 0.4rem 0.9rem; font-size: 0.78rem; white-space: nowrap; }
.radio-lista { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 14px 14px; }
.radio-vazio {
    display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center;
    padding: 36px 24px; color: var(--text-dim); font-size: 0.86rem; max-width: 520px; margin: 0 auto;
}
.radio-vazio b { color: var(--text); font-size: 0.95rem; }
.radio-item {
    position: relative;
    display: grid; grid-template-columns: 14px 24px 40px minmax(0, 1fr) auto 44px 92px;
    align-items: center; gap: 10px;
    padding: 6px 8px; border-radius: 10px;
    transition: background 0.12s ease;
}
.radio-item:hover { background: rgba(255, 255, 255, 0.045); }
.radio-item.atual { background: var(--accent-soft); }
.radio-item.atual .radio-item-tit { color: var(--accent); font-weight: 600; }
.radio-item.tocada:not(:hover) { opacity: 0.5; }
.radio-item.erro .radio-item-tit { text-decoration: line-through; opacity: 0.7; }
.radio-item.arrastando { opacity: 0.35; }
.radio-item.solta-acima::before, .radio-item.solta-abaixo::after {
    content: ''; position: absolute; left: 8px; right: 8px; height: 2px; border-radius: 2px;
    background: var(--accent); box-shadow: 0 0 8px rgba(207, 252, 9, 0.6);
}
.radio-item.solta-acima::before { top: -1px; }
.radio-item.solta-abaixo::after { bottom: -1px; }
.radio-item-pega { color: var(--text-faint); display: inline-flex; opacity: 0; transition: opacity 0.12s ease; }
.radio-item-pega svg { width: 14px; height: 14px; }
.radio-item.movel { cursor: grab; }
.radio-item.movel:hover .radio-item-pega { opacity: 1; }
.radio-item-n {
    display: inline-flex; align-items: center; justify-content: center; height: 20px;
    font-size: 0.78rem; color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.radio-item-n svg { width: 16px; height: 16px; }
.radio-item-n-alerta { color: var(--danger); }
.radio-item-ondas { gap: 2px; align-items: flex-end; height: 16px; }
.radio-item-ondas i { width: 3px; height: 40%; border-radius: 2px; background: var(--accent); }
.radio-item-ondas.vivo i { animation: radio-eq 0.9s ease-in-out infinite; }
.radio-item-ondas.vivo i:nth-child(2) { animation-delay: -0.3s; }
.radio-item-ondas.vivo i:nth-child(3) { animation-delay: -0.6s; }
.radio-item-txt { min-width: 0; }
.radio-item-tit { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-item-sub {
    display: flex; gap: 8px; align-items: center; min-width: 0;
    font-size: 0.75rem; color: var(--text-dim); overflow: hidden; white-space: nowrap;
}
.radio-item-autor, .radio-item-erro { overflow: hidden; text-overflow: ellipsis; }
.radio-item-marca {
    flex: none; padding: 0 6px; border-radius: 999px; font-size: 0.66rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase; color: #0a0a0b; background: var(--accent);
}
.radio-item-erro { color: var(--danger); }
.radio-item-dono {
    justify-self: end; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.72rem; color: var(--text-dim); padding: 2px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}
.radio-item-dur { text-align: right; font-size: 0.78rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.radio-item-acoes { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity 0.12s ease; }
.radio-item:hover .radio-item-acoes, .radio-item:focus-within .radio-item-acoes { opacity: 1; }
.radio-item-btn {
    width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--text-dim);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.radio-item-btn svg { width: 15px; height: 15px; }
.radio-item-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.radio-item-tirar:hover:not(:disabled) { color: var(--danger); background: rgba(255, 107, 107, 0.1); }
.radio-item-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.spinner-xs { width: 14px; height: 14px; border-width: 2px; }

/* letra: sincronizada, a linha cantada acende e a letra acompanha sozinha */
.radio-letra-corpo {
    /* position: relative faz desta caixa o offsetParent das linhas — sem isso o
       offsetTop de cada linha vinha medido do fundo da janela, e a letra rolava
       para o lugar errado (a linha acesa ficava fora de vista) */
    position: relative;
    flex: 1; min-height: 0; overflow-y: auto; outline: none;
    padding: 18px 28px 0 24px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 56px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 56px), transparent 100%);
}
.radio-letra-linha {
    margin: 0 0 12px; font-size: 1.22rem; font-weight: 700; line-height: 1.4;
    color: rgba(255, 255, 255, 0.46); transition: color 0.25s ease, opacity 0.25s ease;
    overflow-wrap: anywhere;
}
.radio-letra-linha.passou { color: rgba(255, 255, 255, 0.2); }
.radio-letra-linha.agora { color: #fff; }
.radio-letra-linha.vazia { font-weight: 500; letter-spacing: 0.3em; }
/* trecho instrumental: a nota acende em lima e respira, para ninguém achar que
   a letra travou */
.radio-letra-linha.vazia.agora { color: var(--accent); animation: radio-respira 1.6s ease-in-out infinite; }
@keyframes radio-respira { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.radio-letra-linha.clicavel { cursor: pointer; }
.radio-letra-linha.clicavel:hover { color: rgba(255, 255, 255, 0.78); }
.radio-letra-linha.agora.clicavel:hover { color: #fff; }
.radio-letra-fim { height: 45%; }
.radio-letra-texto {
    white-space: pre-wrap; overflow-wrap: anywhere; padding-bottom: 48px;
    font-size: 1.02rem; line-height: 1.75; color: rgba(255, 255, 255, 0.78);
}
.radio-letra-estado {
    height: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 24px; text-align: center; color: var(--text-dim); font-size: 0.9rem;
}
.radio-letra-estado small { color: var(--text-faint); font-size: 0.78rem; }
.radio-letra-estado-ico { color: var(--text-faint); display: inline-flex; }
.radio-letra-estado-ico svg { width: 28px; height: 28px; }
.radio-letra-tentar { padding: 0.45rem 1rem; font-size: 0.8rem; }

/* telas médias: sem a pílula de quem colocou (a coluna da fila fica estreita) */
@media (max-width: 1180px) {
    .radio-item { grid-template-columns: 14px 24px 40px minmax(0, 1fr) 44px 92px; }
    .radio-item-dono { display: none; }
}
/* telas estreitas: fila e letra viram abas */
@media (max-width: 980px) {
    .radio-baixo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .radio-abas {
        display: flex; gap: 6px; padding: 10px 16px 0;
    }
    .radio-aba {
        flex: 1; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent;
        color: var(--text-dim); font: inherit; font-weight: 600; font-size: 0.86rem; cursor: pointer;
    }
    .radio-aba.ativa { color: var(--accent); background: var(--accent-soft); border-color: rgba(207, 252, 9, 0.35); }
    .radio-baixo[data-aba="fila"] .radio-letra, .radio-baixo[data-aba="letra"] .radio-fila { display: none; }
    .radio-fila-nome { display: none; } /* a aba já diz o nome */
    .radio-letra { border-left: 0; }
}
@media (max-width: 700px) {
    /* No celular o rádio ocupa a tela inteira VISÍVEL. Era 100vh - 24px: no
       celular, 100vh é a altura SEM a barra do navegador — com a barra de
       endereço à vista a janela ficava mais alta que a tela e, centralizada,
       sobrava para cima e para baixo (cortava o × e o "Tocando agora").
       height: 100% é do fundo (fixed, inset 0), que acompanha a barra. */
    .radio-fundo { align-items: stretch; justify-content: stretch; }
    .radio-janela {
        width: 100%; height: 100%; max-height: none;
        border: 0; border-radius: 0;
        padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
    }
    .radio-agora { grid-template-columns: 76px 1fr; gap: 14px; padding: 16px 56px 6px 16px; }
    .radio-capa { width: 76px; height: 76px; border-radius: 12px; }
    .radio-titulo { font-size: 1.1rem; }
    .radio-prog, .radio-dono { padding-left: 16px; padding-right: 16px; }
    .radio-ctrl { grid-template-columns: 1fr; justify-items: center; padding: 8px 16px; }
    .radio-ctrl-meio { order: -1; }
    .radio-ctrl-dir { justify-content: center; flex-wrap: wrap; }
    .radio-add { padding: 12px 16px; }
    .radio-add-form { flex-wrap: wrap; }
    .radio-add-campo { flex-basis: 100%; }
    .radio-fila-cab { padding: 8px 16px 4px; }
    .radio-lista { padding: 0 6px 10px; }
    .radio-item { grid-template-columns: 0 22px 36px minmax(0, 1fr) 42px 64px; gap: 8px; }
    .radio-item .radio-mini { width: 36px; height: 36px; }
    .radio-item-acoes .radio-item-btn:not(.radio-item-tirar):first-child { display: none; }
    .radio-letra-corpo { padding: 14px 18px 0; }
    .radio-letra-linha { font-size: 1.08rem; }
}
/* sem mouse (toque): as ações da linha ficam sempre à vista */
@media (hover: none) {
    .radio-item-acoes, .radio-item-pega { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .radio-capa.tocando .radio-eq i, .radio-item-ondas.vivo i { animation: none; height: 60%; }
}

/* barra de voz: tocar/pausar e pular na faixa da música, e o botão do rádio */
.mus-faixa-btn {
    flex: 0 0 auto; width: 20px; height: 20px; padding: 2px; display: inline-flex;
    align-items: center; justify-content: center;
    background: none; border: 0; border-radius: 5px; cursor: pointer; color: var(--text);
}
.mus-faixa-btn svg { width: 100%; height: 100%; }
.mus-faixa-btn:hover:not(:disabled) { color: var(--accent); background: rgba(255, 255, 255, 0.06); }
.mus-faixa-btn:disabled { color: var(--text-faint); opacity: 0.5; cursor: not-allowed; }
.mus-faixa-capa {
    flex: none; width: 22px; height: 22px; border-radius: 5px; object-fit: cover; cursor: pointer;
}
.mus-faixa-capa[hidden] { display: none; }
.mus-faixa.com-capa .mus-faixa-tit::before { content: none; } /* a capa já diz que é música */
.radio-abrir[hidden] { display: none; }
.radio-abrir.ativo { color: var(--accent); }
/* lista de canais: rádio pausado fica apagado, sem sumir */
.voice-part-radio.is-pausado .radio-avatar { opacity: 0.55; }

/* Qualidade e troca de tela AO VIVO (barra da MINHA prévia de transmissão) */
.stage-qual { display: inline-flex; gap: 0.35rem; align-items: center; }
.stage-qual-sel {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 0.42rem 0.75rem;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    /* a opção mais longa ("Nativa (sem reescalar)") não dita a largura da barra */
    max-width: 8.5rem;
}
.stage-qual-sel:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-strong); }
.stage-qual-sel option { background: #131316; color: var(--text); }

/* ═══ ANÚNCIO do aplicativo para Windows (ui/anuncio-app.js) ═══════════
   Faixa FIXA no topo da tela; o shell (#view-main, que é fixed inset 0)
   desce a altura dela por --anuncio-h, medida por ResizeObserver — no
   celular ela quebra linha. Fechar tira a faixa e devolve o topo. */
.anuncio-app {
    position: fixed; top: 0; left: 0; right: 0; z-index: 60;
    display: flex; align-items: center; gap: 14px;
    padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
    background: linear-gradient(90deg, rgba(207, 252, 9, 0.14), rgba(207, 252, 9, 0.04) 55%, rgba(0, 0, 0, 0)), #101012;
    border-bottom: 1px solid rgba(207, 252, 9, 0.35);
    color: var(--text); font-size: 0.86rem; line-height: 1.35;
}
.anuncio-app-ico {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(207, 252, 9, 0.12); color: var(--accent, #CFFC09);
}
.anuncio-app-ico svg { width: 22px; height: 22px; }
.anuncio-app-texto { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.anuncio-app-texto strong { font-size: 0.94rem; }
.anuncio-app-texto span { color: var(--text-faint, #a1a1aa); }
.anuncio-app-texto b { color: var(--text); font-weight: 600; }
.anuncio-app-baixar {
    flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center;
    gap: 0; line-height: 1.2; text-decoration: none; white-space: nowrap;
}
.anuncio-app-baixar small { font-size: 0.68rem; font-weight: 500; opacity: 0.8; }
.anuncio-app-fechar {
    flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 8px;
    background: transparent; color: var(--text-faint, #a1a1aa); font-size: 22px; line-height: 1; cursor: pointer;
}
.anuncio-app-fechar:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
body.com-anuncio #view-main { top: var(--anuncio-h, 0px); }

/* o aviso no alto da lista de canais (acima de "Canais de texto") */
.aviso-app {
    display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto;
    column-gap: 10px; align-items: center;
    margin: 8px 10px 10px; padding: 10px 12px; border-radius: 12px;
    text-decoration: none; color: var(--text);
    background: rgba(207, 252, 9, 0.08); border: 1px solid rgba(207, 252, 9, 0.28);
}
.aviso-app:hover { background: rgba(207, 252, 9, 0.14); border-color: rgba(207, 252, 9, 0.5); }
.aviso-app svg { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--accent, #CFFC09); }
.aviso-app-t { font-size: 0.8rem; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aviso-app-s { font-size: 0.74rem; color: var(--text-faint, #a1a1aa); line-height: 1.25; }

/* ═══ CELULAR (ui/mobile.js): uma coluna por vez + abas embaixo ═══════
   Até 760 px o shell deixa de ser três colunas: o painel mostra UMA vista
   (Canais | Conversa | Pessoas, em body[data-vista]), a barra de voz fica
   sempre à mão acima das abas e o que se toca tem 40-44 px. A coluna de
   canais some como CAIXA (display: contents) para que o cabeçalho, a lista e
   a barra de voz virem peças soltas da grade — sem duplicar HTML nem JS.
   Fica no FIM do arquivo de propósito: ganha das regras de mesmo peso. */
.tabbar-mobile { display: none; }
@media (max-width: 760px) {
    #view-main.active {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        background: #0d0d0f;
    }
    #view-main .sidebar { display: contents; }
    #view-main .col-rail, #btn-sidebar-hide, #btn-members-hide, #stage-theater { display: none !important; }
    #view-main .sidebar-head {
        grid-row: 1; grid-column: 1; background: #0d0d0f;
        height: auto; min-height: 52px; padding-top: env(safe-area-inset-top);
    }
    #view-main #channels-nav { grid-row: 2; grid-column: 1; background: #0d0d0f; }
    #view-main .sidebar-foot { grid-row: 3; grid-column: 1; background: #111114; }
    #view-main .content { grid-row: 1 / 3; grid-column: 1; padding-top: env(safe-area-inset-top); }
    #view-main .members-col { grid-row: 1 / 3; grid-column: 1; border-left: 0; padding-top: env(safe-area-inset-top); }
    body:not([data-vista="canais"]) #view-main .sidebar-head,
    body:not([data-vista="canais"]) #view-main #channels-nav { display: none; }
    body:not([data-vista="conversa"]) #view-main .content { display: none; }
    body:not([data-vista="membros"]) #view-main .members-col { display: none; }

    .tabbar-mobile {
        display: flex; grid-row: 4; grid-column: 1;
        border-top: 1px solid var(--line); background: #0d0d0f;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .tab-cel {
        flex: 1; min-height: 54px; display: flex; flex-direction: column; align-items: center;
        justify-content: center; gap: 2px; background: none; border: 0; cursor: pointer;
        color: var(--text-faint); font: inherit; font-size: 0.72rem; font-weight: 600;
        -webkit-tap-highlight-color: transparent;
    }
    .tab-cel svg { width: 22px; height: 22px; }
    .tab-cel.ativa { color: var(--accent); }

    /* toque */
    .channel { min-height: 44px; }
    .voicebar { padding: 0.45rem 0.6rem 0.5rem; gap: 0.4rem; }
    .voice-actions { margin-left: 0; width: 100%; justify-content: space-between; }
    .icon-btn { width: 42px; height: 42px; }
    .icon-btn svg { width: 20px; height: 20px; }
    /* iPhone dá zoom sozinho em campo com fonte menor que 16 px */
    input, select, textarea { font-size: 16px; }
    .modal-card { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 16px; }

    /* anúncio do aplicativo: texto + X na primeira linha, botão inteiro embaixo */
    .anuncio-app { flex-wrap: wrap; gap: 10px 10px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
    .anuncio-app-ico { display: none; }
    .anuncio-app-texto { order: 1; flex: 1 1 calc(100% - 44px); }
    .anuncio-app-fechar { order: 2; }
    .anuncio-app-baixar { order: 3; flex: 1 1 100%; }
    /* a faixa já cobre a área segura do topo */
    body.com-anuncio #view-main .sidebar-head,
    body.com-anuncio #view-main .content,
    body.com-anuncio #view-main .members-col { padding-top: 0; }
}
/* navegador de celular não compartilha a tela (ui/mobile.js) */
body.sem-tela #btn-stream { display: none; }
