/* ═══════════════════════════════════════════════════════════════════════════
   Aufgaben - Fahrrad XXL
   Erscheinungsbild wie die RPM-App: Poppins, Rot auf warmem Grau,
   Bordeaux-Verlaeufe, 3px-Akzentkanten, grosszuegige Radien.
   Mobil zuerst gedacht - grosse Flaechen, wenig Text, klare Farben.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Farben aus dem RPM-Branding */
  --rot:          #d90128;
  --rot-dunkel:   #a80020;
  --bordeaux:     #6e0016;
  --bordeaux-tief:#4a000f;
  --rot-hauch:    #fff0f2;

  --schwarz:      #1a1a1a;
  --weiss:        #ffffff;
  --grund:        #f7f3f1;
  --linie:        #e5ded9;
  --leise:        #5c5450;

  --gruen:        #2e8b3d;
  --gruen-dunkel: #216b2c;
  --gruen-hauch:  #e3f4e6;
  --amber:        #f2c30f;
  --amber-dunkel: #b98600;
  --amber-hauch:  #fdf3d4;
  --blau:         #1565c0;
  --blau-hauch:   #e3edfb;

  --schrift: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --rundung:      12px;
  --rundung-klein: 9px;
  --schatten:     0 1px 2px rgba(26, 26, 26, .05);
  --schatten-hoch: 0 8px 28px rgba(74, 0, 15, .18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Muss hier oben stehen und !important sein: Regeln dieser Datei schlagen
   sonst das hidden-Attribut des Browsers - ein .overlay mit display:flex
   bliebe sichtbar und finge jeden Klick auf der Seite ab. */
[hidden] { display: none !important; }

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

body {
  font-family: var(--schrift);
  background: var(--grund);
  color: var(--schwarz);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  /* Zwei sehr blasse Farbschleier - gibt der Flaeche Tiefe, ohne zu stoeren. */
  background-image:
    radial-gradient(1100px 800px at 100% -10%, rgba(217, 1, 40, .05), transparent 55%),
    radial-gradient(900px 700px at -10% 110%, rgba(110, 0, 22, .05), transparent 55%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

button, input, textarea, select { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { letter-spacing: -.01em; }

/* ═══ ANMELDUNG ══════════════════════════════════════════════════════════ */

#screen-anmeldung {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 600px at 50% -20%, rgba(217, 1, 40, .28), transparent 60%),
    linear-gradient(155deg, var(--bordeaux-tief) 0%, #2a0009 55%, #14060a 100%);
}

.anmelde-box {
  width: 100%;
  max-width: 380px;
  background: var(--weiss);
  border-radius: 18px;
  padding: 30px 26px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  border-top: 4px solid var(--rot);
}

.marke {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--rot);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.marke-unter {
  color: var(--leise);
  font-size: .74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 4px;
}

#pin-titel {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--leise);
  margin-top: 30px;
  text-align: center;
}

.pin-punkte { display: flex; gap: 12px; justify-content: center; margin: 16px 0 6px; }
.pin-punkte i {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--linie); display: block;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.pin-punkte i.voll {
  background: var(--rot); border-color: var(--rot);
  transform: scale(1.12);
}

.ziffernblock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.ziffernblock button {
  padding: 17px 0;
  font-size: 1.45rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--linie);
  border-radius: var(--rundung);
  background: var(--weiss);
  transition: transform .07s ease, border-color .12s ease, background .12s ease;
}
.ziffernblock button:active {
  transform: scale(.96);
  border-color: var(--rot);
  background: var(--rot-hauch);
}
.ziffernblock .leer { visibility: hidden; }
.ziffernblock [data-loeschen] { color: var(--leise); font-size: 1.2rem; }

.fehler {
  color: var(--rot-dunkel);
  font-size: .82rem;
  font-weight: 600;
  min-height: 22px;
  text-align: center;
  padding: 2px 0;
}

/* ═══ KOPF ═══════════════════════════════════════════════════════════════ */

.kopf {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
  padding-top: max(11px, env(safe-area-inset-top));
  background: linear-gradient(120deg, var(--bordeaux-tief), var(--bordeaux) 72%);
  border-bottom: 3px solid var(--rot);
  color: var(--weiss);
}

.kopf-links {
  border: 0; background: none; color: inherit;
  text-align: left; padding: 3px 8px 3px 0;
  display: flex; flex-direction: column; min-width: 0;
}
.kopf-links:active { opacity: .65; }
.kopf-links strong {
  font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kopf-links strong::after { content: " \25BE"; font-size: .62rem; opacity: .7; vertical-align: middle; }
.kopf-filiale {
  font-size: .62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .09em; color: rgba(255, 255, 255, .6);
}

.kopf-rechts { display: flex; gap: 8px; flex-shrink: 0; }
.ikon {
  position: relative; border: 0;
  background: rgba(255, 255, 255, .13);
  color: var(--weiss); width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s ease;
}
.ikon svg { width: 19px; height: 19px; }
.ikon:active { background: rgba(255, 255, 255, .26); }
.zaehler {
  position: absolute; top: -5px; right: -5px;
  background: var(--rot); color: var(--weiss);
  border: 2px solid var(--bordeaux-tief);
  border-radius: 12px; font-size: .62rem; font-weight: 800;
  padding: 1px 5px; min-width: 20px; line-height: 1.4;
}

/* ═══ GRUNDGERUEST ═══════════════════════════════════════════════════════ */

main {
  padding: calc(var(--kopf-hoehe, 66px) + 16px) 16px 150px;
  max-width: 780px;
  margin: 0 auto;
}
body.ohne-sprachknopf main { padding-bottom: 92px; }

.ansicht-titel {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -.015em;
  margin: 2px 0 16px;
}

/* Gruppenueberschrift mit rotem Strich - das Wiedererkennungszeichen aus RPM */
.gruppe-titel {
  display: flex; align-items: center; gap: 9px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--leise);
  margin: 22px 0 10px;
}
.gruppe-titel::before {
  content: ''; width: 3px; height: 13px; background: var(--linie);
  flex-shrink: 0; border-radius: 2px;
}
.gruppe-titel.warnung { color: var(--rot-dunkel); }
.gruppe-titel.warnung::before { background: var(--rot); }

/* ═══ AUFGABENKARTE ══════════════════════════════════════════════════════ */

.karte {
  position: relative;
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--rundung);
  padding: 14px 16px;
  margin-bottom: 9px;
  box-shadow: var(--schatten);
  overflow: hidden;
  transition: transform .08s ease, box-shadow .15s ease;
}
.karte:active { transform: scale(.995); }

/* Statusfarbe als Kante oben - nicht links: liest sich auf schmalen
   Bildschirmen als Kopfzeile der Karte. */
.karte::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--linie);
}
.karte.ueberfaellig::before { background: var(--rot); }
.karte.wartet::before { background: var(--amber-dunkel); }
.karte.fertig::before { background: var(--gruen); }
.karte.fertig { opacity: .72; }

.karte.hoch::after {
  content: "!"; position: absolute; top: 11px; right: 14px;
  color: var(--rot); font-weight: 900; font-size: 1.1rem; line-height: 1;
}

.karte-titel {
  font-weight: 700; font-size: 1rem; line-height: 1.3;
  padding-right: 16px; letter-spacing: -.005em;
}
.karte-zeile { font-size: .8rem; color: var(--leise); margin-top: 4px; }
.karte-zeile b { color: var(--schwarz); font-weight: 700; }

.marker {
  display: inline-block; font-size: .62rem; font-weight: 800;
  padding: 3px 9px; border-radius: 20px; margin: 3px 5px 0 0;
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--linie); color: var(--leise);
}
.marker.rot { background: var(--rot-hauch); color: var(--rot-dunkel); }
.marker.orange { background: var(--amber-hauch); color: var(--amber-dunkel); }
.marker.gruen { background: var(--gruen-hauch); color: var(--gruen-dunkel); }
.marker.grau { background: var(--grund); color: var(--leise); }

.karte-knoepfe { display: flex; gap: 8px; margin-top: 12px; }
.karte-knoepfe button {
  flex: 1; padding: 11px 10px;
  border-radius: var(--rundung-klein);
  border: 2px solid var(--linie);
  background: var(--weiss);
  font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .03em;
  transition: transform .07s ease, background .12s ease, border-color .12s ease;
}
.karte-knoepfe button:active { transform: scale(.97); }
.karte-knoepfe .fertig-knopf,
.karte-knoepfe .ab-knopf {
  background: var(--gruen); border-color: var(--gruen); color: var(--weiss);
}
.karte-knoepfe .zurueck-knopf { border-color: var(--rot); color: var(--rot); }
.karte-knoepfe .zurueck-knopf:active { background: var(--rot-hauch); }

.leer-hinweis {
  text-align: center; color: var(--leise);
  padding: 46px 20px; font-size: .9rem; font-weight: 500;
}

/* ═══ SCHNELLBEFEHLE ═════════════════════════════════════════════════════ */

.shortcut-leiste {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 0 12px; scrollbar-width: none;
}
.shortcut-leiste::-webkit-scrollbar { display: none; }
.shortcut-leiste button {
  flex: 0 0 auto; padding: 9px 16px; border-radius: 22px;
  border: 2px solid var(--linie); background: var(--weiss);
  color: var(--schwarz); font-weight: 700; font-size: .8rem;
  white-space: nowrap;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.shortcut-leiste button:active {
  border-color: var(--rot); background: var(--rot); color: var(--weiss);
}

/* ═══ FORMULARE ══════════════════════════════════════════════════════════ */

label {
  display: block; font-size: .78rem; font-weight: 700;
  margin: 16px 0 7px; letter-spacing: .01em;
}
label.zeile-mitte {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: .9rem;
}
label.zeile-mitte input { width: 20px; height: 20px; accent-color: var(--rot); }

input[type=text], input[type=date], input[type=time], input[type=number],
input[type=tel], textarea, select {
  width: 100%; padding: 13px 14px;
  border: 2px solid var(--linie);
  border-radius: var(--rundung-klein);
  background: var(--weiss); color: var(--schwarz);
  font-size: 1rem;
  appearance: none; -webkit-appearance: none;
  transition: border-color .12s ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rot); }
textarea { resize: vertical; line-height: 1.5; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%235c5450' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 36px;
}

.mit-mikro { display: flex; gap: 8px; align-items: flex-start; }
.mit-mikro input, .mit-mikro textarea { flex: 1; }
.mikro {
  flex: 0 0 auto; width: 48px; height: 48px;
  border-radius: var(--rundung-klein);
  border: 2px solid var(--linie); background: var(--weiss); font-size: 1.2rem;
}
.mikro.hoert { background: var(--rot); border-color: var(--rot); animation: puls 1s infinite; }
@keyframes puls { 50% { opacity: .5; } }

/* Auswahlreihen: Fristen, Wochentage, Umschalter, Zeitraum */
.frist-schnell, .wochentage, .umschalter, .zeitraum-wahl {
  display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 9px;
}
.frist-schnell button, .wochentage button, .umschalter button, .zeitraum-wahl button {
  flex: 1; min-width: 58px; padding: 11px 6px;
  border-radius: var(--rundung-klein);
  border: 2px solid var(--linie); background: var(--weiss);
  font-size: .82rem; font-weight: 700;
  transition: transform .07s ease, background .12s ease, border-color .12s ease, color .12s ease;
}
.frist-schnell button:active, .wochentage button:active,
.umschalter button:active, .zeitraum-wahl button:active { transform: scale(.97); }
.frist-schnell button.an, .wochentage button.an,
.umschalter button.an, .zeitraum-wahl button.an {
  background: var(--rot); border-color: var(--rot); color: var(--weiss);
}

.haupt-knopf {
  width: 100%; margin-top: 22px; padding: 16px 20px;
  border: 0; border-radius: var(--rundung);
  background: linear-gradient(120deg, var(--rot-dunkel), var(--rot) 70%);
  color: var(--weiss);
  font-size: .96rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
  box-shadow: 0 3px 10px rgba(217, 1, 40, .28);
  transition: transform .08s ease, box-shadow .15s ease;
}
.haupt-knopf:active { transform: scale(.985); box-shadow: 0 1px 4px rgba(217, 1, 40, .3); }

.neben-knopf {
  padding: 12px 18px; margin-top: 9px;
  border-radius: var(--rundung-klein);
  border: 2px solid var(--linie); background: var(--weiss);
  font-weight: 700; font-size: .84rem;
  transition: transform .07s ease, border-color .12s ease;
}
.neben-knopf:active { transform: scale(.98); border-color: var(--schwarz); }
.neben-knopf.abmelden { color: var(--rot); border-color: var(--rot); width: 100%; }

.hinweis { font-size: .78rem; color: var(--leise); margin: 7px 0; line-height: 1.5; }

.block {
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--rundung);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--schatten);
}
.block h3 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--leise);
  display: flex; align-items: center; gap: 9px; margin-bottom: 11px;
}
.block h3::before {
  content: ''; width: 3px; height: 13px; background: var(--rot);
  flex-shrink: 0; border-radius: 2px;
}

/* ═══ TEAM & AUSWERTUNG ══════════════════════════════════════════════════ */

.team-zeile {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--rundung); padding: 13px 16px; margin-bottom: 8px;
  box-shadow: var(--schatten);
}
.team-name { font-weight: 700; font-size: .95rem; }
.team-zahlen { display: flex; gap: 12px; text-align: center; flex-shrink: 0; }
.team-zahlen div { min-width: 34px; }

/* Mit fuenf Spalten wird es auf schmalen Bildschirmen eng - dort enger
   setzen, statt die Zeile umbrechen zu lassen. */
@media (max-width: 420px) {
  .team-zahlen { gap: 8px; }
  .team-zahlen div { min-width: 28px; }
  .team-zahlen b { font-size: 1.05rem; }
  .team-zahlen span { font-size: .52rem; letter-spacing: .03em; }
}
.team-zahlen b {
  display: block; font-size: 1.25rem; font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.team-zahlen span {
  font-size: .58rem; color: var(--leise);
  text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
}
.team-zahlen .warn b { color: var(--rot); }

.kennzahlen { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.kz {
  position: relative; overflow: hidden;
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--rundung); padding: 16px 14px;
  box-shadow: var(--schatten);
}
.kz::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--linie);
}
.kz b {
  display: block; font-size: 1.7rem; font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.02em;
}
.kz span {
  display: block; font-size: .64rem; color: var(--leise); margin-top: 4px;
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.kz.warn::before { background: var(--rot); }
.kz.warn b { color: var(--rot); }
.kz.gut::before { background: var(--gruen); }
.kz.gut b { color: var(--gruen-dunkel); }

.balken-block {
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--rundung); padding: 16px; margin-bottom: 12px;
  box-shadow: var(--schatten);
}
.balken-block h3 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--leise);
  display: flex; align-items: center; gap: 9px;
}
.balken-block h3::before {
  content: ''; width: 3px; height: 13px; background: var(--rot);
  flex-shrink: 0; border-radius: 2px;
}
.balken { display: flex; align-items: flex-end; gap: 3px; height: 112px; margin-top: 14px; }
/* height:100% ist Pflicht - ohne feste Hoehe der Saeule loesen die
   Prozentangaben der Balken zu 0 auf und das Diagramm bleibt leer. */
.balken > div {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
}
.balken .b-faellig { background: var(--linie); border-radius: 3px 3px 0 0; min-height: 3px; }
.balken .b-erledigt { background: var(--gruen); border-radius: 3px 3px 0 0; min-height: 3px; }
.balken-achse {
  display: flex; justify-content: space-between;
  font-size: .62rem; color: var(--leise); margin-top: 6px; font-weight: 600;
}
.balken-legende {
  display: flex; gap: 16px; font-size: .68rem; color: var(--leise);
  margin-top: 10px; font-weight: 600;
}
.balken-legende i {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 3px; margin-right: 5px;
}

/* ═══ FUSSLEISTE ═════════════════════════════════════════════════════════ */

.fussleiste {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: var(--weiss);
  border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(26, 26, 26, .05);
}
.fussleiste button {
  flex: 1; border: 0; background: none; padding: 9px 2px 10px;
  font-size: .62rem; font-weight: 700; color: var(--leise);
  text-transform: uppercase; letter-spacing: .04em;
  position: relative; transition: color .12s ease;
}
.fussleiste button svg {
  display: block; width: 21px; height: 21px; margin: 0 auto 3px;
  stroke: currentColor;
}
.fussleiste button.an { color: var(--rot); }
.fussleiste .plus { color: var(--rot); }
.fussleiste .plus svg { width: 24px; height: 24px; }
.badge {
  position: absolute; top: 4px; right: 50%; margin-right: -20px;
  background: var(--rot); color: var(--weiss); border-radius: 12px;
  font-size: .58rem; font-style: normal; font-weight: 800;
  padding: 1px 5px; min-width: 17px; line-height: 1.5;
}

/* ═══ BLATT (Detail, Dialoge) ════════════════════════════════════════════ */

.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(26, 10, 14, .55);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.blatt {
  background: var(--grund); width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(26px + env(safe-area-inset-bottom));
  border-top: 4px solid var(--rot);
  box-shadow: var(--schatten-hoch);
  animation: hoch .18s ease-out;
}
@keyframes hoch { from { transform: translateY(22px); opacity: .6; } to { transform: none; opacity: 1; } }

.blatt h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -.015em; }
.blatt-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.blatt-schliessen {
  border: 0; background: none; font-size: 1.6rem; color: var(--leise);
  line-height: 1; padding: 0 4px;
}

.zurueck-leiste {
  display: flex; align-items: center; justify-content: space-between;
  margin: -2px 0 10px;
}
.zurueck-blatt {
  border: 0; background: none; color: var(--rot);
  font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 8px 6px 0;
}
.zurueck-blatt:active { opacity: .55; }
.ansicht-zurueck {
  border: 0; background: none; color: var(--rot);
  font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px 10px 0;
}

/* ═══ VERLAUF ════════════════════════════════════════════════════════════ */

.verlauf { margin-top: 18px; }
.verlauf h3 {
  font-size: .72rem !important; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--leise); margin-bottom: 12px;
}
.verlauf-eintrag {
  border-left: 2px solid var(--linie);
  padding: 0 0 14px 14px; position: relative; font-size: .84rem;
}
.verlauf-eintrag::before {
  content: ''; position: absolute; left: -5px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--linie); border: 2px solid var(--grund);
  box-sizing: content-box;
}
.verlauf-eintrag.wichtig::before { background: var(--rot); }
.verlauf-kopf { font-weight: 700; }
.verlauf-zeit { font-size: .68rem; color: var(--leise); font-variant-numeric: tabular-nums; }
.verlauf-text { margin-top: 3px; color: var(--leise); }

/* ═══ ANHAENGE ═══════════════════════════════════════════════════════════ */

.anhang-knoepfe { display: flex; gap: 8px; }
.anhang-knoepfe .neben-knopf {
  flex: 1; text-align: center; margin-top: 9px; cursor: pointer;
}

.foto-liste { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.foto-kachel {
  position: relative; display: block;
  width: 84px; height: 84px; border-radius: var(--rundung-klein);
  overflow: hidden; border: 1px solid var(--linie);
}
.foto-kachel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anhang-weg {
  position: absolute; top: 3px; right: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(26, 26, 26, .68); color: #fff;
  font-size: 1rem; line-height: 1; padding: 0;
}

.datei-zeile {
  display: flex; align-items: center; gap: 8px;
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--rundung-klein);
  padding: 10px 12px; margin-top: 8px;
}
.datei-zeile a {
  flex: 1; display: flex; align-items: center; gap: 10px;
  color: var(--schwarz); text-decoration: none; min-width: 0;
}
.datei-zeile svg { width: 20px; height: 20px; color: var(--rot); flex-shrink: 0; }
.datei-name {
  flex: 1; font-weight: 600; font-size: .86rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.datei-groesse {
  font-size: .68rem; color: var(--leise); flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.anhang-weg-klein {
  border: 0; background: none; color: var(--leise);
  font-size: 1.2rem; line-height: 1; padding: 0 4px; flex-shrink: 0;
}

/* ═══ BENACHRICHTIGUNGEN ═════════════════════════════════════════════════ */

.bnr-eintrag {
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--rundung-klein);
  padding: 12px 14px; margin-bottom: 8px;
  font-size: .86rem; box-shadow: var(--schatten);
}
.bnr-eintrag.neu { border-left: 3px solid var(--rot); }
.bnr-eintrag .zeit {
  font-size: .66rem; color: var(--leise); margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ═══ SPRACHE ════════════════════════════════════════════════════════════ */

.sprach-knopf {
  position: fixed; right: 16px; z-index: 30;
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: 60px; height: 60px; border-radius: 50%;
  border: 0; color: var(--weiss);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--rot) 0%, var(--bordeaux) 100%);
  box-shadow: 0 6px 18px rgba(110, 0, 22, .42);
  transition: transform .1s ease;
}
.sprach-knopf svg { width: 25px; height: 25px; }
.sprach-knopf:active { transform: scale(.93); }
body.ohne-sprachknopf .sprach-knopf { display: none; }

/* Am Rechner ist Platz genug - dann steht der Knopf neben der Spalte
   statt darauf. (390 halbe Spalte + 60 Knopf + 16 Abstand) */
@media (min-width: 940px) {
  .sprach-knopf { right: calc(50% - 466px); }
}

.overlay.diktat { align-items: center; padding: 16px; }
.diktat-box {
  position: relative; background: var(--weiss); width: 100%; max-width: 460px;
  border-radius: 18px; padding: 28px 20px 22px;
  max-height: 92vh; overflow-y: auto;
  border-top: 4px solid var(--rot);
  box-shadow: var(--schatten-hoch);
}
.diktat-x { position: absolute; top: 10px; right: 14px; }

.welle { display: flex; justify-content: center; gap: 5px; height: 46px; align-items: center; margin-bottom: 16px; }
.welle i {
  width: 5px; border-radius: 3px; height: 12px;
  background: linear-gradient(180deg, var(--rot), var(--bordeaux));
  animation: welle 1s infinite ease-in-out;
}
.welle i:nth-child(2) { animation-delay: .1s; }
.welle i:nth-child(3) { animation-delay: .2s; }
.welle i:nth-child(4) { animation-delay: .3s; }
.welle i:nth-child(5) { animation-delay: .4s; }
@keyframes welle { 0%, 100% { height: 12px; } 50% { height: 40px; } }
.welle.still i { animation: none; height: 12px; background: var(--linie); }

.diktat-status { text-align: center; font-weight: 700; margin-bottom: 10px; }
.diktat-text { text-align: center; font-size: 1.05rem; min-height: 48px; margin-bottom: 10px; }
.diktat-beispiel {
  font-size: .74rem; color: var(--leise); text-align: center;
  margin-bottom: 8px; line-height: 1.5;
}

#diktat-eingabe {
  width: 100%; font-size: 1rem; padding: 14px;
  border-radius: var(--rundung-klein); border: 2px solid var(--linie);
  line-height: 1.5;
}

.erkannt {
  background: var(--grund); border: 1px solid var(--linie);
  border-radius: var(--rundung); padding: 14px 16px; margin-bottom: 14px;
}
.erkannt-zeile {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 5px 0; font-size: .84rem;
}
.erkannt-zeile span { color: var(--leise); font-weight: 500; }
.erkannt-zeile b { text-align: right; font-weight: 700; }
.erkannt-zeile.fehlt b { color: var(--rot); }
.roh-text {
  font-size: .72rem; color: var(--leise); font-style: italic;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--linie);
}

.diktat-zeile {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--weiss); border: 2px dashed var(--rot);
  border-radius: var(--rundung); padding: 12px 14px; margin-bottom: 16px;
  color: var(--rot); font-weight: 700; font-size: .86rem;
  text-transform: uppercase; letter-spacing: .03em;
}
.diktat-zeile span { font-size: 1.2rem; }

.ios-kasten {
  background: var(--amber-hauch); border: 1px solid #e8d492;
  border-radius: var(--rundung-klein);
  padding: 12px 14px; font-size: .78rem; line-height: 1.55; margin-bottom: 10px;
}

/* ═══ DIALOGE ════════════════════════════════════════════════════════════ */
/* Eigene statt alert/confirm/prompt: die sehen je nach Geraet anders aus,
   sind auf dem Handy winzig und lassen sich nicht gestalten. */

.overlay.dialog { align-items: center; padding: 18px; }
.dialog-box {
  background: var(--weiss); width: 100%; max-width: 420px;
  border-radius: 18px; padding: 24px 22px 20px;
  border-top: 4px solid var(--rot);
  box-shadow: var(--schatten-hoch);
  animation: hoch .16s ease-out;
}
.dialog-box h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.dialog-text { font-size: .9rem; color: var(--leise); line-height: 1.55; margin-bottom: 16px; }
.dialog-box textarea {
  width: 100%; padding: 13px 14px; font-size: 1rem; line-height: 1.5;
  border: 2px solid var(--linie); border-radius: var(--rundung-klein);
  font-family: inherit; resize: vertical;
}
.dialog-box textarea:focus { outline: none; border-color: var(--rot); }
.dialog-knoepfe { display: flex; gap: 10px; margin-top: 18px; }
.dialog-knoepfe .neben-knopf,
.dialog-knoepfe .haupt-knopf { flex: 1; margin: 0; }
.dialog-knoepfe .haupt-knopf.gefahr {
  background: linear-gradient(120deg, #8a0016, var(--rot) 75%);
}
.pin-anzeige {
  display: block; text-align: center;
  font-size: 2rem; font-weight: 800; letter-spacing: .18em;
  color: var(--rot); margin: 6px 0 14px;
  font-variant-numeric: tabular-nums;
}

/* Aktualisieren-Knopf: kurze Drehung als Rueckmeldung */
#knopf-aktualisieren.dreht svg { animation: dreh .6s ease-in-out; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* ═══ TOAST ══════════════════════════════════════════════════════════════ */

.toast {
  position: fixed; bottom: calc(86px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--schwarz); color: var(--weiss);
  padding: 12px 20px; border-radius: 30px;
  font-size: .84rem; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  z-index: 60; max-width: 90vw; text-align: center;
  animation: hoch .2s ease-out;
}

/* ═══ BREITE BILDSCHIRME ═════════════════════════════════════════════════ */

@media (min-width: 620px) {
  .kennzahlen { grid-template-columns: repeat(4, 1fr); }
  .ansicht-titel { font-size: 1.6rem; }
}

/* ═══ SUCHE ══════════════════════════════════════════════════════════════ */

.overlay.suche { align-items: flex-start; padding: 0; }
.suche-box {
  background: var(--grund); width: 100%; max-width: 620px;
  max-height: 100vh; overflow-y: auto;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
  border-bottom: 4px solid var(--rot);
  animation: runter .16s ease-out;
}
@keyframes runter { from { transform: translateY(-14px); opacity: .7; } to { transform: none; opacity: 1; } }

.suche-kopf {
  display: flex; align-items: center; gap: 10px;
  background: var(--weiss); border: 2px solid var(--linie);
  border-radius: var(--rundung); padding: 4px 12px;
}
.suche-kopf:focus-within { border-color: var(--rot); }
.suche-kopf svg { width: 19px; height: 19px; color: var(--leise); flex-shrink: 0; }
.suche-kopf input {
  flex: 1; border: 0; outline: none; background: none;
  font-size: 1.05rem; padding: 12px 0; min-width: 0;
}
.suche-hinweis { margin: 8px 2px 14px; }

.fundstelle {
  font-size: .78rem; color: var(--leise); margin-top: 7px;
  padding: 7px 10px; background: var(--grund);
  border-radius: var(--rundung-klein); border-left: 2px solid var(--linie);
  overflow-wrap: anywhere;
}
mark { background: #ffe9a8; color: inherit; padding: 0 2px; border-radius: 3px; }

.zeitraum-eigen {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.zeitraum-eigen input { flex: 1; min-width: 130px; padding: 9px 11px; font-size: .88rem; }
.zeitraum-eigen span { font-size: .8rem; color: var(--leise); }
.zeitraum-eigen .neben-knopf { margin: 0; }

.team-zeile.anklickbar { cursor: pointer; }
.team-zeile.anklickbar:active { transform: scale(.995); }

/* ═══ ERWAEHNUNGEN ═══════════════════════════════════════════════════════ */

.erwaehn-feld { position: relative; }
.erwaehn-liste {
  position: absolute; left: 0; right: 56px; top: 100%; z-index: 5;
  background: var(--weiss); border: 2px solid var(--rot);
  border-radius: var(--rundung-klein); overflow: hidden;
  box-shadow: 0 6px 18px rgba(26, 26, 26, .16);
}
.erwaehn-liste button {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; border: 0; background: none; text-align: left;
  padding: 11px 13px; font-weight: 600; font-size: .9rem;
  border-bottom: 1px solid var(--linie);
}
.erwaehn-liste button:last-child { border-bottom: 0; }
.erwaehn-liste button:active { background: var(--rot-hauch); }
.erwaehn-liste span { font-size: .64rem; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; }

.erwaehnt {
  color: var(--rot); font-weight: 700;
  background: var(--rot-hauch); padding: 1px 5px; border-radius: 5px;
}

/* ═══ WARNHINWEISE ═══════════════════════════════════════════════════════ */
/* Sichtbar, aber nicht schreiend - wer sie dreimal ueberliest, liest sie
   beim vierten Mal auch nicht lauter. */

.warnkasten {
  background: var(--amber-hauch);
  border: 1px solid #e8d492;
  border-left: 3px solid var(--amber-dunkel);
  border-radius: var(--rundung-klein);
  padding: 12px 14px;
  font-size: .8rem;
  line-height: 1.55;
  margin: 16px 0 4px;
}
.warnkasten b { color: var(--schwarz); }
.warnkasten ul { margin: 8px 0 8px 18px; }
.warnkasten li { margin-bottom: 3px; }
.leitkasten { margin-bottom: 20px; }

.warnzeile {
  font-size: .76rem; color: var(--leise);
  margin: 10px 0 2px; padding-left: 10px;
  border-left: 2px solid var(--amber-dunkel);
}

.leitsatz {
  text-align: center; font-size: .72rem; color: var(--leise);
  font-style: italic; margin: 14px 0 2px;
}

.test-zeile {
  padding: 7px 10px; margin-top: 6px; border-radius: 7px;
  font-size: .8rem; line-height: 1.45; border-left: 3px solid var(--linie);
  background: var(--grund);
}
.test-zeile.gut { border-left-color: var(--gruen); }
.test-zeile.schlecht { border-left-color: var(--rot); background: var(--rot-hauch); }

/* ═══ ANLEITUNG ══════════════════════════════════════════════════════════ */

.overlay.anleitung { align-items: flex-start; padding: 0; overflow-y: auto; }
.anleitung-box {
  background: var(--grund); width: 100%; max-width: 680px;
  min-height: 100vh;
  padding: 14px 16px calc(40px + env(safe-area-inset-bottom));
  border-top: 4px solid var(--rot);
}
.anl-titel { font-size: 1.5rem; font-weight: 800; margin-bottom: 2px; }

.anl-verzeichnis {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--linie);
}
.anl-verzeichnis button {
  border: 1px solid var(--linie); background: var(--weiss);
  border-radius: 18px; padding: 7px 13px;
  font-size: .76rem; font-weight: 600; color: var(--schwarz);
}
.anl-verzeichnis button:active { border-color: var(--rot); color: var(--rot); }

.anl-abschnitt {
  background: var(--weiss); border: 1px solid var(--linie);
  border-radius: var(--rundung); padding: 16px 18px; margin-bottom: 12px;
  box-shadow: var(--schatten); scroll-margin-top: 12px;
}
.anl-abschnitt h3 {
  display: flex; align-items: center; gap: 9px;
  font-size: 1.05rem; font-weight: 800; margin-bottom: 10px;
}
.anl-abschnitt h3::before {
  content: ''; width: 3px; height: 15px; background: var(--rot);
  flex-shrink: 0; border-radius: 2px;
}
.anl-abschnitt p { font-size: .88rem; line-height: 1.6; color: var(--schwarz); }
.anl-abschnitt b { font-weight: 700; }

.anl-bild {
  width: 100%; height: auto; display: block;
  margin: 4px 0 14px; background: var(--grund);
  border: 1px solid var(--linie); border-radius: var(--rundung-klein);
  padding: 8px;
}

.anl-schritte { margin: 12px 0 0 20px; font-size: .86rem; line-height: 1.6; }
.anl-schritte li { margin-bottom: 6px; }
.anl-schritte li::marker { font-weight: 800; color: var(--rot); }

.anl-achtung {
  background: var(--amber-hauch); border-left: 3px solid var(--amber-dunkel);
  border-radius: var(--rundung-klein);
  padding: 11px 13px; margin-top: 13px;
  font-size: .82rem; line-height: 1.55;
}
.anl-luecke { background: var(--rot-hauch); border-left-color: var(--rot); }
.anl-luecke code {
  background: var(--weiss); padding: 1px 5px; border-radius: 4px;
  font-size: .78rem;
}

.roh-zeile { display: flex; gap: 8px; align-items: stretch; }
.roh-zeile textarea {
  flex: 1; padding: 11px 12px; font-size: .92rem; line-height: 1.5;
  border: 2px solid var(--linie); border-radius: var(--rundung-klein);
  font-family: inherit; resize: vertical;
}
.roh-zeile textarea:focus { outline: none; border-color: var(--rot); }
.roh-zeile .neben-knopf { margin: 0; white-space: nowrap; flex-shrink: 0; }
