/* ──────────────────────────────────────────────────────────────────────
   Network View — Frigid immersive radial visualization
   Home screen tab 1
   ─────────────────────────────────────────────────────────────────────── */

/* ── Switcher multi-serveur (coin haut-gauche, dans le breadcrumb) ───── */

.nv-corner-switcher {
    position: absolute;
    top: 44px;   /* juste sous le breadcrumb (height: 36px + 8px) */
    left: 8px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.nv-corner-switcher__trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 6px;
    background: rgba(0, 160, 255, 0.07);
    border: 1px solid rgba(0, 160, 255, 0.22);
    border-radius: 3px;
    color: rgba(0, 160, 255, 0.80);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}
.nv-corner-switcher__trigger:hover {
    background: rgba(0, 160, 255, 0.14);
    border-color: rgba(0, 160, 255, 0.45);
    color: rgba(0, 200, 255, 1);
}

.nv-corner-switcher__icon {
    font-size: 9px;
    opacity: 0.70;
}

.nv-corner-switcher__label {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nv-corner-switcher__caret {
    font-size: 8px;
    opacity: 0.60;
}

.nv-corner-switcher__badge {
    min-width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #d03030;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    letter-spacing: 0;
}

.nv-corner-switcher__list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 180px;
    background: rgba(3, 6, 12, 0.97);
    border: 1px solid rgba(0, 160, 255, 0.25);
    border-radius: 4px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 200;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    animation: nv-corner-fadein 0.12s ease;
}
@keyframes nv-corner-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nv-corner-switcher__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    color: rgba(0, 160, 255, 0.65);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    transition: background 0.12s, color 0.12s;
}
.nv-corner-switcher__item:hover {
    background: rgba(0, 160, 255, 0.09);
    color: rgba(0, 200, 255, 1);
}
.nv-corner-switcher__item.is-active {
    color: rgba(40, 255, 140, 0.90);
    background: rgba(40, 255, 140, 0.05);
}

.nv-corner-switcher__item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nv-corner-switcher__item-badge {
    min-width: 18px;
    height: 16px;
    border-radius: 999px;
    background: #c02828;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    flex-shrink: 0;
    letter-spacing: 0;
}

/* ── Breadcrumb (remplace la tab bar) ───────────────────────────────── */

.nv-home-tabs {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0;
    height: 36px;
    background: rgba(6, 8, 14, 0.92);
    border-bottom: 1px solid rgba(0, 160, 255, 0.10);
    padding: 0 16px;
    backdrop-filter: blur(4px);
    overflow: hidden;
}

/* ── Bouton structure admin (breadcrumb, NV root uniquement) ───────────── */

.nv-structure-btn {
    position: absolute;
    top: 5px;
    right: 40px;   /* à gauche du mute (8px + 26px + 6px) */
    z-index: 21;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: rgba(80, 130, 180, 0.55);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    padding: 0;
}
.nv-structure-btn i { width: 13px; height: 13px; }
.nv-structure-btn[hidden] { display: none !important; }
.nv-structure-btn:hover {
    color: rgba(0, 200, 255, 0.85);
    border-color: rgba(0, 200, 255, 0.25);
    background: rgba(0, 150, 255, 0.07);
}

/* ── Bouton mute sons (dans le breadcrumb, à droite) ───────────────────── */

.nv-mute-btn {
    position: absolute;
    top: 5px;
    right: 8px;
    z-index: 21;   /* au-dessus du breadcrumb (z-index: 20) */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: rgba(80, 130, 180, 0.55);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    padding: 0;
}
.nv-mute-btn i {
    width: 13px;
    height: 13px;
}
.nv-mute-btn:hover {
    color: rgba(0, 200, 255, 0.85);
    border-color: rgba(0, 200, 255, 0.25);
    background: rgba(0, 150, 255, 0.07);
}
.nv-mute-btn[aria-pressed="true"] {
    color: rgba(255, 80, 80, 0.75);
    border-color: rgba(255, 60, 60, 0.20);
}
.nv-mute-btn[aria-pressed="true"]:hover {
    color: rgba(255, 100, 100, 1);
    border-color: rgba(255, 60, 60, 0.45);
    background: rgba(255, 50, 50, 0.07);
}

/* Séparateur › entre les items */
.nv-breadcrumb-item + .nv-breadcrumb-item::before {
    content: '›';
    margin: 0 8px;
    color: rgba(0, 160, 255, 0.30);
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
}

.nv-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgba(80, 120, 170, 0.60);
    position: relative;
    top: 1px;
}

/* Racine (Nexus) toujours visible, cursor pointer */
.nv-breadcrumb-item--root {
    cursor: pointer;
    transition: color 0.15s;
}
.nv-breadcrumb-item--root:hover {
    color: rgba(0, 200, 255, 0.80);
}

/* Niveau intermédiaire (groupe) : clickable pour remonter */
.nv-breadcrumb-item--group {
    cursor: pointer;
    transition: color 0.15s;
}
.nv-breadcrumb-item--group:hover {
    color: rgba(160, 200, 240, 0.80);
}

/* Dernier niveau (actif) : couleur vive, souligné */
.nv-breadcrumb-item--active {
    color: rgba(0, 215, 255, 0.95);
    border-bottom: 2px solid rgba(0, 210, 255, 0.70);
    padding-bottom: 1px;
}
.nv-breadcrumb-item--active.nv-breadcrumb-item--orange {
    color: rgba(255, 160, 60, 0.95);
    border-bottom-color: rgba(255, 140, 40, 0.60);
}
.nv-breadcrumb-item--active.nv-breadcrumb-item--violet {
    color: rgba(200, 140, 255, 0.95);
    border-bottom-color: rgba(180, 100, 255, 0.60);
}
.nv-breadcrumb-item--active.nv-breadcrumb-item--amber {
    color: rgba(255, 210, 80, 0.95);
    border-bottom-color: rgba(220, 180, 50, 0.60);
}
.nv-breadcrumb-item--active.nv-breadcrumb-item--green {
    color: rgba(80, 220, 160, 0.95);
    border-bottom-color: rgba(60, 200, 140, 0.60);
}

.nv-tab-icon {
    width: 12px;
    height: 12px;
    opacity: 0.80;
    flex-shrink: 0;
}

/* ── Breadcrumb dans le channel header ──────────────────────────────── */

.nv-channel-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;         /* retour à la ligne si trop long */
    gap: 0;
    padding: 0 16px;
    min-width: 0;
    flex: 1;
    row-gap: 2px;
}

/* ── Tab panels ─────────────────────────────────────────────────────── */

.nv-home-panel {
    display: none;
    position: absolute;
    top: 36px; /* below tab bar */
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.nv-home-panel--active {
    display: flex;
    flex-direction: column;
}

/* Home tab panel: the existing welcome sections need to fill the panel */
#homeTabPanel {
    position: absolute;
    top: 36px;
    left: 0;
    right: 0;
    bottom: 0;
}

/* The absolute sections inside homeTabPanel already have inset: 0,
   which is relative to their nearest positioned ancestor (homeTabPanel). */
#homeTabPanel .channel-welcome-terminal-screen,
#homeTabPanel .channel-welcome-home-panel,
#homeTabPanel .channel-welcome-glitch-burst {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ── Canvas ─────────────────────────────────────────────────────────── */

.nv-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ── Tooltip ────────────────────────────────────────────────────────── */

.nv-tooltip {
    position: absolute;
    z-index: 200;
    pointer-events: none;
    min-width: 162px;
    max-width: 248px;
    padding: 11px 14px 12px;
    background: rgba(5, 9, 18, 0.96);
    border: 1px solid rgba(0, 175, 255, 0.24);
    border-radius: 4px;
    box-shadow:
        0 4px 28px rgba(0, 0, 0, 0.65),
        0 0 20px rgba(0, 150, 255, 0.08);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.55;
    color: rgba(200, 220, 255, 0.88);
    backdrop-filter: blur(8px);
    opacity: 1;
    transition: opacity 0.1s ease;
}

.nv-tooltip.hidden {
    opacity: 0;
    pointer-events: none;
}

.nv-tt-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(220, 240, 255, 0.96);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
    font-family: 'Orbitron', monospace;
}

.nv-tt-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    color: rgba(155, 195, 240, 0.72);
    margin-bottom: 3px;
}

.nv-tt-row.nv-tt-unread {
    color: rgba(255, 60, 80, 0.95);
    font-weight: 600;
}

.nv-tt-row.nv-tt-muted {
    color: rgba(110, 145, 185, 0.48);
    font-size: 9px;
}

.nv-tt-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(55, 115, 200, 0.7);
    flex-shrink: 0;
}

.nv-tt-dot--cyan {
    background: rgba(0, 210, 255, 0.95);
}

.nv-tt-dot--red {
    background: rgba(255, 30, 55, 0.95);
}

.nv-tt-tag {
    display: inline-block;
    margin-top: 6px;
    padding: 1px 7px;
    background: rgba(0, 110, 195, 0.1);
    border: 1px solid rgba(0, 155, 255, 0.18);
    border-radius: 2px;
    font-size: 9px;
    letter-spacing: 0.08em;
    color: rgba(90, 165, 240, 0.6);
    text-transform: uppercase;
}

.nv-tt-hint {
    margin-top: 9px;
    font-size: 9px;
    letter-spacing: 0.06em;
    color: rgba(75, 135, 200, 0.38);
    text-transform: uppercase;
}

/* ── Scan line overlay on the Network tab ───────────────────────────── */

#nvTabPanel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.025) 3px,
        rgba(0, 0, 0, 0.025) 4px
    );
    pointer-events: none;
    z-index: 1;
}

#nvTabPanel .nv-canvas {
    position: relative;
    z-index: 0;
}

#nvTabPanel .nv-tooltip {
    z-index: 10;
}

/* ── Legacy: toggle button in header (kept for potential reuse) ───────── */

.nv-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    background: transparent;
    border: 1px solid rgba(0, 180, 255, 0.18);
    border-radius: 3px;
    color: rgba(140, 190, 240, 0.65);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.nv-toggle-btn:hover {
    color: rgba(0, 210, 255, 0.9);
    border-color: rgba(0, 210, 255, 0.45);
    background: rgba(0, 160, 255, 0.06);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.12);
}

.nv-toggle-btn.active {
    color: rgba(0, 220, 255, 1);
    border-color: rgba(0, 220, 255, 0.55);
    background: rgba(0, 160, 255, 0.1);
    box-shadow: 0 0 14px rgba(0, 200, 255, 0.2), inset 0 0 8px rgba(0, 200, 255, 0.06);
}

/* ── Nexus Navigation Style ──────────────────────────────────────────────────── */

/* body.nav-nexus : cache la sidebar, ajuste la grille — PC uniquement */
@media (min-width: 769px) {
    body.nav-nexus #chatApp:not(.hidden) {
        grid-template-columns: 0px 1fr;
    }
    body.nav-nexus .sidebar {
        width: 0;
        min-width: 0;
        padding: 0;
        overflow: hidden;
        visibility: hidden;
    }
}

/* select style cyber pour profile.html */
.input-cyber--select {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(0, 30, 60, 0.6);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(0,200,255,0.7)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.input-cyber--select:focus {
    outline: none;
    border-color: rgba(0, 200, 255, 0.55);
    box-shadow: 0 0 8px rgba(0, 200, 255, 0.15);
}
.input-cyber--select option {
    background: #060c14;
    color: #c8e8ff;
}

/* Minimap PC (fixed bottom-right, visible en nav-nexus sur non-mobile) */
.nexus-minimap-wrap {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.nexus-minimap-wrap[hidden] { display: none; }
.nexus-minimap-wrap:hover { opacity: 0.9; }

.nexus-minimap-canvas {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 1px solid rgba(0, 120, 200, 0.28); /* valeur initiale, écrasée par JS */
    background: transparent;
    display: block;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Localisation au-dessus de la minimap */
.nexus-mm-location {
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: rgba(160, 220, 255, 0.75);
    text-transform: uppercase;
    text-align: center;
    max-width: 160px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    padding-bottom: 4px;
}

.nexus-minimap-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    letter-spacing: 0.15em;
    color: rgba(0, 200, 255, 0.45);
    text-transform: uppercase;
}

/* Label hover externe (au-dessus du curseur, hors canvas) */
.nexus-mm-label {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transform: translateX(-50%);
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: rgba(160, 220, 255, 0.95);
    background: rgba(0, 6, 18, 0.88);
    border: 1px solid rgba(0, 180, 255, 0.25);
    border-radius: 3px;
    padding: 3px 7px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.1s;
}
.nexus-mm-label.is-visible {
    opacity: 1;
}

/* Bouton Nexus intégré dans le breadcrumb (mobile) */
.nexus-mobile-btn {
    position: absolute;
    top: 4px;
    right: 40px;   /* à gauche du bouton mute (8px + 26px + 6px) */
    z-index: 21;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(0, 200, 255, 0.28);
    background: rgba(0, 20, 45, 0.60);
    color: rgba(0, 200, 255, 0.80);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.nexus-mobile-btn[hidden] { display: none !important; }
.nexus-mobile-btn:hover, .nexus-mobile-btn:active {
    background: rgba(0, 30, 60, 0.80);
    border-color: rgba(0, 200, 255, 0.55);
}

/* Modal mobile Nexus */
.nexus-mobile-modal {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(0, 3, 10, 0.97);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.nexus-mobile-modal[hidden] { display: none; }
.nexus-mobile-modal-inner {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}
.nexus-mobile-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 10;
    background: rgba(0, 15, 35, 0.8);
    border: 1px solid rgba(0, 200, 255, 0.25);
    color: rgba(0, 200, 255, 0.7);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ── Panneau warning non-lus (à gauche de la minimap) ───────────────────────── */
.nexus-mm-warnings {
    position: fixed;
    bottom: 18px;
    right: calc(18px + 160px + 14px);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    max-width: 200px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition: opacity 0.18s, transform 0.18s;
}
.nexus-mm-warnings.is-visible.has-items {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.nexus-mm-warn-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(255, 80, 60, 0.90);
    text-transform: uppercase;
    padding-bottom: 2px;
}
.nexus-mm-warn-icon {
    flex-shrink: 0;
    color: rgba(255, 70, 50, 0.90);
}

.nexus-mm-warn-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(0, 5, 18, 0.88);
    border: 1px solid rgba(255, 60, 40, 0.22);
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    text-align: left;
    width: 100%;
}
.nexus-mm-warn-item:hover {
    background: rgba(255, 40, 20, 0.10);
    border-color: rgba(255, 80, 60, 0.50);
}

.nexus-mm-warn-name {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    font-weight: 500;
    color: rgba(200, 220, 255, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nexus-mm-warn-badge {
    flex-shrink: 0;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(220, 40, 20, 0.85);
    border-radius: 8px;
    padding: 1px 5px;
    min-width: 18px;
    text-align: center;
}

/* En mode nexus sur mobile/tablette : cache le hamburger, le bouton Nexus prend sa place */
/* Seuil 900px = breakpoint mobile CSS (cohérent avec @media max-width:900px du layout) */
@media (max-width: 900px) {
    .nexus-minimap-wrap { display: none !important; }

    body.nav-nexus .mobile-nav-button { display: none !important; }
}
@media (min-width: 901px) {
    .nexus-mobile-btn { display: none !important; }
    .nv-mute-btn { right: 8px; }       /* pas de décalage pour le bouton mobile sur desktop */
    .nv-structure-btn { right: 40px; } /* à gauche du mute sur desktop */
}

/* Fix grille iPad (769-900px) en nav-nexus :
   la sidebar est position:fixed (hors flux) mais grid-template-columns reste 0px 1fr,
   ce qui place .chat-area dans la colonne 0px.
   On la force à couvrir toute la largeur. */
@media (min-width: 769px) and (max-width: 900px) {
    body.nav-nexus .chat-area {
        grid-column: 1 / -1;
    }
}


/* ── Channel-welcome home panel (Network View tab 2) ──────────────────────── */
/* Bienvenue dans la zone messages : visible quand aucun canal sélectionné */
.channel-welcome {
    display: none;
    flex: 1 1 0;
    min-height: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    background-image: url('/background2.svg');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    position: relative;
    overflow: visible;
}

/* Ultra-large: combler les zones hors cadrage FHD avec le motif */
@media (min-width: 1921px) {
    .channel-welcome {
        background-repeat: repeat;
        background-position: left top;
        background-size: clamp(240px, 20vw, 420px) auto;
    }
}

.channel-view--welcome .channel-header,
.channel-view--welcome .typing-indicator,
.channel-view--welcome .messages-container,
.channel-view--welcome .message-input-container {
    display: none !important;
}

.channel-view--welcome .channel-welcome {
    display: flex;
}

.channel-welcome-terminal-screen,
.channel-welcome-home-panel,
.channel-welcome-glitch-burst {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.channel-welcome-terminal-box {
    width: min(860px, calc(100vw - 28px));
    height: min(260px, 42vh);
    border: 1px solid rgba(45, 167, 255, 0.24);
    background: rgba(3, 8, 12, 0.88);
    box-shadow: 0 0 28px rgba(45, 167, 255, 0.15);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

.channel-welcome-terminal-head {
    border-bottom: 1px solid rgba(45, 167, 255, 0.16);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: Orbitron, sans-serif;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(212, 230, 248, 0.84);
}

.channel-welcome-terminal-body {
    margin: 0;
    padding: 12px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.45;
    color: #a1f6c4;
    white-space: pre-wrap;
}

.channel-welcome-glitch-burst {
    background: transparent;
    color: #dff3ff;
    text-align: center;
    animation: channel-welcome-flicker 0.09s linear infinite;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: clamp(11px, 1.6vw, 14px);
    letter-spacing: 0.08em;
    text-shadow: 0 0 14px rgba(45, 167, 255, 0.45);
    clip-path: inset(0 0 0 0);
}

.channel-welcome-glitch-burst pre {
    margin: 0;
    animation: channel-welcome-fragment 0.18s steps(4) infinite;
}

.channel-welcome-home-card {
    width: min(1100px, calc(100vw - 28px));
    background: transparent;
    padding: 0;
    position: static;
    overflow: visible;
    text-align: center;
}

.channel-welcome-home-panel {
    position: absolute;
    inset: 0;
    place-items: center;
    padding-top: 0;
}

.channel-welcome-home-grid {
    width: 100%;
    display: block;
}

.channel-welcome-home-col-main {
    min-width: 0;
}

.channel-welcome-voice-mobile-toggle {
    display: none;
}

.channel-welcome-voice-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    pointer-events: none;
}

.channel-welcome-home-panel--text-hidden .channel-welcome-home-card {
    opacity: 0;
}

.channel-welcome-home-panel--reveal .channel-welcome-home-card {
    animation: channel-welcome-home-glitch-in 0.42s steps(2, end) both;
}

.channel-welcome-home-title {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: clamp(15px, 2vw, 22px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f7fcff;
    text-align: center;
    text-shadow: 0 0 18px rgba(45, 167, 255, 0.34);
}

.channel-welcome-home-sub {
    margin: 8px 0 0;
    color: rgba(196, 229, 255, 0.9);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.channel-welcome-empty-state {
    margin-top: 18px;
    padding-top: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: clamp(22px, 3.2vw, 40px);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f3fbff;
    text-shadow: 0 0 22px rgba(45, 167, 255, 0.4);
    text-align: center;
}

.channel-welcome-channels-wrap {
    margin-top: 16px;
    padding-top: 4px;
}

.channel-welcome-voice-card {
    position: relative;
    width: min(340px, calc(100vw - 40px));
    max-height: min(72vh, 560px);
    overflow: auto;
    z-index: 1;
    pointer-events: auto;
    text-align: left;
    border: 1px solid rgba(247, 198, 67, 0.55);
    background: rgba(18, 14, 4, 0.86);
    box-shadow: 0 0 24px rgba(247, 198, 67, 0.18);
    padding: 0 10px 12px;
}

.channel-welcome-voice-hazard {
    margin: 0 -10px 8px;
    padding: 6px 10px;
    background: repeating-linear-gradient(
        -45deg,
        rgba(247, 198, 67, 0.42) 0 10px,
        rgba(20, 15, 4, 0.5) 10px 20px
    );
    color: #fff7d4;
    font-family: Orbitron, ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(247, 198, 67, 0.6);
}

.channel-welcome-voice-hazard--bottom {
    margin: 10px -10px -12px;
    border-bottom: 0;
    border-top: 1px solid rgba(247, 198, 67, 0.45);
}

.channel-welcome-voice-kicker {
    margin: 0;
    color: #f7c643;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.channel-welcome-voice-title {
    margin: 5px 0 9px;
    color: #ffe69f;
    font-family: Orbitron, ui-monospace, monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.channel-welcome-voice-live-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    color: #f9d16b;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.channel-welcome-voice-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd34d;
    box-shadow: 0 0 0 0 rgba(255, 211, 77, 0.65);
    animation: voice-live-pulse 1.2s ease-out infinite;
}

.channel-welcome-voice-live-tick {
    margin-left: auto;
    color: rgba(255, 230, 159, 0.85);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.channel-welcome-voice-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.channel-welcome-voice-item {
    border: 1px solid rgba(247, 198, 67, 0.26);
    background: rgba(14, 11, 3, 0.55);
    padding: 8px;
}

.channel-welcome-voice-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.channel-welcome-voice-tag {
    color: #ffe69f;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.channel-welcome-voice-count {
    color: #1a1400;
    background: #f7c643;
    border: 1px solid rgba(247, 198, 67, 0.55);
    font-size: 10px;
    line-height: 1;
    min-width: 20px;
    text-align: center;
    padding: 3px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.channel-welcome-voice-users {
    margin: 7px 0 8px;
    color: #f0d88f;
    font-size: 12px;
    line-height: 1.35;
}

.channel-welcome-voice-join {
    border: 1px solid rgba(247, 198, 67, 0.72);
    background: rgba(247, 198, 67, 0.14);
    color: #ffe69f;
    padding: 5px 8px;
    font-family: Orbitron, ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.channel-welcome-voice-join:hover {
    background: rgba(247, 198, 67, 0.24);
    box-shadow: 0 0 14px rgba(247, 198, 67, 0.22);
}

.channel-welcome-voice-empty {
    margin: 4px 0 0;
    color: rgba(255, 230, 159, 0.78);
    font-size: 12px;
}

@keyframes voice-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 211, 77, 0.6); opacity: 1; }
    75% { box-shadow: 0 0 0 9px rgba(255, 211, 77, 0); opacity: 0.75; }
    100% { box-shadow: 0 0 0 0 rgba(255, 211, 77, 0); opacity: 1; }
}

@keyframes welcome-voice-glitch-in {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
        clip-path: inset(28% 0 46% 0);
        filter: saturate(1.2);
    }
    38% {
        opacity: 0.66;
        clip-path: inset(58% 0 12% 0);
    }
    62% {
        opacity: 0.42;
        clip-path: inset(12% 0 60% 0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        clip-path: inset(0 0 0 0);
        filter: none;
    }
}

@keyframes welcome-voice-glitch-out {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        clip-path: inset(0 0 0 0);
    }
    42% {
        opacity: 0.58;
        clip-path: inset(46% 0 20% 0);
    }
    100% {
        opacity: 0;
        transform: translateY(-7px) scale(0.985);
        clip-path: inset(18% 0 64% 0);
    }
}

.channel-welcome-ack-wrap {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.channel-welcome-ack-btn {
    border: 1px solid rgba(45, 167, 255, 0.45);
    background: rgba(4, 14, 22, 0.65);
    color: #e6f6ff;
    padding: 6px 10px 5px;
    min-width: 150px;
    cursor: pointer;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.channel-welcome-ack-btn:hover:not(:disabled) {
    border-color: rgba(45, 167, 255, 0.9);
    box-shadow: 0 0 22px rgba(45, 167, 255, 0.24);
    transform: translateY(-1px);
}

.channel-welcome-ack-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.channel-welcome-ack-main {
    font-size: clamp(14px, 2.2vw, 22px);
    letter-spacing: 0.14em;
    line-height: 1;
    text-shadow: 0 0 14px rgba(45, 167, 255, 0.5);
}

.channel-welcome-ack-sub {
    font-size: 9px;
    letter-spacing: 0.09em;
    color: rgba(175, 220, 255, 0.95);
}

.channel-welcome-channels-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(174, 219, 255, 0.95);
    margin: 0 0 8px;
    text-align: center;
}

.channel-welcome-channels-list {
    display: grid;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.channel-welcome-channels-list li {
    border: 0;
    background: transparent;
    font-size: 15px;
    padding: 0;
    letter-spacing: 0.06em;
    color: #d4ecff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    text-align: center;
}

.channel-welcome-channels-more {
    color: #88cbff !important;
    text-transform: uppercase;
    font-size: 14px !important;
    letter-spacing: 0.12em !important;
}

.channel-welcome .hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes channel-welcome-flicker {
    0%, 82%, 100% { opacity: 1; }
    83% { opacity: 0.58; }
    85% { opacity: 1; }
    92% { opacity: 0.42; }
    93% { opacity: 1; }
}

@keyframes channel-welcome-fragment {
    0%, 100% { clip-path: inset(0 0 0 0); }
    25% { clip-path: inset(4% 0 58% 0); }
    50% { clip-path: inset(40% 0 24% 0); }
    75% { clip-path: inset(14% 0 37% 0); }
}

@keyframes channel-welcome-home-glitch-in {
    0% {
        opacity: 0;
        transform: translateY(8px);
        clip-path: inset(18% 0 56% 0);
        filter: saturate(1.3);
    }
    28% {
        opacity: 0.5;
        clip-path: inset(48% 0 12% 0);
    }
    46% {
        opacity: 0.32;
        clip-path: inset(10% 0 60% 0);
    }
    64% {
        opacity: 0.84;
        clip-path: inset(36% 0 22% 0);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        clip-path: inset(0 0 0 0);
        filter: none;
    }
}

/* ── Channel-welcome responsive (mobile) ───────────────────────────────────── */
@media (max-width: 768px) {
    .channel-welcome-home-grid {
        display: block;
    }

    .channel-welcome-voice-mobile-toggle {
        display: inline-flex;
        position: absolute;
        top: 8px;
        right: 8px;
        z-index: 12;
        width: 30px;
        height: 30px;
        align-items: center;
        justify-content: center;
        border: 0;
        background: transparent;
        color: rgba(247, 198, 67, 0.92);
        padding: 0;
        cursor: pointer;
    }

    .channel-welcome-voice-mobile-toggle i {
        width: 18px;
        height: 18px;
    }

    .channel-welcome-voice-mobile-toggle.is-open {
        color: #ffe69f;
        filter: drop-shadow(0 0 6px rgba(247, 198, 67, 0.45));
    }

    .channel-welcome-voice-card {
        display: block;
        width: min(88vw, 340px);
        max-height: min(68vh, 520px);
        margin-top: 0;
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.48), 0 0 14px rgba(247, 198, 67, 0.18);
    }

    .channel-welcome-voice-overlay {
        display: block;
        position: absolute;
        top: 36px;
        right: 8px;
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        transform: translateY(-8px) scale(0.985);
    }

    .channel-welcome-home-panel.voice-overlay-open .channel-welcome-voice-overlay {
        pointer-events: auto;
        opacity: 1;
        transform: translateY(0) scale(1);
        animation: welcome-voice-glitch-in 220ms steps(2, end) both;
    }

    .channel-welcome-home-panel.voice-overlay-closing .channel-welcome-voice-overlay {
        pointer-events: none;
        opacity: 0;
        transform: translateY(-6px) scale(0.985);
        animation: welcome-voice-glitch-out 200ms steps(2, end) both;
    }
}

