:root {
  --gruen: #2f5d3a; --gruen-hell: #e7efe6; --gruen-mittel: #4f7d58;
  --erde: #8a6a3f; --sand: #f6f3ec; --text: #1f2a22; --grau: #6b7268; --linie: #dcd8cc;
  --rot: #b3261e; --rot-hell: #fbe9e7; --gelb: #f4c542; --weiss: #fff;
  --radius: 14px; --leiste: 68px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--sand); color: var(--text); font-size: 17px; line-height: 1.45; }
body { padding-bottom: calc(var(--leiste) + env(safe-area-inset-bottom)); min-height: 100vh; }
a { color: var(--gruen); }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
.kopf { background: var(--gruen); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; }
.kopf .marke { font-weight: 700; letter-spacing: .3px; font-size: 1.1rem; }
.kopf .marke span { opacity: .75; font-weight: 500; }
.kopf .zurueck { background: none; border: 0; color: #fff; font-size: 1.6rem; padding: 0 6px 0 0; cursor: pointer; line-height: 1; }
.kopf .wer { margin-left: auto; background: rgba(255,255,255,.18); border-radius: 99px; padding: 4px 10px; font-size: .85rem; font-weight: 600; }
main { max-width: 760px; margin: 0 auto; padding: 18px 16px 24px; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 20px;
  border-radius: var(--radius); border: 0; background: var(--gruen); color: #fff; font-size: 1.05rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.knopf:active { transform: scale(.98); }
.knopf.breit { width: 100%; }
.knopf.zweit { background: var(--weiss); color: var(--gruen); border: 2px solid var(--gruen); }
.knopf.gefahr { background: var(--rot); }
.knopf.klein { min-height: 40px; padding: 8px 14px; font-size: .95rem; }
.knopf[disabled] { opacity: .5; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.knopfreihe > * { flex: 1 1 140px; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kachel { background: var(--weiss); border-radius: var(--radius); padding: 18px 14px; text-decoration: none; color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.06); border: 1px solid var(--linie); display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.kachel .sym { font-size: 2rem; }
.kachel b { font-size: 1.05rem; }
.kachel small { color: var(--grau); }

.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.karte.wichtig { border-left: 6px solid var(--gelb); }
.karte.storniert { opacity: .6; }
.karte.storniert .titel { text-decoration: line-through; }
.liste { list-style: none; padding: 0; margin: 0; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.liste li { border-bottom: 1px solid var(--linie); }
.liste li:last-child { border-bottom: 0; }
.liste a, .liste .zeile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); text-decoration: none; min-height: 56px; }
.liste .sym { font-size: 1.4rem; width: 1.8rem; text-align: center; }
.liste a > div, .liste .zeile > div { flex: 1; min-width: 0; }
.liste .rechts { margin-left: auto; color: var(--grau); font-size: .9rem; text-align: right; }
.liste .rechts { flex: 0 0 auto; }
.liste .pfeil::after { content: '›'; margin-left: 4px; color: var(--grau); font-size: 1.4rem; }
.klein { font-size: .88rem; color: var(--grau); }
.marke-tag { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--gruen-hell); color: var(--gruen); font-size: .8rem; font-weight: 600; margin: 2px 4px 2px 0; }
.marke-tag.rot { background: var(--rot-hell); color: var(--rot); }
.marke-tag.grau { background: #eee; color: var(--grau); }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=date], input:not([type]), textarea, select {
  width: 100%; font-size: 1.05rem; padding: 12px 14px; border: 1.5px solid var(--linie); border-radius: 10px; background: #fff; color: var(--text); font-family: inherit; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--gruen-hell); border-color: var(--gruen-mittel); }
textarea { min-height: 110px; }
.haken { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1.5px solid var(--linie); border-radius: 10px; margin-bottom: 8px; font-weight: 500; cursor: pointer; }
.haken input { width: 24px; height: 24px; accent-color: var(--gruen); }
.haken small { display: block; color: var(--grau); font-weight: 400; }

/* Stufenwahl je Baustein */
.stufen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: #eee; padding: 4px; border-radius: 12px; }
.stufen button { border: 0; background: transparent; padding: 10px 2px; border-radius: 9px; font-size: .82rem; font-weight: 600; color: var(--grau); cursor: pointer; min-height: 44px; }
.stufen button.an { background: #fff; color: var(--gruen); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.stufen button.an.s0 { color: var(--grau); }
.rechtzeile { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.rechtzeile .name { font-weight: 600; margin-bottom: 8px; }

table.tab { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; font-size: .92rem; }
table.tab th, table.tab td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.tab th { background: var(--gruen-hell); font-size: .82rem; }
.tabrahmen { overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--radius); }

.leiste { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--linie); display: flex;
  height: calc(var(--leiste) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.leiste a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--grau); text-decoration: none; font-size: .75rem; font-weight: 600; }
.leiste a .sym { font-size: 1.45rem; line-height: 1; }
.leiste a.aktiv { color: var(--gruen); }
.leiste a.aktiv .sym { transform: scale(1.1); }

.hinweis { background: var(--gruen-hell); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.hinweis.warn { background: #fff4d6; }
.hinweis.fehler { background: var(--rot-hell); color: var(--rot); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--leiste) + 16px + env(safe-area-inset-bottom)); background: var(--text); color: #fff;
  padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: 90vw; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.toast.fehler { background: var(--rot); }

.anmeldung { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.anmeldung .logo { font-size: 4rem; }
.anmeldung h1 { font-size: 2rem; margin-bottom: .2rem; }
.anmeldung .knopf { margin-top: 26px; min-height: 64px; font-size: 1.15rem; }
.qr { background: #fff; padding: 16px; border-radius: var(--radius); border: 1px solid var(--linie); text-align: center; }
.qr svg { width: min(260px, 70vw); height: auto; }
.codes { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; columns: 2; background: #fff; padding: 14px; border-radius: 10px; border: 1px dashed var(--erde); }
.fuss { text-align: center; font-size: .8rem; color: var(--grau); padding: 18px 10px 8px; }
.fuss a { color: var(--grau); }
.leer { text-align: center; color: var(--grau); padding: 30px 10px; }
.vorlage { white-space: pre-wrap; }
@media (min-width: 900px) { main { padding-top: 28px; } }
@media print { .leiste, .kopf, .knopf, .fuss { display: none !important; } body { padding: 0; background: #fff; } }
