:root {
    --bg: #fafafa;
    --panel: #fff;
    --muted: #6b7280;
    --accent: #111827;
    --radius: 8px;
    --gap: 12px;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Noto Sans JP",
        sans-serif;
    background: var(--bg);
    background-image: 
        linear-gradient(to right, #e0f2fe 1px, transparent 1px),
        linear-gradient(to bottom, #e0f2fe 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--accent);
    -webkit-font-smoothing: antialiased;
    padding: 24px;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
}
header h1 {
    margin: 0;
    font-size: 20px;
}
.subtitle {
    margin: 6px 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.form {
    background: var(--panel);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    min-width: 320px;
    max-width: 520px;
}
.form label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--muted);
}
.form input[type="text"],
.form input[type="number"],
.form select,
.form input[type="color"],
.form input[type="file"] {
    margin-top: 6px;
    padding: 8px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}
.checkbox {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
}
.checkbox input {
    width: auto;
    margin-right: 8px;
}
.muted {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}
.buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 6px;
}
button {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e6e6e6;
    background: white;
    cursor: pointer;
}
button#downloadBtn {
    background: #111827;
    color: white;
    border: 0;
}

.preview-area {
    flex: 1;
    min-width: 260px;
}
.preview-area h2 {
    margin: 0 0 8px 0;
    font-size: 14px;
}
.preview {
    background: var(--panel);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}
.preview img,
.preview svg {
    max-width: 100%;
    height: auto;
    display: block;
}
.hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}
.footer {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
}
@media (max-width: 880px) {
    .layout {
        flex-direction: column;
    }
    .form {
        grid-template-columns: 1fr;
    }
}
