* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

header {
    background: #1a1a2e;
    color: #fff;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

header p {
    opacity: 0.7;
    font-size: 0.95rem;
}

main {
    max-width: 640px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Template selector */
.template-selector {
    margin-bottom: 1.5rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.radio-card:hover {
    border-color: #999;
}

.radio-card.selected {
    border-color: #1a1a2e;
    box-shadow: 0 0 0 1px #1a1a2e;
}

.radio-card input {
    display: none;
}

.radio-label {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.radio-desc {
    font-size: 0.85rem;
    color: #777;
}

/* Drop area */
.upload-section {
    margin-bottom: 1.5rem;
}

.drop-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: #fff;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.drop-area.dragover {
    border-color: #1a1a2e;
    background: #eef;
}

.drop-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.drop-text {
    font-size: 1.1rem;
    color: #555;
}

.drop-or {
    color: #999;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* File list */
.file-list-section {
    margin-bottom: 1.5rem;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
}

#file-list {
    list-style: none;
    margin-bottom: 0.75rem;
}

#file-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

#file-list li:last-child {
    border-bottom: none;
}

.file-name {
    font-weight: 500;
}

.file-size {
    color: #999;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.file-remove {
    background: none;
    border: none;
    color: #c00;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.25rem;
}

.file-remove:hover {
    color: #900;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
    background: #1a1a2e;
    color: #fff;
}

.btn-primary:hover {
    background: #2a2a4e;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e8e8e8;
    color: #333;
}

.btn-secondary:hover {
    background: #ddd;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

#render-btn {
    width: 100%;
    margin-bottom: 1.5rem;
}

/* Progress */
.progress-section {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-section p {
    color: #777;
}

/* Result */
.result-section {
    text-align: center;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 2rem;
}

#download-link {
    margin-top: 1rem;
}

#error-area h2 {
    color: #c00;
}

#error-detail {
    text-align: left;
    background: #fee;
    color: #800;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    overflow-x: auto;
    margin-top: 0.75rem;
}
