/* ============================================================
   MODO DISCOVERY — DOSSIER CARD REDESIGN
   ============================================================ */

/* Contexto do body */
.inv-mode-active .main-header {
    border-bottom-color: var(--accent-red);
    box-shadow: 0 0 30px rgba(218, 55, 60, 0.15);
}
.inv-mode-active .right-sidebar { opacity: 0.7; }
.inv-mode-active .left-sidebar  { opacity: 0.7; }

/* Grid container */
#feedArea.inv-mode {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 24px 20px;
    align-items: start;
    background: transparent;
}

/* ── Card principal ── */
.inv-card {
    background: linear-gradient(160deg, #141414 0%, #0e0e0e 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.inv-card:hover {
    transform: translateY(-5px);
    border-color: rgba(218, 55, 60, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(218, 55, 60, 0.2);
}

/* ── Thumbnail ── */
.inv-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
}

.inv-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: brightness(0.85) saturate(0.9);
}

.inv-card:hover .inv-card-thumb img {
    transform: scale(1.05);
    filter: brightness(1.0) saturate(1.1);
}

/* Fallback sem imagem */
.inv-thumb-fallback {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px;
    padding: 20px; text-align: center;
    background: linear-gradient(135deg, #1a0a0a 0%, #0e0e0e 100%);
    color: rgba(255,255,255,0.25);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}
.inv-thumb-fallback i { font-size: 2rem; color: rgba(218, 55, 60, 0.3); }

/* Overlay de scanline noir */
.inv-card-thumb::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* Overlay play (vídeo) */
.inv-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 2;
}
.inv-card:hover .inv-play-overlay { opacity: 1; }
.inv-play-overlay i {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.92);
    border-radius: 50%;
    color: #111; font-size: 1.1rem;
    padding-left: 3px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* Badge de status (canto superior esquerdo) */
.inv-card-status {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    font-family: var(--font-mono);
    font-size: 0.6rem; font-weight: 800;
    letter-spacing: 1.5px; text-transform: uppercase;
    padding: 3px 8px; border-radius: 4px;
}
.inv-card-status.status-open {
    background: rgba(218, 55, 60, 0.15);
    border: 1px solid rgba(218, 55, 60, 0.4);
    color: #da373c;
}
.inv-card-status.status-active {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}
.inv-card-status.status-priority {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
}

/* Contador de fios (canto inferior esquerdo) */
.inv-card-threads {
    position: absolute; bottom: 10px; left: 10px; z-index: 3;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    color: rgba(255,255,255,0.8);
    font-family: var(--font-mono);
    font-size: 0.68rem; font-weight: 700;
    padding: 3px 8px; border-radius: 4px;
    display: flex; align-items: center; gap: 5px;
}
.inv-card-threads i { color: var(--accent-red); font-size: 0.6rem; }

/* Ações rápidas (canto superior direito, surgem no hover) */
.inv-card-actions {
    position: absolute; top: 8px; right: 8px; z-index: 4;
    display: flex; gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}
.inv-card:hover .inv-card-actions { opacity: 1; }

.inv-qa-btn {
    width: 32px; height: 32px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.inv-qa-btn:hover { background: rgba(218,55,60,0.8); border-color: var(--accent-red); color: #fff; }
.inv-qa-btn.active { color: #f59e0b; border-color: rgba(245,158,11,0.4); }

/* ── Body do card ── */
.inv-card-body {
    padding: 14px 16px 16px;
    display: flex; flex-direction: column; gap: 10px;
}

/* Tag de categoria */
.inv-card-tags {
    font-family: var(--font-mono);
    font-size: 0.63rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--accent-red);
}

/* Título */
.inv-card-title {
    font-size: 0.92rem; font-weight: 700;
    color: #f0f0f0; line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Barra de credibilidade */
.inv-card-cred {
    display: flex; flex-direction: column; gap: 5px;
}
.inv-cred-bar {
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px; overflow: hidden;
}
.inv-cred-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease-out;
    box-shadow: 0 0 6px currentColor;
}
.inv-cred-label {
    font-family: var(--font-mono);
    font-size: 0.62rem; color: rgba(255,255,255,0.35);
}

/* Footer: autor + stats */
.inv-card-footer {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.inv-card-author {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
}
.inv-card-author img {
    width: 24px; height: 24px;
    border-radius: 50%; object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}
.inv-card-author span {
    font-size: 0.78rem; font-weight: 600;
    color: rgba(255,255,255,0.65);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 110px;
    transition: color 0.2s;
}
.inv-card-author:hover span { color: #fff; }

.inv-card-stats {
    display: flex; gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem; color: rgba(255,255,255,0.3);
}
.inv-card-stats span { display: flex; align-items: center; gap: 4px; }
.inv-card-stats i { font-size: 0.65rem; }

/* ── Mobile ── */
@media (max-width: 768px) {
    #feedArea.inv-mode {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
        padding: 14px 10px;
    }
    .inv-card-title { font-size: 0.8rem; }
    .inv-card-body { padding: 10px 12px 12px; gap: 7px; }
    .inv-card-author span { max-width: 70px; }
}

/* ============================================================
   MODO THREAD / CANVAS — REDESIGN PREMIUM
   ============================================================ */
body.thread-mode-active .left-sidebar,
body.thread-mode-active .right-sidebar,
body.thread-mode-active .main-column {
    display: none;
}

body.thread-mode-active .app-container {
    max-width: 100vw;
    margin: 0;
}

#threadArea {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- TOOLBAR --- */
.board-toolbar {
    height: 56px;
    min-height: 56px;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.board-title-area {
    flex: 1;
    overflow: hidden;
}

.board-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-ui);
}

.board-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.back-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.back-btn:hover {
    background: rgba(255,255,255,0.1);
}

.board-tools {
    display: flex;
    gap: 6px;
    align-items: center;
}

.board-tools button {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.board-tools button:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.board-tools button.active {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
}

/* --- LAYOUT SPLIT --- */
.board-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* --- CANVAS --- */
.board-canvas-area {
    flex: 1;
    background: #111 url('https://www.transparenttextures.com/patterns/dark-matter.png');
    overflow: auto;
    position: relative;
    cursor: default;
    touch-action: pan-x pan-y;
}

#boardCanvasArea::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    z-index: 10;
}

.canvas-content {
    width: 5000px;
    height: 5000px;
    position: relative;
    background: #111;
}

#boardEdges {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

#boardNodes {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
}

/* --- FAB MOBILE --- */
.board-fab {
    display: none;
    position: absolute;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-red);
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(218,55,60,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
    justify-content: center;
}

.board-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(218,55,60,0.7);
}

.fab-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: var(--accent-red);
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================================
   SIDEBAR DE COMENTÁRIOS â€” NOVA ESTRUTURA
   ============================================================ */
.thread-sidebar {
    width: 360px;
    min-width: 360px;
    background: #0d0d0d;
    border-left: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Handle (mobile) */
.sidebar-handle {
    display: none;
    justify-content: center;
    padding: 10px 0 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.handle-bar {
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* Cabeçalho da Sidebar */
.sidebar-header {
    padding: 16px 16px 0;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 12px;
}

.sidebar-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-ui);
}

.sidebar-participants {
    display: flex;
    align-items: center;
    margin-top: 5px;
    min-height: 20px;
}

.sidebar-participants .part-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #0d0d0d;
    object-fit: cover;
    margin-left: -6px;
}

.sidebar-participants .part-avatar:first-child {
    margin-left: 0;
}

.sidebar-participants .part-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: 6px;
}

.sidebar-close-btn {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: none; /* mostra só no mobile */
}

.sidebar-close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* Sort row */
.sidebar-sort-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 16px;
    transition: all 0.2s;
}

.sort-btn:hover,
.sort-btn.active {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.sort-btn.active {
    color: var(--accent-red);
}

.comment-live-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Lista de comentários */
.board-replies-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.board-replies-list::-webkit-scrollbar {
    width: 4px;
}

.board-replies-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* COMENTÁRIO (flat, estilo YouTube) */
.board-comment {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
}

.board-comment:hover {
    background: rgba(255,255,255,0.02);
}

.board-comment.is-nested {
    padding-left: 44px;
    background: transparent;
    border-bottom: none;
    padding-top: 8px;
    padding-bottom: 8px;
}

.board-comment.is-pinned {
    background: rgba(218, 55, 60, 0.04);
    border-left: 2px solid rgba(218,55,60,0.3);
}

.board-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

.board-comment.is-nested .board-comment-avatar {
    width: 24px;
    height: 24px;
    margin-top: 2px;
}

.board-comment-body {
    flex: 1;
    min-width: 0;
}

.board-comment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.board-comment-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.board-comment-name:hover {
    text-decoration: underline;
}

.board-comment-time {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.pin-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    color: var(--accent-red);
    background: rgba(218,55,60,0.1);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.board-comment-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.85);
    margin-bottom: 6px;
    word-break: break-word;
}

.board-comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-act-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 0;
    transition: color 0.2s;
}

.board-act-btn:hover {
    color: var(--text-primary);
}

.board-act-btn.active {
    color: var(--accent-red);
}

.board-act-btn i {
    font-size: 0.9rem;
}

.board-act-separator {
    width: 3px;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

/* Nested thread container */
.board-nested-thread {
    margin-top: 4px;
}

/* ----------- COMPOSER FIXO ----------- */
.sidebar-composer {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 12px 16px;
    flex-shrink: 0;
    background: #0d0d0d;
}

.reply-context-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.reply-context-bar b {
    color: var(--text-primary);
    font-weight: 600;
}

.reply-context-bar button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: auto;
    font-size: 0.85rem;
    padding: 2px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.reply-context-bar button:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.composer-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.composer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.composer-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 0.875rem;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s;
    font-family: var(--font-ui);
}

.composer-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.2);
}

.composer-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-red);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

.composer-send-btn:hover {
    background: #c0292e;
    transform: scale(1.05);
}

/* ----------- INLINE COMPOSER BOARD ----------- */
#board-inline-composer {
    padding: 8px 16px 8px 44px;
}

/* ============================================================
   NÓS DO CANVAS (Polaroid Style)
   ============================================================ */
.b-node {
    position: absolute;
    background: #e8e4df;
    color: #111;
    border-radius: 2px;
    padding: 14px 14px 22px 14px;
    box-shadow: 5px 12px 30px rgba(0,0,0,0.85), 0 0 0 1px rgba(0,0,0,0.08);
    cursor: move;
    max-width: 300px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #bbb;
    transition: box-shadow 0.2s, transform 0.1s;
    user-select: none;
}

.b-node:hover {
    box-shadow: 7px 16px 40px rgba(0,0,0,0.9);
}

.b-node:active {
    box-shadow: 12px 24px 50px rgba(0,0,0,0.9);
    transform: scale(1.02);
    z-index: 2000 !important;
}

.pin-tape {
    position: absolute;
    top: -13px;
    left: 50%;
    width: 55px;
    height: 24px;
    background: rgba(218,55,60,0.82);
    transform: translateX(-50%) rotate(calc(-5deg + 10deg * var(--rand-r, 0.5)));
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 10;
    pointer-events: none;
}

.n-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 2px 7px;
    border-radius: 2px;
    margin-bottom: 4px;
    width: fit-content;
}

.n-type-badge.type-main { background: rgba(218,55,60,0.15); color: #c0292e; border: 1px solid rgba(218,55,60,0.3); }
.n-type-badge.type-theory { background: rgba(80,80,200,0.12); color: #3a3aaa; border: 1px solid rgba(80,80,200,0.25); }
.n-type-badge.type-image { background: rgba(0,150,100,0.12); color: #006644; border: 1px solid rgba(0,150,100,0.25); }
.n-type-badge.type-link { background: rgba(120,80,200,0.12); color: #6040aa; border: 1px solid rgba(120,80,200,0.25); }
.n-type-badge.type-video { background: rgba(200,20,20,0.12); color: #cc1111; border: 1px solid rgba(200,20,20,0.25); }
.n-type-badge.type-note { background: rgba(180,140,0,0.15); color: #7a5e00; border: 1px solid rgba(180,140,0,0.25); }

.node-main { background: #fff; width: 380px; }
.node-theory { background: #fdf5c8; width: 270px; font-family: var(--font-mono); }
.node-theory .pin-tape { background: rgba(80,80,200,0.8); }
.node-note { background: #fef9e0; width: 260px; font-family: var(--font-mono); }
.node-note .pin-tape { background: rgba(180,140,0,0.75); }
.node-image { width: 310px; padding: 10px 10px 28px 10px; background: #fff; box-shadow: 4px 10px 30px rgba(0,0,0,0.5); }
.node-image .n-media { width: 100%; height: auto; min-height: 100px; max-height: 400px; object-fit: contain; background: #f0f0f0; display: block; cursor: pointer; }
.node-link { background: #f5f0ff; width: 300px; }
.node-link .pin-tape { background: rgba(120,80,200,0.8); }
.node-video { background: #fff; width: 330px; padding: 10px 10px 28px 10px; }
.node-video .pin-tape { background: rgba(200,20,20,0.8); }

.n-author { font-size: 0.68rem; color: #666; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.n-title { font-weight: 700; font-family: var(--font-mono); font-size: 1rem; border-bottom: 2px solid #ddd; padding-bottom: 6px; margin-bottom: 4px; line-height: 1.3; }
.n-text { font-size: 0.875rem; line-height: 1.5; color: #222; max-height: 200px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ccc transparent; padding-right: 4px; }
.n-text::-webkit-scrollbar { width: 4px; }
.n-text::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.n-date { font-size: 0.72rem; color: var(--accent-red); margin-top: 6px; font-family: var(--font-mono); }

.n-connector {
    position: absolute;
    width: 16px; height: 16px;
    background: var(--accent-red);
    border-radius: 50%;
    right: -8px; top: 50%;
    transform: translateY(-50%);
    cursor: crosshair;
    border: 2px solid #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
    z-index: 20;
    transition: transform 0.15s, box-shadow 0.15s;
}

.b-node:hover .n-connector {
    transform: translateY(-50%) scale(1.3);
    box-shadow: 0 0 10px rgba(218,55,60,0.8);
}

.n-link-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(120,80,200,0.08); border: 1px solid rgba(120,80,200,0.2); border-radius: 4px; text-decoration: none; color: #333; margin-top: 6px; cursor: pointer; transition: background 0.2s; }
.n-link-card:hover { background: rgba(120,80,200,0.15); }
.n-link-card i { color: #6040aa; font-size: 1rem; flex-shrink: 0; }
.n-link-url { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #444; }
.n-yt-embed { position: relative; aspect-ratio: 16/9; background: #000; border: 1px solid #ccc; margin-top: 6px; overflow: hidden; }
.n-yt-embed iframe { width: 100%; height: 100%; border: none; }

.b-node.link-target {
    box-shadow: 0 0 20px var(--accent-red) !important;
    border: 2px solid var(--accent-red) !important;
    transform: scale(1.05);
}

/* btn-pin (ícone) */
.btn-pin {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-pin:hover { color: var(--text-primary); }
.btn-pin.active { color: var(--accent-red); }

.pin-badge { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 8px; font-weight: 600; }
.pin-badge i { color: var(--accent-red); font-size: 0.65rem; }
.pinned-reply { border-left: 2px solid rgba(218,55,60,0.3); padding-left: 10px; }

/* ============================================================
   MOBILE â€” BOTTOM SHEET
   ============================================================ */
@media (max-width: 768px) {
    .board-tools button .desktop-only,
    .back-btn .desktop-only {
        display: none;
    }

    .board-fab {
        display: flex;
    }

    .thread-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 85vh;
        min-width: unset;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.08);
        border-radius: 24px 24px 0 0;
        z-index: 10000;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.1, 0.9, 0.2, 1);
        box-shadow: 0 -12px 48px rgba(0,0,0,0.8);
    }

    .thread-sidebar.show-mobile {
        transform: translateY(0);
    }

    /* backdrop escuro quando aberto */
    .thread-sidebar.show-mobile::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: -1;
        backdrop-filter: blur(2px);
    }

    .sidebar-handle {
        display: flex;
    }

    .sidebar-close-btn {
        display: flex !important;
    }

    /* Nós menores no mobile */
    .b-node {
        max-width: 180px;
        min-width: 140px;
        padding: 10px 10px 18px 10px;
    }

    .node-main,
    .node-theory,
    .node-note,
    .node-image,
    .node-link,
    .node-video {
        width: 180px;
    }
}


/* Mobile — Inv Mode grid */
@media (max-width: 768px) {
    #feedArea.inv-mode {
        grid-template-columns: 1fr;
        padding: 25px 15px;
        gap: 30px;
    }
    #feedArea.inv-mode .post { padding-bottom: 30px; }
    #feedArea.inv-mode .p-media { max-height: 180px; }
    #feedArea.inv-mode .inv-pin { width: 10px; height: 10px; box-shadow: 0 0 5px rgba(218,55,60,0.8); }
    #invStringsMap svg polyline { stroke-width: 1px !important; }
}
/* ============================================================
   SISTEMA DE CURADORIA (PROMOVER AO MURAL)
   ============================================================ */
.promote-area {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px;
}

.promote-progress-bar {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}

.promote-progress-fill {
    height: 100%;
    background: #f59e0b; /* Amber */
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    transition: width 0.3s ease;
}

.promote-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.promote-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.promote-btn {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.promote-btn:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

.promote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.promote-btn.voted {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.promote-status.promoted {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #10b981; /* Emerald */
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
}

.promote-mural-link {
    margin-left: auto;
    background: none;
    border: none;
    color: #10b981;
    text-decoration: underline;
    font-size: 0.75rem;
    cursor: pointer;
}

/* Modais de Promoção */
.promote-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.promote-modal {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.promote-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.promote-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
}

.promote-modal-preview {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.promote-modal-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.promote-node-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    padding-right: 4px;
}

.promote-node-list::-webkit-scrollbar { width: 4px; }
.promote-node-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 2px; }

.promote-node-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.promote-node-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.promote-node-option input[type="radio"] {
    accent-color: #f59e0b;
    width: 16px;
    height: 16px;
}

.promote-node-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.promote-node-badge.type-main { background: rgba(218, 55, 60, 0.15); color: #da373c; border: 1px solid rgba(218, 55, 60, 0.3); }
.promote-node-badge.type-theory { background: rgba(80, 80, 200, 0.15); color: #7b7bff; border: 1px solid rgba(80, 80, 200, 0.3); }
.promote-node-badge.type-note { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.promote-node-badge.type-image { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

.promote-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}
/* ============================================================
   APAGAR PINS DO MURAL
   ============================================================ */
.delete-node-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    color: white;
    border: 2px solid #fff;
    border-radius: 50%;
    display: none; /* Apenas no hover */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 100;
    transition: transform 0.2s;
}

.b-node:hover .delete-node-btn {
    display: flex;
}

.delete-node-btn:hover {
    transform: scale(1.15);
    background: #a01a1d;
}
