/*
 * Table Builder — the shared table, plus layout 07.
 *
 * Two things in here are load-bearing and easy to undo by accident:
 *
 * 1. `container-type: inline-size` on `.mtbl`. Every breakpoint below is a *container*
 *    query, so a table reacts to the width of the block and not of the window. A table
 *    sits in a full-width column on one page and beside a sidebar on the next, and a
 *    media query gets the second case wrong every time.
 *
 * 2. The accent's lightness is derived, not chosen. `--v-accent` is one colour, set
 *    per table by the block; how light it must be to carry text (4.5:1) or a line
 *    (3:1) depends on the surface it prints on, so it is computed from it. Two bands,
 *    not twenty hand-picked values — see docs/SPEC-table-builder.md → Colour.
 *
 * The palette reads the suite's tokens where a page has them and falls back to its own,
 * so this stylesheet works on its own. There is deliberately no `prefers-color-scheme`
 * block: the blog is a light site, and flipping to a dark palette because the reader's
 * OS is dark would put dark text on a light page. A dark theme overrides the tokens.
 */

.mtbl {
	container-type: inline-size;

	/* One colour per table. The block writes this inline; the rest is derived. */
	--v-accent: var(--mf-accent, #1d4f99);

	--mtbl-ink: var(--mf-ink, #1a1a2e);
	--mtbl-muted: var(--mf-muted, #6a6f80);
	--mtbl-line: var(--mf-line, #e2e5ec);
	--mtbl-surface: var(--mf-surface, #fff);
	--mtbl-surface-2: var(--mf-surface-2, #f7f8fa);
	--mtbl-radius: 10px;
	--mtbl-shadow: color-mix(in oklab, var(--mtbl-ink) 16%, transparent);

	/*
	 * The two lightness bands. A dark surface overrides these, not the accent.
	 *
	 * `l` here is a **number** between 0 and 1, never a percentage: `min(l, 45%)` mixes
	 * types, is invalid, and the whole colour is silently dropped — measured, the header
	 * rule fell back to grey and the accent line simply was not there.
	 */
	--v-ink-l: min(l, 0.45);
	--v-mark-l: min(l, 0.62);
	--v-ink-accent: oklch(from var(--v-accent) var(--v-ink-l) c h);
	--v-mark-accent: oklch(from var(--v-accent) var(--v-mark-l) c h);

	/*
	 * The third derived value, and the only one that prints **on** the accent rather
	 * than beside it. Not a band but a step: near-white on a dark accent, near-black on
	 * a light one, turning where neither wins — there is no readable middle to land in.
	 * It derives from the accent alone, so a dark surface does not re-declare it.
	 *
	 * Measured while it was missing: `var(--on-accent)` with nothing behind it is
	 * invalid at computed-value time, `color` therefore falls back to **inherit**, and
	 * the chooser's pressed chips came out ink on accent at **2.14:1**. An undefined
	 * custom property does not fail loudly. It fails legibly.
	 */
	--on-accent: oklch(from var(--v-accent) clamp(0.08, (0.57 - l) * 1000, 0.98) 0 h);

	color: var(--mtbl-ink);
}

/*
 * Not inherited from the theme on purpose. A flattened row is `width: 100%` **plus** a
 * border, so without this it overflows its own container — measured at 390px, the cards
 * ran past the right edge.
 */
.mtbl *,
.mtbl *::before,
.mtbl *::after {
	box-sizing: border-box;
}

/* ---------- the table every layout starts from ---------- */

.mtbl-table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
	font-size: 0.9rem;
}

.mtbl-table th,
.mtbl-table td {
	padding: 0.62rem 0.75rem;
	text-align: left;
	white-space: nowrap;
}

.mtbl-table thead th {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--mtbl-muted);
	background: var(--mtbl-surface-2);
	border-bottom: 2px solid var(--v-mark-accent);
}

/*
 * The row rule is drawn on the **cells**, never on the row's name.
 *
 * The label column reads as one block, not as five boxes — the catalogue does this in
 * its base table and every skin of it repeats the same `tbody td`, so it is the shared
 * rule and not one layout's taste. Adding `th` here was the deviation: 01 already had to
 * undo it by hand, and 09 showed it a second time, which is where a rule belongs to the
 * family rather than to its members.
 */
.mtbl-table tbody td {
	border-bottom: 1px solid var(--mtbl-line);
}

.mtbl-table tbody tr:last-child td {
	border-bottom: none;
}

.mtbl-table tfoot td,
.mtbl-table tfoot th {
	font-weight: 600;
	border-top: 2px solid var(--mtbl-line);
}

/*
 * Right-aligned, decided by the column's `numeric` flag and nothing else.
 *
 * Scoped through `.mtbl-table` on purpose: `.mtbl-table td` is (0,1,1) and a bare
 * `.mtbl-num` is (0,1,0), so the left alignment above would win and every number would
 * sit against its label. Two classes beat one class plus an element — which is how this
 * avoids the `!important` the catalogue needed.
 */
.mtbl-table .mtbl-num {
	text-align: right;
}

.mtbl-caption {
	padding: 0 0.75rem 0.6rem;
	font-size: 0.85rem;
	color: var(--mtbl-muted);
	text-align: left;
	caption-side: top;
}

/* The label column stays put while the rest scrolls sideways. */
.mtbl-stick th:first-child,
.mtbl-stick td:first-child {
	position: sticky;
	left: 0;
	z-index: 2;
	background: var(--mtbl-surface);
}

.mtbl-stick thead th:first-child {
	z-index: 4;
}

/* ============================================================
   01 · Column Pager — the header band, the label column, the row under the cursor
   ============================================================ */

/*
 * The pinned column must be opaque or the columns scroll through it — and that opaque
 * background beat the header's tint, so the first header cell came out **white** while
 * every other one was grey (measured: 255,255,255 against 247,248,250). Same
 * specificity, later rule. The header says it again here, exactly as the catalogue's own
 * `tb01` does.
 */
.mtbl-tb01 .mtbl-stick thead th:first-child {
	background: var(--mtbl-surface-2);
}

/*
 * The label column carries no rule between its rows — that is the shared rule now, up
 * with the base table. What is 01's own is the single line down its right edge, which is
 * what separates the column from the ones sliding past it.
 */
.mtbl-tb01 .mtbl-stick th:first-child,
.mtbl-tb01 .mtbl-stick td:first-child {
	border-right: 1px solid var(--mtbl-line);
}

/*
 * The row under the cursor, **including** the pinned cell. The catalogue tints `td` only,
 * which leaves the pinned column white inside a highlighted row — a gap down the left of
 * the very row you are pointing at. Overriding the sticky background costs one selector
 * and makes the highlight a row.
 */
.mtbl-tb01 .mtbl-table tbody tr:hover td,
.mtbl-tb01 .mtbl-table tbody tr:hover th {
	background: var(--mtbl-surface-2);
}

/* ---------- 07 · Card Stack ---------- */

@container (max-width: 640px) {

	.mtbl-tb07 .mtbl-table,
	.mtbl-tb07 .mtbl-table tbody,
	.mtbl-tb07 .mtbl-table tfoot,
	.mtbl-tb07 .mtbl-table tr,
	.mtbl-tb07 .mtbl-table td,
	.mtbl-tb07 .mtbl-table th {
		display: block;
		width: 100%;
	}

	/*
	 * The header row goes, and with it — measured in Chrome's accessibility tree — the
	 * column names: a `display:none` rowgroup is ignored. That is why every cell carries
	 * its own `data-label`, printed below. The row's name survives as its row header.
	 */
	.mtbl-tb07 .mtbl-table thead {
		display: none;
	}

	.mtbl-tb07 .mtbl-table tbody tr {
		margin: 10px 0;
		padding: 6px 0;
		background: var(--mtbl-surface);
		border: 1px solid var(--mtbl-line);
		border-left: 3px solid var(--v-mark-accent);
		border-radius: var(--mtbl-radius);
	}

	.mtbl-tb07 .mtbl-table td,
	.mtbl-tb07 .mtbl-table th {
		display: grid;
		grid-template-columns: 40% 1fr;
		gap: 10px;
		align-items: baseline;
		padding: 5px 14px;
		white-space: normal;
		border-bottom: none;
	}

	.mtbl-tb07 .mtbl-table td::before,
	.mtbl-tb07 .mtbl-table th::before {
		content: attr(data-label);
		font-size: 0.78rem;
		font-weight: 500;
		color: var(--mtbl-muted);
	}

	/* A number in a card sits next to its label, not against the far edge. */
	.mtbl-tb07 .mtbl-table .mtbl-num {
		text-align: left;
	}

	.mtbl-tb07 .mtbl-table th[data-lead] {
		grid-template-columns: 1fr auto;
		margin-bottom: 4px;
		padding: 8px 14px 10px;
		font-size: 0.95rem;
		border-bottom: 1px solid var(--mtbl-line);
	}

	.mtbl-tb07 .mtbl-table th[data-lead]::before {
		display: none;
	}

	.mtbl-tb07 .mtbl-stick th:first-child,
	.mtbl-tb07 .mtbl-stick td:first-child {
		position: static;
	}
}

@media (prefers-reduced-motion: reduce) {

	.mtbl *,
	.mtbl *::before,
	.mtbl *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ============================================================
   The shared scroller
   ============================================================ */

/*
 * Focusable and named in the markup, so it can be reached and understood; the visible
 * scrollbar is left in place on purpose, because it is the cheapest honest affordance
 * there is. The pager's edge shadows and counter sit on top of this later.
 */
.mtbl-scroll {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
}

.mtbl-scroll:focus-visible {
	outline: 2px solid var(--v-mark-accent);
	outline-offset: 2px;
}

/* ============================================================
   02 · Peek Deck — columns as cards, declared as a transposed table
   ============================================================ */

/*
 * **`max-content`, or the pinned column does not stay pinned.** A sticky element can
 * only stick inside its own containing block, and a block-level flex container is as
 * wide as the scroller — 328px, while its columns summed to 1147px. So the labels stuck
 * for 196px and then slid out of view: pinned on page 1 and 2, gone from page 3 on.
 * The real tables do not have this because a sticky cell's containing block is the
 * `<table>`, which is as wide as its content already.
 */
.mtbl-tb02 .mtbl-deck {
	display: flex;
	width: max-content;
}

/*
 * The label column's width is a token because **two** things need it: the column itself,
 * and the scroller's snap padding. Without that padding the deck's snap points sit at
 * each column's own left edge, while the pager scrolls to `x - pinned` so the column
 * clears the sticky labels — and `scroll-snap-type: mandatory` wins, pulling the scroll
 * back. Measured: the pager reached page 2 and then stuck at scrollLeft 311 however
 * often you pressed next, leaving three of five columns unreachable by button.
 */
.mtbl-tb02 {
	--mtbl-deck-labels: 132px;
}

.mtbl-tb02 .mtbl-scroll {
	scroll-padding-left: var(--mtbl-deck-labels);
}

.mtbl-tb02 .mtbl-deck__labels {
	position: sticky;
	left: 0;
	z-index: 3;
	flex: none;
	width: var(--mtbl-deck-labels);
	background: var(--mtbl-surface);
	border-right: 1px solid var(--mtbl-line);
}

.mtbl-tb02 .mtbl-deck__col {
	flex: none;
	width: 168px;
	scroll-snap-align: start;
	border-right: 1px solid var(--mtbl-line);
}

.mtbl-tb02 .mtbl-deck__col:last-child {
	border-right: none;
}

.mtbl-tb02 .mtbl-deck__cell {
	display: flex;
	align-items: center;
	height: 42px;
	padding: 0 12px;
	overflow: hidden;
	font-size: 0.85rem;
	text-overflow: ellipsis;
	white-space: nowrap;
	border-bottom: 1px solid var(--mtbl-line);
}

.mtbl-tb02 .mtbl-deck__cell--head {
	height: 40px;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--mtbl-muted);
	background: var(--mtbl-surface-2);
}

.mtbl-tb02 .mtbl-deck__labels .mtbl-deck__cell {
	font-weight: 600;
}

/*
 * Narrow: a column takes most of the width and the next one peeks in. That peek **is**
 * the affordance — it says "there is more" without a word of instruction, which is what
 * a bare overflow container never manages.
 */
@container (max-width: 560px) {

	.mtbl-tb02 .mtbl-scroll {
		scroll-snap-type: x mandatory;
	}

	.mtbl-tb02 {
		--mtbl-deck-labels: 108px;
	}

	.mtbl-tb02 .mtbl-deck__col {
		width: 62cqw;
	}
}

/* ============================================================
   12 · Accordion Rows — a list of records, opened by <details>
   ============================================================ */

.mtbl-records__item + .mtbl-records__item {
	border-top: 1px solid var(--mtbl-line);
}

.mtbl-acc__summary {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	align-items: center;
	padding: 12px 14px;
	cursor: pointer;
	list-style: none;
}

/* Safari still draws its own marker without this. */
.mtbl-acc__summary::-webkit-details-marker {
	display: none;
}

/*
 * A triangle drawn from borders rather than a character: generated text content ends up
 * in the accessibility tree, and `<details>` already announces whether it is open, so a
 * spoken "▸" would be noise.
 */
.mtbl-acc__summary::after {
	flex: none;
	order: 9;
	width: 0;
	height: 0;
	content: "";
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 6px solid var(--mtbl-muted);
	transition: transform 0.18s ease;
}

.mtbl-acc[open] .mtbl-acc__summary::after {
	transform: rotate(90deg);
}

.mtbl-acc__summary:hover {
	background: color-mix(in oklab, var(--v-accent) 5%, var(--mtbl-surface));
}

/*
 * The name takes the free space, which puts the peek and the triangle together at the
 * right edge — closed, the row reads "what it is … what it says · open me".
 *
 * The auto margin is on the **name** rather than on either of them: two auto margins
 * would split the free space between them and leave the peek stranded in the middle,
 * and an auto margin on the peek alone would strand the triangle on a row that has no
 * peek to push it.
 */
.mtbl-acc__name {
	margin-right: auto;
	font-weight: 600;
}

.mtbl-acc__peek {
	font-size: 0.85rem;
	color: var(--mtbl-muted);
	text-align: right;
}

.mtbl-acc__panel {
	padding: 0 14px 14px;
}

.mtbl-values {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px 18px;
	margin: 0;
}

.mtbl-values__pair {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.mtbl-values dt {
	font-size: 0.72rem;
	color: var(--mtbl-muted);
}

.mtbl-values dd {
	margin: 0;
	font-weight: 550;
}

/* Under its label, a value that is right-aligned is stranded. */
.mtbl-values dd.mtbl-num {
	text-align: left;
}

/* ============================================================
   The pager, and the edges that say there is more
   ============================================================ */

/*
 * Built by pager.js, which is why there is no server-rendered counterpart: a counter
 * that never counts is worse than no counter. The bar hides itself when the table fits.
 */
.mtbl-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	padding: 8px 12px;
	font-size: 0.8rem;
	background: var(--mtbl-surface-2);
	border-bottom: 1px solid var(--mtbl-line);
}

.mtbl-pager__btn {
	display: grid;
	flex: none;
	place-items: center;
	width: 28px;
	height: 28px;
	color: var(--mtbl-ink);
	cursor: pointer;
	background: var(--mtbl-surface);
	border: 1px solid var(--mtbl-line);
	border-radius: 8px;
}

.mtbl-pager__btn:not(:disabled):hover {
	color: var(--v-ink-accent);
	border-color: var(--v-mark-accent);
}

/* An inactive control is exempt from the contrast requirement, and looking inactive is
   the entire point. */
.mtbl-pager__btn:disabled {
	cursor: default;
	opacity: 0.32;
}

.mtbl-pager__status {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	align-items: baseline;
	margin: 0;
}

.mtbl-pager__name {
	color: var(--v-ink-accent);
}

.mtbl-pager__count {
	color: var(--mtbl-muted);
}

.mtbl-edges {
	position: relative;
}

/*
 * The shadow is on the container, not on the scrolling content, so it stays put while
 * the columns move under it. Only shown on the side that actually has more.
 */
.mtbl-edges::before,
.mtbl-edges::after {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 3;
	width: 26px;
	pointer-events: none;
	content: "";
	opacity: 0;
	transition: opacity 0.18s ease;
}

.mtbl-edges::before {
	left: 0;
	background: linear-gradient(90deg, var(--mtbl-shadow), transparent);
}

.mtbl-edges::after {
	right: 0;
	background: linear-gradient(270deg, var(--mtbl-shadow), transparent);
}

.mtbl-edges[data-mtbl-left="1"]::before,
.mtbl-edges[data-mtbl-right="1"]::after {
	opacity: 1;
}

/* ============================================================
   A surface that is dark in every theme
   ============================================================ */

/*
 * A layout whose surface does not come from the page has to say so, because everything
 * derived from a surface is wrong otherwise: the status colours, the lines, and how light
 * the accent must be to carry text on it. In the catalogue, the absence of exactly this
 * was the single cause that failed **all eighteen** measured colour combinations — a
 * light theme's dark accent printed on a near-black terminal.
 *
 * The two derived accents are re-declared here on purpose. A custom property substitutes
 * its `var()` where it is **declared**, so the copies on `.mtbl` would keep resolving
 * against `.mtbl`'s lightness bands, not these.
 */
[data-surface="dark"] {
	--mtbl-surface: var(--surf-bg, #191c24);
	--mtbl-surface-2: var(--surf-bg-2, #21242e);
	--mtbl-ink: var(--surf-ink, #eef0f6);
	--mtbl-muted: var(--surf-muted, #98a0b3);
	--mtbl-line: var(--surf-line, #2e323e);
	--mtbl-shadow: color-mix(in oklab, #000 55%, transparent);
	--v-ink-l: max(l, 0.78);
	--v-mark-l: max(l, 0.62);
	--v-ink-accent: oklch(from var(--v-accent) var(--v-ink-l) c h);
	--v-mark-accent: oklch(from var(--v-accent) var(--v-mark-l) c h);

	color: var(--mtbl-ink);
	background: var(--mtbl-surface);
}

/* ============================================================
   A caption in a table that scrolls sideways
   ============================================================ */

/*
 * Sticky, or it scrolls out of the box with the first columns and the table loses its
 * visible name halfway across. It stays a `<caption>` element either way — only its box
 * is pinned.
 */
.mtbl-scroll .mtbl-caption {
	position: sticky;
	left: 0;
	width: max-content;
	max-width: 100%;
}

/*
 * A caption inside a table a layout has **flattened** shrinks to its longest word, so it
 * becomes a block there — measured, it came out one word per line.
 *
 * Only there. Doing this to every caption is worse than the bug it fixes: on a table
 * that is still `display: table`, a block caption loses `caption-side` and renders
 * *below* the header row. One container query, the three layouts that flatten, and no
 * further copies.
 */
@container (max-width: 640px) {

	.mtbl-tb07 .mtbl-caption,
	.mtbl-tb08 .mtbl-caption,
	.mtbl-tb09 .mtbl-caption {
		display: block;
		padding-left: 0;
	}
}

/* ============================================================
   08 · Ledger Slip — a skin of 07
   ============================================================ */

.mtbl-tb08 .mtbl-table {
	font-family: ui-monospace, "SF Mono", menlo, consolas, monospace;
	font-size: 0.8rem;
}

.mtbl-tb08 .mtbl-table thead th {
	color: var(--v-ink-accent);
	background: none;
	border-bottom: 1px dashed var(--mtbl-line);
}

.mtbl-tb08 .mtbl-table tbody td {
	border-bottom: 1px dashed var(--mtbl-line);
}

.mtbl-tb08 .mtbl-table tbody tr:nth-child(even) td,
.mtbl-tb08 .mtbl-table tbody tr:nth-child(even) th {
	background: var(--mtbl-surface-2);
}

@container (max-width: 640px) {

	.mtbl-tb08 .mtbl-table,
	.mtbl-tb08 .mtbl-table tbody,
	.mtbl-tb08 .mtbl-table tfoot,
	.mtbl-tb08 .mtbl-table tr,
	.mtbl-tb08 .mtbl-table td,
	.mtbl-tb08 .mtbl-table th {
		display: block;
		width: 100%;
	}

	.mtbl-tb08 .mtbl-table thead {
		display: none;
	}

	.mtbl-tb08 .mtbl-table tbody tr {
		position: relative;
		margin: 12px 0;
		padding: 12px 0 6px;
		background: var(--mtbl-surface);

		/* The torn edge is a mask, not an image: no request, no asset, no semantics. */
		mask:
			radial-gradient(5px at 5px 0, transparent 98%, #000) 0 0 / 10px 10px repeat-x,
			radial-gradient(5px at 5px 100%, transparent 98%, #000) 0 100% / 10px 10px repeat-x,
			linear-gradient(#000, #000) 0 5px / 100% calc(100% - 10px) no-repeat;
	}

	.mtbl-tb08 .mtbl-table tbody tr:nth-child(even) td,
	.mtbl-tb08 .mtbl-table tbody tr:nth-child(even) th {
		background: none;
	}

	.mtbl-tb08 .mtbl-table td,
	.mtbl-tb08 .mtbl-table th {
		display: flex;
		gap: 8px;
		padding: 4px 18px;
		white-space: normal;
		border-bottom: none;
	}

	/* The receipt does right-align its values; only the label stays left. */
	.mtbl-tb08 .mtbl-table td::before {
		flex: none;
		order: -2;
		color: var(--mtbl-muted);
		text-align: left;
		content: attr(data-label);
	}

	/* The leader dots: generated content, so nothing is read out. */
	.mtbl-tb08 .mtbl-table td::after {
		flex: 1;
		order: -1;
		margin: 0 -4px 5px;
		content: "";
		border-bottom: 1px dotted var(--mtbl-line);
	}

	.mtbl-tb08 .mtbl-table td {
		justify-content: flex-end;
		text-align: right;
	}

	.mtbl-tb08 .mtbl-table th[data-lead] {
		margin-bottom: 6px;
		padding-bottom: 10px;
		font-size: 0.9rem;
		color: var(--v-ink-accent);
		border-bottom: 1px dashed var(--mtbl-line);
	}
}

/* ============================================================
   09 · Hairline List — a skin of 07
   ============================================================ */

.mtbl-tb09 .mtbl-table thead th {
	background: none;
	border-bottom: 1px solid var(--mtbl-ink);
}

@container (max-width: 640px) {

	.mtbl-tb09 .mtbl-table,
	.mtbl-tb09 .mtbl-table tbody,
	.mtbl-tb09 .mtbl-table tfoot,
	.mtbl-tb09 .mtbl-table tr,
	.mtbl-tb09 .mtbl-table td,
	.mtbl-tb09 .mtbl-table th {
		display: block;
		width: 100%;
	}

	.mtbl-tb09 .mtbl-table thead {
		display: none;
	}

	.mtbl-tb09 .mtbl-table tbody tr {
		padding: 14px 0 10px;
		border-bottom: 1px solid var(--mtbl-ink);
	}

	.mtbl-tb09 .mtbl-table tbody tr:last-child {
		border-bottom: none;
	}

	.mtbl-tb09 .mtbl-table td,
	.mtbl-tb09 .mtbl-table th {
		display: flex;
		gap: 8px;
		align-items: baseline;
		padding: 3px 0;
		white-space: normal;
		border-bottom: none;
	}

	.mtbl-tb09 .mtbl-table td::before {
		flex: none;
		min-width: 88px;
		color: var(--mtbl-muted);
		text-align: left;
		content: attr(data-label);
	}

	/*
	 * A stacked row reads left to right, so a number sits next to its label rather than
	 * against the far edge. Without this the label inherits the cell's right alignment
	 * and the column of labels comes out ragged.
	 */
	.mtbl-tb09 .mtbl-table .mtbl-num {
		text-align: left;
	}

	/*
	 * The row's name is underlined, and the underline is exactly as wide as the name —
	 * which is what the cell shrinking to its content is for.
	 *
	 * The catalogue drew this on a `<span>` inside the cell. There is no span here: the
	 * renderer prints the name as text, because it is the only thing in the cell. So the
	 * ported `th[data-lead] > *` matched nothing and the underline was never there at
	 * all — the cell itself carries it now.
	 */
	.mtbl-tb09 .mtbl-table th[data-lead] {
		width: fit-content;
		max-width: 100%;
		margin-bottom: 16px;
		padding-bottom: 2px;
		font-size: 0.95rem;
		border-bottom: 2px solid var(--v-mark-accent);
	}
}

/* ============================================================
   15 · Sticky Rail — both axes pinned, nothing snaps
   ============================================================ */

.mtbl-tb15 .mtbl-scroll {
	max-height: 22rem;
	overflow-y: auto;
}

.mtbl-tb15 .mtbl-table thead th {
	position: sticky;
	top: 0;
	z-index: 3;
	box-shadow: inset 0 -2px 0 var(--v-mark-accent);
	border-bottom: none;
}

.mtbl-tb15 .mtbl-stick thead th:first-child {
	z-index: 5;
}

/* ============================================================
   17 · Terminal Table — the surface it brings with it
   ============================================================ */

.mtbl-tb17 {
	--surf-bg: #12141a;
	--surf-bg-2: #1a1d26;
	--surf-ink: #d7dbe6;
	--surf-muted: #98a0b3;
	--surf-line: #262a35;
}

.mtbl-tb17 .mtbl-term {
	overflow: hidden;
	border-radius: var(--mtbl-radius);
}

.mtbl-tb17 .mtbl-term__bar {
	display: flex;
	align-items: center;
	padding: 8px 12px;
	border-bottom: 1px solid var(--mtbl-line);
}

.mtbl-tb17 .mtbl-term__dots {
	display: flex;
	gap: 5px;
}

.mtbl-tb17 .mtbl-term__dots i {
	display: block;
	width: 9px;
	height: 9px;
	background: var(--mtbl-line);
	border-radius: 50%;
}

.mtbl-tb17 .mtbl-table {
	font-family: ui-monospace, "SF Mono", menlo, consolas, monospace;
	font-size: 0.78rem;
}

.mtbl-tb17 .mtbl-table thead th {
	color: var(--v-ink-accent);
	background: none;
	border-bottom: 1px solid var(--mtbl-line);
}

.mtbl-tb17 .mtbl-table tbody td {
	border-bottom: 1px solid var(--mtbl-line);
}

.mtbl-tb17 .mtbl-stick th:first-child,
.mtbl-tb17 .mtbl-stick td:first-child {
	background: var(--mtbl-surface);
}

/* Its status line is the shared pager in a different coat. */
.mtbl-tb17 .mtbl-pager {
	font-family: ui-monospace, "SF Mono", menlo, consolas, monospace;
	font-size: 0.72rem;
	background: var(--mtbl-surface-2);
	border-bottom: 1px solid var(--mtbl-line);
}

.mtbl-tb17 .mtbl-pager__btn {
	background: var(--mtbl-surface-2);
	border-color: var(--mtbl-line);
}

/* ============================================================
   The folded-away row, and the marker both toggles share
   ============================================================ */

/*
 * A triangle from borders, not a character: generated text lands in the accessibility
 * tree, and both buttons already announce their state through `aria-expanded`.
 */
.mtbl-marker {
	display: inline-block;
	flex: none;
	width: 0;
	height: 0;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	border-left: 5px solid currentcolor;
	transition: transform 0.18s ease;
}

[aria-expanded="true"] > .mtbl-marker {
	transform: rotate(90deg);
}

/*
 * The accessible name, off screen. Our own rule rather than the theme's
 * `.screen-reader-text`: that class belongs to whichever theme is active, and a name
 * that disappears with the theme is no name at all. Same reasoning as the icon link's.
 */
.mtbl-vh {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	border: 0;
	clip-path: inset(50%);
}

/*
 * The toggle stands in a column of its own, and that column asks for no more room than
 * its button: `width: 1px` against a table that distributes what is left, which is how
 * a control column stays a control column when the values beside it grow.
 */
.mtbl-detail__cell,
.mtbl-detail__head {
	width: 1px;
	white-space: nowrap;
}

/*
 * Collapsed, the last value on screen stands in for everything folded away, so it reads
 * against the control rather than adrift in the middle of the row. `enhance.js` marks
 * it, because the folded columns are still siblings and CSS would align one of those.
 */
.mtbl-table .mtbl-summary {

	/*
	 * `1%` is the shrink-to-fit width for a table column: the row's name takes every
	 * pixel that is left, which is what brings the value up against the control instead
	 * of leaving it right-aligned in a column half the table wide.
	 */
	width: 1%;
	text-align: right;
}

.mtbl-detail__toggle {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 3px 7px;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--mtbl-muted);
	cursor: pointer;
	background: none;
	border: none;
	border-radius: 6px;
}

.mtbl-detail__toggle:hover {
	color: var(--v-ink-accent);
	background: color-mix(in oklab, var(--v-accent) 10%, var(--mtbl-surface));
}

.mtbl-detail > td {
	padding: 10px 14px 12px;
	background: color-mix(in oklab, var(--v-accent) 5%, var(--mtbl-surface));
}

.mtbl-detail__values {
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

/* ============================================================
   11 · Priority Collapse — the columns leave in rank order
   ============================================================ */

@container (max-width: 900px) {

	.mtbl-tb11 [data-p="4"] {
		display: none;
	}
}

@container (max-width: 720px) {

	.mtbl-tb11 [data-p="3"] {
		display: none;
	}
}

@container (max-width: 520px) {

	.mtbl-tb11 [data-p="2"] {
		display: none;
	}
}

/* ============================================================
   16 · Group Sections — one heading per run of a value
   ============================================================ */

/*
 * The heading does **not** stick. `overflow-x: auto` makes the scroller a scrollport in
 * both axes, so a `top: 0` inside it would have nothing to stick against unless the
 * table also scrolled vertically — and a table in an article that traps vertical
 * scrolling is exactly what 15 is for. Honest and still: no claim, no trap.
 */
.mtbl-group__head {
	padding: 0;
	font-size: 0.78rem;
	color: var(--v-ink-accent);
	text-align: left;
	background: color-mix(in oklab, var(--v-accent) 12%, var(--mtbl-surface));
	border-bottom: 1px solid color-mix(in oklab, var(--v-mark-accent) 28%, transparent);
}

.mtbl-group__toggle {
	display: flex;
	gap: 8px;
	align-items: center;
	width: 100%;
	padding: 8px 14px;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
	background: none;
	border: none;
}

.mtbl-group__name {
	font-weight: 600;
}

.mtbl-group__count {
	margin-left: auto;
	font-weight: 500;
	color: var(--mtbl-muted);
}

.mtbl-tb16 .mtbl-table tbody tr[hidden] {
	display: none;
}

/* ============================================================
   13 · Column Chooser — the chips
   ============================================================ */

.mtbl-chooser {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	padding: 10px 12px;
	background: var(--mtbl-surface-2);
	border-bottom: 1px solid var(--mtbl-line);
}

.mtbl-chooser__chip {
	padding: 6px 9px;
	font: 500 0.72rem/1 inherit;
	color: var(--mtbl-muted);
	cursor: pointer;
	background: var(--mtbl-surface);
	border: 1px solid var(--mtbl-line);
	border-radius: 6px;
}

.mtbl-chooser__chip[aria-pressed="true"] {
	color: var(--on-accent);
	background: var(--v-accent);
	border-color: var(--v-accent);
}

/*
 * A locked chip is not a chip you failed to press — it is a column that cannot leave. It
 * says so by looking settled rather than faded: opacity would take the contrast with it,
 * which is the trap the catalogue fell into.
 *
 * `[aria-disabled]` rather than `:disabled`, because the chip stays focusable: a
 * disabled button cannot be reached by keyboard, so the one reader who most needs the
 * explanation never gets it. The name says "always shown" and the cursor says it is not
 * a switch.
 */
.mtbl-chooser__chip[aria-disabled="true"] {
	--cellbg: color-mix(in oklab, var(--v-accent) 42%, var(--mtbl-surface));

	color: oklch(from var(--cellbg) clamp(0.14, (0.57 - l) * 1000, 0.97) 0 h);
	cursor: not-allowed;
	background: var(--cellbg);
	border-color: transparent;
}

.mtbl-chooser__status {
	margin: 0 0 0 auto;
	font-size: 0.72rem;
	font-variant-numeric: tabular-nums;
	color: var(--mtbl-muted);
}

/* ============================================================
   14 · Detail Sheet — a native dialog, styled like a sheet
   ============================================================ */

.mtbl-sheet__open {
	display: inline-flex;
	align-items: center;
	margin-left: 8px;
	padding: 4px 6px;
	color: var(--mtbl-muted);
	cursor: pointer;
	background: none;
	border: none;
	border-radius: 6px;
}

.mtbl-sheet__open:hover {
	color: var(--v-ink-accent);
	background: color-mix(in oklab, var(--v-accent) 10%, var(--mtbl-surface));
}

/*
 * Bottom of the viewport rather than the middle: on a phone that is where a sheet comes
 * from, and the whole point of this layout is a gesture people already know.
 */
.mtbl-sheet {
	width: min(34rem, 100%);
	max-width: 100%;
	max-height: 80vh;
	margin: auto auto 0;
	padding: 16px 18px 20px;
	overflow-y: auto;
	color: var(--mtbl-ink);
	background: var(--mtbl-surface);
	border: none;
	border-top: 1px solid var(--mtbl-line);
	border-radius: 16px 16px 0 0;
}

.mtbl-sheet::backdrop {
	background: color-mix(in oklab, #000 45%, transparent);
}

.mtbl-sheet__title {
	margin: 0 0 12px;
	font-size: 1rem;
}

.mtbl-sheet__close {
	width: 100%;
	margin-top: 16px;
	padding: 10px;
	font: 600 0.85rem/1 inherit;
	color: var(--mtbl-ink);
	cursor: pointer;
	background: var(--mtbl-surface-2);
	border: 1px solid var(--mtbl-line);
	border-radius: 9px;
}

@media (prefers-reduced-motion: no-preference) {

	.mtbl-sheet[open] {
		animation: mtbl-sheet-in 0.24s cubic-bezier(0.2, 0.75, 0.25, 1);
	}
}

@keyframes mtbl-sheet-in {

	from {
		transform: translateY(12%);
		opacity: 0;
	}
}


/* ============================================================
   05 / 06 · The heat ramp
   ============================================================ */

/*
 * Eleven steps, and both colours of each step come from the server: the text colour has
 * to be chosen from the *mixed* colour, and only whoever mixed it knows what that is.
 * The rules below are static — what changes per table is the eleven pairs of custom
 * properties on `.mtbl-heat`.
 */
.mtbl-heat [data-mtbl-heat] {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.mtbl-heat [data-mtbl-heat="0"] {
	color: var(--mtbl-heat-0-fg);
	background: var(--mtbl-heat-0-bg);
}

.mtbl-heat [data-mtbl-heat="1"] {
	color: var(--mtbl-heat-1-fg);
	background: var(--mtbl-heat-1-bg);
}

.mtbl-heat [data-mtbl-heat="2"] {
	color: var(--mtbl-heat-2-fg);
	background: var(--mtbl-heat-2-bg);
}

.mtbl-heat [data-mtbl-heat="3"] {
	color: var(--mtbl-heat-3-fg);
	background: var(--mtbl-heat-3-bg);
}

.mtbl-heat [data-mtbl-heat="4"] {
	color: var(--mtbl-heat-4-fg);
	background: var(--mtbl-heat-4-bg);
}

.mtbl-heat [data-mtbl-heat="5"] {
	color: var(--mtbl-heat-5-fg);
	background: var(--mtbl-heat-5-bg);
}

.mtbl-heat [data-mtbl-heat="6"] {
	color: var(--mtbl-heat-6-fg);
	background: var(--mtbl-heat-6-bg);
}

.mtbl-heat [data-mtbl-heat="7"] {
	color: var(--mtbl-heat-7-fg);
	background: var(--mtbl-heat-7-bg);
}

.mtbl-heat [data-mtbl-heat="8"] {
	color: var(--mtbl-heat-8-fg);
	background: var(--mtbl-heat-8-bg);
}

.mtbl-heat [data-mtbl-heat="9"] {
	color: var(--mtbl-heat-9-fg);
	background: var(--mtbl-heat-9-bg);
}

.mtbl-heat [data-mtbl-heat="10"] {
	color: var(--mtbl-heat-10-fg);
	background: var(--mtbl-heat-10-bg);
}

/*
 * A heat cell fills its cell rather than sitting in it: a gradient with gaps in it reads
 * as a pattern instead of a scale.
 */
.mtbl-heat .mtbl-table td[data-mtbl-heat] {
	padding: 0.5rem 0.7rem;
}

.mtbl-tb06 .mtbl-table thead th {
	font-family: ui-monospace, "SF Mono", menlo, consolas, monospace;

	/*
	 * 0.72rem and not 0.7: one small size for the whole module. Measured across all
	 * eighteen layouts, everything under 12px is a label, a column head or a status
	 * line — never a value — and these two were the only ones at 11.2px while every
	 * other label sat at 11.52px. An outlier, not a scale.
	 */
	font-size: 0.72rem;
	text-align: center;
}

/* 05 pins both axes: in a matrix a value without both labels is a number with no meaning. */
.mtbl-tb05 .mtbl-scroll {
	max-height: 22rem;
	overflow-y: auto;
}

.mtbl-tb05 .mtbl-table thead th {
	position: sticky;
	top: 0;
	z-index: 3;
	font-family: ui-monospace, "SF Mono", menlo, consolas, monospace;

	/* The module's one small size; see 06's header above. */
	font-size: 0.72rem;
	background: var(--mtbl-surface-2);
}

.mtbl-tb05 .mtbl-stick thead th:first-child {
	z-index: 5;
}

/* ============================================================
   The four drawings
   ============================================================ */

/*
 * A drawing and its number, side by side. The number is never optional: a cell holding
 * only an `aria-hidden` graphic is an empty cell for a screen reader.
 */
.mtbl-viz {
	display: inline-flex;
	gap: 9px;
	align-items: center;
}

.mtbl-viz__value {
	font-weight: 550;
	font-variant-numeric: tabular-nums;
}

.mtbl-viz__bar {
	position: relative;
	flex: none;
	width: 4.5rem;
	height: 7px;
	overflow: hidden;
	background: var(--mtbl-surface-2);
	border-radius: 4px;
}

.mtbl-viz__bar > i {
	position: absolute;
	inset: 0 auto 0 0;
	background: var(--v-mark-accent);
	border-radius: 4px;
}

.mtbl-viz__ring {
	flex: none;
	width: 34px;
	height: 34px;
}

.mtbl-viz__ring circle {
	fill: none;
	stroke-width: 4;
}

.mtbl-viz__ring .mtbl-viz__fill {
	stroke: var(--v-mark-accent);
	stroke-linecap: round;

	/* From the top, clockwise, the way a dial is read. */
	transform: rotate(-90deg);
	transform-origin: 50% 50%;
}

.mtbl-viz__gauge {
	flex: none;
	width: 62px;
	height: 40px;
}

.mtbl-viz__gauge path {
	fill: none;
	stroke-width: 6;
	stroke-linecap: round;
}

.mtbl-viz__gauge .mtbl-viz__fill {
	stroke: var(--v-mark-accent);
}

.mtbl-viz__needle {
	stroke: var(--mtbl-ink);
	stroke-width: 1.6;
	stroke-linecap: round;
}

.mtbl-viz__track {
	fill: none;
	stroke: var(--mtbl-surface-2);
	stroke-width: 4;
}

.mtbl-viz__gauge .mtbl-viz__track {
	stroke-width: 6;
}

.mtbl-viz__spark {
	flex: none;
	width: 108px;
	height: 26px;
}

.mtbl-viz__line {
	fill: none;
	stroke: var(--v-mark-accent);
	stroke-width: 1.6;
	stroke-linejoin: round;
}

.mtbl-viz__area {
	fill: color-mix(in oklab, var(--v-accent) 18%, var(--mtbl-surface));
	stroke: none;
}

/* ============================================================
   18 · Sparkline Cells
   ============================================================ */

@container (max-width: 640px) {

	.mtbl-tb18 .mtbl-table,
	.mtbl-tb18 .mtbl-table tbody,
	.mtbl-tb18 .mtbl-table tfoot,
	.mtbl-tb18 .mtbl-table tr,
	.mtbl-tb18 .mtbl-table td,
	.mtbl-tb18 .mtbl-table th {
		display: block;
		width: 100%;
	}

	.mtbl-tb18 .mtbl-table thead {
		display: none;
	}

	.mtbl-tb18 .mtbl-caption {
		display: block;
		padding-left: 0;
	}

	.mtbl-tb18 .mtbl-table tbody tr {
		padding: 12px 0 14px;
		border-bottom: 1px solid var(--mtbl-line);
	}

	.mtbl-tb18 .mtbl-table td,
	.mtbl-tb18 .mtbl-table th {
		display: grid;
		grid-template-columns: 5.5rem 1fr;
		gap: 10px;
		align-items: center;
		padding: 4px 0;
		white-space: normal;
		border-bottom: none;
	}

	.mtbl-tb18 .mtbl-table td::before {
		font-size: 0.78rem;
		color: var(--mtbl-muted);
		text-align: left;
		content: attr(data-label);
	}

	.mtbl-tb18 .mtbl-table th[data-lead] {
		grid-template-columns: 1fr auto;
		font-size: 0.95rem;
	}

	/* Narrow, a curve gets the width instead of being cropped to a stub. */
	.mtbl-tb18 .mtbl-viz {
		display: flex;
	}

	.mtbl-tb18 .mtbl-viz__spark {
		flex: 1;
		width: auto;
		height: 40px;
	}
}

/* ============================================================
   19 · Status Board — tiles that keep every column
   ============================================================ */

@container (max-width: 660px) {

	.mtbl-tb19 .mtbl-table,
	.mtbl-tb19 .mtbl-table tbody,
	.mtbl-tb19 .mtbl-table tr,
	.mtbl-tb19 .mtbl-table td,
	.mtbl-tb19 .mtbl-table th {
		display: block;
	}

	.mtbl-tb19 .mtbl-table thead {
		display: none;
	}

	.mtbl-tb19 .mtbl-caption {
		display: block;
		padding-left: 0;
	}

	.mtbl-tb19 .mtbl-table tbody {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
		gap: 10px;
		padding: 12px;
	}

	.mtbl-tb19 .mtbl-table tbody tr {
		display: grid;
		gap: 6px;
		padding: 12px;
		background: var(--mtbl-surface);
		border: 1px solid var(--mtbl-line);
		border-radius: 12px;
	}

	.mtbl-tb19 .mtbl-table td,
	.mtbl-tb19 .mtbl-table th {
		padding: 0;
		white-space: normal;
		border-bottom: none;
	}

	/*
	 * Every column is in the tile — the design this is based on dropped the last one
	 * below its breakpoint, and a layout may fold a value away but never discard it.
	 */
	.mtbl-tb19 .mtbl-table td::before {
		display: block;
		font-size: 0.7rem;
		color: var(--mtbl-muted);
		text-align: left;
		content: attr(data-label);
	}

	.mtbl-tb19 .mtbl-table .mtbl-num {
		text-align: left;
	}

	.mtbl-tb19 .mtbl-table th[data-lead] {
		font-size: 0.85rem;
	}
}

/* ============================================================
   20 · Gauge Panel — a rack of instruments
   ============================================================ */

.mtbl-tb20 {
	--surf-bg: #2c3038;
	--surf-bg-2: #23262d;
	--surf-ink: #e8eaf0;
	--surf-muted: #a3abbd;
	--surf-line: #3d434e;
}

.mtbl-tb20 .mtbl-records {
	display: grid;
	gap: 8px;
	padding: 12px;
	background: #23262d;
	border-radius: var(--mtbl-radius);
}

.mtbl-tb20 .mtbl-records__item + .mtbl-records__item {
	border-top: none;
}

.mtbl-tb20 .mtbl-panel {
	display: grid;
	grid-template-columns: minmax(7rem, 1fr) auto;
	gap: 10px 14px;
	align-items: center;
	padding: 11px 14px;
	border: 1px solid var(--mtbl-line);
	border-radius: 8px;
	box-shadow: inset 0 1px 0 color-mix(in oklab, var(--mtbl-line) 72%, var(--mtbl-ink));
}

.mtbl-tb20 .mtbl-panel__name {
	font-family: ui-monospace, "SF Mono", menlo, consolas, monospace;
	font-size: 0.82rem;
	font-weight: 550;
}

.mtbl-tb20 .mtbl-panel__readout {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: flex-end;
}

.mtbl-tb20 .mtbl-panel__instrument {
	display: grid;
	justify-items: center;
	color: var(--mtbl-muted);
}

/*
 * The caption's size is set here and not inherited. `<small>` shrinks whatever it sits
 * in, and it sat in a container already at 0.66rem: the two reductions multiplied to
 * **8.8px**, measured — not a size anybody reads a needle's label at.
 */
.mtbl-tb20 .mtbl-panel__instrument small {
	font-size: 0.72rem;
}

.mtbl-tb20 .mtbl-panel__values {
	grid-column: 1 / -1;
	padding-top: 8px;
	border-top: 1px solid var(--mtbl-line);
}

@container (max-width: 560px) {

	.mtbl-tb20 .mtbl-panel {
		grid-template-columns: 1fr;
	}

	.mtbl-tb20 .mtbl-panel__readout {
		justify-content: flex-start;
	}

	/*
	 * Two columns of readings rather than one. The shared `.mtbl-values` grid asks for
	 * 140px a column, which needs 298px with the gap — four more than a panel has at
	 * 390px, so every reading took its own row and a rack of five services ran to
	 * 1586px. A rack is read one panel at a time, so the panel should at least fit on
	 * a screen.
	 */
	.mtbl-tb20 .mtbl-panel__values .mtbl-values {
		gap: 8px 12px;
		grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
	}
}

/* ============================================================
   10 · Record Pager — the table above the breakpoint, cards below
   ============================================================ */

/*
 * Two markups, one of them rendered. `display: none` and deliberately not a visually
 * hidden copy: the half that is not on screen has to be gone for a screen reader too,
 * or the block reads everything twice and the two readings disagree.
 */
.mtbl-tb10 .mtbl-hybrid--records {
	display: none;
}

@container (max-width: 640px) {

	.mtbl-tb10 .mtbl-hybrid--records {
		display: block;
	}

	.mtbl-tb10 .mtbl-hybrid--table {
		display: none;
	}
}

/*
 * The list is a row inside the scroller, so its own width stays the scroller's and the
 * cards overflow it — which is what makes `flex-basis: 100%` mean "one record per view"
 * rather than "one record per list".
 */
.mtbl-tb10 .mtbl-records {
	display: flex;
}

.mtbl-tb10 .mtbl-scroll {
	scroll-snap-type: x mandatory;
}

.mtbl-tb10 .mtbl-records__item {
	flex: 0 0 100%;
	scroll-snap-align: start;

	/*
	 * The shared list rule rules off stacked records from one another. These sit side
	 * by side, one per view, so a line above each is a line through the middle of the
	 * card in front.
	 */
	border-top: 0;
	border-right: 1px solid var(--mtbl-line);
}

.mtbl-tb10 .mtbl-records__item:last-child {
	border-right: none;
}

.mtbl-tb10 .mtbl-record {
	padding: 14px 16px 18px;
}

.mtbl-tb10 .mtbl-record__name {
	margin-bottom: 12px;
	padding-bottom: 8px;
	font-size: 1.04rem;
	font-weight: 600;
	border-bottom: 2px solid var(--v-mark-accent);
}

.mtbl-tb10 .mtbl-record__values {
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/*
 * The pager's second display: one mark per page, the one you are on stretched into a
 * line. The mechanic is the same — a layout picks the display (the spec's *one
 * mechanic, many displays*), and where the columns are cards you are flicking through
 * them, so the marks sit under the cards rather than labelling them from above.
 */
.mtbl-pager--dots {
	justify-content: flex-start;
	margin-top: 8px;
	border-top: 1px solid var(--mtbl-line);
	border-bottom: none;
}

.mtbl-pager__dots {
	display: flex;
	gap: 5px;
	align-items: center;
}

.mtbl-pager__dots i {
	display: block;
	width: 6px;
	height: 6px;
	background: var(--mtbl-line);
	border-radius: 50%;
	transition: width 0.2s, background 0.2s;
}

.mtbl-pager__dots i.is-here {
	width: 18px;
	background: var(--v-mark-accent);
	border-radius: 3px;
}

.mtbl-pager__dots i.is-seen {
	background: color-mix(in oklab, var(--v-mark-accent) 40%, var(--mtbl-line));
}

/*
 * The pager's third display: a rail under the table that fills as the reader scrolls
 * **down** it.
 *
 * It answers a question the other two cannot, which is why it exists rather than being
 * a prettier counter. The count, the dots and the buttons are all about the columns —
 * the axis the pager moves. This is the other axis: a table of twenty rows in a box
 * 22rem tall is a table whose reader has no way of telling how much is left.
 */
.mtbl-pager--track {
	flex-wrap: wrap;
	margin-top: 8px;
	border-top: 1px solid var(--mtbl-line);
	border-bottom: none;
}

.mtbl-pager__track {
	position: relative;
	flex: 1 0 100%;
	height: 4px;
	overflow: hidden;
	background: var(--mtbl-line);
	border-radius: 2px;
}

.mtbl-pager__track i {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	background: var(--v-mark-accent);
	border-radius: 2px;
	transition: width 0.18s;
}

@media (prefers-reduced-motion: reduce) {

	.mtbl-pager__dots i {
		transition: none;
	}
}
