/* Familienportal — eine Datei, kein Framework, keine fremden Schriften.
 *
 * Zuerst fürs Handy gebaut: große Flächen zum Antippen, kräftiger Kontrast,
 * nichts, was auf einem kleinen Bildschirm zusammenrutscht.
 *
 * Die Schriften kommen ausschließlich vom Gerät. Eine geladene Hausschrift
 * wäre eine fremde Quelle — und die Seite lädt nichts von außen. Für die
 * Überschriften nimmt sie deshalb die Serifenschrift, die jedes System
 * mitbringt; das gibt Charakter, ohne ein Byte zu kosten.
 */

:root {
  --grund: #f6f4ef;          /* warmes Papier statt kaltem Weiß */
  --grund-tief: #ece8e0;
  --karte: #fffdfa;
  --linie: #e2ddd2;
  --linie-zart: #efebe3;
  --text: #23201b;
  --leise: #6f6a60;
  --akzent: #2f6f4e;
  --akzent-tief: #245740;
  --akzent-hell: #e7f1ea;
  --warn: #a2402a;
  --warn-hell: #faeeea;
  --schatten: 0 1px 2px rgba(35, 32, 27, .05), 0 6px 18px rgba(35, 32, 27, .05);
  --schatten-tief: 0 2px 4px rgba(35, 32, 27, .07), 0 12px 32px rgba(35, 32, 27, .09);
  --rund: 14px;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #15171a;
    --grund-tief: #101215;
    --karte: #1e2126;
    --linie: #333840;
    --linie-zart: #282c33;
    --text: #f1eee8;
    --leise: #a5a29a;
    --akzent: #74c79c;
    --akzent-tief: #8fd6b1;
    --akzent-hell: #1d2f26;
    --warn: #ef9077;
    --warn-hell: #33201c;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .3);
    --schatten-tief: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 44rem; margin: 0 auto; padding: 1.2rem 1rem 5rem; }

h1 {
  font-family: var(--serif);
  font-size: 1.75rem; font-weight: 600; letter-spacing: -0.01em;
  margin: 1.4rem 0 0.5rem; line-height: 1.2;
}
h2 {
  font-size: 0.78rem; margin: 2rem 0 0.7rem; color: var(--leise);
  text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700;
}
.karte h2 { margin-top: 0.2rem; }
a { color: var(--akzent-tief); text-underline-offset: 2px; }

/* --- Kopf und Navigation ------------------------------------------------ */
header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.75rem 1rem;
  background: var(--karte); border-bottom: 1px solid var(--linie);
}
header .ich { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
header .wer { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
header .wer strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header .rolle { font-size: 0.78rem; color: var(--leise); }

.bildchen {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--linie-zart);
  background: var(--grund-tief);
}
.bildchen.ersatz {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.15rem; color: var(--leise);
}

nav {
  display: flex; gap: 0.15rem; overflow-x: auto; scrollbar-width: none;
  padding: 0 0.6rem; background: var(--karte);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 5;
}
nav::-webkit-scrollbar { display: none; }
nav a {
  padding: 0.75rem 0.75rem; text-decoration: none; color: var(--leise);
  white-space: nowrap; border-bottom: 2.5px solid transparent; font-size: 0.93rem;
}
nav a.hier { color: var(--text); border-bottom-color: var(--akzent); font-weight: 600; }

/* --- Begrüßung ---------------------------------------------------------- */
.begruessung { margin: 0.5rem 0 1.6rem; }
.begruessung h1 { margin-bottom: 0.15rem; }
.datum { color: var(--leise); font-size: 0.92rem; margin: 0; }

.fortschritt { display: flex; align-items: center; gap: 0.7rem; margin-top: 1rem; }
.schiene {
  flex: 1 1 auto; height: 7px; border-radius: 99px;
  background: var(--grund-tief); overflow: hidden;
}
.fuellung {
  height: 100%; border-radius: 99px; background: var(--akzent);
  transition: width .35s ease;
}
.stand { flex: 0 0 auto; font-size: 0.82rem; color: var(--leise);
         font-variant-numeric: tabular-nums; }

/* --- Karten und Meldungen ----------------------------------------------- */
.karte {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--rund); padding: 1.15rem 1.2rem; margin: 1.1rem 0;
  box-shadow: var(--schatten);
}
.karte.schmal { max-width: 23rem; margin: 3rem auto; padding: 1.6rem 1.4rem; }
.karte.hervor { border-color: var(--akzent); background: var(--akzent-hell); }
.karte.warnkarte { border-color: var(--warn); }
.willkommen { text-align: center; }
.willkommen h1 { margin-top: 0.6rem; }
.willkommen form { text-align: left; margin-top: 1.2rem; }

.leerlauf { text-align: center; padding: 2rem 1.2rem; }
.leerlauf p { margin: 0.3rem 0; }
.gross-zeichen { font-size: 2.4rem; line-height: 1; margin-bottom: 0.6rem !important; }
.fertig-alles { border-color: var(--akzent); background: var(--akzent-hell); }
.fertig-alles .gross-zeichen { color: var(--akzent); }

.meldung, .fehler {
  padding: 0.75rem 0.95rem; border-radius: 10px; margin: 1rem 0; font-size: 0.94rem;
}
.meldung { background: var(--akzent-hell); color: var(--text);
           border: 1px solid var(--akzent); }
.fehler  { background: var(--warn-hell); color: var(--text);
           border: 1px solid var(--warn); }

.ruhig { color: var(--leise); font-size: 0.89rem; }
.leise-link { color: var(--leise); font-size: 0.89rem; }
.zahl { color: var(--leise); font-weight: 500; }
.passwort {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.3rem; letter-spacing: 0.02em; word-break: break-all;
  background: var(--karte); border: 1px dashed var(--akzent);
  border-radius: 10px; padding: 0.8rem; user-select: all; text-align: center;
}

/* --- Das Familienbild --------------------------------------------------- */
.bild-gross {
  display: block; width: 100%; max-height: 15rem; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--linie-zart);
  background: var(--grund-tief); margin-bottom: 0.8rem;
}
.willkommen .bild-gross { max-height: 11rem; }
.leerbild {
  display: flex; align-items: center; justify-content: center;
  height: 8rem; font-size: 2.5rem; border-radius: 12px;
  border: 2px dashed var(--linie); background: var(--grund-tief);
  margin-bottom: 0.8rem;
}

/* --- Aufgabenzeilen: die ganze Zeile ist der Knopf ---------------------- */
form.zeile { margin: 0 0 0.55rem; }
form.zeile button {
  display: flex; align-items: center; gap: 0.85rem; width: 100%;
  padding: 0.95rem 1rem; text-align: left; cursor: pointer;
  background: var(--karte); color: var(--text);
  border: 1px solid var(--linie); border-radius: var(--rund);
  font: inherit; min-height: 3.6rem; box-shadow: var(--schatten);
  transition: box-shadow .18s ease, border-color .18s ease, transform .06s ease;
}
form.zeile button:hover { border-color: var(--akzent); box-shadow: var(--schatten-tief); }
form.zeile button:active { transform: scale(.994); }
form.zeile .haken {
  flex: 0 0 auto; width: 1.85rem; height: 1.85rem; border-radius: 50%;
  border: 2px solid var(--linie); display: flex; align-items: center;
  justify-content: center; font-size: 1.05rem; line-height: 1;
  transition: background .18s ease, border-color .18s ease;
}
form.zeile button:hover .haken { border-color: var(--akzent); }
form.zeile .text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
form.zeile .titel { font-weight: 600; }
form.zeile .notiz { color: var(--leise); font-size: 0.86rem; margin-top: 0.1rem; }
form.zeile.erledigt button { background: var(--akzent-hell); border-color: transparent;
                             box-shadow: none; }
form.zeile.erledigt .haken { border-color: var(--akzent); background: var(--akzent);
                             color: var(--karte); }
form.zeile.erledigt .titel { color: var(--leise); text-decoration: line-through;
                             text-decoration-thickness: 1px; }

/* Zeile plus kleines Minus daneben — nur bei mehrmals-pro-Zeitraum. */
.zeilenpaar { display: flex; align-items: stretch; gap: 0.45rem; margin-bottom: 0.55rem; }
.zeilenpaar form.zeile { flex: 1 1 auto; margin: 0; min-width: 0; }
.minus { flex: 0 0 auto; margin: 0; }
.minus button {
  height: 100%; min-width: 3rem; font-size: 1.3rem; line-height: 1;
  border-radius: var(--rund); padding: 0 0.7rem;
}

/* Angefangen, aber noch nicht fertig: sichtbar unterwegs, nicht abgehakt. */
form.zeile.teils button { border-color: var(--akzent); }
form.zeile.teils .haken {
  border-color: var(--akzent); color: var(--akzent); font-weight: 700;
  font-size: 0.95rem;
}
form.zeile.bedarf button { background: transparent; box-shadow: none;
                           border-style: dashed; }
form.zeile button[disabled] { cursor: default; opacity: 1; }
.marke.zaehler { border-color: var(--akzent); color: var(--akzent); }
.hinweis { margin: -0.3rem 0 0.7rem; }

.marke {
  flex: 0 0 auto; font-size: 0.72rem; color: var(--leise);
  border: 1px solid var(--linie); border-radius: 999px; padding: 0.18rem 0.6rem;
  white-space: nowrap; letter-spacing: 0.01em;
}
.marke.warn { color: var(--warn); border-color: var(--warn); }
.marke.dringend { color: var(--warn); border-color: var(--warn);
                  background: var(--warn-hell); font-weight: 600; }

/* --- Filterleiste (nur Verwaltung) -------------------------------------- */
.filter {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--rund); padding: 0.75rem 0.9rem; margin: 1rem 0;
  box-shadow: var(--schatten);
}
.filtergruppe { display: flex; align-items: center; flex-wrap: wrap;
                gap: 0.35rem; margin: 0.35rem 0; }
.filterwas {
  flex: 0 0 3.6rem; font-size: 0.72rem; color: var(--leise);
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700;
}
.filterknopf {
  display: inline-block; padding: 0.35rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--linie); color: var(--leise);
  text-decoration: none; font-size: 0.87rem; white-space: nowrap;
}
.filterknopf:hover { border-color: var(--akzent); color: var(--text); }
.filterknopf.an { background: var(--akzent); border-color: var(--akzent);
                  color: #fff; font-weight: 600; }
.filter p { margin: 0.6rem 0 0; }
@media (prefers-color-scheme: dark) { .filterknopf.an { color: #10221a; } }

input.daneben { display: inline-block; width: auto; margin: 0 0 0 0.4rem;
                min-height: 2.4rem; padding: 0.35rem 0.5rem; }

/* --- Formulare ---------------------------------------------------------- */
label { display: block; margin: 1rem 0; font-size: 0.88rem; color: var(--leise);
        font-weight: 500; }
input, select {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.75rem 0.85rem;
  font: inherit; color: var(--text); background: var(--grund);
  border: 1px solid var(--linie); border-radius: 10px; min-height: 3rem;
}
input[type="file"] { padding: 0.6rem; background: var(--grund-tief); }
input:focus, select:focus, button:focus-visible {
  outline: 3px solid var(--akzent); outline-offset: 1px;
}
fieldset { border: 1px solid var(--linie); border-radius: 10px; margin: 1rem 0;
           padding: 0.7rem 0.95rem; }
legend { color: var(--leise); font-size: 0.82rem; padding: 0 0.35rem;
         text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
label.radio { display: flex; align-items: flex-start; gap: 0.65rem; color: var(--text);
              margin: 0.6rem 0; font-size: 0.94rem; font-weight: 400; }
label.radio input { width: auto; margin: 0.25rem 0 0; min-height: 0; }

button {
  font: inherit; font-weight: 600; cursor: pointer; padding: 0.7rem 1.15rem;
  background: var(--akzent); color: #fff; border: 0; border-radius: 10px;
  min-height: 3rem; transition: background .15s ease;
}
button:hover { background: var(--akzent-tief); }
button.gross { width: 100%; font-size: 1.02rem; }
button.leise { background: transparent; color: var(--leise);
               border: 1px solid var(--linie); font-weight: 500; }
button.leise:hover { background: var(--grund-tief); color: var(--text); }
button[disabled] { opacity: 0.4; cursor: not-allowed; }
.knopfzeile { display: inline-block; margin: 0.3rem 0.3rem 0 0; }

@media (prefers-color-scheme: dark) { button { color: #10221a; } }

/* --- Tabellen (nur Verwaltung) ------------------------------------------ */
table { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1rem;
        font-size: 0.9rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 0.65rem 0.7rem;
         border-bottom: 1px solid var(--linie-zart); vertical-align: top; }
th { color: var(--leise); font-size: 0.72rem; text-transform: uppercase;
     letter-spacing: 0.07em; font-weight: 700; }
tr.still td { opacity: 0.55; }
tr.laut td { background: var(--warn-hell); }
.wann { color: var(--leise); font-size: 0.8rem; }
.ja { color: var(--akzent); font-weight: 600; }
.nein { color: var(--leise); }
ul.liste { margin: 0.5rem 0; padding-left: 1.15rem; }
ul.liste li { margin: 0.5rem 0; }

/* Wer Bewegung im System abgeschaltet hat, bekommt hier auch keine. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
