.cGalleryDialog {
	display: flex;
	flex-direction: column;
	position: relative;
	/* min-height: min(550px, 90svh); */
}

	.cGalleryDialog_inner{
		flex: 1 1 auto;
		display: flex;
	}

	.cGalleryDialog_primary{
		flex: 999 1 60%;
		display: flex;
		flex-direction: column;
	}

	.cGalleryDialog_title{
		flex: 0 0 auto;
		padding: var(--i-sp_3);
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.cGalleryDialog_imageFormAlign{
		height: 100%;
		display: flex;
		flex-direction: column;
	}

	#elGallerySubmit_toolBar{
		padding: 1em;
		background: var(--i-background_3);
		flex: 0 0 auto;
		position: sticky;
		top: 0;
		z-index: 2;
	}

	.cGallerySubmit_imageDetails {
		flex: 1 1 400px;
		overflow: auto;
		background: var(--i-background_2);
	}

	.cGalleryDialog:not(.cGalleryDialog_uploadStep) .cGallerySubmit_imageDetails {
		display: none;
	}

	.cGallerySubmit_imageDetails .ipsAttachment_dropZone [data-action="uploadFile"] {
		margin: 0 0 10px 0;
		width: 100%;
	}

	.cGallerySubmit_imageDetails .ipsAttachment_dropZone.ipsAttachment_dropZoneSmall {
		padding: 5px;
	}

	.cGallerySubmit_imageDetails .ipsSubmitRow{
		position: -webkit-sticky;
		position: sticky;
		bottom: 0;
	}

.cGallerySubmit_preview {
	height: 190px;
	aspect-ratio: auto;
	text-align: center;
}

.cGallerySubmit_preview .ipsThumb img{
	object-fit: contain;
}

.cGalleryDialog .ipsDialog_title {
	padding: 0;
}

.cGalleryDialog_close {
	font-size: 40px;
	line-height: 1;
	display: none; /* Hide the close icon if the form is viewed via /submit/ instead of a dialog */
}

	.ipsDialog_content .cGalleryDialog_close {
		/* display: block; */
	}


#elFileTypes_menu strong {
	display: none;
}

/* Step 1: Choose album */
.ipsDialog .cGalleryChooseAlbum_wrap{
	display: contents;
}

	.cGalleryChooseAlbum_list {
		flex: 1 1 auto;
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 0 2em 2em 2em;
	}

	.cGalleryChooseAlbum_list > ul {
		width: min(100% - 30px, 450px);
	}

.cGalleryChooseAlbum_listItem {
	display: block;
	background: var(--i-background_2);
	padding: 1.4em;
	padding-inline-end: 40px;
	margin-bottom: 1em;
	border-radius: 6px;
	position: relative;
}
	
	.cGalleryChooseAlbum_listItem[data-disabled] {
		opacity: .7;
		cursor: not-allowed;
	}

		.cGalleryChooseAlbum_listItem[data-disabled] .ipsTitle {
			color: var(--i-color_soft);
		}

	.cGalleryChooseAlbum_listItem:not([data-disabled])::after {
		font-family: var(--i-font-awesome);
		-webkit-font-smoothing: antialiased;
		text-rendering: auto;
		font-weight: 900;
		content: '\f061';
		position: absolute;
		inset-inline-end: 1.2em;
		top: 50%;
		font-size: 1.4em;
		transform: translateY(-50%);
		color: var(--i-color_soft);
	}

	.cGalleryChooseAlbum_listItem:not([data-disabled]):hover {
		background: var(--i-background_3);
	}

.cGalleryChooseAlbum_listItem .ipsTitle {
	font-size: var(--i-font-size_2);
}

/* Dialog: Choose Category */
.cGallerySubmit_albumChoice {
	padding: 5em 1em;
}

	.cGallerySubmit_albumChoice .ipsSelectTree {
		margin: auto;
	}

/* Dialog: Choose Existing Album */
#elGallerySubmit_albumChooser{
	max-height: 60vh;
	display: flex;
	flex-direction: column;
	gap: 1em;
	padding: 0 2em 2em 2em;
}
#elGallerySubmit_albumChooser > li{
	position: relative;
	flex: 0 0 auto;
}

#elGallerySubmit_albumChooser [type="radio"]{
	position: absolute;
	opacity: 0;
}

#elGallerySubmit_albumChooser > li > div {
	background: var(--i-background_2);
	padding: 1.4em;
	border-radius: min(var(--i-design-radius), 6px);
}

	#elGallerySubmit_albumChooser > li > div:hover {
		background: var(--i-background_3);
	}

#elGallerySubmit_albumChooser label{
	position: absolute;
	inset: 0;
	cursor: pointer;
}

#elGallerySubmit_albumChooser > li > [type="radio"]:checked + div {
	background: var(--i-primary);
	color: var(--i-primary-contrast);
}

	#elGallerySubmit_albumChooser > li > [type="radio"]:checked + div .i-color_soft {
		color: inherit;
		opacity: 0.7;
	}

/* Choose Existing Album */
[data-role="existingAlbumForm"]{
	display: contents;
}
.cGalleryChooseAlbum{
	flex: 1 1 100%;
	display: flex;
	flex-direction: column;
}

.cGalleryDialog_container {
	display: contents;
}

.cGalleryDialog_imageForm {
	flex: 1 1 auto;
	overflow: auto;
}

.cGallerySubmit_uploadImages .ipsAttachment_dropZone:not(.ipsDragging) {
	background: var(--i-background_2);
	border-color: var(--i-background_3);
}

/* Style the uploader */
.cGallerySubmit_uploadImages .ipsAttachment_dropZone{
	display: grid;
	place-content: center;
	text-align: center;
	gap: 0;
}

.cGallerySubmit_uploadImages .ipsUploader__icon {
	font-size: 3em;
	margin-bottom: 15px;
}
	.cGallerySubmit_uploadImages .fa-cloud-upload::before {
		content: "\f055";
	}

#elGallerySubmit_imageUploader .ipsAttachment_dropZone {
	cursor: pointer;
}

.cGalleryDialog_uploadStep .ipsUploader[style*="block"]{
	display: flex !important;
	gap: var(--i-sp_3);
}

	.cGalleryDialog_uploadStep #elGallerySubmit_imageUploader .ipsAttachment_dropZone {
		flex: 1 1 200px;
		align-self: start;
		height: 200px;
		margin-bottom: 2em;
	}

	#elGallerySubmit_imageUploader a[data-action="uploadFile"] {
		display: none;
	}

	#elGallerySubmit_imageUploader .moxie-shim.moxie-shim-html5, 
	#elGallerySubmit_imageUploader .moxie-shim.moxie-shim-html5 > input[type="file"]  {
		top: 0 !important;
		left: 0 !important;
		width: 0.1px !important;
		height: 0.1px !important;
	}

.cGallerySubmit_uploadImages .ipsAttachment_fileList{
	flex: 999 1 50%;
}

/* Media thumbnail upload area */
.cGalleryThumbField .ipsAttachment_dropZoneSmall_info {
	margin-inline-start: auto !important;
}

.cGalleryThumbField [data-role="title"] {
	width: 150px;
	max-width: 150px;
}

.cGallerySubmit_fileList:empty{
	display: none !important;
}
	.cGallerySubmit_fileList {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 1em;
		padding-bottom: 2em;
	}

		.cGallerySubmit_fileList .ipsImageAttach {
			border: 1px solid var(--i-background_4);
			background: var(--i-background_2);
			cursor: move;
		}

			.cGallerySubmit_fileList .ipsImageAttach:hover {
				border-color: var(--i-background_6);
			}

			.cGallerySubmit_fileList .ipsImageAttach_thumb{
				aspect-ratio: 1;
			}

				/* Add move cursor to thumbnail */
				.cGallerySubmit_fileList .ipsImageAttach_thumb :is(img, video){
					cursor: inherit;
				}

			
		.cGallerySubmit_fileList .ipsImageAttach.cGallerySubmit_activeFile {
			border-color: var(--i-primary);
			background: var(--i-primary);
		}

		.cGallerySubmit_fileList .ipsImageAttach.cGallerySubmit_activeFile :is(.ipsAttach_title, .cGalleryImageAttach_info){
			color: var(--i-primary-contrast);
		}

		.cGalleryImageAttach_info {
			padding-inline-end: 30px;
		}

		.cGallerySubmit_fileList .ipsImageAttach.cGallerySubmit_imageSaved::before,
		.cGallerySubmit_fileList .ipsImageAttach.cGallerySubmit_imageError::before {
			width: 28px;
			height: 28px;
			border-radius: 28px;
			line-height: 28px;
			color: #fff;
			font-family: var(--i-font-awesome);
			-webkit-font-smoothing: antialiased;
			text-rendering: auto;
			font-weight: 900;
			font-size: 14px;
			position: absolute;
			bottom: 1em;
			inset-inline-end: 1em;
			text-align: center;
		}

		.cGallerySubmit_fileList .ipsImageAttach.cGallerySubmit_imageSaved::before {
			content: '\f00c';
			background: #558B2F;
		}

		.cGallerySubmit_fileList .ipsImageAttach.cGallerySubmit_imageError:not(.cGallerySubmit_activeFile) {
			border-color: #a72f35;
		}

			.cGallerySubmit_fileList .ipsImageAttach.cGallerySubmit_imageError::before {
				content: '\f071';
				background: #a72f35;
			}


@media screen and (max-width: 767px) {
	/* Image details area on mobile is fixed */
	.cGallerySubmit_imageDetails {
		position: fixed;
		inset: 0;
		z-index: 10;
	}
}