.gallery-preview {
    overflow: hidden;
    width: 100%;
    padding: 20px;
}
.gallery-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: scroll 30s linear infinite;
}
.gallery-track img {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}
.gallery-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.gallery {
    padding: 1.5rem;
}

.gallery-controls {
    max-width: 680px;
    margin-bottom: 1.25rem;
}

.gallery-note {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.gallery-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.gallery-upload input[type="file"] {
    max-width: 100%;
}

.gallery-upload button {
    border: 0;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    background: #1f6feb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.gallery-upload button:hover {
    background: #195dc3;
}

.upload-message {
    min-height: 1.3rem;
    margin-top: 0.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-item {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    background: #fff;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.gallery-empty {
    grid-column: 1 / -1;
    margin: 0;
}

@media (max-width: 640px) {
    .gallery {
        padding: 1rem;
    }

    .gallery-upload {
        align-items: stretch;
    }

    .gallery-upload button {
        width: 100%;
    }

    .gallery-item img {
        height: 180px;
    }
}