:root {
  --akzent: #2f6fdb; --akzent-hell: #e8f0fd; --akzent-text: #fff;
  --grund: #f6f4ef; --karte: #ffffff; --text: #1f2430; --leise: #667085; --linie: #e4e1d8;
  --gruen: #2e9b4f; --gelb: #d99a06; --rot: #d9443b; --grau: #a3a8b3;
  --radius: 16px; --schatten: 0 1px 2px rgba(20,25,35,.06), 0 4px 14px rgba(20,25,35,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --grund: #14171d; --karte: #1d2129; --text: #eceef2; --leise: #9aa2b1; --linie: #2c313b;
          --schatten: none; color-scheme: dark; }
}
[data-farbe="blau"]    { --akzent: #2f6fdb; --akzent-hell: #e3ecfc; }
[data-farbe="tuerkis"] { --akzent: #0d8f84; --akzent-hell: #dcf3f0; }
[data-farbe="gruen"]   { --akzent: #2b8a46; --akzent-hell: #e0f2e5; }
[data-farbe="orange"]  { --akzent: #d2690a; --akzent-hell: #fdebdc; }
[data-farbe="rot"]     { --akzent: #cf3a32; --akzent-hell: #fbe3e1; }
[data-farbe="pink"]    { --akzent: #c93682; --akzent-hell: #fae1ee; }
[data-farbe="lila"]    { --akzent: #7048c8; --akzent-hell: #ece5fa; }
[data-farbe="schiefer"]{ --akzent: #44566e; --akzent-hell: #e3e8ee; }
@media (prefers-color-scheme: dark) {
  [data-farbe] { --akzent-hell: color-mix(in srgb, var(--akzent) 22%, #1d2129); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 6px 0 4px; }
h2 { font-size: 1.1rem; margin: 22px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 4px; }
p { margin: 0 0 10px; }
a { color: var(--akzent); }
.leise { color: var(--leise); font-size: .92rem; }
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten);
  border: 1px solid var(--linie); padding: 16px; margin: 0 0 12px; }
.karte.link { display: block; color: inherit; text-decoration: none; }
.karte.link:active { transform: scale(.99); }
.zeile { display: flex; align-items: center; gap: 12px; }
.zeile > .wachsen { flex: 1; min-width: 0; }
.kopf { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.kopf img { width: 76px; height: 76px; flex: none; }
.sprechblase { background: var(--karte); border: 1px solid var(--linie); border-radius: 14px;
  padding: 10px 12px; position: relative; font-size: .95rem; }
.sprechblase::before { content: ""; position: absolute; left: -7px; top: 22px; width: 12px; height: 12px;
  background: var(--karte); border-left: 1px solid var(--linie); border-bottom: 1px solid var(--linie);
  transform: rotate(45deg); }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 0 18px; border-radius: 12px; border: 0; background: var(--akzent); color: var(--akzent-text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.knopf.voll { width: 100%; }
.knopf.zweit { background: var(--akzent-hell); color: var(--akzent); }
.knopf.leise { background: transparent; color: var(--leise); border: 1px solid var(--linie); }
.knopf.rot { background: var(--rot); }
.knopf:disabled { opacity: .5; cursor: default; }
.knoepfe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--linie);
  background: var(--karte); color: var(--text); font: inherit; }
textarea { min-height: 96px; resize: vertical; }
.marke { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  background: var(--akzent-hell); color: var(--akzent); }
.marke.gruen { background: #e0f2e5; color: #1f7a3b; } .marke.gelb { background: #fdf1d4; color: #8a6100; }
.marke.rot { background: #fbe3e1; color: #a52a23; } .marke.grau { background: #eceef1; color: #5b6270; }
@media (prefers-color-scheme: dark) {
  .marke.gruen { background: #183a24; color: #8fd8a6; } .marke.gelb { background: #3a2f12; color: #f0cf7a; }
  .marke.rot { background: #401c1a; color: #f3a29c; } .marke.grau { background: #2a2f38; color: #b5bcc8; }
}
.punkt { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; background: var(--akzent-hell); color: var(--akzent); }
.punkt.fertig { background: var(--akzent); color: var(--akzent-text); }
.balken { height: 10px; background: var(--akzent-hell); border-radius: 99px; overflow: hidden; }
.balken > i { display: block; height: 100%; background: var(--akzent); border-radius: 99px; }
.geld { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.aufgabentext { font-size: 1.05rem; white-space: normal; }
.aufgabentext p { margin: 0 0 10px; }
.aufgabentext ul { margin: 0 0 10px; padding-left: 20px; }
.pfad { display: flex; flex-wrap: wrap; gap: 6px; }
.pfad span { width: 22px; height: 22px; border-radius: 6px; background: var(--linie); }
.pfad span.teil { background: color-mix(in srgb, var(--akzent) 45%, var(--linie)); }
.pfad span.voll { background: var(--akzent); }
.pfad span.jetzt { outline: 2px solid var(--akzent); outline-offset: 2px; }
.ampel { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.ampel:last-child { border-bottom: 0; }
.ampel i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.ampel i.gruen { background: var(--gruen); } .ampel i.gelb { background: var(--gelb); }
.ampel i.rot { background: var(--rot); } .ampel i.grau { background: var(--grau); }
.vorschau { width: 100%; border-radius: 12px; border: 1px solid var(--linie); display: block; margin-top: 8px; }
audio { width: 100%; margin-top: 8px; }
.aufnahme { display: flex; align-items: center; gap: 12px; }
.rec { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--rot); color: #fff;
  font-weight: 800; font-size: .8rem; cursor: pointer; flex: none; }
.rec.laeuft { animation: puls 1.2s infinite; }
@keyframes puls { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--rot) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .rec.laeuft { animation: none; outline: 4px solid var(--rot); } }
.uhr { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.4rem; }
.farben { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.farben button { height: 56px; border-radius: 14px; border: 3px solid transparent; cursor: pointer; }
.farben button[aria-pressed=true] { border-color: var(--text); }
#leiste { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  background: var(--karte); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom); }
#leiste a { flex: 1; max-width: 160px; text-align: center; padding: 10px 0 12px; color: var(--leise);
  text-decoration: none; font-size: .82rem; font-weight: 600; }
#leiste a svg { display: block; margin: 0 auto 2px; width: 24px; height: 24px; }
#leiste a[aria-current=page] { color: var(--akzent); }
#hinweis { position: fixed; left: 16px; right: 16px; bottom: 84px; max-width: 560px; margin: 0 auto;
  background: var(--text); color: var(--grund); padding: 12px 16px; border-radius: 12px; font-weight: 600; z-index: 9; }
.zurueck { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--leise);
  text-decoration: none; font-weight: 600; }
.anmelden { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; }
.anmelden img { width: 120px; margin: 0 auto 8px; display: block; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
td, th { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--linie); vertical-align: top; }
td.zahl, th.zahl { text-align: right; white-space: nowrap; }
.wahl { display: flex; gap: 8px; flex-wrap: wrap; }
.wahl input { position: absolute; opacity: 0; pointer-events: none; }
.wahl label { margin: 0; font-weight: 600; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--linie);
  cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.wahl input:checked + label { background: var(--akzent); color: var(--akzent-text); border-color: var(--akzent); }
.wahl input:focus-visible + label { outline: 2px solid var(--akzent); outline-offset: 2px; }
.loesung { background: var(--akzent-hell); border-radius: 12px; padding: 12px; white-space: pre-wrap; }
.kurve { width: 100%; height: 140px; }
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fotos img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
