.legal-link {
	padding: 4px 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	line-height: 1.8;
	cursor: pointer;
	touch-action: manipulation;
}

.legal-more-information {
	display: block;
	width: fit-content;
	min-height: 44px;
	text-align: left;
}

.legal-link[hidden] { display: none; }

.registration-image-notice {
	margin: 16px 0 0;
	font-size: 14px;
	line-height: 1.5;
}

html:has(.legal-document[open]) { overflow: hidden; }

.legal-document {
	box-sizing: border-box;
	width: min(600px, calc(100vw - 32px));
	max-height: min(760px, calc(100dvh - 48px));
	margin: auto;
	overflow: hidden;
	padding: 0;
	border: 1px solid #e9f0f2;
	border-radius: 20px;
	background: #05080b;
	color: #fff;
	color-scheme: dark;
	font: 15px/1.6 Arial, sans-serif;
}

.legal-document[open] { display: flex; flex-direction: column; }
.legal-document::backdrop { background: #02050ad9; }
.legal-document header, .legal-document footer { flex: 0 0 auto; padding: 16px 20px; }
.legal-document h2 { margin: 0; font-size: 18px; }
.legal-document__body {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior-y: contain;
	-webkit-overflow-scrolling: touch;
	margin-inline-end: 6px;
	padding: 0 14px 0 20px;
	scrollbar-width: thin;
	scrollbar-color: #65787d transparent;
}

/* Use rounded thumbs without native arrow buttons in Chromium and Safari. */
@supports selector(::-webkit-scrollbar) {
	.legal-document__body {
		scrollbar-width: auto;
		scrollbar-color: auto;
	}

	.legal-document__body::-webkit-scrollbar { width: 6px; }
	.legal-document__body::-webkit-scrollbar-track { background: transparent; }
	.legal-document__body::-webkit-scrollbar-thumb {
		min-height: 40px;
		border-radius: 999px;
		background: #65787d;
	}
	.legal-document__body::-webkit-scrollbar-thumb:hover { background: #91a7aa; }
	.legal-document__body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
	.legal-document__body::-webkit-scrollbar-corner { background: transparent; }
}

.legal-document__body p { margin: 0 0 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.legal-document footer { text-align: center; }
.legal-document footer button {
	min-height: 44px;
	min-width: 120px;
	padding: 8px 24px;
	border: 1px solid currentColor;
	border-radius: 99px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
	touch-action: manipulation;
}

.legal-link:focus-visible,
.legal-document button:focus-visible {
	outline: 2px solid #25e4b1;
	outline-offset: 3px;
}
