@layer norn.components {
		norn-heading-anchor {
			display: block;

			& > :is(h2, h3, h4, h5, h6) {
				margin: 0;
				scroll-margin-block-start: var(--norn-space-m, 1.25rem);

				&::before {
					content: "#" / "";
					margin-inline-end: var(--norn-space-2xs, 0.25rem);
					color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
				}
			}

			/* At least 24px tall, the WCAG 2.2 target size, even for a short heading. */
			& a {
				display: inline-block;
				min-block-size: 1.5rem;
				color: inherit;
				text-decoration: none;
				text-underline-offset: 0.1em;

				&:is(:hover, :focus-visible) {
					text-decoration: underline;
				}
			}

			/* The page's margin is at least 1rem on a narrow screen and wider past the content width, so the mark hangs only where the margin holds it: 1.15ch is under 20px for a second-level heading. */
			@media (hover: hover) and (min-width: 70rem) {
				& > :is(h2, h3, h4, h5, h6)::before {
					display: inline-block;
					inline-size: 1ch;
					margin-inline: -1.15ch 0.15ch;
					opacity: 0;
				}

				& > :is(h2, h3, h4, h5, h6):is(:hover, :focus-within)::before {
					opacity: 1;
				}
			}

			@media (hover: hover) and (min-width: 70rem) and (prefers-reduced-motion: no-preference) {
				& > :is(h2, h3, h4, h5, h6)::before {
					transition: opacity var(--norn-ui-motion-duration, 150ms) var(--norn-ui-motion-easing, cubic-bezier(0.2, 0, 0, 1));
				}
			}
		}
	}