/* Live page check notice. Loaded only for people who can edit the form on
 * this page (see src/LiveCheck.php); visitors never receive this file.
 * Every rule is scoped to .af-live-check, except the temporary classes the
 * check adds to a form while it measures, which it removes straight after. */

.af-live-check {
	--af-live-text: #1d2327;
	--af-live-muted: #50575e;
	--af-live-back: #ffffff;
	--af-live-accent: #1d2327;
	--af-live-ok: #00703c;
	--af-live-review: #775200;
	--af-live-problem: #b32d2e;
	box-sizing: border-box;
	max-inline-size: 46rem;
	margin: 1.5rem 0 1rem;
	padding: 20px;
	border: 1px solid #c3c4c7;
	border-radius: 12px;
	background: var(--af-live-back);
	color: var(--af-live-text);
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: normal;
	text-align: start;
	text-transform: none;
	overflow-wrap: anywhere;
}
.af-live-check .af-live-check__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	margin-block-end: 16px;
}
.af-live-check .af-live-check__private {
	color: var(--af-live-muted);
	font-size: 13px;
}
.af-live-check .af-live-check__result {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}
.af-live-check .af-live-check__symbol {
	flex: 0 0 24px;
	inline-size: 24px;
	block-size: 24px;
	color: var(--af-live-ok);
}
.af-live-check .af-live-check__symbol svg {
	display: block;
	inline-size: 24px;
	block-size: 24px;
}
.af-live-check[data-result='problems'] .af-live-check__symbol {
	color: var(--af-live-problem);
}
.af-live-check[data-result='review'] .af-live-check__symbol,
.af-live-check[data-result='incomplete'] .af-live-check__symbol {
	color: var(--af-live-review);
}
.af-live-check[data-state='running'] .af-live-check__symbol {
	color: var(--af-live-muted);
}
.af-live-check *,
.af-live-check *::before,
.af-live-check *::after {
	box-sizing: border-box;
}
.af-live-check p,
.af-live-check ol,
.af-live-check ul,
.af-live-check pre {
	margin: 0 0 0.5em;
	padding: 0;
	color: var(--af-live-text);
	font-size: 1em;
	line-height: 1.5;
}
.af-live-check ol,
.af-live-check ul {
	padding-inline-start: 1.5em;
}
.af-live-check .af-live-check__title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
}
.af-live-check .af-live-check__summary {
	min-inline-size: 0;
	margin: 0;
	flex: 1;
}
.af-live-check .af-live-check__summary-title {
	display: block;
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.4;
}
.af-live-check .af-live-check__summary-copy {
	display: block;
	color: var(--af-live-muted);
}
.af-live-check .af-live-check__summary:empty {
	margin: 0;
}
.af-live-check .af-live-check__details {
	margin: 12px 0 0;
	padding-block-start: 4px;
}
.af-live-check .af-live-check__details > summary {
	display: list-item;
	cursor: pointer;
	margin: 0;
	padding: 10px 0;
	color: var(--af-live-text);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	min-block-size: 44px;
}
.af-live-check .af-live-check__details[open] > summary {
	margin-block-end: 8px;
}
.af-live-check .af-live-check__details > summary:hover {
	text-decoration-thickness: 2px;
}
.af-live-check .af-live-check__item {
	margin: 0 0 0.75em;
}
.af-live-check .af-live-check__item p {
	margin: 0 0 0.25em;
}
.af-live-check .af-live-check__fix,
.af-live-check .af-live-check__note {
	color: var(--af-live-muted);
}
.af-live-check .af-live-check__note {
	margin: 0;
	font-size: 13px;
}
.af-live-check .af-live-check__subhead {
	font-weight: 600;
}
.af-live-check .af-live-check__css {
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	padding: 6px 8px;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	background: #f6f7f7;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.875em;
}
.af-live-check .af-live-check__css code {
	background: none;
	color: var(--af-live-text);
	font: inherit;
	padding: 0;
}
.af-live-check .af-live-check__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 20px;
	margin: 16px 0 12px;
}
.af-live-check .af-live-check__again {
	all: unset;
	box-sizing: border-box;
	display: inline-block;
	min-block-size: 40px;
	padding: 8px 14px;
	border: 1px solid #8c8f94;
	border-radius: 6px;
	background: var(--af-live-back);
	color: var(--af-live-text);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	line-height: 1.4;
}
.af-live-check .af-live-check__again:hover {
	border-color: var(--af-live-accent);
	background: #f6f7f7;
}
.af-live-check .af-live-check__again:active {
	background: #eceeef;
}
.af-live-check .af-live-check__again[aria-disabled='true'] {
	background: #f6f7f7;
	color: var(--af-live-muted);
	cursor: progress;
}
.af-live-check .af-live-check__link,
.af-live-check .af-live-check__link:visited,
.af-live-check .af-live-check__link:hover {
	display: inline-flex;
	align-items: center;
	min-block-size: 40px;
	color: #0a4b78;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.af-live-check .af-live-check__link:hover {
	text-decoration-thickness: 2px;
}
.af-live-check :focus-visible,
.af-live-check .af-live-check__again:focus-visible {
	outline: 3px solid var(--af-live-accent) !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 5px #ffffff !important;
}
@media (max-width: 480px) {
	.af-live-check { padding: 16px; }
	.af-live-check .af-live-check__header { gap: 4px 12px; }
	.af-live-check .af-live-check__actions { gap: 4px 16px; }
	.af-live-check .af-live-check__again,
	.af-live-check .af-live-check__link { min-block-size: 44px; }
}
/* A text field focused briefly so later programmatic focus shows its ring. */
.af-live-check__primer {
	position: fixed !important;
	inset-block-start: 0 !important;
	inset-inline-start: 0 !important;
	inline-size: 1px !important;
	block-size: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

@media (forced-colors: active) {
	.af-live-check {
		border-color: CanvasText;
		background: Canvas;
		color: CanvasText;
	}
	.af-live-check p,
	.af-live-check .af-live-check__fix,
	.af-live-check .af-live-check__note,
	.af-live-check .af-live-check__private,
	.af-live-check .af-live-check__summary-copy,
	.af-live-check .af-live-check__symbol {
		color: CanvasText;
	}
	.af-live-check .af-live-check__again,
	.af-live-check .af-live-check__again:hover {
		border-color: ButtonText;
		background: ButtonFace;
		color: ButtonText;
	}
	.af-live-check .af-live-check__link {
		color: LinkText;
	}
	.af-live-check :focus-visible {
		outline-color: Highlight !important;
	}
}

/* Temporary: while measuring, no transition may hide the real end state. */
.af-live-checking,
.af-live-checking *,
.af-live-checking *::before,
.af-live-checking *::after {
	transition-duration: 0s !important;
	transition-delay: 0s !important;
}
/* Temporary: WCAG 1.4.12 text spacing, applied only during the check. */
.af-live-spacing,
.af-live-spacing * {
	line-height: 1.5 !important;
	letter-spacing: 0.12em !important;
	word-spacing: 0.16em !important;
}
.af-live-spacing p {
	margin-block-end: 2em !important;
}
