.wpm-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease, visibility 0s linear .25s;
}

.wpm-modal.wpm-is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transition: opacity .25s ease;
}

.wpm-overlay {
	position: absolute;
	inset: 0;
	background: var(--wpm-overlay, rgba(0, 0, 0, .6));
}

.wpm-dialog {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--wpm-width, 600px);
	max-height: calc(100vh - 32px);
	overflow: auto;
	background: var(--wpm-bg, #fff);
	border-radius: 8px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
	transform: translateY(16px) scale(.98);
	transition: transform .25s ease;
	outline: none;
	-webkit-overflow-scrolling: touch;
}

.wpm-is-open .wpm-dialog {
	transform: none;
}

.wpm-content {
	padding: var(--wpm-padding, 24px);
}

.wpm-content > :first-child { margin-top: 0; }
.wpm-content > :last-child { margin-bottom: 0; }

.wpm-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .85);
	color: #111;
	font: 400 24px/32px sans-serif;
	text-align: center;
	cursor: pointer;
	box-shadow: none;
}

.wpm-close:hover,
.wpm-close:focus-visible {
	background: #fff;
	color: #000;
}

/* Positions */
.wpm-pos-top { align-items: flex-start; }

.wpm-pos-bottom-right,
.wpm-pos-bottom-left {
	align-items: flex-end;
	pointer-events: none !important;
}
.wpm-pos-bottom-right { justify-content: flex-end; }
.wpm-pos-bottom-left { justify-content: flex-start; }
.wpm-pos-bottom-right .wpm-overlay,
.wpm-pos-bottom-left .wpm-overlay { display: none; }
.wpm-pos-bottom-right.wpm-is-open .wpm-dialog,
.wpm-pos-bottom-left.wpm-is-open .wpm-dialog { pointer-events: auto; }

html.wpm-locked,
html.wpm-locked body {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.wpm-modal,
	.wpm-dialog {
		transition: none;
	}
}
