:root {
    --bg:        #0f1117;
    --surface:   #171a23;
    --surface-2: #1f2330;
    --border:    #2a2f3e;
    --text:      #e7e9ee;
    --muted:     #9aa0ad;
    --primary:   #5b8cff;
    --primary-2: #4a76e0;
    --success:   #3ecf8e;
    --error:     #ff6b6b;
    --warn:      #ffb84d;
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

.header {
    text-align: center;
    margin-bottom: 32px;
}

.header h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
    font-weight: 600;
}

.subhead {
    color: var(--muted);
    margin: 0;
    font-size: 0.95rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.card.success { border-color: var(--success); }
.card.error   { border-color: var(--error); color: var(--error); }

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    background: var(--surface-2);
    margin-bottom: 16px;
}
.dropzone:hover, .dropzone:focus-visible {
    border-color: var(--primary);
    outline: none;
}
.dropzone.drag-active {
    border-color: var(--primary);
    background: rgba(91, 140, 255, 0.08);
}
.dropzone-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    pointer-events: none;
}

/* File list */
.file-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.file-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 6px;
    margin-bottom: 6px;
}
.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-size {
    color: var(--muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.file-remove {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.file-remove:hover { color: var(--error); }

/* Form row */
.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}
.form-row label {
    flex: 1;
}
.form-row input[type="number"] {
    width: 80px;
    padding: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    font: inherit;
}
.hint {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 4px 0 16px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-2); }
.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }

/* Progress */
.progress {
    height: 8px;
    background: var(--surface-2);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0 8px;
}
.progress-bar {
    height: 100%;
    width: 0;
    background: var(--primary);
    transition: width 0.2s;
}
.progress-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 16px;
}

/* Result */
.link-box {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}
.link-box input {
    flex: 1;
    padding: 10px;
    font: inherit;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.85rem;
}

/* Info grid (download page) */
.info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 0 0 20px;
}
.info-grid dt { color: var(--muted); font-weight: normal; }
.info-grid dd { margin: 0; font-weight: 500; }

.warning {
    color: var(--warn);
    font-size: 0.9rem;
    margin: 12px 0 0;
}

.inline-error {
    color: var(--error);
    margin: 12px 0 0;
    font-size: 0.9rem;
}

/* About details */
.about {
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.9rem;
}
.about summary {
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
}
.about summary:hover { color: var(--text); }
.about p { margin: 8px 0 0; }
