:root {
    --bg: #ffffff;
    --panel: #F7F8FA;
    --border: #E5E8EC;
    --border-strong: #D6DAE1;
    --ink: #14181F;
    --ink-soft: #5B6472;
    --ink-faint: #8A93A1;

    --blue: #2F6FED;
    --blue-dark: #2158C9;
    --blue-tint: #EAF1FF;

    --teal: #0FA37F;
    --teal-tint: #E6F8F3;

    --danger: #E14B4B;

    --radius: 12px;
    --radius-sm: 8px;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --shadow-sm: 0 1px 2px rgba(20, 24, 31, 0.05);
    --shadow-md: 0 8px 24px rgba(20, 24, 31, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 24px 96px;
}

/* Header */

.head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
    display: inline-block;
}

h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 34px;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}

.sub {
    color: var(--ink-soft);
    font-size: 15px;
    max-width: 650px;
    line-height: 1.5;
    margin: 0;
}

.privacy-pill {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--teal);
    background: var(--teal-tint);
    border: 1px solid #BFE9DC;
    border-radius: 999px;
    padding: 8px 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    height: fit-content;
}

/* Dropzone */

.dropzone {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    position: relative;
}

.dropzone.drag {
    border-color: var(--blue);
    background: var(--blue-tint);
}

.dz-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    border-radius: 10px;
    background: var(--blue-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
}

.dz-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    margin-bottom: 4px;
}

.dz-title span {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dz-sub {
    color: var(--ink-faint);
    font-size: 13px;
}

.dz-alt {
    margin-top: 10px;
    font-size: 13px;
    color: var(--ink-faint);
}

.dz-alt button {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--blue);
    background: none;
    border: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 0;
}

#fileInput,
#folderInput {
    display: none;
}

/* File panel */

.panel {
    margin-top: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: none;
}

.panel.show {
    display: block;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13.5px;
    color: var(--ink-soft);
}

.toolbar-left b {
    color: var(--ink);
}

.toolbar-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .12s ease;
}

.icon-btn:hover {
    background: var(--blue-tint);
    color: var(--blue);
    border-color: #C6D9FB;
}

.icon-btn.danger:hover {
    background: #FCEAEA;
    color: var(--danger);
    border-color: #F3C6C6;
}

.icon-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

.icon-btn.active {
    background: var(--blue-tint);
    color: var(--blue);
    border-color: #C6D9FB;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-faint);
    font-weight: 500;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}

thead th:first-child {
    width: 44px;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
}

.sortable-th:hover {
    color: var(--blue);
}

.sort-arrow {
    display: inline-block;
    margin-left: 3px;
    opacity: .35;
}

.sortable-th.active .sort-arrow {
    opacity: 1;
    color: var(--blue);
}

.sort-arrow.desc {
    transform: rotate(180deg);
}

tbody tr {
    border-bottom: 1px solid var(--border);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: #FAFBFD;
}

tbody td {
    padding: 12px 18px;
    font-size: 14px;
    vertical-align: middle;
}

.chk {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--border-strong);
    cursor: pointer;
    accent-color: var(--blue);
}

.file-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-ico {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 7px;
    background: var(--blue-tint);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.file-path-hint {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-faint);
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-mono {
    font-family: var(--font-mono);
    color: var(--ink-soft);
    font-size: 13px;
}

.type-badge {
    font-family: var(--font-mono);
    font-size: 11.5px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--ink-soft);
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.row-download,
.row-remove,
.row-rename {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-faint);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.row-download:hover,
.row-rename:hover {
    background: var(--blue-tint);
    color: var(--blue);
}

.row-remove:hover {
    background: #FCEAEA;
    color: var(--danger);
}

.name-edit {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    border: 1.5px solid var(--blue);
    border-radius: 6px;
    padding: 3px 7px;
    outline: none;
    width: 100%;
    max-width: 260px;
}

tr.cut-marked {
    opacity: .45;
}

tr.cut-marked .file-name {
    text-decoration: line-through dashed var(--ink-faint);
}

/* View toggle */

.panel-header {
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.view-toggle {
    display: flex;
    gap: 3px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 3px;
}

.view-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.view-btn:hover {
    color: var(--ink);
}

.view-btn.active {
    background: #fff;
    color: var(--blue);
    box-shadow: var(--shadow-sm);
}

/* Grid */

.grid-view-wrap {
    display: none;
    padding: 18px;
}

.grid-view-wrap.show {
    display: block;
}

.table-view-wrap.hide {
    display: none;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.grid-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 12px 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    transition: border-color .12s ease, box-shadow .12s ease;
    position: relative;
    cursor: grab;
    overflow: hidden;
}

.grid-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.grid-card:active {
    cursor: grabbing;
}

.grid-card.dragging {
    opacity: .45;
    transform: scale(.98);
}

.grid-card.drop-target {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px var(--blue-tint);
}

.grid-card.cut-marked {
    opacity: .45;
}

.grid-card.cut-marked .grid-card-name {
    text-decoration: line-through dashed var(--ink-faint);
}

.grid-card-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-card-actions {
    display: flex;
    gap: 2px;
}

.grid-card-preview {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
}

.preview-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: var(--blue-tint);
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-card-name {
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.grid-card-date {
    font-size: 11px;
    color: var(--ink-faint);
}

.album-hint {
    color: var(--ink-faint);
    font-size: 12px;
}

/* Action */

.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.zip-name-field {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    background: #fff;
}

.zip-name-field input {
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 13.5px;
    width: 210px;
    color: var(--ink);
}

.zip-name-field span {
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: 13px;
}

.btn-compress {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(180deg, var(--blue), var(--blue-dark));
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    box-shadow: var(--shadow-sm);
    transition: transform .1s ease, box-shadow .1s ease;
}

.btn-compress:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-compress:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress */

.progress-wrap {
    display: none;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-soft);
}

.progress-wrap.show {
    display: flex;
}

.progress-track {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--border);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue), var(--teal));
    transition: width .12s ease;
}

.empty-hint {
    text-align: center;
    color: var(--ink-faint);
    font-size: 13px;
    padding: 30px 0 6px;
}

/* Toast */

.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--ink);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 50;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {

    .wrap {
        padding: 30px 16px 70px;
    }

    h1 {
        font-size: 28px;
    }

    .file-name {
        max-width: 120px;
    }

    thead th:nth-child(3),
    tbody td:nth-child(3) {
        display: none;
    }

    thead th:nth-child(5),
    tbody td:nth-child(5) {
        display: none;
    }

    .head {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-right {
        width: 100%;
    }

    .action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-compress {
        justify-content: center;
    }

    .zip-name-field input {
        width: 100%;
    }
}