:root {
  --grund: #f4f5f7; --flaeche: #ffffff; --text: #14171c; --leise: #6b7280; --linie: #e3e6ea;
  --akzent: #2f6fed; --akzent-text: #ffffff; --warn: #c0392b; --gut: #1e8e5a; --weich: #eef2fd;
  --oben: env(safe-area-inset-top, 0px); --unten: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0e1116; --flaeche: #181c23; --text: #eef0f3; --leise: #98a1ae; --linie: #2a303a;
    --akzent: #5b8ff5; --akzent-text: #0b0e13; --warn: #ff7b6b; --gut: #4cc38a; --weich: #1d2636;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--grund); color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; overscroll-behavior-y: none;
}
#app { min-height: 100%; display: flex; flex-direction: column; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--leise); margin: 28px 4px 8px; font-weight: 600; }
p { margin: 0 0 12px; }
.leise { color: var(--leise); }
.klein { font-size: 14px; }

/* Seiten ohne Anmeldung */
.mitte { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--oben) + 24px) 24px calc(var(--unten) + 24px); max-width: 460px; width: 100%; margin: 0 auto; }
.zeichen { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 24px; }
.zahl { font-size: 56px; font-weight: 700; letter-spacing: 0.12em; margin: 12px 0 16px; font-variant-numeric: tabular-nums; }
ol.schritte { padding-left: 22px; margin: 8px 0 20px; }
ol.schritte li { margin-bottom: 8px; }

/* Bedienelemente */
button, .knopf {
  font: inherit; font-weight: 600; border: 0; border-radius: 14px; padding: 14px 18px; min-height: 50px;
  background: var(--akzent); color: var(--akzent-text); width: 100%; cursor: pointer; display: block; text-align: center; text-decoration: none;
}
button:active { opacity: 0.75; }
button[disabled] { opacity: 0.45; }
button.zweit { background: var(--weich); color: var(--akzent); }
button.schlicht { background: none; color: var(--akzent); min-height: 0; padding: 10px; width: auto; }
button.gefahr { background: none; color: var(--warn); min-height: 0; padding: 8px 10px; width: auto; font-weight: 500; }
button + button { margin-top: 10px; }
input, select {
  font: inherit; width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--linie);
  background: var(--flaeche); color: var(--text); margin-bottom: 12px; min-height: 50px;
}
label { display: block; font-size: 14px; color: var(--leise); margin: 0 4px 6px; }
.fehler { color: var(--warn); margin: 12px 4px 0; font-size: 15px; }
.fehler:empty { display: none; }

/* Angemeldet */
.kopf { position: sticky; top: 0; z-index: 5; background: var(--grund); padding: calc(var(--oben) + 12px) 20px 10px; display: flex; align-items: center; gap: 8px; }
.kopf h1 { margin: 0; flex: 1; font-size: 30px; }
.kopf .zurueck { padding: 6px 10px 6px 0; font-size: 17px; }
.inhalt { flex: 1; padding: 4px 16px calc(var(--unten) + 96px); max-width: 640px; width: 100%; margin: 0 auto; }
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--flaeche) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--linie); padding: 6px 8px calc(var(--unten) + 6px);
}
.leiste button { background: none; color: var(--leise); width: 33%; max-width: 180px; margin: 0; padding: 6px 4px; min-height: 48px; font-size: 12px; font-weight: 600; border-radius: 10px; position: relative; }
.leiste button .bild { display: block; font-size: 22px; line-height: 26px; filter: grayscale(1); opacity: 0.7; }
.leiste button.aktiv { color: var(--akzent); }
.leiste button.aktiv .bild { filter: none; opacity: 1; }
.punkt { position: absolute; top: 2px; left: calc(50% + 8px); background: var(--warn); color: #fff; border-radius: 10px; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; padding: 0 5px; }

.kasten { background: var(--flaeche); border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.zeile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--linie); width: 100%; text-align: left; background: none; color: inherit; border-radius: 0; font-weight: 400; min-height: 0; margin: 0; }
.kasten > .zeile:last-child { border-bottom: 0; }
.zeile .haupt { flex: 1; min-width: 0; }
.zeile .titel { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .unter { color: var(--leise); font-size: 15px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zeile .rand { color: var(--leise); font-size: 13px; white-space: nowrap; align-self: flex-start; padding-top: 3px; }
.neu { width: 10px; height: 10px; border-radius: 50%; background: var(--akzent); flex: none; }
.gelesen .neu { background: transparent; }
.erledigt { opacity: 0.55; }
.hinweis { background: var(--weich); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.hinweis p { margin-bottom: 12px; }
.hinweis.achtung { background: color-mix(in srgb, var(--warn) 14%, var(--flaeche)); }
.leer { text-align: center; color: var(--leise); padding: 64px 24px; }

/* Karte */
.karte { background: var(--flaeche); border-radius: 16px; padding: 18px; margin-bottom: 12px; }
.karte .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.karte img { display: block; width: 100%; max-width: 420px; margin: 16px auto 4px; border-radius: 12px; background: #fff; }
.code { font: 600 30px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-align: center; padding: 20px 8px; margin: 16px 0 10px; background: var(--grund); border-radius: 12px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.antwort { color: var(--gut); font-weight: 600; margin-top: 14px; }
.knoepfe { margin-top: 16px; }
.reihe { display: flex; gap: 10px; align-items: center; }
.reihe > * { margin: 0 !important; }
.reihe select { flex: 1; }
.reihe button { width: auto; flex: none; }

/* Apps */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kachel { background: var(--flaeche); color: var(--text); border-radius: 16px; padding: 18px 16px; text-decoration: none; display: block; }
.kachel .bild { font-size: 34px; display: block; margin-bottom: 10px; }
.kachel .name { font-weight: 600; }
.kachel .unter { color: var(--leise); font-size: 14px; }
