:root {
    color-scheme: dark;
    --bg: #0b1020;
    --panel: rgba(255, 255, 255, 0.08);
    --panel-strong: rgba(255, 255, 255, 0.12);
    --panel-border: rgba(255, 255, 255, 0.14);
    --text: #eef5ff;
    --muted: #a9b8d6;
    --accent: #4f9cff;
    --accent-2: #7c3aed;
    --success: #33d69f;
    --danger: #ff6b6b;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}

body[data-theme="light"] {
    color-scheme: light;
    --bg: #eef4fb;
    --panel: rgba(255, 255, 255, 0.96);
    --panel-strong: #ffffff;
    --panel-border: rgba(31, 65, 120, 0.12);
    --text: #162033;
    --muted: #59677f;
    --accent: #2563eb;
    --accent-2: #6d28d9;
    --success: #059669;
    --danger: #dc2626;
    --shadow: 0 20px 45px rgba(30, 52, 95, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(79, 156, 255, 0.20), transparent 34%),
        radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.18), transparent 30%),
        var(--bg);
    color: var(--text);
    font-family: Tahoma, Arial, sans-serif;
}

a { color: inherit; }
.app-shell {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 42px;
}
.app-shell.compact { width: min(980px, calc(100% - 28px)); }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.brand-block {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 900;
    box-shadow: var(--shadow);
}
.brand { display: block; font-size: 1.35rem; }
.subtitle { display: block; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.toolbar, .button-group, .trust-row { display: flex; gap: 10px; flex-wrap: wrap; }

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    padding: 22px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.88fr);
    gap: 24px;
    align-items: start;
}
.hero-copy h1 {
    margin: 10px 0;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.15;
}
.hero-copy p, .muted { color: var(--muted); line-height: 1.85; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(79, 156, 255, 0.14);
    color: var(--accent);
    font-size: 0.9rem;
    line-height: 1.6;
}
.trust-row { margin-top: 20px; }
.trust-row span {
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 0.9rem;
}

.upload-form { display: flex; flex-direction: column; gap: 14px; }
.dropzone {
    min-height: 260px;
    display: grid;
    place-items: center;
    gap: 8px;
    text-align: center;
    border: 2px dashed rgba(79, 156, 255, 0.35);
    border-radius: 24px;
    padding: 26px 18px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
body[data-theme="light"] .dropzone { background: rgba(255,255,255,0.72); }
.dropzone input { display: none; }
.dropzone.dragover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: rgba(79, 156, 255, 0.12);
}
.dropzone-icon { font-size: 2rem; }
.dropzone-title { font-size: 1.25rem; }
.dropzone-meta, .dropzone-help { color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
.dropzone-help { font-size: 0.9rem; }

.field-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { color: var(--muted); font-size: 0.93rem; }
.field input {
    width: 100%;
    min-height: 50px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    padding: 13px 14px;
    background: rgba(255,255,255,0.07);
    color: var(--text);
    outline: none;
}
body[data-theme="light"] .field input { background: #fff; }

.primary-btn, .ghost-btn {
    appearance: none;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border-radius: 16px;
    padding: 13px 18px;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
    white-space: nowrap;
}
.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 16px 34px rgba(79, 156, 255, 0.22);
}
.ghost-btn {
    color: var(--text);
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--panel-border);
}
.primary-btn:hover, .ghost-btn:hover { transform: translateY(-1px); }
.primary-btn:disabled { cursor: not-allowed; opacity: 0.65; transform: none; }
.wide { width: 100%; }

.content-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.help-panel h2, .archive-panel h2 { margin: 0 0 10px; font-size: 1.12rem; }
.steps { display: grid; gap: 10px; }
.steps div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
}
.steps b {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(79, 156, 255, 0.18);
    color: var(--accent);
}

.archive-panel { margin-top: 16px; }
.archive-panel.side { margin-top: 0; align-self: start; }
.archive-list { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow: auto; }
.archive-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
}
.archive-name { overflow-wrap: anywhere; }
.archive-size { color: var(--muted); white-space: nowrap; }
.empty-state {
    display: grid;
    place-items: center;
    min-height: 118px;
    border-radius: 18px;
    border: 1px dashed var(--panel-border);
    color: var(--muted);
    text-align: center;
    padding: 16px;
}

.status-card, .message-box, .preview-box {
    margin-top: 14px;
    border-radius: 18px;
    padding: 15px;
    border: 1px solid var(--panel-border);
    background: rgba(255,255,255,0.05);
}
.status-row { display: flex; justify-content: space-between; gap: 12px; }
.progress-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.10); overflow: hidden; margin-top: 12px; }
.progress-bar { width: 0; height: 100%; border-radius: 999px; background: linear-gradient(135deg, var(--success), var(--accent)); }
.stats-grid, .details-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.stats-grid > div, .details-list > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    overflow-wrap: anywhere;
}
.stat-label, .details-list span { color: var(--muted); font-size: 0.85rem; }
.message-box.error { border-color: rgba(255, 107, 107, 0.45); color: #ffd9d9; background: rgba(255, 107, 107, 0.16); }
.message-box.success { border-color: rgba(51, 214, 159, 0.4); color: #d9ffef; background: rgba(51, 214, 159, 0.14); }
.hidden { display: none !important; }

.download-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr); gap: 16px; }
.download-card { text-align: start; }
.success-badge { font-size: 2rem; margin-bottom: 8px; }
.filename { margin: 0 0 16px; overflow-wrap: anywhere; font-size: clamp(1.35rem, 3vw, 2.2rem); }
.prominent-actions { margin-top: 18px; }
.media-preview { width: 100%; max-height: 420px; object-fit: contain; border-radius: 18px; background: rgba(0,0,0,0.20); }
.audio-preview { width: 100%; }

@media (max-width: 980px) {
    .hero, .download-grid { grid-template-columns: 1fr; }
    .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .app-shell { width: min(100% - 18px, 1120px); padding-top: 14px; }
    .topbar { flex-direction: column; align-items: stretch; }
    .toolbar > *, .button-group > * { flex: 1 1 auto; }
    .panel { padding: 17px; border-radius: 20px; }
    .hero { gap: 16px; }
    .dropzone { min-height: 210px; }
    .field-row, .content-grid, .stats-grid, .details-list { grid-template-columns: 1fr; }
    .primary-btn, .ghost-btn { width: 100%; white-space: normal; }
}
