.system-file-row {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.system-file-details {
    min-width: 0;
    flex: 1 1 14rem;
    overflow-wrap: anywhere;
}

.system-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.system-file-preview {
    display: block;
    width: 100%;
    height: min(60vh, 38rem);
    border: 0;
}

.system-file-preview-panel {
    display: grid;
    min-width: 0;
    gap: .75rem;
}

.system-file-preview-panel video {
    background: #101826;
    object-fit: contain;
}

.system-file-selected-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.system-upload-control {
    display: grid;
    min-width: 0;
    max-width: 100%;
    gap: .5rem;
}

.system-upload-selection:empty,
.system-upload-status:empty,
.system-upload-gallery:empty {
    display: none;
}

.system-upload-area,
.system-upload-image,
.system-upload-gallery-item {
    background: var(--dialog-surface);
    border: 1px solid var(--dialog-border);
    border-radius: .625rem;
}

.system-upload-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: 1rem;
    background: var(--pd-tint-subtle);
    border-style: dashed;
}

.system-upload-image {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    width: fit-content;
    max-width: 100%;
    margin-bottom: .375rem;
    padding: .625rem;
}

.system-upload-thumbnail {
    display: grid;
    place-items: center;
    width: min(clamp(3.25rem, var(--upload-thumbnail-width, 8rem), 12rem), 100%);
    min-height: 3.25rem;
    border: 1px solid var(--dialog-border);
    border-radius: .375rem;
    background: var(--pd-tint-subtle);
    overflow: hidden;
    cursor: pointer;
}

.system-upload-thumbnail > img {
    display: block;
    width: 100% !important;
    max-height: 6.5rem;
    height: auto !important;
    object-fit: contain;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.system-upload-placeholder {
    border-style: dashed;
}

.system-upload-thumbnail:focus-visible,
.system-upload-gallery-preview:focus-visible {
    outline: 2px solid var(--pd-accent);
    outline-offset: 2px;
}

.system-file-identity {
    display: flex;
    align-items: center;
    flex: 1 1 15rem;
    min-width: 0;
    gap: .75rem;
}

.system-file-kind {
    display: grid;
    flex: 0 0 2.375rem;
    height: 2.375rem;
    place-items: center;
    border-radius: .5rem;
    color: var(--pd-accent-dark);
    background: var(--pd-tint-subtle);
}

.system-upload-gallery {
    margin-top: .625rem;
}

.system-upload-gallery-item {
    display: grid;
    width: 100%;
    gap: .5rem;
    padding: .375rem;
}

.system-upload-gallery-preview {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 0;
    border-radius: .375rem;
    background: var(--pd-tint-subtle);
    overflow: hidden;
}

.system-upload-gallery-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.system-avatar-thumbnail {
    background: var(--pd-tint-subtle);
    border: 1px solid var(--dialog-border);
    object-fit: cover;
}

.system-upload-inline,
.input-group:has(.select-img, [class*="select-img-"]) {
    flex-wrap: wrap;
    gap: .5rem;
}

.input-group:has(.select-img, [class*="select-img-"]) > .form-control {
    min-width: min(100%, 10rem);
    border-radius: .375rem;
}

.system-upload-inline .input-group-append,
.input-group:has(.select-img, [class*="select-img-"]) .input-group-append {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    margin-left: 0;
}

.system-upload-inline .btn,
.input-group:has(.select-img, [class*="select-img-"]) .btn {
    margin: 0 !important;
    border-radius: .375rem !important;
}

.pay-event-image-preview {
    display: inline-grid;
    width: 2.375rem;
    height: 2.375rem;
    place-items: center;
    padding: .125rem;
    border: 1px solid var(--dialog-border);
    border-radius: .375rem;
    background: var(--pd-tint-subtle);
    cursor: pointer;
}

.pay-event-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
