.mpow-trigger {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: calc(100vw - 32px);
	min-height: 48px;
	padding: 12px 18px;
	border: 1px solid #111;
	border-radius: 999px;
	background: #111;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.24);
	color: #fff !important;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	text-decoration: none !important;
	transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

body.home .mpow-trigger {
	right: 180px;
}

.mpow-trigger:hover,
.mpow-trigger:focus-visible {
	background: #fff;
	color: #111 !important;
}

.mpow-trigger:focus-visible,
.mpow-dialog button:focus-visible,
.mpow-dialog a:focus-visible {
	outline: 3px solid #42aaff;
	outline-offset: 3px;
}

/* Keep the withdrawal dialog hidden until the floating trigger opens it. */
dialog.mpow-dialog:not([open]) {
	display: none !important;
}

.mpow-dialog {
	width: min(760px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 18px 70px rgba(0, 0, 0, 0.32);
	color: #202020;
}

.mpow-dialog::backdrop {
	background: rgba(0, 0, 0, 0.62);
}

.mpow-dialog__panel {
	display: flex;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	flex-direction: column;
}

.mpow-dialog__header {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	border-bottom: 1px solid #e5e5e5;
	background: #fff;
	color: #202020;
}

.mpow-dialog__title {
	margin: 0;
	color: inherit;
	font: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.mpow-dialog__close {
	position: relative;
	top: auto;
	right: auto;
	display: inline-flex;
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid #d4d4d4;
	border-radius: 50%;
	background: #fff;
	color: #111;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
}

.mpow-dialog__body {
	min-height: 120px;
	padding: 20px;
	overflow: auto;
	overscroll-behavior: contain;
}

.mpow-dialog__status,
.mpow-dialog__error {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: 4px;
}

.mpow-dialog__status {
	background: #f2f5f7;
	color: #202020;
}

.mpow-dialog__error {
	background: #fceeee;
	color: #8a1c1c;
}

.mpow-dialog__footer {
	flex: 0 0 auto;
	padding: 12px 20px;
	border-top: 1px solid #e5e5e5;
	background: #fff;
	color: #202020;
	font-size: 14px;
}

.mpow-dialog__footer a {
	color: #002a5c !important;
	text-decoration: underline;
}

.mpow-dialog__form .form-row {
	float: none;
	width: 100%;
	margin: 0 0 14px;
}

.mpow-dialog__form .form-row::before,
.mpow-dialog__form .form-row::after {
	display: none;
}

.mpow-dialog__form .form-row:not(.form-row-submit) > label {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
}

.mpow-dialog__form input:not([type="checkbox"]):not([type="radio"]),
.mpow-dialog__form select,
.mpow-dialog__form textarea {
	box-sizing: border-box;
	width: 100% !important;
	min-height: 44px;
	padding: 9px 11px;
	border: 1px solid #aeb4bb;
	border-radius: 4px;
	background: #fff;
	color: #202020;
	font: inherit;
}

.mpow-dialog__form .form-row-submit .button {
	min-height: 46px;
	padding: 11px 18px;
	border: 1px solid #111;
	border-radius: 4px;
	background: #111;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
}

.mpow-dialog__form .woocommerce-form__label-for-checkbox {
	display: flex !important;
	align-items: flex-start;
	gap: 8px;
}

.mpow-dialog__form input[type="checkbox"],
.mpow-dialog__form input[type="radio"] {
	width: auto !important;
	min-height: 0;
	margin-top: 4px;
}

.mpow-dialog__form .eu-owb-order-item-select-wrapper {
	overflow-x: auto;
}

html.mpow-dialog-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.mpow-trigger {
		right: max(12px, env(safe-area-inset-right));
		bottom: max(12px, env(safe-area-inset-bottom));
		min-height: 44px;
		padding: 10px 14px;
		font-size: 14px;
	}

	body.home .mpow-trigger {
		right: 120px;
	}

	.mpow-dialog {
		width: calc(100vw - 16px);
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
		border-radius: 10px;
	}

	.mpow-dialog__panel {
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
	}

	.mpow-dialog__header,
	.mpow-dialog__body {
		padding: 14px;
	}

	.mpow-dialog__footer {
		padding: 10px 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mpow-trigger {
		transition: none;
	}
}
