.smart-footnote {
	position: relative;
	display: inline-block;
	vertical-align: 0.08em;
}

.smart-footnote__button {
	display: inline-grid;
	place-items: center;
	min-width: 1.65em;
	height: 1.3em;
	margin-inline: 0.1em;
	padding-inline: 0.48em;
	border: 0;
	border-radius: 999px;
	background: #e9e9e9;
	color: #333;
	font: inherit;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1;
	cursor: help;
	transition: background-color 150ms ease, color 150ms ease;
}

.smart-footnote__link {
	cursor: pointer;
}

.smart-footnote__button:is(:hover, :focus-visible),
.smart-footnote.is-open .smart-footnote__button {
	background: #161616;
	color: #fff;
}

.smart-footnote__button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.smart-footnote__popover {
	position: absolute;
	z-index: 1000;
	bottom: calc(100% + 0.75rem);
	left: 50%;
	width: max-content;
	max-width: min(28rem, calc(100vw - 2rem));
	padding: 1rem 1.1rem;
	border: 1px solid #dedede;
	border-radius: 1rem;
	background: #fff;
	box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 10%);
	color: #171717;
	font-size: 1rem;
	line-height: 1.45;
	text-align: left;
	transform: translate(-50%, 0.3rem);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 150ms ease, transform 150ms ease;
}

.smart-footnote__popover::after {
	position: absolute;
	inset: auto 0 -0.75rem;
	height: 0.75rem;
	content: "";
}

.smart-footnote:is(:hover, :focus-within, .is-open) .smart-footnote__popover {
	transform: translateX(-50%);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.smart-footnote__text {
	display: block;
}

.smart-footnote__source {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	margin-top: 0.7rem;
	color: #a80078;
	font-size: 1rem;
	font-weight: 600;
	overflow-wrap: anywhere;
	text-decoration: none;
}

.smart-footnote__source:is(:hover, :focus-visible) {
	text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
	.smart-footnote__button,
	.smart-footnote__popover {
		transition: none;
	}
}