/* Fotoaufgaben-Upload – Gästeseiten.
   Mobile zuerst; die Seiten werden fast ausschließlich auf Telefonen
   geöffnet, oft in schlechtem Licht und mit einer Hand. Daher große
   Tap-Ziele und kräftiger Kontrast.

   Farbkonzept aus der Deko: Kraftpapier und Jute (Einladungen,
   Namensschilder), Eukalyptus und Schleierkraut. Bewusst nur ein helles
   Schema – die Deko ist hell, und so sieht jedes Handy dasselbe.

     Leinen      --bg           ungebleichtes Papier als Grund
     Schleier-   --flaeche      fast weiß, für Kästen und Kacheln
       kraut
     Walnuss     --text         Schrift, wie Druck auf Kraftpapier
     Eukalyptus  --akzent       alles, was man antippt: Knöpfe, Links, Balken
     Kraftpapier --kraft        Deko: Juteband oben, Schleife, Anhänger
     Kraft dunkel --nummer      Aufgabennummern (Schrift auf Kraft-Ton)

   Alle Schriftfarben halten mindestens 4,5 : 1 gegen ihren Grund. */

:root {
  color-scheme: light;

  --bg:          #f4ecdf;
  --flaeche:     #fffcf7;
  --text:        #3b2f25;
  --leise:       #6b5c4d;
  --akzent:      #4d6a5c;
  --akzent-text: #ffffff;
  --akzent-zart: #e3ebe5;
  --kraft:       #b68d5e;
  --kraft-zart:  #ecdcc3;
  --nummer:      #7e5a36;
  --rand:        #e2d4bf;
  --warnung-bg:  #f9ecd9;
  --warnung-rand: #d8b58a;
  --ok:          #4d6a5c;
  --fehler:      #9a4434;

  --schatten: 0 1px 2px rgba(59, 47, 37, 0.06);
  --radius: 0.7rem;
  --seite-max: 34rem;

  /* Eukalyptuszweig mit Schleierkraut und Juteschleife. */
  --zweig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 56'%3E%3Cstyle%3Epath{stroke:%23a79c86;stroke-width:.6;fill:none;stroke-linecap:round}.b{fill:%23fffdf8;stroke:%23c9baa2;stroke-width:.5}%3C/style%3E%3Cpath d='M141.8 33.5L149 19.2'/%3E%3Cpath d='M149 19.2L155 18' stroke-width='.35'/%3E%3Ccircle cx='155' cy='18' r='1.6' class='b'/%3E%3Cpath d='M149 19.2L144.6 18.1' stroke-width='.35'/%3E%3Ccircle cx='144.6' cy='18.1' r='1.8' class='b'/%3E%3Cpath d='M149 19.2L143.3 17.5' stroke-width='.35'/%3E%3Ccircle cx='143.3' cy='17.5' r='1.8' class='b'/%3E%3Cpath d='M149 19.2L151.7 13.6' stroke-width='.35'/%3E%3Ccircle cx='151.7' cy='13.6' r='1.9' class='b'/%3E%3Cpath d='M149 19.2L151.2 19.9' stroke-width='.35'/%3E%3Ccircle cx='151.2' cy='19.9' r='1.2' class='b'/%3E%3Cpath d='M149 19.2L149.4 15.3' stroke-width='.35'/%3E%3Ccircle cx='149.4' cy='15.3' r='1.4' class='b'/%3E%3Cpath d='M149 19.2L142.4 18.1' stroke-width='.35'/%3E%3Ccircle cx='142.4' cy='18.1' r='1.8' class='b'/%3E%3Cpath d='M165.1 34.3L172.7 48.8'/%3E%3Cpath d='M172.7 48.8L172.7 51' stroke-width='.35'/%3E%3Ccircle cx='172.7' cy='51' r='1.4' class='b'/%3E%3Cpath d='M172.7 48.8L179.7 54.5' stroke-width='.35'/%3E%3Ccircle cx='179.7' cy='54.5' r='1.7' class='b'/%3E%3Cpath d='M172.7 48.8L170.2 47.2' stroke-width='.35'/%3E%3Ccircle cx='170.2' cy='47.2' r='1.2' class='b'/%3E%3Cpath d='M172.7 48.8L176.5 49.7' stroke-width='.35'/%3E%3Ccircle cx='176.5' cy='49.7' r='1.5' class='b'/%3E%3Cpath d='M172.7 48.8L179.1 51.6' stroke-width='.35'/%3E%3Ccircle cx='179.1' cy='51.6' r='1.3' class='b'/%3E%3Cpath d='M172.7 48.8L178.5 50.5' stroke-width='.35'/%3E%3Ccircle cx='178.5' cy='50.5' r='1.5' class='b'/%3E%3Cpath d='M172.7 48.8L166.8 51.4' stroke-width='.35'/%3E%3Ccircle cx='166.8' cy='51.4' r='1.4' class='b'/%3E%3Cpath d='M179.7 33.1L185.2 19.8'/%3E%3Cpath d='M185.2 19.8L191.7 21.6' stroke-width='.35'/%3E%3Ccircle cx='191.7' cy='21.6' r='1.4' class='b'/%3E%3Cpath d='M185.2 19.8L179.6 14.6' stroke-width='.35'/%3E%3Ccircle cx='179.6' cy='14.6' r='1.3' class='b'/%3E%3Cpath d='M185.2 19.8L186 19' stroke-width='.35'/%3E%3Ccircle cx='186' cy='19' r='1.7' class='b'/%3E%3Cpath d='M185.2 19.8L180 20.7' stroke-width='.35'/%3E%3Ccircle cx='180' cy='20.7' r='1.5' class='b'/%3E%3Cpath d='M185.2 19.8L181.1 16' stroke-width='.35'/%3E%3Ccircle cx='181.1' cy='16' r='1.8' class='b'/%3E%3Cpath d='M185.2 19.8L182.4 22.4' stroke-width='.35'/%3E%3Ccircle cx='182.4' cy='22.4' r='1.5' class='b'/%3E%3Cpath d='M185.2 19.8L190.1 20.7' stroke-width='.35'/%3E%3Ccircle cx='190.1' cy='20.7' r='1.9' class='b'/%3E%3Cpath d='M202.1 28.6L208.2 41.7'/%3E%3Cpath d='M208.2 41.7L212 40.9' stroke-width='.35'/%3E%3Ccircle cx='212' cy='40.9' r='1.3' class='b'/%3E%3Cpath d='M208.2 41.7L202.5 42.8' stroke-width='.35'/%3E%3Ccircle cx='202.5' cy='42.8' r='1.6' class='b'/%3E%3Cpath d='M208.2 41.7L206.4 43.2' stroke-width='.35'/%3E%3Ccircle cx='206.4' cy='43.2' r='1.5' class='b'/%3E%3Cpath d='M208.2 41.7L209.3 45' stroke-width='.35'/%3E%3Ccircle cx='209.3' cy='45' r='1.3' class='b'/%3E%3Cpath d='M208.2 41.7L213.9 44.7' stroke-width='.35'/%3E%3Ccircle cx='213.9' cy='44.7' r='1.3' class='b'/%3E%3Cpath d='M208.2 41.7L211.6 45.6' stroke-width='.35'/%3E%3Ccircle cx='211.6' cy='45.6' r='1.9' class='b'/%3E%3Cpath d='M208.2 41.7L213.6 43.3' stroke-width='.35'/%3E%3Ccircle cx='213.6' cy='43.3' r='1.3' class='b'/%3E%3Cpath d='M214.1 24.9L219.3 9'/%3E%3Cpath d='M219.3 9L215.7 10.1' stroke-width='.35'/%3E%3Ccircle cx='215.7' cy='10.1' r='1.8' class='b'/%3E%3Cpath d='M219.3 9L220.7 7' stroke-width='.35'/%3E%3Ccircle cx='220.7' cy='7' r='1.7' class='b'/%3E%3Cpath d='M219.3 9L213.3 5.7' stroke-width='.35'/%3E%3Ccircle cx='213.3' cy='5.7' r='1.8' class='b'/%3E%3Cpath d='M219.3 9L220.9 5.4' stroke-width='.35'/%3E%3Ccircle cx='220.9' cy='5.4' r='1.3' class='b'/%3E%3Cpath d='M219.3 9L212.6 6.3' stroke-width='.35'/%3E%3Ccircle cx='212.6' cy='6.3' r='1.2' class='b'/%3E%3Cpath d='M219.3 9L214.8 6.8' stroke-width='.35'/%3E%3Ccircle cx='214.8' cy='6.8' r='1.3' class='b'/%3E%3Cpath d='M219.3 9L217.4 10.2' stroke-width='.35'/%3E%3Ccircle cx='217.4' cy='10.2' r='1.7' class='b'/%3E%3Cpath d='M120 30Q175 42 224 21' style='stroke:%237f8f78;stroke-width:1.5'/%3E%3Cellipse cx='132.1' cy='23.5' rx='7.7' ry='7' fill='%239db3a5' stroke='none'/%3E%3Cellipse cx='143' cy='41.6' rx='7.3' ry='6.6' fill='%2386a092' stroke='none'/%3E%3Cellipse cx='154.7' cy='26.7' rx='6.8' ry='6.1' fill='%23b3c6b9' stroke='none'/%3E%3Cellipse cx='166.3' cy='41.3' rx='6.3' ry='5.6' fill='%237b9587' stroke='none'/%3E%3Cellipse cx='177.8' cy='26.9' rx='5.8' ry='5.2' fill='%239db3a5' stroke='none'/%3E%3Cellipse cx='189.1' cy='37.9' rx='5.3' ry='4.7' fill='%2386a092' stroke='none'/%3E%3Cellipse cx='199.3' cy='24.1' rx='4.8' ry='4.3' fill='%23b3c6b9' stroke='none'/%3E%3Cellipse cx='209.4' cy='32' rx='4.3' ry='3.9' fill='%237b9587' stroke='none'/%3E%3Cellipse cx='218.3' cy='19.1' rx='3.9' ry='3.5' fill='%239db3a5' stroke='none'/%3E%3Cellipse cx='225.2' cy='25.4' rx='3.6' ry='3.2' fill='%2386a092' stroke='none'/%3E%3Cpath d='M98.2 33.5L89.8 19.1'/%3E%3Cpath d='M89.8 19.1L84.7 15.4' stroke-width='.35'/%3E%3Ccircle cx='84.7' cy='15.4' r='1.8' class='b'/%3E%3Cpath d='M89.8 19.1L92.6 22.8' stroke-width='.35'/%3E%3Ccircle cx='92.6' cy='22.8' r='1.6' class='b'/%3E%3Cpath d='M89.8 19.1L89.5 20.3' stroke-width='.35'/%3E%3Ccircle cx='89.5' cy='20.3' r='1.9' class='b'/%3E%3Cpath d='M89.8 19.1L83.8 18' stroke-width='.35'/%3E%3Ccircle cx='83.8' cy='18' r='1.8' class='b'/%3E%3Cpath d='M89.8 19.1L93.1 19.2' stroke-width='.35'/%3E%3Ccircle cx='93.1' cy='19.2' r='1.8' class='b'/%3E%3Cpath d='M89.8 19.1L87.7 18.8' stroke-width='.35'/%3E%3Ccircle cx='87.7' cy='18.8' r='1.8' class='b'/%3E%3Cpath d='M89.8 19.1L88.6 19.7' stroke-width='.35'/%3E%3Ccircle cx='88.6' cy='19.7' r='1.6' class='b'/%3E%3Cpath d='M74.9 34.3L66.7 47.8'/%3E%3Cpath d='M66.7 47.8L67.9 48.8' stroke-width='.35'/%3E%3Ccircle cx='67.9' cy='48.8' r='1.6' class='b'/%3E%3Cpath d='M66.7 47.8L73.6 52.3' stroke-width='.35'/%3E%3Ccircle cx='73.6' cy='52.3' r='1.5' class='b'/%3E%3Cpath d='M66.7 47.8L70 49.3' stroke-width='.35'/%3E%3Ccircle cx='70' cy='49.3' r='1.8' class='b'/%3E%3Cpath d='M66.7 47.8L60.9 49.8' stroke-width='.35'/%3E%3Ccircle cx='60.9' cy='49.8' r='1.6' class='b'/%3E%3Cpath d='M66.7 47.8L66.5 47' stroke-width='.35'/%3E%3Ccircle cx='66.5' cy='47' r='1.5' class='b'/%3E%3Cpath d='M66.7 47.8L68.3 51.7' stroke-width='.35'/%3E%3Ccircle cx='68.3' cy='51.7' r='1.2' class='b'/%3E%3Cpath d='M66.7 47.8L63.9 49.6' stroke-width='.35'/%3E%3Ccircle cx='63.9' cy='49.6' r='1.3' class='b'/%3E%3Cpath d='M60.3 33.1L50.8 18.5'/%3E%3Cpath d='M50.8 18.5L49.9 20.9' stroke-width='.35'/%3E%3Ccircle cx='49.9' cy='20.9' r='1.7' class='b'/%3E%3Cpath d='M50.8 18.5L46.5 16.3' stroke-width='.35'/%3E%3Ccircle cx='46.5' cy='16.3' r='1.8' class='b'/%3E%3Cpath d='M50.8 18.5L56.1 16.4' stroke-width='.35'/%3E%3Ccircle cx='56.1' cy='16.4' r='1.4' class='b'/%3E%3Cpath d='M50.8 18.5L45.7 16.7' stroke-width='.35'/%3E%3Ccircle cx='45.7' cy='16.7' r='1.8' class='b'/%3E%3Cpath d='M50.8 18.5L53.7 21.5' stroke-width='.35'/%3E%3Ccircle cx='53.7' cy='21.5' r='1.3' class='b'/%3E%3Cpath d='M50.8 18.5L50.1 16.2' stroke-width='.35'/%3E%3Ccircle cx='50.1' cy='16.2' r='1.5' class='b'/%3E%3Cpath d='M50.8 18.5L52.5 17.8' stroke-width='.35'/%3E%3Ccircle cx='52.5' cy='17.8' r='1.8' class='b'/%3E%3Cpath d='M37.9 28.6L27.9 42.5'/%3E%3Cpath d='M27.9 42.5L22 40.5' stroke-width='.35'/%3E%3Ccircle cx='22' cy='40.5' r='1.2' class='b'/%3E%3Cpath d='M27.9 42.5L30.9 43.6' stroke-width='.35'/%3E%3Ccircle cx='30.9' cy='43.6' r='1.8' class='b'/%3E%3Cpath d='M27.9 42.5L21.2 40.4' stroke-width='.35'/%3E%3Ccircle cx='21.2' cy='40.4' r='1.2' class='b'/%3E%3Cpath d='M27.9 42.5L32.6 40.6' stroke-width='.35'/%3E%3Ccircle cx='32.6' cy='40.6' r='1.2' class='b'/%3E%3Cpath d='M27.9 42.5L29.7 43.3' stroke-width='.35'/%3E%3Ccircle cx='29.7' cy='43.3' r='1.7' class='b'/%3E%3Cpath d='M27.9 42.5L32.2 47.5' stroke-width='.35'/%3E%3Ccircle cx='32.2' cy='47.5' r='1.3' class='b'/%3E%3Cpath d='M27.9 42.5L27.6 39.9' stroke-width='.35'/%3E%3Ccircle cx='27.6' cy='39.9' r='1.5' class='b'/%3E%3Cpath d='M25.9 24.9L17.3 12.2'/%3E%3Cpath d='M17.3 12.2L14.1 9.5' stroke-width='.35'/%3E%3Ccircle cx='14.1' cy='9.5' r='1.6' class='b'/%3E%3Cpath d='M17.3 12.2L18.9 13.4' stroke-width='.35'/%3E%3Ccircle cx='18.9' cy='13.4' r='1.8' class='b'/%3E%3Cpath d='M17.3 12.2L23 7' stroke-width='.35'/%3E%3Ccircle cx='23' cy='7' r='1.7' class='b'/%3E%3Cpath d='M17.3 12.2L12.1 10.5' stroke-width='.35'/%3E%3Ccircle cx='12.1' cy='10.5' r='1.8' class='b'/%3E%3Cpath d='M17.3 12.2L15.6 10.9' stroke-width='.35'/%3E%3Ccircle cx='15.6' cy='10.9' r='1.8' class='b'/%3E%3Cpath d='M17.3 12.2L23.5 10.6' stroke-width='.35'/%3E%3Ccircle cx='23.5' cy='10.6' r='1.3' class='b'/%3E%3Cpath d='M17.3 12.2L20.4 13.4' stroke-width='.35'/%3E%3Ccircle cx='20.4' cy='13.4' r='1.7' class='b'/%3E%3Cpath d='M120 30Q65 42 16 21' style='stroke:%237f8f78;stroke-width:1.5'/%3E%3Cellipse cx='107.9' cy='23.5' rx='7.7' ry='7' fill='%239db3a5' stroke='none'/%3E%3Cellipse cx='97' cy='41.6' rx='7.3' ry='6.6' fill='%2386a092' stroke='none'/%3E%3Cellipse cx='85.3' cy='26.7' rx='6.8' ry='6.1' fill='%23b3c6b9' stroke='none'/%3E%3Cellipse cx='73.7' cy='41.3' rx='6.3' ry='5.6' fill='%237b9587' stroke='none'/%3E%3Cellipse cx='62.2' cy='26.9' rx='5.8' ry='5.2' fill='%239db3a5' stroke='none'/%3E%3Cellipse cx='50.9' cy='37.9' rx='5.3' ry='4.7' fill='%2386a092' stroke='none'/%3E%3Cellipse cx='40.7' cy='24.1' rx='4.8' ry='4.3' fill='%23b3c6b9' stroke='none'/%3E%3Cellipse cx='30.6' cy='32' rx='4.3' ry='3.9' fill='%237b9587' stroke='none'/%3E%3Cellipse cx='21.7' cy='19.1' rx='3.9' ry='3.5' fill='%239db3a5' stroke='none'/%3E%3Cellipse cx='14.8' cy='25.4' rx='3.6' ry='3.2' fill='%2386a092' stroke='none'/%3E%3Cg stroke='%23b68d5e' stroke-width='2.3'%3E%3Cpath d='M120 30C110 20 102 24 106 30C109 35 116 33 120 30C124 33 131 35 134 30C138 24 130 20 120 30' style='stroke:%23b68d5e;stroke-width:2.3'/%3E%3Cpath d='M118 31L112 45M122 31L128 45' style='stroke:%23b68d5e;stroke-width:2.3'/%3E%3C/g%3E%3Ccircle cx='120' cy='30' r='2.7' fill='%239c7549'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

/* Ohne das gewinnt jedes display: flex/grid gegen das hidden-Attribut –
   die Vorschau-Liste und der Auswahlknopf ließen sich nicht ausblenden. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  /* Schleierkraut: vereinzelte helle Pünktchen, kaum sichtbar. */
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.75) 0 1.1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 0.8px, transparent 1.3px);
  background-size: 41px 37px, 29px 53px;
  background-position: 0 0, 13px 19px;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Juteband über die ganze Breite, oben am Bildschirmrand. */
body::before {
  content: "";
  flex: 0 0 auto;
  height: 0.5rem;
  background-color: var(--kraft);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(59, 47, 37, 0.14) 0 1px, transparent 1px 3px);
  box-shadow: 0 1px 0 rgba(59, 47, 37, 0.12);
}

.seite {
  flex: 1;
  width: 100%;
  max-width: var(--seite-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

/* ---------- Kopfbereich ---------- */

.kopf { margin-bottom: 1.5rem; }

.gruss {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--leise);
}

/* Wie ein Namensschild aus Kraftpapier, mit Loch für die Schnur. */
.aufgabe-nr {
  position: relative;
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.2rem 0.75rem 0.2rem 1.35rem;
  border-radius: 0.25rem 0.5rem 0.5rem 0.25rem;
  background: var(--kraft-zart);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--nummer);
}
.aufgabe-nr::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  width: 0.38rem;
  height: 0.38rem;
  margin-top: -0.19rem;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--kraft);
}

.aufgabe-text,
.titel {
  margin: 0;
  color: var(--text);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.3;
}

.untertitel {
  margin: 0.5rem 0 0;
  color: var(--leise);
}

/* ---------- Hinweise ---------- */

.hinweis {
  box-shadow: var(--schatten);
  margin: 0 0 1.5rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  color: var(--leise);
  font-size: 0.97rem;
}

.hinweis-warnung {
  background: var(--warnung-bg);
  border-color: var(--warnung-rand);
  color: var(--text);
}

/* ---------- Dateiauswahl ---------- */

/* Nicht display:none – ein so verstecktes Feld lässt sich auf manchen
   Browsern nicht mehr über das Label öffnen. */
.datei-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
}

.datei-knopf {
  box-shadow: var(--schatten);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 4.5rem;
  padding: 1rem;
  border: 2px dashed var(--akzent);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--akzent);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
}

.datei-input:focus-visible + .datei-knopf {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
}

.datei-note {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--leise);
}

.vorschau {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.6rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

/* Vorschau-Kacheln (Paket 9). Quadratisch, mit Entfernen-Knopf oben
   rechts – groß genug für einen Daumen, obwohl die Kachel klein ist. */
.kachel {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--radius) * 0.7);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  overflow: hidden;
}

.kachel-bild {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kachel-platz {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--leise);
}

.kachel[data-zustand="prep"] .kachel-platz { animation: puls 1.2s ease-in-out infinite; }
.kachel[data-zustand="sending"] .kachel-bild,
.kachel[data-zustand="prep"] .kachel-bild { opacity: 0.6; }
.kachel[data-zustand="bad"] .kachel-bild,
.kachel[data-zustand="failed"] .kachel-bild { opacity: 0.35; filter: grayscale(1); }

@keyframes puls { 50% { opacity: 0.35; } }

.kachel-status {
  position: absolute;
  left: 0.3rem;
  bottom: 0.3rem;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5rem;
  text-align: center;
}
.kachel-status:empty { display: none; }
.kachel[data-zustand="done"] .kachel-status { background: var(--ok); color: #fff; }
.kachel[data-zustand="bad"] .kachel-status,
.kachel[data-zustand="failed"] .kachel-status { background: var(--fehler); color: #fff; }

.kachel-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  /* oben Platz für den Entfernen-Knopf, unten für das Statuszeichen */
  padding: 2rem 0.4rem 2.1rem;
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
}

.kachel-weg {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0 0 0.6rem 0.6rem;
  border: none;
  background: none;
  cursor: pointer;
}
.kachel-weg::before {
  content: "×";
  display: block;
  width: 1.7rem;
  height: 1.7rem;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(59, 47, 37, 0.7);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1.6rem;
  text-align: center;
}
.kachel-weg { font-size: 0; color: transparent; }
.kachel-weg:focus-visible::before { outline: 3px solid var(--akzent); outline-offset: 1px; }

.upload-meldung {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  font-size: 0.97rem;
}
.upload-meldung-hinweis { color: var(--leise); }
.upload-meldung-fehler {
  background: var(--warnung-bg);
  border-color: var(--warnung-rand);
  color: var(--text);
}

.upload-weiter {
  display: block;
  margin-top: 0.75rem;
  color: var(--akzent);
  font-weight: 600;
  text-align: center;
  padding: 0.6rem;
}

/* ---------- Felder und Knöpfe ---------- */

.namensfeld {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rand);
}

.namensfeld summary {
  cursor: pointer;
  color: var(--leise);
  padding: 0.35rem 0;
}

.feld {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--leise);
}

.feld-zusatz { opacity: 0.8; }

.eingabe {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
  /* 16px verhindert das Hineinzoomen von Safari beim Fokus. */
  font: inherit;
  font-size: 1.05rem;
}

.eingabe-nummer {
  font-size: 2rem;
  text-align: center;
  letter-spacing: 0.12em;
  padding: 0.9rem;
}

.eingabe:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 1px;
}

.knopf {
  display: block;
  width: 100%;
  min-height: 3.5rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  background: var(--akzent);
  color: var(--akzent-text);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
}

.knopf:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ---------- Fortschritt (§6.2) ---------- */

.fortschritt { margin-top: 1.25rem; }

.fortschritt-bahn {
  height: 0.7rem;
  border-radius: 999px;
  background: var(--rand);
  overflow: hidden;
}

.fortschritt-wert {
  display: block;
  width: 0;
  height: 100%;
  background: var(--akzent);
  transition: width 0.2s ease-out;
}

.fortschritt-zeile {
  margin: 0.5rem 0 0;
  font-weight: 600;
}
.fortschritt-zeile:empty { display: none; }

.fortschritt-text {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--leise);
}

/* ---------- Live-Anzeige der Nummer ---------- */

.live {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--rand);
  border-left: 4px solid var(--akzent);
  border-radius: var(--radius);
  background: var(--flaeche);
  box-shadow: var(--schatten);
}

.live .gruss { font-size: 1rem; margin-bottom: 0.4rem; }
.live .aufgabe-text { font-size: 1.2rem; }
.live-leer { color: var(--leise); }

/* ---------- Aufgabenliste ---------- */

.aufgabenliste {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aufgabenliste li { border-bottom: 1px solid var(--rand); }

.aufgabenliste a {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.9rem 0.2rem;
  color: inherit;
  text-decoration: none;
}

.aufgabenliste-nr {
  flex: 0 0 2.2rem;
  font-weight: 700;
  color: var(--nummer);
  text-align: right;
}

/* ---------- Navigation und Fuß ---------- */

.seitenlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rand);
}

.seitenlinks a,
.fuss a {
  color: var(--leise);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.35rem 0;
}

/* Seit Paket 11: volle 44 px Höhe – die Links unter der Moderation und
   der Galerie werden im Stehen mit dem Daumen getroffen. */
.seitenlinks a { display: inline-block; padding: 0.6rem 0; }

.fuss {
  width: 100%;
  max-width: var(--seite-max);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2.5rem;
  text-align: center;
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
}

.fuss::before {
  content: "";
  display: block;
  height: 2.6rem;
  margin: 0 auto 0.75rem;
  background: var(--zweig) center / contain no-repeat;
  opacity: 0.9;
}

.fuss-immich {
  display: inline-block;
  font-weight: 600;
  color: var(--akzent) !important;
}

.fuss-hinweis {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--leise);
}

/* ================================================================
   Paket 11 – Erfolgsseite, Galerie, Moderation
   ================================================================ */

/* ---------- Erfolgsseite (§3.5) ---------- */

.fertig-kopf { text-align: center; }
.fertig-haken {
  height: 4.5rem;
  margin: -0.5rem 0 0.5rem;
  background: var(--zweig) center / contain no-repeat;
}
.fertig-kopf .titel { font-size: 2.2rem; }

.stand { margin: 0 0 1.75rem; }
.stand-zeile { margin: 0 0 0.5rem; text-align: center; font-size: 1.1rem; }
.stand-bahn {
  height: 0.7rem;
  border-radius: 999px;
  background: var(--rand);
  overflow: hidden;
}
.stand-wert { display: block; height: 100%; background: var(--akzent); }

.knopfreihe .knopf { margin-top: 0.75rem; text-align: center; text-decoration: none; }
.knopf-zweit {
  background: transparent;
  color: var(--akzent);
  box-shadow: inset 0 0 0 2px var(--akzent);
}
a.knopf { display: flex; align-items: center; justify-content: center; }

.immich-hinweis {
  display: block;
  margin-top: 1.75rem;
  padding: 0.6rem 0;
  text-align: center;
  font-weight: 600;
  color: var(--akzent);
  text-underline-offset: 3px;
}

/* ---------- Galerie: Kachelraster (§7) ---------- */

/* Die Galerie darf breiter sein als die Formularseiten. */
.raster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .raster { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
}

/* Die Erfolgsseite springt mit #a23 hierher: nicht unter die Oberkante. */
.raster-feld { scroll-margin-top: 1rem; }
.raster-feld:target .gkachel { box-shadow: 0 0 0 3px var(--akzent); }

.gkachel {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  box-shadow: var(--schatten);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.gkachel:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

.gkachel-bild {
  display: grid;
  aspect-ratio: 1 / 1;
  gap: 2px;
  background: var(--rand);
}
.gkachel-bild img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  background: var(--rand);
}
/* 1 Foto: ganz. 2: nebeneinander. 3: eins groß links, zwei rechts. 4: 2×2. */
.collage-1 { grid-template-columns: 1fr; }
.collage-2 { grid-template-columns: 1fr 1fr; }
.collage-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage-3 img:first-child { grid-row: 1 / 3; }
.collage-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.gkachel-offen {
  background: transparent;
  border: 2px dashed var(--kraft-zart);
  box-shadow: none;
}
.gkachel-leer {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--leise);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.gkachel-unter {
  display: block;
  padding: 0.5rem 0.65rem 0.65rem;
}
.gkachel-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.gkachel-nr { font-weight: 700; color: var(--nummer); }
.gkachel-zahl { font-size: 0.8rem; color: var(--leise); white-space: nowrap; }
.gkachel-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.15rem;
  font-size: 0.88rem;
  line-height: 1.35;
}
.gkachel-offen .gkachel-text { color: var(--leise); }

/* ---------- Galerie: Detailansicht ---------- */

/* Feste Kopfzeile: Die Zuordnung darf beim Scrollen nie verloren gehen.
   Kompakter als sonst, damit sie auf dem Handy nicht den halben
   Bildschirm belegt. */
.kopf-fest {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -2rem -1.25rem 1rem;
  padding: 0.75rem 1.25rem 0.8rem;
  background: var(--bg);
  border-bottom: 1px solid var(--rand);
}
.kopf-fest .aufgabe-text { font-size: 1.2rem; }
.kopf-fest .aufgabe-nr { margin-bottom: 0.15rem; }

.zurueck {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.3rem 0;
  color: var(--leise);
  text-decoration: none;
  font-size: 0.95rem;
}

.fotos {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 48rem) {
  .fotos { grid-template-columns: 1fr 1fr; }
}
.foto { display: block; border-radius: var(--radius); overflow: hidden; background: var(--rand); }
.foto img { display: block; width: 100%; height: auto; }

/* ---------- Vollbild (assets/galerie.js) ---------- */

.vollbild {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  /* Wischen macht das Skript selbst; der Browser soll nicht scrollen. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.vollbild-bahn {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
}
.vollbild-bahn.gleitet { transition: transform 0.22s ease-out; }
.vollbild-feld {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vollbild-feld img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}
.vollbild-leiste {
  position: absolute;
  left: 0; right: 0; top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.5rem 0.5rem 1rem;
  background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0));
  font-size: 0.95rem;
}
.vollbild-zu,
.vollbild-pfeil {
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.vollbild-pfeil {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.vollbild-pfeil[data-richtung="-1"] { left: 0.5rem; }
.vollbild-pfeil[data-richtung="1"] { right: 0.5rem; }
.vollbild-zu:focus-visible,
.vollbild-pfeil:focus-visible { outline: 3px solid #fff; }
/* Auf Touch-Geräten wischt man; die Pfeile wären nur im Weg. */
@media (hover: none) { .vollbild-pfeil { display: none; } }

body.vollbild-offen { overflow: hidden; }

/* ---------- Moderation (§8) ---------- */

/* Keine Deko am Fuß der Admin-Seiten – dort gibt es keinen Fuß. */

.seite-admin { max-width: 46rem; }

.admin-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.admin-neu {
  padding: 0.6rem 0.2rem;
  color: var(--akzent);
  font-weight: 600;
}

.admin-stand {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.admin-zahl {
  margin: 0;
  padding: 0.7rem 0.6rem;
  border-radius: var(--radius);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--leise);
}
.admin-zahl strong {
  display: block;
  font-size: 1.35rem;
  color: var(--text);
}

/* Speicher: Balken, Rest, Knopf „+5 GB". Der Knopf ist erst frei, wenn
   höchstens 2 GB übrig sind – vorher steht er ausgegraut da, damit man
   weiß, dass es ihn gibt. */
.admin-speicher {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  scroll-margin-top: 1rem;
}
.admin-speicher-knapp { border-color: var(--warnung-rand); background: var(--warnung-bg); }
.admin-speicher-knapp .stand-wert { background: var(--kraft); }
.speicher-zeile { display: flex; align-items: center; gap: 0.9rem; }
.speicher-zeile form { margin: 0; flex: 0 0 auto; }
.speicher-mitte { flex: 1; min-width: 0; }
.speicher-text { margin: 0.4rem 0 0; font-size: 0.9rem; }
.speicher-text .admin-leise { display: block; margin: 0; font-size: 0.85rem; }
.speicher-platte, .speicher-meldung { margin: 0.6rem 0 0; font-size: 0.88rem; }
.speicher-platte { padding: 0.5rem 0.7rem; border: 1px solid var(--warnung-rand); border-radius: calc(var(--radius) * 0.7); }
.speicher-meldung { color: var(--akzent); font-weight: 600; }

.knopf-klein {
  min-width: 5.5rem;
  min-height: 2.9rem;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: var(--radius);
  background: var(--akzent);
  color: var(--akzent-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.knopf-klein:disabled {
  background: var(--rand);
  color: var(--leise);
  cursor: default;
}
.knopf-klein:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

.admin-offen {
  margin: 0 0 1.5rem;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--flaeche);
}
.admin-offen summary {
  padding: 0.9rem 1rem;
  cursor: pointer;
  min-height: 3rem;
}
.admin-offen[open] summary { border-bottom: 1px solid var(--rand); }
.offen-liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.2rem 0.8rem;
  margin: 0;
  padding: 0.6rem 1rem 0.9rem;
  list-style: none;
  font-size: 0.95rem;
}
.offen-nr {
  display: inline-block;
  min-width: 1.8rem;
  font-weight: 700;
  color: var(--nummer);
}
.admin-leise { margin: 0 0 0.9rem; color: var(--leise); font-size: 0.93rem; }
.admin-offen .admin-leise { padding: 0.8rem 1rem 0; }

.admin-h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.mod-liste {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 34rem) {
  .mod-liste { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.mod form { margin: 0; }
.mod { scroll-margin-top: 1rem; }

/* Das ganze Thumbnail ist der Knopf – das Tap-Ziel ist so groß wie das
   Foto, auf dem Handy rund 170 px im Quadrat. */
.mod-knopf {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--rand);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mod-knopf img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.15s, filter 0.15s;
}
.mod-knopf:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.mod-knopf:disabled { cursor: progress; }
.mod-knopf:disabled img { opacity: 0.6; }

.mod-zustand {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.35rem;
  background: var(--fehler);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}
.mod-zustand:empty { display: none; }

.mod-aus .mod-knopf img { opacity: 0.3; filter: grayscale(1); }
.mod-aus .mod-knopf { box-shadow: inset 0 0 0 3px var(--fehler); }
.mod-aus .mod-info { opacity: 0.6; }

.mod-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.45rem;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.35;
}
.mod-info strong { color: var(--nummer); }
.mod-zeit { color: var(--leise); }
.mod-von { flex-basis: 100%; color: var(--leise); font-style: italic; }

.mod-fehler {
  grid-column: 1 / -1;
}

.admin-blaettern {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
}
.admin-blaettern a { padding: 0.7rem 0.2rem; color: var(--akzent); font-weight: 600; }

/* ---------- Zuordnungsliste ---------- */

.namenliste { margin: 0; padding: 0; list-style: none; }
.namenliste li {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.75rem 0.1rem;
  border-bottom: 1px solid var(--rand);
}
.namen-nr { flex: 0 0 2rem; text-align: right; font-weight: 700; color: var(--nummer); }
.namen-rumpf { flex: 1; min-width: 0; }
.namen-name { display: block; }
.namen-text { display: block; font-size: 0.9rem; color: var(--leise); }
.namen-stand {
  flex: 0 0 auto;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--leise);
  white-space: nowrap;
}
.namen-offen .namen-stand { color: var(--akzent); font-weight: 600; }

/* Auf der Erfolgsseite hängt der Zweig schon oben – unten nicht noch einmal. */
.seite:has(.fertig-kopf) + .fuss::before { display: none; }
