.image-gallery-wrapper {
    position: relative;
}

.image-gallery-popup {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
    background: white;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
    box-sizing: border-box;
    box-shadow: 0 .15em 1.5em 0 rgba(0, 0, 0, .1), 0 0 1em 0 rgba(0, 0, 0, .03);
}

.appimagegallery-icon {
    height: 24px;
    width: 24px;
    padding: 3px;
    margin: 0;
    margin-left: 4px;
    box-sizing: border-box;
    vertical-align: top;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-option {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border 0.2s;
    box-sizing: border-box;
}

.image-option.selected {
    border: 2px solid #007bff;
    background-color: #f0f8ff;
}

.gallery-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.gallery-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.image-gallery-popup input[type="text"] {
    width: 100%;
    padding: 4px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    box-sizing: border-box;
}
