* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-cream: #fdfcfa;
    --bg-warm: #faf7f4;
    --white: #ffffff;
    --sage: #7d9b8c;
    --sage-light: #a8c5b8;
    --sage-pale: #e8f0ec;
    --sage-dark: #5a7c6d;
    --blush: #f8e8e8;
    --blush-dark: #e8b4b4;
    --gold: #d4a574;
    --gold-light: #f5e6d3;
    --text-dark: #2d3436;
    --text-medium: #636e72;
    --text-light: #b2bec3;
    --border-light: #f0ebe6;
    --border-medium: #e5ddd5;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lifted: 0 12px 40px rgba(0, 0, 0, 0.08);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-cream);
    min-height: 100vh;
    padding: 48px 24px;
    color: var(--text-dark);
    overflow-x: hidden;
    position: relative;
}

/* Decorative blobs */
.decor-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
    top: -150px;
    right: -100px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    bottom: 100px;
    left: -100px;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    top: 40%;
    right: 10%;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 48px;
}

header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

header p {
    font-size: 1.125rem;
    color: var(--text-medium);
    font-weight: 400;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* How It Works */
.how-it-works {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    padding: 24px 40px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--sage), var(--sage-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(125, 155, 140, 0.3);
}

.step-text {
    font-size: 0.9375rem;
    color: var(--text-medium);
    font-weight: 500;
}

.step-divider {
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--border-light), var(--sage-pale), var(--border-light));
    border-radius: 1px;
}

@media (max-width: 768px) {
    .how-it-works {
        gap: 12px;
        padding: 20px;
    }

    .step-text {
        display: none;
    }

    .step-divider {
        width: 30px;
    }
}

/* Upload Section */
.upload-section {
    margin-bottom: 24px;
}

.upload-area {
    background: var(--white);
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 64px 48px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.upload-area:hover {
    border-color: var(--sage);
    background: linear-gradient(135deg, var(--white), var(--sage-pale));
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--sage);
    background: var(--sage-pale);
    box-shadow: var(--shadow-lifted);
    transform: scale(1.01);
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--sage-pale), var(--white));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    transition: var(--transition);
}

.upload-area:hover .upload-icon-wrapper {
    background: linear-gradient(135deg, var(--sage-light), var(--sage-pale));
    transform: scale(1.05);
}

.upload-icon {
    width: 36px;
    height: 36px;
    color: var(--sage);
    transition: var(--transition);
}

.upload-area:hover .upload-icon {
    color: var(--sage-dark);
}

.upload-area h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 500;
}

.upload-area p {
    color: var(--text-light);
    font-size: 0.9375rem;
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.upload-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-light);
    background: var(--bg-warm);
}

/* Platform Selection */
.platform-selection {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.platform-selection h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 500;
}

.background-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.background-control label {
    color: var(--text-medium);
    font-size: 0.875rem;
    font-weight: 500;
}

.background-control select {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.background-control select:hover {
    border-color: var(--sage);
}

.background-control select:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px var(--sage-pale);
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.platform-card {
    position: relative;
    cursor: pointer;
}

.platform-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.card-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: var(--transition);
}

.platform-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.platform-card:hover .card-content {
    border-color: var(--sage-light);
    background: var(--sage-pale);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.platform-card input[type="checkbox"]:checked + .card-content {
    background: linear-gradient(135deg, var(--sage-pale), #d4e8dd);
    border-color: var(--sage);
    box-shadow: 0 4px 16px rgba(125, 155, 140, 0.2);
}

/* Checkmark indicator */
.platform-card input[type="checkbox"]:checked + .card-content::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: var(--sage);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(125, 155, 140, 0.4);
}

.platform-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.8125rem;
    margin-bottom: 4px;
    text-align: center;
}

.platform-size {
    font-size: 0.6875rem;
    color: var(--text-light);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Process Button */
.process-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--sage), var(--sage-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px 32px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(125, 155, 140, 0.3);
}

.process-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(125, 155, 140, 0.4);
}

.process-btn:active {
    transform: translateY(-1px);
}

.process-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.platform-toggle-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.platform-toggle-links a {
    color: var(--sage-dark);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.platform-toggle-links a:hover {
    color: var(--sage);
    text-decoration: underline;
}

.platform-toggle-links span {
    color: var(--text-light);
}

.process-btn span {
    font-size: 1.25rem;
}

/* Preview Section */
.preview-section {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-soft);
}

.preview-section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-bottom: 28px;
    font-weight: 500;
    text-align: center;
}

.download-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 28px;
    background: linear-gradient(135deg, var(--sage), var(--sage-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(125, 155, 140, 0.3);
}

.download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(125, 155, 140, 0.4);
}

.download-all-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.preview-group-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 4px 4px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.preview-group-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    overflow-wrap: anywhere;
}

.preview-group-header span {
    color: var(--text-light);
    font-size: 0.8125rem;
    font-weight: 500;
}

.group-download-btn {
    margin-left: auto;
    background: var(--white);
    color: var(--sage-dark);
    border: 2px solid var(--sage);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
}

.group-download-btn:hover {
    background: var(--sage);
    color: var(--white);
}

.preview-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

.preview-card:hover {
    border-color: var(--sage-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.preview-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--bg-warm), var(--border-light));
    display: block;
}

.preview-info {
    padding: 16px;
}

.preview-info h4 {
    color: var(--text-dark);
    font-size: 0.9375rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.preview-info p {
    color: var(--text-light);
    font-size: 0.75rem;
    margin-bottom: 0;
}

.preview-info p.actual-size {
    font-weight: 600;
    color: var(--text-medium);
    font-variant-numeric: tabular-nums;
    margin-bottom: 12px;
}

.download-btn {
    width: 100%;
    background: var(--white);
    color: var(--sage-dark);
    border: 2px solid var(--sage);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.download-btn:hover {
    background: var(--sage);
    color: var(--white);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    background: var(--white);
    color: var(--sage-dark);
}

.download-note {
    color: var(--text-light);
    font-size: 0.9375rem;
    text-align: center;
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}

/* Footer */
.brand-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.brand-footer a {
    color: var(--sage);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.brand-footer a:hover {
    color: var(--sage-dark);
}

/* Inline notices (replace alert/confirm — those are blocked in embedded iframes) */
.notice {
    position: relative;
    background: var(--gold-light);
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 14px 44px 14px 16px;
    margin-bottom: 16px;
    color: var(--text-dark);
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-line;
    animation: fadeIn 0.3s ease;
}

.notice-error {
    background: var(--blush);
    border-color: var(--blush-dark);
}

.notice p {
    margin: 0;
}

.notice-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-medium);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
}

.notice-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

.notice-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.notice-btn {
    border: 2px solid var(--border-medium);
    background: var(--white);
    color: var(--text-medium);
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.notice-yes {
    border-color: var(--sage);
    color: var(--sage-dark);
}

.notice-yes:hover {
    background: var(--sage);
    color: var(--white);
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-light);
    border-top-color: var(--sage);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: var(--text-medium);
    font-size: 1rem;
    margin-top: 20px;
    font-weight: 500;
    max-width: 80%;
    text-align: center;
}

.cancel-btn {
    margin-top: 20px;
    background: var(--white);
    color: var(--text-medium);
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.cancel-btn:hover {
    border-color: var(--blush-dark);
    color: var(--blush-dark);
}

.cancel-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-card:nth-child(1) { animation-delay: 0.02s; }
.preview-card:nth-child(2) { animation-delay: 0.04s; }
.preview-card:nth-child(3) { animation-delay: 0.06s; }
.preview-card:nth-child(4) { animation-delay: 0.08s; }
.preview-card:nth-child(5) { animation-delay: 0.1s; }
.preview-card:nth-child(6) { animation-delay: 0.12s; }
.preview-card:nth-child(7) { animation-delay: 0.14s; }
.preview-card:nth-child(8) { animation-delay: 0.16s; }
.preview-card:nth-child(9) { animation-delay: 0.18s; }
.preview-card:nth-child(10) { animation-delay: 0.2s; }

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 24px 16px;
    }

    header {
        margin-bottom: 32px;
    }

    header h1 {
        font-size: 2.25rem;
    }

    header p {
        font-size: 1rem;
    }

    .platform-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .card-content {
        padding: 16px 12px;
    }

    .preview-grid {
        grid-template-columns: 1fr;
    }

    .upload-area {
        padding: 48px 24px;
    }

    .platform-selection,
    .preview-section {
        padding: 24px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
