/* ── ProjetoX Social Panel ─────────────────────────────────────────────────── */

:root {
    --spx-bg: #10141f;
    --spx-surface: #181e2e;
    --spx-border: rgba(255,255,255,0.08);
    --spx-text: #e6edf5;
    --spx-sub: #7a8999;
    --spx-accent: #3d7eff;
    --spx-accent-glow: rgba(61,126,255,0.25);
    --spx-online: #3ddc84;
    --spx-offline: #555;
    --spx-danger: #ff4f6a;
    --spx-ok: #3ddc84;
    --spx-radius: 12px;
    --spx-w: 320px;
    --spx-h: 520px;
}

/* ── Barra de ícones — canto inferior direito, acima do minimapa ─────────────── */
#spx-corner-bar {
    position: fixed;
    /* Levemente acima do minimapa:
       1280×720  → minimapa topo ≈ 140px → botões em 160px = +20px de folga
       1920×1080 → minimapa topo ≈ 204px → botões em 160px ficam atrás do mapa,
                   mas o canvas é proporcional então SIZE escala com a janela   */
    bottom: 160px;
    right: 10px;
    display: flex;
    flex-direction: row;      /* lado a lado horizontalmente */
    align-items: center;
    gap: 8px;
    z-index: 99990;
}

/* Botão base — compacto, quadrado, ícone-apenas */
#spx-fab,
.spx-corner-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 20, 31, 0.88);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: #c8d4e8;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.15s, border-color 0.15s, transform 0.12s, color 0.15s;
    position: relative;
    user-select: none;
    flex-shrink: 0;
    /* reset de estilos de botão nativo */
    outline: none;
    padding: 0;
    font-family: inherit;
}
#spx-fab:hover,
.spx-corner-btn:hover {
    background: rgba(30, 39, 64, 0.95);
    border-color: rgba(61,126,255,0.45);
    color: #e6edf5;
    transform: translateY(-2px);
}
#spx-fab:active,
.spx-corner-btn:active { transform: scale(0.93); }

/* Social — destaque azul suave quando painel aberto */
#spx-fab.is-open {
    background: rgba(61,126,255,0.2);
    border-color: rgba(61,126,255,0.55);
    color: #6fa3ff;
}

/* Admin — destaque vermelho */
.spx-admin-btn {
    background: rgba(16, 20, 31, 0.88) !important;
}
.spx-admin-btn:hover {
    border-color: rgba(255,0,85,0.5) !important;
    color: #ff6699 !important;
    background: rgba(255,0,85,0.12) !important;
}

/* Badge de notificação */
#spx-fab-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--spx-danger);
    color: #fff;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    padding: 0 3px;
    border: 2px solid #10141f;
    pointer-events: none;
}

@keyframes spxFabPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,79,106,0.6); }
    50%      { box-shadow: 0 0 0 7px rgba(255,79,106,0); }
}
#spx-fab.has-notif { animation: spxFabPulse 1.8s infinite; }

/* ── Painel ─────────────────────────────────────────────────────────────────── */
#spx-panel {
    position: fixed;
    bottom: 213px;   /* abre acima da barra de ícones (160px + 40px botão + 13px margem) */
    max-height: calc(100vh - 230px); /* garante que não saia pela borda superior */
    right: 14px;
    width: var(--spx-w);
    height: var(--spx-h);
    background: var(--spx-bg);
    border: 1px solid var(--spx-border);
    border-radius: var(--spx-radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 99991;
    resize: both;
    min-width: 260px;
    min-height: 380px;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
#spx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--spx-surface);
    border-bottom: 1px solid var(--spx-border);
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}
#spx-user-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.spx-user-nick {
    font-weight: 700;
    font-size: 13px;
    color: var(--spx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spx-user-lvl {
    font-size: 11px;
    color: var(--spx-accent);
    font-weight: 700;
    background: rgba(61,126,255,0.12);
    padding: 1px 6px;
    border-radius: 8px;
}
#spx-close {
    background: none;
    border: none;
    color: var(--spx-sub);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s;
}
#spx-close:hover { color: var(--spx-danger); }

/* ── Abas ───────────────────────────────────────────────────────────────────── */
#spx-tabs {
    display: flex;
    border-bottom: 1px solid var(--spx-border);
    background: var(--spx-surface);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
#spx-tabs::-webkit-scrollbar { display: none; }
.spx-tab {
    flex: 1;
    min-width: 44px;
    padding: 8px 6px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--spx-sub);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.spx-tab:hover { color: var(--spx-text); }
.spx-tab.active {
    color: var(--spx-accent);
    border-bottom-color: var(--spx-accent);
}
.spx-tab-lbl { font-size: 9.5px; }

/* ── Tab icons ──────────────────────────────────────────────────────────────── */
.spx-tab-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.spx-tab-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    opacity: 0.55;
    transition: opacity 0.15s;
    filter: drop-shadow(0 0 0 transparent);
}
.spx-tab:hover .spx-tab-icon,
.spx-tab.active .spx-tab-icon {
    opacity: 1;
}
.spx-tab.active .spx-tab-icon {
    filter: drop-shadow(0 0 3px var(--spx-accent));
}
.spx-tab-voice-icon {
    font-size: 16px;
    line-height: 1;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.spx-tab-icon,
.social-tab-icon {
    display: none !important;
}

.spx-tab-icon-wrap::before,
.social-tabs button::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 16px;
    line-height: 1;
}

.spx-tab:nth-child(1) .spx-tab-icon-wrap::before,
.social-tabs button:nth-child(1)::before { content: "\f500"; }
.spx-tab:nth-child(2) .spx-tab-icon-wrap::before,
.social-tabs button:nth-child(2)::before { content: "\e068"; }
.spx-tab:nth-child(3) .spx-tab-icon-wrap::before { content: "\f0f3"; }
.spx-tab:nth-child(4) .spx-tab-icon-wrap::before { content: "\f1ad"; }
.spx-tab:nth-child(5) .spx-tab-icon-wrap::before { content: "\f086"; }
.social-tabs button:nth-child(3)::before { content: "\f086"; }
.social-tabs button:nth-child(4)::before { content: "\f0f3"; }
.social-tabs button:nth-child(5)::before { content: "\f1ad"; }
.spx-tab:nth-child(6) .spx-tab-icon-wrap::before { content: "\f130"; }
.spx-tab:hover .spx-tab-voice-icon,
.spx-tab.active .spx-tab-voice-icon { opacity: 1; }

.spx-tab-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
    line-height: 1;
}

/* ── Tab tooltip ────────────────────────────────────────────────────────────── */
.spx-tab[data-spx-tip] { position: relative; }
.spx-tab[data-spx-tip]::after {
    content: attr(data-spx-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10,10,20,0.92);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s;
    z-index: 9999;
    max-width: 220px;
    white-space: normal;
    text-align: center;
}
.spx-tab[data-spx-tip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(10,10,20,0.92);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s;
    z-index: 9999;
}
.spx-tab[data-spx-tip]:hover::after,
.spx-tab[data-spx-tip]:hover::before { opacity: 1; }

/* ── Body ───────────────────────────────────────────────────────────────────── */
#spx-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#spx-body::-webkit-scrollbar { width: 4px; }
#spx-body::-webkit-scrollbar-track { background: transparent; }
#spx-body::-webkit-scrollbar-thumb { background: var(--spx-border); border-radius: 2px; }

/* ── Elementos comuns ───────────────────────────────────────────────────────── */
.spx-section-title {
    font-size: 10px;
    font-weight: 800;
    color: var(--spx-sub);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 6px 0 2px;
}
.spx-offline-title { color: #444; }
.spx-empty {
    color: var(--spx-sub);
    font-size: 12px;
    text-align: center;
    padding: 18px 8px;
    line-height: 1.6;
}
.spx-info-box {
    background: rgba(61,126,255,0.1);
    border: 1px solid rgba(61,126,255,0.25);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--spx-text);
    margin-bottom: 6px;
}

/* ── Row ────────────────────────────────────────────────────────────────────── */
.spx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--spx-surface);
    border: 1px solid var(--spx-border);
    gap: 8px;
    transition: background 0.12s;
}
.spx-row:hover { background: #1e2740; }
.spx-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.spx-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.spx-sub {
    display: block;
    font-size: 10px;
    color: var(--spx-sub);
}
.spx-offline { color: var(--spx-sub) !important; }

/* ── Avatar ─────────────────────────────────────────────────────────────────── */
.spx-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
#spx-user-bar .spx-avatar { width: 28px; height: 28px; }
.spx-avatar-wrap { position: relative; flex-shrink: 0; }
.spx-dot {
    position: absolute;
    bottom: 0; right: -1px;
    width: 9px; height: 9px;
    border-radius: 50%;
    border: 2px solid var(--spx-bg);
}
.spx-dot.online  { background: var(--spx-online); }
.spx-dot.offline { background: var(--spx-offline); }

/* ── Botões ─────────────────────────────────────────────────────────────────── */
.spx-btn {
    padding: 6px 12px;
    background: rgba(61,126,255,0.15);
    border: 1px solid rgba(61,126,255,0.3);
    border-radius: 7px;
    color: #7eb3ff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.spx-btn:hover { background: rgba(61,126,255,0.3); color: #fff; }
.spx-btn.active, .spx-btn:active { background: var(--spx-accent); color: #fff; }
.spx-act-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--spx-border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
    padding: 0;
}
.spx-act-btn:hover { background: rgba(255,255,255,0.1); }
.spx-ok-btn     { border-color: rgba(61,220,132,0.3); color: var(--spx-ok); }
.spx-ok-btn:hover { background: rgba(61,220,132,0.15); }
.spx-danger-btn { border-color: rgba(255,79,106,0.3); color: var(--spx-danger); }
.spx-danger-btn:hover { background: rgba(255,79,106,0.15); }
.spx-dm-btn { position: relative; }

/* ── Input ──────────────────────────────────────────────────────────────────── */
.spx-input {
    flex: 1;
    padding: 6px 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--spx-border);
    border-radius: 7px;
    color: var(--spx-text);
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s;
    min-width: 0;
}
.spx-input:focus { border-color: var(--spx-accent); }
.spx-input::placeholder { color: var(--spx-sub); }
.spx-add-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}

/* ── DM Badge ───────────────────────────────────────────────────────────────── */
.spx-dm-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--spx-danger);
    color: #fff;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 800;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    padding: 0 3px;
    pointer-events: none;
}

/* ── Team ───────────────────────────────────────────────────────────────────── */
.spx-team-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.spx-team-code {
    text-align: center;
    padding: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--spx-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--spx-sub);
    margin-bottom: 6px;
    transition: border-color 0.15s;
}
.spx-team-code:hover { border-color: var(--spx-accent); color: var(--spx-text); }
.spx-member-icon { font-size: 18px; }

/* ── Clãs ───────────────────────────────────────────────────────────────────── */
.spx-clan-card {
    background: linear-gradient(135deg, rgba(61,126,255,0.15), rgba(61,126,255,0.05));
    border: 1px solid rgba(61,126,255,0.3);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.spx-clan-header { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.spx-clan-badge {
    background: var(--spx-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 1px;
}
.spx-clan-name { font-weight: 800; font-size: 14px; color: var(--spx-text); }
.spx-clan-desc { font-size: 12px; color: var(--spx-sub); margin: 4px 0; }
.spx-clan-actions { display: flex; gap: 6px; margin: 8px 0 4px; flex-wrap: wrap; }
.spx-clan-actions .spx-btn { flex: 1; min-width: 100px; padding: 6px 8px; font-size: 12px; }
.spx-clan-icon { font-size: 18px; }

/* ── Voice ──────────────────────────────────────────────────────────────────── */
.spx-voice-modes {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}
.spx-mode-btn {
    padding: 8px 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--spx-border);
    border-radius: 8px;
    color: var(--spx-sub);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    line-height: 1.4;
}
.spx-mode-btn:hover { background: rgba(255,255,255,0.08); color: var(--spx-text); }
.spx-mode-btn.active {
    background: rgba(61,126,255,0.2);
    border-color: var(--spx-accent);
    color: var(--spx-accent);
}
.spx-voice-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.spx-voice-dot { font-size: 10px; color: var(--spx-offline); margin-right: 6px; flex-shrink: 0; }
.spx-voice-dot.active { color: var(--spx-online); }
@keyframes vcPulse { 0%,100%{opacity:1}50%{opacity:0.3} }
.spx-voice-dot.active { animation: vcPulse 1s infinite; }
/* Self mic row */
.spx-voice-self {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
}
/* Per-peer row */
.spx-voice-peer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 4px;
}
.spx-voice-peer-name {
    flex: 1;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--spx-text);
}
/* Volume slider + label */
.spx-voice-vol-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 90px;
}
.spx-voice-vol-label {
    font-size: 10px;
    color: var(--spx-muted);
    text-align: right;
}
.spx-voice-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
    outline: none;
    cursor: pointer;
}
.spx-voice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--spx-accent);
    cursor: pointer;
}
/* Compact mute button — usa .spx-unmuted/.spx-muted para estado, não .active */
.spx-voice-mute-btn {
    padding: 4px 10px;
    font-size: 13px;
    line-height: 1.4;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
/* Mic ativo (não mutado) — destaque verde */
.spx-voice-mute-btn.spx-unmuted {
    background: rgba(0,220,100,0.15);
    border-color: rgba(0,220,100,0.5);
    color: #00dc64;
}
/* Mic mutado — destaque vermelho */
.spx-voice-mute-btn.spx-muted {
    background: rgba(255,70,70,0.18);
    border-color: rgba(255,70,70,0.55);
    color: #ff5555;
}
.spx-mic-status { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; }
/* Para mute de peer (speaker) mantém o .active original */
.spx-voice-mute-btn.active {
    background: rgba(255,80,80,0.22);
    border-color: #ff5050;
    color: #ff6060;
}
/* PTT toggle row */
.spx-voice-ptt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.spx-voice-ptt-btn {
    padding: 4px 10px;
    font-size: 12px;
    flex-shrink: 0;
}
.spx-voice-ptt-btn.active {
    background: rgba(61,126,255,0.2);
    border-color: var(--spx-accent);
    color: var(--spx-accent);
}
.spx-voice-ptt-hint {
    font-size: 10px;
    color: var(--spx-muted);
    flex: 1;
}

/* ── DM Flutuante ───────────────────────────────────────────────────────────── */
#spx-dm {
    position: fixed;
    bottom: 60px;
    right: 350px;
    width: 290px;
    height: 360px;
    background: var(--spx-bg);
    border: 1px solid var(--spx-border);
    border-radius: var(--spx-radius);
    box-shadow: 0 6px 30px rgba(0,0,0,0.7);
    flex-direction: column;
    z-index: 99992;
    overflow: hidden;
}
#spx-dm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--spx-surface);
    border-bottom: 1px solid var(--spx-border);
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    gap: 8px;
}
/* Lado esquerdo: avatar + nome */
.spx-dm-hdr-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;          /* permite truncar o nick */
    flex: 1;
}
.spx-dm-hdr-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid var(--spx-border);
}
.spx-dm-hdr-nick {
    font-weight: 700;
    font-size: 13px;
    color: var(--spx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Botões header (fechar + minimizar) */
.spx-dm-hdr-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.spx-dm-close-btn,
.spx-dm-mini-btn {
    background: none;
    border: none;
    color: var(--spx-sub);
    font-size: 13px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 6px;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.15s;
}
.spx-dm-close-btn:hover { color: var(--spx-danger); }
.spx-dm-mini-btn:hover  { color: var(--spx-text); }

/* ── Estado minimizado ──────────────────────────────────────────────────────── */
#spx-dm.spx-dm-minimized {
    height: auto;
    width: 220px;
    min-height: 0;
}
#spx-dm.spx-dm-minimized #spx-dm-header {
    border-bottom: none;
}
.spx-dm-mini-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    cursor: move;
    user-select: none;
}
.spx-dm-mini-avatar {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid var(--spx-border);
}
.spx-dm-mini-nick {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: var(--spx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
#spx-dm-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#spx-dm-msgs::-webkit-scrollbar { width: 3px; }
#spx-dm-msgs::-webkit-scrollbar-thumb { background: var(--spx-border); border-radius: 2px; }
.spx-dm-empty { font-size: 12px; }
.spx-dm-bubble {
    max-width: 80%;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--spx-text);
    word-break: break-word;
    position: relative;
}
.spx-dm-bubble.mine {
    align-self: flex-end;
    background: rgba(61,126,255,0.25);
    border: 1px solid rgba(61,126,255,0.3);
    border-radius: 12px 3px 12px 12px;
}
.spx-dm-bubble.theirs {
    align-self: flex-start;
    background: var(--spx-surface);
    border: 1px solid var(--spx-border);
    border-radius: 3px 12px 12px 12px;
}
.spx-dm-ts {
    display: block;
    font-size: 9px;
    color: var(--spx-sub);
    text-align: right;
    margin-top: 2px;
}
#spx-dm-input-row {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid var(--spx-border);
    flex-shrink: 0;
}
.spx-dm-row { cursor: pointer; }
.spx-dm-row:hover { background: #1a2035; }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
.spx-toast {
    position: fixed;
    top: 70px;
    right: 14px;
    background: var(--spx-surface);
    border: 1px solid var(--spx-border);
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--spx-text);
    font-size: 13px;
    font-weight: 600;
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    animation: spxToastIn 0.22s ease;
    max-width: 280px;
    word-break: break-word;
}
.spx-toast.dm { border-color: rgba(61,126,255,0.4); }
.spx-toast.success { border-color: rgba(61,220,132,0.4); }
.spx-toast.error { border-color: rgba(255,79,106,0.4); }
@keyframes spxToastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Responsivo ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #spx-panel { width: calc(100vw - 16px); right: 8px; bottom: 56px; }
    #spx-dm    { width: calc(100vw - 16px); right: 8px; bottom: 56px; }
    .spx-tab-lbl { display: none; }
}

/* ── Terminal flutuante Admin ────────────────────────────────────────────────── */
#admin-terminal-panel {
    position: fixed;
    bottom: 213px;
    right: 60px;
    width: 560px;
    height: 380px;
    background: #0a0e17;
    border: 1px solid rgba(0, 255, 0, 0.18);
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,255,0,0.06);
    display: none;       /* toggled via JS */
    flex-direction: column;
    overflow: hidden;
    z-index: 999995;
    min-width: 320px;
    min-height: 200px;
    resize: both;
    font-family: 'Cascadia Code', 'Fira Mono', 'Consolas', 'Courier New', monospace;
}

/* Barra de título estilo macOS */
#admin-terminal-header {
    background: linear-gradient(180deg, #1a1f2e 0%, #12161f 100%);
    border-bottom: 1px solid rgba(0,255,0,0.10);
    padding: 8px 12px;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}
.adm-term-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
}
.adm-term-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.adm-term-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: filter 0.15s;
}
.adm-term-dot:hover { filter: brightness(1.3); }
.adm-term-dot.red    { background: #ff5f57; border: 1px solid rgba(0,0,0,0.25); }
.adm-term-dot.yellow { background: #ffbd2e; border: 1px solid rgba(0,0,0,0.2); }
.adm-term-dot.green  { background: #28c840; border: 1px solid rgba(0,0,0,0.2); }
.adm-term-title {
    font-size: 11px;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.02em;
    flex: 1;
    text-align: center;
    margin-right: 52px; /* compensa os dots à esquerda para centralizar */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Área de saída */
#admin-terminal-out {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 10px 14px;
    color: #00ff41;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre;
    word-break: normal;
    background: #0a0e17;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,255,65,0.25) transparent;
}
#admin-terminal-out::-webkit-scrollbar { width: 5px; height: 5px; }
#admin-terminal-out::-webkit-scrollbar-thumb { background: rgba(0,255,65,0.2); border-radius: 4px; }
#admin-terminal-out::-webkit-scrollbar-track { background: transparent; }

/* Linha de input */
#admin-terminal-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 8px;
    background: #070b12;
    border-top: 1px solid rgba(0,255,0,0.10);
    flex-shrink: 0;
}
.adm-term-prompt {
    color: #00ff41;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.85;
}
#admin-terminal-in {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e0ffe0;
    font-family: inherit;
    font-size: 12px;
    caret-color: #00ff41;
}
#admin-terminal-in::placeholder { color: rgba(0,255,65,0.3); }

/* Botão CMD no corner-bar */
.spx-cmd-btn:hover {
    border-color: rgba(0,255,65,0.5) !important;
    color: #00ff41 !important;
    background: rgba(0,255,65,0.08) !important;
}
