/* ──────────────────────────────────────────────────────────────────────
   Virtual Filesystem workflow node — inline desktop + tree viewer.
   Styled to feel like a tiny OS window glued inside a node body.
   ────────────────────────────────────────────────────────────────────── */

.wf-vfs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.55);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.wf-vfs-tabs {
    display: flex;
    gap: 4px;
}

.wf-vfs-tab {
    background: transparent;
    color: #cbd5f5;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.wf-vfs-tab:hover { background: rgba(148, 163, 184, 0.18); }
.wf-vfs-tab-active {
    background: rgba(14, 165, 233, 0.22);
    border-color: rgba(14, 165, 233, 0.55);
    color: #e0f2fe;
}

.wf-vfs-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wf-vfs-count {
    font-size: 11px;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    padding: 1px 8px;
    min-width: 20px;
    text-align: center;
}

.wf-vfs-btn {
    background: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
}
.wf-vfs-btn:hover { background: rgba(148, 163, 184, 0.22); }
.wf-vfs-btn:disabled { opacity: .4; cursor: not-allowed; }
.wf-vfs-btn-danger { color: #fecaca; border-color: rgba(248, 113, 113, 0.4); }
.wf-vfs-btn-danger:hover { background: rgba(248, 113, 113, 0.22); }

.wf-vfs-scroll {
    overflow: auto;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.65), rgba(2, 6, 23, 0.85));
    padding: 8px;
    min-height: 140px;
}

.wf-vfs-empty {
    text-align: center;
    color: #94a3b8;
    padding: 28px 12px;
    font-size: 12px;
}
.wf-vfs-empty-icon { font-size: 32px; opacity: .65; margin-bottom: 6px; }
.wf-vfs-empty-hint { margin-top: 6px; font-size: 11px; opacity: .75; }

/* ── Desktop grid ── */
.wf-vfs-desktop {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
}
.wf-vfs-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background .12s;
}
.wf-vfs-icon:hover { background: rgba(14, 165, 233, 0.15); }
.wf-vfs-icon-glyph { font-size: 28px; line-height: 1; }
.wf-vfs-icon-label {
    font-size: 11px;
    color: #e2e8f0;
    text-align: center;
    line-height: 1.2;
    word-break: break-all;
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Tree view ── */
.wf-vfs-tree { font-size: 12px; color: #e2e8f0; }
.wf-vfs-folder { display: block; }
.wf-vfs-folder-row {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    background: transparent;
    border: 0;
    color: inherit;
    text-align: left;
    padding: 2px 4px 2px calc(4px + var(--vfs-depth, 0) * 14px);
    cursor: pointer;
    border-radius: 3px;
}
.wf-vfs-folder-row:hover { background: rgba(148, 163, 184, 0.15); }
.wf-vfs-caret { width: 10px; opacity: .7; }
.wf-vfs-folder-icon, .wf-vfs-file-icon { flex: 0 0 auto; }
.wf-vfs-folder-name, .wf-vfs-file-name { flex: 1 1 auto; word-break: break-all; }

.wf-vfs-file {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px 2px calc(4px + (var(--vfs-depth, 0) + 1) * 14px);
    border-radius: 3px;
    cursor: pointer;
    color: #cbd5f5;
}
.wf-vfs-file:hover { background: rgba(14, 165, 233, 0.15); color: #e0f2fe; }
.wf-vfs-file-size {
    font-size: 10px;
    color: #64748b;
    flex: 0 0 auto;
}

/* ── Resize handle ── */
.wf-vfs-resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    color: #64748b;
    cursor: nwse-resize;
    opacity: .7;
}
.wf-vfs-resize:hover { opacity: 1; color: #94a3b8; }

/* ── Preview overlay (double-click a file) ── */
.wf-vfs-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.wf-vfs-preview {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    width: min(720px, 100%);
    max-height: min(80vh, 720px);
    display: flex;
    flex-direction: column;
    color: #e2e8f0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.wf-vfs-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.wf-vfs-preview-title {
    font-weight: 600;
    font-size: 13px;
    word-break: break-all;
    margin-right: 12px;
}
.wf-vfs-preview-close {
    background: transparent;
    color: #cbd5f5;
    border: 0;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.wf-vfs-preview-close:hover { background: rgba(148, 163, 184, 0.18); }
.wf-vfs-preview-meta {
    display: flex;
    gap: 10px;
    padding: 6px 14px;
    color: #94a3b8;
    font-size: 11px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.wf-vfs-preview-body {
    overflow: auto;
    padding: 12px 14px;
    flex: 1 1 auto;
}
.wf-vfs-preview-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #e2e8f0;
}
.wf-vfs-preview-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
