/* Scope overrides to the attachment UI; preserve existing PIN and Dropzone styles elsewhere. */
#imageDropzone {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: .75rem;
    padding: 1rem;
}
#imageDropzone .dz-message {
    grid-column: 1 / -1;
    margin: 1rem 0;
}
#imageDropzone .image-preview-tile {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: .375rem;
    border: 1px solid #e9e9e9;
    border-radius: .75rem;
    background: #fff;
}
#imageDropzone .image-preview-tile .dz-image {
    width: 100%;
    height: 128px;
    border-radius: .5rem;
    background: #f7f7f7;
    cursor: zoom-in;
}
#imageDropzone .image-preview-tile .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: none;
    filter: none;
}
#imageDropzone .image-preview-name {
    overflow: hidden;
    margin-top: .375rem;
    font-size: .65rem;
    color: #777;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#imageDropzone .image-remove {
    position: absolute;
    top: .5rem;
    right: .5rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
#imageDropzone .image-preview-tile .dz-progress {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: 3px;
    margin: .375rem 0 0;
    transform: none;
}
#imageDropzone .image-preview-tile .dz-error-message {
    position: static;
    display: none;
    width: auto;
    margin-top: .375rem;
    padding: .375rem;
    opacity: 1;
    font-size: .65rem;
    overflow-wrap: anywhere;
    pointer-events: auto;
}
#imageDropzone .image-preview-tile.dz-error .dz-error-message {
    display: block;
}
#imageDropzone .image-preview-tile .dz-error-message::after {
    display: none;
}
#imageUploadBox .image-amount-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8rem;
    gap: .5rem;
}
#imageTotalAmount {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-radius: 1rem;
    background: #f7f7f7;
    padding: .70rem .75rem;
    text-align: center;
    font-size: .75rem;
}
#imageTotalAmount:focus {
    outline: 1px solid var(--point-color);
}
#registerImageGroupBtn {
    padding: .70rem .75rem;
}
/* Fit the original image inside the viewport, including the close button and modal spacing. */
#imagePreviewModal .modal-dialog {
    width: calc(100% - 2rem);
    max-width: 960px;
    margin: 1rem auto;
    min-height: calc(100vh - 2rem);
    min-height: calc(100dvh - 2rem);
}
#imagePreviewModal .modal-content {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
}
#imagePreviewModal .modal-header {
    flex-shrink: 0;
    padding: .75rem 1rem;
}
#imagePreviewModal .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: .75rem;
    overflow: hidden;
}
#imagePreviewModal #previewImage {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 7rem);
    max-height: calc(100dvh - 7rem);
    object-fit: contain;
}
@media (max-width: 575.98px) {
    #imageUploadBox .image-amount-input-row {
        grid-template-columns: minmax(0, 1fr) 6.5rem;
    }
}
