.mgs-trigger {
	color: inherit;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

.mgs-trigger:hover,
.mgs-trigger:focus-visible {
	text-decoration-style: solid;
}

.mgs-dialog {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity 0.18s ease;
}

.mgs-dialog[hidden] {
	display: none;
}

.mgs-dialog.is-open {
	opacity: 1;
}

.mgs-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}

.mgs-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(920px, 100%);
	height: min(90vh, 1100px);
	background: #fff;
	color: #1f2937;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	transform: translateY(8px);
	transition: transform 0.18s ease;
}

.mgs-dialog.is-open .mgs-panel {
	transform: none;
}

.mgs-head {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 10px 10px 18px;
	border-bottom: 1px solid #e5e7eb;
	font-size: 15px;
	line-height: 1.3;
}

.mgs-title {
	flex: 1 1 auto;
	font-weight: 600;
	min-width: 0;
}

.mgs-external {
	flex: 0 0 auto;
	font-size: 14px;
	color: inherit;
	text-decoration: underline;
}

.mgs-close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.mgs-close:hover {
	background: #f3f4f6;
}

.mgs-close:focus-visible,
.mgs-external:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.mgs-body {
	flex: 1 1 auto;
	min-height: 0;
	background: #525659;
}

.mgs-frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (max-width: 600px) {
	.mgs-dialog {
		padding: 0;
	}

	.mgs-panel {
		width: 100%;
		height: 100%;
		border-radius: 0;
	}

	.mgs-external {
		display: none;
	}
}

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