:root {
    --bg: #f8f9fd;
    --card: #ffffff;
    --line: #e8ebf3;
    --text: #161c2d;
    --muted: #727b8f;
    --primary: #4e6bff;
    --primary-dark: #3651d4;
    --ok: #0a9d53;
    --danger: #d3324b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 14px 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.logo-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(78, 107, 255, 0.12);
}

.topbar-note {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.topbar-link {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.topbar-link:hover {
    text-decoration: underline;
}

.layout {
    max-width: 1200px;
    margin: 26px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
        "main side"
        "files side";
    gap: 16px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
}

.main-panel {
    grid-area: main;
}

.side {
    grid-area: side;
}

.files-panel {
    grid-area: files;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.3;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.hero-meta p {
    margin-bottom: 8px;
}

.actions-row {
    display: flex;
    gap: 10px;
    margin: 18px 0;
}

.btn {
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 11px 18px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

.btn.small {
    padding: 9px 13px;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-light, .btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

.dropzone {
    border: 2px dashed var(--line);
    border-radius: 12px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all .2s ease;
    padding: 16px;
    margin-top: 25px;
}

.single-use-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbff;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.single-use-option input {
    margin-top: 3px;
    flex-shrink: 0;
}

.quick-link {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f7f9ff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-link-label {
    font-size: 13px;
    color: var(--muted);
}

.quick-link a {
    color: var(--primary-dark);
    text-decoration: underline;
    font-size: 14px;
    font-weight: 600;
    word-break: break-all;
}

.dropzone.active {
    border-color: var(--primary);
    background: rgba(78, 107, 255, 0.05);
}

.drop-title {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
}

.drop-subtitle {
    margin-top: 7px;
    color: var(--muted);
}

.side-panel h2, .files-panel h2 {
    margin-top: 0;
}

.link-block {
    display: flex;
    gap: 10px;
}

#linkOutput {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.files-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-card {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}

.file-list {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.file-item {
    border: 1px solid #edf1fa;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.file-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.file-item-name {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
}

.file-item-meta {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.file-item-status {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.file-item-status.ok {
    color: var(--ok);
    font-weight: 600;
}

.file-item-status.error {
    color: var(--danger);
    font-weight: 600;
}

.file-item-track {
    height: 7px;
    border-radius: 999px;
    background: #eef2f9;
    margin-top: 8px;
    overflow: hidden;
}

.file-item-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width .2s linear;
}

.file-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.file-name {
    margin: 0;
    font-weight: 700;
}

.file-meta {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.progress-track {
    height: 9px;
    border-radius: 999px;
    background: #eff2f8;
    margin-top: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: var(--primary);
    transition: width .2s linear;
}

.status {
    margin: 12px 0 0;
    font-weight: 600;
}

.status-ok {
    color: var(--ok);
}

.status-error {
    color: var(--danger);
}

.download-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.download-wrapper {
    width: min(95%, 560px);
}

.download-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
}

.download-card h1 {
    margin: 0 0 18px;
}

.download-card .btn {
    display: inline-block;
    text-decoration: none;
    margin-top: 12px;
}

.back-link {
    margin-top: 16px;
}

.back-link a {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 960px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "files"
            "side";
    }

    .hero {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 26px;
    }

    .topbar-note {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1320;
        --card: #161c2d;
        --line: #2b3347;
        --text: #edf2ff;
        --muted: #a4b0c8;
        --primary: #6f86ff;
        --primary-dark: #8da0ff;
        --ok: #44d18e;
        --danger: #ff6e85;
    }

    .topbar {
        background: #12192a;
    }

    .btn-light,
    .btn-ghost {
        background: #1b2338;
        border-color: var(--line);
        color: var(--text);
    }

    .dropzone {
        background: #131a2b;
    }

    .quick-link {
        background: #1a2340;
    }

    .quick-link a {
        color: #b7c4ff;
    }

    #linkOutput {
        background: #11182a;
        color: var(--text);
        border-color: var(--line);
    }

    .file-item {
        border-color: #2a3553;
        background: #131a2a;
    }

    .file-item-track,
    .progress-track {
        background: #232d45;
    }

    .download-card {
        background: var(--card);
    }

    .single-use-option {
        background: #1a2235;
        border-color: var(--line);
    }
}
