/* A research paper's page (paper.js), grown from its place in the listing
   (morph.js) over the content panel, in the project pages' frame
   (page.css): their top app bar, and their scroller as the container the
   paper lays out against.

   The paper reads at about 74 characters a line, near the top of the 50
   to 75 that read comfortably (Baymard), so it isn't squeezed between
   its contents and its notes. On wide pages its contents stand to the
   left, following the reader, and its notes to the right, beside what
   they note; on narrower ones the notes give way first, then the
   contents fold into the text. Type follows M3's scale: display small
   for the title, headline small for sections, body large for the text,
   at a looser line for long reading. */

.paper-actions {
	display: flex;
	gap: var(--s1);
	margin-left: auto;
}

.paper-actions .icon-button {
	color: var(--muted);
}

.paper-actions .icon-button:hover {
	color: var(--text);
}

/* --- The grid ---------------------------------------------------------------- */

.paper {
	--measure: 74ch;
	display: grid;
	grid-template-columns: [full-start text-start] minmax(0, var(--measure)) [text-end full-end];
	justify-content: center;
	column-gap: var(--s7);
	padding-top: var(--s2);
}

.paper-lead {
	grid-column: full;
	margin: 0 0 var(--s6);
}

.paper-head {
	grid-column: text;
	margin-bottom: var(--s6);
}

.paper-contents {
	display: none;
	grid-column: 1;
}

.paper-column {
	grid-column: text;
	min-width: 0;
}

.paper-margin {
	display: none;
}

/* The contents beside the text. */
@container page (min-width: 900px) {
	.paper {
		grid-template-columns: [full-start] 200px [text-start] minmax(0, var(--measure)) [text-end full-end];
	}

	.paper-head {
		grid-column: text-start / full-end;
	}

	.paper-contents {
		display: block;
		grid-row: 3;
	}

	.paper-column {
		grid-row: 3;
	}

	.paper-contents-inline {
		display: none;
	}
}

/* And the notes beside it too. */
@container page (min-width: 1200px) {
	.paper {
		grid-template-columns: [full-start] 216px [text-start] minmax(0, var(--measure)) [text-end] 232px [full-end];
	}

	.paper-margin {
		position: relative;
		display: block;
		grid-column: 3;
		grid-row: 3;
	}
}

/* --- The lead figure ----------------------------------------------------- */

/* Grown out of the listing's thumbnail as the page opens (morph.js). */
.paper-hero {
	height: clamp(200px, 34cqh, 360px);
	border: 1px solid var(--hairline);
	border-radius: var(--s4);
	transform-origin: top center;
	background: var(--bg);
	overflow: hidden;
}

.paper-hero-empty {
	height: 0;
	border: 0;
}

.paper-lead figcaption {
	max-width: 88ch;
	margin-top: var(--s3);
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-quiet);
}

/* --- The head ------------------------------------------------------------- */

.paper-overline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	row-gap: var(--s2);
	margin: 0;
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-quiet);
}

/* The head's facts set apart by dots, as the listing's are
   (research.css): one starting a wrapped line loses its dot. */
.paper-head .paper-overline {
	margin-left: calc(-1 * var(--s5));
	clip-path: inset(0 0 0 var(--s5));
}

.paper-head .paper-overline > * {
	position: relative;
	margin-left: var(--s5);
	white-space: nowrap;
}

.paper-head .paper-overline > ::before {
	content: "·";
	position: absolute;
	left: calc(-1 * var(--s5) + var(--s2));
}

/* M3's label-medium on a small chip's 8px corners, in the secondary
   container. */
.paper-status {
	padding: 2px var(--s2);
	border-radius: var(--s2);
	background: var(--selected);
	color: var(--ink-accent);
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.5px;
}


.paper-title {
	margin: var(--s3) 0 var(--s4);
	font-size: 28px;
	line-height: 36px;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

@container page (min-width: 860px) {
	.paper-title {
		max-width: 30ch;
		font-size: 36px;
		line-height: 44px;
	}
}

.paper-title:focus {
	outline: none;
}

.paper-byline {
	margin: 0;
	font-size: 16px;
	line-height: 24px;
}

.paper-author {
	--underline-rest: var(--border);
}

.paper-byline sup {
	margin-left: 1px;
	color: var(--ink-quiet);
	font-size: 11px;
	line-height: 0;
}

.paper-affiliations {
	display: grid;
	gap: 2px;
	margin: var(--s2) 0 0;
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-quiet);
}

.paper-affiliations sup {
	margin-right: 2px;
	line-height: 0;
}

.paper-affiliations a {
	--underline-rest: var(--border);
}

.paper-topics {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2);
	margin: var(--s4) 0 0;
}

/* M3's assist chips, as labels: 32px tall, 8px corners, outlined. */
.paper-topics span {
	display: inline-flex;
	align-items: center;
	height: 28px;
	padding: 0 var(--s3);
	border: 1px solid var(--border);
	border-radius: var(--s2);
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.5px;
	color: var(--ink-quiet);
}

/* --- The contents ---------------------------------------------------------- */

/* Kept in view while the text scrolls past, inside a box as tall as the
   text so it stops with it. */
.paper-contents-inner {
	position: sticky;
	top: var(--s5);
	display: flex;
	flex-direction: column;
	max-height: calc(100cqh - var(--s7));
}

.paper-contents-head {
	margin: 0 0 var(--s2);
	padding-left: var(--s4);
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.1px;
	font-weight: 700;
}

.paper-contents-rail {
	min-height: 0;
	overflow-y: auto;
	scrollbar-width: none;
}

.paper-contents-list {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* The track the bar runs along. */
.paper-contents-list::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 1px;
	width: 1px;
	background: var(--hairline);
}

.paper-contents-list a {
	display: grid;
	grid-template-columns: 2.6em minmax(0, 1fr);
	padding: 6px var(--s2) 6px var(--s4);
	background: none;
	color: var(--ink-quiet);
	font-size: 13px;
	line-height: 18px;
	transition: color 150ms var(--ease-effects);
}

.paper-contents-list a:hover,
.paper-contents-list a:focus-visible {
	color: var(--text);
}

.paper-contents-list a[aria-current] {
	color: var(--ink-accent);
}

.paper-contents-list a:focus-visible {
	outline-offset: -2px;
	border-radius: var(--s1);
}

/* Unnumbered parts (the brief, the end matter) take the whole line. */
.paper-contents-number:empty {
	display: none;
}

.paper-contents-number:empty + .paper-contents-title {
	grid-column: 1 / -1;
}

.paper-contents-number {
	font-variant-numeric: tabular-nums;
}

.paper-contents-level-3 a {
	padding-left: calc(var(--s4) + 1.2em);
}

/* The liquid bar (tab-indicator.js), on the track. */
.paper-contents-indicator {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	color: var(--ink-accent);
	pointer-events: none;
}

.paper-progress {
	margin: var(--s3) 0 0;
	padding-left: var(--s4);
	font-size: 12px;
	line-height: 16px;
	color: var(--ink-quiet);
	font-variant-numeric: tabular-nums;
}

/* Folded into the text where there's no room beside it, in the outline
   of the text's other disclosures. */
.paper-contents-inline {
	margin: 0 0 var(--s6);
	border: 1px solid var(--hairline);
	border-radius: var(--s3);
}

.paper-contents-inline > summary {
	display: flex;
	align-items: center;
	gap: var(--s2);
	min-height: 48px;
	padding: 0 var(--s4);
	font-size: 14px;
	font-weight: 700;
	list-style: none;
	cursor: pointer;
}

.paper-contents-inline > summary::-webkit-details-marker {
	display: none;
}

.paper-contents-inline > summary::after {
	content: "";
	width: 6px;
	height: 6px;
	margin-left: auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	rotate: 45deg;
	transition: rotate 200ms cubic-bezier(0.2, 0, 0, 1);
}

.paper-contents-inline[open] > summary::after {
	rotate: 225deg;
}

.paper-contents-inline .paper-contents-list {
	padding: 0 0 var(--s2);
}

.paper-contents-inline .paper-contents-list::before {
	display: none;
}

.paper-contents-inline .paper-contents-list a {
	padding-block: 10px;
	font-size: 14px;
	line-height: 20px;
}

/* --- In brief, and the abstract ----------------------------------------------- */

/* The paper in plain words first: a filled card (M3, 12px corners), its
   summary in body large, its key points numbered. */
.paper-brief {
	margin-bottom: var(--s6);
	padding: var(--s5);
	border-radius: var(--s4);
	background: var(--surface);
}

.paper-brief-title {
	display: flex;
	align-items: center;
	gap: var(--s2);
	margin: 0 0 var(--s3);
	color: var(--ink-accent);
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.1px;
}

.paper-summary {
	margin: 0;
	font-size: 17px;
	line-height: 28px;
}

.paper-points {
	display: grid;
	gap: var(--s3);
	margin: var(--s5) 0 0;
	padding: 0;
	list-style: none;
	counter-reset: point;
	font-size: 14px;
	line-height: 22px;
}

.paper-points li {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	gap: var(--s3);
	counter-increment: point;
}

.paper-points li::before {
	content: counter(point);
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	margin-top: -3px;
	border-radius: 50%;
	background: var(--selected);
	color: var(--ink-accent);
	font-size: 13px;
	font-weight: 700;
}

.paper-abstract {
	margin-bottom: var(--s6);
}

.paper-section-title {
	margin: 0 0 var(--s3);
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.1px;
}

.paper-abstract p {
	margin: 0 0 var(--s4);
	font-size: 16px;
	line-height: 1.7;
}

.paper-abstract p:last-child {
	margin-bottom: 0;
}

/* --- The text ---------------------------------------------------------------- */

.paper-body,
.paper-end {
	max-width: none;
	font-size: 16px;
	line-height: 1.7;
}

.paper-column .markdown :is(.md-h2, .md-h3) {
	position: relative;
	padding-bottom: 0;
	border-bottom: 0;
	scroll-margin-top: var(--s5);
}

.paper-column .markdown .md-h2 {
	margin: var(--s7) 0 var(--s4);
	font-size: 24px;
	line-height: 32px;
}

.paper-column .markdown .md-h3 {
	margin: var(--s6) 0 var(--s3);
	font-size: 18px;
	line-height: 26px;
}

.paper-body > .md-h2:first-child {
	margin-top: 0;
}

.paper-body .md-math {
	font-size: 1.06em;
}

/* Citations: bracketed numbers, each a link to its reference. */
.paper-cite {
	color: var(--ink-quiet);
	white-space: nowrap;
}

.markdown .paper-cite a {
	--underline-rest: var(--border);
	padding-inline: 1px;
	color: var(--ink-accent);
	font-variant-numeric: tabular-nums;
}

.paper-cite-missing {
	color: var(--ink-del);
}

/* A note's mark, lit with its note beside the text. */
.paper-body .md-fn-ref a {
	color: var(--ink-accent);
}

.paper-body .md-fn-ref {
	border-radius: var(--s1);
	transition: background-color 150ms var(--ease-effects);
}

.paper-body .md-fn-ref.paper-lit {
	background: var(--selected);
}

/* --- Notes beside the text ---------------------------------------------------- */

.paper-sidenote {
	position: absolute;
	left: 0;
	right: 0;
	display: grid;
	grid-template-columns: 1.6em minmax(0, 1fr);
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-quiet);
	transition: color 150ms var(--ease-effects);
}

.paper-sidenote > :not(.paper-sidenote-number) {
	grid-column: 2;
	margin: 0;
}

.paper-sidenote-number {
	grid-column: 1;
	color: var(--ink-accent);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.paper-sidenote.paper-lit {
	color: var(--text);
}

/* --- Arriving at a part ---------------------------------------------------------- */

/* A wash of the accent that fades as a ring widens away from it, so the
   eye finds where a link led. */
.paper-arrived {
	border-radius: var(--s2);
	animation: paper-arrived 1600ms cubic-bezier(0.2, 0, 0, 1);
}

@keyframes paper-arrived {
	0% {
		background-color: color-mix(in srgb, var(--accent) 0%, transparent);
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
	}

	12% {
		background-color: color-mix(in srgb, var(--accent) 16%, transparent);
		box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent);
	}

	100% {
		background-color: color-mix(in srgb, var(--accent) 0%, transparent);
		box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent);
	}
}

/* --- The end matter -------------------------------------------------------------- */

.paper-end {
	margin-top: var(--s7);
	padding-top: var(--s2);
	border-top: 1px solid var(--hairline);
}

.paper-end > section {
	margin-bottom: var(--s7);
}

.paper-end > section > .md-h2 {
	margin-top: var(--s6);
}

/* Authors: outlined cards (M3, 12px corners), each led by an avatar of
   their initials. */
.paper-end .paper-author-list {
	display: grid;
	gap: var(--s3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.markdown .paper-author-list li + li {
	margin-top: 0;
}

.paper-author-card {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	gap: var(--s4);
	padding: var(--s4) var(--s5) var(--s4) var(--s4);
	border: 1px solid var(--hairline);
	border-radius: var(--s3);
}

.paper-avatar {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--selected);
	color: var(--ink-accent);
	font-size: 15px;
	font-weight: 700;
}

.paper-author-text > * {
	margin: 0;
}

.paper-author-name {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s2);
	font-size: 16px;
	line-height: 24px;
	font-weight: 700;
}

.paper-badge {
	padding: 0 6px;
	border: 1px solid var(--border);
	border-radius: var(--s1);
	color: var(--ink-quiet);
	font-size: 11px;
	line-height: 16px;
	font-weight: 400;
	letter-spacing: 0.5px;
}

.paper-author-place {
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-quiet);
}

.markdown .paper-author-bio {
	margin-top: var(--s2);
	font-size: 14px;
	line-height: 22px;
}

.paper-author-roles {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s1) var(--s2);
	margin-top: var(--s3) !important;
}

.paper-author-roles > span:not(.visually-hidden) {
	padding: 0 var(--s2);
	border-radius: var(--s1);
	background: color-mix(in srgb, var(--text) 6%, transparent);
	font-size: 12px;
	line-height: 22px;
	color: var(--ink-quiet);
}

.paper-author-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s1) var(--s4);
	margin-top: var(--s3) !important;
	font-size: 13px;
	line-height: 20px;
}

.markdown .paper-author-links a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	--underline-rest: transparent;
}

.paper-author-links svg {
	width: 14px;
	height: 14px;
	color: var(--ink-quiet);
}

/* Citing: M3's segmented buttons choose the style (40px, outlined,
   the chosen one in the secondary container with a check that grows in),
   over the citation with a way to copy it. */
.paper-formats {
	display: inline-flex;
	max-width: 100%;
	margin-bottom: var(--s3);
	overflow-x: auto;
	scrollbar-width: none;
}

.paper-segment {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	height: 40px;
	padding: 0 var(--s4);
	border: 1px solid var(--border);
	background: none;
	color: var(--text);
	font: inherit;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.1px;
	transition: background-color 200ms var(--ease-effects);
}

.paper-segment + .paper-segment {
	margin-left: -1px;
}

.paper-segment:first-child {
	border-radius: 20px 0 0 20px;
}

.paper-segment:last-child {
	border-radius: 0 20px 20px 0;
}

.paper-segment svg {
	width: 0;
	height: 18px;
	margin-right: 0;
	opacity: 0;
	transition:
		width 250ms cubic-bezier(0.2, 0, 0, 1),
		margin-right 250ms cubic-bezier(0.2, 0, 0, 1),
		opacity 150ms var(--ease-effects);
}

.paper-segment[aria-pressed="true"] {
	background: var(--selected);
}

.paper-segment[aria-pressed="true"] svg {
	width: 18px;
	margin-right: var(--s2);
	opacity: 1;
}

.paper-segment:not([aria-pressed="true"]):hover {
	background: color-mix(in srgb, var(--text) 8%, transparent);
}

.paper-segment:focus-visible {
	position: relative;
	z-index: 1;
}

.paper-citation {
	position: relative;
}

.markdown .paper-citation pre {
	margin: 0;
	padding: var(--s4) calc(var(--s4) + 40px) var(--s4) var(--s4);
	border: 1px solid var(--hairline);
	border-radius: var(--s3);
	font-size: 13px;
	line-height: 20px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.markdown .paper-citation code {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	font-size: inherit;
}

.paper-citation-copy {
	position: absolute;
	top: var(--s1);
	right: var(--s1);
	color: var(--ink-quiet);
}

/* References: numbered as cited, in brackets, hanging. */
.paper-end .paper-references ol {
	padding: 0;
	list-style: none;
	font-size: 14px;
	line-height: 22px;
}

.paper-references li {
	position: relative;
	padding-left: 3em;
}

.paper-references li::before {
	content: "[" counter(list-item) "]";
	position: absolute;
	left: 0;
	color: var(--ink-quiet);
	font-variant-numeric: tabular-nums;
}

.markdown .paper-references li + li {
	margin-top: var(--s3);
}

.paper-ref-venue {
	color: var(--ink-quiet);
}

.paper-ref-back {
	display: inline-flex;
	vertical-align: -2px;
	--underline-rest: transparent;
}

.paper-ref-back svg {
	width: 14px;
	height: 14px;
}

/* Versions: a timeline, newest first, the one shown marked. */
.paper-end .paper-version-list {
	position: relative;
	padding: 0;
	list-style: none;
	font-size: 14px;
	line-height: 22px;
}

.paper-version-list li {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 var(--s3);
	padding-left: var(--s6);
}

.markdown .paper-version-list li + li {
	margin-top: var(--s4);
}

/* Its line, and a dot for each version. */
.paper-version-list::before {
	content: "";
	position: absolute;
	top: 8px;
	bottom: 8px;
	left: 7px;
	width: 2px;
	border-radius: 1px;
	background: var(--hairline);
}

.paper-version-list li::before {
	content: "";
	position: absolute;
	top: 5px;
	left: 2px;
	width: 8px;
	height: 8px;
	border: 2px solid var(--border);
	border-radius: 50%;
	background: var(--bg);
}

.paper-version-list .paper-version-current::before {
	border-color: var(--ink-accent);
	background: var(--ink-accent);
}

.paper-version-number {
	font-weight: 700;
}

.paper-version-current .paper-version-number {
	color: var(--ink-accent);
}

.paper-version-list time {
	color: var(--ink-quiet);
}

.paper-version-note {
	flex-basis: 100%;
}

.paper-license {
	display: flex;
	align-items: flex-start;
	gap: var(--s2);
	margin-top: var(--s5) !important;
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-quiet);
}

.paper-license svg {
	flex: none;
	width: 16px;
	height: 16px;
	margin-top: 2px;
}

/* The project the paper comes from: an outlined card with its cover,
   moving while pointed at. */
.paper-project {
	--underline-rest: transparent;
	display: grid;
	grid-template-columns: 168px minmax(0, 1fr);
	align-items: center;
	gap: var(--s5);
	margin-bottom: var(--s6);
	padding: var(--s3);
	border: 1px solid var(--hairline);
	border-radius: var(--s4);
	background: none;
	transition: background-color 200ms var(--ease-effects);
}

.paper-project:hover {
	background-color: color-mix(in srgb, var(--text) 4%, transparent);
	color: inherit;
}

.paper-project-cover {
	display: block;
	height: 104px;
	border-radius: var(--s3);
	background: var(--surface);
	overflow: hidden;
}

.paper-project-cover canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.paper-project-text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.paper-project .paper-overline,
.paper-neighbour .paper-overline {
	gap: 6px;
	font-size: 12px;
	line-height: 16px;
}

.paper-overline svg {
	width: 14px;
	height: 14px;
}

.paper-project-title {
	font-size: 18px;
	line-height: 26px;
	font-weight: 700;
}

.paper-project-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-accent);
}

.paper-project-cta svg {
	width: 14px;
	height: 14px;
	transition: translate 250ms cubic-bezier(0.2, 0, 0, 1);
}

.paper-project:hover .paper-project-cta svg {
	translate: 3px 0;
}

@container page (max-width: 559px) {
	.paper-project {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* The papers either side of this one. */
.paper-neighbours {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--s3);
}

.paper-neighbour {
	--underline-rest: transparent;
	display: grid;
	align-content: start;
	gap: var(--s1);
	padding: var(--s4);
	border: 1px solid var(--hairline);
	border-radius: var(--s3);
	background: none;
	transition: background-color 200ms var(--ease-effects);
}

.paper-neighbour:hover {
	background-color: color-mix(in srgb, var(--text) 4%, transparent);
	color: inherit;
}

.paper-neighbour-next {
	grid-column: -2;
	text-align: right;
}

.paper-neighbour-next .paper-overline {
	justify-content: flex-end;
}

.paper-neighbour-title {
	font-size: 15px;
	line-height: 22px;
	font-weight: 700;
}

.paper-neighbour-summary {
	display: -webkit-box;
	font-size: 13px;
	line-height: 20px;
	color: var(--ink-quiet);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

/* --- Previews ------------------------------------------------------------------- */

/* A figure, table or equation previews wider than M3's rich tooltip, so
   it can be read in it. */
.hover-card:has(.paper-preview-part) {
	width: min(480px, calc(100vw - 16px));
}

.paper-preview > * {
	margin: 0;
}

.paper-preview > * + * {
	margin-top: var(--s2);
}

.paper-preview-kind {
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.5px;
	color: var(--muted);
}

.paper-preview-title {
	font-size: 14px;
	line-height: 20px;
	font-weight: 700;
}

.paper-preview-reference .paper-ref-venue {
	color: var(--muted);
}

.paper-preview-reference a {
	--underline-rest: var(--border);
}

.paper-preview-note > * {
	margin: 0;
}

.paper-preview-go {
	--underline-rest: transparent;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--accent);
}

.paper-preview-go svg {
	width: 14px;
	height: 14px;
}

.paper-preview.markdown {
	max-width: none;
	font-size: 13px;
	line-height: 20px;
}

.paper-preview .md-figure,
.paper-preview .md-table-figure {
	margin: 0;
}

.paper-preview .md-math {
	margin: 0;
	font-size: 15px;
}

.paper-preview .figure-art {
	min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
	.paper-contents-list a,
	.paper-sidenote,
	.paper-body .md-fn-ref,
	.paper-segment,
	.paper-segment svg,
	.paper-project,
	.paper-project-cta svg,
	.paper-neighbour,
	.paper-contents-inline > summary::after {
		transition: none;
	}

	.paper-arrived {
		animation-duration: 2400ms;
	}
}

/* --- Printed ----------------------------------------------------------------------- */

/* An open paper prints as a paper: the site's frame, bar and the reading
   aids that need a screen go, the text runs in one column across the page
   in the light theme's ink (paper.js switches to it while printing), and
   figures, tables and equations keep from breaking across pages. Notes
   print after the text, and references keep their DOIs written out. */
@media print {
	@page {
		margin: 18mm 16mm;
	}

	body:has(.paper-page) {
		display: block;
		height: auto;
		background: none;
	}

	body:has(.paper-page) > :not(.content-frame),
	.content-frame:has(.paper-page) > :not(.paper-page),
	.content-frame:has(.paper-page)::after {
		display: none !important;
	}

	.content-frame:has(.paper-page) {
		display: block;
		margin: 0;
		border-radius: 0;
		overflow: visible;
		background: none;
	}

	.paper-page {
		position: static;
		display: block;
		background: none !important;
		clip-path: none !important;
		translate: none !important;
		opacity: 1 !important;
	}

	.paper-page > :not(.page-scroll),
	.paper-contents,
	.paper-margin,
	.paper-contents-inline,
	.paper-formats,
	.paper-citation-copy,
	.paper-ref-back,
	.paper-project,
	.paper-neighbours,
	.paper-page .md-anchor,
	.paper-page .md-fn-back,
	.paper-page .md-copy,
	.paper-page .figure-data,
	.paper-page .figure-tip {
		display: none !important;
	}

	.paper-page .page-scroll {
		padding: 0;
		overflow: visible;
		container-type: inline-size;
		-webkit-mask-image: none !important;
		mask-image: none !important;
	}

	.paper {
		display: block;
		padding: 0;
	}

	.paper-hero {
		height: auto;
		transform: none !important;
	}

	.paper-hero .figure-art {
		height: auto;
	}

	.paper-head {
		margin-bottom: var(--s5);
	}

	.paper-title {
		max-width: none;
		font-size: 24pt;
		line-height: 1.2;
	}

	.paper-brief {
		padding: var(--s4) var(--s5);
		border: 1px solid var(--border);
		background: none;
	}

	.paper-body,
	.paper-end,
	.paper-abstract p {
		font-size: 10.5pt;
		line-height: 1.5;
	}

	.paper-column .markdown .md-h2 {
		margin-top: var(--s6);
		font-size: 15pt;
	}

	.paper-column .markdown .md-h3 {
		font-size: 12pt;
	}

	.paper-page :is(h2, h3, figcaption) {
		break-after: avoid;
	}

	.paper-page :is(figure, .md-math, .md-table, .paper-brief, .paper-author-card, .paper-references li, .paper-version-list li) {
		break-inside: avoid;
	}

	/* A flowchart taller than a page shrinks to fit one. */
	.paper-page .md-flow {
		overflow: visible;
		break-inside: avoid;
	}

	.paper-page .md-flow .flow {
		width: auto;
		max-width: 100%;
		height: auto;
		max-height: 150mm;
	}

	.paper-end {
		margin-top: var(--s6);
	}

	.paper-end > section {
		margin-bottom: var(--s6);
	}

	/* Links read as text; where they lead is written out in the
	   references. */
	.paper-page a {
		--underline-rest: transparent;
		background: none;
		color: inherit;
	}

	.paper-cite a,
	.paper-body .md-fn-ref a {
		color: inherit;
	}
}
