:root {
	--scrollbar: 0px;
}
@media (pointer: fine) {
	:root {
		--scrollbar: 15px;
	}
}
html.dialog-opened { overflow: hidden; padding-right: var(--scrollbar); }
html.dialog-opened #menu { right: var(--scrollbar); }

.dialog {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	height: 100svh;
	max-height: 100svh;
	margin: 0;
	overflow: hidden scroll;
	border: none;
	background: transparent;
	position: fixed;
	inset: 0;
	z-index: 999;
}
.dialog.open {
	display: flex;
	align-items: center;
	flex-direction: column;
}
.dialog::backdrop {
	transition: 0.2s;
	background: rgba(0, 0, 0, 0);
}
.dialog.open::backdrop {
	transition: 0.3s;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(10px);
}
.dialog .dialog-wrap {
	background: #fff;
	border-radius: 20px;
	width: min(100vw - 30px, 560px);
	margin: auto;
	opacity: 0;
	transition: opacity 0.2s;
	position: relative;
	z-index: 1000;
	padding: 32px;
}
.dialog .dialog-wrap h2 {
	margin: 0;
}
.dialog .dialog-wrap.open {
	opacity: 1;
	transition: opacity 0.4s;
}
.dialog:where(.dialog-img, .dialog-yt) .dialog-wrap > *:where(img, iframe) {
	border: none;
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 20px;
}
.dialog.dialog-yt .dialog-wrap > iframe {
	width: min(100vw - 30px, 1280px);
	aspect-ratio: 1280/720;
}
.dialog .dialog-close {
	color: #312d89;
	border-radius: 20px;
	border: none;
	background: transparent;
	position: absolute;
	inset: 16px 16px auto auto;
	padding: 0;
	width: 32px;
	height: 32px;
	font: 400 26px/33px sans-serif;
	cursor: pointer;
	margin: 0;
}
.dialog .dialog-close:hover {
	color: #ff5b2e;
}