:root {
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #d1d5db;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --warn-bg: #fef3c7;
    --warn-text: #92400e;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.card {
    width: 100%;
    max-width: 640px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--primary);
}

.subtitle {
    margin: 0.25rem 0 1.5rem;
    color: var(--muted);
}

/* Dropzone */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 2rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}
.dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}
.dropzone-icon { font-size: 2rem; }
.dropzone-text { font-weight: 600; word-break: break-all; }
.dropzone-hint { font-size: 0.85rem; color: var(--muted); }

/* Optionen */
.options {
    margin: 1.25rem 0 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.options legend {
    padding: 0 0.5rem;
    font-weight: 600;
    color: var(--muted);
}
.options label {
    display: block;
    margin: 0.35rem 0;
    cursor: pointer;
}

/* Button */
button#submit-btn {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}
button#submit-btn:hover:not(:disabled) { background: var(--primary-dark); }
button#submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Status */
.status {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}
.status.loading { background: #eff6ff; color: var(--primary-dark); }
.status.error { background: var(--error-bg); color: var(--error-text); }

/* Ergebnis */
.result {
    margin-top: 1.75rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}
.result h2 { margin-top: 0; font-size: 1.2rem; }
.downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.btn-download {
    flex: 1 1 auto;
    text-align: center;
    text-decoration: none;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    background: #eff6ff;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    transition: background 0.15s;
}
.btn-download:hover { background: #dbeafe; }

.warning {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--warn-bg);
    color: var(--warn-text);
    font-size: 0.9rem;
}

.preview { margin-top: 1.25rem; }
.preview summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.preview pre {
    margin-top: 0.75rem;
    max-height: 320px;
    overflow: auto;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.85rem;
}
