@font-face {
  font-family: "Sora";
  src: url("assets/sora-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sora";
  src: url("assets/sora-latin-ext.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f5f7f9;
  --paper-2: #eef2f3;
  --card: #ffffff;
  --ink: #232328;
  --body: #4b4f54;
  --muted: #697174;
  --line: #dfe4e7;
  --green: #19be84;
  --green-text: #0b8058;
  --green-pale: #e5f6ef;
  --danger: #b3261e;
  --nav-h: 72px;
  --radius: 12px;
  --kopf: "Sora", system-ui, sans-serif;
  --text: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color: var(--ink); background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--green-text); outline-offset: 2px; }
.unsichtbar {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.seite {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom));
}

/* Kopf */
.marke { display: flex; align-items: center; gap: 8px; }
.marke img { display: block; }
.marke-name {
  font-family: var(--kopf); font-weight: 700; font-size: .875rem; letter-spacing: .08em; color: var(--ink);
}
h1 {
  margin: 18px 0 2px;
  font-family: var(--kopf);
  font-weight: 800;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.datum { margin: 0; color: var(--muted); }
.stand { margin-top: 16px; }
.stand-zahl { margin: 0 0 6px; font-weight: 600; color: var(--ink); }
.balken { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.balken span { display: block; height: 100%; width: 0; background: var(--green); transition: width .25s ease; }

/* Eingabe */
.eingabe {
  margin-top: 20px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feld-label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--ink); }
.feld-zeile { display: flex; gap: 8px; }
.feld-zeile input {
  flex: 1 1 auto; min-width: 0;
  height: 52px; padding: 0 14px;
  background: var(--paper);
  border: 2px solid var(--muted);
  border-radius: 10px;
  font-size: 1.0625rem;
}
.feld-zeile input::placeholder { color: var(--muted); }
.feld-zeile input:focus-visible { outline: none; border-color: var(--green-text); }
.feld-zeile input[aria-invalid="true"] { border-color: var(--danger); background: #fff; }
.knopf-haupt {
  flex: 0 0 auto;
  height: 52px; padding: 0 18px;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 10px;
  font-weight: 600;
}
.knopf-haupt:hover { background: var(--body); }
.fehler {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 0;
  color: var(--danger); font-weight: 600; font-size: 1rem;
}
.fehler span {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: .875rem; font-weight: 700;
}
.fehler[hidden] { display: none; }
.warnung {
  margin: 12px 0 0; padding: 12px 14px;
  background: #fbf3de; border: 1px solid #d5a030; border-radius: 10px; color: #8a650f;
}

/* Filter: am Handy die Leiste unten */
.filter {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
}
.filter button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px;
  background: transparent;
  border: 0; border-radius: 10px;
  font-weight: 600; color: var(--body);
}
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.anzahl {
  min-width: 26px; padding: 1px 7px;
  border-radius: 6px;
  background: var(--paper-2); color: var(--ink);
  font-size: .875rem; font-weight: 700; text-align: center;
}
.filter button[aria-pressed="true"] .anzahl { background: var(--green); color: var(--ink); }

/* Liste */
.liste-bereich { margin-top: 16px; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aufgabe {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 4px 6px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.aufgabe input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto;
  width: 48px; height: 48px; margin: 0;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 10px;
  cursor: pointer;
}
.aufgabe input[type="checkbox"]::before {
  content: "";
  width: 28px; height: 28px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--card) center / 18px no-repeat;
}
.aufgabe input[type="checkbox"]:checked::before {
  background-color: var(--green);
  border-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='%23232328' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.aufgabe label {
  flex: 1 1 auto; min-width: 0;
  padding: 10px 4px;
  color: var(--ink);
  overflow-wrap: anywhere;
  cursor: pointer;
}
.aufgabe.erledigt label { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.loeschen {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 10px;
  color: var(--muted);
}
.loeschen:hover { color: var(--ink); background: var(--paper-2); }
.loeschen svg { width: 22px; height: 22px; }

.leer {
  padding: 28px 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.leer[hidden] { display: none; }
.leer-titel { margin: 0 0 4px; font-family: var(--kopf); font-weight: 700; font-size: 1.125rem; color: var(--ink); }
.leer-text { margin: 0; color: var(--body); }

/* Rückgängig-Meldung über der Leiste */
.meldung {
  position: fixed; z-index: 20;
  left: 12px; right: 12px;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px;
  max-width: 616px; margin: 0 auto;
  padding: 6px 6px 6px 16px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgb(35 35 40 / .18);
}
.meldung[hidden] { display: none; }
.meldung-text { flex: 1 1 auto; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meldung-knopf {
  flex: 0 0 auto;
  min-height: 48px; padding: 0 14px;
  background: transparent; border: 0; border-radius: 8px;
  color: var(--green); font-weight: 700;
}
.meldung-knopf:hover { background: rgb(255 255 255 / .08); }
.meldung-knopf:focus-visible { outline-color: var(--green); }

/* Breite Bildschirme: Leiste oben über der Liste */
@media (min-width: 900px) {
  .seite { padding-top: 40px; padding-bottom: 120px; }
  .filter {
    position: static;
    margin-top: 20px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .meldung { bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .balken span { transition: none; }
}
