/* KiTaO-App: Farben aus dem Wichtel (Mützenrot, Senf, Petrol der Schürze, Creme), Navy aus dem Logo.
   Motiv: Taschen mit gestrichelter Naht wie an der Schürze. Für das Handy gebaut, hell und dunkel. */
:root {
	--creme: #fbf3e6; --papier: #fffdf8; --linie: #eadbc4; --naht: #d9c3a3;
	--rot: #c8553d; --rot-dunkel: #9e3b28; --rot-hell: #f7ded6;
	--senf: #e3a833; --senf-dunkel: #8a5f0c; --senf-hell: #f8eccb;
	--petrol: #4e7f86; --petrol-dunkel: #2f5a60; --petrol-hell: #dfecea;
	--rose: #f2c9bc; --tinte: #1e3a5f; --ink: #3a2a20; --leise: #7a6a5e; --fehler: #a3261b;
	--bot: #fffdf8; --ich: #dfecea;
	--schatten: 0 2px 0 rgba(91, 58, 41, .10), 0 6px 18px rgba(91, 58, 41, .06);
	--rund: ui-rounded, "SF Pro Rounded", "Nunito", "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
	:root { --creme: #241c17; --papier: #2f251e; --linie: #47392e; --naht: #6a5544; --ink: #f3e8da; --leise: #c2b0a0;
		--rot-hell: #4a2a21; --senf-hell: #45361a; --petrol-hell: #22393c; --tinte: #f3e8da; --bot: #2f251e; --ich: #22393c;
		--schatten: 0 2px 0 rgba(0, 0, 0, .25); }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--creme); color: var(--ink); font: 16px/1.45 var(--rund); -webkit-text-size-adjust: 100%; }
#app { min-height: 100%; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { color: var(--tinte); }

/* Kopfzeile */
.kopf { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; min-height: 58px;
	padding: calc(env(safe-area-inset-top) + 6px) 12px 6px; background: var(--creme); }
.kopf.mit-linie { border-bottom: 2px dashed var(--naht); }
.kopf h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf .marke { height: 42px; width: auto; }
@media (prefers-color-scheme: dark) { .kopf .marke { padding: 3px 6px; background: #fbf3e6; border-radius: 12px; } }
.kopf .luecke { flex: 1; }
.knopf-klein { flex: none; min-width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--papier); color: var(--rot);
	display: grid; place-items: center; box-shadow: var(--schatten); }
.knopf-klein .svg { width: 24px; height: 24px; }
.zurueck { display: flex; align-items: center; gap: 2px; min-height: 48px; padding: 0 14px 0 6px; border: 0; border-radius: 24px;
	background: var(--papier); color: var(--rot); font-size: 16px; font-weight: 750; flex: none; box-shadow: var(--schatten); }
.zurueck .svg { width: 24px; height: 24px; stroke-width: 2.6; }
.kopf h1.mit-kachel { display: flex; align-items: center; gap: 8px; }
.kopf h1.mit-kachel > span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 340px) { .kopf h1.mit-kachel .kachel { display: none; } }

/* Symbole und Kacheln */
.svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kachel { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; color: #fff; }
.kachel.petrol { background: var(--petrol); } .kachel.senf { background: var(--senf); color: #3b2a06; } .kachel.rot { background: var(--rot); }
.kopf .kachel { width: 32px; height: 32px; border-radius: 11px; }
.kopf .kachel .svg { width: 18px; height: 18px; }

/* Startseite: Wichtel mit Sprechblase */
.start { padding: 4px 14px 16px; display: grid; gap: 14px; }
.gruss { display: flex; align-items: flex-end; gap: 6px; margin-top: 2px; }
.gruss img { flex: none; width: 104px; height: auto; margin-bottom: -6px; }
.blase { position: relative; flex: 1; margin-bottom: 26px; padding: 12px 15px; background: var(--papier); border-radius: 20px;
	box-shadow: var(--schatten); font-size: 17px; }
.blase strong { color: var(--rot); }
.blase::before { content: ""; position: absolute; left: -9px; bottom: 16px; border: 9px solid transparent; border-right-color: var(--papier); border-left: 0; }

/* Taschen: Karten mit Naht */
.tasche { position: relative; padding: 16px; border-radius: 24px; background: var(--papier); box-shadow: var(--schatten); }
.tasche::after { content: ""; position: absolute; inset: 6px; border: 2px dashed var(--naht); border-radius: 19px; pointer-events: none; }
.tasche.petrol { background: var(--petrol-hell); } .tasche.petrol::after { border-color: rgba(78, 127, 134, .45); }
.tasche.senf { background: var(--senf-hell); } .tasche.senf::after { border-color: rgba(227, 168, 51, .55); }
.tasche.rose { background: var(--rot-hell); } .tasche.rose::after { border-color: rgba(200, 85, 61, .35); }
.tasche-kopf { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0;
	background: none; text-align: left; }
.tasche-kopf .text { flex: 1; min-width: 0; }
.tasche-kopf .name { display: block; font-size: 18px; font-weight: 800; color: var(--tinte); }
.tasche-kopf .unter { display: block; font-size: 14px; color: var(--leise); }
.tasche-kopf .pfeil { color: var(--leise); }
.punkt { flex: none; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--rot); color: #fff;
	font-size: 14px; font-weight: 800; display: grid; place-items: center; }
.aktionen { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.aktion { display: grid; justify-items: center; gap: 4px; min-height: 76px; padding: 10px 4px; border: 0; border-radius: 18px;
	background: var(--papier); color: var(--petrol-dunkel); font-size: 14px; font-weight: 750; box-shadow: var(--schatten); }
.aktion .svg { width: 28px; height: 28px; }
.aktion:active, .chip:active { transform: translateY(1px); }
.chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { min-height: 42px; padding: 8px 14px; border: 0; border-radius: 21px; background: var(--papier); color: var(--senf-dunkel);
	font-size: 15px; font-weight: 750; box-shadow: var(--schatten); }
@media (prefers-color-scheme: dark) { .aktion { color: #a9d0d4; } .chip { color: #f0c870; } }
.leer { padding: 24px; text-align: center; color: var(--leise); }

/* Hinweis beim ersten Start */
.hinweis { display: flex; align-items: stretch; background: var(--senf-hell); border: 2px dashed var(--senf); border-radius: 18px; }
.hinweis-text { flex: 1; min-height: 52px; padding: 10px 14px; border: 0; background: none; text-align: left; font-size: 15px; }
.hinweis-zu { flex: none; width: 48px; border: 0; background: none; color: var(--leise); font-size: 18px; }

/* Karten-Seiten (Anmeldung, Einladung, Installieren) */
.seite { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 18px calc(env(safe-area-inset-bottom) + 24px); }
.buehne { display: flex; justify-content: center; margin-bottom: -18px; position: relative; z-index: 1; }
.buehne img { width: 150px; height: auto; }
.karte { position: relative; background: var(--papier); border-radius: 26px; padding: 26px 20px 22px; box-shadow: var(--schatten); }
.karte::after { content: ""; position: absolute; inset: 7px; border: 2px dashed var(--naht); border-radius: 20px; pointer-events: none; }
.karte > * { position: relative; z-index: 1; }
.logo { display: block; width: 104px; height: auto; margin: 0 auto 8px; }
.karte h2 { margin: 0 0 6px; text-align: center; font-size: 23px; }
.karte p { margin: 0 0 14px; }
.leise { color: var(--leise); }
.mitte { text-align: center; }
label.feld { display: block; margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--leise); }
label.feld input { display: block; width: 100%; margin-top: 4px; padding: 13px 15px; font: 17px var(--rund); color: var(--ink);
	background: var(--creme); border: 2px solid var(--linie); border-radius: 16px; }
label.feld input:focus { outline: none; border-color: var(--rot); }
.knopf { display: block; width: 100%; min-height: 52px; margin-top: 8px; border: 0; border-radius: 26px; background: var(--rot);
	color: #fff; font-size: 17px; font-weight: 800; box-shadow: 0 3px 0 var(--rot-dunkel); }
.knopf:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rot-dunkel); }
.knopf:disabled { opacity: .6; }
.knopf.zweit { background: var(--papier); color: var(--rot); border: 2px solid var(--rot); box-shadow: none; }
.fehler { color: var(--fehler); font-weight: 700; }
.benutzer { background: var(--senf-hell); border-radius: 14px; padding: 10px 12px; margin: 0 0 14px; }
.benutzer strong { font-size: 18px; }
ol.schritte { margin: 0 0 16px; padding-left: 0; list-style: none; counter-reset: s; }
ol.schritte li { counter-increment: s; display: flex; gap: 12px; align-items: center; margin: 10px 0; }
ol.schritte li::before { content: counter(s); flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--senf);
	color: #3b2a06; font-weight: 800; display: grid; place-items: center; }

/* Hilfe */
.hilfe { padding: 8px 16px calc(env(safe-area-inset-bottom) + 24px); }
.hilfe h2 { margin: 22px 0 10px; font-size: 19px; }
.hilfe h3 { margin: 0 0 4px; font-size: 16px; }
.hilfe p { margin: 0 0 6px; }
.hilfe .einleitung { margin-top: 10px; font-size: 17px; }
.kanalhilfe { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kanalhilfe li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--papier); border-radius: 20px; box-shadow: var(--schatten); }
.beispiel { color: var(--leise); font-size: 14px; font-style: italic; }
.tipp { padding: 14px; margin: 0 0 10px; background: var(--papier); border-radius: 20px; box-shadow: var(--schatten); }
.tipp.warm { background: var(--rot-hell); }
.tipp .knopf { text-align: center; text-decoration: none; line-height: 48px; margin: 8px 0; }
.hilfe > .knopf { margin-top: 12px; }

/* Chat */
.verlauf { flex: 1; overflow-y: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.zeile { display: flex; align-items: flex-end; gap: 8px; }
.zeile.ich { justify-content: flex-end; }
.zeile .figur { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--papier); box-shadow: var(--schatten); }
.nachricht { max-width: 82%; padding: 10px 14px; border-radius: 20px; overflow-wrap: anywhere; box-shadow: var(--schatten); }
.nachricht.bot { background: var(--bot); border-bottom-left-radius: 6px; }
.nachricht.ich { background: var(--ich); border-bottom-right-radius: 6px; }
.nachricht p { margin: 0 0 6px; } .nachricht p:last-child { margin-bottom: 0; }
.nachricht ul { margin: 4px 0 6px; padding-left: 20px; } .nachricht li { margin: 2px 0; }
.nachricht .zeit { display: block; margin-top: 4px; font-size: 12px; color: var(--leise); text-align: right; }
.nachricht a { color: var(--petrol-dunkel); }
.datei { display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0; padding: 10px 12px; min-height: 50px; text-align: left;
	background: var(--senf-hell); border: 2px dashed var(--senf); border-radius: 16px; color: var(--ink); }
.datei .symbol { font-size: 20px; }
.datei .dname { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei .aktion-text { font-size: 14px; color: var(--senf-dunkel); font-weight: 800; }
@media (prefers-color-scheme: dark) { .datei .aktion-text { color: #f0c870; } .nachricht a { color: #a9d0d4; } }
.angekommen { font-size: 12px; color: var(--petrol); font-weight: 700; }
.bild { display: block; padding: 0; margin: 2px 0 4px; border: 0; background: var(--linie); border-radius: 14px; overflow: hidden;
	min-width: 120px; min-height: 90px; }
.bild img { display: block; max-width: 100%; max-height: 300px; }
.bildebene { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(36, 28, 23, .92); }
.bildebene img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bildebene .rund { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 12px; color: #fff; background: none; border: 2px solid rgba(255, 255, 255, .5); }

/* Eingabe */
.eingabe { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px);
	background: var(--creme); border-top: 2px dashed var(--naht); }
.eingabe textarea { flex: 1; min-height: 48px; max-height: 140px; resize: none; padding: 12px 16px; font: 16px/1.35 var(--rund);
	color: var(--ink); background: var(--papier); border: 2px solid var(--linie); border-radius: 24px; }
.eingabe textarea:focus { outline: none; border-color: var(--rot); }
.rund { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 20px;
	background: var(--rot); color: #fff; }
.rund.mikro { background: var(--petrol); }
.rund.foto { background: var(--papier); color: var(--petrol); border: 2px solid var(--linie); }
.rund .svg { width: 24px; height: 24px; }
.rund.aufnahme { background: var(--rot); animation: puls 1.2s infinite; }
.rund.abbruch { background: var(--papier); color: var(--leise); border: 2px solid var(--linie); }
.rund:disabled { opacity: .5; }
.aufnahme-info { flex: 1; align-self: center; font-weight: 800; color: var(--rot); }
@keyframes puls { 50% { box-shadow: 0 0 0 8px rgba(200, 85, 61, .2); } }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); transform: translateX(-50%); z-index: 9;
	max-width: 90%; padding: 10px 16px; border-radius: 16px; background: var(--tinte); color: #fff; font-size: 15px; font-weight: 700; }
@media (prefers-color-scheme: dark) { .toast { background: #4e7f86; } }

/* Startseite unten: angemeldetes Konto und Abmelden */
.konto { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
	margin: 0 14px calc(env(safe-area-inset-bottom) + 18px); padding: 12px 4px 0; border-top: 2px dashed var(--naht);
	color: var(--leise); font-size: 14px; }
.konto strong { color: var(--ink); }
.abmelden { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 2px solid var(--linie);
	border-radius: 22px; background: var(--papier); color: var(--rot); font-size: 15px; font-weight: 800; }
.abmelden .svg { width: 20px; height: 20px; }
