.sidebar-tree-card {
    min-height: 18rem;
}

.sidebar-tree {
    max-height: calc(100vh - 22rem);
    overflow-x: hidden;
    overflow-y: auto;
}

.viewer-tree {
    font-size: 0.9rem;
}

.viewer-tree-item {
    line-height: 1.65;
}

.viewer-tree-link {
    display: inline-block;
    min-width: 0;
    max-width: calc(100% - 2rem);
    overflow: hidden;
    padding: 0.1rem 0.3rem;
    color: var(--bs-body-color);
    text-decoration: none;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
    border-radius: 0.25rem;
}

.viewer-tree-link:hover {
    color: var(--bs-primary);
    background: var(--bs-tertiary-bg);
}

.viewer-tree-link.active {
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    box-shadow: inset 3px 0 0 var(--bs-primary);
    font-weight: 700;
}

.folder-link.active .fa-folder {
    color: var(--bs-primary) !important;
}

.file-link.active .fa-file-lines {
    color: var(--bs-primary) !important;
}

.btn-tree-toggle,
.tree-toggle-spacer {
    display: inline-flex;
    width: 1.7rem;
    min-width: 1.7rem;
    height: 1.7rem;
    align-items: center;
    justify-content: center;
    margin-right: 0.1rem;
    padding: 0;
    font-size: 0.7rem;
}

.btn-tree-toggle {
    border: 0;
    color: var(--bs-secondary-color);
}

.btn-tree-toggle:hover,
.btn-tree-toggle:focus {
    background: var(--bs-tertiary-bg);
    color: var(--bs-primary);
}

.viewer-card {
    min-height: 60vh;
}

.file-content {
    padding: 1rem;
    overflow-x: auto;
    color: #d1d5db;
    background: #1a1a1a;
    border-radius: 0.375rem;
}

.viewer-image {
    max-width: 100%;
    max-height: calc(100vh - 16rem);
    object-fit: contain;
}

.html-preview,
.pdf-preview {
    width: 100%;
    min-height: calc(100vh - 17rem);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    background: #fff;
}

@media (max-width: 991.98px) {
    .sidebar-tree {
        max-height: 24rem;
    }

    .html-preview,
    .pdf-preview {
        min-height: 65vh;
    }
}
