/**
 * Stations-App.
 *
 * Gebaut fuer Handschuhe, Sonnenlicht und ein Handy in der einen Hand:
 * grosse Flaechen, hoher Kontrast, keine Aufklappmenues, kein
 * horizontales Scrollen.
 */

.ln-app {
	--ln-rot: #c62828;
	--ln-rot-hell: #d93b3c;
	--ln-gruen: #2e7d32;
	--ln-gelb: #ef6c00;
	--ln-grau: #5c6470;
	--ln-linie: #d7dae0;
	--ln-flaeche: #fff;
	--ln-text: #12161c;
	--ln-still: #f3f4f6;

	max-width: 720px;
	margin: 0 auto;
	padding: 0 14px 90px;
	color: var(--ln-text);
	font-size: 17px;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
}

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

/* --------------------------------------------------------------- Kopf */

.ln-kopf {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 0 14px;
	border-bottom: 2px solid var(--ln-linie);
	margin-bottom: 18px;
}

.ln-kopf-text { min-width: 0; flex: 1 1 auto; }
.ln-kopf h2 { margin: 0; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.ln-kopf p { margin: 3px 0 0; font-size: 14px; color: var(--ln-grau); }

.ln-zurueck {
	flex: 0 0 auto;
	width: 44px; height: 44px;
	font-size: 30px; line-height: 1;
	border: 1px solid var(--ln-linie);
	background: var(--ln-flaeche);
	border-radius: 10px;
	cursor: pointer;
	color: var(--ln-text);
}

/* ------------------------------------------------------------ Kacheln */

.ln-kacheln { display: grid; gap: 12px; grid-template-columns: 1fr; }

@media (min-width: 520px) {
	.ln-kacheln { grid-template-columns: 1fr 1fr; }
}

.ln-kachel {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-height: 84px;
	padding: 18px;
	text-align: left;
	background: var(--ln-flaeche);
	border: 2px solid var(--ln-linie);
	border-radius: 12px;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.ln-kachel:active { background: var(--ln-still); }
.ln-kachel-label { font-size: 18px; font-weight: 650; }
.ln-kachel-zeit { font-size: 14px; color: var(--ln-grau); }

/* ------------------------------------------------------------- Liste */

.ln-liste { list-style: none; margin: 0; padding: 0; }
.ln-liste li { margin-bottom: 10px; }

.ln-zeile {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 68px;
	padding: 12px 14px;
	background: var(--ln-flaeche);
	border: 2px solid var(--ln-linie);
	border-left-width: 6px;
	border-radius: 11px;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: left;
}

.ln-zeile:active { background: var(--ln-still); }
.ln-zeile.ln-status-offen { border-left-color: var(--ln-linie); }
.ln-zeile.ln-status-erfasst { border-left-color: var(--ln-gelb); }
.ln-zeile.ln-status-freigegeben { border-left-color: var(--ln-gruen); }
.ln-zeile.ln-status-ruecklauf { border-left-color: var(--ln-rot); }

.ln-nr {
	flex: 0 0 44px;
	height: 44px;
	display: grid;
	place-items: center;
	background: var(--ln-still);
	border-radius: 9px;
	font-weight: 700;
	font-size: 19px;
}

.ln-zeile-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ln-zeile-text strong { font-size: 16px; }
.ln-zeile-text small { font-size: 13px; color: var(--ln-grau); }

.ln-zeile-rechts {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 3px;
}

.ln-zeile-rechts small { font-size: 13px; color: var(--ln-grau); font-variant-numeric: tabular-nums; }

.ln-pille {
	font-size: 12px;
	font-weight: 650;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--ln-still);
	color: var(--ln-grau);
	white-space: nowrap;
}

.ln-pille-erfasst { background: #fdf0e3; color: #a04b00; }
.ln-pille-freigegeben { background: #e6f2e7; color: #1f5c22; }
.ln-pille-ruecklauf { background: #fbe9e9; color: #8f2020; }

/* -------------------------------------------------------------- Bloecke */

.ln-block {
	background: var(--ln-flaeche);
	border: 2px solid var(--ln-linie);
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 14px;
}

.ln-block-kopf {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.ln-block-kopf h3 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--ln-grau); }
.ln-limit { font-size: 14px; color: var(--ln-grau); font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- Uhr */

.ln-uhr { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.ln-uhr-zeit {
	flex: 1 1 130px;
	font-size: 52px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.02em;
	line-height: 1;
}

.ln-uhr-zeit.ln-ueber, .ln-ueber { color: var(--ln-rot); }

.ln-uhr-knoepfe { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }

.ln-uhr-knopf {
	min-width: 118px;
	min-height: 62px;
	font-size: 19px;
	font-weight: 700;
	font-family: inherit;
	color: #fff;
	background: var(--ln-gruen);
	border: 0;
	border-radius: 11px;
	cursor: pointer;
}

.ln-uhr-knopf.ln-laeuft { background: var(--ln-rot); }

/* -------------------------------------------------------------- Felder */

.ln-feld { display: block; margin-top: 14px; }
.ln-feld > span { display: block; font-size: 14px; color: var(--ln-grau); margin-bottom: 6px; }

.ln-feld input[type="text"], .ln-feld textarea {
	width: 100%;
	font: inherit;
	font-size: 17px; /* kleiner loest auf iOS einen Zoom aus */
	padding: 12px 13px;
	border: 2px solid var(--ln-linie);
	border-radius: 9px;
	background: #fff;
	color: var(--ln-text);
}

.ln-feld input:focus, .ln-feld textarea:focus {
	outline: none;
	border-color: var(--ln-rot);
}

/* ------------------------------------------------------------- Zaehler */

.ln-zaehler {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

.ln-zaehler-knopf {
	width: 62px; height: 62px;
	font-size: 30px;
	font-family: inherit;
	line-height: 1;
	border: 2px solid var(--ln-linie);
	background: var(--ln-still);
	border-radius: 11px;
	cursor: pointer;
	color: var(--ln-text);
	touch-action: manipulation;
}

.ln-zaehler-knopf:active { background: #e4e6ea; }
.ln-zaehler-knopf.ln-plus { background: #fbe9e9; border-color: #f0c4c4; color: var(--ln-rot); }

.ln-zaehler-wert {
	min-width: 56px;
	text-align: center;
	font-size: 34px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- Personen */

.ln-person {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 0;
	border-top: 1px solid var(--ln-linie);
}

.ln-person:first-of-type { border-top: 0; }
.ln-person-text { min-width: 0; display: flex; flex-direction: column; }
.ln-person-text strong { font-size: 16px; }
.ln-person-text small { font-size: 13px; color: var(--ln-grau); }

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

.ln-btn {
	display: inline-block;
	padding: 13px 20px;
	font: inherit;
	font-weight: 650;
	color: #fff;
	background: var(--ln-rot);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
}

.ln-btn:active { background: #ab2020; }
.ln-btn-weit { display: block; width: 100%; margin-top: 14px; }
.ln-btn-gross { min-height: 62px; font-size: 19px; }

.ln-btn-still {
	background: var(--ln-still);
	color: var(--ln-text);
	border: 2px solid var(--ln-linie);
}

.ln-btn-still:active { background: #e4e6ea; }

/* ------------------------------------------------------------- Matrix */

.ln-matrix-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ln-matrix {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.ln-matrix th, .ln-matrix td {
	padding: 9px 8px;
	border: 1px solid var(--ln-linie);
	text-align: center;
	vertical-align: middle;
}

.ln-matrix th {
	background: var(--ln-still);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--ln-grau);
}

.ln-matrix td:nth-child(2) { text-align: left; }
.ln-matrix td small { display: block; font-size: 12px; color: var(--ln-grau); }
.ln-nr-zelle { font-weight: 700; background: var(--ln-still); }

.ln-zelle.ln-status-offen { background: #fafbfc; }
.ln-zelle.ln-status-erfasst { background: #fdf6ed; }
.ln-zelle.ln-status-freigegeben { background: #eff7f0; }
.ln-zelle.ln-status-ruecklauf { background: #fdefef; }

.ln-zelle-knoepfe { display: flex; gap: 4px; justify-content: center; margin-top: 5px; }

.ln-mini {
	width: 30px; height: 30px;
	font-size: 14px;
	font-family: inherit;
	border: 1px solid var(--ln-linie);
	background: #fff;
	border-radius: 7px;
	cursor: pointer;
	line-height: 1;
}

.ln-mini-ok { color: var(--ln-gruen); border-color: #b9d8bb; }

.ln-summe-zelle strong { font-size: 18px; }
.ln-erg-bestanden .ln-summe-zelle { background: #eff7f0; }
.ln-erg-nicht_bestanden .ln-summe-zelle { background: #fdefef; }

/* ------------------------------------------------------------ Meldungen */

.ln-hinweis {
	background: var(--ln-still);
	border: 2px solid var(--ln-linie);
	border-radius: 12px;
	padding: 22px;
	text-align: center;
}

.ln-hinweis p { margin: 0 0 12px; }
.ln-hinweis p:last-child { margin-bottom: 0; }

.ln-ruecklauf {
	background: #fbe9e9;
	border: 2px solid #f0c4c4;
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 14px;
	font-size: 15px;
}

.ln-app-laden { padding: 40px 0; text-align: center; color: var(--ln-grau); }

.ln-queue {
	position: fixed;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	background: #12161c;
	color: #fff;
	font-size: 13px;
	padding: 8px 15px;
	border-radius: 999px;
	z-index: 40;
}

.ln-toast {
	position: fixed;
	left: 50%;
	bottom: 56px;
	transform: translateX(-50%);
	max-width: calc(100vw - 32px);
	background: var(--ln-gruen);
	color: #fff;
	padding: 12px 18px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	z-index: 50;
	box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
	transition: opacity .4s ease;
}

.ln-toast-warnung { background: var(--ln-gelb); }
.ln-toast-fehler { background: var(--ln-rot); }
.ln-toast-weg { opacity: 0; }

/* --------------------------------------------------------- Dunkelmodus */

@media (prefers-color-scheme: dark) {
	.ln-app {
		--ln-flaeche: #161b22;
		--ln-still: #21262d;
		--ln-linie: #333b45;
		--ln-text: #e8eaed;
		--ln-grau: #9aa4b2;
	}

	.ln-feld input[type="text"], .ln-feld textarea { background: #0d1117; color: var(--ln-text); }
	.ln-zaehler-knopf.ln-plus { background: #3a1f1f; border-color: #5a2c2c; color: #ff8a8a; }
	.ln-pille-erfasst { background: #3a2a14; color: #ffc06e; }
	.ln-pille-freigegeben { background: #17301a; color: #85d18b; }
	.ln-pille-ruecklauf { background: #3a1f1f; color: #ff9a9a; }
	.ln-zelle.ln-status-offen { background: #12161c; }
	.ln-zelle.ln-status-erfasst { background: #251d12; }
	.ln-zelle.ln-status-freigegeben { background: #132515; }
	.ln-zelle.ln-status-ruecklauf { background: #2a1717; }
	.ln-erg-bestanden .ln-summe-zelle { background: #132515; }
	.ln-erg-nicht_bestanden .ln-summe-zelle { background: #2a1717; }
	.ln-ruecklauf { background: #2a1717; border-color: #5a2c2c; }
	.ln-mini { background: var(--ln-flaeche); color: var(--ln-text); }
}

/* ------------------------------------------------------- Bedienbarkeit */

.ln-app button:focus-visible,
.ln-app input:focus-visible,
.ln-app textarea:focus-visible {
	outline: 3px solid var(--ln-rot-hell);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.ln-toast { transition: none; }
}

/* =====================================================================
   App-Rahmen: Inhalt plus feste Leiste unten
   ===================================================================== */

.ln-rahmen { padding-bottom: 4px; }

.ln-inhalt { padding-bottom: 12px; }

.ln-leiste {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	display: flex;
	background: var(--ln-flaeche);
	border-top: 1px solid var(--ln-linie);
	padding-bottom: env(safe-area-inset-bottom);
	z-index: 30;
}

.ln-leiste-knopf {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 9px 4px 8px;
	background: none;
	border: 0;
	border-top: 3px solid transparent;
	font: inherit;
	font-size: 11px;
	color: var(--ln-grau);
	cursor: pointer;
	min-height: 56px;
}

.ln-leiste-knopf.ln-aktiv {
	color: var(--ln-rot);
	border-top-color: var(--ln-rot);
}

.ln-leiste-symbol { font-size: 19px; line-height: 1; }

/* App-Modus: Platz fuer die Leiste, damit nichts verdeckt wird. */
.ln-app { padding-bottom: 86px; }

.ln-queue { bottom: 70px; }
.ln-toast { bottom: 112px; }

/* =====================================================================
   Anmeldung
   ===================================================================== */

.ln-tor {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 70svh;
	padding: 20px 0 40px;
}

.ln-tor-karte {
	width: 100%;
	max-width: 400px;
	background: var(--ln-flaeche);
	border: 2px solid var(--ln-linie);
	border-radius: 14px;
	padding: 26px 22px 22px;
}

.ln-tor-karte h1 {
	font-size: 23px;
	margin: 0 0 18px;
	line-height: 1.2;
}

.ln-tor-text { font-size: 15px; color: var(--ln-grau); margin: 0 0 18px; line-height: 1.5; }

.ln-marke {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 18px;
}

.ln-marke span {
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--ln-grau);
}

.ln-link-knopf {
	display: block;
	width: 100%;
	margin-top: 14px;
	padding: 10px;
	background: none;
	border: 0;
	font: inherit;
	font-size: 14px;
	color: var(--ln-grau);
	text-decoration: underline;
	cursor: pointer;
}

.ln-fehlerbox,
.ln-warnbox {
	border-radius: 9px;
	padding: 11px 13px;
	margin-bottom: 16px;
	font-size: 14.5px;
	line-height: 1.45;
}

.ln-fehlerbox { background: #fbe9e9; border: 1px solid #f0c4c4; color: #8f2020; }
.ln-warnbox { background: #fdf3e3; border: 1px solid #f0d9ae; color: #7a4a00; }

.ln-feld-hinweis {
	display: block;
	margin-top: 5px;
	font-size: 12.5px;
	color: var(--ln-grau);
}

.ln-feld input[type="email"],
.ln-feld input[type="password"],
.ln-feld input[type="date"],
.ln-feld select {
	width: 100%;
	font: inherit;
	font-size: 17px;
	padding: 12px 13px;
	border: 2px solid var(--ln-linie);
	border-radius: 9px;
	background: #fff;
	color: var(--ln-text);
}

.ln-feld select:focus,
.ln-feld input:focus { outline: none; border-color: var(--ln-rot); }

.ln-btn:disabled { opacity: .55; cursor: default; }

/* =====================================================================
   Verwaltung
   ===================================================================== */

.ln-reiter {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 14px;
	padding-bottom: 4px;
}

.ln-reiter-knopf {
	flex: 0 0 auto;
	padding: 9px 15px;
	background: var(--ln-still);
	border: 2px solid var(--ln-linie);
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--ln-grau);
	cursor: pointer;
	white-space: nowrap;
}

.ln-reiter-knopf.ln-aktiv {
	background: var(--ln-rot);
	border-color: var(--ln-rot);
	color: #fff;
}

.ln-abschnitt {
	margin: 22px 0 10px;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--ln-grau);
}

.ln-knopfzeile { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.ln-knopfzeile .ln-btn { flex: 1 1 auto; }

.ln-haken {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 2px;
	border-top: 1px solid var(--ln-linie);
	cursor: pointer;
	font-size: 15px;
}

.ln-haken:first-of-type { border-top: 0; }

.ln-haken input[type="checkbox"] {
	width: 22px; height: 22px;
	flex: 0 0 auto;
	margin-top: 1px;
	accent-color: var(--ln-rot);
}

.ln-haken small { color: var(--ln-grau); font-size: 13px; }

.ln-auswahlliste {
	max-height: 320px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	border: 2px solid var(--ln-linie);
	border-radius: 9px;
	padding: 4px 12px;
	margin: 12px 0;
}

.ln-minitabelle {
	width: 100%;
	border-collapse: collapse;
	margin-top: 12px;
	font-size: 14px;
}

.ln-minitabelle td {
	padding: 7px 6px;
	border-top: 1px solid var(--ln-linie);
	vertical-align: top;
}

.ln-minitabelle td:last-child { text-align: right; color: var(--ln-grau); }
.ln-minitabelle small { color: var(--ln-grau); }

.ln-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.ln-chip {
	background: var(--ln-still);
	border: 1px solid var(--ln-linie);
	border-radius: 999px;
	padding: 4px 11px;
	font-size: 13px;
}

.ln-text-klein { font-size: 14px; color: var(--ln-grau); margin: 0 0 12px; line-height: 1.5; }

.ln-kopf { position: relative; }
.ln-kopf .ln-mini { margin-left: auto; }

@media (prefers-color-scheme: dark) {
	.ln-feld input[type="email"],
	.ln-feld input[type="password"],
	.ln-feld input[type="date"],
	.ln-feld select { background: #0d1117; color: var(--ln-text); }

	.ln-fehlerbox { background: #2a1717; border-color: #5a2c2c; color: #ff9a9a; }
	.ln-warnbox { background: #251d12; border-color: #4a3a1e; color: #ffc06e; }
	.ln-leiste { background: var(--ln-flaeche); }
}

/* =====================================================================
   Eigenstaendige Seite (eigene Adresse, ohne Theme drumherum)
   ===================================================================== */

body.ln-standalone {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	color: #12161c;
	min-height: 100svh;
	padding-top: env(safe-area-inset-top);
}

body.ln-standalone .ln-app {
	padding-left: max(14px, env(safe-area-inset-left));
	padding-right: max(14px, env(safe-area-inset-right));
}

@media (prefers-color-scheme: dark) {
	body.ln-standalone { color: #e8eaed; }
}
