.ter-popup[hidden] {
	display: none !important;
}

.ter-popup {
	position: fixed;
	inset: 0;
	z-index: 2147483600;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	padding: 16px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 220ms ease;
}

.ter-popup *,
.ter-popup *::before,
.ter-popup *::after {
	box-sizing: border-box;
}

.ter-popup.is-open {
	opacity: 1;
	pointer-events: auto;
}

.ter-popup__overlay {
	position: absolute;
	inset: 0;
	background: var(--ter-popup-overlay, #000);
	opacity: var(--ter-popup-overlay-opacity, .72);
}

.ter-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(var(--ter-popup-width, 720px), calc(100vw - 32px));
	max-height: calc(100dvh - 32px);
	overflow: visible;
	outline: none;
	transition: opacity 220ms ease, transform 220ms ease;
}

.ter-popup__content {
	max-height: calc(100dvh - 32px);
	overflow: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.ter-popup button.ter-popup__close[type="button"] {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;
	display: grid !important;
	place-items: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	color: var(--ter-popup-close-color, #111) !important;
	box-shadow: none !important;
	cursor: pointer;
	appearance: none;
	transition: transform 160ms ease, opacity 160ms ease;
}

.ter-popup button.ter-popup__close[type="button"]:hover {
	background: transparent !important;
	background-color: transparent !important;
	color: var(--ter-popup-close-color, #111) !important;
	transform: scale(1.06);
}

.ter-popup button.ter-popup__close[type="button"]:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

.ter-popup__close-surface {
	display: grid !important;
	place-items: center;
	width: 42px !important;
	height: 42px !important;
	border-radius: 999px !important;
	background: var(--ter-popup-close-background, #FDCB04) !important;
	background-color: var(--ter-popup-close-background, #FDCB04) !important;
	box-shadow: 0 4px 18px rgb(0 0 0 / 18%) !important;
	pointer-events: none;
}

.ter-popup__close-surface svg {
	display: block;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 2;
}

.ter-popup--fade .ter-popup__dialog {
	opacity: 0;
}

.ter-popup--fade.is-open .ter-popup__dialog {
	opacity: 1;
}

.ter-popup--scale .ter-popup__dialog {
	opacity: 0;
	transform: scale(.94);
}

.ter-popup--scale.is-open .ter-popup__dialog {
	opacity: 1;
	transform: scale(1);
}

.ter-popup--slide .ter-popup__dialog {
	opacity: 0;
	transform: translateY(28px);
}

.ter-popup--slide.is-open .ter-popup__dialog {
	opacity: 1;
	transform: translateY(0);
}

html.ter-popup-scroll-locked,
html.ter-popup-scroll-locked body {
	overflow: hidden !important;
}

@media (max-width: 767px) {
	.ter-popup {
		padding: 12px;
	}

	.ter-popup__dialog {
		width: min(var(--ter-popup-width, 720px), calc(100vw - 24px));
		max-height: calc(100dvh - 24px);
	}

	.ter-popup__content {
		max-height: calc(100dvh - 24px);
	}

	.ter-popup button.ter-popup__close[type="button"] {
		top: 8px;
		right: 8px;
		width: 40px;
		height: 40px;
	}

	.ter-popup__close-surface {
		width: 40px !important;
		height: 40px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ter-popup,
	.ter-popup__dialog,
	.ter-popup__close {
		transition-duration: 1ms !important;
	}
}
