/* 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. */
#view-main.active {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 240px;
    grid-template-rows: minmax(0, 1fr);
}

/* ── 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;
}

.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-title {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.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;
}

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

.members {
    min-width: 0;
    min-height: 0;
    background: #0d0d0f;
    border-left: 1px solid var(--line);
    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);
    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; }

/* 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);
    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 membros some e o stage ganha a largura */
body.theater #view-main.active { grid-template-columns: 260px minmax(0, 1fr); }
body.theater .members { 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;
}

/* 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. */
.field input[type="text"],
.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="password"]::placeholder { color: rgba(255, 255, 255, 0.35); }
.field input[type="text"]:focus,
.field input[type="password"]:focus {
    outline: none;
    border-color: var(--accent, #CFFC09);
}
.field input[type="text"]:disabled,
.field input[type="password"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── engrenagem de admin no header da sidebar ─────────────────── */
.sidebar-admin { margin-left: auto; }

/* ── 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);
}
