#pai-popup:not([open]) {
	display: none;
}

#pai-popup[open] {
	display: grid;
	place-items: center;
}

#pai-popup {
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	width: max-content;
	height: max-content;
	min-width: 60px;
	min-height: 60px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 16px 64px rgb(0 0 0 / 24%);
}

#pai-popup::backdrop {
	background: rgb(0 0 0 / 58%);
}

#pai-popup .pai-popup-image {
	display: block;
	width: auto;
	height: auto;
	max-width: min(900px, calc(100vw - 32px));
	max-height: min(84vh, calc(100vh - 32px));
	max-height: min(84dvh, calc(100dvh - 32px));
	margin: 0;
	border: 0;
}

#pai-popup .pai-popup-close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #242424;
	color: #fff;
	font: 28px / 1 sans-serif;
	cursor: pointer;
}

#pai-popup .pai-popup-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}
