/* ReFindit - one stylesheet for every page (2026-11). No framework, no web fonts. */

:root {
	--ink: #1d2433;
	--ink-soft: #4b5568;
	--ink-faint: #7a8396;
	--line: #dfe3ea;
	--line-strong: #c4cad6;
	--paper: #ffffff;
	--page: #f5f7fa;
	--brand: #2f5fae;
	--brand-dark: #22468a;
	--brand-tint: #eaf0fb;
	--accent: #f2b705;
	--link: #1f55b8;
	--title: #1a3f8f;
	--authors: #1d7a46;
	--danger: #b3261e;
	--radius: 10px;
	--radius-small: 6px;
	--shadow: 0 1px 2px rgba(20, 30, 50, 0.06), 0 4px 16px rgba(20, 30, 50, 0.06);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--wrap: 1180px;
}

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

[hidden] {
	display: none !important;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--page);
	color: var(--ink);
	font: 16px/1.55 var(--font);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

main {
	flex: 1;
}

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
}

code, pre {
	font-family: var(--mono);
	font-size: 0.88em;
}

:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- header and footer ---------- */

.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: 68px;
	flex-wrap: wrap;
}

.brand {
	display: flex;
	align-items: center;
	padding: 8px 0;
}

.brand img {
	display: block;
	width: 158px;
	height: auto;
}

.site-nav, .related {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.site-nav {
	flex: 1;
}

.site-nav a, .related a {
	padding: 6px 12px;
	border-radius: var(--radius-small);
	color: var(--ink-soft);
	font-size: 15px;
	font-weight: 500;
}

.site-nav a:hover, .related a:hover {
	background: var(--page);
	color: var(--ink);
	text-decoration: none;
}

.site-nav a[aria-current="page"] {
	background: var(--brand-tint);
	color: var(--brand-dark);
}

.related a {
	font-size: 14px;
	color: var(--ink-faint);
}

.related a::after {
	content: " ↗";
	font-size: 0.85em;
}

.site-footer {
	margin-top: 56px;
	border-top: 1px solid var(--line);
	background: var(--paper);
	color: var(--ink-faint);
	font-size: 14px;
}

.footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 18px;
	padding-bottom: 18px;
}

.powered {
	display: flex;
	align-items: center;
	gap: 10px;
}

.powered img {
	display: block;
	width: 104px;
	height: auto;
}

.footer-links {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
}

.footer-links a {
	color: var(--ink-faint);
}

/* ---------- buttons and inputs ---------- */

input[type="text"] {
	width: 100%;
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-small);
	background: var(--paper);
	color: var(--ink);
	font: inherit;
	font-size: 16px;
}

input[type="text"]:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(47, 95, 174, 0.18);
}

input[type="text"]:disabled {
	background: var(--page);
	color: var(--ink-faint);
}

input::placeholder {
	color: #9aa2b1;
}

.button, button.button, input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 22px;
	border: 1px solid var(--brand);
	border-radius: var(--radius-small);
	background: var(--brand);
	color: #ffffff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

input[type="submit"]:hover, .button:hover {
	background: var(--brand-dark);
	border-color: var(--brand-dark);
	text-decoration: none;
}

/* client.js marks the button while a search runs */
input[type="submit"].blue_button {
	background: var(--brand-tint);
	color: var(--brand-dark);
	border-color: var(--brand-tint);
	cursor: progress;
}

.small-button {
	height: 30px;
	padding: 0 12px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-small);
	background: var(--paper);
	color: var(--ink-soft);
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.small-button:hover {
	border-color: var(--brand);
	color: var(--brand-dark);
}

.link-button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--link);
	font: inherit;
	cursor: pointer;
}

.link-button:hover {
	text-decoration: underline;
}

/* ---------- home: search ---------- */

.hero {
	padding: 40px 0 8px;
	text-align: center;
}

.hero h1 {
	margin: 0 0 6px;
	font-size: 30px;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.hero p {
	margin: 0 auto;
	max-width: 640px;
	color: var(--ink-soft);
}

.search-card {
	max-width: 860px;
	margin: 26px auto 0;
	padding: 26px 28px 20px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.search_row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
}

.search_row .inputs {
	flex: 1;
	min-width: 0;
}

#search label {
	display: block;
	margin-bottom: 5px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink-soft);
}

#advanced_fields {
	display: grid;
	grid-template-columns: 2fr 0.8fr 2fr 2fr;
	gap: 10px;
}

#go {
	min-width: 120px;
}

.mode_row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 16px;
	margin: 12px 0 18px;
	font-size: 14px;
}

#mode::before {
	content: "▸ ";
}

#mode[aria-expanded="true"]::before {
	content: "◂ ";
}

#advanced_tip {
	color: var(--ink-faint);
}

#advanced_tip.working {
	color: var(--brand);
	animation: pulse 0.8s ease-in-out infinite alternate;
}

.sources_row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
}

.sources_label {
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-faint);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

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

#queries {
	max-width: 860px;
	margin: 10px auto 0;
	font-size: 13px;
	color: var(--ink-faint);
	text-align: right;
}

/* ---------- source colours (chips, badges, "more" links) ---------- */

.source {
	--chip-bg: #eef0f4;
	--chip-fg: #39414f;
	--chip-line: #c9ced8;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border: 1px solid var(--chip-line);
	border-radius: 999px;
	background: var(--chip-bg);
	color: var(--chip-fg);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
}

.CrossRef { --chip-bg: #fde6da; --chip-fg: #8a3a12; --chip-line: #f2b896; }
.OpenAlex { --chip-bg: #ffe8c7; --chip-fg: #7d4a00; --chip-line: #f5c27a; }
.DataCite { --chip-bg: #d6eff9; --chip-fg: #0b5a78; --chip-line: #8fd0ea; }
.PubMed { --chip-bg: #dcf1dc; --chip-fg: #2a6a2a; --chip-line: #a3d6a3; }
.Mendeley { --chip-bg: #e8e0fb; --chip-fg: #4f2f9a; --chip-line: #c4b1f2; }
.BHLarticles { --chip-bg: #fdf4cf; --chip-fg: #6c5600; --chip-line: #ecd781; }
.BHLbooks { --chip-bg: #fbe0e1; --chip-fg: #8a2a31; --chip-line: #efb0b4; }
.GNUB { --chip-bg: #e7e9fb; --chip-fg: #353f8f; --chip-line: #babff0; }

a.source:hover {
	text-decoration: none;
	border-color: var(--chip-fg);
}

/* the switches in the search form */
#search button.source {
	cursor: pointer;
}

#search button.source .count {
	font-weight: 500;
	opacity: 0.85;
}

#search button.source.off {
	background: var(--paper);
	border-style: dashed;
	border-color: var(--line-strong);
	color: var(--ink-faint);
	font-weight: 500;
	text-decoration: line-through;
}

#search button.source.none {
	opacity: 0.55;
}

#search button.source.waiting {
	animation: pulse 0.9s ease-in-out infinite alternate;
}

#search button.source.failed {
	border-color: var(--danger);
	background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(179, 38, 30, 0.12) 6px 12px);
	cursor: pointer;
}

#search button.source.failed .count {
	color: var(--danger);
}

@keyframes pulse {
	from { opacity: 0.4; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	#search button.source.waiting, #advanced_tip.working {
		animation: none;
	}
}

/* ---------- home: results ---------- */

#results_bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 14px;
	margin-top: 34px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
	font-size: 14px;
}

#status {
	flex: 1;
	min-width: 220px;
	color: var(--ink-soft);
	font-weight: 500;
}

#status.none {
	color: var(--danger);
}

#export_all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ink-faint);
}

.style-picker {
	display: flex;
	align-items: center;
	gap: 8px;
}

.style-picker label {
	color: var(--ink-faint);
	white-space: nowrap;
}

#style {
	width: 300px;
	height: 36px;
	font-size: 14px;
}

#results {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 16px;
}

.result {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 24px;
	padding: 20px 22px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.result:hover, .result:focus-within {
	border-color: var(--line-strong);
	box-shadow: var(--shadow);
}

.result:focus {
	outline: none;
	border-color: var(--brand);
}

.ref {
	min-width: 0;
	font-size: 14px;
	color: var(--ink-soft);
	overflow-wrap: anywhere;
}

.ref .title {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--title);
}

.ref .title.blue {
	color: var(--ink);
}

.ref .authors {
	color: var(--authors);
	font-size: 14px;
}

.ref .href {
	font-size: 13px;
	color: var(--link);
}

.relation {
	font-size: 13px;
}

.relation::first-letter {
	text-transform: uppercase;
}

.plaintext {
	margin-top: 4px;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin-top: 12px;
}

.tags .source {
	font-size: 12px;
	padding: 2px 9px;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 9px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	color: var(--ink-soft);
	white-space: nowrap;
}

.badge.oa {
	border-color: #f0b44c;
	color: #8a5200;
	background: #fff6e5;
}

.info_page {
	font-size: 13px;
}

.pubLogo {
	max-height: 22px;
	width: auto;
	opacity: 0.7;
}

.toolbox {
	padding-left: 24px;
	border-left: 1px solid var(--line);
	font-size: 13px;
	color: var(--ink-soft);
	overflow-wrap: anywhere;
}

.formatted:empty {
	display: none;
}

.formatted.hint {
	color: var(--ink-faint);
}

.formatted .csl-left-margin {
	display: none;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.actions:first-child {
	margin-top: 0;
}

.actions button, #export_all button {
	height: 28px;
	padding: 0 11px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-small);
	background: var(--paper);
	color: var(--ink-soft);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.actions button:hover, #export_all button:hover {
	border-color: var(--brand);
	color: var(--brand-dark);
}

#more {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}

/* ---------- text pages (about, code, contacts, API) ---------- */

.page-head {
	padding: 40px 0 6px;
}

.page-head h1 {
	margin: 0;
	font-size: 30px;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.page-head .lead {
	margin: 8px 0 0;
	max-width: 720px;
	font-size: 18px;
	color: var(--ink-soft);
}

.prose {
	max-width: 820px;
}

.prose h2 {
	margin: 40px 0 10px;
	font-size: 22px;
	line-height: 1.3;
}

.prose h3 {
	margin: 28px 0 8px;
	font-size: 17px;
}

.prose p, .prose li {
	color: #2c3445;
}

.card {
	margin-top: 22px;
	padding: 22px 24px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.card > :first-child {
	margin-top: 0;
}

.card > :last-child {
	margin-bottom: 0;
}

.steps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin: 22px 0 0;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.steps li {
	padding: 18px 20px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	counter-increment: step;
}

.steps li::before {
	content: counter(step);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-bottom: 8px;
	border-radius: 50%;
	background: var(--brand-tint);
	color: var(--brand-dark);
	font-weight: 700;
	font-size: 14px;
}

.steps strong {
	display: block;
	margin-bottom: 4px;
}

.source-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.funding {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
}

.funding img {
	max-height: 48px;
	width: auto;
}

/* contacts */
.people {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	margin-top: 24px;
}

.person {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	padding: 22px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.person .photo {
	flex: none;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	object-position: 50% 20%;
	background: var(--brand-tint);
}

.person .initials {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--brand-dark);
	font-size: 24px;
	font-weight: 700;
}

.person h2 {
	margin: 0;
	font-size: 18px;
}

.person .role {
	margin: 2px 0 10px;
	color: var(--ink-faint);
	font-size: 14px;
}

.person p {
	margin: 0;
	font-size: 15px;
}

.address {
	font-style: normal;
	line-height: 1.7;
}

/* API reference */
.api-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.api-nav a {
	display: inline-block;
	padding: 5px 12px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: var(--paper);
	font-size: 14px;
	font-weight: 500;
}

.endpoint {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 12px 0;
	padding: 10px 14px;
	background: #1e2533;
	border-radius: var(--radius-small);
	color: #e8ecf3;
	font-family: var(--mono);
	font-size: 14px;
	overflow-wrap: anywhere;
}

.method {
	padding: 1px 8px;
	border-radius: 4px;
	background: #3d6fd1;
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
}

.method.post {
	background: #1f8a55;
}

.params {
	width: 100%;
	margin: 10px 0;
	border-collapse: collapse;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius-small);
	font-size: 14px;
}

.params th, .params td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.params th {
	background: #f0f3f8;
	font-size: 13px;
	color: var(--ink-soft);
}

.params tr:last-child td {
	border-bottom: 0;
}

.params td:first-child {
	white-space: nowrap;
}

.params code, .prose p code, .prose li code {
	padding: 1px 5px;
	border-radius: 4px;
	background: #eef1f6;
	color: #24304a;
}

.example {
	display: block;
	margin: 8px 0;
	padding: 10px 14px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-left: 3px solid var(--brand);
	border-radius: var(--radius-small);
	font-family: var(--mono);
	font-size: 13px;
	overflow-wrap: anywhere;
}

pre.json {
	margin: 10px 0;
	padding: 14px 16px;
	background: #1e2533;
	border-radius: var(--radius-small);
	color: #e8ecf3;
	overflow-x: auto;
	line-height: 1.5;
}

.note {
	padding: 10px 14px;
	border-radius: var(--radius-small);
	background: #fff8e1;
	border: 1px solid #f3dc8c;
	font-size: 14px;
}

/* ---------- narrow screens ---------- */

@media (max-width: 980px) {
	.result {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.toolbox {
		padding: 14px 0 0;
		border-left: 0;
		border-top: 1px solid var(--line);
	}

	.formatted:empty + .actions {
		margin-top: 0;
	}

	.steps, .people {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 760px) {
	.wrap {
		padding: 0 16px;
	}

	.header-inner {
		gap: 4px 12px;
		padding-bottom: 8px;
	}

	.site-nav {
		order: 3;
		flex-basis: 100%;
		margin: 0 -12px;
	}

	.related {
		margin-left: auto;
	}

	.related a {
		padding: 6px 8px;
		font-size: 13px;
	}

	.hero {
		padding-top: 26px;
	}

	.hero h1, .page-head h1 {
		font-size: 24px;
	}

	.search-card {
		padding: 18px 16px 16px;
	}

	.search_row {
		flex-direction: column;
		align-items: stretch;
	}

	#advanced_fields {
		grid-template-columns: 1fr 1fr;
	}

	.sources_row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	#queries {
		text-align: left;
	}

	.style-picker {
		flex-basis: 100%;
	}

	#style {
		flex: 1;
		width: auto;
	}

	.result {
		padding: 16px;
	}

	.params td:first-child {
		white-space: normal;
	}
}

@media (max-width: 460px) {
	.brand img {
		width: 132px;
	}

	.related {
		display: none;
	}
}

/* ---------- citation style box (client.js: setUpStyleBox) ---------- */

.combo {
	position: relative;
}

#style_list {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	right: 0;
	width: max(100%, 420px);
	max-width: calc(100vw - 32px);
	max-height: min(420px, 60vh);
	margin: 0;
	padding: 4px;
	overflow-y: auto;
	list-style: none;
	background: var(--paper);
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-small);
	box-shadow: 0 8px 28px rgba(20, 30, 50, 0.18);
	font-size: 14px;
}

#style_list [role="option"] {
	padding: 7px 10px;
	border-radius: 4px;
	color: var(--ink);
	cursor: pointer;
	line-height: 1.35;
}

#style_list [role="option"][aria-selected="true"] {
	background: var(--brand-tint);
	color: var(--brand-dark);
}

#style_list [role="option"].current {
	font-weight: 600;
}

#style_list [role="option"].current::after {
	content: " ✓";
	color: var(--brand);
}

#style_list .group {
	padding: 8px 10px 4px;
	color: var(--ink-faint);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

#style_list .more {
	padding: 8px 10px;
	color: var(--ink-faint);
	font-size: 13px;
}

@media (max-width: 760px) {
	.style-picker .combo {
		flex: 1;
		min-width: 0;
	}

	#style {
		width: 100%;
	}

	#style_list {
		left: 0;
		right: auto;
		width: 100%;
	}
}
