/* The site's design (UV, 7 Nov; docs/ui.md, "The design"), from the neumorphism
   sandbox, on every page but the match stage. Loaded after the component and control
   layers and before a page's own stylesheet.

   Everything is see-through, so the page carries on behind it and only the shadows
   draw it. They are cast by the light (page-light.js): cards and buttons are raised,
   inputs are sunken, and the card floats above them. One text size, 16px, one field
   height, 52px, and 24px between fields. A glow or selection that moves is always
   animated, on a layer of its own or by an outline: a transition on a shadow holding
   the light's offset would start again at every move of the light.

   The stage (.mv-stage) draws itself in match.css and is left out. */

/* ── The page ──────────────────────────────────────────────────────── */
/* Its glow is off: the light is seen only in what it casts. The match page keeps it,
   for the stage. */
body:not(:has(#mv-stage))::before { opacity: 0; }

/* ── Cards ─────────────────────────────────────────────────────────── */
/* Its shadow alone: the highlight is for the parts inside it. */
.tdc-card:not(:has(.mv-stage)) {
	margin-top: var(--space-4);
	margin-bottom: var(--space-5);
	padding: var(--space-6) var(--space-5);
	border-radius: var(--nm-radius);
	corner-shape: squircle;
	box-shadow: var(--nm-card);
}
@media (max-width: 991px) {
	.tdc-card:not(:has(.mv-stage)) { width: calc(100% - 2 * var(--space-4)); }
}
/* Turned sideways, a phone's page fills the screen, clear of the notch (UV,
   9 Nov). The match page has its own landscape. */
@media (max-width: 991px) and (orientation: landscape) {
	.tdc-card:not(:has(.mv-stage)) {
		max-width: none;
		width: calc(100% - 2 * max(var(--space-4), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)));
	}
}
/* Less inside the page's card on a phone (UV, 9 Nov). */
@media (max-width: 36rem) {
	.tdc-card:not(:has(.mv-stage)) { padding: var(--space-5) var(--space-3); }
}
@media (max-width: 24rem) {
	.tdc-card:not(:has(.mv-stage)) {
		width: calc(100% - 2 * var(--space-2));
		padding-right: var(--space-3);
		padding-left: var(--space-3);
	}
}
@media print {
	.tdc-card:not(:has(.mv-stage)) { box-shadow: none; }
}

/* A long word in a heading must not widen the page on a narrow screen. */
.tdc-card h1,
.tdc-card h2 { overflow-wrap: anywhere; }

/* A block of related things inside a card is sunk into it. */
.panel,
.empty,
.code-item,
.selected-player {
	border: 0;
	border-radius: var(--nm-field-radius);
	background: transparent;
	box-shadow: var(--nm-sunken);
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}
.panel { padding: var(--space-5); margin-bottom: var(--space-5); }
.empty { color: var(--text-muted); font-size: 1rem; }

/* Something you press to open is set into the card (UV, 4 Dec: "let all clickable
   elements have inner shadow rather than outer"; it stood up until then). */
.tile-link,
.match-card {
	border: 0;
	border-radius: var(--nm-field-radius);
	background: transparent;
	box-shadow: var(--nm-sunken);   /* pressable, so inset (UV, 4 Dec: "let all clickable elements have inner shadow rather than outer") */
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}
.tile-link,
.match-card { margin-bottom: var(--space-5); padding: var(--space-4) var(--nm-pad); }
/* A staff tile says its tier in its heading's colour, not a ring round it. */
.tile-link.tile-staff,
.tile-link.tile-admin,
.tile-link.tile-owner { border: 0; box-shadow: var(--nm-sunken); }
.tile-link.tile-staff { color: var(--text-primary); }
.tile-link.tile-admin { color: var(--color-primary); }
.tile-link.tile-owner { color: var(--color-owner); }
.tile-link .sub { color: var(--text-muted); }
.match-card:hover,
.match-card.needs-you { border: 0; box-shadow: var(--nm-sunken); }
.tile-link:active,
.match-card:active { box-shadow: var(--nm-pressed); }   /* a press, deeper (UV, 4 Dec: "Deeper inset while pressed") */
.match-card.needs-you .match-opponent { color: var(--color-primary); }

/* ── Fields ────────────────────────────────────────────────────────── */
.field { margin-bottom: var(--space-5); }
.field label {
	margin-bottom: var(--space-2);
	padding-left: 0;   /* in line with the words, no pill to sit inside (UV, 4 Dec) */
	color: var(--text-primary);
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}
.field .hint,
.field-pair > .hint { margin-top: var(--space-2); padding-left: 0; font-size: 0.85rem; }
.field-pair { margin-bottom: var(--space-5); row-gap: var(--space-5); }
@media (max-width: 24rem) {
	.field-pair { grid-template-columns: minmax(0, 1fr); }
}
/* What sat side by side in narrow columns now takes a row each: the controls are as
   tall and as wide as a field. */
.field-row { display: block; margin-bottom: 0; }
.field-row > .field { margin-bottom: var(--space-5); }
.set-rule { margin: 0 0 var(--space-5); border: 0; }

/* A typed field, a kept native list, a date: its words over one grey line, no
   pill (UV, 4 Dec: "No more pills around drop downs and text. Just a simple grey line underneath each input is fine with a grey drop-down arrow used for drop downs. Numeric inputs will also lose the pill around"). Not in a table, whose cells are too narrow, nor in the
   stage. The line turns the site's colour while it is being typed in. */
:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"], [type="button"], [type="submit"]), select, textarea):where(:not(table *, .mv-stage *)) {
	width: 100%;
	min-height: var(--nm-field);
	padding: var(--space-2) 0;
	border: 0;
	border-bottom: 1px solid var(--text-muted);
	border-radius: 0;
	outline: none;
	background: transparent;
	color: var(--text-primary);
	font-family: inherit;
	font-size: 1rem;   /* 16px stops iPhone zooming in on focus */
	box-shadow: none;
	transition: border-color 0.2s ease;
}
textarea:where(:not(table *, .mv-stage *)) {
	display: block;
	padding-top: var(--space-4);
	padding-bottom: var(--space-4);
	resize: vertical;
}
:is(input, select, textarea):where(:not(table *, .mv-stage *))::placeholder { color: var(--text-muted); }
:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"], [type="button"], [type="submit"]), select, textarea):where(:not(table *, .mv-stage *)):focus {
	border-bottom-color: var(--color-primary);
}
@media (hover: hover) {
	:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"], [type="button"], [type="submit"], :disabled), select:not(:disabled), textarea:not(:disabled)):where(:not(table *, .mv-stage *)):hover {
		border-bottom-color: var(--color-primary);
	}
}
/* A kept native list has an arrow of its own, the dropdown's, grey (UV, 4 Dec). */
select:where(:not(table *, .mv-stage *)) {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 2rem;
	background-image: var(--nm-arrow-muted);
	background-position: right center;
	background-repeat: no-repeat;
	background-size: 1.25rem;
}
/* A native date or time's own picker takes the theme. */
input:is([type="date"], [type="time"], [type="datetime-local"]):where(:not(table *, .mv-stage *)) { color-scheme: dark; }
[data-theme="light"] input:is([type="date"], [type="time"], [type="datetime-local"]) { color-scheme: light; }

/* A control beside its label: the word in line with a field's, the control out to the
   right edge they share, the hint under both. */
.field.field-beside,
.field-row > .field.field-beside {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-rows: none;
	align-items: center;
	justify-items: stretch;
	column-gap: var(--space-3);
	margin-bottom: var(--space-5);
	text-align: left;
}
.field-beside > label,
.field-row > .field.field-beside > label {
	grid-column: 1;
	grid-row: 1;
	align-self: center;
	margin: 0;
	overflow-wrap: anywhere;
}
.field-beside > .tdc-stepper,
.field-beside > .tdc-switch,
.field-beside > .tdc-check,
.field-beside > .tdc-tri,
.field-row > .field.field-beside > :not(label):not(.hint) {
	grid-column: 2;
	grid-row: 1;
	justify-self: end;
	align-self: center;
}
.field-beside > .hint,
.field-row > .field.field-beside > .hint { grid-column: 1 / -1; grid-row: 2; }

/* ── The dropdown ──────────────────────────────────────────────────── */
/* A window over a grey line (tdc-controls.js; the pill gone, UV 4 Dec): the words lie still under the
   card and show only through it. Closed it opens on the selection and arrow, with the
   field's label on the card beside it. Open it reaches the label and the options,
   chosen one glowing, and pushes what is under it down: the options are laid out once,
   out of the page's flow, and an empty spacer grows while the mask moves over them. */
.tdc-drop {
	--nm-drop-time: 0.45s;
	--nm-selection-left: calc(100% + var(--nm-pad));
	position: relative;
	isolation: isolate;
	display: block;
	width: 100%;
}
.tdc-drop::before,
.tdc-drop::after {
	content: "";
	position: absolute;
	inset: 0 0 0 calc(var(--nm-selection-left) - var(--nm-pad));
	z-index: -1;
	border-radius: var(--nm-field-radius);
}
/* No pill: one grey line under the row, the label's and the selection's, and
   under the options once open (UV, 4 Dec: "No more pills around drop downs and text. Just a simple grey line underneath each input is fine with a grey drop-down arrow used for drop downs. Numeric inputs will also lose the pill around") */
.tdc-drop::before {
	left: 0;
	border-bottom: 1px solid var(--text-muted);
	border-radius: 0;
	transition: border-color 0.2s ease;
}
.tdc-drop:has(.tdc-drop-button:focus-visible)::before { border-bottom-color: var(--color-primary); }
.tdc-drop::after {
	box-shadow: var(--glow-primary);
	opacity: 0;
	pointer-events: none;
	transition: left var(--nm-drop-time) ease, opacity 0.2s ease;
}
.tdc-drop.open::before,
.tdc-drop.open::after { left: 0; }
.tdc-drop-button {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--space-3);
	width: 100%;
	min-height: var(--nm-field);
	height: var(--nm-field);
	margin: 0;
	padding: 0;   /* the arrow at the line's end (UV, 4 Dec: no pill) */
	border: 0;
	border-radius: var(--radius-pill);
	outline: none;
	background: transparent;
	color: var(--text-primary);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: normal;
	text-align: right;
	text-transform: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	/* What it cuts off can be neither seen nor pressed. */
	clip-path: inset(0 0 0 calc(var(--nm-selection-left) - var(--nm-pad)) round var(--nm-field-radius) var(--nm-field-radius) 0 0);
	transition: clip-path var(--nm-drop-time) ease;
}
.tdc-drop.open .tdc-drop-button { clip-path: inset(0 0 0 0 round var(--nm-field-radius) var(--nm-field-radius) 0 0); }
.tdc-drop-value {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 75%;
	font-weight: 600;
	line-height: 1.2;
	overflow-wrap: anywhere;
}
/* A drop-down with no label beside it (tdc-controls.js): its words start at the
   line's left, on one line, the arrow at the end (UV, 4 Dec: "left margin on the
   drop down text is big for nothing"; they sat at the right, where a label leaves
   room for them). */
.tdc-drop.is-unlabelled .tdc-drop-button { justify-content: space-between; text-align: left; }
.tdc-drop.is-unlabelled .tdc-drop-value { max-width: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* Open, its options start where its words do, each on one line, the list as wide
   as its longest (the drop-down may be narrower, sized to the one chosen) */
.tdc-drop.is-unlabelled .tdc-drop-clip { left: calc(-1 * var(--nm-pad)); right: auto; width: max-content; min-width: calc(100% + var(--nm-pad)); }
.tdc-drop.is-unlabelled .tdc-drop-list li { white-space: nowrap; overflow-wrap: normal; }
.tdc-drop-button svg {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	fill: none;
	stroke: var(--text-muted);   /* grey (UV, 4 Dec: "a grey drop-down arrow used for drop downs") */
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform var(--nm-drop-time) ease;
}
.tdc-drop.open .tdc-drop-button svg { transform: rotate(180deg); }
.tdc-drop-tray {
	display: block;
	height: 0;
	visibility: hidden;
	transition: height var(--nm-drop-time) ease, visibility var(--nm-drop-time);
}
/* In two steps. .ready: the options are drawn, under the closed mask, and can take the
   focus. .open, two frames later: the mask and the spacer set off. */
.tdc-drop.ready .tdc-drop-tray { visibility: visible; transition: height var(--nm-drop-time) ease; }
.tdc-drop.open .tdc-drop-tray { height: var(--nm-list-height, 0px); }
.tdc-drop-clip {
	position: absolute;
	top: var(--nm-field);
	right: 0;
	left: 0;
	clip-path: inset(calc(-1 * var(--nm-field)) 0 100% calc(var(--nm-selection-left) - var(--nm-pad)) round var(--nm-field-radius));
	transition: clip-path var(--nm-drop-time) ease;
}
.tdc-drop.open .tdc-drop-clip { clip-path: inset(calc(-1 * var(--nm-field)) 0 0 0 round var(--nm-field-radius)); }
/* A new screen width puts it straight in its place; only a new selection eases there. */
.tdc-drop.still::before,
.tdc-drop.still::after,
.tdc-drop.still .tdc-drop-button,
.tdc-drop.still .tdc-drop-clip,
.tdc-drop.still .tdc-drop-tray { transition: none; }
/* A long list scrolls inside the window. */
.tdc-drop-list {
	position: relative;
	max-height: 17.5rem;
	margin: 0;
	padding: 0 var(--space-2) var(--space-2);
	overflow-y: auto;
	list-style: none;
	outline: none;
}
/* The wash under the option the keys or the pointer are on: one layer that slides. */
.tdc-drop-list::before {
	content: "";
	position: absolute;
	top: 0;
	right: var(--space-2);
	left: var(--space-2);
	height: var(--nm-active-height, 0px);
	border-radius: var(--radius-pill);
	background: var(--hover-wash);
	opacity: 0;
	transform: translateY(var(--nm-active-y, 0px));
	transition: transform 0.2s ease, height 0.2s ease, opacity 0.2s ease;
}
.tdc-drop-list.washed::before { opacity: 1; }
.tdc-drop-list li {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 2.75rem;
	padding: var(--space-2) var(--space-4) var(--space-2) calc(var(--nm-pad) - var(--space-2));
	border-radius: var(--radius-pill);
	color: var(--text-muted);   /* grey (UV, 4 Dec: "Show drop down options in grey"); the chosen one stays the site's colour, glowing */
	overflow-wrap: anywhere;
	cursor: pointer;
	transition: color 0.2s ease, text-shadow 0.2s ease;
}
.tdc-drop-list li[aria-selected="true"] {
	color: var(--nm-light-colour);
	font-weight: 600;
	text-shadow: 0 0 0.75rem color-mix(in srgb, var(--nm-light-colour) 80%, transparent);
}
.tdc-drop-list li[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.tdc-drop > select {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 1px;
	min-height: 0;
	height: 1px;
	padding: 0;
	opacity: 0;
	box-shadow: none;
	pointer-events: none;
}
.tdc-drop.is-disabled { opacity: 0.4; pointer-events: none; }
/* Its label lies on the card, level with the selection, on the same line. */
.field:has(> .tdc-drop) { position: relative; }
.field:has(> .tdc-drop) > label {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	width: max(0px, calc(var(--nm-selection-left, 50%) - var(--nm-pad)));
	height: var(--nm-field);
	margin: 0;
	padding: 0 var(--space-2) 0 0;
	overflow: hidden;
	line-height: 1.2;
	pointer-events: none;
}
.field-row > .field:has(> .tdc-drop) { display: block; margin-bottom: var(--space-5); text-align: left; }
/* A label that would not fit beside a long selection goes above the pill, as a typed
   field's does (tdc-controls.js decides). */
.field:has(> .tdc-drop).drop-stacked > label {
	position: static;
	display: block;
	width: auto;
	height: auto;
	margin: 0 0 var(--space-2);
	padding: 0;
	overflow: visible;
}

/* ── The number input ──────────────────────────────────────────────── */
/* Sideways over a grey line (no pill, UV 4 Dec), as tall as a field, with the dropdown's text and arrows. At either
   end its arrow goes and it thins, once the pointer has left it, or the other
   arrow would move from under the finger. */
.tdc-stepper.is-across {
	--sn: 1rem;
	--chevron: 0.8333rem;
	--chevron-stroke: 3.75;
	flex: none;
	height: var(--nm-field);
	padding: 0 var(--space-3);
	border: 0;
	border-bottom: 1px solid var(--text-muted);   /* no pill (UV, 4 Dec: "No more pills around drop downs and text. Just a simple grey line underneath each input is fine with a grey drop-down arrow used for drop downs. Numeric inputs will also lose the pill around") */
	border-radius: 0;
	box-shadow: none;
	transition: none;
}
.tdc-stepper::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: var(--glow-primary);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.tdc-stepper.is-across:hover { box-shadow: none; }
.tdc-stepper.is-across:focus-within { box-shadow: none; border-bottom-color: var(--color-primary); }
.tdc-stepper.is-across > .tdc-chevron,
.tdc-stepper.is-across .tdc-chevron:hover { color: var(--nm-light-colour); }
.tdc-stepper.is-across > .tdc-chevron { align-self: stretch; padding: 0 var(--space-3); }
.tdc-stepper.is-across .tdc-stepper-window > input[type="number"],
.tdc-stepper.is-across .tdc-stepper-ghost { color: var(--text-primary); font-weight: 600; }
.tdc-stepper .tdc-stepper-window > input[type="number"] {
	min-height: 0;
	padding: 0;
	outline: none;
	box-shadow: none;
}
.tdc-stepper.is-across:hover > .tdc-chevron[hidden] { display: block !important; visibility: hidden; }
.tdc-stepper.is-across:not(:hover) > .tdc-chevron[hidden] + .tdc-stepper-window { margin-left: var(--space-2); }
.tdc-stepper.is-across:not(:hover) > .tdc-stepper-window:has(+ .tdc-chevron[hidden]) { margin-right: var(--space-2); }
/* The window hugs the number, or a 1 sits further from its arrows than a 12. A browser
   without this keeps the width of the longest number. */
@supports (field-sizing: content) {
	.tdc-stepper.is-across .tdc-stepper-window { width: auto; }
	.tdc-stepper.is-across .tdc-stepper-window > input[type="number"] { width: auto; min-width: 1ch; field-sizing: content; }
}
.time-pair { flex-wrap: wrap; justify-content: flex-end; }
.stepper-row { padding: var(--space-3); }

/* ── Toggles ───────────────────────────────────────────────────────── */
/* A solid knob in a sunken track as tall as the cards' title capitals, which
   holds exactly two knobs (UV, 4 Dec: "The same should apply to other elements like
   the toggle pill size"; "The toggle pill should be the same height as the heading
   text on the cards"; --card-title-caps), the knob filling its height (UV, 4 Dec:
   "remove the padding around the knob so it fills the pill"; --knob-gap 0, from
   2px). It was a field's height. Its label still
   toggles it. On, the knob stays as it is and the pill fills with colour, drawn
   across behind the knob as it slides (UV, 4 Dec: "Do not change the color of the
   toggle knob when toggled. instead, change the colour inside the pill (drag
   across)"; it glowed from its edge inward). Its shadow falls in the track alone,
   being level with the card. --p runs from 0 off to 1 on, set by the script. */
.tdc-switch {
	--knob-gap: 0px;
	--switch-height: var(--card-title-caps);
	--nm-knob: calc(var(--switch-height) - 2 * var(--knob-gap));
	--switch-width: calc(2 * var(--nm-knob) + 2 * var(--knob-gap));
	overflow: hidden;
	border-radius: var(--radius-pill);
	/* A grey line round the pill, as a field's (UV, 4 Dec: "Add a grey outline to the
	   toggle pill but leave the knob alone"): a ring just outside it, so the knob
	   inside keeps its size and nothing is drawn over it */
	box-shadow: 0 0 0 1px var(--text-muted);
}
.tdc-switch-track,
.tdc-tri-track {
	border: 0;
	background: transparent;
	box-shadow: var(--nm-sunken-tiny);   /* tiny, as the switch is (4 Dec) */
	transition: none;
}
/* The colour: a layer of the track's background, so the track's set-in shadow
   still falls over it. It ends under the knob's near half, at its centre when on,
   never beyond, so no colour shows round the knob's far edge (UV, 4 Dec: "there
   should be no green bleeding through around the right side of the knob"). */
.tdc-switch-track {
	background: linear-gradient(var(--switch-fill), var(--switch-fill)) left center / calc(var(--p) * (var(--switch-width) - var(--switch-height) / 2)) 100% no-repeat;
}
.tdc-switch:hover .tdc-switch-track { box-shadow: var(--nm-sunken-tiny); }
.tdc-tri:hover .tdc-tri-track { box-shadow: var(--nm-sunken-tiny); }
.tdc-switch:has(> .tdc-check-native:focus-visible) .tdc-switch-track { outline: none; }
.tdc-switch:has(> .tdc-check-native:focus-visible) { outline: 2px solid var(--nm-light-colour); outline-offset: 2px; }
.tdc-switch-knob,
.tdc-tri-knob {
	top: var(--knob-gap);
	left: var(--knob-gap);
	width: var(--nm-knob);
	height: var(--nm-knob);
	border-radius: var(--radius-round);
	background: var(--switch-knob);   /* solid, the background's colour (UV, 4 Dec); it was see-through */
	/* The pill's grey line round the knob too (UV, 4 Dec: "add a grey outline to the
	   knob as well"): a ring just outside it, cut off where the knob meets the
	   pill's edge, so the pill's own line carries on there and it is one line */
	box-shadow: 0 0 0 1px var(--text-muted), var(--nm-raised-tiny);
}
/* A plain toggle has no tick: the colour in the pill says it is on. One with icons
   of its own (the profile menu's) shows them. */
.tdc-switch:not(.has-icons) .tdc-switch-knob .tdc-ring { opacity: 0; }
.tdc-switch-knob .tdc-ring { padding: 15%; box-sizing: border-box; }
/* The three-way switch: three knobs long, as tall as the switch (UV, 4 Dec). At
   either end the pill fills with colour from its middle stop to the knob's centre,
   drawn across as the knob slides, as the switch's is, and never past it, so none
   shows round the knob's far edge; the knob stays as it is (UV, 4 Dec). The
   middle stop's centre and the knob's, by stop (--tri-before, --tri-k;
   status.css), one knob apart; at the middle they meet and there is none. */
.tdc-tri {
	--knob-gap: 0px;
	--tri-height: var(--card-title-caps);
	--nm-knob: calc(var(--tri-height) - 2 * var(--knob-gap));
	--tri-width: calc(3 * var(--nm-knob) + 2 * var(--knob-gap));
	overflow: hidden;
	border-radius: var(--radius-pill);
	box-shadow: 0 0 0 1px var(--text-muted);   /* the switch's grey line (UV, 4 Dec) */
}
.tdc-tri-track {
	--tri-step: calc((var(--tri-width) - var(--tri-height)) / 2);
	--tri-mid: calc(var(--tri-height) / 2 + var(--tri-before) * var(--tri-step));
	--tri-knob: calc(var(--tri-height) / 2 + var(--tri-k) * var(--tri-step));
	--tri-from: min(var(--tri-mid), var(--tri-knob));
	--tri-to: max(var(--tri-mid), var(--tri-knob));
	background: linear-gradient(var(--switch-fill), var(--switch-fill)) var(--tri-from) center / calc(var(--tri-to) - var(--tri-from)) 100% no-repeat;
}
/* The L and W icons fill the knob (UV, 17 Nov; 15% in from its edge before),
   their lines thinned to match so they are no bolder than before (5 × 0.7). */
.tdc-tri-knob .tdc-ring { padding: 0; box-sizing: border-box; }
.tdc-tri-knob .tdc-ring svg { stroke-width: 3.5; }
.tdc-tri[data-tone="warning"] { --switch-fill: var(--color-warning); }

/* ── No rings round icons (UV, 7 Nov) ──────────────────────────────── */
/* The icon stands alone. The stage keeps its own. */
.tdc-ring:not(.mv-stage .tdc-ring) .ring { display: none; }
/* A tick against a person or a thing sits in a small sunken well, as tall as the
   switch (UV, 4 Dec; it was --ring-size, 2.25rem). */
.tdc-check,
table .tdc-check { --rs: var(--card-title-caps); }
.tdc-check {
	box-shadow: var(--nm-sunken-tiny);
	transition: none;
}
.tdc-check:hover { box-shadow: var(--nm-sunken-tiny); }
.tdc-check .tdc-ring { padding: 18%; box-sizing: border-box; }

/* ── Buttons ───────────────────────────────────────────────────────── */
/* Raised, as tall as a field, in the one text size. Only the main action is filled;
   the others are see-through, danger quiet in its words alone. */
.btn,
.btn-link,
.tdc-card button:where(:not(.mv-stage *, .tdc-chevron, .tdc-drop-button, .tdc-switch *, .tdc-check *, .tdc-tri *, .tdc-slide *)) {
	min-height: var(--nm-field);
	margin-bottom: var(--space-5);
	padding: var(--space-2) var(--space-5);
	border: 0;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--text-primary);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: var(--nm-sunken);   /* pressable, so inset (UV, 4 Dec: "let all clickable elements have inner shadow rather than outer") */
}
.btn:active,
.btn-link:active,
.tdc-card button:where(:not(.mv-stage *, .tdc-chevron, .tdc-drop-button, .tdc-switch *, .tdc-check *, .tdc-tri *, .tdc-slide *)):active { box-shadow: var(--nm-pressed); }   /* a press, deeper (UV, 4 Dec: "Deeper inset while pressed") */
/* A control's own parts are not buttons. forms.css's .tdc-card button would size them. */
.tdc-card button.tdc-chevron,
.tdc-card button.tdc-drop-button { margin: 0; background: none; box-shadow: none; }
.tdc-card button.tdc-drop-button { width: 100%; font-size: 1rem; font-weight: 400; letter-spacing: normal; text-transform: none; }
.tdc-card .tdc-stepper.is-across > button.tdc-chevron { width: auto; padding: 0 var(--space-3); letter-spacing: normal; }
.btn-primary,
.tdc-card button.btn-primary { background: var(--nm-light-colour); color: var(--color-on-primary); }
.btn-secondary,
.btn-danger { border: 0 !important; background: transparent; }
.btn-secondary { color: var(--text-primary); }
.btn-danger,
.tdc-card button.btn-danger { color: var(--color-error); }
.btn-google,
.tdc-card button.btn-google { background: var(--google-blue); color: var(--google-on-blue); }
.btn-sm,
.tdc-card button.btn-sm {
	min-height: 2.25rem;
	margin-bottom: 0;
	padding: 0.25rem var(--space-4);
	font-size: 0.85rem;
	letter-spacing: normal;
	box-shadow: var(--nm-sunken-small);   /* pressable, so inset (UV, 4 Dec: "let all clickable elements have inner shadow rather than outer") */
}
.btn-sm:active,
.tdc-card button.btn-sm:active { box-shadow: var(--nm-pressed-small); }
.btn-link {
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}
.btn-row { gap: var(--space-3); margin-bottom: var(--space-5); }
/* A quiet link, a search result and a picked player are not buttons, though they are
   <button>s: no shadow, no size of their own. */
.tdc-card button.link,
.link-row button.link,
.chosen .link,
.player-pick .pick-link,
.tdc-card button.league-nav-item,
.venue-pick .venue-pill-remove {
	min-height: 0;
	box-shadow: none;
}
.tdc-card button.result,
.player-pick .pick-result {
	min-height: var(--nm-field);
	margin: 0 0 var(--space-3);
	padding: var(--space-2) var(--nm-pad);
	border: 0;
	border-radius: var(--nm-field-radius);
	background: transparent;
	color: var(--text-primary);
	font-size: 1rem;
	font-weight: 400;
	text-align: left;
	box-shadow: var(--nm-sunken-small);   /* pressable, so inset (UV, 4 Dec: "let all clickable elements have inner shadow rather than outer") */
}
.tdc-card button.result:active,
.player-pick .pick-result:active { box-shadow: var(--nm-pressed-small); }
.venue-pill {
	border: 0;
	background: transparent;
	font-size: 1rem;
	box-shadow: var(--nm-sunken-small);
}
/* A picture is a plain circle, no line round it. */
.chosen-avatar { border: 0; box-shadow: var(--shadow-pic); }
.chosen { border: 0; }

/* ── Status messages ───────────────────────────────────────────────── */
/* TDC.status's own classes, in a sunken slot that grows for a longer message. */
.status:not(:empty) {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--nm-field);
	padding: var(--space-2) var(--nm-pad);
	border-radius: var(--nm-field-radius);
	font-size: 1rem;
	text-align: center;
	overflow-wrap: anywhere;
	box-shadow: var(--nm-sunken);
}
.status:empty { display: none; }

/* ── Badges ────────────────────────────────────────────────────────── */
/* A small sunken pill, saying its state in its words' colour. */
.badge,
.badge.verified,
.badge.needs-you,
.badge.disputed,
.badge.warn,
.badge.pending,
.badge.live,
.badge.paid {
	border: 0;
	font-size: 0.85rem;
	box-shadow: var(--nm-sunken-small);
}

/* ── Tabs ──────────────────────────────────────────────────────────── */
/* A sunken pill as tall as a field. The chosen tab is a thumb like the toggle's knob,
   which slides to it (tdc-controls.js), its shadow in the pill alone. All one weight, so
   that choosing one moves no words. They scroll inside the pill when they don't fit. */
.league-nav {
	width: 100%;
	height: var(--nm-field);
	margin: 0 0 var(--space-5);
	padding: 0;
	border: 0;
	box-shadow: var(--nm-sunken);
}
/* The tabs only whoever runs it has (UV, 10 Nov): a second pill, just under the first. */
.league-nav:has(+ .league-nav-admin:not([hidden])) { margin-bottom: var(--space-2); }
.league-nav-track { position: relative; flex: 1; gap: 0; padding: var(--space-1); }
.league-nav-item,
.tdc-card button.league-nav-item {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 0 auto;
	width: auto;
	margin: 0;
	padding: 0 var(--space-3);
	border: 0;
	background: none;
	color: var(--text-primary);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.league-nav-item[aria-current="page"],
.tdc-card button.league-nav-item[aria-current="page"] { background: none; color: var(--text-primary); }
.league-nav-item:focus-visible,
button.league-nav-item:focus-visible { outline: 2px solid var(--nm-light-colour); outline-offset: -2px; }
@media (hover: none) {
	a.league-nav-item:hover,
	button.league-nav-item:not([aria-current]):hover { background: none; }
}
.tdc-tab-thumb {
	position: absolute;
	top: var(--space-1);
	bottom: var(--space-1);
	left: 0;
	width: var(--nm-tab-width, 0px);
	border-radius: var(--radius-pill);
	box-shadow: var(--nm-raised-small);
	transform: translateX(var(--nm-tab-x, 0px));
	transition: transform 0.25s ease, width 0.25s ease;
}
.tdc-tab-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 16px var(--nm-knob-glow);
}
.still > .tdc-tab-thumb { transition: none; }
.cp-views,
.install-seg { position: relative; }
.install-seg > .tdc-tab-thumb { top: 0; bottom: 0; }

/* ── Collapsible groups ────────────────────────────────────────────── */
/* Just the heading with the arrow right after its words (UV, 10 Nov: no pill).
   tdc-controls.js does the opening. */
.set-group {
	position: relative;
	margin-bottom: var(--space-5);
	padding: 0;
	border: 0;
}
.set-group > summary {
	display: flex;
	align-items: center;
	width: fit-content;
	max-width: 100%;
	min-height: var(--nm-field);
	margin: 0;
	padding: var(--space-2) 1.75rem var(--space-2) 0;
	color: var(--text-primary);
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}
.set-group > summary:focus-visible { outline: 2px solid var(--nm-light-colour); outline-offset: 2px; border-radius: var(--radius-pill); }
/* The dropdown's arrow, where the + and - were. */
.set-group > summary::after,
.set-group[open] > summary::after {
	content: "";
	right: 0;
	width: 1.25rem;
	height: 1.25rem;
	background: var(--nm-arrow) center / contain no-repeat;
	transition: transform 0.35s ease, opacity var(--dots-dim) ease;
}
.set-group[open]:not(.is-closing) > summary::after { transform: translateY(-50%) rotate(180deg); }
.set-group > summary > .group-dots { right: -0.2rem; }
.set-group > .field > label,
.set-group > .field > .hint,
.set-group > .field-row > .field > label,
.set-group > .field-row > .field > .hint { padding-left: 0; }
/* A filter: its label and selection together in one small pill, the label grey
   (UV, 9 Nov). These are not hero elements. The <label> stays for screen
   readers; tdc-controls.js says it inside the button. */
.field.drop-joined {
	--nm-field: 2.25rem;
	--nm-field-radius: 1.125rem;
	--nm-pad: var(--space-3);
	width: fit-content;
	max-width: 100%;
	margin-bottom: var(--space-2);
}
.field-row > .field.drop-joined { margin-bottom: var(--space-2); }
.field.drop-joined > .tdc-drop::before,
.field.drop-joined > .tdc-drop::after { left: 0; }
.field.drop-joined > .tdc-drop::before { box-shadow: none; }
.field.drop-joined > .tdc-drop:not(.open) > .tdc-drop-button { clip-path: inset(0 0 0 0 round var(--nm-field-radius)); }
.field.drop-joined > label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
}
.field.drop-joined .tdc-drop-button { justify-content: flex-start; gap: var(--space-1); padding: 0 var(--space-2) 0 var(--space-3); font-size: 0.8rem; }
.field.drop-joined .tdc-drop-label { flex: none; color: var(--text-muted); }
.field.drop-joined .tdc-drop-value { max-width: none; }
.field.drop-joined .tdc-drop-button svg { width: 1rem; height: 1rem; margin-left: auto; }
.field.drop-joined .tdc-drop-list li { min-height: 2.25rem; font-size: 0.85rem; }
.set-group > :not(summary):last-child { margin-bottom: var(--space-5); }
.set-group > .field-row:last-child > .field:last-child { margin-bottom: 0; }

/* ── Tables and lists ──────────────────────────────────────────────── */
/* One sunken panel holding the rows, which lie flat in it with a hairline between them:
   a shadow on every row would be repainted at every move of the light. */
.table-scroll {
	position: relative;   /* or a control's hidden parts escape it and widen the page */
	padding: var(--space-3) var(--space-4);
	border-radius: var(--nm-field-radius);
	box-shadow: var(--nm-sunken);
}
.tdc-table { font-size: 1rem; }
.tdc-table th,
.row-table-label,
.row-table-head {
	color: var(--text-muted);
	font-size: 0.85rem;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}
.tdc-table .sub,
.list-row-main .sub,
.row-table-meta,
.row-table-stat,
.row-table-stat .sub { font-size: 0.85rem; }
.row-table-row h3 { font-size: 1rem; }
.row-table {
	padding: var(--space-3) var(--space-4);
	border-radius: var(--nm-field-radius);
	box-shadow: var(--nm-sunken);
}
.row-table-row { margin: 0; transition: background-color 0.2s ease; }
.row-table-row:hover,
.row-table-row:focus-visible {
	background: var(--hover-wash);
	box-shadow: none;
}
.row-table-row:hover::after,
.row-table-row:focus-visible::after { display: block; }
.row-table-head { border: 0; }
.row-table-pic { box-shadow: var(--shadow-pic); }
@media (max-width: 24rem) {
	.row-table { padding-right: var(--space-2); padding-left: var(--space-2); }
	.row-table-row,
	.row-table.has-pic .row-table-row { padding-right: var(--space-2); }
	.row-table-badges { align-items: flex-start; grid-column: 1 / -1; }
	.row-table-row { grid-template-columns: minmax(0, 1fr); }
	.row-table.has-pic .row-table-row { grid-template-columns: auto minmax(0, 1fr); }
	.row-table-badges .badge { white-space: normal; }
	.row-table-stats { grid-template-columns: repeat(auto-fit, minmax(4rem, 1fr)); }
}

/* ── Pictures set into the page (UV, 9 Nov; the whole site, the stage too) ──
   A picture somebody chose lies in a sunken hole with the shadow across it; as
   /sandbox/neumorph/'s logo well, but filling it. A box-shadow on the box would
   be painted under its <img>, so it goes on a layer over it. Initials and
   default icons stay as they were. A new picture box joins these lists. */
:is(.nav-avatar-wrap, .nav-account-pic, .nav-account-person-pic, .person-pic, .lj-pic-inner, .pp-pic-inner, .pp-zoom-inner, .pp-person-pic, .pp-row-pic, .pp-vs-pic, .pp-c-pic, .mv-pic, .hc-face, .venue-mark, .shop-pic, .mg-face):has(> img:not([hidden])) {
	--shadow-pic: 0 0 transparent;
	--match-mark-shadow: 0 0 transparent;
	position: relative;
}
:is(.nav-avatar-wrap, .nav-account-pic, .nav-account-person-pic, .person-pic, .lj-pic-inner, .pp-pic-inner, .pp-zoom-inner, .pp-person-pic, .pp-row-pic, .pp-vs-pic, .pp-c-pic, .mv-pic, .hc-face, .venue-mark, .shop-pic, .mg-face):has(> img:not([hidden]))::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: var(--pic-inset, var(--nm-pic-sunken-small));
	opacity: var(--pic-shade-strength);
	pointer-events: none;
}
/* The bigger ones take more depth. Every picture's shadow is lighter and moves half
   as far as the shadows round it (UV, 24 Nov): --nm-pic-sunken(-small), at
   --pic-shade-strength (variables.css). */
:is(.nav-account-pic, .lj-pic-inner, .pp-pic-inner, .pp-zoom-inner, .pp-vs-pic, .mv-pic, .shop-hero, .shop-cat-pic) { --pic-inset: var(--nm-pic-sunken); }
/* The box round a picture casts nothing once the picture is sunk in it. */
:is(.pp-pic, .pp-zoom-pic, .lj-pic):has(img) { --shadow-pic: 0 0 transparent; }
/* A venue's picture before its name (UV, 24 Nov; TDC.venueMark): a circle the
   height of the text, or the map pin in the text's colour when there is none. */
.venue-mark {
	display: inline-grid;
	place-items: center;
	width: 1.2em;
	height: 1.2em;
	margin-right: 0.3em;
	vertical-align: -0.25em;
	border-radius: var(--radius-round);
	overflow: hidden;
}
.venue-mark > img { width: 100%; height: 100%; object-fit: cover; }
.venue-mark.is-pin > svg { width: 100%; height: 100%; }
/* These two draw the picture as their own background, under an inset shadow. */
.avatar-large:not(.placeholder) { box-shadow: var(--nm-pic-sunken); }
.chosen-avatar:where([style*="background-image"]) { box-shadow: var(--nm-pic-sunken-small); }

/* A league's shield and a team's hexagon (TDC.leaguePic, TDC.teamPic). The box
   they stand in gives up its circle. The shadow is the page round the shape,
   blurred once and only moved with the light, on a layer of its own: nothing
   is blurred again at each move, so a page of them stays cheap. */
:is(.team-pic, .jumbo-pic, .league-tile-pic, .lc-pic, .lj-pic, .lj-pic-inner, .hc-pic, .hc-face):has(.tdc-shaped) {
	--shadow-pic: 0 0 transparent;
	border-radius: 0;
	overflow: visible;
	background: none;
}
/* The shade moves half as far as before and is drawn lighter (UV, 24 Nov: a
   picture's shadow less severe and moving less than the page's): 0.25 and 0.5,
   were 0.5 and 1, at --pic-shade-strength. */
.tdc-shaped {
	--shade-move: 0.25;
	--shade-blur: calc(var(--nm-blur) / 8);
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: var(--color-primary);
	overflow: hidden;
}
:is(.jumbo-pic, .league-tile-pic, .lc-pic, .lj-pic-inner, .hc-pic) .tdc-shaped {
	--shade-move: 0.5;
	--shade-blur: calc(var(--nm-blur) / 4);
}
/* As tall as its box, and as wide as a shield is. */
.tdc-shaped-shield { width: auto; aspect-ratio: 0.88; margin-inline: auto; }
.tdc-shaped > img { width: 100%; height: 100%; object-fit: cover; }
.tdc-shaped > svg { width: 58%; height: 58%; }
.tdc-shaped > .tdc-shade {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	filter: blur(var(--shade-blur));
	opacity: var(--pic-shade-strength);
	will-change: transform;
}
.tdc-shade-dark {
	fill: var(--nm-dark);
	transform: translate(calc(var(--nm-x) * var(--shade-move)), calc(var(--nm-y) * var(--shade-move)));
}
.tdc-shade-lit {
	fill: var(--nm-lit);
	transform: translate(calc(var(--nm-x) * var(--shade-move) * -1), calc(var(--nm-y) * var(--shade-move) * -1));
}

/* A team's name is blue wherever it stands on its own (UV, 9 Nov). A new place
   joins this list, or takes .team-name. The team card left it on 11 Nov (UV):
   its names take a fixture's state colours, or cream (league.css). */
html :is(.team-name, .fx-name, .team-box-name, .team-sep-name, .pp-team-name, .sd-team-row .sd-name) { color: var(--color-team); }

/* ── Anything that fades ───────────────────────────────────────────── */
[data-motion="reduce"] :is(.tdc-drop::before, .tdc-drop::after),
[data-motion="reduce"] :is(.tdc-drop-button, .tdc-drop-button svg, .tdc-drop-tray, .tdc-drop-clip, .tdc-drop-list li, .tdc-tab-thumb) { transition: none; }
[data-motion="reduce"] .tdc-drop::before,
[data-motion="reduce"] .tdc-drop::after,
[data-motion="reduce"] .tdc-drop-list::before,
[data-motion="reduce"] .tdc-stepper::after,
[data-motion="reduce"] .set-group > summary::after { transition: none; }
@media (prefers-reduced-motion: reduce) {
	:root:not([data-motion="full"]) .tdc-drop::before,
	:root:not([data-motion="full"]) .tdc-drop::after,
	:root:not([data-motion="full"]) .tdc-drop-button,
	:root:not([data-motion="full"]) .tdc-drop-button svg,
	:root:not([data-motion="full"]) .tdc-drop-tray,
	:root:not([data-motion="full"]) .tdc-drop-clip,
	:root:not([data-motion="full"]) .tdc-drop-list::before,
	:root:not([data-motion="full"]) .tdc-drop-list li,
	:root:not([data-motion="full"]) .tdc-tab-thumb,
	:root:not([data-motion="full"]) .tdc-stepper::after,
	:root:not([data-motion="full"]) .set-group > summary::after { transition: none; }
}

/* ── Nothing leaves its card, and no card leaves its container (UV, 10 Nov): what
 * does not fit scrolls inside the card. Everywhere; a new kind of card joins this list. */
.tdc-card,
.tdc-card > *,
.tdc-card :where(.jumbo, .fx-card, .lr-doc, .team-box, .lj-rule-box, .lj-notes, .ls-stage, .cal-month, .lu-compare, .lu-team, .qv-pill) {
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%;
}
.tdc-card :where(.jumbo, .fx-card, .lr-doc, .team-box, .lj-rule-box, .lj-notes, .ls-stage, .cal-month, .lu-compare, .lu-team, .qv-pill) {
	overflow: auto hidden;
	scrollbar-width: none;
}

/* ── A team name on one line, running sideways when too long (UV, 16 Nov) ──
 * TDC.runName (tdc.js): never broken inside a word; one too long for its room
 * runs sideways and back, fading at both edges, as on the Season tab's cards and
 * the players' fixtures. Short enough, it keeps its place's own alignment. With
 * less motion it stands still, cut at "…". The underline (your own team) is
 * carried into the running words, which an inline-block would otherwise drop. */
.tdc-run {
	display: block;
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	white-space: nowrap;
	overflow-wrap: normal;
	text-overflow: clip;
	/* Room inside the clip for the underline below and Safari's higher letters
	   above, taken back outside so nothing moves */
	padding-block: 0.15em 0.35em;
	margin-block: -0.15em -0.35em;
}
.tdc-run > .lj-run {
	display: inline-block;
	text-decoration: inherit;
	text-decoration-thickness: inherit;
	text-underline-offset: inherit;
}
.tdc-run.is-long {
	text-align: left;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 0.75rem, #000 calc(100% - 0.75rem), transparent);
	mask-image: linear-gradient(to right, transparent, #000 0.75rem, #000 calc(100% - 0.75rem), transparent);
}
.tdc-run.is-long > .lj-run { animation: tdc-run var(--run-time) ease-in-out infinite alternate; }
@keyframes tdc-run {
	0%, 15% { transform: translateX(0); }
	85%, 100% { transform: translateX(var(--run)); }
}
/* Wrapping between words (TDC.runWords; UV, 16 Nov, the scorecard's banner):
 * each word a run of its own, side by side, the lines breaking only at the
 * spaces; the underline carried into each word. */
.tdc-wrap { display: block; min-width: 0; max-width: 100%; overflow-wrap: normal; word-break: normal; }
.tdc-wrap > .tdc-run {
	display: inline-block;
	vertical-align: top;
	/* Keep most of the underline's room below each line, so a wrapped line's
	   underline clears the next line's letters (UV, 16 Nov) */
	margin-bottom: -0.1em;
	text-decoration: inherit;
	text-decoration-thickness: inherit;
	text-underline-offset: inherit;
}
[data-motion="reduce"] .tdc-run > .lj-run { display: inline; animation: none; }
[data-motion="reduce"] .tdc-run.is-long { text-overflow: ellipsis; -webkit-mask-image: none; mask-image: none; }
@media (prefers-reduced-motion: reduce) {
	:root:not([data-motion="full"]) .tdc-run > .lj-run { display: inline; animation: none; }
	:root:not([data-motion="full"]) .tdc-run.is-long { text-overflow: ellipsis; -webkit-mask-image: none; mask-image: none; }
}
