@layer pages {
	/* create a new list: the method switcher from the add-game flow; the
	   standard type is a name joined with a create button, the game of
	   the year type keeps its sheet with the award year. It sits above
	   the lists so it is always in reach */

	.list-create {
		margin-block-end: clamp(2.5rem, 5vw, 4rem);
	}

	.list-create {
		#list-type-standard:checked
			~ .method-switcher
			label[for="list-type-standard"],
		#list-type-goty:checked ~ .method-switcher label[for="list-type-goty"] {
			background: var(--color-surface);
			box-shadow: var(--shadow-raised);
			color: var(--color-brand);
		}

		#list-type-standard:focus-visible
			~ .method-switcher
			label[for="list-type-standard"],
		#list-type-goty:focus-visible ~ .method-switcher label[for="list-type-goty"] {
			outline: 3px solid var(--color-focus);
		}
	}

	/* one shared sheet per type; only the visibility differs */
	.list-create-form {
		display: block;
		padding: var(--panel-pad);
		margin-block-start: 1rem;
		overflow: clip;

		.form-grid {
			align-items: end;
		}
	}

	.list-create-goty {
		/* the same gold-to-white wash as .list-card.list-goty, but quieter
		   and shorter so it reads as a tint, not a second paper */
		background: linear-gradient(
			to bottom,
			color-mix(in oklch, var(--color-highlight) 30%, var(--color-surface)),
			var(--color-surface) 65%
		);

		.list-create-guidance {
			margin-block-end: 1rem;
		}
	}

	.list-create-form.list-create-goty {
		display: none;
	}

	/* the chosen type reveals its form; the radios and both forms are
	   siblings inside the section, so the switch is pure CSS */
	#list-type-goty:checked ~ .list-create-standard {
		display: none;
	}

	#list-type-goty:checked ~ .list-create-goty {
		display: block;
	}

	/* the list grid: cards in the show-all spirit */

	.lists-empty {
		color: var(--color-text-muted);
		font-family: var(--font-sans);
		font-size: 0.8rem;
		font-weight: 650;
	}

	.list-grid {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
		/* masonry breathes: a taller row gap than the column gap */
		gap: 2rem 1.1rem;
		padding: 0;
		margin: 0;
		list-style: none;
	}

	/* Keep ordered lists in rows. Masonry and its column fallback
	   can place the second card below the first. */
	@supports (grid-template-rows: masonry) {
		.list-grid:not(.list-grid-ordered) {
			grid-template-rows: masonry;
		}
	}

	@supports not (grid-template-rows: masonry) {
		.list-grid:not(.list-grid-ordered) {
			display: block;
			columns: 4 13rem;
			column-gap: 1.1rem;

			> li {
				break-inside: avoid;
				margin-block-end: 2rem;
			}
		}
	}

	.list-card {
		display: flex;
		flex-direction: column;
		gap: 0.8rem;
		min-block-size: 10.5rem;
		padding: 1.1rem;
		/* no red margin line: a card is a slip of paper, not a sheet
		   of ruled notes; the standard list takes the journal's blue
		   tape instead of the recipe's gold one */
		--tape-color: color-mix(in oklch, var(--color-brand) 13%, transparent);
		background: var(--color-surface);
		color: var(--color-text);
		text-decoration: none;
	}

	.list-card.list-goty {
		/* the game-of-the-year paper stays gold: the year's own tape
		   and a hue that pools at the top and fades down the sheet */
		--tape-color: color-mix(in oklch, var(--color-highlight) 46%, transparent);
		background: linear-gradient(
			to bottom,
			color-mix(in oklch, var(--color-highlight) 28%, var(--color-surface)),
			var(--color-surface)
		);
	}

	.list-card:is(:hover, :focus-visible) {
		box-shadow: 0 0.9rem 2.2rem
			color-mix(in oklch, var(--color-text) 9%, transparent);
		translate: 0 -0.15rem;
	}

	.list-card-name {
		color: var(--color-text);
		font-family: var(--font-sans);
		font-size: 1.02rem;
		font-weight: 800;
		letter-spacing: -0.02em;
		line-height: 1.25;
		text-wrap: balance;
		/* monster names wrap inside the card instead of stretching it */
		overflow-wrap: anywhere;
	}

	.list-card-entries {
		display: grid;
		gap: 0.45rem;
		padding: 0;
		margin: 0;
		list-style: none;
		color: var(--color-text);
		font-family: var(--font-sans);
		font-size: 0.82rem;
		font-weight: 500;
		line-height: 1.35;

		li {
			/* a plain block: the ellipsis needs one block box around the
			   text, which a flex row cannot provide (the text item would
			   never shrink below its content) */
			min-inline-size: 0;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;

			.list-card-rank {
				display: inline-block;
				margin-inline-end: 0.35rem;
			}
		}
	}

	.list-card-rank {
		min-inline-size: 1.4ch;
		color: var(--color-text-muted);
		font-family: var(--font-display);
		font-size: 0.95rem;
		font-variant-numeric: tabular-nums;
		font-weight: 300;
	}

	.list-card-more {
		color: var(--color-text-muted);
		font-family: var(--font-sans);
		font-size: var(--font-size-label);
	}

	.lists-page .list-index-divider {
		/* even room above and below: the cards' tape reaches up into it */
		margin-block: 4.5rem;
	}

	/* one list: settings, entries on one sheet, then the add search */

	.list-show-header {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		align-items: end;

		> .eyebrow {
			grid-column: 1;
			grid-row: 1;
			margin-block-end: 0.85rem;
		}

		h1 {
			grid-column: 1;
			grid-row: 2;
		}

		/* long names take the journal's calmer size; anywhere also breaks
		   the unbreakable stress-test words that balance cannot save */
		h1.long {
			font-size: clamp(2.6rem, 7vw, 4.4rem);
			letter-spacing: -0.045em;
			line-height: 1.05;
			overflow-wrap: anywhere;
		}

		/* very long names step down once more */
		h1.very-long {
			font-size: clamp(2.2rem, 6vw, 3.6rem);
		}
	}

	.list-description {
		margin-block: 1.25rem 0;
		color: var(--color-text-muted);
		font-size: 0.875rem;
	}

	.list-settings {
		padding-block-start: 1rem;
		border-block-start: 1px solid var(--color-rule);

		summary {
			inline-size: max-content;
			margin-block-end: 1rem;
			color: var(--color-text-muted);
			cursor: pointer;
			font-family: var(--font-sans);
			font-size: var(--font-size-label);
			font-weight: 750;

			&:is(:hover, :focus-visible) {
				color: var(--color-accent);
			}
		}

		.list-settings-panel {
			/* surface shell on .surface-panel; this shows the shared
			   method-panel and lays out its form */
			display: block;
			padding: var(--panel-pad);
			margin-block-start: 1rem;
			overflow: clip;
		}

		&.list-settings-standard .list-settings-form {
			grid-template-columns: minmax(0, 1fr) auto;

			.primary-button {
				inline-size: fit-content;
				min-inline-size: 0;
			}
		}

		.list-settings-form {
			grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
			align-items: end;
		}
	}

	.list-settings-divider {
		/* the controller divider rides inside the paper panel: tighter
			   than page-level dividers, glyphs on the panel surface */
		margin-block: 3rem 1.75rem;

		&::after {
			background: var(--color-surface);
		}
	}

	.list-settings-divider + .share-link {
		margin-block-start: 0;
	}

	.list-contents {
		margin-block-start: 3rem;
	}

	.list-sheet {
		/* surface shell on .surface-panel; this carries the layout */
		display: grid;
		gap: 0;
		padding: 0;
		/* the sole source of the gap to the settings fold below; must
		   stay taller than any margin on the wrapping section, or the
		   two collapse and max() silently eats the smaller one */
		margin: 0 0 4rem;
		overflow: clip;
		list-style: none;
	}

	.list-entry {
		position: relative;
		/* the row's own grid: rank, cover, identity, actions. Keeping it
		   on an inner wrapper lets the notes details stay a plain block
		   below it, so an open note always owns a full, fresh row. */
		.list-entry-main {
			display: grid;
			grid-template-columns: 2rem 2.75rem minmax(0, 1fr) auto auto;
			align-items: center;
			gap: 1rem;
		}

		padding-block: 0.7rem;
		padding-inline: 1.1rem;
		border-block-end: 1px solid var(--color-rule);

		/* faint controller symbols surface behind the row on hover,
		   using the status tabs' masked-colour recipe */
		&::before {
			position: absolute;
			inset: 0;
			background: color-mix(in oklch, var(--color-brand) 50%, transparent);
			mask:
				url("../../assets/images/gallery-symbols.svg?v=2") center / 8rem 6rem repeat;
			content: "";
			opacity: 0;
			pointer-events: none;
		}

		&:last-child {
			border-block-end: 0;
		}

		&:is(:hover, :has(.entry-notes-details[open])) {
			background: color-mix(
				in oklch,
				var(--color-brand) 2.5%,
				var(--color-surface)
			);
		}
	}

	@media (hover: hover) and (pointer: fine) {
		.list-entry:is(:hover, :focus-within)::before {
			opacity: 1;
		}
	}

	/* an expanded entry keeps its texture while it stays open, fading
	   out toward the bottom so it yields to the notes slip */
	.list-entry:has(.entry-notes-details[open])::before {
		opacity: 1;
		mask:
			url("../../assets/images/gallery-symbols.svg?v=2") center / 8rem 6rem repeat,
			linear-gradient(to bottom, black, transparent 85%);
		mask-composite: intersect;
	}

	.entry-rank {
		color: var(--color-text-muted);
		font-family: var(--font-display);
		font-size: 1.1rem;
		font-variant-numeric: tabular-nums;
		font-weight: 300;
		text-align: center;
	}

	button.entry-rank {
		padding: 0.3rem 0.15rem;
		border: 0;
		background: transparent;
		cursor: pointer;

		&:is(:hover, :focus-visible) {
			color: var(--color-brand);
		}
	}

	.entry-rank-input {
		inline-size: 2.4rem;
		padding-block: 0.15rem;
		padding-inline: 0.1rem;
		border: 1px solid var(--color-rule);
		border-radius: 0.25rem;
		outline: 0;
		background: var(--color-surface);
		color: var(--color-text);
		font-family: var(--font-display);
		font-size: 1.1rem;
		font-variant-numeric: tabular-nums;
		font-weight: 300;
		text-align: center;
		-moz-appearance: textfield;
		appearance: textfield;

		&::-webkit-inner-spin-button,
		&::-webkit-outer-spin-button {
			appearance: none;
			margin: 0;
		}

		&:focus-visible {
			border-color: var(--color-brand);
			outline: 3px solid var(--color-focus);
		}
	}

	.entry-cover-link {
		display: block;
		inline-size: 2.75rem;
		aspect-ratio: 3 / 4;
		overflow: clip;
		border-radius: 0.25rem;

		&:focus-visible {
			outline: 3px solid var(--color-focus);
			outline-offset: 0.2rem;
		}

		> :is(img, .fallback-artwork) {
			inline-size: 100%;
			block-size: 100%;
			object-fit: cover;
		}
	}

	.entry-cover {
		position: relative;
		box-shadow:
			inset 0 1px rgb(255 255 255 / 24%),
			inset 1px 0 rgb(255 255 255 / 9%),
			inset 0 -1px rgb(10 25 68 / 9%),
			var(--shadow-card);
	}

	.entry-copy {
		display: grid;
		gap: 0.2rem;
		min-inline-size: 0;

		/* long names and developer strings wrap instead of stretching the
		   row; anywhere keeps single monster words from overflowing */
		overflow-wrap: anywhere;

		:is(a, span) {
			/* the editable sheet links the name; the public one renders a
			   plain span — both carry the same identity styling */
			justify-self: start;
			min-inline-size: 0;
			max-inline-size: 100%;
			color: var(--color-text);
			font-family: var(--font-sans);
			font-size: 0.95rem;
			font-weight: 750;
			text-decoration: none;

			/* only the linked name (the editable sheet) shifts on hover;
			   the public sheet's plain span stays calm */
			a&:is(:hover, :focus-visible) {
				/* the app's "go" hover: primary buttons and back links
				   also turn accent */
				color: var(--color-accent);
			}
		}

		small {
			color: var(--color-text-muted);
			font-size: 0.78rem;
		}
	}

	.entry-actions {
		display: flex;
		align-items: center;
		gap: 0.6rem;
		/* pinned to the top row's last column: grid auto-placement would
		   push them below the spanning notes panel instead */
		grid-row: 1;
		grid-column: -1;
	}

	/* a closed accordion contributes nothing to the row grid; otherwise
	   its empty cell shifts every sibling and breaks narrow layouts */
	.entry-notes-details:not([open]) {
		display: none;
	}

	.entry-notes-details[open] {
		/* a plain block under the row's grid: always a full-width row of
		   its own; the margin doubles as the former row gap */
		display: block;
		margin-block-start: 1rem;
	}

	.list-entry-toggle {
		cursor: pointer;
	}

	.entry-notes {
		/* hidden for now: rows already toggle on click; the affordance
		   may return once the row's click/drag split settles */
		display: none;
	}

	.entry-notes-panel {
		/* no top padding: the slip starts flush under the entry; the bottom
		   clearance makes room for the fold pill hanging off the slip */
		display: block;
		padding-block: 0 2rem;
		padding-inline: 0.4rem;
	}

	/* the slip itself rolls in when its fragment lands; the panel stays
	   out of the way so htmx's swap cannot double-animate. The entrance
	   lives in the motion layer so reduced motion skips it. */

	/* the rolled-out notes are a genuine piece of the journal page: a
	   taped, slightly tilted slip with the red margin line and serif body */
	.entry-notes-slip {
		inline-size: auto;
		max-inline-size: 42rem;
		margin-inline: auto;
		/* symmetric inline padding: the old extra 0.6rem on the left (for
		   the margin line) pushed the writing column off-centre, leaving
		   visible air on the right */
		padding-block: 1.1rem 1.5rem;
		padding-inline: 1.5rem;
		border: 1px solid var(--color-rule);
		border-radius: 0.25rem 0.25rem 0 0;
		background:
			linear-gradient(
				90deg,
				transparent 0.9rem,
				var(--paper-margin) 0.9rem 0.95rem,
				transparent 0.95rem
			),
			var(--color-surface);
		box-shadow: var(--shadow-panel);
		/* the tape comes centred from .paper-tape-center; no hem */
	}

	.entry-notes-slip .rendered-notes {
		/* the slip's own rhythm; the shared recipe carries the typography */
		padding-block: 0.5rem;
		font-size: 0.9rem;
		line-height: 1.6;
	}

	/* the slip's own little fold pill, so closing feels as deliberate as
	   opening; it straddles the bottom line like a second strip of tape,
	   and shares the tape's width */
	.entry-notes-contract {
		position: absolute;
		inset-inline: 0;
		bottom: -0.85rem;
		inline-size: 4.5rem;
		margin-inline: auto;
		padding-block: 0.5rem;
		padding-inline: 0.25rem;
		border: 1px solid var(--color-rule);
		border-radius: 999px;
		background: var(--color-surface-muted);
		box-shadow: 0 0.25rem 0.6rem rgb(22 22 22 / 10%);
		color: var(--color-text-muted);
		cursor: pointer;
		font-family: var(--font-sans);
		font-size: var(--font-size-micro);
		font-weight: 800;
		letter-spacing: 0.06em;
		text-align: center;
		text-transform: uppercase;

		&:is(:hover, :focus-visible) {
			border-color: var(--color-brand);
			color: var(--color-brand);
		}
	}

	.entry-notes-empty {
		color: var(--color-text-muted);
		font-family: var(--font-serif);
		font-size: 0.85rem;
		font-style: italic;
	}

	/* the quiet state of a search row after an htmx add */
	.entry-search-added {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		gap: 1rem;
		padding-block: 0.6rem;

		img {
			inline-size: 2.75rem;
			height: auto;
			aspect-ratio: 3 / 4;
			border-radius: 0.25rem;
			object-fit: cover;
		}
	}

	.entry-added-chip {
		padding-block: 0.3rem;
		padding-inline: 0.6rem;
		border-radius: 999px;
		background: color-mix(in oklch, var(--color-brand) 10%, var(--color-surface));
		color: var(--color-brand);
		font-family: var(--font-sans);
		font-size: var(--font-size-micro);
		font-weight: 800;
		letter-spacing: 0.05em;
		text-transform: uppercase;
	}

	.entry-drag {
		display: grid;
		inline-size: 2.5rem;
		block-size: 2.5rem;
		padding: 0;
		border: 1px solid transparent;
		border-radius: 0.25rem;
		background: transparent;
		color: var(--color-text-muted);
		cursor: grab;
		font-size: 1.05rem;
		line-height: 1;
		place-items: center;
		touch-action: none;
		user-select: none;
		-webkit-user-select: none;

		&:is(:hover, :focus-visible) {
			border-color: var(--color-rule);
			color: var(--color-brand);
		}

		&:active {
			cursor: grabbing;
		}
	}

	/* the row Sortable lifts while it travels */
	.list-entry.sortable-chosen {
		background: var(--color-surface);
		box-shadow: var(--shadow-card);
	}

	.list-entry.sortable-ghost {
		opacity: 0.35;
	}

	.entry-remove {
		inline-size: 2rem;
		padding-block: 0.15rem;
		padding-inline: 0;
		border: 1px solid transparent;
		border-radius: 0.25rem;
		background: transparent;
		color: var(--color-text-muted);
		cursor: pointer;
		font-size: 1rem;
		line-height: 1;

		&:is(:hover, :focus-visible) {
			border-color: color-mix(in oklch, var(--color-accent) 30%, transparent);
			color: var(--color-accent);
		}
	}

	.list-contents-heading {
		padding-block-start: 0;
		border-block-start: 0;
	}

	/* add games by searching the catalogue */

	/* accent flair spans (＋, ▼) render smaller than the heading text,
	   with a little breathing room from the words */
	.section-heading:not(.section-heading-display) h2 span {
		color: var(--color-accent);
		font-size: 0.85rem;
		margin-inline-start: 0.25rem;
	}

	.entry-search {
		padding-block-start: 0;
		margin-block-end: 2.5rem;

		.section-heading {
			margin-block-end: 1rem;
		}
	}

	.entry-search-form {
		/* surface shell on .surface-panel; this only pads the search pill */
		padding: var(--panel-pad);
		margin-block-end: 0.75rem;
	}

	.entry-search-hints {
		/* the search tokens sit under the pill on one row and never wrap: a
		   narrow screen swipes the strip sideways, with the scrollbar hidden
		   so it still reads as a hint line */
		display: flex;
		flex-wrap: nowrap;
		align-items: baseline;
		gap: 0.4rem 0.5rem;
		/* room for the chip focus ring, which a scroll container clips */
		padding-block: 0.25rem;
		margin: 0 0.75rem 1rem;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		/* the fade sits on the scroll port, not the content, so it keeps
		   hinting at more while the strip is swiped; it dims nothing when
		   the chips end before the edge */
		mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
		color: var(--color-text-muted);
		font-size: 0.78rem;

		&::-webkit-scrollbar {
			display: none;
		}

		> span,
		button {
			flex: none;
		}

		/* a chip is a button, but looks like the inline code it replaced */
		button {
			padding: 0.1em 0.35em;
			border: 0;
			border-radius: 0.2rem;
			background: color-mix(in oklch, var(--color-rule) 55%, transparent);
			color: var(--color-text);
			font-family: var(--font-mono, monospace);
			font-size: 0.85em;
			cursor: pointer;
		}
	}

	@media (width <= 34rem) {
		.entry-search-hints {
			gap: 0.3rem 0.4rem;
			margin-inline: 0.4rem;
			font-size: 0.75rem;
		}
	}

	.entry-search-field {
		/* the shared icon search pill lives on .search-box; this only
		   raises the pill and swaps its surface for the page tone */
		min-block-size: 3.4rem;
		background: var(--color-page);

		input {
			min-block-size: 3rem;
		}
	}

	.remove-list {
		margin-block-start: 2.5rem;
		font-family: var(--font-sans);

		details {
			padding-block-start: 1rem;
			border-block-start: 1px solid var(--color-rule);
		}

		summary {
			inline-size: max-content;
			color: var(--color-text-muted);
			cursor: pointer;
			font-size: var(--font-size-label);
			font-weight: 750;

			&:is(:hover, :focus-visible) {
				color: var(--color-accent);
			}
		}

		p {
			margin-block-start: 0.8rem;
			color: var(--color-text-muted);
			font-size: 0.72rem;
		}

		button {
			padding: 0.65rem 0.8rem;
			border: 1px solid var(--color-accent);
			border-radius: 0.35rem;
			margin-block-start: 0.8rem;
			background: transparent;
			color: var(--color-accent);
			cursor: pointer;
			font-family: var(--font-sans);
			font-size: var(--font-size-micro);
			font-weight: 800;
			text-transform: uppercase;

			&:is(:hover, :focus-visible) {
				background: var(--color-accent);
				color: white;
			}
		}
	}

	/* one-shot confetti burst from the ✓ chip; the pieces live in app.js
	   and remove themselves on animationend */

	.entry-search-results:empty {
		display: none;
	}

	.entry-search-results {
		/* deliberately bare: no panel, no card — just dense rows on the
		   page tone, so scanning stays fast while adding; the inline
		   padding keeps row edges aligned with the search pill above */
		display: grid;
		padding-inline: 0.75rem;
		margin: 0;
		list-style: none;

		li {
			display: grid;
			grid-template-columns: 2rem minmax(0, 1fr) auto;
			align-items: center;
			gap: 0.65rem;
			padding-block: 0.3rem;
			border-block-end: 1px solid
				color-mix(in oklch, var(--color-rule) 55%, transparent);

			&:last-child {
				border-block-end: 0;
			}

			img {
				inline-size: 2rem;
				aspect-ratio: 3 / 4;
				border-radius: 0.2rem;
				object-fit: cover;
			}
		}

		.entry-add-button {
			min-block-size: 1.9rem;
			padding: 0.35rem 0.85rem;
			font-size: var(--font-size-micro);
		}

		@media (width >= 48rem) {
			column-gap: 2.5rem;
			grid-template-columns: 1fr 1fr;

			/* with two columns the last ROW has two items: drop both
			   borders so neither column ends on a dangling line */
			li:nth-last-child(-n + 2) {
				border-block-end: 0;
			}
		}
	}

	.entry-search-copy {
		display: flex;
		align-items: baseline;
		gap: 0.5rem;
		min-inline-size: 0;

		strong {
			color: var(--color-text);
			font-family: var(--font-sans);
			font-size: 0.88rem;
			font-weight: 700;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}

		small {
			color: var(--color-text-muted);
			font-size: 0.75rem;
			flex-shrink: 0;
		}
	}

	.entry-search-more {
		margin: 0.75rem 0.75rem 0;
		color: var(--color-text-muted);
		font-size: 0.78rem;
		text-align: end;
	}

	@media (width <= 34rem) {
		.list-settings-panel {
			padding-inline: 1.25rem;
		}

		/* name across the line; year and save share the second row, each
		   filling its half of the form */
		.list-settings-form {
			grid-template-columns: repeat(2, minmax(0, 1fr));

			> label:first-of-type {
				grid-column: 1 / -1;
			}

			.primary-button {
				/* undo the page-level fit-content shrink so the save
				   button fills its column on phones */
				inline-size: 100%;
			}
		}
		.list-entry-main {
			/* rank hugs its content, cover shrinks a touch, copy flexes,
			   actions stay at their natural size */
			grid-template-columns: auto 2.25rem minmax(0, 1fr) auto;
			gap: 0.65rem;
		}

		.list-entry {
			/* symmetric inline padding: the old trimmed right edge made
			   the buttons sit nearer the screen edge, but now that notes
			   span the full row they inherit the asymmetry and look
			   off-centre — 0.6rem each side keeps both fine */
			padding-block: 0.55rem;
			padding-inline: 0.6rem;
		}

		/* the rank stays visible on phones: a ranked list without its
		   numbers is just a pile of games; two digits wide so the row
		   never jumps when 9 becomes 10 */
		.entry-rank {
			font-size: 0.9rem;
			min-inline-size: 2ch;
		}

		.entry-cover-link {
			inline-size: 2.25rem;
		}

		.entry-copy {
			gap: 0.1rem;

			/* long names and developers truncate on phones instead of
			   wrapping into tall brittle rows */
			:is(a, span),
			small {
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}

			:is(a, span) {
				font-size: 0.85rem;
			}

			small {
				font-size: 0.68rem;
			}
		}

		/* the reorder and removal buttons sit tight together, pushed
		   against the row's end; the handle stays a tall grab target */
		.entry-remove,
		.entry-drag {
			inline-size: 1.75rem;
		}

		.entry-drag {
			block-size: 2rem;
		}

		.entry-actions {
			gap: 0;
			justify-self: end;
			margin-inline-start: auto;
		}

		/* unfolded accordion: no width meddling — the details spans the
		   row and the slip's width:auto capsule fills/centres itself */
	}
}

@media (width <= 52rem) {
	@layer pages {
		/* 16px keeps iOS Safari from zooming the page into the search field */
		.entry-search-field input,
		.list-create-standard input {
			font-size: 1rem;
		}

		/* long and very long names stay calmer than the phone header's
		   default size */
		.list-show-header h1.long {
			font-size: clamp(2.1rem, 9.5vw, 3.1rem);
		}

		.list-show-header h1.very-long {
			font-size: clamp(1.8rem, 8.5vw, 2.6rem);
		}
	}
}

@layer motion {
	@media (prefers-reduced-motion: no-preference) {
		.list-entry {
			transition: background-color 160ms ease;
		}

		/* the card lifts quietly under the pointer */
		.list-card {
			transition:
				translate 160ms ease,
				box-shadow 160ms ease;
		}

		.list-entry::before {
			transition: opacity 160ms ease;
		}

		/* the notes slip rolls in when its fragment lands */
		.entry-notes-slip {
			animation: entry-notes-roll 220ms ease;
		}

		@keyframes entry-notes-roll {
			from {
				opacity: 0;
				translate: 0 -0.4rem;
			}
		}
	}
}
