/**
 * ua-pwa — die App-Leiste unten (0.2.2), die Ladelinie und der weiche
 * Seitenwechsel (0.2.3), NUR im Standalone-Modus.
 *
 * LUFT UNTEN (0.2.3, B9): Der iPhone-Balken bekommt
 * max(12px, env(safe-area-inset-bottom)) — die Zone ist nur dann > 0,
 * wenn das Viewport-Meta viewport-fit=cover trägt; das setzt ua-pwa in
 * der App per Skript nach (frontend.php, Kadences Meta hat es nicht).
 * Höhe = 56 px + diese Luft; dieselbe Formel für den Platz des Rumpfs
 * und den Nach-oben-Knopf. Die 56 stehen nur in dieser Datei.
 *
 * LEISTE IN DER BILDMITTE NACH ANKER-SPRUNG (0.2.9): Beim Laden mit
 * Anker (#mittag) stand die Leiste am iPhone auf etwa 58 % der Höhe, bis
 * zum ersten Scrollen — WebKit, nicht diese Regeln. Behoben per Nachstoß
 * in ua-pwa-register.js (Ziel erneut anspringen, 1 px hin und zurück).
 * Kein transform, filter, contain oder will-change an Vorfahren der
 * Leiste: Dann bezöge sich „fixed“ auf diesen Vorfahren statt aufs Fenster.
 *
 * Sichtbar über @media (display-mode: standalone) und — für altes iOS
 * mit navigator.standalone — über die Klasse ua-pwa-standalone am <html>
 * (ua-pwa-register.js). Im Browser: display none, nie zu sehen.
 *
 * Farben aus ua-farben.css über var(); hart nur Weiß #fff (Grund der
 * Leiste, kein Paletteneintrag) und das Grau #5c6773 der nicht aktiven
 * Einträge — das Grau #6f7b88 der Palette-losen Töne kommt auf Weiß nur
 * auf 4,3:1, #5c6773 auf 5,8:1 (WCAG AA ≥ 4,5:1). Bei der Farbrunde
 * mitziehen.
 */
.ua-pwa-leiste {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 950;
	box-sizing: border-box;
	height: calc(56px + max(12px, env(safe-area-inset-bottom, 0px)));
	padding: 0 0 max(12px, env(safe-area-inset-bottom, 0px));
	margin: 0;
	background: #fff;
	border-top: 1px solid var(--ua-sand, #d9cdb8);
	font-family: var(--ua-sans, "Source Sans 3", Arial, sans-serif);
}
@media (display-mode: standalone) {
	.ua-pwa-leiste { display: flex; }
	body.ua-pwa-leiste-da { padding-bottom: calc(56px + max(12px, env(safe-area-inset-bottom, 0px))); }
	/* Kadences „Nach oben“-Knopf (#kt-scroll-up, fest unten rechts) über die Leiste heben — ohne ihn wirkungslos (Gegenlesung B3). */
	body.ua-pwa-leiste-da #kt-scroll-up, body.ua-pwa-leiste-da #kt-scroll-up-reader { bottom: calc(56px + 30px + max(12px, env(safe-area-inset-bottom, 0px))); }
	/* Mit viewport-fit=cover läge der Kopf unter der Statusleiste — oben die Zone freihalten (bei Statusleisten-Stil „default“ ist sie 0; der Riegel kostet nichts). */
	body.ua-pwa-leiste-da #masthead { padding-top: env(safe-area-inset-top, 0px); }
	/* WEICHER SEITENWECHSEL (0.2.3, B11): kurzer Fade zwischen zwei Seiten, wo der Browser es kann (Chrome ≥ 126); sonst passiert nichts. */
	@view-transition { navigation: auto; }
	::view-transition-old(root), ::view-transition-new(root) { animation-duration: 150ms; }
}
html.ua-pwa-standalone .ua-pwa-leiste { display: flex; }
html.ua-pwa-standalone body.ua-pwa-leiste-da { padding-bottom: calc(56px + max(12px, env(safe-area-inset-bottom, 0px))); }
html.ua-pwa-standalone body.ua-pwa-leiste-da #kt-scroll-up, html.ua-pwa-standalone body.ua-pwa-leiste-da #kt-scroll-up-reader { bottom: calc(56px + 30px + max(12px, env(safe-area-inset-bottom, 0px))); }
html.ua-pwa-standalone body.ua-pwa-leiste-da #masthead { padding-top: env(safe-area-inset-top, 0px); }
@media (prefers-reduced-motion: reduce) {
	::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

.ua-pwa-leiste__eintrag,
.ua-pwa-leiste__eintrag:hover,
.ua-pwa-leiste__eintrag:focus-visible {
	position: relative;
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	min-width: 44px;
	margin: 0;
	padding: 10px 4px 6px; /* oben 10 px Luft (B9.3) */
	box-sizing: border-box;
	color: #5c6773;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.ua-pwa-leiste__eintrag:focus-visible { outline: 2px solid var(--ua-amber, #e8a020); outline-offset: -2px; }
.ua-pwa-leiste__eintrag--aktiv,
.ua-pwa-leiste__eintrag--aktiv:hover,
.ua-pwa-leiste__eintrag--aktiv:focus-visible { color: var(--ua-navy, #184058); font-weight: 700; }
/* AKTIV-BALKEN (0.2.3, B10): 28 × 3 px Amber mittig oben, direkt unter der Sand-Linie, unten gerundet — Navy und fett allein reichten nicht (Alex). Kein Hintergrund, kein Kreis. */
.ua-pwa-leiste__eintrag--aktiv::before { content: ""; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--ua-amber, #e8a020); }
.ua-pwa-leiste__symbol { position: relative; display: block; width: 22px; height: 22px; margin: 0 0 4px; line-height: 0; } /* 4 px zum Wort (B9.3) */
.ua-pwa-leiste__symbol svg { display: block; width: 22px; height: 22px; }
.ua-pwa-leiste__wort { display: block; }
/* Amber-Punkt an „Essen“ (Mo–Fr 11–15 Uhr, Mittagstisch heute): 8 px, Rand 2 px Weiß gegen das Symbol. */
.ua-pwa-leiste__punkt { position: absolute; top: -3px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--ua-amber, #e8a020); box-shadow: 0 0 0 2px #fff; }
.ua-pwa-leiste .ua-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* LADELINIE (0.2.3, B11): 3 px Amber, fest unter der Kopfzeile (Skript
   setzt top; ganz oben, wenn der Kopf nicht fest steht). Startet erst
   150 ms nach dem Tipp, wächst in 1,5 s auf 80 % und bleibt, bis die
   Seite wechselt (dann voll und weg). Nur im Standalone-Modus — das
   Skript zeigt sie nur dort. Ohne Bewegungswunsch: an/aus ohne Animation. */
.ua-pwa-ladelinie { position: fixed; left: 0; top: 0; z-index: 960; height: 3px; width: 0; background: var(--ua-amber, #e8a020); pointer-events: none; }
.ua-pwa-ladelinie[hidden] { display: none; }
.ua-pwa-ladelinie--an { width: 80%; transition: width 1.5s ease-out; }
.ua-pwa-ladelinie--fertig { width: 100%; transition: width .15s linear; }
@media (prefers-reduced-motion: reduce) {
	.ua-pwa-ladelinie--an, .ua-pwa-ladelinie--fertig { transition: none; }
}
