:root {
    color-scheme: dark;
    --bg: #080a10;
    --panel: rgba(19, 22, 32, .82);
    --panel-strong: #151925;
    --line: rgba(255,255,255,.10);
    --text: #f6f7fb;
    --muted: #9ca3b5;
    --accent: #7c5cff;
    --accent-2: #35c5f0;
    --danger: #ff5f70;
    --success: #62d5a4;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 2%, rgba(124,92,255,.23), transparent 33rem),
        radial-gradient(circle at 88% 24%, rgba(53,197,240,.12), transparent 29rem),
        var(--bg);
}
button, input, select { font: inherit; }
a { color: inherit; }

.page { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 32px; }
.page.narrow { width: min(560px, calc(100% - 32px)); display: grid; min-height: 100vh; place-items: center; }
.hero { padding: 8px 4px 34px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 28px rgba(124,92,255,.28); }
.hero h1 { max-width: 760px; margin: 38px 0 18px; font-size: clamp(44px, 8vw, 82px); line-height: .98; letter-spacing: -.065em; }
.hero h1 span { background: linear-gradient(100deg, #b8a9ff, #75dcf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 560px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.6; }

.panel { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.24); backdrop-filter: blur(18px); }
.panel h2 { margin: 0 0 18px; font-size: 20px; letter-spacing: -.025em; }
.dropzone { display: grid; min-height: 260px; place-items: center; align-content: center; gap: 9px; padding: 32px; border: 1.5px dashed rgba(255,255,255,.24); border-radius: 19px; background: rgba(255,255,255,.025); cursor: pointer; transition: .2s ease; text-align: center; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent-2); background: rgba(53,197,240,.07); transform: translateY(-2px); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone strong { font-size: 20px; }
.dropzone > span:last-child { color: var(--muted); }
.upload-icon { display: grid; width: 58px; height: 58px; margin-bottom: 7px; place-items: center; border-radius: 18px; font-size: 30px; background: linear-gradient(135deg, rgba(124,92,255,.24), rgba(53,197,240,.18)); border: 1px solid rgba(255,255,255,.12); }

.form-row { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-top: 18px; }
.form-row label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
select { min-width: 160px; padding: 12px 40px 12px 13px; color: var(--text); border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
button, .button-link, .file-actions a { border: 0; cursor: pointer; text-decoration: none; }
#upload-button { min-width: 170px; padding: 13px 22px; border-radius: 13px; color: white; font-weight: 750; background: linear-gradient(135deg, var(--accent), #5f86ff); box-shadow: 0 12px 30px rgba(124,92,255,.24); }
#upload-button:hover { filter: brightness(1.08); }
#upload-button:disabled { opacity: .55; cursor: wait; }
.selection { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.selection span { max-width: 100%; padding: 8px 10px; border-radius: 9px; background: rgba(255,255,255,.06); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.selection small { color: var(--muted); }
.progress-wrap { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.progress { height: 8px; flex: 1; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .1s linear; }
.message { min-height: 22px; margin-top: 14px; font-size: 14px; }
.message.success { color: var(--success); }
.message.error { color: #ff8793; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.button-secondary { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; }
.button-secondary:hover { color: var(--text); background: rgba(255,255,255,.05); }
.history { display: grid; gap: 10px; }
.empty { padding: 34px 18px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; }
.file-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); }
.file-main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.file-icon { display: grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: rgba(124,92,255,.13); color: #b6a8ff; }
.file-text { display: grid; min-width: 0; gap: 4px; }
.file-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-text span { color: var(--muted); font-size: 12px; }
.file-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.file-actions button, .file-actions a { padding: 8px 10px; border-radius: 9px; color: var(--text); background: rgba(255,255,255,.065); font-size: 12px; }
.file-actions button:hover, .file-actions a:hover { background: rgba(255,255,255,.12); }
.file-actions .delete-link { color: #ff9ca6; }
.file-actions .forget-button { padding-inline: 9px; color: var(--muted); background: transparent; font-size: 18px; }

.confirm-panel { width: 100%; text-align: center; }
.confirm-panel h1 { margin: 14px 0 8px; font-size: 34px; letter-spacing: -.04em; }
.confirm-panel p { color: var(--muted); }
.confirm-panel .filename { color: var(--text); font-weight: 700; word-break: break-all; }
.danger-icon { display: grid; width: 62px; height: 62px; margin: auto; place-items: center; border-radius: 20px; color: white; background: rgba(255,95,112,.18); font-size: 38px; }
.confirm-panel form { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 28px; }
.button-danger { padding: 12px 17px; border-radius: 11px; color: white; background: var(--danger); font-weight: 700; }
.button-link { display: inline-block; padding: 12px 17px; border-radius: 11px; background: rgba(255,255,255,.07); }
footer { padding: 20px 4px 4px; color: #6f7586; font-size: 12px; text-align: center; }

@media (max-width: 720px) {
    .page { width: min(100% - 20px, 920px); padding-top: 24px; }
    .hero { padding-inline: 8px; }
    .panel { padding: 16px; border-radius: 20px; }
    .dropzone { min-height: 220px; }
    .file-card { align-items: stretch; flex-direction: column; }
    .file-actions { flex-wrap: wrap; padding-left: 52px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 46px; }
    .form-row { align-items: stretch; flex-direction: column; }
    #upload-button, select { width: 100%; }
    .section-head { align-items: flex-start; }
    .file-actions { padding-left: 0; }
}

.form-row-end { align-items: center; }
.storage-note { color: var(--muted); font-size: 14px; line-height: 1.5; }

@media (max-width: 640px) {
    .form-row-end { align-items: stretch; }
}
