:root {
    color-scheme: light dark;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    background: #111827;
    color: #f9fafb;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.panel {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 60px rgb(0 0 0 / 25%);
}

h1, h2 {
    margin-top: 0;
}

.muted, .help {
    color: #cbd5e1;
}

.form {
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

textarea, input, select, button {
    border-radius: 12px;
    border: 1px solid #475569;
    padding: 12px 14px;
    font: inherit;
}

textarea, input, select {
    background: #0f172a;
    color: #f8fafc;
}

button, .download {
    display: inline-block;
    background: #38bdf8;
    color: #082f49;
    border: 0;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    padding: 13px 18px;
    border-radius: 12px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid.three {
    grid-template-columns: repeat(3, 1fr);
}

.help {
    font-size: 0.9rem;
    font-weight: 500;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.alert.warning {
    background: #713f12;
    color: #fff7ed;
}

.alert.error {
    background: #7f1d1d;
    color: #fee2e2;
}

.preview {
    display: block;
    width: 100%;
    max-height: 720px;
    object-fit: contain;
    background: #0f172a;
    border-radius: 16px;
    border: 1px solid #334155;
}

.preview.small {
    max-height: 260px;
    margin: 12px 0 18px;
}

.empty {
    display: grid;
    place-items: center;
    min-height: 360px;
    border: 1px dashed #64748b;
    border-radius: 16px;
    color: #cbd5e1;
}

code {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 2px 5px;
}

@media (max-width: 900px) {
    .container, .grid, .grid.three {
        grid-template-columns: 1fr;
    }
}
