.jr {
	--jr-red: #8f1d2c;
	--jr-green: #285741;
	--jr-gold: #c6983f;
	--jr-ink: #2d2926;
	--jr-paper: #fffaf0;
}

.jr-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin: 0 0 2rem;
	padding: clamp(1.2rem, 4vw, 2rem);
	border: 1px solid #ddcfbc;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 18px 50px rgba(75, 48, 31, .08);
}

.jr-field {
	display: grid;
	gap: .4rem;
}

.jr-field-wide {
	grid-column: 1 / -1;
}

.jr-field label,
.jr-theme-picker legend {
	font-weight: 750;
}

.jr-field input,
.jr-field select {
	width: 100%;
	min-height: 48px;
	padding: .7rem .8rem;
	border: 1px solid #aa9d8f;
	border-radius: 9px;
	background: #fff;
	color: var(--jr-ink);
	font: inherit;
}

.jr-field input:focus,
.jr-field select:focus {
	outline: 3px solid rgba(198, 152, 63, .35);
	outline-offset: 2px;
}

.jr-field small {
	color: #655e57;
}

.jr-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
}

.jr-form-status {
	color: #8b1627;
	font-weight: 700;
}

.jr-result {
	margin: 2rem 0 3rem;
	scroll-margin-top: 2rem;
}

.jr-result-paper {
	position: relative;
	overflow: hidden;
	padding: clamp(1.5rem, 5vw, 3rem);
	border: 1px solid rgba(143, 29, 44, .24);
	border-radius: 20px;
	background: radial-gradient(circle at 85% 15%, rgba(198, 152, 63, .15), transparent 30%), var(--jr-paper);
	box-shadow: 0 22px 60px rgba(75, 48, 31, .12);
}

.jr-result-paper h2 {
	margin: .25rem 0 1rem;
	font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.jr-to {
	margin: 0;
	color: var(--jr-red);
	font-size: 1.05rem;
	font-weight: 800;
}

.jr-result blockquote,
.jr-tag blockquote,
.jr-bank blockquote {
	white-space: pre-line;
}

.jr-result blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	font-family: Georgia, serif;
	font-size: clamp(1.18rem, 3vw, 1.55rem);
	font-style: italic;
	line-height: 1.65;
}

.jr-meta {
	margin: 1rem 0 0;
	color: #675c51;
	font-size: .86rem;
	text-transform: capitalize;
}

.jr-motif {
	position: absolute;
	top: .5rem;
	right: .6rem;
	width: clamp(110px, 24vw, 180px);
	height: auto;
	opacity: .24;
}

.jr-motif-line,
.jr-motif-branch,
.jr-motif-lantern {
	fill: none;
	stroke: var(--jr-red);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

.jr-motif-star {
	fill: var(--jr-gold);
}

.jr-result-actions,
.jr-tag-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .65rem;
	margin-top: 1rem;
}

.jr-result-actions button,
.jr-tag-actions button,
.jr-bank button {
	padding: .65rem .9rem;
	border: 1px solid #a99b8d;
	border-radius: 999px;
	background: #fff;
	color: var(--jr-ink);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.jr-result-actions button:hover,
.jr-result-actions button:focus-visible,
.jr-tag-actions button:hover,
.jr-tag-actions button:focus-visible,
.jr-bank button:hover,
.jr-bank button:focus-visible {
	border-color: var(--jr-red);
	outline: 2px solid rgba(143, 29, 44, .18);
}

.jr-live {
	min-height: 1.5em;
	color: var(--jr-green);
	font-weight: 700;
}

.jr-tags {
	margin: 3rem 0;
	padding: clamp(1.2rem, 4vw, 2rem);
	border-radius: 18px;
	background: #f4ede2;
	scroll-margin-top: 2rem;
}

.jr-tags-head {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	align-items: end;
	justify-content: space-between;
}

.jr-tags-head h2 {
	margin: .25rem 0 0;
}

.jr-theme-picker {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem 1rem;
	width: fit-content;
	margin: 1rem 0 0;
	padding: .7rem 1rem;
	border: 1px solid #cbbba8;
	border-radius: 10px;
}

.jr-theme-picker label {
	display: inline-flex;
	gap: .35rem;
	align-items: center;
}

.jr-print-sheet {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin-top: 1.2rem;
}

.jr-tag {
	position: relative;
	overflow: hidden;
	min-height: 220px;
	padding: 1.2rem 1.25rem 1rem;
	border: 1px dashed #88796a;
	border-radius: 14px;
	background: #fffdf7;
}

.jr-tag::before {
	position: absolute;
	top: 12px;
	left: 12px;
	width: 12px;
	height: 12px;
	border: 1px solid #88796a;
	border-radius: 50%;
	background: #fff;
	content: "";
}

.jr-tag-gran {
	--jr-red: #285741;
	--jr-gold: #8f1d2c;
}

.jr-tag-sno {
	--jr-red: #477187;
	--jr-gold: #a6c4d1;
}

.jr-tag .jr-motif {
	top: .2rem;
	right: .2rem;
	width: 125px;
}

.jr-tag-to {
	margin: 1.2rem 0 .5rem;
	color: var(--jr-red);
	font-weight: 800;
}

.jr-tag blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	font-family: Georgia, serif;
	font-size: .93rem;
	font-style: italic;
	line-height: 1.45;
}

.jr-tag-from {
	margin: 1rem 0 0;
	font-size: .85rem;
}

.jr-tag-remove {
	position: absolute;
	top: .35rem;
	right: .35rem;
	display: grid;
	width: 30px;
	height: 30px;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .85);
	font-size: 1.2rem;
	cursor: pointer;
}

.jr-bank {
	margin: 4rem 0 1rem;
	color: #f6f0e7;
}

.jr-bank > h2 {
	margin: .3rem 0 .5rem;
	color: #fff0d3;
}

.jr-bank > p {
	color: #f6f0e7;
}

.jr-bank > .tomten-opt-eyebrow {
	color: #f3c968;
}

.jr-bank-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .7rem;
	margin-top: 1.4rem;
}

.jr-bank details {
	padding: .9rem 1rem;
	border: 1px solid #ddd1c4;
	border-radius: 12px;
	background: #fff;
	color: var(--jr-ink);
}

.jr-bank details[open] {
	grid-column: 1 / -1;
}

.jr-bank summary {
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	font-weight: 750;
	cursor: pointer;
}

.jr-bank summary span {
	color: #776c61;
	font-size: .82rem;
	font-weight: 600;
}

.jr-bank blockquote {
	margin: 1rem 0;
	padding-left: 1rem;
	border-left: 3px solid var(--jr-gold);
	font-family: Georgia, serif;
	font-style: italic;
}

.jr-bank-rhymes {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 1.5rem;
}

.jr-noscript {
	padding: 1rem;
	border-left: 4px solid var(--jr-red);
	background: #fff4df;
}

@media (max-width: 640px) {
	.jr-form,
	.jr-print-sheet,
	.jr-bank-grid,
	.jr-bank-rhymes {
		grid-template-columns: 1fr;
	}

	.jr-field-wide {
		grid-column: auto;
	}

	.jr-result-paper {
		padding-top: 4.3rem;
	}

	.jr-tag {
		min-height: 205px;
	}
}

@media print {
	body * {
		visibility: hidden !important;
	}

	.jr-tags,
	.jr-tags .jr-print-sheet,
	.jr-tags .jr-print-sheet * {
		visibility: visible !important;
	}

	.jr-tags {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		margin: 0;
		padding: 0;
		background: #fff;
	}

	.jr-tags-head,
	.jr-tags > p,
	.jr-tag-actions,
	.jr-tag-remove {
		display: none !important;
	}

	.jr-print-sheet {
		grid-template-columns: repeat(2, 1fr);
		gap: 8mm;
		margin: 0;
	}

	.jr-tag {
		min-height: 62mm;
		break-inside: avoid;
		box-shadow: none;
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}

	@page {
		size: A4;
		margin: 12mm;
	}
}
