/*
 * Lempar — component layer.
 *
 * The small set of app-like pieces the coach screens are built from (T-083):
 * tone classes, card and expanding row, filter chip, segmented control,
 * three-state chip, save bar, bottom tab bar, sheet, timeline. Plugins put
 * these classes on their own markup and write no colour or typeface of their
 * own; `docs/DECISIONS.md`, "The theme is the design authority", is why.
 *
 * Every colour here is a preset, or is derived from one with color-mix(), so
 * each component follows the light and dark scheme without a rule of its own
 * for either; the literal colours, the sheet's backdrop and the lightbox's
 * frame and close control, each say why. Radii are the card, small and pill
 * tokens, except three inner radii that are commented where they occur.
 * The 0.75rem label size is the site's existing eyebrow and pill size, not
 * a new step.
 *
 * Loaded on every front-end request rather than on plugin routes only: a
 * plugin cannot name this stylesheet as a dependency, because WordPress drops
 * a stylesheet whose dependency is missing, so a plugin that did would lose
 * its own styles whenever the theme was switched.
 *
 * The vocabulary, and which status takes which tone, is tabulated in the
 * theme's CLAUDE.md. Renaming a class here unstyles a plugin screen silently.
 */

/* -------------------------------------------------------------------------
 * 0. The hidden attribute
 *
 * `hidden` wins over every component. The browser's own rule for it is
 * `display: none` at the lowest priority there is, so any author rule that
 * sets display beats it, and 30 in this file do: a plugin that hid a
 * themed element the way HTML says to found it still painted. Found by
 * Management (T-088), whose coach saw the previous player's WhatsApp link,
 * hidden but visible, and tapped it.
 *
 * One rule rather than a guard beside each display: it covers an element
 * carrying a component class, any direct child of one (tab-bar items,
 * segmented and three-state options, the save bar's buttons are bare
 * elements styled through their parent), and the theme's block styles.
 * `!important` because specificity cannot keep up: the component rules
 * reach (0,3,1) today and will grow, and this rule only ever hides, so
 * there is nothing for it to override wrongly. The alternative, a
 * site-wide `[hidden]` reset, was rejected as reaching every plugin's and
 * core's markup for a problem only the theme's classes cause.
 *
 * `hidden="until-found"` is exempt: it must stay in the layout, collapsed,
 * so find-in-page can open it, and display none would break that.
 * ---------------------------------------------------------------------- */

:is([class*="lempar-"], [class*="lempar-"] > *, [class*="is-style-"])[hidden]:not([hidden="until-found"]) {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * 1. Tones
 *
 * A tone is a colour with a meaning, set once and read by whichever
 * component carries it: pill, button, segment, three-state option,
 * timeline dot. Components never name spirit or alert directly, so a status
 * can change tone in one place.
 *
 * The tint is the tone at 20% over whatever is behind it, and the ink is 40%
 * tone into --contrast. Mixing into --contrast darkens in the light scheme
 * and lightens in the dark one, so one formula serves both. Measured
 * 2026-09-25 across all four tones, on base and on surface, in both
 * schemes, each ink against its own tint laid over that ground: the lowest
 * is highlight over the light base, 4.77:1 computed and 4.74:1 measured in
 * the browser. At 50% tone that case fell to 3.69:1, which is why it is 40.
 * Against the bare ground, without the tint, every figure is higher.
 *
 * Four more for a role's pill (T-612), one colour a role: accent, field,
 * and sky and violet, two presets made for it, chosen so that each ink
 * reads 4.5:1 or better on its tint over base, surface and raised in
 * both schemes, and so that sky and violet stand as far apart as accent
 * and highlight do. A tone's meaning is the plugin's map; the theme only
 * draws it.
 * ---------------------------------------------------------------------- */

.is-tone-spirit {
	--lempar-tone: var(--wp--preset--color--spirit);
}

.is-tone-highlight {
	--lempar-tone: var(--wp--preset--color--highlight);
}

.is-tone-muted {
	--lempar-tone: var(--wp--preset--color--muted);
}

.is-tone-alert {
	--lempar-tone: var(--wp--preset--color--alert);
}

.is-tone-accent {
	--lempar-tone: var(--wp--preset--color--accent);
}

.is-tone-field {
	--lempar-tone: var(--wp--preset--color--field);
}

.is-tone-sky {
	--lempar-tone: var(--wp--preset--color--sky);
}

.is-tone-violet {
	--lempar-tone: var(--wp--preset--color--violet);
}

:root {
	/*
	 * Items 3.25rem plus 0.5rem above and below, plus the home indicator on
	 * handsets that have one. The save bar and the page's own bottom padding
	 * both read this, so the three cannot disagree.
	 */
	--lempar-tabbar-height: calc(4.25rem + env(safe-area-inset-bottom, 0px));

	/*
	 * A game's state, for plugins that draw scores (T-132). Win is spirit and
	 * loss is alert, the tones those statuses already have; live stays the
	 * coral it has always been on frisbee.id. Each has an ink for text, by the
	 * tone formula below, because the bare colours are for fills, borders and
	 * dots: as text in the light scheme live is 2.82:1 on surface and win
	 * 2.17:1, and the inks are 7.25:1 and 6.38:1 over a 10% tint of their own.
	 * Declared on :root, where the dark scheme's presets are also declared,
	 * so they follow the scheme.
	 */
	--lempar-live: var(--wp--preset--color--accent);
	--lempar-win: var(--wp--preset--color--spirit);
	--lempar-loss: var(--wp--preset--color--alert);
	--lempar-live-ink: color-mix(in srgb, var(--lempar-live) 40%, var(--wp--preset--color--contrast));
	--lempar-win-ink: color-mix(in srgb, var(--lempar-win) 40%, var(--wp--preset--color--contrast));
	--lempar-loss-ink: color-mix(in srgb, var(--lempar-loss) 40%, var(--wp--preset--color--contrast));

	/*
	 * A timetable's cells (T-334, the schedule builder's step 4): a slot
	 * holding a game, the game being moved, a free slot it may go to, and
	 * a slot it may not, which says why. Each has its colour for a border
	 * or a fill, its `-tint` for the cell's ground, and its `-ink` for the
	 * words on that tint, by the tone formula below. The game being moved
	 * is where you are, so the accent (T-083); free is spirit's "yes",
	 * blocked alert's "no", and a game is the plain surface and the page's
	 * ink. A plugin draws the cell; these keep one meaning one colour.
	 */
	--lempar-slot-game: var(--wp--preset--color--line);
	--lempar-slot-game-tint: var(--wp--preset--color--surface);
	--lempar-slot-game-ink: var(--wp--preset--color--contrast);
	--lempar-slot-moving: var(--wp--preset--color--accent);
	--lempar-slot-moving-tint: color-mix(in srgb, var(--wp--preset--color--accent) 20%, var(--wp--preset--color--surface));
	--lempar-slot-moving-ink: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
	--lempar-slot-free: var(--wp--preset--color--spirit);
	--lempar-slot-free-tint: color-mix(in srgb, var(--wp--preset--color--spirit) 12%, var(--wp--preset--color--surface));
	--lempar-slot-free-ink: color-mix(in srgb, var(--wp--preset--color--spirit) 40%, var(--wp--preset--color--contrast));
	--lempar-slot-blocked: var(--wp--preset--color--alert);
	--lempar-slot-blocked-tint: color-mix(in srgb, var(--wp--preset--color--alert) 12%, var(--wp--preset--color--surface));
	--lempar-slot-blocked-ink: color-mix(in srgb, var(--wp--preset--color--alert) 40%, var(--wp--preset--color--contrast));
}

/*
 * Declared beside the tone rather than once on :root, because a custom
 * property's var() is resolved where it is declared: on :root there is no
 * tone yet, and the tint would inherit as nothing.
 */
[class*="is-tone-"] {
	--lempar-tone-tint: color-mix(in srgb, var(--lempar-tone) 20%, transparent);
	--lempar-tone-ink: color-mix(in srgb, var(--lempar-tone) 40%, var(--wp--preset--color--contrast));
}

/*
 * The site's existing pill, given a tone, becomes a status badge. One pill
 * rather than a second badge class: a toneless .is-style-pill keeps the
 * filled highlight it has always had. There was a `lempar-pill` alias; it
 * was removed before anything used it, because its toneless form had no
 * fill and rendered as bare text.
 */
:where(.is-style-pill) {
	display: inline-block;
	flex-shrink: 0;
	margin: 0;
	padding: 0.25rem 0.625rem;
	border-radius: var(--wp--custom--radius--pill);
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1.5;
	white-space: nowrap;
}

.is-style-pill[class*="is-tone-"] {
	background-color: var(--lempar-tone-tint);
	color: var(--lempar-tone-ink);
}

/* -------------------------------------------------------------------------
 * 2. Card, row and the expanding row
 *
 * A card is lempar's card — the same radius, surface and shadow as
 * .is-style-card — without its padding, because what sits inside is a row
 * or a body that carries its own. A row is one line: avatar, a title over a
 * caption, and something at the end. Inside <summary> it expands its card;
 * as a link it goes somewhere; either way the whole line is the target.
 * ---------------------------------------------------------------------- */

.lempar-stack {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

/*
 * As a list, which a stack of links usually is: its items stay list items
 * inside the flex column, so without this they keep the browser's markers
 * and the list's 40px indent (Management's club links under Saya, T-179).
 */
ul.lempar-stack,
ol.lempar-stack {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lempar-card {
	box-sizing: border-box;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--card);
	color: var(--wp--preset--color--contrast);
}

.lempar-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
}

/* An expanded body is divided from the row that opened it. */
.lempar-row + .lempar-card__body {
	border-top: 1px solid var(--wp--preset--color--line);
}

.lempar-row {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	width: 100%;
	min-height: 4rem;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: start;
	text-decoration: none;
}

/*
 * A row that is also a card keeps the card's surface. `.lempar-row` clears
 * its background and comes later in the file than `.lempar-card`, at the
 * same specificity, so from 1.1.0 every card-row — the demo's link row, its
 * three-state rows, a chosen lesson — was transparent: measured 2026-09-28,
 * `rgba(0, 0, 0, 0)` against a plain card's white. Found measuring T-127.
 */
.lempar-card.lempar-row {
	background-color: var(--wp--preset--color--surface);
}

:is(a, button, summary).lempar-row {
	cursor: pointer;
}

summary.lempar-row {
	list-style: none;
}

summary.lempar-row::-webkit-details-marker {
	display: none;
}

/*
 * The chevron is drawn by the row, not supplied by the plugin, so every
 * expanding row and every link row points the same way. Down when closed,
 * up when open, right on a link.
 */
:is(summary, a).lempar-row::after {
	content: "";
	flex-shrink: 0;
	width: 0.5rem;
	height: 0.5rem;
	margin-inline: 0.25rem 0.375rem;
	border-right: 2px solid var(--wp--preset--color--muted);
	border-bottom: 2px solid var(--wp--preset--color--muted);
	transform: translateY(-0.125rem) rotate(45deg);
	transition: transform 0.2s ease;
}

details[open] > summary.lempar-row::after {
	transform: translateY(0.125rem) rotate(-135deg);
}

a.lempar-row::after {
	transform: rotate(-45deg);
}

.lempar-row__main {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 0.125rem;
	min-width: 0;
}

.lempar-row__title {
	overflow: hidden;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.lempar-row__meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.35;
}

/*
 * A row whose title is a sentence (T-258). A title is a name, kept to one
 * line and cut with an ellipsis so a list of people keeps its rhythm; on
 * Saya a row's title is the whole message, and at 375 "3 players without a
 * jersey number" beside its action read "3 players without a jers…". With
 * `lempar-row--wraps` on the row the title runs to as many lines as it
 * needs and the row grows with it; the end slot and the chevron stay in the
 * middle of the row's height, as on any row. A word longer than the line
 * breaks rather than pushing the end slot off the row.
 */
.lempar-row--wraps .lempar-row__title {
	overflow: visible;
	white-space: normal;
	overflow-wrap: anywhere;
	text-overflow: clip;
}

.lempar-row__end {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
}

/*
 * A row that is chosen (T-127): `button.lempar-row` in a `role="group"`,
 * with `aria-pressed`, one pressed at a time — the lesson chooser's rows.
 * Pressed reads as the pressed stat tile and filter chip do: a 2px accent
 * ring, a 10% accent tint laid over whatever the row sits on, and the
 * accent ink on its title; the 10% keeps the muted caption above AA, as
 * measured for the tile. A button row draws no chevron (only `summary` and
 * `a` rows do), and is already full width, left-aligned and 4rem tall.
 */
button.lempar-row[aria-pressed="true"] {
	background-image: linear-gradient(color-mix(in srgb, var(--wp--preset--color--accent) 10%, transparent), color-mix(in srgb, var(--wp--preset--color--accent) 10%, transparent));
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--accent);
}

/* A row that is also a card keeps the card's own shadow beneath the ring. */
button.lempar-card.lempar-row[aria-pressed="true"] {
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--accent), var(--wp--preset--shadow--card);
}

button.lempar-row[aria-pressed="true"] .lempar-row__title {
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
}

.lempar-avatar {
	box-sizing: border-box;
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--tap-target);
	height: var(--wp--custom--tap-target);
	overflow: hidden;
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
}

.lempar-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lempar-avatar--large {
	width: 4.5rem;
	height: 4.5rem;
	border-radius: var(--wp--custom--radius--card);
	font-size: var(--wp--preset--font-size--large);
}

/* The day-and-date tile that leads a session row. */
.lempar-date {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	align-items: center;
	width: 3rem;
	padding: 0.375rem 0;
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--base);
	line-height: 1.15;
}

.lempar-date__day {
	color: var(--wp--preset--color--muted);
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
}

.lempar-date__number {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

/*
 * Figures in a row of three. A tile sits on the page's surface, or on the
 * page's base when it is inside a card or a sheet, so it always reads as a
 * well.
 */
.lempar-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
	gap: var(--wp--preset--spacing--20);
}

.lempar-stat {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	padding: 0.625rem var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface);
}

:is(.lempar-card, .lempar-sheet) .lempar-stat {
	background-color: var(--wp--preset--color--base);
}

.lempar-stat__value {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
}

/*
 * A tile that is also the filter for what it counts (T-092): Aaron had the
 * attendance screen's summary tiles replace the chip row above them. As a
 * <button aria-pressed> it looks exactly like the plain tile until pressed,
 * and the whole tile is the target.
 *
 * Pressed reads as the pressed chip does — accent border, accent tint,
 * accent ink — with two measured differences. The tint is 10%, not the
 * chip's 20%: a tile keeps muted text (its label and its caption line),
 * and muted over a 20% accent tint on the light base is 4.08:1, under AA;
 * at 10% the lowest case is 4.51:1. And the border is 2px, not 1px, because
 * a hairline round a tile this size reads as an outline rather than a
 * state. The value takes the accent ink, 6.83:1 at worst, as the chip's
 * label does, so pressed does not rest on the accent border alone, which is
 * 2.64:1 against the light base.
 *
 * The tint is a background image laid over the tile's own ground, so it
 * works on surface or on base, and the borders are inset shadows so that
 * pressing a tile moves nothing. Focus is lempar.css's shared ring, the one
 * the chips use.
 */
button.lempar-stat {
	appearance: none;
	box-sizing: border-box;
	width: 100%;
	min-height: var(--wp--custom--tap-target);
	margin: 0;
	border: 0;
	color: inherit;
	font: inherit;
	text-align: start;
	cursor: pointer;
}

button.lempar-stat:hover {
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--contrast);
}

button.lempar-stat[aria-pressed="true"] {
	background-image: linear-gradient(color-mix(in srgb, var(--wp--preset--color--accent) 10%, transparent), color-mix(in srgb, var(--wp--preset--color--accent) 10%, transparent));
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--accent);
}

button.lempar-stat[aria-pressed="true"] .lempar-stat__value {
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
}

/*
 * A tile that opens a region, and the region (T-253). Where a pressed tile
 * filters the list it sits over, an expanded tile opens something new
 * beneath the tiles: `button.lempar-stat` with `aria-expanded` and
 * `aria-controls`, and the region it names as `.lempar-region`.
 *
 * The look is Aaron's from T-229, moved here from Management, which drew
 * it first: "it's currently very subtle and initially I missed that a new
 * section has appeared". So the open tile is solid accent, stronger than a
 * pressed one on purpose, and the region reads as a thing that appeared:
 * an accent edge and a 7% accent tint of the surface, not more list. The
 * plugin adds `is-opening` to replay the entrance, a 200ms slide and fade,
 * on each open and on a switch between tiles; under reduced motion there
 * is none, and the colour and the edge carry it. `hidden` on the region
 * holds, by §0.
 *
 * After the hover rule above, which it must beat at equal weight: a hovered
 * open tile keeps its accent ring.
 */
button.lempar-stat[aria-expanded="true"] {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-contrast);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--accent);
}

button.lempar-stat[aria-expanded="true"] :is(.lempar-stat__value, .is-style-eyebrow, .lempar-row__meta) {
	color: inherit;
}

.lempar-region {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--40);
	border-left: 4px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius--card);
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 7%, var(--wp--preset--color--surface));
	scroll-margin-top: var(--wp--preset--spacing--40);
}

.lempar-region > :is(h3, p) {
	margin: 0;
}

.lempar-region.is-opening {
	animation: lempar-region-in 200ms ease-out;
}

@keyframes lempar-region-in {
	from {
		opacity: 0;
		transform: translateY(-0.5rem);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* -------------------------------------------------------------------------
 * 2a. Facts: details that read as a profile (T-100)
 *
 * A person's or a session's details are read first and edited one field at
 * a time (STANDARDS, "Screens a coach uses"): each row is a label, a value
 * ("Not set" when empty, with is-empty) and a quiet edit button; editing a
 * row hides its value and shows its editor in place. Markup:
 *
 *   dl.lempar-facts
 *     div.lempar-fact [.is-empty] [.is-editing]
 *       dt.lempar-fact__label           (may end in span.lempar-fact__dot, §3)
 *       dd.lempar-fact__value
 *       button.lempar-fact__edit        (aria-label, an icon in currentColor)
 *       div.lempar-fact__editor[hidden] (the plugin's field and refusal)
 *
 * The plugin toggles is-editing on the row and `hidden` on the editor;
 * §0 makes `hidden` hold. The label sits above the value in a narrow list
 * and beside it from 28rem of the list's own width, a container query
 * rather than a viewport one for the reason the app layout gives: the
 * docked panel, about 470px of content, reads label-beside-value, a phone
 * label-above.
 * ---------------------------------------------------------------------- */

.lempar-facts {
	container-type: inline-size;
	container-name: lempar-facts;
	margin: 0;
	padding: 0;
}

.lempar-fact {
	display: grid;
	grid-template-areas:
		"label  edit"
		"value  edit"
		"editor editor";
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: var(--wp--preset--spacing--30);
	align-items: center;
	padding: var(--wp--preset--spacing--30) 0;
}

.lempar-fact + .lempar-fact {
	border-top: 1px solid var(--wp--preset--color--line);
}

.lempar-fact__label {
	grid-area: label;
	margin: 0;
	color: var(--wp--preset--color--muted);
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1.4;
}

.lempar-fact__value {
	grid-area: value;
	margin: 0;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.lempar-fact.is-empty .lempar-fact__value {
	color: var(--wp--preset--color--muted);
}

.lempar-fact.is-editing .lempar-fact__value {
	display: none;
}

.lempar-fact__edit {
	grid-area: edit;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--tap-target);
	height: var(--wp--custom--tap-target);
	padding: 0;
	border: 0;
	border-radius: var(--wp--custom--radius--small);
	background: transparent;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
}

.lempar-fact__edit:hover {
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
}

.lempar-fact__edit svg {
	width: 1.125rem;
	height: 1.125rem;
}

.lempar-fact__editor {
	grid-area: editor;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	min-width: 0;
	padding-top: var(--wp--preset--spacing--20);
}

@container lempar-facts (min-width: 28rem) {
	.lempar-fact {
		grid-template-areas:
			"label value  edit"
			"label editor editor";
		grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) auto;
	}

	/* One class more than the phone rule in §2b, which comes later in the file. */
	.lempar-facts .lempar-fact > :is(.lempar-field-error, .lempar-field-note) {
		grid-column: 2 / -1;
	}

	/* Beside the value, the label lines up with its first line of text. */
	.lempar-fact__label {
		align-self: start;
		padding-top: 0.625rem;
	}

	/* While editing, the editor takes the value's place beside the label. */
	.lempar-fact.is-editing {
		grid-template-areas: "label editor edit";
	}

	.lempar-fact.is-editing .lempar-fact__editor {
		padding-top: 0;
	}

	/* A tall editor would otherwise pull the button to its middle. */
	.lempar-fact.is-editing .lempar-fact__edit {
		align-self: start;
	}
}

/*
 * Compact (T-158): `dl.lempar-facts.is-compact` for a block of details that
 * is read past rather than read, such as a club's under Saya. The value
 * takes the small preset and the rows lose most of their padding; the edit
 * button keeps its 44px, so it, not the padding, now sets a row's height.
 */
.lempar-facts.is-compact .lempar-fact {
	padding: 0.25rem 0;
}

.lempar-facts.is-compact .lempar-fact__value {
	font-size: var(--wp--preset--font-size--small);
}

@container lempar-facts (min-width: 28rem) {
	/* The smaller value sits lower in the 44px row; the label follows it. */
	.lempar-facts.is-compact .lempar-fact__label {
		padding-top: 0.8125rem;
	}
}

/* -------------------------------------------------------------------------
 * 2b. The words under a wrong field (T-104)
 *
 * lempar.css draws the field; this is the sentence under it. The plugin
 * writes the words — what is wrong and how to fix it, in the site's
 * language — puts them in a `p.lempar-field-error` directly after the
 * field, gives it an id, and names that id in the field's
 * `aria-describedby`. It hides the message with `hidden` while the field
 * is right (§0 holds that).
 *
 * The alert ink, bold, with a small alert mark before it that a screen
 * reader skips; close under its field and clear of the next, so it reads
 * as that field's. Measured: the ink 10.83:1 on white, 10.13:1 on the
 * light base, 10.43:1 and 12.05:1 in dark; the mark's "!" 5.14:1 and
 * 7.49:1 on its disc.
 * ---------------------------------------------------------------------- */

.lempar-field-error {
	--lempar-tone: var(--wp--preset--color--alert);

	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0.375rem 0 var(--wp--preset--spacing--40);
	color: color-mix(in srgb, var(--lempar-tone) 40%, var(--wp--preset--color--contrast));
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.4;
}

.lempar-field-error::before {
	content: "!" / "";
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 1.125rem;
	height: 1.125rem;
	margin-top: 0.0625rem;
	border-radius: 50%;
	background-color: var(--wp--preset--color--alert);
	color: var(--wp--preset--color--alert-contrast);
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1;
}

/*
 * A note, not an error (T-105): a field that is right but worth a second
 * look — a new name another player already has. The save still goes
 * through, so nothing is red and the field keeps its border; the plugin
 * sets no `aria-invalid`. Markup as for the error: `p.lempar-field-note`
 * directly after the field (or after a fact's value in view mode), its
 * id in the field's `aria-describedby`, `hidden` when there is nothing to
 * say; the plugin writes the words.
 *
 * Highlight ink, a weight lighter than the error's, and an "i" mark. The
 * mark's disc is the ink and its letter the surface, as the approval badge
 * is drawn, because plain highlight is 1.44:1 against a white card and the
 * disc would vanish. Measured: ink 5.43:1 on white, 5.08:1 on the light
 * base, 12.80 and 14.78 in dark; the mark the same.
 */
.lempar-field-note {
	--lempar-tone: var(--wp--preset--color--highlight);

	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0.375rem 0 var(--wp--preset--spacing--40);
	color: color-mix(in srgb, var(--lempar-tone) 40%, var(--wp--preset--color--contrast));
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.4;
}

.lempar-field-note::before {
	content: "i" / "";
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 1.125rem;
	height: 1.125rem;
	margin-top: 0.0625rem;
	border-radius: 50%;
	background-color: color-mix(in srgb, var(--lempar-tone) 40%, var(--wp--preset--color--contrast));
	color: var(--wp--preset--color--surface);
	font-size: 0.75rem;
	font-weight: 800;
	font-style: normal;
	line-height: 1;
}

/* In a fact's editor the editor's own gap does the spacing. */
.lempar-fact__editor :is(.lempar-field-error, .lempar-field-note) {
	margin: 0;
}

/* Under a fact's value in view mode: across the row on a phone. */
.lempar-fact > :is(.lempar-field-error, .lempar-field-note) {
	grid-column: 1 / -1;
	margin: 0.25rem 0 0;
}

/* -------------------------------------------------------------------------
 * 3. Buttons
 *
 * The primary action is the site's own button: give the element
 * `wp-element-button` and global styles do the rest. A second primary look
 * for coach screens would be the two-sites problem in miniature. Its white
 * on coral measures 2.82:1 and stays: Aaron chose it over dark text and a
 * darker coral on 2026-09-25 (docs/DECISIONS.md, "The primary button is
 * white on the coral"), so an audit that finds it has found a decision.
 * What the site lacked is the quiet button that sits inside a card, and the
 * dashed one for a bulk action like "mark everyone present".
 * ---------------------------------------------------------------------- */

.lempar-button {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--20);
	min-height: var(--wp--custom--tap-target);
	padding: 0 var(--wp--preset--spacing--40);
	border: 0;
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.lempar-button--quiet {
	border: 1px dashed var(--wp--preset--color--line);
	background: transparent;
}

/* A mouse hover only: a tap leaves the button as it was (T-440). */
@media (hover: hover) {
	.lempar-button:hover {
		background-color: var(--wp--preset--color--line);
	}
}

/*
 * Global styles colour every hovered link accent, from a rule whose
 * specificity (0,1,0) ties with a single component class, so which wins
 * would depend on stylesheet order. Measured on the home page, global
 * styles print first and lose; on these, element plus class plus :hover
 * wins whatever the order.
 */
a.lempar-row:hover {
	color: inherit;
}

a.lempar-button:hover {
	color: var(--wp--preset--color--contrast);
}

.lempar-button svg {
	flex-shrink: 0;
	width: 1.125rem;
	height: 1.125rem;
}

/*
 * A toned button reads its tone the way a toned pill does: tint for the
 * ground, ink for the label, and an icon drawn in currentColor follows the
 * ink. First asked for by Management's WhatsApp button, which is always on
 * the person sheet and, with no number stored, carries the alert tone and a
 * cross (T-089).
 *
 * Hover deepens the tint to 30%, where the lowest pair is still highlight
 * over the light base at 4.61:1. The hover rule names the element so that
 * it outranks `a.lempar-button:hover` (0,2,1) above, which would otherwise
 * turn a toned link's label back to --contrast.
 */
.lempar-button[class*="is-tone-"] {
	background-color: var(--lempar-tone-tint);
	color: var(--lempar-tone-ink);
}

/* A mouse hover only: a tap leaves the button as it was (T-440). */
@media (hover: hover) {
	:is(a, button).lempar-button[class*="is-tone-"]:hover {
		background-color: color-mix(in srgb, var(--lempar-tone) 30%, transparent);
		color: var(--lempar-tone-ink);
	}
}

/*
 * A button that is only an icon, and a dot it can carry (T-277, for the
 * person sheet's header, T-276: a key and a pencil at the top right).
 *
 *   button.lempar-button.lempar-button--icon   (aria-label; one svg in
 *                                               currentColor)
 *     span.lempar-button__dot[aria-hidden="true"]   (optional; `hidden`
 *                                                    takes it away)
 *
 * The button is `lempar-button` made square at the tap target, so it takes
 * `--quiet` and a tone as any button does; its icon is 20px where a
 * labelled button's is 18, since the icon is all there is. A plain
 * `lempar-button` holding only an icon came out 44 high and 50 wide, and
 * the square controls the layer had, the popover's trigger and a fact's
 * pencil, belong to their own components.
 *
 * The dot says "something here wants you" and nothing more precise; the
 * button's `aria-label` carries the words, so the dot is hidden from a
 * screen reader. It is the bare alert colour, which is for fills and dots,
 * 11px at the top right inside the square, with a 2px ring of --surface
 * that cuts it from the button and from the icon it overlaps: told apart
 * by lightness and by the ring, not by its hue alone. It takes no tone:
 * one dot, one meaning.
 *
 * Working (§3a), the ring stands in for the icon rather than beside it,
 * so the square stays a square.
 */
.lempar-button--icon {
	position: relative;
	flex-shrink: 0;
	width: var(--wp--custom--tap-target);
	padding: 0;
}

.lempar-button--icon svg {
	width: 1.25rem;
	height: 1.25rem;
}

.lempar-button--icon[aria-busy="true"] svg {
	display: none;
}

/* One disc, wherever it sits: the button's, and a fact label's below. */
.lempar-button__dot,
.lempar-fact__dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--alert);
}

.lempar-button__dot {
	position: absolute;
	top: 7px;
	right: 7px;
	box-shadow: 0 0 0 2px var(--wp--preset--color--surface);
	pointer-events: none;
}

/*
 * The same dot on a fact's label (T-292): the pencil's dot says a detail
 * is missing, and in the form the pencil opens this one says which.
 * `span.lempar-fact__dot[aria-hidden="true"]`, the last child of
 * `dt.lempar-fact__label`, after the label's text; `hidden` takes it away.
 * It sits in the line, 6px after the text and centred on the capitals, so
 * the label's line and the row keep their height. No ring: here nothing
 * lies under it but the list's own ground. The words for a screen reader
 * are the plugin's, beside it.
 */
.lempar-fact__dot {
	display: inline-block;
	margin-inline-start: 0.375rem;
	vertical-align: -0.1em;
}

/*
 * A round icon over a label (T-270, for the scorekeeper's Score, Block
 * and Timeout): an action, not a toggle, which is the stacked chip's (§4).
 *
 *   button.lempar-button.lempar-button--stacked   (the plugin's aria-label
 *                                                  when the word is not enough)
 *     span.lempar-button__disc[aria-hidden="true"]   one svg in currentColor,
 *                                                    or a few characters
 *     span.lempar-button__label                      the word
 *     span.lempar-button__pips[aria-hidden="true"]   optional: one span each,
 *                                                    `is-used` on a spent one
 *
 * The button has no ground of its own, so three sit in a row on a card; it
 * is at least the tap target wide and 64px tall, and its disc, 40px, is
 * the thing pressed at. The disc is the raised surface under the page's
 * ink. With a tone on the button it takes the tone's tint and ink. For a
 * colour that is data, a team's, the plugin sets two properties inline on
 * the button, both or neither: `--lempar-disc`, the colour, and
 * `--lempar-disc-ink`, an ink that reads on it, which only the plugin can
 * choose, since CSS cannot weigh a colour it is handed. A faint inner edge
 * keeps a pale disc from vanishing into a pale card.
 *
 * `is-counting` on the button while something runs down, a timeout's
 * seconds: the disc empties to the card's surface inside a ring of its
 * colour and holds the plugin's figures, "1:10", in tabular 12px.
 *
 * Pips count what is left of a few, a team's timeouts: 8px, filled in the
 * disc's colour, and a spent one is a hollow ring, so the two differ in
 * shape and not in hue alone. The words are the aria-label's.
 *
 * Disabled, it dims and refuses the pointer. Working (§3a), the ring
 * stands in the disc and the button keeps its size.
 */
.lempar-button--stacked {
	flex-direction: column;
	/* From the top, so discs in a row line up whether or not one has pips. */
	justify-content: flex-start;
	gap: 0.25rem;
	min-width: var(--wp--custom--tap-target);
	min-height: 4rem;
	padding: 0.25rem;
	background: transparent;
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
}

.lempar-button--stacked:hover,
.lempar-button--stacked[class*="is-tone-"],
:is(a, button).lempar-button--stacked[class*="is-tone-"]:hover {
	background: transparent;
}

.lempar-button--stacked[class*="is-tone-"] {
	--lempar-disc: var(--lempar-tone-tint);
	--lempar-disc-ink: var(--lempar-tone-ink);
	/* A tint is too faint for a ring or a pip: those take the tone itself. */
	--lempar-disc-mark: var(--lempar-tone);

	color: var(--wp--preset--color--contrast);
}

.lempar-button__disc {
	box-sizing: border-box;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background-color: var(--lempar-disc, var(--wp--preset--color--surface-raised));
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	color: var(--lempar-disc-ink, var(--wp--preset--color--contrast));
	font-size: 0.75rem;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

/* A mouse hover only: a tap leaves the button as it was (T-440). */
@media (hover: hover) {
	.lempar-button--stacked:hover .lempar-button__disc {
		box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--wp--preset--color--contrast) 35%, transparent);
	}
}

.lempar-button__disc svg {
	width: 1.25rem;
	height: 1.25rem;
}

.lempar-button--stacked.is-counting .lempar-button__disc {
	border: 3px solid var(--lempar-disc-mark, var(--lempar-disc, var(--wp--preset--color--contrast)));
	background-color: var(--wp--preset--color--surface);
	box-shadow: none;
	color: var(--wp--preset--color--contrast);
}

.lempar-button__pips {
	display: flex;
	gap: 3px;
}

.lempar-button__pips > span {
	box-sizing: border-box;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--lempar-disc-mark, var(--lempar-disc, var(--wp--preset--color--contrast)));
	/* A firmer rim than the disc's: 8px of a team's navy on a dark card is nothing without one. */
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--contrast) 40%, transparent);
}

.lempar-button__pips > span.is-used {
	border: 1.5px solid var(--wp--preset--color--muted);
	background-color: transparent;
	box-shadow: none;
}

/* Working: the ring in the disc, in place of what the disc held. */
button.lempar-button.lempar-button--stacked[aria-busy="true"]::before {
	content: none;
}

.lempar-button--stacked[aria-busy="true"] .lempar-button__disc {
	font-size: 0;
}

.lempar-button--stacked[aria-busy="true"] .lempar-button__disc > * {
	display: none;
}

.lempar-button--stacked[aria-busy="true"] .lempar-button__disc::before {
	content: "";
	box-sizing: border-box;
	width: 1.125rem;
	height: 1.125rem;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: lempar-spin 0.8s linear infinite;
}

/* -------------------------------------------------------------------------
 * 3a. A button that is working (T-136)
 *
 * STANDARDS: every control that submits shows it is working until the
 * answer comes. `aria-busy="true"` on any button draws the save bar's ring
 * (§7) before the label, in the button's own colour, 1em across, so the
 * button's height does not change. assets/js/busy.js sets it, with
 * `disabled` and the "Saving…" or "Working…" label, on a plain form's
 * submit; a plugin whose script drives the button sets the same three.
 * An `input` button cannot hold the ring and is only dimmed.
 * ---------------------------------------------------------------------- */

:is(button, input[type="submit"])[aria-busy="true"] {
	cursor: progress;
	opacity: 0.85;
}

button[aria-busy="true"]:not(.lempar-savebar__save)::before {
	content: "";
	display: inline-block;
	box-sizing: border-box;
	flex-shrink: 0;
	width: 1em;
	height: 1em;
	margin-inline-end: 0.5em;
	vertical-align: -0.15em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: lempar-spin 0.8s linear infinite;
}

/* A flex button already spaces its children. */
button.lempar-button[aria-busy="true"]::before {
	margin-inline-end: 0;
}

/* -------------------------------------------------------------------------
 * 3a-ii. A button that cannot be pressed (T-318)
 *
 * `disabled`, or `aria-disabled="true"` on a button or a link, on the
 * site's primary button and on every `lempar-button`, plain, quiet, toned,
 * icon-only or stacked. Before, the primary drew disabled exactly as
 * enabled, in the full coral: Management's "Send rosters" (T-317, read on
 * the rehearsal copy, 2026-10-14).
 *
 * One look for all of them: the ground goes, a 1px inset line keeps the
 * button's outline without moving anything, and the words and the icon
 * take the muted ink, which reads on the page, a card or a sheet in both
 * schemes. No opacity: dimming the words is what made them hard to read.
 * Hover and focus change nothing, and the pointer says no. Told from a
 * quiet button, whose ground is also clear, by its solid outline where the
 * quiet one's is dashed, and by the muted words.
 *
 * A working button (§3a) is disabled too, by busy.js or a plugin, and
 * keeps the working look: it is busy, not unavailable. The save bar has
 * its own (§7).
 * ---------------------------------------------------------------------- */

:is(.wp-element-button, .wp-block-button__link, .lempar-button):is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], .lempar-savebar *),
:is(.wp-element-button, .wp-block-button__link, .lempar-button):is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], .lempar-savebar *):is(:hover, :focus, :focus-visible, :active) {
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	cursor: not-allowed;
}

/* The quiet button keeps its dashed edge; the inset line would double it. */
.lempar-button--quiet:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], .lempar-savebar *),
.lempar-button--quiet:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"], .lempar-savebar *):hover {
	box-shadow: none;
}

/* A stacked button's outline is its disc's, and its pips go quiet with it. */
.lempar-button--stacked:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"]),
.lempar-button--stacked:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"]):hover {
	box-shadow: none;
}

.lempar-button--stacked:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"]) .lempar-button__disc {
	border-color: var(--wp--preset--color--line);
	background-color: transparent;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
}

.lempar-button--stacked:is(:disabled, [aria-disabled="true"]):not([aria-busy="true"]) .lempar-button__pips > span:not(.is-used) {
	background-color: var(--wp--preset--color--muted);
	box-shadow: none;
}

/* -------------------------------------------------------------------------
 * 3b. Popover menu (T-173)
 *
 * A small menu behind a 44px trigger, such as a row's three-dot "More":
 *
 *   details.lempar-popover [.lempar-popover--start]
 *     summary.lempar-popover__trigger   (aria-label, an icon in currentColor)
 *     div.lempar-popover__panel
 *       button|a.lempar-popover__item  [.is-tone-alert for a destructive one]
 *
 * The account menu's look without its account specifics. A <details>, so it
 * opens, closes and is reached by keyboard with no script;
 * assets/js/popover.js closes it on Escape (focus back to the trigger), on a
 * tap outside, when focus leaves and after an item is pressed, and places
 * the panel `position: fixed` against the trigger while it is open, below
 * or, without room, above, so that a card, a scrolling list column or a
 * sheet does not clip it. The absolute placement here is the fallback. The
 * panel's right edge meets the trigger's by default; --start meets the left.
 * ---------------------------------------------------------------------- */

.lempar-popover {
	position: relative;
	display: inline-block;
}

.lempar-popover > summary {
	list-style: none;
	cursor: pointer;
}

.lempar-popover > summary::-webkit-details-marker {
	display: none;
}

.lempar-popover__trigger {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--tap-target);
	height: var(--wp--custom--tap-target);
	border-radius: var(--wp--custom--radius--small);
	color: var(--wp--preset--color--muted);
}

.lempar-popover__trigger:hover,
.lempar-popover[open] > .lempar-popover__trigger {
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
}

.lempar-popover__trigger svg {
	width: 1.25rem;
	height: 1.25rem;
}

.lempar-popover__panel {
	z-index: 40;
	box-sizing: border-box;
	min-width: 10rem;
	max-width: min(18rem, calc(100vw - 1rem));
	padding: 0.375rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--card);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
}

/*
 * The fallback place, for a panel popover.js has not placed: under the
 * trigger, inside the popover. Scoped to the unplaced panel so that no
 * `top` here competes with the script's (T-173: Management read the
 * stylesheet's `top: calc(100% + 0.25rem)` against the window, 816px at
 * an 812px window, beside the script's inline placement). With the script
 * running, an unplaced open panel waits invisible for its place.
 */
.lempar-popover__panel:not([data-lempar-placed]) {
	position: absolute;
	top: calc(100% + 0.25rem);
	right: 0;
}

.lempar-popover--start .lempar-popover__panel:not([data-lempar-placed]) {
	right: auto;
	left: 0;
}

.lempar-js .lempar-popover__panel:not([data-lempar-placed]) {
	visibility: hidden;
}

.lempar-popover__item {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	min-height: var(--wp--custom--tap-target);
	padding: 0 0.75rem;
	border: 0;
	border-radius: var(--wp--custom--radius--small);
	background: none;
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-weight: 700;
	text-align: start;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.lempar-popover__item:hover {
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
}

.lempar-popover__item.is-tone-alert {
	color: var(--lempar-tone-ink);
}

.lempar-popover__item:focus-visible {
	outline-offset: -2px;
}

/* -------------------------------------------------------------------------
 * 3c. Picker: one of a list, searched (T-270)
 *
 * One person out of a roster, found by typing a name or a number: the
 * scorekeeper's "Who scored?". A field that opens a list under itself, in
 * the flow of the page, so nothing floats over a sheet's other fields and
 * nothing is clipped by one.
 *
 *   div.lempar-picker
 *     button.lempar-picker__trigger   aria-haspopup="listbox",
 *                                     aria-expanded, aria-controls; holds
 *                                     the choice, or the plugin's
 *                                     placeholder with `is-empty`
 *     div.lempar-picker__panel        shown and hidden with `hidden`
 *       div.lempar-picker__search     optional svg in currentColor, then
 *                                     input[type="search"] with the
 *                                     plugin's aria-label
 *       div.lempar-picker__options    role="listbox"
 *         button.lempar-picker__option   role="option", aria-selected;
 *                                        may start with
 *                                        span.lempar-picker__number
 *       p.lempar-picker__empty        "nobody matches", the plugin's words;
 *                                     `hidden` while somebody does
 *
 * The trigger is drawn as the site's field is (lempar.css §2), with the
 * row's chevron, which turns over while the list is open; open, its border
 * is the page's ink. Wrong, it takes `aria-invalid="true"` and a
 * `lempar-field-error` after the picker, as any field.
 *
 * The chosen option is current, and current is accent (T-083): the
 * pressed row's 10% tint and accent ink. Options are the tap target tall;
 * the list scrolls on its own past about six, so the search stays in
 * sight above it. A number lines up in a column of its own, so names
 * start at one edge whether the number has one digit or three.
 *
 * The theme has no script for it: opening, filtering, the arrow keys and
 * what Escape does are the plugin's. The search field is 16px on a phone
 * by lempar.css's rule for every field, so iOS does not zoom into it.
 * ---------------------------------------------------------------------- */

.lempar-picker {
	display: flex;
	flex-direction: column;
	/* Never squeezed by a column that has run out of room: the list scrolls. */
	flex-shrink: 0;
	gap: 0.375rem;
	min-width: 0;
}

.lempar-picker__trigger {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20);
	width: 100%;
	min-height: var(--wp--custom--tap-target);
	/* The field's own padding and line, so the two are one height. */
	padding: 0.8125rem 1rem;
	border: 2px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: normal;
	text-align: start;
	overflow-wrap: anywhere;
	cursor: pointer;
}

.lempar-picker__trigger.is-empty {
	color: var(--wp--preset--color--muted);
}

.lempar-picker__trigger::after {
	content: "";
	flex-shrink: 0;
	width: 0.5rem;
	height: 0.5rem;
	margin-inline: 0.25rem 0.125rem;
	border-right: 2px solid var(--wp--preset--color--contrast);
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	transform: translateY(-0.125rem) rotate(45deg);
	transition: transform 0.2s ease;
}

.lempar-picker__trigger[aria-expanded="true"] {
	border-color: var(--wp--preset--color--contrast);
}

.lempar-picker__trigger[aria-expanded="true"]::after {
	transform: translateY(0.125rem) rotate(-135deg);
}

.lempar-picker__trigger[aria-invalid="true"] {
	border-color: var(--wp--preset--color--alert);
	background-color: color-mix(in srgb, var(--wp--preset--color--alert) 8%, var(--wp--preset--color--surface));
}

.lempar-picker__panel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 2px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface);
}

.lempar-picker__search {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	padding: 0 0.75rem;
	border-bottom: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
}

/* The ring is the row's, inside the panel's clipped corners. */
.lempar-picker__search:focus-within {
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--accent);
}

.lempar-picker__search svg {
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
}

.lempar-picker__search input {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	min-height: var(--wp--custom--tap-target);
	padding: 0;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
}

.lempar-picker .lempar-picker__search input:focus-visible {
	outline: 0;
}

.lempar-picker__options {
	display: flex;
	flex-direction: column;
	max-height: min(17.5rem, 45dvh);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.lempar-picker__option {
	box-sizing: border-box;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	width: 100%;
	min-height: var(--wp--custom--tap-target);
	padding: 0.375rem 1rem;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	line-height: 1.25;
	text-align: start;
	overflow-wrap: anywhere;
	cursor: pointer;
}

.lempar-picker__option:hover {
	background-color: var(--wp--preset--color--surface-raised);
}

/*
 * Inside the list's clipped box an outset ring would be cut. Both this and
 * the search field's rule below name the picker as well, to outrank a
 * plugin's own focus rule for every button and field in its wrapper
 * (Tournaments', two classes' worth), which would put the ring back outside.
 */
.lempar-picker .lempar-picker__option:focus-visible {
	outline-offset: -2px;
}

.lempar-picker__option[aria-selected="true"] {
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 10%, var(--wp--preset--color--surface));
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
	font-weight: 800;
}

.lempar-picker__number {
	flex-shrink: 0;
	min-width: 2.25rem;
	font-variant-numeric: tabular-nums;
}

.lempar-picker__empty {
	margin: 0;
	padding: 0.75rem 1rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* -------------------------------------------------------------------------
 * 4. Filter chips
 *
 * A row of toggles above a list. The pressed chip is "current", and current
 * is accent everywhere on the site, as in the sidebar; spirit means a
 * selected status and nothing else, so a data colour never also says "you
 * are here" (the Manager's ruling on T-083, 2026-09-25).
 *
 * Tinted rather than filled. Filled accent under its white contrast text is
 * 2.82:1 in the light scheme. That ratio is accepted for the primary button
 * alone; DECISIONS leaves text on the coral elsewhere an open question, so
 * the chip does not borrow the exemption. The tone recipe applied to
 * accent, a 20% tint under a 40% ink, measures 6.19:1 at worst in light and
 * 7.20:1 in dark, and still reads as the sidebar's coral.
 *
 * The row scrolls sideways rather than wrapping, so a list's first line
 * never moves when a count changes.
 * ---------------------------------------------------------------------- */

.lempar-chips {
	display: flex;
	gap: var(--wp--preset--spacing--20);
	overflow-x: auto;
	padding-bottom: 2px;
	scrollbar-width: none;
}

.lempar-chip {
	box-sizing: border-box;
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 0.375rem;
	min-height: var(--wp--custom--tap-target);
	padding: 0 var(--wp--preset--spacing--40);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	cursor: pointer;
}

.lempar-chip:hover {
	border-color: var(--wp--preset--color--contrast);
}

.lempar-chip[aria-pressed="true"],
.lempar-chip.is-active {
	border-color: var(--wp--preset--color--accent);
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 20%, var(--wp--preset--color--surface));
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
}

/*
 * A count is told from its label by weight alone. The mockup dimmed it to
 * 70% opacity, which measured 3.06:1 on a muted tab label in the light
 * scheme; a lighter weight costs no contrast.
 */
.lempar-chip__count {
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

/*
 * Stacked (T-183): an icon over a short word, for a row of tools such as
 * Playbook's on a phone. `button.lempar-chip.lempar-chip--stacked` holding
 * an svg in currentColor and a `span.lempar-chip__label`, pressed as any
 * chip is. A column, the icon at 20px over the word at the tab bar's
 * 12px/700, at least 44px each way, its corners the small radius: a pill on
 * a box this tall reads as a lozenge.
 */
.lempar-chip--stacked {
	flex-direction: column;
	justify-content: center;
	gap: 0.125rem;
	min-width: var(--wp--custom--tap-target);
	padding: 0.375rem;
	border-radius: var(--wp--custom--radius--small);
	font-size: 0.75rem;
	line-height: 1.2;
}

.lempar-chip--stacked svg {
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
}

/* -------------------------------------------------------------------------
 * 5. Segmented control
 *
 * One choice among two to five, drawn as a track with the choice lifted out
 * of it. Two uses share it: sheet and screen tabs (role="tab",
 * aria-selected), where the choice inverts to --contrast; and a status
 * picker (aria-pressed, or radios), where each option carries a tone and the
 * choice is tinted in it.
 *
 * Five fit a 292px row, a 360px phone less Saya's margins (T-257, measured
 * for Saya's tabs, "Today · 12", "Club", "Teams", "Season", "Me" and their
 * Indonesian). More than fit scroll within the row (T-355, Saya's sixth,
 * "Tournaments"): assets/js/segmented.js marks the edges with more beyond
 * them in `data-lempar-overflow`, which fades them below, and keeps the
 * chosen segment clear of the fade.
 *
 * Options are the full 44px, which makes the track 52px where the mockup
 * drew 48. The decision names 44px targets as the standard, and the mockup's
 * 40px options were the one place it did not meet its own rule.
 * ---------------------------------------------------------------------- */

.lempar-segmented,
.lempar-choice {
	box-sizing: border-box;
	display: grid;
	/*
	 * Each segment is at least as wide as its own label and shares what is
	 * left equally (T-127): equal columns clipped a label wider than its
	 * share — the session sheet's "Attendance 8/36" needed 92px of an 81px
	 * column at 375px and read "ttendance 8/3". Short labels still come out
	 * equal. Should the labels outgrow the row, it scrolls sideways rather
	 * than clipping or pushing the page wider.
	 */
	grid-auto-columns: minmax(max-content, 1fr);
	overflow-x: auto;
	scrollbar-width: none;
	grid-auto-flow: column;
	gap: 0.25rem;
	padding: 0.25rem;
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface);
}

.lempar-card :is(.lempar-segmented, .lempar-choice) {
	background-color: var(--wp--preset--color--base);
}

:is(.lempar-segmented, .lempar-choice) > :is(button, label, a) {
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	white-space: nowrap;
	/*
	 * 44px each way, the width too (T-257): a short label in a row that has
	 * run out of room was as narrow as its word, "Me" 34px and "Tim" 40px.
	 */
	min-width: var(--wp--custom--tap-target);
	min-height: var(--wp--custom--tap-target);
	padding: 0 var(--wp--preset--spacing--20);
	border: 0;
	border-radius: 10px; /* The track's 14px less its 4px inset, so the curves stay concentric. */
	background: transparent;
	color: var(--wp--preset--color--muted);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

/*
 * Five segments give up half their side padding (T-257), so the five fit a
 * 360px phone: at 8px Saya's tabs needed 305px of a 292px row and the last
 * was cut; at 4px they need 281px. With room to spare the tracks share it
 * as before, so nothing looks tighter until the row is. Two to four keep
 * their 8px, and measure as they did.
 */
.lempar-segmented:has(> :nth-child(5)) > :is(button, label, a) {
	padding-inline: 0.25rem;
}

/*
 * The edges of a row that scrolls (T-355): faded where there is more, by
 * a mask over the row, track and all, so what is cut reads as going on.
 * `--lempar-fade` is the width segmented.js keeps the chosen segment
 * clear of; change both together.
 */
.lempar-segmented {
	--lempar-fade: 24px;
}

.lempar-segmented[data-lempar-overflow="end"] {
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--lempar-fade)), transparent);
	mask-image: linear-gradient(to right, #000 calc(100% - var(--lempar-fade)), transparent);
}

.lempar-segmented[data-lempar-overflow="start"] {
	-webkit-mask-image: linear-gradient(to left, #000 calc(100% - var(--lempar-fade)), transparent);
	mask-image: linear-gradient(to left, #000 calc(100% - var(--lempar-fade)), transparent);
}

.lempar-segmented[data-lempar-overflow="start end"] {
	-webkit-mask-image: linear-gradient(to right, transparent, #000 var(--lempar-fade), #000 calc(100% - var(--lempar-fade)), transparent);
	mask-image: linear-gradient(to right, transparent, #000 var(--lempar-fade), #000 calc(100% - var(--lempar-fade)), transparent);
}

/* A radio inside a label stays in the tab order and the form, unseen. */
:is(.lempar-segmented, .lempar-choice) > label > input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

:is(.lempar-segmented, .lempar-choice) > label:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

:is(.lempar-segmented, .lempar-choice) > :is([aria-selected="true"], [aria-pressed="true"], [aria-current="page"], label:has(input:checked)) {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/*
 * A tone answers only a pressed option or a checked radio, never
 * aria-selected: a tab that happened to carry a tone class would otherwise
 * be tinted instead of inverted, and tabs and status pickers would stop
 * looking like two different things.
 */
.lempar-segmented > [class*="is-tone-"]:is([aria-pressed="true"], label:has(input:checked)) {
	background-color: var(--lempar-tone-tint);
	box-shadow: inset 0 0 0 1px var(--lempar-tone-ink);
	color: var(--lempar-tone-ink);
}

/*
 * A choice among a few (T-334, the schedule builder's "How many pools?" 1,
 * 2 or 3, and "What do the others play?"): `div.lempar-choice` with
 * `role="group"` and the plugin's `aria-label`, holding `button`s with
 * `aria-pressed`, one of them "true"; or, in a form with no script,
 * `label`s each holding an `input type="radio"` of one name. The segmented
 * look, from the same rules: the track, 44px options, the pressed one
 * inverted. What differs: the options share the row equally and a label of
 * two words wraps at the space rather than the row scrolling, since a
 * choice is a handful of short answers, and a disabled option, one the
 * other choices rule out, is struck through and refuses the pointer.
 */
.lempar-choice {
	grid-auto-columns: minmax(min-content, 1fr);
	overflow-x: visible;
}

.lempar-choice > :is(button, label, a) {
	padding-block: 0.375rem;
	white-space: normal;
	line-height: 1.2;
}

:is(.lempar-segmented, .lempar-choice) > :is(:disabled, [aria-disabled="true"], label:has(input:disabled)) {
	text-decoration: line-through;
	cursor: not-allowed;
}

/*
 * A tab's count (T-265): the notification disc of the header's account
 * menu, beside the tab's word. Aaron, on Saya on his phone: "Make the
 * number (5) more like a notification number like in the Person menu".
 * So it is that disc and no other, the highlight with its contrast ink in
 * both schemes, on the chosen tab and the others alike, and the account
 * menu's own count is drawn by this same rule (lempar.css only places it).
 *
 * `span.lempar-segmented__count` inside the segment, after its word. The
 * segment's accessible name is the plugin's to state, since a bare number
 * says nothing aloud. It sits 4px from the word, not the segment's 6px, so
 * five tabs with a three-digit count still show whole on a 360px phone.
 */
.lempar-account__count,
.lempar-segmented__count {
	box-sizing: border-box;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.3rem;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--highlight);
	color: var(--wp--preset--color--highlight-contrast);
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1.25rem;
	text-align: center;
}

.lempar-segmented__count {
	flex-shrink: 0;
	margin-inline-start: -0.125rem;
}

/* -------------------------------------------------------------------------
 * 5a. Steps (T-319)
 *
 * Where a screen is a few steps in order, the Team tab's four: a progress
 * stepper, not a segmented row, which Aaron read as a count ("Should use
 * standard progress bar if that's is what it's meant to indicate").
 *
 *   p.lempar-steps__count               "Step 2 of 4", above the list
 *   ol.lempar-steps
 *     li.lempar-steps__item             `is-done` or `is-current`, or neither
 *       button.lempar-steps__button     where the coach may go to that step;
 *                                       a `span` of the same class where not;
 *                                       `aria-current="step"` on the current
 *         span.lempar-steps__marker     aria-hidden: the number, or once done
 *                                       a tick (an svg in currentColor; left
 *                                       empty, the theme draws one)
 *         span.lempar-steps__label      the step's word
 *
 * One column a step, the marker over its label. The columns share the
 * width equally, but none is narrower than its longest word: at 320
 * "Tournament" needs 66px of a 63px share and was broken mid-word, so its
 * column takes what it needs and the others share the rest. A word is
 * never hyphenated or broken; two words wrap at the space.
 *
 * A line joins the markers. Each step draws its own two halves, centre to
 * edge, so the line meets exactly whatever the columns' widths: the half
 * before a step is the accent if the step is done or current, the half
 * after it if the step is done, so the filled run ends at the current
 * step.
 *
 * - Not reached: the surface inside a 2px line ring, the number and the
 *   word in the muted ink.
 * - Current: the accent's ring over its 20% tint, the number and the word
 *   in the accent ink at 800, as a pressed chip is drawn (§4) and for its
 *   reason: white on the bare coral is 2.82:1.
 * - Done: filled in the accent ink with the tick in the surface colour, the
 *   word in the page's ink.
 *
 * A button step is the tap target tall and its column wide; hovered, its
 * marker's ring darkens. lempar has no script for it.
 * ---------------------------------------------------------------------- */

.lempar-steps__count {
	margin: 0 0 var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.lempar-steps {
	--lempar-steps-marker: 2rem;

	display: grid;
	grid-auto-columns: minmax(min-content, 1fr);
	grid-auto-flow: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lempar-steps__item {
	position: relative;
	display: flex;
	justify-content: center;
	min-width: 0;
	margin: 0;
}

/* The line, in two halves a step: before the marker and after it. */
.lempar-steps__item::before,
.lempar-steps__item::after {
	content: "";
	position: absolute;
	top: calc(var(--lempar-steps-marker) / 2 - 1px);
	height: 2px;
	background-color: var(--wp--preset--color--line);
}

.lempar-steps__item::before {
	right: 50%;
	left: 0;
}

.lempar-steps__item::after {
	right: 0;
	left: 50%;
}

.lempar-steps__item:first-child::before,
.lempar-steps__item:last-child::after {
	content: none;
}

.lempar-steps__item:is(.is-done, .is-current)::before,
.lempar-steps__item.is-done::after {
	background-color: var(--wp--preset--color--accent);
}

.lempar-steps__button {
	box-sizing: border-box;
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.375rem;
	width: 100%;
	min-height: var(--wp--custom--tap-target);
	padding: 0 0.125rem;
	border: 0;
	border-radius: var(--wp--custom--radius--small);
	background: transparent;
	color: var(--wp--preset--color--muted);
	font: inherit;
	text-align: center;
}

button.lempar-steps__button {
	cursor: pointer;
}

.lempar-steps__marker {
	box-sizing: border-box;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: var(--lempar-steps-marker);
	height: var(--lempar-steps-marker);
	border: 2px solid var(--wp--preset--color--line);
	border-radius: 50%;
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.lempar-steps__marker svg {
	width: 1rem;
	height: 1rem;
}

.lempar-steps__label {
	max-width: 100%;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.2;
}

button.lempar-steps__button:hover .lempar-steps__marker {
	border-color: var(--wp--preset--color--contrast);
}

.lempar-steps__item.is-current .lempar-steps__button {
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
}

.lempar-steps__item.is-current .lempar-steps__marker {
	border-color: var(--wp--preset--color--accent);
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 20%, var(--wp--preset--color--surface));
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
}

.lempar-steps__item.is-current .lempar-steps__label {
	font-weight: 800;
}

.lempar-steps__item.is-done .lempar-steps__button {
	color: var(--wp--preset--color--contrast);
}

.lempar-steps__item.is-done .lempar-steps__marker,
.lempar-steps__item.is-done button.lempar-steps__button:hover .lempar-steps__marker {
	border-color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
	color: var(--wp--preset--color--surface);
}

/* Done with the marker left empty: the theme's own tick. */
.lempar-steps__item.is-done .lempar-steps__marker:empty::before {
	content: "";
	width: 0.3125rem;
	height: 0.625rem;
	margin-top: -0.1875rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

/* -------------------------------------------------------------------------
 * 5b. A number with − and + (T-334)
 *
 * The schedule builder's playing time, "75 min", its break and a team's
 * rest. `div.lempar-number` with `role="group"` and the plugin's label,
 * holding `button.lempar-number__step` for less, the value, and another
 * `lempar-number__step` for more. The value is `output.lempar-number__value`
 * (or a `span`), whose words, unit and all, are the plugin's; in a form
 * with no script it may be `input.lempar-number__value` instead, a number
 * field with `min`, `max` and `step`, typed into. Each step is a 44px disc
 * named by its `aria-label` ("Shorter", "Longer"), holding a glyph or an
 * svg in `currentColor`; at the end of the range the plugin disables it,
 * and it shows so. The plugin's script changes the value; lempar has none.
 * ---------------------------------------------------------------------- */

.lempar-number {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 0.375rem;
}

.lempar-number__step {
	box-sizing: border-box;
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--tap-target);
	height: var(--wp--custom--tap-target);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: 1.25rem;
	font-weight: 900;
	line-height: 1;
	cursor: pointer;
}

.lempar-number__step:hover {
	background-color: var(--wp--preset--color--line);
}

.lempar-number__step svg {
	width: 1.25rem;
	height: 1.25rem;
}

/* The end of the range: as every disabled button is drawn (§3a-ii). */
.lempar-number__step:is(:disabled, [aria-disabled="true"]),
.lempar-number__step:is(:disabled, [aria-disabled="true"]):hover {
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	cursor: not-allowed;
}

.lempar-number__value {
	box-sizing: border-box;
	min-width: 4.5rem;
	color: var(--wp--preset--color--contrast);
	font-size: 1.0625rem;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
	text-align: center;
	white-space: nowrap;
}

/* A field to type into, for a form with no script: the field's frame, narrow, no spinner. */
input.lempar-number__value {
	width: 4.5rem;
	min-height: var(--wp--custom--tap-target);
	padding: 0 0.25rem;
	border: 2px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface);
	font-family: inherit;
	-moz-appearance: textfield;
}

input.lempar-number__value::-webkit-inner-spin-button,
input.lempar-number__value::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

/* -------------------------------------------------------------------------
 * 5c. A meter: how much of something is used (T-334)
 *
 * The schedule builder's "What fits": per day, the slots a format uses of
 * those there are, "6/12". `div.lempar-meter` holding
 * `span.lempar-meter__label` (optional, "Sat"), `span.lempar-meter__bar`
 * with `span.lempar-meter__used` inside, and `span.lempar-meter__value`.
 * The used part's width is `--lempar-meter` on the meter, a percentage the
 * plugin writes inline and clamps at 100%: `style="--lempar-meter: 50%"`.
 * `is-over` on the meter when more is wanted than there is: the bar fills
 * in the alert colour over its tint and the value takes the alert ink.
 *
 * The bar says nothing aloud; the plugin gives the meter its words, as
 * `role="img"` with an `aria-label` ("Saturday: 6 of 12 slots used"), or
 * puts them in the meter's list's own label, as the mockup did.
 * Several meters in `div.lempar-meters` line up: the labels in one column,
 * the bars in the next, the values in a third.
 * ---------------------------------------------------------------------- */

.lempar-meters {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr) max-content;
	gap: 0.375rem 0.5rem;
	align-items: center;
}

.lempar-meter {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr) max-content;
	gap: 0.5rem;
	align-items: center;
}

.lempar-meters > .lempar-meter {
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
}

/* A meter with no label: the bar takes the first column too. */
.lempar-meter:not(:has(> .lempar-meter__label)) > .lempar-meter__bar {
	grid-column: 1 / span 2;
}

.lempar-meter__label {
	color: var(--wp--preset--color--muted);
	font-size: 0.75rem;
	font-weight: 800;
}

.lempar-meter__bar {
	position: relative;
	height: 0.875rem;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--surface-raised);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
}

.lempar-meter__used {
	position: absolute;
	inset: 0 auto 0 0;
	width: min(var(--lempar-meter, 0%), 100%);
	border-radius: inherit;
	/*
	 * The accent drawn a fifth of the way to the page's ink: the bare coral
	 * is 2.4:1 against the light track, under the 3:1 a part of a picture
	 * wants; this is 3.32 there and 6.21 in dark, and still reads as coral.
	 */
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 80%, var(--wp--preset--color--contrast));
}

.lempar-meter__value {
	color: var(--wp--preset--color--contrast);
	font-size: 0.75rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	text-align: end;
}

.lempar-meter.is-over .lempar-meter__bar {
	background-color: color-mix(in srgb, var(--wp--preset--color--alert) 20%, var(--wp--preset--color--surface));
}

.lempar-meter.is-over .lempar-meter__used {
	background-color: var(--wp--preset--color--alert);
}

.lempar-meter.is-over .lempar-meter__value {
	color: color-mix(in srgb, var(--wp--preset--color--alert) 40%, var(--wp--preset--color--contrast));
}

/* -------------------------------------------------------------------------
 * 6. Three-state chip
 *
 * Present, late, absent — three square icon buttons, at most one pressed.
 * None pressed is a fourth state, "not recorded", and must stay visibly
 * different from absent, so an unpressed option is only muted, never
 * tinted. Each option carries its tone; the plugin supplies the icon and an
 * aria-label.
 * ---------------------------------------------------------------------- */

.lempar-tristate {
	display: inline-grid;
	flex-shrink: 0;
	grid-auto-columns: var(--wp--custom--tap-target);
	grid-auto-flow: column;
	gap: 0.25rem;
}

.lempar-tristate > :is(button, label) {
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--tap-target);
	height: var(--wp--custom--tap-target);
	padding: 0;
	border: 0;
	border-radius: 12px; /* The mockup's; the small token's 14px leaves a 44px square looking round. */
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--muted);
	cursor: pointer;
}

.lempar-tristate > label > input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.lempar-tristate > label:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.lempar-tristate > :is([aria-pressed="true"], label:has(input:checked)) {
	background-color: var(--lempar-tone-tint);
	box-shadow: inset 0 0 0 1.5px var(--lempar-tone-ink);
	color: var(--lempar-tone-ink);
}

.lempar-tristate svg {
	width: 1.25rem;
	height: 1.25rem;
}

/*
 * A second fact on a pressed mark: approved or not, under Absent or Late
 * (T-092). Aaron wanted the choice to close once made and "the mark itself
 * then showing which was chosen", so it rides on the mark rather than in a
 * row of its own. <span class="lempar-tristate__badge is-tone-…"
 * aria-hidden="true"> inside the button, holding a small icon; the button's
 * aria-label carries the words.
 *
 * A 16px disc at the top right, inside the 44px square, so the button's size
 * and target do not change. The disc is its tone's ink rather than its
 * tint, because it sits on the pressed button's own tint and a tint on a
 * tint would not read; the glyph is --surface on it, and a --surface ring
 * cuts it from the button's edge. Measured for spirit and alert discs on
 * alert and highlight buttons, over surface and base, in both schemes: the
 * glyph is at least 6.87:1 on its disc, and the disc at least 4.82:1
 * against the button under it.
 *
 * A badge with no tone class of its own inherits its button's tone, since
 * custom properties inherit: measured, an untoned badge on an alert button
 * is alert ink. Give it the tone of the fact it states.
 *
 * The icon rule names the tristate as well, to outrank the 20px rule above
 * for every icon in a tristate.
 */
.lempar-tristate__badge {
	position: absolute;
	top: 3px;
	right: 3px;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background-color: var(--lempar-tone-ink);
	box-shadow: 0 0 0 1.5px var(--wp--preset--color--surface);
	color: var(--wp--preset--color--surface);
	pointer-events: none;
}

.lempar-tristate .lempar-tristate__badge svg {
	width: 10px;
	height: 10px;
}

/* -------------------------------------------------------------------------
 * 7. Save bar
 *
 * One save for a screenful of changes, shown only while there is something
 * to save: the plugin toggles `hidden`, honoured by §0. It is inverted —
 * --contrast ground, --base text — so it reads as a separate layer in
 * either scheme.
 *
 * Sticky rather than fixed. It sits at the end of the form it saves and
 * stays in view while any of that form is, and a page with two forms gets
 * two bars that cannot overlap. Fixed would need the plugin to know what
 * else is fixed on the page.
 *
 * Above the phone's keyboard (T-103). Aaron's phone showed the bar behind
 * the keyboard while a field was being edited: the keyboard shrinks only
 * the visual viewport, and a bar held to the layout viewport's bottom is
 * covered. Two parts, both the theme's, so no plugin listens for anything:
 * the viewport tag carries `interactive-widget=resizes-content`, which
 * makes Chrome on Android shrink the layout viewport instead; and where a
 * browser ignores that (Safari), assets/js/viewport.js sets
 * --lempar-keyboard-inset to the keyboard's height, which every bar's
 * `bottom` and every modal sheet's placement add. It is 0 while the
 * keyboard is closed, so nothing moves then.
 * ---------------------------------------------------------------------- */

.lempar-savebar {
	position: sticky;
	bottom: calc(var(--wp--preset--spacing--30) + var(--lempar-keyboard-inset, 0px));
	z-index: 20;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin-top: var(--wp--preset--spacing--30);
	padding: 0.5rem 0.5rem 0.5rem var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--preset--shadow--nav);
	color: var(--wp--preset--color--base);
}

/*
 * Held above 0,1,0 (T-620). For a signed-in administrator WordPress.com
 * prints wp-components' stylesheet after this one, and its
 * `[role=region] { position: relative }` ties `.lempar-savebar` and comes
 * later, so a bar marked as a region, as most are, lost its stickiness.
 * Position alone: the app's and the sheet's own placements outrank this.
 */
.lempar-savebar[role] {
	position: sticky;
}

.lempar-savebar__text {
	flex-grow: 1;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.lempar-savebar :is(button, a) {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--tap-target);
	padding: 0 var(--wp--preset--spacing--30);
	gap: 0.5rem;
	border: 0;
	border-radius: 10px; /* The bar's 18px less its 8px inset, concentric like the segmented track. */
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.lempar-savebar .lempar-savebar__save {
	padding: 0 var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-weight: 800;
}

/*
 * Saving (T-101). Aaron: "a loader or some indication on the save button as
 * there is a delay after pressed to when the save happens". From the tap
 * until the reply the plugin sets `aria-busy="true"` and `disabled` on
 * the Save button, changes its label to "Saving…", and disables Discard;
 * the theme draws the rest. The spinner is a ring in the button's own
 * colour, 1em across, so the bar's height cannot change between states
 * (the button keeps its 44px); with reduced motion it stands still, a
 * three-quarter ring that still reads as "working".
 *
 * A disabled button in the bar is dimmed and refuses the pointer; the
 * busy Save button is dimmed less, because it is the thing being watched.
 */
.lempar-savebar :is(button, a):is(:disabled, [aria-disabled="true"]) {
	cursor: not-allowed;
	opacity: 0.6;
}

.lempar-savebar .lempar-savebar__save[aria-busy="true"] {
	cursor: progress;
	opacity: 0.85;
}

.lempar-savebar .lempar-savebar__save[aria-busy="true"]::before {
	content: "";
	box-sizing: border-box;
	flex-shrink: 0;
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: lempar-spin 0.8s linear infinite;
}

@keyframes lempar-spin {
	to {
		transform: rotate(360deg);
	}
}

/*
 * Fields to fix (T-104): with `is-tone-alert` the bar turns the alert
 * colour, its text in alert-contrast (5.14:1 light, 7.49:1 dark), and the
 * plugin's words say how many fields need fixing. Save stays live: the
 * plugin decides what a press does, and the bar only says why it is red.
 */
.lempar-savebar.is-tone-alert {
	background-color: var(--wp--preset--color--alert);
	color: var(--wp--preset--color--alert-contrast);
}

/* -------------------------------------------------------------------------
 * 8. Bottom tab bar
 *
 * A coach screen's own sections, under the thumb on a handset. Below 900px
 * it is fixed to the bottom and the page makes room for it; from 900px the
 * shell's sidebar already sits at the left, so the bar becomes an ordinary
 * row at the top of the content instead of a second navigation pinned to
 * the window.
 *
 * The current item is accent, as current is everywhere on the site (see the
 * filter chips). It takes accent's ink rather than accent itself, which is
 * 2.8:1 on the white bar, too faint for a 12px label.
 *
 * Its items are links to pages, `a[aria-current="page"]` for the current
 * one, or tabs that switch panels on one page (T-182, Playbook's builder):
 * the bar `role="tablist"`, each item `button role="tab"` with
 * `aria-selected`, the selected one drawn as the current link is.
 * ---------------------------------------------------------------------- */

.lempar-tabbar {
	--lempar-tone: var(--wp--preset--color--accent);

	box-sizing: border-box;
	display: grid;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	gap: 0.25rem;
	background-color: var(--wp--preset--color--surface);
}

.lempar-tabbar > :is(a, button) {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	min-height: 3.25rem;
	padding: 0.25rem;
	color: var(--wp--preset--color--muted);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
}

/*
 * A tab is a button; it draws as the links do. It fills its grid cell on a
 * phone as a link does, and in the wide row takes its content's width as a
 * link does (width: 100% stretched each tab across the whole row at 1280).
 */
.lempar-tabbar > button {
	justify-self: stretch;
	border: 0;
	border-radius: 0;
	background: none;
	font-family: inherit;
	cursor: pointer;
}

.lempar-tabbar svg {
	box-sizing: content-box;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0.125rem 0.875rem;
	border-radius: var(--wp--custom--radius--pill);
}

.lempar-tabbar > :is(a[aria-current="page"], button[aria-selected="true"]) {
	color: color-mix(in srgb, var(--lempar-tone) 40%, var(--wp--preset--color--contrast));
}

.lempar-tabbar > :is(a[aria-current="page"], button[aria-selected="true"]) svg {
	background-color: color-mix(in srgb, var(--lempar-tone) 20%, transparent);
}

/*
 * The window decides for a tab bar outside an app. Inside one, the app's
 * own width decides (§10a): a coach screen's menu must follow the space
 * the app has, or there is a band of windows — 900px to about 1168px,
 * where the shell's sidebar takes its share — in which the window says
 * "not a phone" and the app says "not wide", and neither menu is drawn.
 * Aaron found that band on a laptop (T-098).
 */
@media (max-width: 899.98px) {
	.lempar-tabbar:not(.lempar-app *) {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 30;
		height: var(--lempar-tabbar-height);
		padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid var(--wp--preset--color--line);
	}

	body:has(.lempar-tabbar:not(.lempar-app *)) {
		padding-bottom: var(--lempar-tabbar-height);
	}

	body:has(.lempar-tabbar:not(.lempar-app *)) .lempar-savebar:not(.lempar-app *) {
		bottom: calc(var(--wp--preset--spacing--30) + max(var(--lempar-tabbar-height), var(--lempar-keyboard-inset, 0px)));
	}
}

@media (min-width: 900px) {
	.lempar-tabbar:not(.lempar-app *) {
		display: flex;
		flex-wrap: wrap;
		margin-bottom: var(--wp--preset--spacing--50);
		padding: 0.25rem;
		border-radius: var(--wp--custom--radius--pill);
		box-shadow: var(--wp--preset--shadow--card);
	}

	.lempar-tabbar:not(.lempar-app *) > :is(a, button) {
		flex-direction: row;
		min-height: var(--wp--custom--tap-target);
		padding: 0 var(--wp--preset--spacing--40) 0 0.5rem;
		border-radius: var(--wp--custom--radius--pill);
		font-size: var(--wp--preset--font-size--small);
	}

	.lempar-tabbar:not(.lempar-app *) svg {
		width: 1.25rem;
		height: 1.25rem;
		padding: 0.25rem;
	}

	.lempar-tabbar:not(.lempar-app *) > :is(a[aria-current="page"], button[aria-selected="true"]) {
		background-color: color-mix(in srgb, var(--lempar-tone) 20%, transparent);
	}

	.lempar-tabbar:not(.lempar-app *) > :is(a[aria-current="page"], button[aria-selected="true"]) svg {
		background: transparent;
	}
}

/* -------------------------------------------------------------------------
 * 9. Sheet
 *
 * A person, a session, anything opened from a list: a header, then tabs,
 * then panels. As a <dialog> opened with showModal() it rises from the
 * bottom on a handset and centres on a wide screen; the same markup in a
 * plain element is an in-page panel, which is how the demo shows it.
 * Panels are switched by the plugin with `hidden`, which §0 honours.
 * ---------------------------------------------------------------------- */

.lempar-sheet {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}

.lempar-sheet__header {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) 0;
}

.lempar-sheet__identity {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	min-width: 0;
}

.lempar-sheet__identity :is(h1, h2, h3) {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
	overflow-wrap: anywhere;
}

.lempar-sheet__body {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
	padding: var(--wp--preset--spacing--40);
	overflow-y: auto;
}

.lempar-sheet__panel {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
}

/* The tabs sit on the sheet's surface, so their track drops to base. */
.lempar-sheet :is(.lempar-segmented, .lempar-choice) {
	background-color: var(--wp--preset--color--base);
}

/*
 * Position and inset are the UA's defaults for a modal dialog, restated so
 * that a reset stylesheet stripping them cannot unpin the sheet; the
 * `margin-top: auto` below is what pushes it to the bottom against them.
 */
dialog.lempar-sheet {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: 100%;
	bottom: var(--lempar-keyboard-inset, 0px);
	max-height: calc(92dvh - var(--lempar-keyboard-inset, 0px));
	margin: auto 0 0;
	padding: 0;
	border: 0;
	border-end-start-radius: 0;
	border-end-end-radius: 0;
	box-shadow: var(--wp--preset--shadow--nav);
}

dialog.lempar-sheet:not([open]) {
	display: none;
}

/*
 * A literal colour, one of the three: ::backdrop inherits nothing from the
 * document in the browsers this site still serves, so a preset custom
 * property would resolve to nothing there. The value is --contrast's light
 * ink at half strength, which dims either scheme.
 */
dialog.lempar-sheet::backdrop {
	background-color: rgba(35, 34, 43, 0.5);
}

@media (min-width: 900px) {
	dialog.lempar-sheet:not(.lempar-app *) {
		max-width: 36rem;
		max-height: 85dvh;
		margin: auto;
		border-radius: var(--wp--custom--radius--card);
	}
}

/* -------------------------------------------------------------------------
 * 9a. Lightbox
 *
 * One photograph, opened with showModal() on a <dialog class="lempar-lightbox">
 * holding the <img>. The theme supplies the surround; the plugin supplies
 * the image's own sizing (Management's is 100vw by 92vh, contain).
 *
 * The surround is dark in both schemes, so it cannot be a preset: every
 * preset changes with the scheme, and a photograph wants the same dark
 * frame whichever the reader chose. It is the dark scheme's own --base,
 * #16151c, written as a literal for that reason — the second literal colour
 * in this file, beside the sheet's backdrop. color-scheme is set dark so the
 * browser's own controls inside (a close button's focus ring, scrollbars)
 * match the frame rather than the page.
 * ---------------------------------------------------------------------- */

dialog.lempar-lightbox {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: fit-content;
	height: fit-content;
	max-width: 100vw;
	max-height: 100dvh;
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 0;
	background-color: #16151c;
	color: #f7f2ea;
	color-scheme: dark;
}

dialog.lempar-lightbox:not([open]) {
	display: none;
}

dialog.lempar-lightbox::backdrop {
	background-color: rgba(22, 21, 28, 0.94);
}

dialog.lempar-lightbox img {
	display: block;
}

/*
 * The close control: a <button class="lempar-lightbox__close"> inside the
 * dialog, top-right of the frame, with the plugin's own icon or glyph and
 * an aria-label. Tap-to-close on the backdrop is not discoverable on a
 * handset, which is why Aaron asked for it.
 *
 * It sits over the photograph, so it brings its own ground rather than
 * trusting the image: the frame colour at 80%. Measured over the two worst
 * photographs, the icon is 8.66:1 on white and 16.86:1 on black. Over a
 * black photograph the ground itself all but disappears (1.12:1), so a
 * faint light hairline bounds it. The literals are the frame's, for the
 * frame's reason: they must not change with the scheme.
 *
 * Focus is a light ring on a dark halo, so it shows over any photograph:
 * the ring is 18.84:1 against black and the halo 18.13:1 against white.
 * Inset from the edge by the safe area on handsets with a notch.
 *
 * Pinned to the top right of the screen the reader sees, zoomed or not
 * (T-248, Aaron: when he pinch-zooms a photo the X must stay at the top
 * right). viewport.js publishes the visual viewport; the box is fixed with
 * its top right corner on the visual viewport's, then drawn at one over the
 * zoom about that corner, so it stays 44px on the glass, and moved in by
 * the inset, also over the zoom. Without the script the properties fall
 * back to no zoom: the screen's top right. Still the dialog's first child
 * in the plugin's markup, so showModal() focuses it.
 */
.lempar-lightbox__close {
	--lempar-close-inset-top: max(0.5rem, env(safe-area-inset-top, 0px));
	--lempar-close-inset-right: max(0.5rem, env(safe-area-inset-right, 0px));

	position: fixed;
	top: var(--lempar-vv-top, 0px);
	left: calc(var(--lempar-vv-left, 0px) + var(--lempar-vv-width, 100vw) - var(--wp--custom--tap-target));
	z-index: 1;
	transform-origin: 100% 0;
	transform:
		translate(
			calc(-1 * var(--lempar-close-inset-right) / var(--lempar-vv-scale, 1)),
			calc(var(--lempar-close-inset-top) / var(--lempar-vv-scale, 1))
		)
		scale(calc(1 / var(--lempar-vv-scale, 1)));
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wp--custom--tap-target);
	height: var(--wp--custom--tap-target);
	padding: 0;
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	background-color: rgba(22, 21, 28, 0.8);
	box-shadow: 0 0 0 1px rgba(247, 242, 234, 0.25);
	color: #f7f2ea;
	font: inherit;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
}

.lempar-lightbox__close:hover {
	background-color: rgba(22, 21, 28, 0.95);
}

.lempar-lightbox__close:focus-visible {
	outline: 2px solid #f7f2ea;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px #16151c;
}

.lempar-lightbox__close svg {
	width: 1.25rem;
	height: 1.25rem;
}

/* -------------------------------------------------------------------------
 * 10. Timeline
 *
 * A person's history, newest first. Each item's dot takes the item's tone;
 * an item with none is muted. The connecting line stops at the last item.
 * ---------------------------------------------------------------------- */

.lempar-timeline {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lempar-timeline > li {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.1875rem;
	min-height: 4rem;
	padding: 0 0 var(--wp--preset--spacing--40) 2.25rem;
	box-sizing: border-box;
}

.lempar-timeline > li::before {
	content: "";
	position: absolute;
	top: 0.25rem;
	left: 0.375rem;
	z-index: 1;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	background-color: var(--lempar-tone, var(--wp--preset--color--muted));
}

.lempar-timeline > li:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 1rem;
	bottom: 0;
	left: 0.6875rem;
	width: 2px;
	background-color: var(--wp--preset--color--line);
}

.lempar-timeline__title {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.35;
}

.lempar-timeline__meta {
	color: var(--wp--preset--color--muted);
	font-size: 0.75rem;
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * 10a. The app: one markup, two layouts (T-098)
 *
 * A coach screen is wrapped in .lempar-app, and its layout is decided by
 * that container's own width, never the device's. Below 900px of app width
 * nothing here applies: the tab bar is fixed to the bottom, the list is the
 * page, and a person or session opens as a sheet rising from the bottom, as
 * before. From 900px the same markup becomes three columns: a section rail
 * in place of the tab bar, the list at 340–460px, and the detail column,
 * in which the open sheet is docked as a panel rather than risen. Aaron
 * chose this from the prototype on 2026-09-27 ("wire it up"); the prototype
 * is kept as docs/research/2026-09-27-coach-screens-wide-prototype.html in
 * the family repository, for shape only.
 *
 * Why the container and not the viewport: the shell's sidebar takes a
 * share of the window from 900px of viewport, so a viewport breakpoint
 * would open three columns into a space too narrow for them; the
 * container knows the width the app actually has.
 *
 * Measured before relying on it: `container-type: inline-size` here does
 * not make the container the reference box for fixed descendants — a
 * fixed element inside one still sat at the viewport's bottom, 844 of 844
 * — so the phone tab bar inside .lempar-app stays pinned to the screen.
 *
 * Markup, all of it the plugin's:
 *   .lempar-app
 *     .lempar-app__layout
 *       nav.lempar-rail        the same items, icons and aria-current as…
 *       nav.lempar-tabbar      …the tab bar, which it replaces at width
 *       .lempar-app__list
 *       .lempar-app__detail
 *         .lempar-app__empty   "Pick a player or a session"
 *         .lempar-sheet        a <dialog> or a plain element; docked when
 *                              open (dialog[open], or an element without
 *                              `hidden`); its .lempar-savebar, as the
 *                              sheet's last child, is the panel's footer
 * ---------------------------------------------------------------------- */

.lempar-app {
	container-type: inline-size;
	container-name: lempar-app;
}

.lempar-rail,
.lempar-app__empty {
	display: none;
}

/*
 * In a sheet, the tab strip stays put while the panel scrolls: at the top
 * of the header already, and sticky if a plugin puts it in the body.
 */
.lempar-sheet .lempar-segmented[role="tablist"] {
	position: sticky;
	top: 0;
	z-index: 1;
}

/*
 * Three tiers, all by the app's width. Below 600px, the phone: the tab bar
 * fixed to the bottom, a sheet rising from it. From 600px, the rail
 * replaces the tab bar. From 600px to 899px, a tablet or a folded phone
 * opened out: rail and a full-width list, and a person or session opens as
 * a side sheet from the right over the list, with a scrim. From 900px, two
 * panes with the sheet docked. Management's script opens sheets modal below
 * 900px of app and docked above, so the side sheet is the modal sheet
 * restyled; it asks nothing new of the plugin.
 */
@container lempar-app (max-width: 599.98px) {
	.lempar-app .lempar-tabbar {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 30;
		height: var(--lempar-tabbar-height);
		padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid var(--wp--preset--color--line);
	}

	/* A save bar in the app's own flow floats above the fixed tab bar. */
	.lempar-app__layout .lempar-savebar {
		bottom: calc(var(--wp--preset--spacing--30) + max(var(--lempar-tabbar-height), var(--lempar-keyboard-inset, 0px)));
	}
}

@container lempar-app (min-width: 600px) {
	.lempar-app__layout {
		display: grid;
		grid-template-columns: 5.5rem minmax(0, 1fr);
		height: 100dvh;
		background-color: var(--wp--preset--color--base);
	}

	/*
	 * Each column is pinned to its track, so a rail that is still `hidden`
	 * while the plugin's script builds it leaves its track empty rather
	 * than pulling the list into it — measured on 877 before the script ran:
	 * the list 88px wide in the rail's track.
	 */
	.lempar-rail {
		grid-column: 1;
	}

	.lempar-app__list {
		grid-column: 2;
	}

	/* The rail replaces the tab bar; one markup, so the bar is hidden here. */
	.lempar-app .lempar-tabbar {
		display: none;
	}

	.lempar-rail {
		--lempar-tone: var(--wp--preset--color--accent);

		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		gap: 0.375rem;
		padding: var(--wp--preset--spacing--40) 0.5rem;
		border-right: 1px solid var(--wp--preset--color--line);
		background-color: var(--wp--preset--color--surface);
		overflow-y: auto;
	}

	.lempar-rail > a {
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 0.25rem;
		min-height: 4rem;
		padding: 0.25rem;
		border-radius: var(--wp--custom--radius--small);
		color: var(--wp--preset--color--muted);
		font-size: 0.75rem;
		font-weight: 700;
		line-height: 1.2;
		text-align: center;
		text-decoration: none;
	}

	.lempar-rail > a:hover {
		background-color: var(--wp--preset--color--surface-raised);
	}

	.lempar-rail svg {
		box-sizing: content-box;
		width: 1.5rem;
		height: 1.5rem;
		padding: 0.25rem;
		border-radius: 12px;
	}

	/* Current is accent, as on the tab bar: ink for the label, tint behind the icon. */
	.lempar-rail > a[aria-current="page"] {
		color: color-mix(in srgb, var(--lempar-tone) 40%, var(--wp--preset--color--contrast));
	}

	.lempar-rail > a[aria-current="page"] svg {
		background-color: color-mix(in srgb, var(--lempar-tone) 20%, transparent);
	}

	.lempar-app__list {
		box-sizing: border-box;
		min-width: 0;
		padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
		overflow-y: auto;
	}

}

@container lempar-app (min-width: 600px) and (max-width: 899.98px) {
	/* No detail column yet: the list has the width, and a sheet comes over it. */
	.lempar-app__detail {
		display: none;
	}

	/*
	 * The side sheet: the modal sheet, from the right edge, as tall as the
	 * window, as wide as 34rem or the app less its rail, whichever is
	 * narrower, so the rail stays in view. Its body scrolls and its save
	 * bar is its footer, as the docked panel's is. A top-layer dialog is
	 * still a descendant of the app, so the app's width decides it.
	 */
	.lempar-app dialog.lempar-sheet:modal {
		inset: 0 0 var(--lempar-keyboard-inset, 0px) auto;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		width: min(34rem, calc(100cqw - 5.5rem));
		max-width: none;
		height: calc(100dvh - var(--lempar-keyboard-inset, 0px));
		max-height: calc(100dvh - var(--lempar-keyboard-inset, 0px));
		margin: 0;
		border-start-start-radius: var(--wp--custom--radius--card);
		border-end-start-radius: var(--wp--custom--radius--card);
		border-start-end-radius: 0;
		border-end-end-radius: 0;
	}

	.lempar-app dialog.lempar-sheet:modal > .lempar-sheet__header {
		flex-shrink: 0;
	}

	.lempar-app dialog.lempar-sheet:modal > .lempar-sheet__body {
		flex: 1 1 auto;
		min-height: 0;
	}

	.lempar-app dialog.lempar-sheet:modal > .lempar-savebar {
		position: static;
		flex-shrink: 0;
		margin: 0;
		border-radius: 0;
		box-shadow: none;
	}
}

@container lempar-app (min-width: 900px) {
	.lempar-app__layout {
		grid-template-columns: 5.5rem clamp(340px, 36cqi, 460px) minmax(0, 1fr);
	}

	.lempar-app__list {
		border-right: 1px solid var(--wp--preset--color--line);
	}

	.lempar-app__detail {
		grid-column: 3;
	}

	/* A modal sheet that is not docked — a chooser, say — centres. */
	.lempar-app dialog.lempar-sheet:modal {
		max-width: 36rem;
		max-height: 85dvh;
		margin: auto;
		border-radius: var(--wp--custom--radius--card);
	}

	.lempar-app__detail {
		position: relative;
		min-width: 0;
		min-height: 0;
		overflow: hidden;
	}

	.lempar-app__empty {
		display: grid;
		place-items: center;
		height: 100%;
		color: var(--wp--preset--color--muted);
		font-weight: 700;
		text-align: center;
	}

	.lempar-app__detail:has(> :is(dialog.lempar-sheet[open], :not(dialog).lempar-sheet:not([hidden]))) > .lempar-app__empty {
		display: none;
	}

	/*
	 * The docked panel. Everything that makes a sheet rise — fixed position,
	 * the bottom margin, the shadow, the top-only corners, the height cap —
	 * is undone, and the panel fills the column with its own scroll. A
	 * dialog opened with show() rather than showModal() has no backdrop.
	 */
	.lempar-app__detail > .lempar-sheet {
		position: static;
		inset: auto;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		margin: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.lempar-app__detail > dialog.lempar-sheet:not([open]) {
		display: none;
	}

	.lempar-app__detail > .lempar-sheet > .lempar-sheet__header {
		flex-shrink: 0;
		padding-inline: var(--wp--preset--spacing--70);
	}

	.lempar-app__detail > .lempar-sheet > .lempar-sheet__body {
		flex: 1 1 auto;
		min-height: 0;
		padding-inline: var(--wp--preset--spacing--70);
	}

	/* The save bar is the panel's footer: flush, full width, never floating. */
	.lempar-app__detail > .lempar-sheet > .lempar-savebar {
		position: static;
		flex-shrink: 0;
		margin: 0;
		border-radius: 0;
		box-shadow: none;
	}
}

/* -------------------------------------------------------------------------
 * 10b. The app page fits the window
 *
 * On the page-app template, when the app is the page's content, the page
 * does not scroll at width: the main column is the window's height, the
 * title keeps its own, the app takes what is left, each column scrolls on
 * its own, and the footer steps aside. Management measured the need on
 * page 877 at 1280x800 (T-098): the layout was 100dvh tall but began at
 * y 112, under the title, so every column's foot — both save bars with it
 * — sat 112px below the window at scroll 0.
 *
 * Decided by the width the app will have, as the app's own layout is, not
 * the device's. The template wraps main and footer in .lempar-app-page, a
 * query container; the app is main's width less main's side padding, the
 * root padding of 1.125rem each side, so 600px of app — where the rail
 * replaces the tab bar — is 600px + 2.25rem of this container. Below that
 * the page scrolls as a phone's does, and the room it needs at its end for
 * the fixed tab bar is kept under the footer, since the app's own
 * container cannot reach the footer and the window cannot see the app.
 * `:has(> .lempar-app)` limits the fit to a page whose post content is the
 * app itself: a page with an app among other content — the
 * demo, 878 — scrolls as a page should, and its app keeps its 100dvh.
 *
 * Constrained layout centres its children with auto margins, which in a
 * flex column would shrink them to their content — the app, an inline-size
 * container with no content width of its own, measured 0px wide — so they
 * are given their full width back. And main's height is the window less the
 * gap the site puts above every top-level block after the header,
 * `:where(.wp-site-blocks) > * { margin-block-start: spacing-50 }`, named
 * here by the same token so the two cannot drift apart, and less the top
 * bar where the shell has one (--lempar-shell-top, set by lempar.css below
 * 900px of window, where the header is a bar in the flow and not the
 * fixed sidebar).
 * ---------------------------------------------------------------------- */

.lempar-app-page {
	container-type: inline-size;
	container-name: lempar-app-page;
}

@container lempar-app-page (max-width: calc(600px + 2.25rem - 0.02px)) {
	.lempar-app-page:has(.lempar-app .lempar-tabbar:not([hidden])) > .lempar-footer {
		margin-bottom: var(--lempar-tabbar-height);
	}

	/*
	 * Every save bar on the page clears the app's fixed tab bar, not only the
	 * app's own: on 878 the demo's standalone bar, outside the app, sat 68px
	 * lower and behind the tab bar once only in-app bars were lifted.
	 */
	.lempar-app-page:has(.lempar-app .lempar-tabbar:not([hidden])) .lempar-savebar:not(dialog *) {
		bottom: calc(var(--wp--preset--spacing--30) + max(var(--lempar-tabbar-height), var(--lempar-keyboard-inset, 0px)));
	}
}

/*
 * An app on any other template has no wrapper to ask, so the window
 * stands in, as it did before page-app: a fallback, not the rule.
 */
@media (max-width: 899.98px) {
	body:not(:has(.lempar-app-page)):has(.lempar-app .lempar-tabbar:not([hidden])) {
		padding-bottom: var(--lempar-tabbar-height);
	}

	body:not(:has(.lempar-app-page)):has(.lempar-app .lempar-tabbar:not([hidden])) .lempar-savebar:not(dialog *) {
		bottom: calc(var(--wp--preset--spacing--30) + max(var(--lempar-tabbar-height), var(--lempar-keyboard-inset, 0px)));
	}
}

@container lempar-app-page (min-width: calc(600px + 2.25rem)) {
	.lempar-app-page main:has(> .wp-block-post-content > .lempar-app) {
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		height: calc(100dvh - var(--lempar-shell-top, 0px)); /* main has no top margin since T-436 */
	}

	.lempar-app-page main:has(> .wp-block-post-content > .lempar-app) > * {
		box-sizing: border-box;
		width: 100%;
	}

	.lempar-app-page main > .wp-block-post-content:has(> .lempar-app) {
		display: flex;
		flex: 1 1 0;
		flex-direction: column;
		min-height: 0;
	}

	.lempar-app-page .wp-block-post-content > .lempar-app {
		box-sizing: border-box;
		flex: 1 1 0;
		width: 100%;
		min-height: 0;
	}

	.lempar-app-page .wp-block-post-content > .lempar-app > .lempar-app__layout {
		height: 100%;
	}

	.lempar-app-page:has(main > .wp-block-post-content > .lempar-app) > .lempar-footer {
		display: none;
	}
}

/* -------------------------------------------------------------------------
 * 11. Motion
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	:is(summary, a).lempar-row::after {
		transition: none;
	}

	/* The busy ring stands still: a static mark, not a stopped spinner. */
	.lempar-savebar .lempar-savebar__save[aria-busy="true"]::before,
	button[aria-busy="true"]:not(.lempar-savebar__save)::before,
	.lempar-button--stacked[aria-busy="true"] .lempar-button__disc::before {
		animation: none;
	}

	.lempar-picker__trigger::after {
		transition: none;
	}

	/* The region arrives without the slide; colour and edge announce it. */
	.lempar-region.is-opening {
		animation: none;
	}
}

/* -------------------------------------------------------------------------
 * 12. A sheet that scrolls whole (T-198)
 *
 * `.lempar-sheet--scrolls-whole` on a sheet makes the sheet itself the
 * scroller, its header included, in every tier: the modal sheet on a phone,
 * the side sheet and the docked panel. Back, the title and the tabs scroll
 * away with the content and come back when the reader scrolls up, so a
 * plugin's own `position: sticky; top: 0` row inside the body (Management's
 * attendance filter tiles) holds the top of the sheet instead. Escape still
 * closes a modal sheet wherever it is scrolled. The save bar stays at the
 * sheet's foot: floating and sticky on a phone, as without the modifier;
 * a flush footer, now sticky, in the side and docked tiers. Sheets without
 * the modifier are untouched.
 *
 * At the end of the file, and its child rules raised by `:not(#lempar-none)`
 * (one id's weight, matching every element), because the tiers' own rules
 * reach (0,4,1) — `.lempar-app dialog.lempar-sheet:modal > …` — and the
 * modifier has to win over each of them without restating each.
 * ---------------------------------------------------------------------- */

.lempar-sheet.lempar-sheet--scrolls-whole {
	overflow-y: auto;
	overscroll-behavior: contain;
}

.lempar-sheet--scrolls-whole:not(#lempar-none) > :is(.lempar-sheet__header, .lempar-sheet__body) {
	flex: none;
	min-height: auto;
}

.lempar-sheet--scrolls-whole:not(#lempar-none) > .lempar-sheet__body {
	overflow: visible;
}

/* The tabs scroll away with the header rather than holding the top. */
.lempar-sheet--scrolls-whole:not(#lempar-none) .lempar-segmented[role="tablist"] {
	position: static;
}

/* Where the tiers make the save bar a static footer, it sticks to the foot. */
.lempar-app dialog.lempar-sheet--scrolls-whole:modal > .lempar-savebar,
.lempar-app__detail > .lempar-sheet--scrolls-whole > .lempar-savebar {
	position: sticky;
	bottom: 0;
	margin-top: auto;
}

/* -------------------------------------------------------------------------
 * 13. A wide docked sheet (T-244)
 *
 * `.lempar-sheet--wide` on a sheet docked in the detail column: while it is
 * open, from 900px of app width, the detail column takes the list's track
 * as well and the list is not drawn, so the sheet spans both — Aaron wanted
 * the person sheet at least twice as wide on a desktop. Nothing scripts
 * it: when the plugin closes the sheet (its Back), the `:has()` below no
 * longer matches and the list returns as it was. Below 900px of app the
 * sheet is the phone's full-width modal or the side sheet, as without the
 * modifier, and a sheet without it is untouched. Open means what §10a
 * means by docked: `dialog[open]`, or a plain element without `hidden`.
 * ---------------------------------------------------------------------- */

@container lempar-app (min-width: 900px) {
	.lempar-app__layout:has(> .lempar-app__detail > :is(dialog.lempar-sheet--wide[open], :not(dialog).lempar-sheet--wide:not([hidden]))) > .lempar-app__list {
		display: none;
	}

	.lempar-app__layout:has(> .lempar-app__detail > :is(dialog.lempar-sheet--wide[open], :not(dialog).lempar-sheet--wide:not([hidden]))) > .lempar-app__detail {
		grid-column: 2 / -1;
	}
}

/* -------------------------------------------------------------------------
 * 14. A full-screen sheet with a fixed foot (T-361)
 *
 * A walk-through, "Enter a team": one question a step, Back and the next
 * step at the foot. `dialog.lempar-sheet.lempar-sheet--full`, opened with
 * showModal():
 *
 *   <dialog class="lempar-sheet lempar-sheet--full" aria-labelledby="…">
 *     <div class="lempar-sheet__header">
 *       <div class="lempar-sheet__identity">
 *         <button class="lempar-button lempar-button--icon" aria-label="Close">svg</button>
 *         <h1 id="…">Enter Kejuaraan Nasional</h1>
 *         <p class="lempar-steps__count">Step 1 of 5</p>
 *       </div>
 *       <ol class="lempar-steps">…</ol>
 *     </div>
 *     <div class="lempar-sheet__body">…</div>
 *     <div class="lempar-sheet__foot">
 *       <button class="lempar-button">Back</button>
 *       <button class="wp-element-button">Next</button>
 *     </div>
 *   </dialog>
 *
 * Below 900px of window it is the whole window on the page's ground, the
 * keyboard's inset taken off its foot; from 900px a centred panel, 40rem
 * by at most 85% of the window, a fixed height so a step's change does not
 * move it. By the window, not the app: it covers whatever opened it, a
 * coach screen as much as a tournament page. Its selectors carry the
 * `:not(#lempar-none)` lift, so the app's side-sheet and docking rules,
 * which reach (0,4,1), cannot dock it. The header and the foot keep their
 * height and the body scrolls between them. The foot's first plain
 * `lempar-button` is the quiet Back, its ground taken away; the primary is
 * the site's `wp-element-button` at the end, alone where there is no
 * Back. Without `ol.lempar-steps` the header is the top line alone.
 * ---------------------------------------------------------------------- */

dialog.lempar-sheet.lempar-sheet--full:not(#lempar-none) {
	position: fixed;
	inset: 0 0 var(--lempar-keyboard-inset, 0px) 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: none;
	height: calc(100dvh - var(--lempar-keyboard-inset, 0px));
	max-height: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 0;
	background-color: var(--wp--preset--color--base);
	box-shadow: none;
}

dialog.lempar-sheet.lempar-sheet--full:not(#lempar-none):not([open]) {
	display: none;
}

.lempar-sheet--full:not(#lempar-none) > .lempar-sheet__header {
	flex-shrink: 0;
	gap: var(--wp--preset--spacing--20);
	padding: max(0.25rem, env(safe-area-inset-top)) var(--wp--preset--spacing--40) 0.625rem 0.375rem;
	border-bottom: 1px solid var(--wp--preset--color--line);
	background-color: var(--wp--preset--color--base);
}

.lempar-sheet--full > .lempar-sheet__header > .lempar-sheet__identity {
	gap: 0.25rem;
	min-height: var(--wp--custom--tap-target);
}

.lempar-sheet--full > .lempar-sheet__header > .lempar-sheet__identity > .lempar-button--icon:first-child {
	background: transparent;
}

/* A mouse hover only: a tap leaves the button as it was (T-440). */
@media (hover: hover) {
	.lempar-sheet--full > .lempar-sheet__header > .lempar-sheet__identity > .lempar-button--icon:first-child:hover {
		background-color: var(--lempar-fill, var(--wp--preset--color--surface-raised));
	}
}

.lempar-sheet--full > .lempar-sheet__header > .lempar-sheet__identity > :is(h1, h2) {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 900;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.lempar-sheet--full > .lempar-sheet__header > .lempar-sheet__identity > .lempar-steps__count {
	flex: none;
	margin: 0;
	color: var(--wp--preset--color--muted);
}

/* The steps sit under the top line, from the title's start, not the Close's. */
.lempar-sheet--full > .lempar-sheet__header > .lempar-steps {
	margin: 0;
	padding-inline-start: 0.625rem;
}

.lempar-sheet--full:not(#lempar-none) > .lempar-sheet__body {
	flex: 1 1 auto;
	min-height: 0;
	gap: var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* What is in the body keeps its height; the body scrolls instead (§9's squeeze). */
.lempar-sheet--full > .lempar-sheet__body > * {
	flex-shrink: 0;
}

.lempar-sheet__foot {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	padding: 0.625rem var(--wp--preset--spacing--40) max(0.875rem, env(safe-area-inset-bottom));
	border-top: 1px solid var(--wp--preset--color--line);
	background-color: var(--wp--preset--color--base);
}

.lempar-sheet__foot > :is(.wp-element-button, .lempar-button) {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	min-height: 2.9375rem;
	font-size: var(--wp--preset--font-size--medium);
}

/* The quiet Back: no ground, the page's ink, its target kept. */
.lempar-sheet__foot > .lempar-button:not([class*="is-tone-"]) {
	padding-inline: 0.5rem 1rem;
	border: 0;
	background: transparent;
	font-weight: 800;
}

/* A mouse hover only: a tap leaves the button as it was (T-440). */
@media (hover: hover) {
	.lempar-sheet__foot > .lempar-button:not([class*="is-tone-"]):hover {
		background-color: var(--lempar-fill, var(--wp--preset--color--surface-raised));
	}
}

.lempar-sheet__foot > .wp-element-button {
	margin-inline-start: auto;
	border-radius: var(--wp--custom--radius--pill);
	font-weight: 900;
}

.lempar-sheet__foot svg {
	width: 1.25rem;
	height: 1.25rem;
	flex-shrink: 0;
}

dialog.lempar-sheet--full::backdrop {
	background-color: rgba(35, 34, 43, 0.5);
}

@media (min-width: 900px) {
	dialog.lempar-sheet.lempar-sheet--full:not(#lempar-none) {
		inset: 0;
		width: min(40rem, calc(100vw - 4rem));
		height: min(85dvh, 52rem);
		margin: auto;
		border-radius: var(--wp--custom--radius--card);
		box-shadow: var(--wp--preset--shadow--nav);
	}

	.lempar-sheet--full:not(#lempar-none) > .lempar-sheet__header {
		padding-top: var(--wp--preset--spacing--20);
	}

	.lempar-sheet--full:not(#lempar-none) > .lempar-sheet__body {
		padding-inline: var(--wp--preset--spacing--60);
	}

	.lempar-sheet__foot {
		padding-bottom: 0.875rem;
	}
}

/* -------------------------------------------------------------------------
 * 15. Large choice cards (T-361)
 *
 * One of a few ways, each a card with an icon, a title and a line under
 * it, "How do you want to enter?":
 *
 *   <div class="lempar-choice-cards" role="radiogroup" aria-labelledby="…">
 *     <label class="lempar-choice-card">
 *       <input type="radio" name="how" value="squad">
 *       <span class="lempar-choice-card__icon" aria-hidden="true">svg</span>
 *       <span class="lempar-choice-card__text">
 *         <span class="is-style-pill">Recommended</span>
 *         <span class="lempar-choice-card__title">Use your training squad</span>
 *         <span class="lempar-choice-card__meta">18 selected players</span>
 *       </span>
 *       <span class="lempar-choice-card__mark" aria-hidden="true"></span>
 *     </label>
 *   </div>
 *
 * The radio is the control, unseen and in the tab order; the arrow keys
 * move between the cards as between any radios. The badge is optional.
 * The mark is empty markup: the theme draws the ring, and the tick when
 * checked. Checked is drawn as a pressed chip is, the accent's tint and a
 * 2px accent ring, the icon on the surface in the accent's ink and the
 * line under the title in that ink. A disabled card is drawn as a
 * disabled button is: no ground, a line ring, the words muted.
 * ---------------------------------------------------------------------- */

.lempar-choice-cards {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30);
}

.lempar-choice-card {
	position: relative;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	min-height: var(--wp--custom--tap-target);
	padding: var(--wp--preset--spacing--40) 0.875rem var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
	border: 2px solid var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}

/* Unseen, still the control: in the tab order, the form and the arrow keys. */
.lempar-choice-card > input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.lempar-choice-card:has(> input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.lempar-choice-card__icon {
	box-sizing: border-box;
	display: grid;
	flex: none;
	place-items: center;
	width: 3rem;
	height: 3rem;
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
}

.lempar-choice-card__icon svg {
	width: 1.5rem;
	height: 1.5rem;
}

.lempar-choice-card__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	min-width: 0;
}

.lempar-choice-card__text > .is-style-pill {
	margin: 0;
}

.lempar-choice-card__title {
	font-size: 1.0625rem;
	font-weight: 900;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.lempar-choice-card__meta {
	color: var(--wp--preset--color--muted);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
}

.lempar-choice-card__mark {
	box-sizing: border-box;
	position: relative;
	flex: none;
	width: 1.625rem;
	height: 1.625rem;
	border: 2px solid var(--wp--preset--color--muted);
	border-radius: 50%;
	background-color: var(--wp--preset--color--surface);
}

.lempar-choice-card:has(> input:checked) {
	border-color: var(--wp--preset--color--accent);
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 20%, var(--wp--preset--color--surface));
}

.lempar-choice-card:has(> input:checked) .lempar-choice-card__icon {
	background-color: var(--wp--preset--color--surface);
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
}

.lempar-choice-card:has(> input:checked) .lempar-choice-card__meta {
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
}

.lempar-choice-card:has(> input:checked) .lempar-choice-card__mark {
	border: 0;
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
}

/* The tick: two sides of a box, turned. */
.lempar-choice-card:has(> input:checked) .lempar-choice-card__mark::after {
	content: "";
	position: absolute;
	top: 0.3125rem;
	left: 0.5625rem;
	width: 0.4375rem;
	height: 0.75rem;
	border: solid var(--wp--preset--color--surface);
	border-width: 0 0.15625rem 0.15625rem 0;
	transform: rotate(45deg);
}

.lempar-choice-card:has(> input:disabled) {
	border-color: transparent;
	background-color: transparent;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	cursor: not-allowed;
}

.lempar-choice-card:has(> input:disabled) :is(.lempar-choice-card__icon, .lempar-choice-card__mark) {
	background-color: transparent;
	color: var(--wp--preset--color--muted);
}

/* -------------------------------------------------------------------------
 * 16. Help pages and walkthroughs (T-455)
 *
 * The parts core's help section (T-453) and a module's help pages and
 * walkthroughs (T-454) are written in. The names were fixed by the Manager
 * before the look, since core and Tournaments wrote markup against them the
 * same night: add to them, never rename them.
 *
 * - `article.lempar-prose`: running text at a readable measure.
 * - `ol.lempar-howto`: numbered steps, one action each.
 * - `aside.lempar-callout` with `is-tip`, `is-warning` or `is-note`.
 * - `span.lempar-ui`: a control's name, drawn as a key to press.
 * - `a.lempar-try`: a help page's one way to its practice area.
 * - `input.lempar-help-search`: the index's search, above its rows.
 * - `div.lempar-coach`: a walkthrough's note; `.lempar-coach-target` the
 *   ring on what it points at. assets/js/coach.js keeps the two apart.
 * - `p.lempar-help-link`: the footer's link to help (blocks/help-link).
 * ---------------------------------------------------------------------- */

/* Prose: a measure for reading, and the page's own type inside it. */
.lempar-prose {
	max-width: 68ch;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
}

.lempar-prose > * {
	margin-block: 0;
}

.lempar-prose > * + * {
	margin-block-start: 1em;
}

.lempar-prose > :is(h2, h3, h4) {
	margin-block-start: 1.75em;
	line-height: 1.25;
	font-weight: 900;
}

.lempar-prose > :is(h2, h3, h4) + * {
	margin-block-start: 0.5em;
}

.lempar-prose > h2 {
	font-size: 1.375rem;
}

.lempar-prose > h3 {
	font-size: 1.125rem;
}

.lempar-prose > h4 {
	font-size: 1rem;
}

.lempar-prose :is(ul, ol):not([class]) {
	padding-inline-start: 1.375em;
}

.lempar-prose :is(ul, ol):not([class]) > li + li {
	margin-block-start: 0.375em;
}

.lempar-prose a:not([class]) {
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.lempar-prose img {
	display: block;
	box-sizing: border-box;
	max-width: 100%;
	height: auto;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--small);
}

.lempar-prose figure {
	margin-inline: 0;
}

.lempar-prose figcaption {
	margin-top: 0.5em;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.lempar-prose :is(code, kbd) {
	padding: 0.1em 0.35em;
	border-radius: 6px;
	background-color: var(--wp--preset--color--surface-raised);
	font-size: 0.875em;
}

.lempar-prose hr {
	margin-block: 2em;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--line);
}

/*
 * How-to steps: a numbered disc a step, joined by a line, the step's words
 * beside it. The disc is the raised surface under the page's ink, as the
 * number control's steps are: a step to do, not where you are, so no
 * accent. Anything may sit in a step: a paragraph, an image, a callout.
 */
ol.lempar-howto {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-inline: 0;
	padding: 0;
	list-style: none;
	counter-reset: lempar-howto;
}

.lempar-howto > li {
	position: relative;
	min-height: 2rem;
	padding-inline-start: 2.75rem;
	counter-increment: lempar-howto;
}

.lempar-howto > li::before {
	content: counter(lempar-howto);
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background-color: var(--wp--preset--color--surface-raised);
	color: var(--wp--preset--color--contrast);
	font-size: 0.875rem;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.lempar-howto > li:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 2.25rem;
	bottom: -0.75rem;
	left: calc(1rem - 1px);
	width: 2px;
	border-radius: 1px;
	background-color: var(--wp--preset--color--line);
}

.lempar-howto > li > * {
	margin-block: 0;
}

/* The first line of a step sits on the disc's middle. */
.lempar-howto > li > :first-child {
	padding-block-start: calc((2rem - 1lh) / 2);
}

.lempar-howto > li > * + * {
	margin-block-start: 0.5em;
}

/*
 * Callouts: a tip, a warning or a note, on a tint of its tone with the
 * tone's mark beside the words. The words keep the page's ink; only the
 * mark takes the tone's. A tip is spirit, a warning alert, a note muted.
 */
.lempar-callout {
	--lempar-tone: var(--wp--preset--color--muted);
	display: grid;
	grid-template-columns: 1.25rem minmax(0, 1fr);
	column-gap: 0.75rem;
	box-sizing: border-box;
	padding: 0.875rem 1rem;
	border: 1px solid color-mix(in srgb, var(--lempar-tone) 35%, transparent);
	border-radius: var(--wp--custom--radius--small);
	background-color: color-mix(in srgb, var(--lempar-tone) 12%, transparent);
	color: var(--wp--preset--color--contrast);
	line-height: 1.5;
}

.lempar-callout.is-tip {
	--lempar-tone: var(--wp--preset--color--spirit);
}

.lempar-callout.is-warning {
	--lempar-tone: var(--wp--preset--color--alert);
}

.lempar-callout::before {
	content: "";
	grid-row: 1 / span 20;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: calc((1lh - 1.25rem) / 2);
	background-color: color-mix(in srgb, var(--lempar-tone) 40%, var(--wp--preset--color--contrast));
	-webkit-mask: var(--lempar-callout-mark) center / contain no-repeat;
	mask: var(--lempar-callout-mark) center / contain no-repeat;
	--lempar-callout-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v6M12 7.5v.01'/%3E%3C/svg%3E");
}

.lempar-callout.is-tip::before {
	--lempar-callout-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.6 10.8c.6.5 1 1.2 1 2V16h5.2v-.2c0-.8.4-1.5 1-2A6 6 0 0 0 12 3z'/%3E%3C/svg%3E");
}

.lempar-callout.is-warning::before {
	--lempar-callout-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.5 20h19z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.01'/%3E%3C/svg%3E");
}

.lempar-callout > * {
	grid-column: 2;
	margin-block: 0;
}

.lempar-callout > * + * {
	margin-block-start: 0.5em;
}

/* A control's name: the key to press, inline in the sentence. */
.lempar-ui {
	display: inline-block;
	padding: 0 0.45em;
	border-radius: 6px;
	background-color: var(--wp--preset--color--surface-raised);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--line);
	color: var(--wp--preset--color--contrast);
	font-size: 0.9em;
	font-weight: 800;
	line-height: 1.6;
	white-space: nowrap;
}

.lempar-ui svg {
	width: 1em;
	height: 1em;
	margin-inline-end: 0.3em;
	vertical-align: -0.125em;
}

/*
 * The way to practise: one row a help page has once, a play mark, the
 * words and a chevron, on the accent's tint with the accent's ink.
 */
a.lempar-try {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	box-sizing: border-box;
	width: 100%;
	min-height: 3.5rem;
	padding: 0.75rem 1rem;
	border: 2px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius--card);
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 12%, var(--wp--preset--color--surface));
	color: color-mix(in srgb, var(--wp--preset--color--accent) 40%, var(--wp--preset--color--contrast));
	font-weight: 900;
	line-height: 1.3;
	text-decoration: none;
}

a.lempar-try::before,
a.lempar-try::after {
	content: "";
	flex: none;
	background-color: currentColor;
}

a.lempar-try::before {
	width: 1.5rem;
	height: 1.5rem;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M10 8.5v7l5.5-3.5z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M10 8.5v7l5.5-3.5z' fill='%23000'/%3E%3C/svg%3E") center / contain no-repeat;
}

a.lempar-try::after {
	width: 1rem;
	height: 1rem;
	margin-inline-start: auto;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (hover: hover) {
	a.lempar-try:hover {
		background-color: color-mix(in srgb, var(--wp--preset--color--accent) 22%, var(--wp--preset--color--surface));
	}
}

/* The index's search: the site's field, the column's width. */
input.lempar-help-search {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin-block: 0 var(--wp--preset--spacing--50);
}

/* The footer's link to help: a 44px target in the footer's small type. */
.lempar-help-link a {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--tap-target);
}

/*
 * A walkthrough's note. On the page it floats at the window's foot (or,
 * moved by coach.js, under the header bar), above the keyboard and the
 * home indicator, inverted in light and the raised surface in dark, as an
 * inverted card is (T-398). Inside a sheet or dialog it sits in the
 * sheet's flow, so a modal's inert outside never holds it and it covers
 * nothing. The plugin's markup: an optional `p.lempar-coach__count`
 * ("Step 2 of 6"), `p.lempar-coach__text`, and `div.lempar-coach__actions`
 * holding its buttons, Skip with `lempar-coach__skip` (it goes to the
 * row's start) and Next as the `wp-element-button`.
 *
 * Small, so it hides little (T-461): its actions are one row, whose labels
 * wrap inside their 44px buttons rather than the row wrapping; it is never
 * taller than a third of the window above the keyboard, its words
 * scrolling within it above actions that stay in sight; and in a short
 * window, as with a keyboard up, coach.js marks it compact
 * (`data-lempar-coach-size`): the count is for a screen reader only, the
 * words a size smaller, the padding less, so a sheet's body keeps the room.
 */
.lempar-coach {
	--lempar-coach-pad-block: 0.625rem;
	--lempar-coach-pad-inline: 0.875rem;
	position: fixed;
	right: 0;
	bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px) + var(--lempar-keyboard-inset, 0px));
	left: 0;
	z-index: 25;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	box-sizing: border-box;
	width: calc(100% - 1.5rem);
	max-width: 30rem;
	max-height: max(7.5rem, calc((100dvh - var(--lempar-keyboard-inset, 0px)) / 3));
	margin-inline: auto;
	padding: var(--lempar-coach-pad-block) var(--lempar-coach-pad-inline) 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--lempar-coach-ground);
	box-shadow: var(--wp--preset--shadow--nav);
	color: var(--lempar-coach-ink);
}

/*
 * Held above 0,1,0 (T-620), as the save bar is: wp-components'
 * `[role=region] { position: relative }` put a note that is a region
 * into the page's flow for a signed-in administrator on WordPress.com.
 * Inside a sheet the flow rule below still wins, by order at 0,2,0.
 */
.lempar-coach[role] {
	position: fixed;
}

.lempar-coach[data-lempar-coach-place="top"] {
	top: calc(var(--lempar-shell-top, 0px) + 0.75rem);
	bottom: auto;
}

@media (min-width: 900px) {
	/* Centred on the page beside the sidebar, not on the window. */
	.lempar-coach {
		left: 232px;
		width: calc(100% - 232px - 3rem);
	}
}

:is(dialog, .lempar-sheet) .lempar-coach {
	position: relative;
	inset: auto;
	z-index: auto;
	flex: none;
	width: auto;
	max-width: none;
	margin: 0 var(--wp--preset--spacing--30) var(--wp--preset--spacing--30);
	box-shadow: none;
}

.lempar-coach > * {
	margin: 0;
}

.lempar-coach__count {
	color: color-mix(in srgb, var(--lempar-coach-ink) 72%, var(--lempar-coach-ground));
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: 0.02em;
}

.lempar-coach__text {
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.4;
}

/*
 * One row, kept in sight at the note's foot while its words scroll. The
 * row's padding is the note's own bottom padding, so the sticky row
 * covers the words to the note's edge.
 */
.lempar-coach__actions {
	position: sticky;
	bottom: 0;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.375rem;
	margin-top: 0.125rem;
	padding-bottom: var(--lempar-coach-pad-block);
	background-color: var(--lempar-coach-ground);
}

.lempar-coach__skip {
	margin-inline-end: auto;
}

/* Its buttons, whatever class the plugin gives them, on its ground. */
.lempar-coach__actions > :is(button, a) {
	flex: 0 1 auto;
	min-width: var(--wp--custom--tap-target);
	line-height: 1.15;
	text-align: center;
	white-space: normal;
	overflow-wrap: break-word;
}

.lempar-coach :is(button, a):not(.wp-element-button, .lempar-ui) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: var(--wp--custom--tap-target);
	min-height: var(--wp--custom--tap-target);
	padding: 0 0.75rem;
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	background: transparent;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lempar-coach-ink) 40%, var(--lempar-coach-ground));
	color: var(--lempar-coach-ink);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 800;
	line-height: 1.15;
	text-decoration: none;
	cursor: pointer;
}

.lempar-coach :is(button, a).lempar-coach__skip:not(.wp-element-button) {
	padding-inline: 0.375rem;
	box-shadow: none;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.lempar-coach .wp-element-button {
	min-height: var(--wp--custom--tap-target);
	padding: 0.25rem 1rem;
	font-size: 0.9375rem;
	line-height: 1.15;
}

/* A short window: the body under it keeps the room (T-461). */
.lempar-coach[data-lempar-coach-size="compact"] {
	--lempar-coach-pad-block: 0.5rem;
	--lempar-coach-pad-inline: 0.75rem;
	gap: 0.125rem;
}

.lempar-coach[data-lempar-coach-size="compact"] .lempar-coach__count {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.lempar-coach[data-lempar-coach-size="compact"] .lempar-coach__text {
	font-size: 0.875rem;
	line-height: 1.35;
}

:is(dialog, .lempar-sheet) .lempar-coach[data-lempar-coach-size="compact"] {
	margin: 0 var(--wp--preset--spacing--20) var(--wp--preset--spacing--20);
}

@media (hover: hover) {
	.lempar-coach :is(button, a):not(.wp-element-button, .lempar-ui, .lempar-coach__skip):hover {
		background-color: color-mix(in srgb, var(--lempar-coach-ink) 14%, var(--lempar-coach-ground));
	}
}

/* The page keeps its end above a note at the foot (coach.js). */
html[style*="--lempar-coach-room"] body::after {
	content: "";
	display: block;
	height: var(--lempar-coach-room, 0px);
}

/*
 * The ring on what a step points at, in the note's own colours (T-473), so
 * it pairs with the note and wears no hue a team can have: a double line,
 * two 2px lines with a 2px gap between, flush round the control. A keeper
 * control's own marks are one line, solid (a counting timeout, in the
 * team's colour) or dashed (a pencil); no control draws two. The lines are
 * whichever of the note's two colours stands off the page, its ground in
 * light and its ink in dark (both the page's ink), and the gap is the
 * other. The outer line is the outline, the inner line and the gap one
 * shadow each, and the halo, in the lines' colour, pulses out from the
 * ring. Under reduced motion the halo stands still.
 */
.lempar-coach,
.lempar-coach-target {
	--lempar-coach-ground: light-dark(var(--wp--preset--color--contrast), var(--wp--preset--color--surface-raised));
	--lempar-coach-ink: light-dark(var(--wp--preset--color--base), var(--wp--preset--color--contrast));
}

.lempar-coach-target.lempar-coach-target {
	--lempar-coach-line: light-dark(var(--lempar-coach-ground), var(--lempar-coach-ink));
	--lempar-coach-gap: light-dark(var(--lempar-coach-ink), var(--lempar-coach-ground));
	--lempar-coach-lines: 0 0 0 2px var(--lempar-coach-line), 0 0 0 4px var(--lempar-coach-gap);
	outline: 2px solid var(--lempar-coach-line);
	outline-offset: 4px;
	box-shadow: var(--lempar-coach-lines);
	scroll-margin-block: calc(var(--lempar-shell-top, 0px) + 6rem) 14rem;
	animation: lempar-coach-pulse 1.6s ease-out infinite;
}

/* In a sheet the body is its own scrollport: the note and header are outside it. */
:is(dialog, .lempar-sheet) .lempar-coach-target.lempar-coach-target {
	scroll-margin-block: 0.75rem;
}

@keyframes lempar-coach-pulse {
	0% {
		box-shadow: var(--lempar-coach-lines), 0 0 0 6px color-mix(in srgb, var(--lempar-coach-line) 40%, transparent);
	}

	100% {
		box-shadow: var(--lempar-coach-lines), 0 0 0 20px color-mix(in srgb, var(--lempar-coach-line) 0%, transparent);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lempar-coach-target.lempar-coach-target {
		animation: none;
		box-shadow: var(--lempar-coach-lines), 0 0 0 10px color-mix(in srgb, var(--lempar-coach-line) 22%, transparent);
	}
}
