: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;
}

.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: 40px;
    line-height: 1.1;
}

.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: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all .2s ease;
    padding: 16px;
}

.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-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: 30px;
    }

    .topbar-note {
        display: none;
    }
}
