:root {
	color-scheme: light dark;
	--hintergrund: #f6f5f2;
	--flaeche: #ffffff;
	--text: #1d1d1f;
	--leise: #5f5f66;
	--rand: #d8d6d0;
	--akzent: #1f6f5c;
	--akzent-text: #ffffff;
	--fehler: #b3261e;
}

@media (prefers-color-scheme: dark) {
	:root {
		--hintergrund: #161617;
		--flaeche: #222224;
		--text: #ececee;
		--leise: #a2a2a8;
		--rand: #3a3a3e;
		--akzent: #5cc2a5;
		--akzent-text: #0f1f1a;
		--fehler: #ff8a80;
	}
}

* {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

body {
	margin: 0;
	background: var(--hintergrund);
	color: var(--text);
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	-webkit-text-size-adjust: 100%;
}

main {
	max-width: 40rem;
	margin: 0 auto;
	padding: 1.5rem 1rem 3rem;
}

h1 {
	font-size: 1.75rem;
	line-height: 1.2;
	margin: 0 0 0.25rem;
}

.einleitung {
	margin: 0 0 1.5rem;
	color: var(--leise);
}

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

/* Formular */

.formular {
	display: grid;
	gap: 1.25rem;
	padding: 1rem;
	background: var(--flaeche);
	border: 1px solid var(--rand);
	border-radius: 12px;
}

.feld label {
	display: block;
	margin-bottom: 0.3rem;
	font-weight: 600;
}

/* Mindestens 16px, sonst zoomt iOS beim Antippen ins Feld. */
.feld input[type="text"],
.feld input[type="number"] {
	width: 100%;
	min-height: 44px;
	padding: 0.6rem 0.75rem;
	font: inherit;
	font-size: 1rem;
	color: var(--text);
	background: var(--hintergrund);
	border: 1px solid var(--rand);
	border-radius: 8px;
}

.feld input[type="number"] {
	max-width: 8rem;
}

.feld input[aria-invalid="true"] {
	border-color: var(--fehler);
}

.feld-haken {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 44px;
}

.feld-haken input {
	width: 1.4rem;
	height: 1.4rem;
	margin: 0;
	accent-color: var(--akzent);
}

.feld-haken label {
	margin: 0;
}

.hinweis {
	margin: 0.3rem 0 0;
	font-size: 0.875rem;
	color: var(--leise);
}

.errorlist {
	margin: 0.3rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
	color: var(--fehler);
}

button {
	min-height: 44px;
	padding: 0.6rem 1.1rem;
	font: inherit;
	font-weight: 600;
	color: var(--akzent-text);
	background: var(--akzent);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.formular button {
	width: 100%;
}

@media (min-width: 30rem) {
	.formular button {
		width: auto;
		justify-self: start;
	}
}

/* Ergebnis */

.ergebnis {
	margin-top: 2rem;
}

/* Bleibt beim Scrollen durch lange Listen oben, samt Kopier-Knopf. */
.ergebnis-kopf {
	position: sticky;
	top: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	padding: 0.5rem 0;
	background: var(--hintergrund);
}

.ergebnis-kopf h2 {
	margin: 0 auto 0 0;
	font-size: 1.25rem;
}

/* Eigene Zeile unter Überschrift und Knopf, sonst rutscht der Knopf
   in schmalen Fenstern unter die Meldung. */
.meldung {
	order: 1;
	flex-basis: 100%;
	font-size: 0.875rem;
	color: var(--leise);
}

.meldung:empty {
	display: none;
}

.ergebnis pre {
	margin: 0.5rem 0 0;
	padding: 1rem;
	font: 0.95rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	background: var(--flaeche);
	border: 1px solid var(--rand);
	border-radius: 12px;
}

/* Rechtstexte */

.rechtstext h2 {
	margin: 2rem 0 0.5rem;
	font-size: 1.15rem;
	line-height: 1.3;
}

.rechtstext p,
.rechtstext ul {
	margin: 0 0 0.75rem;
}

.rechtstext ul {
	padding-left: 1.25rem;
}

.kurzfassung {
	padding: 1rem;
	background: var(--flaeche);
	border: 1px solid var(--rand);
	border-radius: 12px;
}

.stand {
	margin-top: 2rem;
	font-size: 0.875rem;
	color: var(--leise);
}

a {
	color: var(--akzent);
}

/* Fußzeile */

.fuss {
	max-width: 40rem;
	margin: 0 auto;
	padding: 0 1rem 2rem;
	font-size: 0.875rem;
}

/* Linie an der Leiste statt am Rahmen, damit sie bündig mit dem
   Inhalt darüber abschließt. */
.fuss nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--rand);
}

/* Fingerfreundliche Höhe, ohne die Zeile optisch aufzublähen. */
.fuss a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--leise);
}

.fuss a[aria-current="page"] {
	color: var(--text);
	text-decoration: none;
}
