.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px auto;
}

.preview-container {
    position: relative;
    width: 90px;
    height: 120px;
    border: 2px dashed #ccc;
    overflow: hidden;
    border-radius: 10px;
    background-color: #f5f5f5;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 18px;
}

.plus-icon {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    width: 20px;
    height: 20px;
    bottom: 0px;
    right: 0px;
    cursor: pointer;
    border-radius: 50%;
    background-color: red;
}

.plus_icon {
    font-size: 24px;
    color: #ccc;
}

.close-button {
    position: absolute;
    top: 0px;
    right: 5px;
    cursor: pointer;
    font-size: 24px;
    color: red;
}

.image-wrapper {
    width: 300px;
    display: flex;
    flex-direction: column;
}

.image-wrapper input {
    width: 100%;
    margin-top: 5px;
    border: 2px dashed #ccc;
    height: 50px;
    border-radius: 5px;
    padding: 10px;
}

.image-wrapper input::placeholder {
    color: #ccc;
    opacity: 1;
}

/* ================= MODE: 360 × 800 ONLY ================= */
@media (max-width: 390px) {

    .grid-container {
        grid-template-columns: repeat(3, 1fr) !important;
        padding-left: 14px;
        padding-right: 14px;
        gap: 18px;
    }

    .preview-container {
        width: 100% !important;
        height: 100px !important;
    }

}

/* =====================================================
   768 x 1024 ONLY — tighten profile grid spacing
   ===================================================== */
@media (width: 768px) and (height: 1024px) {

    .main-profile-photo,
    .preview-container,
    .preview-image {
        width: 118px !important;
        min-width: 118px !important;
        max-width: 118px !important;
        height: 118px !important;
        min-height: 118px !important;
        max-height: 118px !important;
        object-fit: cover !important;
        border-radius: 10px !important;
        display: block !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #photoGallery.grid-container,
    .grid-container {
        display: grid !important;
        grid-template-columns: repeat(3, 118px) !important;
        grid-auto-rows: 118px !important;
        column-gap: 6px !important;
        row-gap: 6px !important;
        justify-content: start !important;
        justify-items: start !important;
        align-items: start !important;
        align-content: start !important;
        width: auto !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 0 56px 0 !important;
    }

    .preview-container {
        position: relative !important;
    }
}

/* =====================================================
   1280 x 800 ONLY — profile photo + 3x3 grid same size
   ===================================================== */
@media (width: 1280px) and (height: 800px) {

    .main-profile-photo,
    .preview-container,
    .preview-image {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
        object-fit: cover !important;
        border-radius: 10px !important;
        display: block !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #photoGallery.grid-container,
    .grid-container {
        display: grid !important;
        grid-template-columns: repeat(3, 120px) !important;
        grid-auto-rows: 120px !important;
        column-gap: 20px !important;
        row-gap: 20px !important;
        justify-content: start !important;
        justify-items: start !important;
        align-items: start !important;
        align-content: start !important;
        width: auto !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
    }

    .preview-container {
        position: relative !important;
    }
}