/* Shared “Your photos” picker — same pattern as Images face history */

.mds-photo-history-modal {
	position: fixed;
	inset: 0;
	z-index: 99900;
	display: flex;
	align-items: center;
	justify-content: center;
}
.mds-photo-history-modal[hidden] {
	display: none;
}
.mds-photo-history-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	cursor: pointer;
}
.mds-photo-history-modal__panel {
	position: relative;
	z-index: 1;
	background: var(--mds-bg-card, var(--theme-color-alter_bg_color));
	border: 1px solid var(--mds-border, var(--theme-color-bd_color));
	border-radius: var(--mds-radius, 14px);
	width: min(92vw, 560px);
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.mds-photo-history-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px 12px;
	border-bottom: 1px solid var(--mds-bd, var(--theme-color-bd_color));
}
.mds-photo-history-modal__heading {
	flex: 1;
	min-width: 0;
}
.mds-photo-history-modal__title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--mds-text-dark, var(--theme-color-text_dark));
	margin: 0;
}
.mds-photo-history-modal__subtitle {
	margin: 4px 0 0;
	font-size: 0.82em;
	color: var(--mds-text-muted, var(--theme-color-text));
	line-height: 1.4;
}
.mds-photo-history-modal__close {
	background: none;
	border: none;
	color: var(--mds-text-muted, var(--theme-color-text));
	cursor: pointer;
	font-size: 1.1em;
	line-height: 1;
	padding: 4px;
}
.mds-photo-history-modal__close:hover {
	color: var(--mds-text, var(--theme-color-text));
}
.mds-photo-history-modal__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 8px;
	padding: 16px 20px;
	overflow-y: auto;
	flex: 1;
}
.mds-photo-history-item {
	position: relative;
	aspect-ratio: 1;
}
.mds-photo-history-thumb {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: var(--mds-radius-sm, 8px);
	overflow: hidden;
	cursor: pointer;
	border: none;
	padding: 0;
	background: var(--theme-color-alter_bg_color, var(--mds-bg-card));
	transition: box-shadow 0.15s;
}
.mds-photo-history-thumb:hover,
.mds-photo-history-thumb:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px var(--mds-accent, var(--theme-color-text_link));
	border-radius: var(--mds-radius-sm, 8px);
}
.mds-photo-history-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.mds-photo-history-delete {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 22px;
	height: 22px;
	border: none;
	border-radius: 50%;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
}
.mds-photo-history-item:hover .mds-photo-history-delete,
.mds-photo-history-delete:focus-visible {
	opacity: 1;
}
.mds-photo-history-delete:hover,
.mds-photo-history-delete:focus-visible {
	background: rgba(0, 0, 0, 0.78);
}
@media (hover: none) {
	.mds-photo-history-delete { opacity: 1; }
}
.mds-photo-history-empty {
	margin: 0;
	color: var(--mds-text-muted, var(--theme-color-text));
	text-align: center;
	grid-column: 1 / -1;
	padding: 20px 0;
}
.mds-photo-history-modal__footer {
	padding: 12px 20px 16px;
	border-top: 1px solid var(--mds-bd, var(--theme-color-bd_color));
	display: flex;
	justify-content: flex-end;
}
