/* Charity Box – Handy-Oberfläche (docs/SPEZ-OBERFLAECHE.md) */
:root {
	--grund: #f4f5f2;
	--karte: #ffffff;
	--text: #1d2421;
	--leise: #5d6862;
	--linie: #dfe3df;
	--marke: #1f5f4a;
	--marke-hell: #e3efe9;
	--warn: #9a5b00;
	--warn-hell: #fdf1dc;
	--rot: #a8322d;
	--rot-hell: #fbe6e4;
	--blau: #275d8f;
	--blau-hell: #e3edf7;
	--grau-hell: #eceeec;
	--radius: 14px;
	--schatten: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }
/* hidden muss gegen display-Regeln der Klassen gewinnen (Zurück-Pfeil, Leiste) */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
	background: var(--grund);
	color: var(--text);
	font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	min-height: 100dvh;
	-webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Kopf */
.kopf {
	position: sticky; top: 0; z-index: 10;
	display: flex; align-items: center; gap: 4px;
	height: 56px; padding: 0 8px; padding-top: env(safe-area-inset-top);
	background: var(--marke); color: #fff;
}
.kopf-titel { flex: 1; margin: 0 8px; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-zurueck, .kopf-abmelden {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; color: #fff; cursor: pointer;
}
.kopf-zurueck:active, .kopf-abmelden:active { background: rgba(255, 255, 255, .15); }

/* Inhalt */
.inhalt { max-width: 640px; margin: 0 auto; padding: 12px 12px calc(96px + env(safe-area-inset-bottom)); }
.inhalt.ohne-leiste { padding-bottom: 24px; }
h2 { font-size: 15px; font-weight: 600; color: var(--leise); margin: 20px 4px 8px; text-transform: none; }
.leer { color: var(--leise); text-align: center; padding: 20px 8px; }

/* Suche */
.suche { position: relative; }
.suche input {
	width: 100%; height: 50px; padding: 0 14px 0 44px;
	border: 1px solid var(--linie); border-radius: 25px; background: var(--karte); box-shadow: var(--schatten);
	font-size: 17px;
}
.suche input:focus { outline: 2px solid var(--marke); outline-offset: 0; }
.suche svg { position: absolute; left: 14px; top: 14px; color: var(--leise); }

/* Kacheln mit Zahlen */
.zahlen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.zahl {
	display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
	padding: 12px 14px; border: 0; border-radius: var(--radius); background: var(--karte); box-shadow: var(--schatten);
	text-align: left; cursor: pointer;
}
.zahl b { font-size: 24px; line-height: 1.1; }
.zahl span { font-size: 14px; color: var(--leise); }
.zahl.warn b { color: var(--warn); }
.zahl.rot b { color: var(--rot); }

/* Karten */
.karte {
	background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten);
	padding: 14px; margin-bottom: 10px;
}
.karte.klickbar { cursor: pointer; display: block; width: 100%; border: 0; text-align: left; }
.karte.klickbar:active { background: #fafbfa; }
.karte-zeile { display: flex; align-items: center; gap: 10px; }
.karte-titel { font-weight: 600; font-size: 17px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.karte-text { color: var(--leise); font-size: 15px; margin-top: 4px; overflow-wrap: anywhere; }
.karte-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.karte-knoepfe .knopf { flex: 1 1 auto; }

/* Schilder */
.schild { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.schild.verfuegbar { background: var(--marke-hell); color: var(--marke); }
.schild.ausgegeben { background: var(--blau-hell); color: var(--blau); }
.schild.gemeldet { background: var(--warn-hell); color: var(--warn); }
.schild.ausser { background: var(--grau-hell); color: var(--leise); }
.schild.rot { background: var(--rot-hell); color: var(--rot); }
.schild.ok { background: var(--marke-hell); color: var(--marke); }

/* Knöpfe */
.knopf {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 8px 16px; border: 1px solid var(--linie); border-radius: 12px;
	background: var(--karte); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.knopf svg { flex: none; }
.knopf:active { transform: translateY(1px); }
.knopf.haupt { background: var(--marke); border-color: var(--marke); color: #fff; }
.knopf.gefahr { color: var(--rot); border-color: #efc7c4; }
.knopf.breit { width: 100%; }
.knopf[disabled] { opacity: .45; pointer-events: none; }

/* Leiste unten (Hauptaktion ohne Scrollen erreichbar) */
.leiste {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
	display: flex; gap: 8px; justify-content: center;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	background: rgba(244, 245, 242, .96); border-top: 1px solid var(--linie);
	backdrop-filter: blur(6px);
}
.leiste .knopf { flex: 1; max-width: 616px; }

/* Angaben */
.angaben { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.angaben dt { color: var(--leise); font-size: 15px; }
.angaben dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
a.tel { color: var(--blau); font-weight: 600; text-decoration: none; }

/* Verlauf */
details.verlauf summary { cursor: pointer; font-weight: 600; padding: 4px 0; list-style: none; }
details.verlauf summary::-webkit-details-marker { display: none; }
details.verlauf summary::after { content: " ▾"; color: var(--leise); }
details.verlauf[open] summary::after { content: " ▴"; }
.verlauf ol { list-style: none; margin: 8px 0 0; padding: 0; }
.verlauf li { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--linie); font-size: 15px; }
.verlauf li time { color: var(--leise); min-width: 84px; }

/* Formulare */
.feld { display: block; margin-bottom: 14px; }
.feld > span { display: block; font-size: 15px; color: var(--leise); margin-bottom: 4px; }
.feld input[type=text], .feld input[type=tel], .feld input[type=date], .feld select {
	width: 100%; height: 50px; padding: 0 12px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; font-size: 17px;
}
.feld input:focus, .feld select:focus { outline: 2px solid var(--marke); outline-offset: 0; }
.wahl { display: flex; gap: 8px; }
.wahl label { flex: 1; }
.wahl input { position: absolute; opacity: 0; pointer-events: none; }
.wahl span {
	display: flex; align-items: center; justify-content: center; height: 48px; border: 1px solid var(--linie);
	border-radius: 12px; background: #fff; font-weight: 600; cursor: pointer;
}
.wahl input:checked + span { background: var(--marke-hell); border-color: var(--marke); color: var(--marke); }
.wahl input:focus-visible + span { outline: 2px solid var(--marke); }
.fehler { color: var(--rot); font-size: 15px; margin: -6px 0 12px; }

/* Schritte des Assistenten */
.schritte { display: flex; gap: 6px; margin: 4px 0 16px; }
.schritte i { flex: 1; height: 5px; border-radius: 3px; background: var(--linie); }
.schritte i.an { background: var(--marke); }

/* QR */
.qr { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.qr svg { width: min(72vw, 300px); height: auto; stroke: none; background: #fff; border-radius: 8px; }
/* pyqrcode zeichnet Linien (stroke); der allgemeine Symbolstil darf sie nicht überschreiben */
.qr svg path { stroke: #000; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; fill: none; }
.verbunden { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--marke); font-weight: 700; font-size: 18px; padding: 16px; }

/* Filter-Chips */
/* mehrzeilig statt waagerecht scrollen (Can 10.11.): alle Filter auf einen Blick */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 2px 0 12px; }
.chips button { min-height: 44px; border: 1px solid var(--linie); background: #fff; border-radius: 999px; padding: 6px 8px;
	font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer; }
.chips button.an { background: var(--marke); border-color: var(--marke); color: #fff; }

/* Blatt von unten */
.blatt-hintergrund { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .35); }
.blatt {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
	max-width: 640px; margin: 0 auto; max-height: 90dvh; overflow-y: auto;
	padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
	background: var(--karte); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 24px rgba(0, 0, 0, .15);
}
.blatt h3 { margin: 0 0 12px; font-size: 19px; }
.blatt p { margin: 0 0 14px; }
.blatt-knoepfe { display: flex; gap: 8px; margin-top: 8px; }
.blatt-knoepfe .knopf { flex: 1; }

/* Hinweis (Toast) */
.hinweis {
	position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30;
	max-width: calc(100% - 24px); padding: 12px 16px; border-radius: 12px; background: #1d2421; color: #fff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .2); font-size: 15px;
}
.hinweis.fehler-hinweis { background: var(--rot); }

.laden { text-align: center; color: var(--leise); padding: 32px; }
@media (min-width: 700px) {
	.zahlen { grid-template-columns: repeat(4, 1fr); }
}

/* Startseite: Kacheln (Can 10.11.) */
.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.kachel {
	position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	min-height: 136px; padding: 16px 10px; border: 0; border-radius: 18px; background: var(--karte); box-shadow: var(--schatten);
	font-weight: 600; font-size: 16px; line-height: 1.25; text-align: center; cursor: pointer;
}
.kachel:active { transform: translateY(1px); background: #fafbfa; }
.kachel-symbol { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 30px;
	background: var(--marke-hell); color: var(--marke); }
.kachel-symbol svg { width: 34px; height: 34px; stroke-width: 1.7; }
.kachel-symbol .akzent { stroke-width: 2.4; }
.kachel-symbol.rot { background: var(--rot-hell); color: var(--rot); }
.abzeichen { position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
	background: var(--rot); color: #fff; font-size: 14px; line-height: 26px; }
#alle { margin-top: 6px; }

/* Leiste: Zurück schmal, Hauptaktion breit */
.leiste .knopf[data-zurueck] { flex: 0 0 auto; }

/* Mehrfachauswahl */
.wahl-zeile { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 12px 8px 12px 12px; border: 2px solid transparent; }
.wahl-zeile .kaestchen { flex: none; width: 28px; height: 28px; color: var(--leise); }
.wahl-zeile .haken-pfad { opacity: 0; }
.wahl-zeile.an { border-color: var(--marke); background: #f5faf7; }
.wahl-zeile.an .kaestchen { color: var(--marke); }
.wahl-zeile.an .kaestchen rect { fill: var(--marke); }
.wahl-zeile.an .haken-pfad { opacity: 1; stroke: #fff; }
.wahl-zeile.aus { cursor: default; opacity: .55; }
.wahl-zeile:focus-visible { outline: 2px solid var(--marke); }
.wahl-inhalt { flex: 1; min-width: 0; }
.mehr { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
	border: 0; border-radius: 20px; background: transparent; color: var(--leise); cursor: pointer; }
.mehr:active { background: var(--grau-hell); }
.karte-text.klein { font-size: 13px; }

/* Status-Auswahl */
.optionen { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; cursor: pointer; }
.option input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--marke); }
.option span { display: flex; flex-direction: column; gap: 2px; }
.option small { color: var(--leise); font-size: 14px; }
.option:has(input:checked) { border-color: var(--marke); background: var(--marke-hell); }
.option.aus { opacity: .5; cursor: default; }

/* Überfällige: eine Zeile Box · Besitzer · Telefon */
.ue-zeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 17px; }
.ue-zeile b { font-size: 17px; }
.ue-zeile span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.karte-knoepfe .knopf { min-height: 44px; padding: 6px 12px; font-size: 15px; }

/* Ergebnis je Box */
.ergebnis.gut .karte-titel svg { color: var(--marke); vertical-align: -5px; }
.ergebnis.schlecht { border-left: 4px solid var(--rot); }
.ergebnis.schlecht .karte-titel svg { color: var(--rot); vertical-align: -5px; }
.warnkarte { border-left: 4px solid var(--warn); background: var(--warn-hell); }
.qr-hinweis { margin: 4px 0 0; text-align: left; font-size: 15px; }
.warntext { color: var(--warn); }

/* S10 Einstellungen */
.wahl.raster { display: grid; grid-template-columns: repeat(3, 1fr); }
.wahl.raster span { font-size: 14px; padding: 0 4px; text-align: center; }
.mit-einheit { display: flex; align-items: center; gap: 10px; }
.mit-einheit input { width: 110px; height: 50px; padding: 0 12px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; font-size: 17px; }
.mit-einheit input:focus { outline: 2px solid var(--marke); outline-offset: 0; }
.mit-einheit em { font-style: normal; color: var(--leise); }
.feld input[type=time] { width: 140px; height: 50px; padding: 0 12px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; font-size: 17px; }
.hilfe { display: block; color: var(--leise); font-size: 13px; margin-top: 4px; }
.hinweiskarte { background: var(--blau-hell); color: var(--blau); font-size: 15px; }
.karte .feld:last-child { margin-bottom: 0; }

/* Verwaltung / S11 */
.menue { display: flex; align-items: center; gap: 14px; }
.menue > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.menue small { color: var(--leise); font-size: 14px; }
.menue > svg { color: var(--leise); }
.kachel-symbol.klein { width: 46px; height: 46px; flex: none; }
.kachel-symbol.klein svg { width: 26px; height: 26px; }
.linkfeld { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--grau-hell); border-radius: 8px;
	padding: 10px; overflow-wrap: anywhere; user-select: all; }
/* Anmeldeseite */
.anmelden { max-width: 440px; padding-top: 24px; }
.anmelden-titel { margin: 0 0 14px; color: var(--text); font-size: 20px; }
.anmelden-hilfe { margin: 14px 0 0; text-align: center; }
.feld input[type=password] { width: 100%; height: 50px; padding: 0 12px; border: 1px solid var(--linie); border-radius: 12px; background: #fff; font-size: 17px; }
.anmelden .fehler { margin: 0 0 12px; }
