body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
header { text-align: center; margin-bottom: 30px; }
header h1 { font-size: 2.5em; color: #2c3e50; margin-bottom: 0.2em; }
main { display: flex; gap: 30px; width: 100%; max-width: 1200px; }
.panel { background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); padding: 25px; flex: 1; display: flex; flex-direction: column; }
.panel h2 { margin-top: 0; border-bottom: 1px solid #e0e0e0; padding-bottom: 15px; margin-bottom: 20px; color: #34495e; }
.image-placeholder {
    width: 100%;
    /* aspect-ratio: 1 / 1; <--- DELETE THIS LINE */
    background-color: #ecf0f1;
    border: 2px dashed #bdc3c7;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    min-height: 200px; /* Add a minimum height for the empty state */
}
.image-placeholder span, .image-placeholder .info-text { color: #7f8c8d; text-align: center; }
.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* <--- CHANGE 'cover' TO 'contain' */
}
.button { display: inline-block; padding: 12px 20px; border: none; border-radius: 5px; font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; transition: background-color 0.2s; background-color: #3498db; color: white; width: 100%; box-sizing: border-box; }
.button:hover { background-color: #2980b9; }
.button:disabled { background-color: #bdc3c7; cursor: not-allowed; }
#download-link { background-color: #2ecc71; }
#download-link:hover { background-color: #27ae60; }
.loader { border: 6px solid #f3f3f3; border-top: 6px solid #3498db; border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media (max-width: 768px) { main { flex-direction: column; } }
