@layer norn.components {
		norn-simple-table {
			display: block;
			min-inline-size: 0;

			/* Shadows at the edges that have more to scroll to: the first two are the page's color and scroll with the content, so they cover the shadows underneath until the content has moved. */
			& > div:first-of-type {
				--_bg: var(--norn-surface-base, light-dark(#ffffff, #101216));
				--_shadow: color-mix(in oklab, var(--norn-text-base, light-dark(#16181d, #eceef3)) 18%, transparent);
				overflow-x: auto;
				background:
					linear-gradient(to right, var(--_bg) 30%, transparent) local 0 0 / 2rem 100% no-repeat,
					linear-gradient(to left, var(--_bg) 30%, transparent) local 100% 0 / 2rem 100% no-repeat,
					radial-gradient(farthest-side at 0 50%, var(--_shadow), transparent) scroll 0 0 / 0.75rem 100% no-repeat,
					radial-gradient(farthest-side at 100% 50%, var(--_shadow), transparent) scroll 100% 0 / 0.75rem 100% no-repeat;
			}

			& > div > table {
				min-inline-size: 100%;
				border-collapse: collapse;
				border-block-end: 1px solid var(--norn-ui-border-color, light-dark(#d3d8e2, #2d323e));
			}

			& > div > table > caption {
				padding-block-end: var(--norn-space-xs, 0.5rem);
				color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
				text-align: start;
			}

			& > div > table :is(th, td) {
				min-inline-size: 7rem;
				padding: var(--norn-space-xs, 0.5rem) var(--norn-space-s, 0.75rem);
				border-block-end: 1px solid var(--norn-ui-border-color, light-dark(#d3d8e2, #2d323e));
				text-align: start;
				vertical-align: top;
			}

			/* The last column is usually the one with sentences, so it keeps room to wrap into rather than a column of words. */
			& > div > table :is(th, td):last-child {
				min-inline-size: 10rem;
			}

			/* Wrap between words only: a token split across lines reads as two. */
			& > div > table :is(th, td, code) {
				overflow-wrap: normal;
				word-break: normal;
			}

			& > div > table code {
				white-space: nowrap;
			}

			/* An even body row takes the raised surface, for a long table read across. */
			& > div[data-striped] > table > tbody > tr:nth-child(even) {
				background-color: var(--norn-surface-raised, light-dark(hsl(40, 14%, 96%), #242932));
			}

			/* A numeric column, named by its position, lines up at the end with figures of one width. */
			& > div[data-numeric~="1"] > table :is(th, td):nth-child(1),
			& > div[data-numeric~="2"] > table :is(th, td):nth-child(2),
			& > div[data-numeric~="3"] > table :is(th, td):nth-child(3),
			& > div[data-numeric~="4"] > table :is(th, td):nth-child(4),
			& > div[data-numeric~="5"] > table :is(th, td):nth-child(5),
			& > div[data-numeric~="6"] > table :is(th, td):nth-child(6),
			& > div[data-numeric~="7"] > table :is(th, td):nth-child(7),
			& > div[data-numeric~="8"] > table :is(th, td):nth-child(8) {
				font-variant-numeric: tabular-nums;
				text-align: end;
			}

			& > [data-note] {
				margin: 0;
				padding-block-start: var(--norn-space-xs, 0.5rem);
				color: var(--norn-text-muted, light-dark(#4b5160, #a4abba));
				font-size: var(--norn-font-size-s, 0.875rem);
			}

			& > [data-note]:empty {
				display: none;
			}

			@media print {
				& > div:first-of-type {
					overflow: visible;
					background: none;
				}
			}
		}
	}