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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f7;
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

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

h1 {
    font-size: 2rem;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.subtitle {
    color: #6e6e73;
    font-size: 1.1rem;
}

main {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
}

@media (max-width: 800px) {
    main {
        grid-template-columns: 1fr;
    }
}

.form-panel,
.preview-panel {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

input[type="url"],
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e5e7;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: #0071e3;
}

/* Logo Grid */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .logo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.logo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e5e5e7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.logo-card:hover {
    border-color: #c5c5c7;
    background: #f0f0f2;
}

.logo-card.selected {
    border-color: #0071e3;
    background: #f0f7ff;
}

.logo-preview {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 8px;
}

.logo-preview.no-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e5e7;
    border-radius: 8px;
    color: #86868b;
    font-size: 0.75rem;
}

.logo-name {
    font-size: 0.75rem;
    color: #6e6e73;
    text-align: center;
    line-height: 1.2;
}

/* Format Switch */
.format-switch {
    display: flex;
    border: 2px solid #e5e5e7;
    border-radius: 10px;
    overflow: hidden;
}

.format-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #6e6e73;
}

.format-btn:first-child {
    border-right: 1px solid #e5e5e7;
}

.format-btn.active {
    background: #0071e3;
    color: white;
}

.format-btn:hover:not(.active) {
    background: #f5f5f7;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn.primary {
    background: #0071e3;
    color: white;
}

.btn.primary:hover {
    background: #0077ed;
}

.btn.secondary {
    background: #e5e5e7;
    color: #1d1d1f;
    margin-top: 20px;
}

.btn.secondary:hover {
    background: #d2d2d7;
}

#download-btn {
    margin-top: 20px;
}

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

/* Preview */
.preview-panel h2 {
    font-size: 1.2rem;
    color: #1d1d1f;
    margin-bottom: 20px;
}

#preview-area {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border: 2px dashed #e5e5e7;
    border-radius: 12px;
    padding: 20px;
}

#preview-area svg,
#preview-area canvas {
    max-width: 100%;
    height: auto;
}

#preview-area .placeholder {
    color: #86868b;
    font-size: 0.95rem;
}

#preview-area .error {
    color: #ff3b30;
}

#preview-area .loading {
    color: #86868b;
}
