/* Verteilen — geteiltes Werkzeug fuer Verteilungsaufgaben mit Zeitbalken (wer macht was, wann ist alles fertig?).
   Datengetrieben: je Aufgabe ein Ordner mit index.html + data.json. Kein Framework.
   Gestaltung „Blatt" (2026-10-21): Farben, Schrift, Knopf und Blatt kommen aus
   ../assets/css/material.css (vorher geladen); hier nur das Layout des Werkzeugs, nur --m-*-Tokens.
   Den Grund setzt dieses Werkzeug selbst (material.css nennt nur quellen/ordnen/datenspuren), mit denselben Tokens. */

body.verteilen {
  margin: 0;
  background: var(--m-grund);
  color: var(--m-tinte);
  font: 17px/1.5 var(--m-schrift);
  -webkit-text-size-adjust: 100%;
}

.v-huelle { max-width: 900px; margin: 0 auto; padding: 28px 20px 48px; }

.v-kopf { padding: 0 2px 16px; }
.v-kopf h1 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.25; font-weight: 700; }
.v-kopf p { margin: 0 0 6px; max-width: var(--m-mass); }
.v-erfunden { font-size: .9rem; color: var(--m-leise); font-style: italic; }

/* ── Lagen: Reiter ───────────────────────────────────────────────────── */
.v-lagen { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.v-lage-knopf[aria-pressed="true"] { background: var(--m-tinte); color: var(--m-blatt); }

.v-blatt { padding: 16px 18px 18px; margin: 0 0 20px; }
.v-blatt h2 { margin: 0 0 4px; font-size: 1.2rem; }
.v-blatt > p { margin: 0 0 12px; max-width: var(--m-mass); }

/* ── Aufgaben: je Karte die Zeiten und die Wahl der Person ───────────── */
.v-aufgaben { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.v-aufgabe {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center;
  border: 1px solid var(--m-linie-hell); border-radius: 2px; padding: 10px 12px; background: var(--m-blatt);
}
.v-aufgabe-name { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.v-zeichen { width: 18px; height: 18px; border-radius: 3px; flex: none; }
.v-zeiten { grid-column: 1; font-size: .95rem; color: var(--m-leise); }
.v-wahl { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 8px; }
.v-wahl .m-knopf { padding: 0 14px; min-width: 88px; }
.v-wahl .m-knopf[aria-pressed="true"] { background: var(--m-tinte); color: var(--m-blatt); }

/* Farben der Arbeiten: nur Flächen, die Schrift im Balken ist weiß auf dunklem Grund.
   Nie Rot oder Grün: die stehen für „zu spät“ und „rechtzeitig“. */
.v-f0 { background: var(--m-blau); }
.v-f1 { background: var(--m-violett); }
.v-f2 { background: var(--m-leise); }
.v-f3 { background: var(--m-tinte); }

/* ── Zeitbalken ──────────────────────────────────────────────────────── */
.v-plan { padding: 16px 18px 14px; margin: 0 0 20px; }
.v-plan h2 { margin: 0 0 10px; font-size: 1.2rem; }
.v-zeile { display: grid; grid-template-columns: 96px minmax(0, 1fr) 150px; gap: 10px; align-items: center; margin: 0 0 10px; }
.v-zeile-name { font-weight: 700; }
.v-zeile-bahn {
  position: relative; height: 48px;
  background: var(--m-notiz); border: 1px solid var(--m-linie-hell); border-radius: 2px; overflow: hidden;
}
.v-balken {
  position: absolute; top: 4px; bottom: 4px; border-radius: 2px;
  color: var(--m-blatt); font-size: .82rem; font-weight: 600; line-height: 1.15;
  padding: 3px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border-right: 2px solid var(--m-blatt);
}
.v-zeile-ende { font-size: .95rem; }
.v-zeile-ende.v-zu-spaet { color: var(--m-rot); font-weight: 700; }
.v-achse { position: relative; height: 42px; font-size: .8rem; color: var(--m-leise); }
.v-strich { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.v-frist { position: absolute; top: 0; bottom: 0; width: 0; border-left: 3px solid var(--m-rot); z-index: 5; }
.v-frist-schild { position: absolute; top: 20px; transform: translateX(-50%); color: var(--m-rot); font-weight: 700; white-space: nowrap; }

/* ── Ergebnis ────────────────────────────────────────────────────────── */
.v-ergebnis { margin: 6px 0 0; font-size: 1.15rem; font-weight: 700; min-height: 1.6em; }
.v-ergebnis.v-zu-spaet { color: var(--m-rot); }
.v-ergebnis.v-rechtzeitig { color: var(--m-gut); }
.v-ergebnis.v-offen { color: var(--m-leise); font-weight: 400; font-size: 1rem; }
.v-handlungen { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ── Versuche ────────────────────────────────────────────────────────── */
.v-versuche { padding: 14px 18px; }
.v-versuche h2 { margin: 0 0 6px; font-size: 1.1rem; }
.v-versuche ol { margin: 0; padding-left: 1.4em; }
.v-versuche li { margin: 0 0 4px; }
.v-versuche .v-zu-spaet { color: var(--m-rot); font-weight: 700; }
.v-versuche .v-rechtzeitig { color: var(--m-gut); font-weight: 700; }

/* ── Vergleich: Rückstand je Arbeit ──────────────────────────────────── */
.v-vergleich { display: grid; gap: 16px; margin: 4px 0 16px; }
.v-vg-gruppe { border: 1px solid var(--m-linie-hell); border-radius: 2px; padding: 10px 12px; }
.v-vg-gruppe .v-aufgabe-name { margin-bottom: 8px; }
.v-vg-zeile { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: center; margin: 0 0 6px; }
.v-vg-bahn { position: relative; height: 34px; }
.v-vg-mehr {
  position: absolute; top: 4px; bottom: 4px; border: 2px dashed var(--m-rot); border-left: 0;
  color: var(--m-rot); font-weight: 700; font-size: .85rem; line-height: 1; padding: 0 6px;
  display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; overflow: visible;
}
.v-frage { border-top: 1px solid var(--m-linie-hell); padding-top: 12px; }
.v-frage-text { font-weight: 700; margin: 0 0 4px; }
.v-handlungen .m-knopf[aria-pressed="true"] { background: var(--m-tinte); color: var(--m-blatt); }

/* ── These und Erkenntnis ────────────────────────────────────────────── */
.v-these { border: 2px solid var(--m-tinte); border-radius: var(--m-ecke); padding: 10px 14px; margin: 0 0 14px; }
.v-these-wort { display: block; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--m-leise); }
.v-these p { margin: 2px 0 0; font-size: 1.12rem; font-weight: 700; }
.v-erkenntnis { padding: 18px 20px 20px; margin: 28px 0 20px; border: 3px solid var(--m-tinte); box-shadow: 8px 8px 0 var(--m-kante); }
.v-erkenntnis-wort { display: block; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--m-leise); }
.v-erkenntnis h2 { margin: 2px 0 12px; font-size: 1.35rem; line-height: 1.25; }
.v-erkenntnis h3 { margin: 18px 0 4px; font-size: 1.1rem; }
.v-erkenntnis > p { margin: 0 0 12px; max-width: var(--m-mass); }
.v-erkenntnis-satz {
  margin: 0 0 12px; padding: 10px 14px; max-width: var(--m-mass);
  border-left: 5px solid var(--m-tinte); background: var(--m-notiz); font-size: 1.08rem; font-weight: 700;
}
.v-merk { margin-top: 12px; }

/* ── Wiedergabe ──────────────────────────────────────────────────────── */
.v-jetzt { position: absolute; top: -2px; bottom: -2px; width: 0; border-left: 3px solid var(--m-tinte); z-index: 6; }
.v-uhrzeile { margin: 4px 0 0; min-height: 1.5em; font-variant-numeric: tabular-nums; font-weight: 600; }
.v-grund { margin: 2px 0 0; color: var(--m-tinte); max-width: var(--m-mass); }
.v-balken { transition: none; }

/* ── Eigene Lage ─────────────────────────────────────────────────────── */
.v-eigen-zeile { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 12px; }
.v-eigen-titel { font-weight: 700; }
.v-eingabe {
  min-height: var(--m-klick); padding: 0 10px; max-width: 100%;
  border: 1px solid var(--m-linie); border-radius: var(--m-ecke); background: var(--m-blatt);
}
.v-aufgabe-name .v-eingabe { flex: 1; min-width: 0; font-weight: 700; }
.v-zahl { width: 4.6em; text-align: right; }
.v-eigen-zeiten { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--m-tinte); }
.v-eigen-feld { display: inline-flex; gap: 6px; align-items: center; }
.v-klein { min-height: 36px; padding: 0 10px; font-size: .88rem; font-weight: 400; }

.v-nachweis { margin-top: 28px; font-size: .8rem; color: var(--m-leise); line-height: 1.5; }

/* Schmales Gerät: Namen über die Bahn, Ende darunter */
@media (max-width: 620px) {
  .v-huelle { padding: 18px 12px 40px; }
  .v-aufgabe { grid-template-columns: 1fr; }
  .v-wahl { grid-column: 1; grid-row: auto; }
  .v-zeile { grid-template-columns: 60px minmax(0, 1fr); gap: 6px; }
  .v-zeile-ende { grid-column: 2; }
  .v-strich-zwischen { display: none; }
}

/* ══ Art „woche“: Wochenplan-Rennen, Version 3 (Ergänzung 3, 2026-11-09) ══════════════════════════
   Breiter Modus nur, wenn die Lage „woche“ offen ist (body.v-woche-an, setzt verteilen.js).
   Je Arbeit ein Knopf je Person mit den Wochenminuten; ein Balken je Person; danach die Wochenplan-Tabelle.
   Keine Emojis. Eine ruhige Farbe je Person (helle Fläche, dunkle Schrift), Art der Arbeit als farbiges Wort.
   Helle Flächen aus den Tokens gemischt (color-mix); ältere Browser nehmen die Zeile davor (--m-notiz). */
.v-woche-an .v-huelle { max-width: 1240px; padding: 10px 12px 28px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; }
.v-woche-an .v-huelle > * { flex: 1 1 100%; }
.v-woche-an .v-kopf { flex: 1 1 auto; padding: 0 2px 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.v-woche-an .v-kopf h1 { margin: 0; font-size: 1rem; color: var(--m-leise); }
.v-woche-an .v-kopf p { margin: 0; }
.v-woche-an .v-kopf p:empty { display: none; }
.v-woche-an .v-lagen { flex: 0 0 auto; margin: 0 0 6px; gap: 8px; }
.v-woche-an .v-lagen .m-knopf { min-height: 44px; padding: 0 14px; }
.v-woche-an .v-blatt { padding: 12px 14px 16px; margin: 0 0 10px; }
.v-woche-an .v-nachweis { margin-top: 6px; }

/* Farben: Personen und Arten (Fläche hell, Rand kräftig, Schrift Tinte) */
.w-p0 { --w-farbe: var(--m-blau); }
.w-p1 { --w-farbe: var(--m-ocker); }
.w-p2 { --w-farbe: var(--m-gut); }
.w-art { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: .78rem; font-weight: 700; line-height: 1.35;
  border: 1px solid var(--w-art); color: var(--m-tinte); background: var(--m-notiz); background: color-mix(in srgb, var(--w-art) 14%, var(--m-blatt)); }
.w-art-haus { --w-art: var(--m-leise); }
.w-art-erziehung { --w-art: var(--m-violett); }
.w-art-pflege { --w-art: var(--m-rot); }
.w-art-beziehung { --w-art: var(--m-blau); }

/* Oben: Titel und Schritte, Start an fester Stelle */
.w-oben { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: center; margin: 0 0 10px; }
.w-intro h2 { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.2; }
.w-intro > p:empty { display: none; }
.w-schritte { margin: 0; padding-left: 1.4em; font-size: 1.05rem; font-weight: 700; line-height: 1.4; }
.w-start-knopf { width: 100%; min-height: 60px; font-size: 1.3rem; border-width: 3px; }

.w-raster { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }

/* Personenkarten */
.w-personen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.w-pkarte { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 6px; border-left: 6px solid var(--w-farbe);
  background: var(--m-notiz); background: color-mix(in srgb, var(--w-farbe) 12%, var(--m-blatt)); font-size: .88rem; line-height: 1.3; }
.w-pkarte strong { font-size: 1.05rem; }

/* Liste der Arbeiten: je Zeile ein Knopf je Person */
.w-liste-kopf { display: flex; justify-content: space-between; padding: 0 4px 4px; font-size: .85rem; font-weight: 700; color: var(--m-leise); }
.w-liste { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--m-tinte); }
.w-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; min-height: 64px; padding: 6px 4px;
  border-bottom: 1px solid var(--m-linie-hell); }
.w-arbeit { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.w-arbeit-name { font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
.w-arbeit-unter { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.w-tage { font-size: .85rem; color: var(--m-leise); }
.w-wahl { display: flex; gap: 6px; }
.w-knopf {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  width: 92px; min-height: 52px; padding: 2px 4px; border: 2px solid var(--m-linie); border-radius: 6px;
  background: var(--m-blatt); color: var(--m-tinte); font: inherit; line-height: 1.15; cursor: pointer;
}
.w-knopf-name { font-size: .82rem; font-weight: 600; }
.w-knopf-zahl { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.w-knopf[aria-pressed="true"] { border: 3px solid var(--w-farbe); background: var(--m-notiz); background: color-mix(in srgb, var(--w-farbe) 24%, var(--m-blatt)); }
.w-knopf.w-gesperrt { border-style: dashed; color: var(--m-leise); background: var(--m-notiz); cursor: help; }
.w-knopf.w-gesperrt .w-knopf-zahl { font-size: .8rem; font-weight: 600; }
.w-grund { grid-column: 1 / -1; margin: 0; padding: 4px 10px; border-left: 4px solid var(--m-tinte); background: var(--m-notiz); font-weight: 600; }

/* Balken je Person */
.w-balken-box h3, .w-laeufe h3 { margin: 0 0 6px; font-size: 1rem; }
.w-bzeile { display: grid; grid-template-columns: 52px minmax(0, 1fr) 40px; gap: 6px; align-items: center; margin: 0 0 6px; }
.w-bname { font-weight: 700; }
.w-bahn { position: relative; height: 34px; border: 1px solid var(--m-linie-hell); border-radius: 4px; background: var(--m-notiz); }
.w-balken { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; border: 2px solid var(--w-farbe);
  background: var(--m-notiz); background: color-mix(in srgb, var(--w-farbe) 30%, var(--m-blatt)); }
.w-balken[style*="width: 0"] { border-width: 0; }
.w-bisher { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 3px dashed var(--m-tinte); }
.w-bzahl { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.w-bisher-legende { margin: 0; font-size: .8rem; color: var(--m-leise); }

/* Ergebnis: der größte Text der Seite */
.w-ergebnis { margin: 12px 0 0; }
.w-satz { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.w-gewinn { margin: 4px 0 0; font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.w-zahl { display: block; font-size: 3.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.w-status { margin: 0; font-weight: 700; }
.w-status:empty { display: none; }
.w-laeufe { margin: 12px 0 0; }
.w-laeufe ol { margin: 0; padding-left: 1.5em; font-variant-numeric: tabular-nums; }
.w-bester { font-weight: 700; }
.w-klein { margin-top: 12px; min-height: 44px; padding: 0 14px; font-size: .95rem; }
body.w-laeuft .w-knopf { cursor: default; }

/* Wochenplan-Tabelle: tafelfähig, Wörter, wenig Farbe */
.w-wochenplan { margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--m-tinte); }
.w-wochenplan[hidden] { display: none; }
.w-wochenplan-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.w-wochenplan h2 { margin: 0; font-size: 1.4rem; }
.w-umschalter { display: flex; gap: 8px; }
.w-umschalter .w-klein { margin-top: 0; }
.w-umschalter .m-knopf[aria-pressed="true"] { background: var(--m-tinte); color: var(--m-blatt); }
.w-tabelle h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.w-tabelle table { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--m-blatt); }
.w-tabelle th, .w-tabelle td { border: 1px solid var(--m-linie); padding: 5px 5px; vertical-align: top; text-align: left; }
.w-tabelle thead th { font-size: .9rem; background: var(--m-notiz); }
.w-tab-person { width: 70px; font-size: 1rem; border-left: 6px solid var(--w-farbe) !important; }
.w-tab-summe { width: 70px; text-align: right !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.w-eintrag { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0 0 6px; }
.w-eintrag-name { font-size: .92rem; font-weight: 600; line-height: 1.2; }
.w-eintrag .w-art { max-width: 100%; font-size: .7rem; white-space: normal; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.w-merkmale { margin: 8px 0 0; padding-left: 1.2em; font-size: .9rem; line-height: 1.45; }

@media (max-width: 899px) {
  .w-oben, .w-raster { grid-template-columns: minmax(0, 1fr); }
  .w-tabelle { overflow-x: auto; }
  .w-tabelle table { min-width: 760px; }
}
