.zip-inline-panel .zip-tree,
.zip-browser .zip-tree {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 13px 0 0;
    padding: 0;
}

.zip-tree ul {
    list-style: none;
    display: grid;
    gap: 7px;
    margin: 8px 0 0 20px;
    padding: 0 0 0 13px;
    border-left: 1px solid rgba(188, 239, 246, 0.14);
}

.zip-dir {
    min-width: 0;
}

.zip-dir.collapsed > ul {
    display: none;
}

.folder-toggle {
    width: 100%;
    font: inherit;
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 11px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(50, 226, 194, 0.22);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(50, 226, 194, 0.13), rgba(98, 197, 255, 0.07)), rgba(3, 16, 24, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    color: #dcfff6;
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.folder-toggle:hover,
.folder-toggle:focus-visible {
    border-color: var(--line-strong);
    background: linear-gradient(135deg, rgba(50, 226, 194, 0.2), rgba(98, 197, 255, 0.11)), rgba(6, 24, 33, 0.92);
    transform: translateY(-1px);
}

.zip-entry-icon {
    width: 40px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(188, 239, 246, 0.15);
    border-radius: 12px;
    background: rgba(4, 17, 25, 0.66);
    font-size: 1.15rem;
}

.zip-entry-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.zip-entry-copy strong {
    min-width: 0;
    color: #fff;
    font-size: 0.96rem;
    line-height: 1.35;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.zip-entry-copy small {
    color: var(--muted-2);
    font-size: 0.7rem;
    line-height: 1.25;
    font-weight: 900;
    text-transform: uppercase;
}

.zip-folder-caret {
    width: 11px;
    height: 11px;
    justify-self: center;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 180ms ease;
}

.zip-dir.collapsed > .folder-toggle .zip-folder-caret {
    transform: rotate(-45deg) translate(-2px, -2px);
}

.zip-file {
    min-width: 0;
    min-height: 62px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 11px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 44%), rgba(4, 17, 25, 0.62);
    color: var(--muted);
    overflow-wrap: anywhere;
}

.zip-file.highlight {
    border-color: rgba(241, 184, 102, 0.4);
    background: linear-gradient(135deg, rgba(241, 184, 102, 0.14), transparent 42%), rgba(4, 17, 25, 0.68);
}

.zip-file.highlight .zip-entry-copy small {
    color: #ffe8bd;
}

.zip-size {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
    border: 1px solid rgba(188, 239, 246, 0.14);
    border-radius: 999px;
    background: rgba(98, 197, 255, 0.1);
    color: #d8edf3;
    font-size: 0.76rem;
    line-height: 1;
    font-weight: 900;
    white-space: nowrap;
}

a.zip-download {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    border: 1px solid rgba(50, 226, 194, 0.3);
    border-radius: 12px;
    background: rgba(50, 226, 194, 0.15);
    color: #dffcf5;
    font-size: 0.86rem;
    line-height: 1;
    font-weight: 950;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

a.zip-download:hover,
a.zip-download:focus-visible {
    border-color: var(--line-strong);
    background: rgba(50, 226, 194, 0.24);
    transform: translateY(-1px);
}

.zip-browser-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 11px;
}

.zip-browser-summary span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 1px solid rgba(188, 239, 246, 0.14);
    border-radius: 999px;
    background: rgba(4, 17, 25, 0.54);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.zip-browser-summary strong {
    color: var(--accent);
}

@media (max-width: 760px) {
    .zip-tree ul {
        margin-left: 9px;
        padding-left: 8px;
    }

    .folder-toggle,
    .zip-file {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 9px;
        padding: 10px;
    }

    .folder-toggle {
        grid-template-columns: 36px minmax(0, 1fr) 16px;
        min-height: 56px;
    }

    .zip-entry-icon {
        width: 36px;
    }

    .zip-file .zip-size,
    .zip-file .zip-download {
        grid-column: 2;
        justify-self: start;
    }

    .zip-file .zip-download {
        width: 100%;
        min-height: 44px;
    }

    .zip-close {
        width: 100%;
    }
}


/* ZIP tree uses the same portal icon language as file cards. */
.zip-entry-icon > span {
    position: relative;
    display: block;
    filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.24));
}

.zip-entry-icon-folder > span {
    width: 25px;
    height: 18px;
    border: 2px solid var(--accent);
    border-radius: 4px 6px 6px 6px;
    background: linear-gradient(135deg, rgba(50, 226, 194, 0.26), rgba(98, 197, 255, 0.12));
}

.zip-entry-icon-folder > span::before {
    position: absolute;
    top: -6px;
    left: 1px;
    width: 11px;
    height: 6px;
    border: 2px solid var(--accent);
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
    background: rgba(50, 226, 194, 0.18);
    content: "";
}

.zip-entry-icon-file > span {
    width: 22px;
    height: 27px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: rgba(5, 22, 31, 0.66);
}

.zip-entry-icon-file > span::before {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-top: 2px solid var(--accent-2);
    border-right: 2px solid var(--accent-2);
    content: "";
}

.zip-entry-icon-file > span::after {
    position: absolute;
    top: 11px;
    left: 4px;
    width: 11px;
    height: 2px;
    background: var(--accent-2);
    box-shadow: 0 5px 0 var(--accent-3), 0 10px 0 rgba(98, 197, 255, 0.68);
    content: "";
}
