:root {
  --grund: #f6f8f9; --flaeche: #ffffff; --linie: #e3e8ec; --text: #12181f; --leise: #66727e;
  --akzent: #0d9488; --akzent-weich: #ccfbf1; --gefahr: #c2410c;
  --radius: 14px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --grund: #0b0f14; --flaeche: #131a22; --linie: #222c37; --text: #e8eef3; --leise: #8b98a5;
    --akzent: #2dd4bf; --akzent-weich: #104a43; --gefahr: #fb923c; color-scheme: dark; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--grund); color: var(--text);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); min-height: 100vh; }

header { position: sticky; top: 0; z-index: 5; background: var(--grund);
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--linie); }
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.laden { display: inline-flex; align-items: center; gap: 8px; max-width: 60%;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.laden span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--leise); flex: none; }
.laden.aktiv .punkt { background: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-weich); }

#neu { display: flex; gap: 8px; }
#eingabe { flex: 1; min-width: 0; font: inherit; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); outline: none; }
#eingabe:focus { border-color: var(--akzent); }
#neu button { width: 50px; border: 0; border-radius: var(--radius); background: var(--akzent);
  color: var(--grund); font-size: 26px; font-weight: 600; cursor: pointer; }

main { padding: 8px 16px 40px; max-width: 640px; margin: 0 auto; }
.liste { list-style: none; margin: 0; padding: 0; }
.gruppe { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--leise);
  margin: 18px 4px 6px; }
.eintrag { display: flex; align-items: center; gap: 14px; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 14px; margin: 6px 0;
  cursor: pointer; user-select: none; transition: transform .12s ease, opacity .2s ease; }
.eintrag:active { transform: scale(0.985); }
.kreis { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--linie); flex: none;
  display: grid; place-items: center; }
.name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.von { font-size: 12px; color: var(--leise); }
.weg .eintrag, .eintrag.weg { opacity: 0; transform: translateX(30px); }
.erledigt .eintrag { background: transparent; }
.erledigt .name { color: var(--leise); text-decoration: line-through; }
.erledigt .kreis { background: var(--akzent); border-color: var(--akzent); }
.erledigt .kreis::after { content: ""; width: 6px; height: 11px; border: solid var(--grund);
  border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

details { margin-top: 26px; }
summary { cursor: pointer; color: var(--leise); padding: 6px 4px; list-style: none; display: flex; gap: 8px; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸"; transition: transform .15s; }
details[open] summary::before { transform: rotate(90deg); }
.zahl { background: var(--linie); border-radius: 999px; padding: 0 8px; font-size: 13px; }
.leise { background: none; border: 0; color: var(--leise); font: inherit; font-size: 15px; padding: 12px 4px; cursor: pointer; }
.leer, .hinweis { color: var(--leise); text-align: center; margin: 40px 0; }
.hinweis { margin: 10px 0; font-size: 14px; }

.zugang { position: fixed; inset: 0; background: var(--grund); display: grid; place-content: center;
  text-align: center; padding: 24px; z-index: 20; }
.zugang[hidden], .blatt[hidden], .meldung[hidden], [hidden] { display: none !important; }

.blatt { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 15; display: flex; align-items: flex-end; }
.blatt-innen { background: var(--flaeche); width: 100%; border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 75vh; overflow: auto; }
.blatt h2 { margin: 0 0 10px; font-size: 18px; }
#laden-liste { list-style: none; padding: 0; margin: 0 0 8px; }
#laden-liste li { padding: 14px 4px; border-bottom: 1px solid var(--linie); cursor: pointer; display: flex; justify-content: space-between; }
#laden-liste li small { color: var(--leise); }
.blatt-innen .leise { display: block; width: 100%; text-align: left; }

.meldung { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--grund); padding: 10px 16px; border-radius: 999px; font-size: 15px; z-index: 30;
  display: flex; gap: 14px; align-items: center; max-width: calc(100% - 32px); }
.meldung button { background: none; border: 0; color: var(--akzent); font: inherit; font-weight: 600; cursor: pointer; }
