/**
 * Demo «Mensch gegen Automat».
 *
 * Links ein Beleg, der wie ein Beleg aussieht; rechts ein Formular, das wie
 * ein Erfassungsformular aussieht. Beides bewusst nuechtern – der Reiz liegt
 * in der Arbeit, nicht in der Gestaltung.
 */

/* Auch fuer das gemeinsame Fenster: Die Aktionsleiste am unteren Rand liegt
   ausserhalb von .aeb, und ohne diese Zeile waere var(--aeb-akzent) dort nicht
   aufloesbar – der Knopf bliebe weiss auf weiss. */
.aeb,
.aefe[data-ae-fenster="belege"] {
	--aeb-akzent: var(--ae-akzent, #E71E62);
	--aeb-akzent-tief: var(--ae-akzent-tief, #B3124A);
	--aeb-dunkel: var(--ae-dunkel, #36474F);
	--aeb-tiefe: var(--ae-tiefe, #263238);
	--aeb-linie: var(--ae-linie, #CFD8DC);
	--aeb-getoent: var(--ae-getoent, #ECEFF1);
	--aeb-grund: var(--ae-grund, #FFFFFF);
	--aeb-still: #6b7a82;
	--aeb-leise: #8b979d;

	color: var(--aeb-dunkel);
	font-size: 16px;
	line-height: 1.55;
	text-align: left;
}

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

.aeb-kopf { margin-bottom: 16px; }
.aeb-kopf h3 { margin: 0 0 5px; font-size: 24px; }
.aeb-sub { margin: 0; color: var(--aeb-still); }

.aeb-buehne {
	border: 1px solid var(--aeb-linie);
	border-radius: 12px;
	background: var(--aeb-grund);
	padding: 22px;
}

.aeb-hinweis { font-size: 12.5px; color: var(--aeb-still); margin: 0 0 16px; }

/* ---------------- Startbild ---------------- */

.aeb-vorschau {
	max-width: 460px;
	margin: 0 auto 20px;
	transform: rotate(-1.2deg);
}
.aeb-beleg--klein { opacity: .85; pointer-events: none; }

.aeb-start { text-align: center; }
.aeb-start .aeb-hinweis { text-align: left; }

/* ---------------- Die beiden Spuren ---------------- */

.aeb-spur {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 6px 18px;
	align-items: center;
	margin-bottom: 22px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--aeb-linie);
}

.aeb-spurzeile {
	display: flex;
	align-items: center;
	gap: 12px;
	grid-column: 1;
}

.aeb-spurname { font-size: 13px; font-weight: 700; min-width: 96px; }
.aeb-spur--automat .aeb-spurname { color: var(--aeb-akzent-tief); }

.aeb-bahn { display: flex; gap: 4px; flex: 1 1 auto; }
.aeb-feld {
	flex: 1 1 auto;
	height: 9px;
	border-radius: 2px;
	background: var(--aeb-getoent);
	transition: background .25s ease;
}
.aeb-spur--sie .aeb-feld--voll { background: var(--aeb-dunkel); }
.aeb-spur--automat .aeb-feld--voll { background: var(--aeb-akzent); }

.aeb-spurzahl { font-size: 12.5px; color: var(--aeb-still); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }

.aeb-uhr {
	grid-column: 2;
	grid-row: 1 / span 2;
	font-size: 30px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--aeb-dunkel);
	align-self: center;
}

/* ---------------- Die Arena ---------------- */

.aeb-arena {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

/* ---------------- Der Beleg ---------------- */

.aeb-beleg {
	border: 1px solid var(--aeb-linie);
	border-radius: 4px;
	background: #FEFEFC;
	padding: 22px 24px;
	box-shadow: 0 4px 18px rgba(38, 50, 56, .07);
	font-size: 13.5px;
	line-height: 1.5;
}

.aeb-belegkopf {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	border-bottom: 1px solid var(--aeb-linie);
	padding-bottom: 14px;
	margin-bottom: 14px;
}
.aeb-lieferant { display: block; font-size: 15px; }
.aeb-adresse, .aeb-uid { display: block; font-size: 12px; color: var(--aeb-still); }
.aeb-uid { margin-top: 3px; font-variant-numeric: tabular-nums; }

.aeb-stempel {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .16em;
	color: var(--aeb-leise);
	border: 1.5px solid var(--aeb-leise);
	border-radius: 3px;
	padding: 3px 9px;
	white-space: nowrap;
}

.aeb-belegmeta {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 14px;
	margin: 0 0 16px;
	font-size: 12.5px;
}
.aeb-belegmeta dt { color: var(--aeb-still); }
.aeb-belegmeta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.aeb-positionen, .aeb-summe { width: 100%; border-collapse: collapse; }
.aeb-positionen td { padding: 5px 0; border-bottom: 1px dotted var(--aeb-linie); }
.aeb-zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.aeb-summe { margin-top: 12px; }
.aeb-summe td { padding: 3px 0; color: var(--aeb-still); }
.aeb-total td {
	padding-top: 9px;
	border-top: 2px solid var(--aeb-dunkel);
	font-weight: 700;
	font-size: 15px;
	color: var(--aeb-dunkel);
}

/* ---------------- Das Formular ---------------- */

.aeb-formular {
	border: 1px solid var(--aeb-linie);
	border-radius: 10px;
	padding: 20px 22px;
	background: #FAFBFC;
}
.aeb-formularkopf { margin: 0 0 16px; font-size: 13px; font-weight: 700; color: var(--aeb-still); }

.aeb-form { display: grid; gap: 11px; }
.aeb-feldbox { display: block; }
.aeb-feldname { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }
.aeb-feldbox input {
	width: 100%;
	border: 1px solid var(--aeb-linie);
	border-radius: 7px;
	padding: 9px 12px;
	font: inherit;
	font-size: 14.5px;
	color: var(--aeb-dunkel);
	background: var(--aeb-grund);
}
.aeb-feldbox input:focus {
	outline: 2px solid var(--aeb-akzent);
	outline-offset: 1px;
	border-color: transparent;
}

.aeb-hilfe { margin: 0; font-size: 11.5px; color: var(--aeb-leise); line-height: 1.5; }
.aeb-leiste { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* ---------------- Ergebnis ---------------- */

.aeb-ergebnis h4 { margin: 0 0 20px; font-size: 24px; }
.aeb-ergebnis h5 { margin: 22px 0 8px; font-size: 15px; }

.aeb-gegen {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 22px;
}

.aeb-partei {
	border: 1px solid var(--aeb-linie);
	border-radius: 10px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.aeb-partei--automat { border-color: rgba(231, 30, 98, .4); background: rgba(231, 30, 98, .04); }

.aeb-parteiname { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--aeb-still); }
.aeb-parteizahl { font-size: 44px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.aeb-partei--automat .aeb-parteizahl { color: var(--aeb-akzent); }
.aeb-parteitext { font-size: 13px; color: var(--aeb-still); }
.aeb-parteimeta { font-size: 12.5px; color: var(--aeb-leise); margin-top: 6px; font-variant-numeric: tabular-nums; }

.aeb-satz { margin: 0 0 10px; font-size: 16px; }
.aeb-hochrechnung {
	margin: 16px 0;
	padding: 14px 16px;
	background: var(--aeb-getoent);
	border-left: 3px solid var(--aeb-akzent);
	border-radius: 0 8px 8px 0;
	font-size: 15px;
	font-weight: 600;
}

.aeb-fehlerliste {
	border: 1px solid var(--aeb-linie);
	border-radius: 10px;
	padding: 16px 18px;
	margin: 18px 0;
}
.aeb-fehlerliste h5 { margin: 0 0 10px; font-size: 14px; }
.aeb-fehlerzeile {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 13px;
}
.aeb-fehlerfeld { color: var(--aeb-still); min-width: 190px; }
.aeb-fehlerfalsch { text-decoration: line-through; color: var(--aeb-akzent-tief); }
.aeb-fehlerpfeil { color: var(--aeb-leise); }
.aeb-fehlerrichtig { font-weight: 600; }

.aeb-ehrlich {
	margin: 18px 0;
	font-size: 15px;
	color: var(--aeb-still);
	border-left: 3px solid var(--aeb-linie);
	padding-left: 14px;
}

.aeb-klappe { border-top: 1px solid var(--aeb-linie); margin-top: 18px; }
.aeb-klappe > summary {
	cursor: pointer;
	padding: 12px 0;
	font-size: 14px;
	font-weight: 600;
	list-style: none;
}
.aeb-klappe > summary::-webkit-details-marker { display: none; }
.aeb-klappe > summary::before {
	content: "";
	display: inline-block;
	width: 0; height: 0;
	margin-right: 8px;
	border-left: 5px solid var(--aeb-akzent);
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transition: transform .18s ease;
}
.aeb-klappe[open] > summary::before { transform: rotate(90deg); }

.aeb-klappeninhalt { padding-bottom: 16px; display: grid; gap: 10px; }
.aeb-schritt {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 12px;
	font-size: 13.5px;
}
.aeb-schrittnr {
	grid-row: 1 / span 2;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 12px;
	color: var(--aeb-akzent);
	font-weight: 700;
	padding-top: 2px;
}
.aeb-schritt span:last-child { color: var(--aeb-still); }

.aeb-cta { border-top: 1px solid var(--aeb-linie); margin-top: 20px; padding-top: 18px; }
.aeb-cta h5 { margin: 0 0 6px; font-size: 17px; }
.aeb-cta p { margin: 0 0 4px; color: var(--aeb-still); }

/* ---------------- Knoepfe ---------------- */

.aeb-btn {
	display: inline-block;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	font-size: 15px;
	padding: 11px 20px;
	margin-top: 12px;
	text-decoration: none;
	transition: transform .12s ease, background .15s ease;
}
.aeb-btn:hover { transform: translateY(-1px); }
.aeb-btn--primary { background: var(--aeb-akzent); color: #fff; }
.aeb-btn--primary:hover { background: var(--aeb-akzent-tief); }
.aeb-btn--geist { background: transparent; color: var(--aeb-dunkel); border: 1px solid var(--aeb-linie); margin-left: 8px; }

/* ---------------- Schmalere Fenster ---------------- */

@media (max-width: 900px) {
	.aeb-arena { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.aeb-gegen { grid-template-columns: 1fr; }
	.aeb-uhr { grid-column: 1; grid-row: auto; font-size: 24px; }
	.aeb-spur { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
	.aeb-buehne { padding: 16px; }
	.aeb-beleg { padding: 16px 15px; font-size: 12.5px; }
	.aeb-spurname { min-width: 68px; font-size: 12px; }
	.aeb-parteizahl { font-size: 34px; }
	.aeb-fehlerfeld { min-width: 0; }
	.aeb-vorschau { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.aeb-btn:hover { transform: none; }
	.aeb-feld { transition: none; }
	.aeb-vorschau { transform: none; }
}
