/* VS Code–style file tree */
.studio-filetree {
    width: 220px;
    flex-shrink: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: .95rem;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.035);
}

.studio-filetree .ftree-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0.55rem 0.35rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.studio-filetree .ftree-title {
    color: #9ca3af;
    font: 650 10px/1 ui-monospace, monospace;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.studio-filetree .ftree-stats {
    color: #6b7280;
    font: 500 10px/1.3 ui-monospace, monospace;
}

.studio-filetree .ftree-search-wrap {
    padding: 0.35rem 0.45rem 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.studio-filetree .ftree-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(0,0,0,.2);
    color: #e5e7eb;
    font: 500 11px/1.2 ui-monospace, monospace;
    outline: none;
}

.studio-filetree .ftree-search:focus {
    border-color: rgba(163,230,53,.45);
}

.studio-filetree .ftree-body {
    flex: 1;
    overflow: auto;
    padding: 0.35rem 0.25rem 0.5rem;
}

.studio-filetree .ftree-empty {
    padding: 1rem 0.55rem;
    color: #6b7280;
    font-size: 11px;
}

.studio-filetree .ftree-folder-btn,
.studio-filetree .ftree-file {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: #c7ccd4;
    font: 520 12px/1.2 ui-monospace, monospace;
    cursor: pointer;
    border-radius: 0.55rem;
    padding-top: 0.38rem;
    padding-bottom: 0.38rem;
    padding-right: 0.4rem;
}

.studio-filetree .ftree-file:hover,
.studio-filetree .ftree-folder-btn:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.08);
}

.studio-filetree .ftree-file.active {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.12);
    color: #fff;
}

.studio-filetree .ftree-file.is-generating,
.studio-filetree .ftree-file.is-ready,
.studio-filetree .ftree-file.is-editing {
    border-color: rgba(163, 230, 53, 0.25);
}

.studio-filetree .ftree-file.is-editing {
    border-color: rgba(129, 140, 248, 0.75);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35), 0 0 18px rgba(129, 140, 248, 0.18);
    background: rgba(129, 140, 248, 0.08);
    color: #fff;
}

.studio-filetree .ftree-file.is-generating .studio-file-pulse,
.studio-filetree .ftree-file.is-ready .studio-file-pulse,
.studio-filetree .ftree-file.is-editing .studio-file-spinner,
.studio-filetree .ftree-file.is-generating .studio-file-spinner {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid rgba(129, 140, 248, 0.2);
    border-top-color: #a5b4fc;
    border-radius: 50%;
    flex-shrink: 0;
    animation: ftree-spin 0.65s linear infinite;
}

.studio-filetree .ftree-file.is-ready .studio-file-pulse {
    background: #4ade80;
    animation: none;
    border: none;
    width: 0.45rem;
    height: 0.45rem;
}

@keyframes ftree-spin {
    to { transform: rotate(360deg); }
}

@keyframes ftree-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1); }
}

.studio-filetree .ftree-file.is-reveal {
    animation: ftree-reveal 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ftree-reveal {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.studio-filetree .ftree-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.studio-filetree .ftree-chevron {
    width: 0.65rem;
    flex-shrink: 0;
    color: #6b7280;
    font-size: 11px;
    transition: transform 0.15s ease;
    display: inline-block;
}

.studio-filetree .ftree-chevron.is-open {
    transform: rotate(90deg);
}

.studio-code-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
    color: #9aa0aa;
    font: 500 11px/1.2 ui-monospace, monospace;
    overflow: hidden;
}

.studio-code-breadcrumb span {
    color: #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.studio-code-tabs {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 42vw;
    overflow-x: auto;
    flex-shrink: 1;
    scrollbar-width: thin;
}

.studio-code-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 9rem;
    padding: 0.22rem 0.45rem;
    border-radius: 0.45rem;
    border: 1px solid transparent;
    background: transparent;
    color: #9aa0aa;
    font: 500 10px/1 ui-monospace, monospace;
    cursor: pointer;
    white-space: nowrap;
}

.studio-code-tab:hover { background: rgba(255,255,255,.06); color: #fff; }
.studio-code-tab.active {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.12);
    color: #fff;
}

.studio-code-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-code-meta {
    color: #6b7280;
    font: 500 10px/1 ui-monospace, monospace;
    white-space: nowrap;
    flex-shrink: 0;
}
