.sgm-admin .sgm-panel {
	background: #fff;
	border: 1px solid #dcdcde;
	margin: 18px 0;
	padding: 16px 18px;
	max-width: 880px;
}

.sgm-selector {
	align-items: center;
	display: flex;
	gap: 10px;
	margin: 16px 0;
}

.sgm-selector select {
	min-width: 280px;
}

.sgm-inline-form {
	display: grid;
	gap: 6px;
	max-width: 420px;
}

.sgm-inline-form input[type="text"],
.sgm-inline-form textarea {
	width: 100%;
}

.sgm-delete-link {
	display: inline-block;
	margin-left: 10px;
	margin-top: 8px;
}

.sgm-image-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	margin-top: 18px;
}

.sgm-image-card {
	background: #fff;
	border: 1px solid #dcdcde;
	padding: 12px;
}

.sgm-image-card img {
	aspect-ratio: 4 / 3;
	background: #f6f7f7;
	display: block;
	height: auto;
	margin-bottom: 10px;
	object-fit: cover;
	width: 100%;
}

.sgm-image-card label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}

.sgm-image-card input,
.sgm-image-card textarea {
	display: block;
	font-weight: 400;
	margin-top: 3px;
	width: 100%;
}

.sgm-gallery {
	display: grid;
	gap: 16px;
	margin: 1.5rem 0;
}

.sgm-album-list {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	margin: 1.5rem 0;
}

.sgm-album-card {
	background: #fff;
	border: 1px solid #dcdcde;
	padding: 12px 12px 14px;
}

.sgm-featured-link {
	display: block;
}

.sgm-album-card-title,
.sgm-album-card-count {
	display: block;
}

.sgm-album-card-title {
	font-weight: 700;
	margin-top: 10px;
}

.sgm-album-card-caption {
	display: block;
	font-style: italic;
	line-height: 1.45;
	margin-top: 4px;
	opacity: 0.9;
}

.sgm-album-card-link {
	display: inline-block;
	margin-top: 10px;
	text-decoration: none;
}

.sgm-featured-trigger {
	background: transparent;
	border: 0;
	cursor: zoom-in;
	display: block;
	margin: 0;
	padding: 0;
	width: 100%;
}

.sgm-gallery-trigger {
	background: transparent;
	border: 0;
	cursor: zoom-in;
	display: block;
	margin: 0;
	padding: 0;
	width: 100%;
}

.sgm-featured-image,
.sgm-featured-placeholder {
	aspect-ratio: 4 / 3;
	display: block;
	width: 100%;
}

.sgm-featured-image {
	object-fit: cover;
}

.sgm-featured-placeholder {
	align-items: center;
	background: #f6f7f7;
	color: #646970;
	display: flex;
	justify-content: center;
}

.sgm-album-card-count {
	font-size: 0.9rem;
	margin-top: 8px;
	opacity: 0.72;
}

.sgm-back-link {
	display: inline-block;
	margin-bottom: 1rem;
}

.sgm-gallery-description,
.sgm-album-description {
	margin-bottom: 1rem;
}

.sgm-modal {
	align-items: center;
	inset: 0;
	display: flex;
	justify-content: center;
	position: fixed;
	z-index: 2147483647;
}

.sgm-modal[hidden] {
	display: none;
}

.sgm-modal-backdrop {
	background: rgba(0, 0, 0, 0.82);
	inset: 0;
	position: absolute;
	z-index: 0;
}

.sgm-modal-dialog {
	background: #111;
	color: #fff;
	margin: 24px;
	max-height: calc(100vh - 48px);
	max-width: min(96vw, 1200px);
	overflow: auto;
	padding: 14px;
	position: relative;
	z-index: 1;
	width: 100%;
}

.sgm-modal-close {
	align-items: center;
	background: rgba(58, 58, 58, 0.96);
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 30px;
	height: 34px;
	line-height: 1;
	justify-content: center;
	position: absolute;
	right: 12px;
	top: 12px;
	width: 34px;
}

.sgm-modal-close:hover,
.sgm-modal-close:focus-visible {
	background: rgba(72, 72, 72, 0.98);
	outline: 0;
}

.sgm-modal-image {
	display: block;
	height: auto;
	max-height: calc(100vh - 160px);
	object-fit: contain;
	width: 100%;
}

.sgm-modal-meta {
	padding: 10px 4px 4px;
}

.sgm-modal-title {
	margin: 0;
}

.sgm-modal-caption {
	font-style: italic;
	margin: 6px 0 0;
	opacity: 0.9;
}

body.sgm-modal-open {
	overflow: hidden;
}

.sgm-columns-1 {
	grid-template-columns: 1fr;
}

.sgm-columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sgm-columns-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sgm-columns-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sgm-columns-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.sgm-columns-6 {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.sgm-gallery-item {
	margin: 0;
}

.sgm-gallery-item img {
	aspect-ratio: 4 / 3;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.sgm-gallery-item figcaption {
	font-size: 0.9rem;
	line-height: 1.4;
	margin-top: 6px;
}

.sgm-gallery-item-title {
	display: block;
	font-weight: 700;
}

.sgm-gallery-item-caption {
	display: block;
	font-style: italic;
	margin-top: 3px;
}

@media (max-width: 720px) {
	.sgm-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 460px) {
	.sgm-gallery {
		grid-template-columns: 1fr;
	}
}
