:root {
	--grund: #f4f5f7;
	--karte: #ffffff;
	--text: #1c1f24;
	--leise: #5c6470;
	--linie: #d9dde3;
	--akzent: #2457c5;
	--akzent-text: #ffffff;
	--fehler: #b42318;
	--radius: 10px;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--grund: #121418;
		--karte: #1c1f25;
		--text: #e8eaee;
		--leise: #a0a8b4;
		--linie: #333943;
		--akzent: #7aa2ff;
		--akzent-text: #0d1220;
		--fehler: #ff8a80;
	}
}

* { box-sizing: border-box; }

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

.kopf, main {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 16px;
}

.kopf { padding-top: 2rem; }
.kopf h1 { margin: 0; font-size: 1.6rem; }
.kopf p { margin: 0.25rem 0 1.25rem; color: var(--leise); }

.unsichtbar {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

/* Reiter: auf dem Handy waagerecht scrollbar statt umbrechen */
.typen {
	display: flex;
	gap: 0.4rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	margin-bottom: 0.75rem;
	scrollbar-width: thin;
}

.typen button {
	flex: none;
	border: 1px solid var(--linie);
	background: var(--karte);
	color: var(--text);
	border-radius: 999px;
	padding: 0.4rem 0.9rem;
	font: inherit;
	cursor: pointer;
}

.typen button[aria-selected="true"] {
	background: var(--akzent);
	border-color: var(--akzent);
	color: var(--akzent-text);
}

.raster {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
	gap: 1rem;
	align-items: start;
	padding-bottom: 3rem;
}

@media (max-width: 760px) {
	.raster { grid-template-columns: minmax(0, 1fr); }
}

.karte {
	background: var(--karte);
	border: 1px solid var(--linie);
	border-radius: var(--radius);
	padding: 1.25rem;
}

.ausgabe { position: sticky; top: 1rem; }
@media (max-width: 760px) { .ausgabe { position: static; } }

.info { margin: 0 0 1rem; color: var(--leise); }

.felder {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem 1rem;
}

@media (max-width: 480px) {
	.felder { grid-template-columns: minmax(0, 1fr); }
}

.feld { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.voll { grid-column: 1 / -1; }

.feld label { font-size: 0.9rem; font-weight: 600; }

.feld.haken { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.feld.haken label { font-weight: 400; }
.feld.haken .fehler { flex-basis: 100%; }

input, select, textarea {
	font: inherit;
	color: inherit;
	background: var(--grund);
	border: 1px solid var(--linie);
	border-radius: 6px;
	padding: 0.45rem 0.6rem;
	width: 100%;
}

input[type="checkbox"] { width: auto; }
input[type="color"] { height: 2.4rem; padding: 0.15rem; }
textarea { resize: vertical; }

input:focus, select:focus, textarea:focus, button:focus-visible, summary:focus-visible {
	outline: 2px solid var(--akzent);
	outline-offset: 1px;
}

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

.fehler { color: var(--fehler); min-height: 0; }
.fehler:empty { display: none; }
.hinweis { color: var(--leise); font-size: 0.9rem; margin: 0.75rem 0 0; }
.hinweis:empty { display: none; }

details { margin-top: 1rem; }
summary { cursor: pointer; font-weight: 600; }
details > .felder { margin-top: 0.75rem; }

.vorschau {
	aspect-ratio: 1;
	display: grid;
	place-items: center;
	border-radius: 6px;
	/* Karomuster zeigt einen transparenten Hintergrund */
	background: repeating-conic-gradient(#0000000d 0 25%, transparent 0 50%) 0 0 / 16px 16px;
}

.vorschau svg { width: 100%; height: 100%; display: block; }
.vorschau .leer { color: var(--leise); text-align: center; padding: 1rem; margin: 0; }

.groesse { font-size: 0.85rem; color: var(--leise); text-align: center; margin: 0.5rem 0; min-height: 1.3em; }

.knoepfe {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

button {
	font: inherit;
	border: 1px solid var(--linie);
	background: var(--grund);
	color: var(--text);
	border-radius: 6px;
	padding: 0.5rem 0.75rem;
	cursor: pointer;
}

button.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.klein { padding: 0.2rem 0.6rem; font-size: 0.85rem; margin-left: auto; }

pre {
	white-space: pre-wrap;
	word-break: break-all;
	font-size: 0.8rem;
	background: var(--grund);
	border-radius: 6px;
	padding: 0.6rem;
	margin: 0.5rem 0 0;
}

.tipp { font-size: 0.85rem; color: var(--leise); margin: 1rem 0 0; }
