:root {
  --bg: #f4f5f7; --kachel: #fff; --text: #1c2430; --leise: #667085; --linie: #e3e6ea;
  --blau: #0b5cad; --blau-text: #fff; --rot: #b42318; --stern: #e0a100;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161c; --kachel: #1c222b; --text: #e8ecf1; --leise: #9aa5b4; --linie: #2b3340; --blau: #5aa2ec; --blau-text: #0a1624; --rot: #ff8a80; --stern: #f5c542; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 0 0 calc(5rem + env(safe-area-inset-bottom)); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--blau); }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }
[hidden] { display: none !important; }

.kopf { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .25rem; min-height: 3.5rem;
  padding: env(safe-area-inset-top) .5rem 0; background: var(--blau); color: var(--blau-text); }
.kopf h1 { flex: 1; min-width: 0; margin: 0; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knopf { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%;
  background: none; color: inherit; font-size: 1.7rem; text-decoration: none; }
.knopf:hover { background: rgba(255, 255, 255, .18); }
.status { margin: 0; padding: .5rem 1rem; background: var(--stern); color: #1c1500; font-size: .95rem; }
.status a { color: inherit; font-weight: 600; }

main { max-width: 40rem; margin: 0 auto; padding: .75rem .75rem 0; }
.liste { list-style: none; margin: 0 0 .75rem; padding: 0; background: var(--kachel); border-radius: .75rem; overflow: hidden; }
.liste:empty { display: none; }
.liste > li + li { border-top: 1px solid var(--linie); }
.leer { padding: 1rem; color: var(--leise); }
.zeile { display: flex; align-items: center; gap: .25rem; min-height: 3.25rem; padding: .15rem .35rem; }
.listenzeile { gap: .75rem; padding: .5rem .85rem; color: inherit; text-decoration: none; }
.emoji { font-size: 1.5rem; }
.name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.zahl { color: var(--leise); }

.kreis { flex: none; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; background: none; color: var(--blau-text); position: relative; }
.kreis::before { content: ""; position: absolute; inset: .6rem; border: 2px solid var(--leise); border-radius: 50%; }
.fertig .kreis::before { background: var(--blau); border-color: var(--blau); }
.kreis { font-size: .9rem; }
.text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: .4rem .25rem; border: 0; background: none; text-align: left; overflow-wrap: anywhere; }
.notiz { color: var(--leise); font-size: .85rem; }
.fertig .t { text-decoration: line-through; color: var(--leise); }
.stern { flex: none; width: 2.75rem; height: 2.75rem; border: 0; background: none; font-size: 1.4rem; color: var(--leise); }
.stern.an { color: var(--stern); }

.neu input, .editor input, .menue input { width: 100%; padding: .8rem .9rem; border: 1px solid var(--linie); border-radius: .75rem; background: var(--kachel); }
.neu { margin: 0 0 .75rem; }
.editor { padding: .6rem; }
.editor form { width: 100%; }
.editor input + input { margin-top: .5rem; }
.knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.knoepfe button, .menue button, .anmelden button { padding: .6rem 1rem; border: 1px solid var(--linie); border-radius: .6rem; background: var(--kachel); }
.editor .knoepfe button:first-child, .menue button:not([type=button]), .anmelden button:not(.zweit) { background: var(--blau); border-color: var(--blau); color: var(--blau-text); }
.gefahr { color: var(--rot); }
.menue { margin: 0 0 .75rem; padding: .6rem; background: var(--kachel); border-radius: .75rem; }
.zeile { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.editor { -webkit-user-select: auto; user-select: auto; }
.knoepfe button { min-height: 2.75rem; }
.abschn { background: var(--bg); min-height: 2.5rem; }
.abschn .t { font-weight: 600; color: var(--leise); text-transform: uppercase; font-size: .8rem; letter-spacing: .04em; }
.zieht { position: relative; z-index: 2; background: var(--kachel); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.vor { box-shadow: inset 0 3px 0 var(--blau); }
.liste.ende { box-shadow: inset 0 -3px 0 var(--blau); }
.vorschlag { margin-top: -.5rem; }
.vorschlagknopf { display: block; width: 100%; padding: .7rem .9rem; border: 0; background: none; text-align: left; overflow-wrap: anywhere; }
.sortierung { display: block; margin-bottom: .6rem; color: var(--leise); }
.sortierung select, .editor select { width: 100%; padding: .6rem; margin-top: .5rem; border: 1px solid var(--linie); border-radius: .6rem; background: var(--kachel); }
.menuezeile { display: flex; gap: .5rem; margin-bottom: .6rem; }
.menuezeile .emojifeld { width: 4.2rem; text-align: center; flex: none; }
.erlkopf { display: block; margin: 0 0 .5rem; padding: .6rem .25rem; border: 0; background: none; color: var(--leise); }

.undo { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; display: flex;
  align-items: center; gap: 1rem; width: calc(100% - 1.5rem); max-width: 28rem; padding: .5rem .5rem .5rem 1rem; border-radius: .75rem;
  background: #263040; color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); }
.undo span { flex: 1; }
.undo button { padding: .55rem .9rem; border: 0; border-radius: .5rem; background: #5aa2ec; color: #0a1624; font-weight: 600; }
.fuss { max-width: 40rem; margin: 1rem auto 0; padding: 0 1rem; text-align: center; font-size: .9rem; }
.fuss a { color: var(--leise); }

.seite .anmelden { max-width: 22rem; margin: 3rem auto; padding: 0 1rem; }
.anmelden form { display: grid; gap: .75rem; }
.anmelden input { width: 100%; padding: .8rem .9rem; border: 1px solid var(--linie); border-radius: .6rem; background: var(--kachel); }
.meldung { padding: .75rem 1rem; border-radius: .6rem; background: var(--kachel); border: 1px solid var(--rot); }
@media (prefers-reduced-motion: no-preference) { .kreis::before { transition: background .15s; } }
