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

body {
    font-family: 'Cal Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: /* @tweakable main title size */ 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #000;
}

header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: /* @tweakable upload area border radius */ 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    max-width: 500px;
    margin: 0 auto;
}

.upload-area:hover {
    border-color: #007bff;
    background: #f0f8ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #007bff;
    background: #e6f3ff;
    transform: scale(1.02);
}

.upload-content svg {
    color: #999;
    margin-bottom: 0.75rem;
}

.upload-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.upload-content p {
    color: #666;
    font-size: 0.9rem;
}

.analysis-options {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.analysis-options h3 {
    margin-bottom: 1.5rem;
    color: #000;
}

.style-buttons {
    display: grid;
    /* @tweakable min-width of style buttons */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.style-btn {
    background: white;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    /* @tweakable vertical gap between title and description in style buttons */
    gap: 0.25rem;
}

.style-btn:hover {
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.style-btn.active {
    border-color: #007bff;
    background: #f0f8ff;
}

.style-title {
    font-weight: 600;
    color: #000;
    font-size: 1rem;
}

.style-desc {
    font-size: 0.85rem;
    color: #666;
    font-family: 'Space Mono', monospace;
}

.custom-prompt {
    margin-bottom: 1.5rem;
}

.custom-prompt label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #000;
}

.custom-prompt textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    font-family: 'Cal Sans', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
}

.custom-prompt textarea:focus {
    outline: none;
    border-color: #007bff;
}

.analysis-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
}

.analyze-btn {
    background: #000;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Cal Sans', sans-serif;
}

.analyze-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.analyze-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.style-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f0f0f0;
    border-color: #e0e6ed;
    transform: none;
    box-shadow: none;
}

.memory-toggle {
    background: #e6f3ff;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #bce0ff;
    margin-bottom: 1rem;
}

.image-preview {
    text-align: center;
    margin-bottom: 2rem;
}

.image-preview img {
    max-width: 100%;
    max-height: /* @tweakable preview image max height */ 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.memory-bank {
    margin-bottom: 2rem;
}

.memory-bank h4 {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.memory-thumbnails {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.memory-thumb-container {
    position: relative;
}

.memory-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: block;
}

.remove-thumb-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: black;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease-in-out;
}

.memory-thumb-container:hover .remove-thumb-btn {
    opacity: 1;
    transform: scale(1);
}

.results-section {
    margin-top: 2rem;
}

.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 1.1rem;
}

.analysis-result {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 2rem;
    font-family: 'Space Mono', monospace;
    font-size: /* @tweakable analysis result text size */ 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

#spinning-mango-bird {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    animation: spin 10s linear infinite;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.1s ease-out;
}

#spinning-mango-bird.clicked {
    transform: scale(0.95);
    animation-play-state: paused;
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .style-buttons {
        grid-template-columns: 1fr;
    }
    
    .analysis-controls {
        gap: 1rem;
    }
}