*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--golden: #f6b213;
	--golden-half: #c58e0f;
	--orange: #fe7900;
	--grey: #e0e0e0;
	--grey-dark: #b0b0b0;
	--bg: #fbf6f0;
	--bg-sidebar: #fbf6f0;
	--text: #333333;
	--text-muted: #888888;
	--border: #e6052f;
	--highlight: #ffd700;
	--mark: #fff176;
	--mark-fuzzy: #fff8c4;
	--font: system-ui, -apple-system, sans-serif;
	--golden-dim: #f9db98;
	--orange-dim: #fcc490;
	--grey-dim: #f0edea;

	/* Search-confidence ramp, spaced evenly in OKLab rather than in sRGB so the steps look as
	   even as they measure. It reads as three bands, not one gradient:
	     1. a high-confidence match, --golden/--orange alone;
	     2. every other match, tiers 4..1 packed one unit apart;
	     3. no match at all, the *-dim colour.
	   Each ramp is nine units wide and the two band boundaries take three units apiece, so both
	   are about three times a step inside the cluster. That contrast is what makes them read as
	   boundaries rather than as further notches; the four clustered tiers only need to be told
	   apart end to end, not neighbour by neighbour. */
	--golden-t4: #f7c053;
	--golden-t3: #f8c560;
	--golden-t2: #f8c96c;
	--golden-t1: #f8ce78;
	--orange-t4: #ff9448;
	--orange-t3: #ff9c56;
	--orange-t2: #ffa462;
	--orange-t1: #feac6e;
}

html,
body {
	height: 100%;
	overflow: hidden;
}

body {
	display: flex;
	font-family: var(--font);
	font-size: 14px;
	color: var(--text);
	background: var(--bg);
}

#loading {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	z-index: 1000;
}

#loading.hidden {
	display: none;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid var(--grey);
	border-top-color: var(--golden);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

mark {
	background: var(--mark);
	padding: 0 1px;
	border-radius: 1px;
}

mark.mark--fuzzy {
	background: var(--mark-fuzzy);
}

:focus-visible:not(input):not(textarea):not(select) {
	outline: 2px solid var(--golden);
	outline-offset: 2px;
}

.view {
	display: none;
	opacity: 0;
}

.view.active {
	display: flex;
	opacity: 1;
	animation: viewFadeIn 0.5s ease;
}

#view-results.active,
#view-detail.active,
#view-collection.active {
	display: block;
	animation: viewFadeIn 0.5s ease;
}

@keyframes viewFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@media print {
	#sidebar,
	.mobile-grid-toggle,
	.mobile-overlay,
	.detail-back,
	.detail-home,
	.credits-back,
	.credits-home,
	.detail-collections,
	.detail-collections-heading,
	.results-sticky,
	.query-menu,
	.filter-menu,
	.query-tip,
	.skip-link,
	.correction-link {
		display: none !important;
	}

	body {
		display: block;
		overflow: visible;
	}

	#main {
		overflow: visible;
	}

	#view-detail.active,
	#view-results.active,
	#view-collection.active {
		padding: 0;
	}

	.detail-container {
		max-width: 100%;
	}

	.detail-image {
		width: 100%;
		page-break-inside: avoid;
	}
}

.skip-link {
	position: absolute;
	top: -100px;
	left: 8px;
	z-index: 10000;
	padding: 8px 16px;
	background: var(--bg-sidebar);
	border: 2px solid var(--golden);
	border-radius: 4px;
	font-family: var(--font);
	font-size: 14px;
	color: var(--text);
	text-decoration: none;
	transition: top 0.2s;
}

.skip-link:focus {
	top: 8px;
}

/* Shared by every Home button, whichever view builds it. */
.home-icon {
	display: inline-block;
	position: relative;
	top: -1px;
}

.copy-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 28px;
	font-family: var(--font);
	font-size: 12px;
	color: var(--text-muted);
	background: none;
	border: 1px solid var(--grey);
	border-radius: 4px;
	padding: 4px 8px;
	cursor: pointer;
	margin-left: 12px;
	vertical-align: middle;
}

.copy-link-btn:hover {
	background: var(--grey);
	color: var(--text);
}

.copy-link-btn--copied {
	color: var(--golden);
	border-color: var(--golden);
}

.bookmark-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	font-family: var(--font);
	color: var(--text-muted);
	background: none;
	border: 1px solid var(--grey);
	border-radius: 4px;
	cursor: pointer;
	margin-left: 8px;
	vertical-align: middle;
	padding: 0;
}

.bookmark-btn:hover {
	background: var(--grey);
}

.bookmark-btn--active {
	color: var(--orange);
	border-color: var(--orange);
}

.bookmark-btn--active .bookmark-icon path {
	fill: currentColor;
	stroke: none;
}

.bookmark-btn svg {
	width: 14px;
	height: 14px;
}

.mobile-grid-toggle {
	display: none;
	position: fixed;
	bottom: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	background: var(--golden);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	z-index: 100;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	align-items: center;
	justify-content: center;
}

.mobile-overlay {
	position: fixed;
	inset: 0;
	z-index: 98;
	background: rgba(0, 0, 0, 0.3);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 0.3s ease,
		visibility 0.3s;
}

.mobile-overlay.visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/*
 * The corrections link, which the build writes outside the views so that it outlives every
 * navigation. It fades in with `viewFadeIn`, the animation the views themselves come in on, and
 * goes as instantly as an outgoing view does — which is what `hidden` gives for nothing, and why
 * nothing here transitions `visibility`.
 */
.correction-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	position: fixed;
	bottom: 16px;
	right: 16px;
	/* Under `.mobile-overlay`, so an open grid dims this too. */
	z-index: 97;
	padding: 3px 7px;
	font-family: var(--font);
	font-size: 10px;
	color: var(--text-muted);
	/* Opaque, so that it stays legible where the page has scrolled something underneath it. */
	background: var(--bg);
	border: 1px solid var(--grey);
	border-radius: 4px;
	text-decoration: none;
	animation: viewFadeIn 0.5s ease;
}

.correction-link:hover {
	background: var(--grey);
	color: var(--text);
}

/* The class sets a `display`, which would otherwise win over the one `[hidden]` carries. */
.correction-link[hidden] {
	display: none;
}

@media (max-width: 768px) {
	/* The other corner, since `.mobile-grid-toggle` has this one. */
	.correction-link {
		right: auto;
		left: 16px;
	}

	#sidebar {
		display: flex;
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 99;
		overflow: hidden;
		transform: translateX(-100%);
		visibility: hidden;
		pointer-events: none;
		transition:
			transform 0.3s ease-in-out,
			visibility 0.3s,
			box-shadow 0.3s;
	}

	#sidebar.mobile-visible {
		transform: translateX(0);
		visibility: visible;
		pointer-events: auto;
		box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
	}

	.mobile-grid-toggle {
		display: flex;
	}

	.landing-logo {
		padding: 0 20px;
	}

	.result-row {
		min-height: auto;
	}

	.result-header {
		margin-right: 0;
	}

	.result-body {
		margin-right: 0;
		height: auto;
	}

	.result-text {
		height: auto;
		max-height: 200px;
	}

	.result-text--overflow {
		-webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
		mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
	}

	.result-image-wrap {
		position: relative;
		right: auto;
		top: auto;
		transform: none;
		width: 100%;
		height: auto;
		margin-top: 8px;
	}

	.result-image {
		width: 100%;
		height: auto;
		max-height: 200px;
		object-fit: contain;
	}

	#view-results.active {
		padding: 12px;
	}

	#view-detail.active {
		padding: 12px;
	}

	.results-input {
		font-size: 16px;
	}
}

#sidebar {
	--cell-size: 10px;
	--cell-radius: 1px;
	--grid-gap: 1px;
	--label-font-size: 9px;
	--cell-ring: 2px;

	width: 100px;
	flex-shrink: 0;
	overflow-y: auto;
	border-right: 1px solid var(--grey);
	background: var(--bg-sidebar);
}

#grid-container {
	padding: 4px;
}

#main {
	flex: 1;
	overflow-y: auto;
	background: var(--bg);
	scrollbar-width: none;
}

#main::-webkit-scrollbar {
	display: none;
}

.grid-header-row {
	position: sticky;
	top: 0;
	z-index: 2;
	display: grid;
	grid-template-columns: repeat(7, var(--cell-size));
	gap: var(--grid-gap);
	background: var(--bg-sidebar);
	box-shadow: -8px 0 0 var(--bg-sidebar);
}

.grid-header {
	height: var(--cell-size);
	font-size: var(--label-font-size);
	color: var(--text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.grid-layout {
	display: flex;
	gap: var(--grid-gap);
	padding-top: var(--cell-ring);
}

#grid {
	display: grid;
	grid-template-columns: repeat(7, var(--cell-size));
	grid-auto-rows: var(--cell-size);
	gap: var(--grid-gap);
}

.cell {
	border-radius: var(--cell-radius);
	cursor: pointer;
	color: inherit;
	text-decoration: none;
	transition:
		background 0.15s,
		box-shadow 0.15s,
		transform 0.15s;
}

.cell-date {
	display: none;
}

.cell--none {
	background: var(--grey);
}
.cell--has-comic {
	background: var(--golden);
}
.cell--bookmarked {
	background: var(--orange);
}

/* Confidence tiers, strongest first. These are single-class selectors so they must sit after
   .cell--has-comic to win; the bookmarked variants are two-class and beat them in turn. */
.cell--search-t5 {
	background: var(--golden);
}
.cell--search-t4 {
	background: var(--golden-t4);
}
.cell--search-t3 {
	background: var(--golden-t3);
}
.cell--search-t2 {
	background: var(--golden-t2);
}
.cell--search-t1 {
	background: var(--golden-t1);
}

.cell--search-t5.cell--bookmarked {
	background: var(--orange);
}
.cell--search-t4.cell--bookmarked {
	background: var(--orange-t4);
}
.cell--search-t3.cell--bookmarked {
	background: var(--orange-t3);
}
.cell--search-t2.cell--bookmarked {
	background: var(--orange-t2);
}
.cell--search-t1.cell--bookmarked {
	background: var(--orange-t1);
}

.cell--search-nonmatch {
	background: var(--golden-dim);
}
.cell--search-nonmatch.cell--bookmarked {
	background: var(--orange-dim);
}
.cell--search-nonmatch.cell--none {
	background: var(--grey-dim);
}
.cell--search-nonmatch.cell--none.cell--bookmarked {
	background: var(--orange-dim);
}

.cell--rerun.cell--search-match {
	background: var(--grey);
}
.cell--rerun.cell--search-match.cell--bookmarked {
	background: var(--orange);
}

.cell--selected {
	box-shadow: 0 0 0 var(--cell-ring) var(--border);
	z-index: 1;
	position: relative;
}
.cell--bookmarked.cell--selected {
	box-shadow: 0 0 0 var(--cell-ring) #000;
}
.cell--hover-highlight {
	box-shadow: 0 0 4px 2px var(--highlight);
	z-index: 2;
	position: relative;
	transform: scale(1.3);
}

.grid-tooltip {
	position: fixed;
	pointer-events: none;
	z-index: 10000;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	transition: opacity 0.1s;
	transform: translateY(-50%);
}

.grid-tooltip--visible {
	opacity: 1;
}

@media (hover: none) {
	.grid-tooltip {
		display: none;
	}
}

.grid-labels {
	display: grid;
	grid-auto-rows: var(--cell-size);
	gap: var(--grid-gap);
}

.month-labels {
	display: none;
}

.grid-label-wrap {
	grid-column: 1;
}

.grid-sticky-label {
	position: sticky;
	top: 0;
	z-index: 3;
	height: var(--cell-size);
	display: flex;
	align-items: center;
	padding-left: 2px;
	font-size: var(--label-font-size);
	line-height: 1;
	white-space: nowrap;
	color: var(--text-muted);
}

#year-rail {
	display: none;
}

.year-rail-button {
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-family: var(--font);
	background: none;
	border: none;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
}

.year-rail-pill {
	min-width: 2.4em;
	padding: 3px 5px;
	border-radius: 4px;
	font-size: var(--label-font-size);
	line-height: 1;
	white-space: nowrap;
	text-align: center;
	font-variant-numeric: tabular-nums;
	color: var(--text-muted);
	transition:
		background 0.15s,
		color 0.15s;
}

.year-rail-button--active .year-rail-pill {
	background: var(--golden);
	color: #fff;
	font-weight: 600;
}

@media (max-width: 768px) {
	#sidebar {
		--cell-size: 28px;
		--cell-radius: 3px;
		--grid-gap: 2px;
		--label-font-size: 12px;
		width: max-content;
		max-width: 92vw;
	}

	#grid-container {
		flex: 1;
		overflow-y: auto;
		padding: 8px;
	}

	.grid-header-row {
		box-shadow:
			-8px 0 0 var(--bg-sidebar),
			0 -8px 0 var(--bg-sidebar);
	}

	.cell {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.cell--selected .cell-date {
		display: block;
		pointer-events: none;
		font-size: 12px;
		line-height: 1;
		font-weight: 500;
		color: rgba(255, 255, 255, 0.95);
	}

	.cell--none:not(.cell--bookmarked).cell--selected .cell-date {
		color: var(--text-muted);
	}

	.month-labels {
		display: grid;
	}

	.year-labels {
		display: none;
	}

	.grid-sticky-label {
		padding-left: 6px;
	}

	#year-rail {
		display: flex;
		flex-direction: column;
		flex-shrink: 0;
		padding: 8px 4px;
		border-left: 1px solid var(--grey);
		background: var(--bg-sidebar);
	}
}

#view-landing.active {
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.landing-logo {
	display: block;
	max-width: 480px;
	width: 100%;
	aspect-ratio: 722 / 103;
	margin: 0 auto 32px auto;
}

.landing-form {
	width: 100%;
	max-width: 520px;
	padding: 0 24px;
}

.landing-input {
	width: 100%;
	/* Room on the right for the submit button, which sits inside the box rather than beside it. */
	padding: 16px 56px 16px 20px;
	font-size: 18px;
	font-family: var(--font);
	color: var(--text);
	background: var(--bg-sidebar);
	border: 2px solid var(--grey);
	border-radius: 8px;
	outline: none;
	transition: border-color 0.2s;
}

.landing-input:focus {
	border-color: var(--golden);
}

.landing-input::placeholder {
	color: var(--text-muted);
}

/* An ordinary submit button, in the room the input's own right padding reserves for it. */
.landing-submit {
	position: absolute;
	top: 50%;
	right: 9px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	color: var(--text-muted);
	background: none;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition:
		color 0.2s,
		background 0.2s;
}

.landing-submit:hover {
	color: var(--golden-half);
	background: var(--grey-dim);
}

.landing-submit > svg {
	width: 19px;
	height: 19px;
}

.landing-credits {
	display: block;
	margin-top: 32px;
	font-size: 12px;
	font-family: var(--font);
	color: var(--text-muted);
	text-decoration: none;
}

.landing-credits:hover {
	color: var(--golden);
}

.query-field {
	display: block;
	position: relative;
	min-width: 0;
}

/* Takes over the growing that `.results-input` used to do as a flex item itself. */
.results-search-bar > .query-field {
	flex: 1;
}

.query-box {
	position: relative;
}

.query-box > input {
	position: relative;
	width: 100%;
	/* The mirror behind carries the fill, so its rounded corners are the ones on show. */
	background: transparent;
}

/*
 * The pills, painted behind the input's own text.
 *
 * The mirror holds the same string with transparent glyphs, so the text is drawn exactly once —
 * by the input — and a sub-pixel disagreement about font metrics shows up as a slightly wide
 * pill rather than as ghosting. Everything that decides where a glyph lands is copied off the
 * input at runtime by `syncMetrics`, because the two inputs this attaches to are deliberately
 * styled differently: 18px text in a 2px border on the landing page, 15px in 1px in the results
 * bar, 16px on a phone.
 */
.query-highlights {
	position: absolute;
	inset: 0;
	overflow: hidden;
	white-space: pre;
	color: transparent;
	background: var(--bg-sidebar);
	border-style: solid;
	border-color: transparent;
	pointer-events: none;
}

/*
 * How far along a filter is, told by the extent of its pill rather than by a fourth colour: gold
 * covers what has settled, grey covers what is still being typed, and the two close up into one
 * gold pill on the keystroke that makes the filter parse. Red is the only other state, and it
 * means no amount of typing will save this one — see `filterSpans`.
 */
.query-pill {
	background: var(--golden-dim);
	border-radius: 3px;
}

.query-pill--pending {
	background: var(--grey);
	border-radius: 0 3px 3px 0;
}

/* Half of a pair, so only its outer corners are round. */
.query-pill--head {
	border-radius: 3px 0 0 3px;
}

.query-pill--invalid {
	background: #fbd7d7;
}

/*
 * The reason a filter will not work, said again for a reader who cannot hover a tooltip.
 *
 * Announced when it changes and given no space of its own: a line under the box grows the search
 * bar and shoves the whole page of results down every time a value is half-typed, which is
 * exactly what the floating tooltip exists to avoid.
 */
.query-note {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Anchored to the pill it explains, and never in the way of the pointer that summoned it. */
.query-tip {
	position: fixed;
	z-index: 10001;
	max-width: 320px;
	padding: 6px 9px;
	font-family: var(--font);
	font-size: 12px;
	color: #fff;
	background: rgba(0, 0, 0, 0.85);
	border-radius: 4px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.1s;
}

.query-tip--visible {
	opacity: 1;
}

.query-menu {
	position: fixed;
	z-index: 10000;
	/* How tall it gets is `MENU_HEIGHT` and the room the viewport has, applied together by `place`.
	   A `max-height` here as well would be a second opinion that the inline one overrode. */
	overflow-y: auto;
	padding: 4px;
	font-family: var(--font);
	font-size: 13px;
	background: var(--bg-sidebar);
	border: 1px solid var(--grey);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s;
}

.query-menu--visible {
	opacity: 1;
	visibility: visible;
}

/*
 * One line, always: the five rows `MENU_HEIGHT` budgets for are five rows of the same height, so a
 * long hint is cut short rather than allowed to wrap and push the rest of the list out of view.
 */
.query-menu-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 4px;
	cursor: pointer;
}

.query-menu-row--active {
	background: var(--golden-dim);
}

.query-menu-row:not(.query-menu-row--active):hover {
	background: var(--grey-dim);
}

/* What the row would insert, and so the half that keeps its full width when the two compete. */
.query-menu-syntax {
	flex: 0 0 auto;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
}

/* A real value, which is text to accept: upright, and in the colour of text rather than of a slot. */
.query-menu-value {
	font-weight: 400;
	color: var(--text);
}

/* The slot to fill, set apart from the name that is already settled. Left for the one row that is
   still about a shape rather than a value: the `@date:YYYY` shown beside a filter's name, before
   its colon has been typed. */
.query-menu-template {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-style: italic;
	font-weight: 400;
	color: var(--golden-half);
}

/* The half that gives way: `min-width: 0` is what lets a flex item shrink past its text at all. */
.query-menu-hint {
	min-width: 0;
	margin-left: auto;
	padding-left: 8px;
	overflow: hidden;
	text-align: right;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--text-muted);
}

#view-results.active {
	display: block;
	padding: 20px;
}

/*
 * The search box and the filter bar are one block: they stick together, and they share the border
 * that used to sit under the search box alone.
 */
.results-sticky {
	position: sticky;
	top: 0;
	margin-bottom: 20px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--grey);
	background: var(--bg);
	z-index: 2;
}

.results-search-bar {
	display: flex;
	align-items: center;
	gap: 8px;
}

.results-input {
	flex: 1;
	padding: 10px 14px;
	font-size: 15px;
	font-family: var(--font);
	color: var(--text);
	background: var(--bg-sidebar);
	border: 1px solid var(--grey);
	border-radius: 6px;
	outline: none;
	transition: border-color 0.2s;
}

.results-input:focus {
	border-color: var(--golden);
}

.results-input::placeholder {
	color: var(--text-muted);
}

.results-clear {
	width: 32px;
	height: 32px;
	font-size: 18px;
	color: var(--text-muted);
	background: none;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.results-clear:hover {
	color: var(--text);
	background: var(--grey);
}

.results-sort {
	width: 32px;
	height: 32px;
	color: var(--text-muted);
	background: none;
	border: 1px solid var(--grey);
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0;
}

.results-sort:hover {
	color: var(--text);
	background: var(--grey);
}

.results-sort svg {
	width: 16px;
	height: 16px;
}

.results-empty {
	text-align: center;
	color: var(--text-muted);
	padding: 60px 20px;
	font-size: 16px;
}

.result-row {
	display: block;
	color: inherit;
	text-decoration: none;
	padding: 16px 0;
	border-bottom: 1px solid var(--grey);
	cursor: pointer;
	transition: background 0.1s;
	position: relative;
	min-height: 140px;
}

.result-row:hover {
	background: var(--bg-sidebar);
}

.result-row.result-row--highlight {
	background: #fff8e1;
}

.result-row--no-image .result-header,
.result-row--no-image .result-body {
	margin-right: 0;
}

.result-row:first-of-type {
	padding-top: 0;
}

.result-header {
	font-weight: 600;
	margin-bottom: 8px;
	margin-right: 216px;
	color: var(--text);
}

.result-source {
	margin-left: 8px;
	font-weight: 400;
	font-size: 12px;
	color: var(--text-muted);
}

.result-body {
	margin-right: 216px;
	height: 140px;
	overflow: hidden;
}

.result-text {
	height: 140px;
	overflow: hidden;
	position: relative;
	white-space: pre-wrap;
	font-size: 13px;
	line-height: 1.5;
}

.result-text--overflow {
	-webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
	mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
}

.result-image-wrap {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 200px;
	height: 140px;
	border-radius: 4px;
	overflow: hidden;
	background: var(--grey);
}

.result-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
	opacity: 0;
	transition: opacity 0.3s;
}

.result-image.loaded {
	opacity: 1;
}

/*
 * The second row of the sticky block: the count on the left, the dropdowns on the right.
 *
 * One line, always. It neither wraps nor scrolls: five short labels and a count fit down to most
 * phone widths, and where they do not, `fit` in `filter-bar.ts` takes dropdowns away rather than
 * let the row break — a second line of buttons under the count is a toolbar, and this is not one.
 * The `gap` is what `fit` measures against, so the two are the same number.
 */
.filter-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	margin-top: 6px;
}

/* The same box as a `filter-drop`, so the count and the labels line up by their glyphs. Neither
   shrinks nor wraps: `fit` reads its width and makes the fields answer for it. */
.filter-count {
	flex-shrink: 0;
	padding: 3px 7px;
	font-size: 13px;
	white-space: nowrap;
	color: var(--text-muted);
}

/* `flex-shrink: 0` so a button is measured at the width it asks for rather than the width the row
   has left — with every button shown, which is how `fit` reads them, the group can be wider than
   the bar for the length of one task. */
.filter-fields {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 6px;
}

/*
 * Just the noun, and the same noun whatever the dropdown is holding — no `Year: 1988`, no count
 * badge, no border, and no tint for a field that is in use.
 *
 * Everything that was tried there restated something the query box is already saying a line above,
 * and paid for it in the one currency this row has none of: four outlined, coloured, resizing
 * buttons turn the quietest corner of the page into a toolbar. Hover and open are the only states
 * left, because those two are about the pointer rather than about the query.
 */
.filter-drop {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 7px;
	font-family: var(--font);
	font-size: 13px;
	color: var(--text-muted);
	background: none;
	border: none;
	border-radius: 5px;
	cursor: pointer;
}

/* The `display` above beats the attribute's own `display: none`, so it is said again here. */
.filter-drop[hidden] {
	display: none;
}

.filter-drop:hover,
.filter-drop[aria-expanded="true"] {
	color: var(--text);
	background: var(--grey-dim);
}

.filter-drop-chevron {
	width: 12px;
	height: 12px;
}

.filter-drop[aria-expanded="true"] .filter-drop-chevron {
	transform: rotate(180deg);
}

/*
 * On the body and floated, like `query-menu`, so the sticky row it hangs from cannot clip it.
 *
 * A column, because only the values scroll: eleven years and a `Clear` are taller than the menu is
 * allowed to be, and a `Clear` below the fold is a `Clear` nobody finds.
 */
.filter-menu {
	position: fixed;
	z-index: 10000;
	display: flex;
	flex-direction: column;
	padding: 4px;
	font-family: var(--font);
	font-size: 13px;
	background: var(--bg-sidebar);
	border: 1px solid var(--grey);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s;
}

.filter-menu--visible {
	opacity: 1;
	visibility: visible;
}

/* Says which half of `@day:` is in here, since the weekday half deliberately is not. */
.filter-menu-heading {
	padding: 6px 8px 4px 8px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.filter-menu-options {
	overflow-y: auto;
}

.filter-menu-options--grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
	min-width: 224px;
}

.filter-option {
	border-radius: 4px;
	cursor: pointer;
	/* The click in here is no longer always swallowed, so a drag across the rows would otherwise take
	   their labels with it as a text selection. */
	-webkit-user-select: none;
	user-select: none;
}

.filter-option--list {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	white-space: nowrap;
}

.filter-option--grid {
	display: grid;
	place-items: center;
	height: 28px;
	font-variant-numeric: tabular-nums;
}

.filter-option:hover {
	background: var(--grey-dim);
}

/*
 * A check beside the label says a list row is on; a grid cell has no room for one, so it is filled
 * instead. Neither is the focus ring's job: it has to be able to sit on a row that is already
 * checked and still be visible there, which is why it is a ring and not a fill.
 */
.filter-option-check {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	color: var(--golden-half);
	visibility: hidden;
}

.filter-option--checked .filter-option-check {
	visibility: visible;
}

.filter-option--checked {
	background: var(--golden-dim);
}

/*
 * The one place a checked row is set in bold, and only because a grid cell has no check beside it
 * to say so. A list row must not: the menu is as wide as its widest label, and `September` in bold
 * is wider than `September` — so ticking it would widen the whole dropdown under the pointer.
 * The grid is seven equal columns, which cannot move whatever weight the numbers are set in.
 */
.filter-option--grid.filter-option--checked {
	font-weight: 600;
}

.filter-option--checked:hover {
	background: var(--golden-dim);
}

/*
 * The ring is the page's one focus rule in `base.css`, gold and 2px, and these rows want every bit
 * of that. Only its offset is wrong for them: drawn outside the box it would be clipped on the first
 * and last rows by the options' own `overflow-y`, and in the day grid it would land squarely in the
 * 2px gap and over the cells either side. Drawn inside, it clears both.
 */
.filter-option:focus-visible,
.filter-menu-clear:focus-visible {
	outline-offset: -2px;
}

/* The one row that is an action rather than a value, so it sits apart from the list. */
.filter-menu-clear {
	display: block;
	flex-shrink: 0;
	width: 100%;
	margin-top: 4px;
	padding: 6px 8px;
	font-family: var(--font);
	font-size: 12px;
	text-align: left;
	color: var(--text-muted);
	background: none;
	border: none;
	border-top: 1px solid var(--grey);
	border-radius: 0 0 4px 4px;
	cursor: pointer;
}

.filter-menu-clear:hover {
	color: var(--text);
	background: var(--grey-dim);
}

#view-detail.active {
	display: block;
	/* The corrections link floats over the bottom of the page; the last line clears it. */
	padding: 20px 20px 56px;
}

.detail-container {
	max-width: 800px;
}

.detail-back {
	display: inline-block;
	font-family: var(--font);
	font-size: 14px;
	color: var(--text);
	background: none;
	border: 1px solid var(--grey);
	border-radius: 6px;
	padding: 6px 14px;
	cursor: pointer;
	margin-bottom: 20px;
}

.detail-back--disabled {
	opacity: 0.25;
	cursor: default;
}

.detail-back:not(.detail-back--disabled):hover,
.detail-home:hover {
	background: var(--grey);
}

.detail-home {
	display: inline-block;
	text-decoration: none;
	font-family: var(--font);
	font-size: 14px;
	color: var(--text);
	background: none;
	border: 1px solid var(--grey);
	border-radius: 6px;
	padding: 6px 14px;
	cursor: pointer;
	margin-bottom: 20px;
}

.nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	font-family: var(--font);
	font-size: 14px;
	color: var(--text-muted);
	text-decoration: none;
	background: none;
	border: 1px solid var(--grey);
	border-radius: 4px;
	cursor: pointer;
	margin-left: 4px;
	vertical-align: middle;
	padding: 0;
}

.nav-btn:hover {
	background: var(--grey);
}

.nav-btn--disabled {
	opacity: 0.25;
	cursor: default;
}

.detail-date {
	font-size: 20px;
	font-weight: 600;
	margin-bottom: 10px;
}

.detail-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 20px;
}

.detail-actions > .copy-link-btn,
.detail-actions > .bookmark-btn,
.detail-actions > .nav-btn {
	margin-left: 0;
}

.detail-comic + .detail-comic {
	margin-top: 40px;
}

.detail-description {
	font-size: 15px;
	line-height: 1.7;
	color: var(--text);
}

.detail-transcript-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-muted);
	margin: 20px 0 6px 0;
}

.detail-transcript-toggle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 10px;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}

.detail-transcript-toggle__original {
	color: var(--golden);
}

.detail-transcript-toggle__alternate {
	color: var(--text-muted);
}

.detail-transcript-toggle input {
	appearance: none;
	width: 24px;
	height: 12px;
	margin: 0;
	border: 1px solid var(--grey);
	border-radius: 999px;
	background: var(--grey);
	cursor: pointer;
	position: relative;
}

.detail-transcript-toggle input::before {
	content: "";
	position: absolute;
	width: 8px;
	height: 8px;
	top: 1px;
	left: 2px;
	border-radius: 50%;
	background: var(--text-muted);
	transition: transform 0.15s;
}

.detail-transcript-toggle input:checked::before {
	transform: translateX(10px);
}

.detail-transcript-toggle input:focus-visible {
	outline: 2px solid var(--golden);
	outline-offset: 2px;
}

.detail-transcript-wrap:has(.detail-transcript-toggle input:checked) .detail-transcript-toggle__original {
	color: var(--text-muted);
}

.detail-transcript-wrap:has(.detail-transcript-toggle input:checked) .detail-transcript-toggle__alternate {
	color: var(--golden);
}

.detail-transcript {
	white-space: pre-wrap;
	font-size: 14px;
	line-height: 1.6;
	color: var(--text);
}

.detail-transcript--alternate {
	display: none;
}

.detail-transcript-wrap:has(.detail-transcript-toggle input:checked) .detail-transcript--original {
	display: none;
}

.detail-transcript-wrap:has(.detail-transcript-toggle input:checked) .detail-transcript--alternate {
	display: block;
}

.detail-comic--illustrated .detail-transcript {
	color: var(--text-muted);
}

.detail-description-skeleton span {
	display: block;
	height: 11px;
	border-radius: 3px;
	background: var(--grey);
	animation: pulse 1.5s ease-in-out infinite;
	margin-bottom: 9px;
}

.detail-description-skeleton span:nth-child(1) {
	width: 100%;
}

.detail-description-skeleton span:nth-child(2) {
	width: 96%;
}

.detail-description-skeleton span:nth-child(3) {
	width: 62%;
	margin-bottom: 26px;
}

.detail-note {
	color: var(--text-muted);
	font-style: italic;
	font-size: 13px;
	margin-top: 8px;
}

.detail-attribution {
	color: var(--text-muted);
	font-size: 12px;
	margin-top: 16px;
}

.detail-attribution a {
	color: var(--text-muted);
}

.detail-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin-top: 12px;
}

.detail-read-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	color: var(--text-muted);
	text-decoration: none;
}

.detail-read-link:hover {
	color: var(--golden);
}

.detail-missing {
	color: var(--text-muted);
	font-size: 16px;
	padding: 40px 0;
}

.detail-rerun-banner {
	font-size: 13px;
	color: var(--text-muted);
	margin-bottom: 24px;
}

.detail-rerun-link {
	color: var(--golden);
	text-decoration: none;
}

.detail-rerun-link:hover {
	text-decoration: underline;
}

.detail-collections-heading {
	font-size: 12px;
	color: var(--text-muted);
	margin: 24px 0 8px 0;
}

.detail-collections {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px;
}

.collection-entry {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.collection-pages {
	max-width: 72px;
	margin-top: 7px;
	font-size: 11px;
	line-height: 1.35;
	color: var(--text-muted);
	text-align: center;
	hyphens: auto;
	overflow-wrap: break-word;
}

.collection-pages__line {
	display: block;
}

.detail-collections--empty {
	font-style: italic;
	color: var(--text-muted);
}

.collection-book {
	display: block;
	height: 64px;
	position: relative;
	cursor: pointer;
	transition: transform 0.15s;
	background: var(--grey);
	border-radius: 3px;
}

.collection-book img {
	height: 64px;
	width: auto;
	display: block;
	border-radius: 3px;
}

.collection-book:hover {
	transform: scale(1.1);
}

.collection-book--bw img {
	filter: grayscale(100%);
}

.collection-book__badge {
	position: absolute;
	top: -5px;
	right: -5px;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: var(--golden);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
	z-index: 1;
}

.collection-tooltip {
	position: fixed;
	pointer-events: none;
	z-index: 10000;
	background: rgba(0, 0, 0, 0.85);
	color: #fff;
	padding: 8px 10px;
	border-radius: 4px;
	font-size: 13px;
	white-space: nowrap;
	opacity: 0;
	transition: opacity 0.1s;
}

.collection-tooltip--visible {
	opacity: 1;
}

.collection-tooltip__name {
	font-weight: 600;
}

.collection-tooltip__year {
	font-size: 11px;
	color: #aaa;
}

.collection-tooltip__pages {
	margin-top: 4px;
	font-size: 12px;
	color: #ddd;
	white-space: normal;
	max-width: 260px;
	line-height: 1.4;
}

.collection-tooltip__divider {
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	margin-top: 5px;
	padding-top: 5px;
	font-size: 11px;
	color: #aaa;
	font-style: italic;
	line-height: 1.4;
	white-space: normal;
	max-width: 260px;
}

.detail-image-wrapper {
	position: relative;
	display: block;
	width: 100%;
	margin-bottom: 20px;
	border-radius: 4px;
	overflow: hidden;
	background: var(--grey);
}

.detail-image-pulse {
	position: absolute;
	inset: 0;
	background: var(--grey);
	animation: pulse 1.5s ease-in-out infinite;
}

.detail-image-pulse.loaded {
	display: none;
}

.detail-image {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

@keyframes pulse {
	0%,
	100% {
		opacity: 0.4;
	}
	50% {
		opacity: 0.8;
	}
}

#view-collection.active {
	display: block;
	/* The corrections link floats over the bottom of the page; the last line clears it. */
	padding: 20px 20px 56px;
}

.collection-container {
	max-width: 800px;
}

.collection-header {
	display: flex;
	gap: 24px;
	margin-bottom: 24px;
	align-items: flex-start;
}

.collection-cover {
	flex-shrink: 0;
	height: 128px;
}

.collection-cover img {
	height: 128px;
	width: auto;
	border-radius: 4px;
	display: block;
}

.collection-info {
	flex: 1;
}

.collection-name {
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 4px;
}

.collection-type {
	font-size: 13px;
	color: var(--text-muted);
	text-transform: capitalize;
	margin-bottom: 8px;
}

.collection-meta {
	font-size: 13px;
	color: var(--text);
	line-height: 1.6;
	margin-bottom: 4px;
}

.collection-meta--label {
	color: var(--text-muted);
}

.collection-note {
	font-size: 13px;
	color: var(--text-muted);
	font-style: italic;
	line-height: 1.5;
	margin-top: 8px;
	margin-bottom: 16px;
}

.collection-section-heading {
	font-size: 12px;
	color: var(--text-muted);
	margin: 24px 0 8px 0;
}

.collection-extras {
	list-style: disc;
	padding-left: 20px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--text);
}

.collection-extras li {
	margin-bottom: 2px;
}

.collection-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.collection-link {
	display: inline-flex;
	align-items: center;
	font-size: 13px;
	color: var(--text);
	text-decoration: none;
	padding: 4px 12px;
	border: 1px solid var(--border);
	border-radius: 4px;
}

.collection-link:hover {
	border-color: var(--golden);
	color: var(--golden);
}

.collection-ranges {
	font-size: 13px;
	color: var(--text);
	line-height: 1.6;
}

.collection-range {
	margin-bottom: 2px;
}

.collection-no-ranges {
	font-style: italic;
	color: var(--text-muted);
	font-size: 13px;
}

#view-credits.active {
	display: block;
	/* The corrections link floats over the bottom of the page; the last line clears it. */
	padding: 20px 20px 56px;
}

.credits-container {
	max-width: 600px;
}

.credits-back,
.credits-home {
	display: inline-block;
	font-family: var(--font);
	font-size: 14px;
	color: var(--text);
	text-decoration: none;
	background: none;
	border: 1px solid var(--grey);
	border-radius: 6px;
	padding: 6px 14px;
	cursor: pointer;
	margin-bottom: 24px;
}

.credits-back--disabled {
	opacity: 0.25;
	cursor: default;
}

.credits-back:not(.credits-back--disabled):hover,
.credits-home:hover {
	background: var(--grey);
}

.credits-heading {
	font-size: 20px;
	font-weight: 600;
	margin-bottom: 20px;
}

.credits-section {
	margin-bottom: 20px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--text);
}

.credits-section a {
	color: var(--golden);
	text-decoration: none;
}

.credits-section a:hover {
	text-decoration: underline;
}

.credits-section ul {
	margin: 6px 0 0 0;
	padding-left: 1.2em;
}

.credits-footer {
	margin-top: 32px;
	font-size: 12px;
	color: var(--text-muted);
}

.credits-footer a {
	color: var(--golden);
	text-decoration: none;
}

.credits-footer a:hover {
	text-decoration: underline;
}

