:root {
    --brand: #5D0F67;
    --brand-h: #7a1587;
    --brand-soft: #f7eefa;
    --bg: #f4f2f5;
    --card: #ffffff;
    --ink: #1f2430;
    --muted: #6b7280;
    --faint: #9aa1ac;
    --line: #e8e6ec;
    --danger: #c0392b;
    --ok: #2d7a2d;
    --ok-bg: #eaf7ea;
    --radius: 16px;
    --shadow: 0 4px 24px rgba(31, 20, 40, .07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.wrap { max-width: 620px; margin: 0 auto; padding: 40px 20px 64px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.card--narrow { max-width: 400px; margin: 12vh auto 0; }
.center { text-align: center; }

.brand { font-weight: 700; font-size: 17px; display: inline-flex; align-items: center; gap: 8px; color: var(--brand); }
.brand__mark { font-size: 20px; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

.h1 { font-size: 22px; font-weight: 700; margin: 16px 0 4px; letter-spacing: -.01em; }
.h2 { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

input[type=text], input[type=password], input[type=date], select, textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: 11px; font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(93, 15, 103, .12);
}
textarea { resize: vertical; }
select { appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border: 1px solid transparent; border-radius: 11px;
    font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
    text-decoration: none; color: var(--ink);
    transition: background .18s, border-color .18s, transform .12s, box-shadow .18s;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-h); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(93, 15, 103, .25); }
.btn--primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--faint); background: #fafafa; }
.btn--danger { background: #fff; border-color: #f0d4d0; color: var(--danger); }
.btn--danger:hover { background: #fdecea; }
.btn--block { width: 100%; }
.btn--hero { width: 100%; padding: 17px 22px; font-size: 17px; border-radius: 13px; }

.alert { padding: 12px 15px; border-radius: 11px; margin: 14px 0; font-size: 14px; }
.alert--error { background: #fdecea; color: var(--danger); border: 1px solid #f4cfca; }

/* Dropzone */
.dropzone {
    display: block; border: 2px dashed var(--line); border-radius: 13px;
    padding: 36px 20px; text-align: center; cursor: pointer; margin: 20px 0 6px;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone--over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone__inner { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.dropzone__icon { font-size: 28px; margin-bottom: 4px; }
.dropzone__title { font-weight: 600; }
.dropzone__sub { color: var(--muted); font-size: 14px; }

/* File chips */
.filelist { list-style: none; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.filelist__item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: #fbfafc; border: 1px solid var(--line); border-radius: 11px;
}
.filelist__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.filelist__size { white-space: nowrap; font-size: 13px; }
.filelist__remove { border: none; background: none; color: var(--faint); cursor: pointer; font-size: 15px; padding: 2px 6px; line-height: 1; }
.filelist__remove:hover { color: var(--danger); }

/* Download-page file rows */
.filelist__link { display: flex; align-items: center; gap: 12px; width: 100%; text-decoration: none; color: inherit; }
.filelist__link:hover { border-color: var(--brand); }
.filelist--download .filelist__item { transition: border-color .15s, background .15s; }
.filelist--download .filelist__item:hover { border-color: var(--brand); background: var(--brand-soft); }
.filelist__dl { margin-left: auto; color: var(--brand); font-weight: 600; white-space: nowrap; font-size: 14px; }
.fileicon { font-size: 18px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 6px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink); }

.progress { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 16px; }
.progress__bar { height: 100%; width: 0; background: var(--brand); border-radius: 6px; transition: width .2s; }

/* Upload result */
.result { margin-top: 18px; padding: 20px; background: var(--ok-bg); border: 1px solid #c6e6c6; border-radius: 13px; }
.result__title { font-weight: 700; color: var(--ok); margin-bottom: 12px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; font-size: 14px; }
.result__actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.result__actions .link { margin-right: auto; }

.link { color: var(--brand); text-decoration: none; font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; }

/* Download page hero */
.dlhead { text-align: center; margin-bottom: 4px; }
.dlhead .brand { margin-bottom: 18px; }
.dlmeta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.note {
    background: var(--brand-soft); border-radius: 12px; padding: 14px 16px;
    margin: 18px 0; color: var(--ink); font-size: 15px;
}
.hero-actions { margin: 22px 0 6px; }
.expiry-pill {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
    font-size: 13px; color: var(--muted);
}

/* Transfers dashboard */
.transfers { display: flex; flex-direction: column; gap: 12px; }
.transfer {
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
    padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fbfafc;
}
.transfer--expired { opacity: .55; }
.transfer__main { flex: 1; min-width: 200px; }
.transfer__names strong { display: block; word-break: break-word; }
.transfer__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.linkfield { width: 210px; font-size: 13px; padding: 9px 11px; }

/* Download log */
.dltable { margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.dltable__head, .dltable__row {
    display: grid; grid-template-columns: 150px 1fr 140px; gap: 14px;
    padding: 12px 16px; align-items: baseline;
}
.dltable__head { background: #fbfafc; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.dltable__row { border-top: 1px solid var(--line); font-size: 14px; }
.dltable__row:hover { background: #fbfafc; }
.dltable__file { word-break: break-word; }
.dltable__ip code { font-family: "SF Mono", SFMono-Regular, Consolas, Menlo, monospace; font-size: 13px; color: var(--brand); }
.dltable__ua { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -6px; }

@media (max-width: 520px) {
    .dltable__head { display: none; }
    .dltable__row { grid-template-columns: 1fr; gap: 4px; }
    .dltable__ua { margin-top: 0; }
    .grid2 { grid-template-columns: 1fr; }
    .linkfield { width: 100%; }
    .transfer__actions { width: 100%; }
    .result__actions { flex-wrap: wrap; }
}
