/* Formular für Mitglieder. Nur semantische Tokens (tokens.css) – keine festen Farben. */

body:has(.summenleiste) { padding-bottom: 124px; } /* Platz für die Summenleiste (Desktop ca. 105 px) */
/* Fokussierte oder angesprungene Elemente nicht hinter Summenleiste bzw. Schritt-Navigation verstecken */
html:has(.summenleiste) { scroll-padding-bottom: 136px; scroll-padding-top: 64px; }
@media (max-width: 639px) {
  /* Auf dem Handy ist die Leiste ca. 150 px hoch (Stand-Zeile, Summe, Knopf über die volle Breite). */
  body:has(.summenleiste) { padding-bottom: 172px; }
  html:has(.summenleiste) { scroll-padding-bottom: 184px; }
}

/* --- Grundelemente --------------------------------------------------- */
/* Boxen (Hinweis, Warnung, Fehler, Erfolg) stehen in basis.css (Entscheidung 8). */
[hidden] { display: none !important; }

.info-ansprechpartner { margin-bottom: 1rem; }
.ausfuellhinweise { margin: 0 0 1.25rem; background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 6px; padding: .6rem 1rem; }
.ausfuellhinweise summary { cursor: pointer; font-weight: 700; color: var(--text-stark); }
.ausfuellhinweise ul { margin: .6rem 0; padding-left: 1.2rem; }
.ausfuellhinweise li { margin-bottom: .3rem; }

/* Stand-Zeichen (Entscheidung 3): ✓ vollständig, Stift = in Arbeit, ! = fehlt etwas, Ring = noch nicht begonnen */
.stand { position: relative; width: 24px; height: 24px; border-radius: 50%; flex: none; box-sizing: border-box; display: block; }
.stand svg { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; display: none; }
.stand[data-stand="ok"] { background: var(--erfolg-rand); color: var(--flaeche); }
.stand[data-stand="ok"] .i-ok { display: block; }
.stand[data-stand="arbeit"] { background: var(--hinweis-flaeche); border: 1.5px solid var(--hinweis-rand); color: var(--hinweis-text); }
.stand[data-stand="arbeit"] .i-arbeit { display: block; }
.stand[data-stand="fehlt"] { background: var(--warn-flaeche); border: 1.5px solid var(--warn-rand); color: var(--warn-text); }
.stand[data-stand="fehlt"] .i-fehlt { display: block; }
.stand[data-stand="leer"] { border: 1.5px solid var(--rahmen-stark); }
.pfeil { width: 18px; height: 18px; flex: none; color: var(--text-gedaempft); transition: transform .15s; }

/* Abschnitte als aufklappbare Karten, Kopfzeile = Knopf (Entscheidung 3) */
.karte.abschnitt { padding: 0; overflow: hidden; }
.abschnitt-titel { margin: 0; font-size: inherit; }
.abschnitt-kopf {
  font: inherit; width: 100%; display: flex; align-items: center; gap: 10px; min-height: 56px; box-sizing: border-box;
  padding: 10px 16px; background: var(--flaeche); border: none; text-align: left; cursor: pointer; color: var(--text-stark);
}
.abschnitt.offen .abschnitt-kopf { background: var(--flaeche-erhoben); border-bottom: 1px solid var(--rahmen); }
.abschnitt.offen .abschnitt-kopf .pfeil { transform: rotate(180deg); }
.abschnitt-kopf:focus-visible { outline: 3px solid var(--fokus); outline-offset: -3px; }
.abschnitt-name { font-weight: 700; font-size: 1.15rem; flex: none; }
.abschnitt-info { flex: 1; min-width: 0; font-size: .88rem; color: var(--text-gedaempft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abschnitt-info.fehlt { color: var(--warn-text); font-weight: 700; }
.abschnitt-inhalt { padding: 1.25rem; }
@media (max-width: 760px) {
  .karte.abschnitt { box-shadow: none; }
  .abschnitt-inhalt { padding: 1rem; }
}
.karte-intro { color: var(--text-gedaempft); margin-top: 0; }

.raster { display: grid; gap: 1rem; }
.raster.zwei { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.feld { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.feld label { font-weight: 700; color: var(--text-stark); font-size: .92rem; }
.feld small { color: var(--text-gedaempft); font-size: .85rem; }
.optional { font-weight: 400; color: var(--text-gedaempft); }

input[type=text], input[type=email], input[type=date], select {
  font: inherit; color: var(--text-stark); background: var(--flaeche-eingabe);
  border: 1px solid var(--rahmen-stark); border-radius: 4px; padding: .55rem .6rem; width: 100%;
  min-height: 44px;
}
input:focus-visible, select:focus-visible { outline: 3px solid var(--fokus); outline-offset: 0; border-color: var(--fokus); }
[aria-invalid="true"] { border-color: var(--akzent) !important; box-shadow: 0 0 0 1px var(--akzent); }
.ungueltig { box-shadow: 0 0 0 2px var(--akzent); border-radius: 6px; }

/* Größere Felder für den Daumen (Entscheidung 4) */
:is(#formular, #antwortFormular) :is(input[type=text], input[type=email], input[type=date], select, textarea) {
  font-size: 1.05rem; min-height: 52px; border: 2px solid var(--rahmen-stark); border-radius: 8px; padding: 0 14px;
}
:is(#formular, #antwortFormular) textarea { padding: 12px 14px; }
:is(#formular, #antwortFormular) select {
  appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-gedaempft) 50%), linear-gradient(135deg, var(--text-gedaempft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
:is(#formular, #antwortFormular) :is(input, select, textarea)::placeholder { color: var(--text-gedaempft); opacity: 1; }
:is(#formular, #antwortFormular) :is(input, select, textarea):focus-visible {
  outline: none; border-color: var(--fokus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fokus) 30%, transparent);
}
:is(#formular, #antwortFormular) .feld label { font-size: 1rem; }
:is(#formular, #antwortFormular) [aria-invalid="true"] { box-shadow: none; }
/* Fehlermeldung direkt unter dem Feld (zusätzlich zur Sammelbox) */
.feld-fehler { display: flex; gap: 6px; align-items: flex-start; color: var(--fehler-text); font-size: .88rem; font-weight: 700; margin-top: 2px; }
.feld-fehler svg { width: 18px; height: 18px; flex: none; }

.checkbox-zeile { display: flex; gap: .6rem; align-items: flex-start; margin-top: .9rem; }
.checkbox-zeile input { width: 20px; height: 20px; margin-top: .15rem; flex: none; accent-color: var(--akzent); }
.erklaerungen .checkbox-zeile:first-child { margin-top: 0; }
.erklaerungen label { font-size: .93rem; }

.hp-feld { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Schaltflächen (Entscheidung 9) ---------------------------------------------
   Pillenform, 48 px. Rot nur für die eine Hauptaktion je Ansicht; Zweitknopf hell mit dünnem Rahmen;
   Löschen-Knopf in derselben Form, rot umrandet mit Mülleimer. Reine Links bleiben Links. */
.btn-primaer, .btn-sekundaer, .btn-loeschen {
  font: inherit; font-size: 1rem; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; text-align: center;
  min-height: 48px; padding: 0 22px; border-radius: 999px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primaer { background: var(--akzent); color: var(--akzent-text-auf); border: 1px solid var(--akzent-rand); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
/* Rand bleibt beim Darüberfahren: im Dunkelmodus trägt er den Kontrast (Entscheidung 13). */
.btn-primaer:hover { background: var(--akzent-hover); }
.btn-sekundaer { background: var(--flaeche-erhoben); color: var(--text-stark); border: 1px solid var(--rahmen); }
.btn-sekundaer:hover { border-color: var(--text); }
.btn-loeschen { background: var(--flaeche-erhoben); color: var(--fehler-text); border: 1px solid var(--akzent); padding: 0 20px 0 16px; }
.btn-loeschen:hover { background: var(--fehler-flaeche); }
.btn-primaer svg, .btn-sekundaer svg, .btn-loeschen svg { width: 18px; height: 18px; flex: none; }
button:disabled, .btn-primaer[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.link-knopf, .symbol-knopf {
  font: inherit; cursor: pointer; border-radius: 4px; min-height: 44px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.link-knopf { background: none; border: none; color: var(--link); text-decoration: underline; padding: 0; min-height: auto; }
.symbol-knopf {
  background: none; border: 1px solid transparent; color: var(--text-gedaempft); width: 44px; padding: 0; font-size: 1.1rem;
}
.symbol-knopf:hover { color: var(--text-stark); border-color: var(--rahmen); }
.symbol-knopf.klein { width: 36px; min-height: 36px; font-size: 1rem; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: .8rem; align-items: center; }
/* Handy: Knöpfe übereinander über die volle Breite, Hauptknopf oben. */
@media (max-width: 640px) {
  .knopfreihe { flex-direction: column; align-items: stretch; }
  .knopfreihe > .btn-primaer { order: -1; }
}

/* Status-Marken (Entscheidung 9): eckig, nur Rahmen und farbige Schrift, keine Fläche.
   Hier statt in admin.css, weil auch die Statusseite sie zeigt. */
.marke, .hinweis-marke {
  display: inline-block; padding: 1px 10px; border-radius: 4px; font-size: .8rem; font-weight: 700; line-height: 1.5;
  border: 1.5px solid; background: transparent; white-space: nowrap; vertical-align: middle;
}
.marke-offen { color: var(--hinweis-text); border-color: var(--hinweis-rand); }
.marke-rueckfrage, .hinweis-marke.warn { color: var(--warn-text); border-color: var(--warn-rand); }
.marke-erstattet { color: var(--erfolg-text); border-color: var(--erfolg-rand); }
.marke-abgelehnt, .hinweis-marke.fehler { color: var(--fehler-text); border-color: var(--akzent); }
.hinweise { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Schrittanzeige (Entscheidung 2) --------------------------------------- */
.schritt-anzeige { position: sticky; top: 0; z-index: 20; margin: 0 -16px 1rem; }
.schritt-knopf {
  font: inherit; width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: pointer;
  background: var(--flaeche); color: inherit; border: none; border-bottom: 1px solid var(--rahmen); padding: 10px 16px 12px;
}
.schritt-knopf:focus-visible { outline: 3px solid var(--fokus); outline-offset: -3px; }
.schritt-zeile { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.schritt-text strong { color: var(--text-stark); }
.schritt-text #schrittName { color: var(--text-gedaempft); }
.schritt-knopf[aria-expanded="true"] .pfeil { transform: rotate(180deg); }
.schritt-balken { display: block; height: 6px; border-radius: 3px; background: var(--rahmen); overflow: hidden; }
.schritt-balken span { display: block; height: 100%; width: 25%; background: var(--akzent); border-radius: 3px; transition: width .2s; }
.schritt-liste {
  list-style: none; margin: 0; padding: 4px 0; background: var(--flaeche); border-bottom: 1px solid var(--rahmen); box-shadow: var(--schatten);
}
.schritt-liste a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; text-decoration: none; color: var(--text-stark); }
.schritt-liste a:hover { background: var(--flaeche-erhoben); }
.schritt-liste a[aria-current="step"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--akzent); }
.schritt-liste a[aria-disabled="true"] { color: var(--text-gedaempft); pointer-events: none; }
.schritt-liste small { margin-left: auto; font-size: .78rem; color: var(--text-gedaempft); }
@media (min-width: 992px) { .schritt-anzeige { margin: 0 0 1rem; } .schritt-knopf { border: 1px solid var(--rahmen); border-radius: 8px; } }

/* --- Belege (Entscheidung 5: Seitenstreifen) ------------------------------------ */
.belege-dropzone { border: 2px dashed transparent; border-radius: 8px; transition: border-color .15s; }
.belege-dropzone.drag-aktiv { border-color: var(--fokus); background: var(--hinweis-flaeche); }
.beleg-liste { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.beleg { border: 1px solid var(--rahmen); border-radius: 8px; background: var(--flaeche); padding: 10px 12px; }
.beleg.ziehend { opacity: .5; }
.beleg.ziel { border-color: var(--fokus); box-shadow: 0 0 0 2px var(--fokus); }
.beleg-kopf { display: flex; align-items: center; gap: .5rem; }
.beleg-titel { font-weight: 700; color: var(--text-stark); white-space: nowrap; }
.beleg-zuordnung {
  font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--hinweis-flaeche); color: var(--hinweis-text); border: 1px solid var(--hinweis-rand);
}
.beleg-zuordnung.frei { background: var(--warn-flaeche); color: var(--warn-text); border-color: var(--warn-rand); }
.beleg-name { flex: 1; min-width: 0; font-size: .85rem; color: var(--text-gedaempft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beleg-kopf .rechts { margin-left: auto; display: flex; gap: .25rem; flex: none; }
.beleg-kopf .symbol-knopf.klein { border-color: var(--rahmen-stark); color: var(--text-stark); }
/* Touch: Tippfläche 44 px, ohne das Aussehen zu ändern – unsichtbare Fläche um die kleinen Knöpfe. */
@media (pointer: coarse) {
  .beleg-kopf .rechts { gap: 8px; } /* Tippflächen der Nachbarknöpfe überlappen nicht */
  .beleg-kopf .symbol-knopf.klein { position: relative; }
  .beleg-kopf .symbol-knopf.klein::after, .seite-weg::after { content: ""; position: absolute; inset: -4px; }
  .seite-weg::after { inset: -8px; }
}
.griff { cursor: grab; color: var(--text-gedaempft); user-select: none; padding: 0 .25rem; font-size: 1.2rem; }
.seiten { display: flex; gap: 14px; overflow-x: auto; padding: 12px 12px 4px 0; margin-top: 2px; }
.seite { position: relative; flex: none; }
.seite-vorschau {
  width: 76px; height: 100px; border: 1px solid var(--rahmen); border-radius: 4px; background: var(--flaeche-eingabe);
  display: grid; place-items: center; overflow: hidden; cursor: zoom-in; padding: 0; font: inherit; color: var(--text-gedaempft);
}
.seite-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.seite-vorschau .pdf-symbol { font-weight: 700; font-size: .85rem; }
.seite-nr {
  position: absolute; left: 4px; bottom: 4px; font-size: .7rem; font-weight: 700; line-height: 1.4; padding: 0 4px;
  border-radius: 3px; background: #3c3c3b; color: #ffffff; pointer-events: none;
}
.seite-weg {
  position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; border-radius: 50%; padding: 0; font: inherit;
  font-size: .75rem; display: grid; place-items: center; cursor: pointer;
  background: var(--flaeche); color: var(--text-stark); border: 1px solid var(--rahmen-stark);
}
.seite-weg:hover { border-color: var(--text); }
.seite-neu-wrap { position: relative; flex: none; }
.seite-neu {
  width: 76px; height: 100px; box-sizing: border-box; border: 2px dashed var(--rahmen-stark); border-radius: 4px;
  background: transparent; color: var(--text-stark); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.seite-neu:hover { border-color: var(--text); }
.seite-menue {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 15; min-width: 180px; padding: 4px; display: flex; flex-direction: column;
  background: var(--flaeche); border: 1px solid var(--rahmen-stark); border-radius: 6px; box-shadow: var(--schatten);
}
.seite-menue button { font: inherit; font-size: .92rem; text-align: left; min-height: 44px; padding: 0 12px; border: none; border-radius: 4px; background: none; color: var(--text-stark); cursor: pointer; }
.seite-menue button:hover, .seite-menue button:focus-visible { background: var(--flaeche-erhoben); }
.belege-leer { color: var(--text-gedaempft); text-align: center; padding: 1.25rem; border: 1px dashed var(--rahmen-stark); border-radius: 6px; margin: 1rem 0 0; }
.belege-groesse { font-size: .88rem; color: var(--text-gedaempft); margin: .6rem 0 0; }
.belege-groesse.warnung { color: var(--fehler-text); font-weight: 700; }
.verarbeitung {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem;
  background: var(--hinweis-flaeche); color: var(--hinweis-text); padding: .6rem .8rem; border-radius: 6px;
}
@media (max-width: 760px) {
  .beleg-kopf { flex-wrap: wrap; gap: .4rem; }
  .beleg-kopf .griff { display: none; } /* Ziehen per Touch geht nicht; dort gibt es ↑ ↓ */
  .beleg-name { order: 5; flex-basis: 100%; }
}

/* --- Positionen (Entscheidung 6) ------------------------------------------------- */
.positionen { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.position { border: 1px solid var(--rahmen); border-radius: 8px; background: var(--flaeche); overflow: hidden; }
.position-titel { margin: 0; font-size: inherit; }
.position-kopf {
  font: inherit; width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; box-sizing: border-box;
  padding: 8px 14px; background: var(--flaeche); border: none; text-align: left; cursor: pointer; color: var(--text-stark);
}
.position.offen .position-kopf { background: var(--flaeche-erhoben); border-bottom: 1px solid var(--rahmen); }
.position.offen .position-kopf .pfeil { transform: rotate(180deg); }
.position-kopf:focus-visible { outline: 3px solid var(--fokus); outline-offset: -3px; }
.position-haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.position-haupt b { font-size: 1rem; }
.position-haupt [data-anzeige="info"] { font-size: .84rem; color: var(--text-gedaempft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.position-haupt [data-anzeige="info"].fehlt { color: var(--warn-text); font-weight: 700; }
.position-summe { font-weight: 700; font-size: 1.05rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.position:not(.offen) .position-inhalt { display: none; }
.position-inhalt { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; padding: 14px; }
.position-beleg { display: flex; flex-direction: column; gap: 8px; }
.position-belegbild {
  position: relative; width: 180px; height: 240px; padding: 0; border: 1px solid var(--rahmen); border-radius: 6px;
  background: var(--flaeche-eingabe); overflow: hidden; display: grid; place-items: center; cursor: zoom-in; font: inherit; color: var(--text-gedaempft);
}
.position-belegbild:disabled { cursor: default; }
.position-belegbild img { width: 100%; height: 100%; object-fit: cover; }
.position-belegbild .pdf-symbol { font-weight: 700; font-size: .85rem; }
.position-belegbild .lupe {
  position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 4px; display: grid; place-items: center;
  background: #3c3c3b; color: #ffffff;
}
.position-belegbild:disabled .lupe { display: none; }
.position-belegbild .lupe svg { width: 16px; height: 16px; }
.position-felder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; }
.position-felder .feld { grid-column: span 3; }
.position-felder .f-kostenstelle, .position-fuss { grid-column: 1 / -1; }
.euro-feld { position: relative; display: block; }
.euro-feld::after { content: "€"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--text-gedaempft); }
#formular .f-betrag input { font-size: 1.35rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; padding-right: 36px; }
.position-fuss { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--rahmen); padding-top: 12px; }
.position-neu {
  font: inherit; width: 100%; min-height: 52px; border: 2px dashed var(--rahmen-stark); border-radius: 8px;
  background: transparent; color: var(--text-stark); font-weight: 700; cursor: pointer;
}
.position-neu:hover { border-color: var(--text); }
/* Kostenstelle mit Schalter "unsicher" im selben Rahmen */
.ks-gruppe { display: flex; align-items: stretch; min-height: 52px; box-sizing: border-box; border: 2px solid var(--rahmen-stark); border-radius: 8px; background: var(--flaeche-eingabe); overflow: hidden; }
.ks-gruppe:focus-within { border-color: var(--fokus); }
#formular .ks-gruppe .ks-eingabe { border: none; border-radius: 0; min-height: 48px; flex: 1; min-width: 0; background: transparent; box-shadow: none; }
.ks-schalter {
  font: inherit; font-size: .9rem; line-height: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px;
  border: none; border-left: 1px solid var(--rahmen); background: transparent; color: var(--text-gedaempft); cursor: pointer; white-space: nowrap;
}
.ks-schalter:hover { color: var(--text-stark); }
.ks-schalter:focus-visible { outline: 3px solid var(--fokus); outline-offset: -3px; }
.ks-box { position: relative; width: 18px; height: 18px; box-sizing: border-box; border: 2px solid var(--rahmen-stark); border-radius: 3px; flex: none; }
.ks-box svg { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; display: none; }
.ks-gruppe.unsicher-an { border-color: var(--warn-rand); }
.ks-gruppe.unsicher-an .ks-schalter { color: var(--warn-text); font-weight: 700; }
.ks-gruppe.unsicher-an .ks-box { background: var(--warn-rand); border-color: var(--warn-rand); color: var(--flaeche); }
.ks-gruppe.unsicher-an .ks-box svg { display: block; }
.ks-gruppe:has(.ks-eingabe[aria-invalid="true"]) { border-color: var(--akzent); }
.ks-hinweis { margin: .3rem 0 0; font-size: .82rem; color: var(--warn-text); }
@media (max-width: 760px) {
  .position-inhalt { grid-template-columns: 1fr; gap: 14px; }
  .position-beleg { flex-direction: row; align-items: center; gap: 10px; }
  .position-belegbild { width: 64px; height: 84px; flex: none; }
  .position-belegbild .lupe { width: 24px; height: 24px; right: 3px; bottom: 3px; }
  .position-beleg .f-beleg { flex: 1; }
  .position-felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .position-felder .feld { grid-column: 1 / -1; }
  .position-felder .f-betrag, .position-felder .f-datum { grid-column: span 1; }
  .position-fuss { flex-direction: column-reverse; align-items: stretch; }
}

.ks-feld { position: relative; }
.ks-eingabe.gewaehlt { font-weight: 700; }
/* Trefferliste der Kostenstellen-Suche (Entscheidung 14): eine Liste mit Gruppen, Nummer fett links,
   Treffer gelb hinterlegt, Auswahl blau mit Strich links, Bereiche mit Anzahl und Pfeil. */
/* Im Textfluss statt schwebend: Karten und Positionen schneiden mit overflow:hidden ab, und so
   schiebt die Liste den Rest nach unten, statt ihn zu verdecken (Handy: volle Breite). */
.ks-liste {
  position: relative; z-index: 30; margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--flaeche); border: 1px solid var(--rahmen-stark); border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  max-height: min(520px, 70vh); overflow-y: auto;
}
.ks-liste [role=option] {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 44px;
  padding: 4px 14px; box-sizing: border-box; cursor: pointer; line-height: 1.3; color: var(--text-stark);
}
.ks-liste [role=option]:hover { background: var(--flaeche-erhoben); }
.ks-liste [role=option][aria-selected="true"] { background: var(--hinweis-flaeche); box-shadow: inset 3px 0 0 var(--hinweis-rand); }
.ks-liste .ks-nr { font-weight: 700; font-variant-numeric: tabular-nums; }
.ks-liste .ks-name { min-width: 0; }
.ks-liste .ks-unterzeile { display: block; font-size: .8rem; color: var(--text-gedaempft); }
.ks-liste mark { background: var(--warn-flaeche); color: inherit; border-radius: 2px; padding: 0 1px; }
.ks-liste .ks-titel { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--text-gedaempft); padding: 10px 14px 4px; }
.ks-liste .ks-titel mark { background: none; text-decoration: underline; }
.ks-liste .ks-titelzeile { padding: 8px 14px 2px; font-weight: 700; color: var(--text-stark); }
.ks-liste .ks-titelzeile span { display: block; font-weight: 400; font-size: .8rem; color: var(--text-gedaempft); }
.ks-liste .ks-bereich { grid-template-columns: minmax(0, 1fr) auto 16px; }
.ks-liste .ks-zurueck { grid-template-columns: 16px minmax(0, 1fr); color: var(--link); font-weight: 700; }
.ks-liste .ks-anz { font-size: .82rem; color: var(--text-gedaempft); font-variant-numeric: tabular-nums; }
.ks-liste .ks-weiter { width: 16px; height: 16px; color: var(--text-gedaempft); }
.ks-liste .ks-zurueck .ks-weiter { color: var(--link); }
.ks-liste .ks-info { display: block; cursor: default; color: var(--text-gedaempft); font-size: .88rem; min-height: 0; padding: 10px 14px; }
.ks-liste .ks-info:hover { background: none; }
.ks-liste .ks-fuss { border-top: 1px solid var(--rahmen); margin-top: 4px; padding: 8px 14px 4px; font-size: .82rem; }
@media (max-width: 760px) {
  .ks-liste [role=option] { min-height: 48px; }
  .ks-liste .ks-tasten { display: none; }
}
.ks-pfad { margin: .3rem 0 0; font-size: .85rem; color: var(--text-gedaempft); }
.ks-pfad:empty { display: none; }
@media (min-width: 761px) { .ks-pfad { display: none; } }
.ks-unsicher { display: inline-flex; gap: .4rem; align-items: center; margin-top: .4rem; font-size: .9rem; }
.ks-unsicher input { width: 18px; height: 18px; accent-color: var(--akzent); }

/* --- Prüfansicht ------------------------------------------------------------ */
.uebersicht h2 { margin-top: 0; }
.tabelle-scroll { overflow-x: auto; }
table.uebersicht-tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.uebersicht-tabelle th, .uebersicht-tabelle td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--rahmen); vertical-align: top; }
.uebersicht-tabelle th { color: var(--text-stark); background: var(--flaeche-erhoben); }
.uebersicht-tabelle .betrag { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.uebersicht-tabelle tfoot td { font-weight: 700; color: var(--text-stark); border-bottom: none; }
.unsicher-text { color: var(--fehler-text); font-weight: 700; }
.kennzahlen { color: var(--text-gedaempft); }
@media (max-width: 760px) {
  .uebersicht-tabelle thead { display: none; }
  .uebersicht-tabelle tr { display: block; border: 1px solid var(--rahmen); border-radius: 6px; margin-bottom: .6rem; padding: .3rem .5rem; }
  .uebersicht-tabelle td { display: flex; justify-content: space-between; gap: 1rem; border-bottom: none; padding: .2rem 0; }
  .uebersicht-tabelle td::before { content: attr(data-label); font-weight: 700; color: var(--text-stark); }
  .uebersicht-tabelle td.betrag { text-align: right; }
  .uebersicht-tabelle tfoot tr { border: none; }
  .uebersicht-tabelle tfoot td:first-child { display: none; } /* „Gesamtsumme“ steht schon als Beschriftung am Betrag */
}

/* --- Erfolg, Fortschritt ---------------------------------------------------- */
.erfolg-nr { font-size: 1.2rem; }
.status-link a { word-break: break-all; }
.fortschritt { margin: 1rem 0; }
.fortschritt progress { width: 100%; height: 10px; accent-color: var(--akzent); }
.lokal-loeschen { text-align: center; margin-top: 2rem; }

/* --- Summenleiste ------------------------------------------------------------ */
.summenleiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: var(--flaeche); border-top: 1px solid var(--rahmen); box-shadow: 0 -2px 8px rgba(0,0,0,.12);
}
.summenleiste-innen { max-width: 960px; margin: 0 auto; padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.summe-label { font-size: .8rem; color: var(--text-gedaempft); }
.summe-wert { font-size: 1.3rem; font-weight: 700; line-height: 1.2; color: var(--text-stark); font-variant-numeric: tabular-nums; }
.summen-reihe { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.summen-reihe .btn-primaer { padding: 0 28px; }
/* Stand-Zeile (Entscheidung 7): kleine Stand-Zeichen (16 px), Glyphe im selben SVG – exakt mittig. */
.stand-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: .84rem; color: var(--text-gedaempft); min-height: 20px; }
.stand-eintrag { display: inline-flex; align-items: center; gap: 6px; }
.stand-eintrag.ok { color: var(--text); }
.stand-eintrag.arbeit { color: var(--hinweis-text); }
.stand-eintrag.fehlt { color: var(--warn-text); font-weight: 700; }
.stand-eintrag.fertig { color: var(--erfolg-text); font-weight: 700; }
.stand-kurz { display: none; }
.stand-kurz b { color: var(--warn-text); }
.mini { width: 16px; height: 16px; flex: none; display: block; }
.mini .grund-ok { fill: var(--erfolg-rand); }
.mini .glyphe-ok { stroke: var(--flaeche); }
.mini .grund-arbeit { fill: var(--hinweis-flaeche); stroke: var(--hinweis-rand); }
.mini .glyphe-arbeit { stroke: var(--hinweis-text); }
.mini .grund-fehlt { fill: var(--warn-flaeche); stroke: var(--warn-rand); }
.mini .glyphe-fehlt { stroke: var(--warn-text); }
.mini .grund-leer { fill: none; stroke: var(--rahmen-stark); }
/* Handy (C): Stand-Zeile verkürzt, Summe groß in einer Zeile, Knopf über die volle Breite. */
@media (max-width: 639px) {
  .summenleiste-innen { padding: 10px 16px 14px; gap: 10px; }
  .stand-zeile { flex-wrap: nowrap; align-items: flex-start; gap: 6px; }
  .stand-zeile .stand-eintrag { display: none; }
  .stand-zeile .stand-kurz { display: flex; gap: 6px; align-items: flex-start; }
  .stand-kurz .mini { margin-top: 1px; }
  .summen-reihe { flex-direction: column; align-items: stretch; gap: 10px; }
  .summe-block { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 12px; }
  .summe-block .summe-wert { font-size: 1.6rem; white-space: nowrap; }
  .summe-block .summe-label::before { content: "Gesamt · "; }
  .summen-reihe .btn-primaer { width: 100%; min-height: 52px; font-size: 1.05rem; }
}

/* --- Dialoge ------------------------------------------------------------------ */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.overlay-karte {
  background: var(--flaeche); color: var(--text); border-radius: 8px; padding: 1.25rem; width: 100%; max-width: 640px;
  max-height: calc(100vh - 32px); overflow: auto;
}
.overlay-breit { max-width: 900px; }
.overlay-hinweis { color: var(--text-gedaempft); font-size: .9rem; }
/* --- Zuschnitt (Entscheidung 15) ----------------------------------------------------- */
.zuschnitt-karte { max-width: 820px; display: flex; flex-direction: column; gap: 12px; }
.zuschnitt-oben { display: flex; align-items: center; }
.zuschnitt-oben h2 { margin: 0; font-size: 1.25rem; }
.zuschnitt-oben .zuschnitt-abbrechen-oben, .zuschnitt-oben .platz { display: none; }
.zuschnitt-hinweis { margin: -4px 0 0; }
.zuschnitt-schritt { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.zuschnitt-arbeit { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; align-items: start; }
.zuschnitt-bild {
  position: relative; background: #111111; border-radius: 6px; display: flex; justify-content: center; align-items: center;
  min-height: 200px; overflow: hidden; touch-action: none;
}
#zuschnittFlaeche { display: block; }
/* Griff 20 px sichtbar, 44 px Tastfläche, exakt mittig auf der Ecke */
.ecke {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: none; background: none;
  cursor: grab; touch-action: none; display: grid; place-items: center;
}
.ecke::before { content: ""; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; background: #ffffff; border: 3px solid #e30613; }
.ecke:active { cursor: grabbing; }
.ecke:focus-visible { outline: none; }
.ecke:focus-visible::before { box-shadow: 0 0 0 3px #78bcf0; }
.zuschnitt-seite { display: flex; flex-direction: column; gap: 10px; }
.zuschnitt-seite .lbl { font-weight: 700; font-size: .9rem; color: var(--text-stark); }
.zuschnitt-ergebnis {
  background: var(--flaeche-eingabe); border: 1px solid var(--rahmen); border-radius: 6px; height: 230px;
  display: grid; place-items: center; padding: 8px; box-sizing: border-box;
}
#zuschnittVorschau { max-width: 100%; max-height: 212px; box-shadow: 0 0 0 1px var(--rahmen); background: #ffffff; }
.zuschnitt-klein { font-size: .8rem; color: var(--text-gedaempft); }
/* Darstellung: zwei Symbol-Knöpfe (ausdrücklich gewünscht), gewählt mit dunklem Rahmen + rotem Strich */
.darstellung-wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.darstellung-wahl button {
  font: inherit; font-size: .85rem; cursor: pointer; min-height: 64px; padding: 8px 4px 6px; box-sizing: border-box;
  border: 1px solid var(--rahmen-stark); border-radius: 8px; background: var(--flaeche); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.darstellung-wahl button svg { width: 24px; height: 24px; display: block; flex: none; }
.darstellung-wahl button:hover { border-color: var(--text); }
.darstellung-wahl button[aria-pressed="true"] { border: 2px solid var(--text-stark); color: var(--text-stark); font-weight: 700; box-shadow: inset 0 -3px 0 var(--akzent); }
.zuschnitt-knoepfe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.zuschnitt-knoepfe .rechts { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.zuschnitt-danach { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; padding: 8px 0; }
.zuschnitt-danach p { margin: 0; }
.danach-vorschau { background: var(--flaeche-eingabe); border: 1px solid var(--rahmen); border-radius: 8px; padding: 14px 24px; }
.danach-vorschau img { display: block; max-height: 220px; max-width: 100%; background: #ffffff; }
.zuschnitt-danach .knopfreihe { justify-content: center; }
/* Handy: Vollbild auf Schwarz, oben „✕ Abbrechen“, unten Darstellung, Drehen · Ganzes Foto, Übernehmen */
@media (max-width: 639px) {
  .zuschnitt-overlay { padding: 0; }
  .zuschnitt-karte {
    max-width: none; width: 100%; height: 100%; max-height: none; border-radius: 0; padding: 0; gap: 0;
    background: #000000; color: #ffffff; overflow: hidden;
  }
  .zuschnitt-oben { justify-content: space-between; min-height: 52px; padding: 6px 8px 6px 4px; }
  .zuschnitt-oben h2 { color: #ffffff; font-size: 1rem; }
  .zuschnitt-oben .zuschnitt-abbrechen-oben {
    display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .95rem; background: none; border: none;
    color: #ffffff; min-height: 44px; padding: 0 12px; cursor: pointer;
  }
  .zuschnitt-abbrechen-oben svg { width: 18px; height: 18px; }
  .zuschnitt-oben .platz { display: block; width: 84px; }
  .zuschnitt-schritt { flex: 1; gap: 0; }
  .zuschnitt-arbeit { display: contents; } /* Bild, Hinweis, Darstellung, Knöpfe in eine Spalte */
  .zuschnitt-bild { order: 1; flex: 1; border-radius: 0; background: #1b1b1b; min-height: 0; }
  .zuschnitt-hinweis { order: 2; margin: 0; padding: 8px 16px 0; text-align: center; font-size: .85rem; color: #ffffffcc; }
  .zuschnitt-seite { order: 3; padding: 10px 16px 0; }
  .zuschnitt-seite > .lbl { display: none; }
  .zuschnitt-knoepfe { order: 4; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 16px 16px; }
  .zuschnitt-knoepfe .rechts { display: contents; }
  .zuschnitt-knoepfe #zuschnittAbbrechen { display: none; }
  .zuschnitt-knoepfe #zuschnittUebernehmen { grid-column: 1 / -1; }
  .zuschnitt-karte .btn-sekundaer { background: #262626; color: #ffffff; border-color: #ffffff59; width: 100%; }
  .zuschnitt-karte .btn-primaer { width: 100%; box-shadow: 0 0 0 1px #ffffff80; }
  .darstellung-wahl button { background: #1f1f1f; color: #ffffffcc; border-color: #ffffff59; min-height: 56px; flex-direction: row; gap: 8px; font-size: .95rem; }
  .darstellung-wahl button[aria-pressed="true"] { border: 2px solid #ffffff; color: #ffffff; box-shadow: inset 0 -3px 0 #e30613; }
  .zuschnitt-klein { color: #ffffffb3; }
  .zuschnitt-danach { flex: 1; justify-content: center; padding: 16px; }
  .danach-vorschau { background: #1b1b1b; border: none; }
  .zuschnitt-danach .knopfreihe { width: 100%; }
}
#vorschauRahmen { width: 100%; height: 65vh; border: 1px solid var(--rahmen); border-radius: 6px; background: #fff; }
.overlay-dunkel { background: rgba(0,0,0,.88); flex-direction: column; }
.overlay-dunkel img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; background: #fff; }
.grossansicht-schliessen, .grossansicht-nav {
  position: absolute; background: rgba(0,0,0,.5); color: #fff; border: 1px solid rgba(255,255,255,.4);
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; cursor: pointer;
}
.grossansicht-schliessen { top: 16px; right: 16px; }
.grossansicht-nav.zurueck { left: 16px; top: 50%; }
.grossansicht-nav.vor { right: 16px; top: 50%; }
.grossansicht-seite { color: #fff; margin: .6rem 0 0; }
.grossansicht-reihenfolge { display: flex; gap: .6rem; margin-top: .6rem; }

@media print {
  .summenleiste, .schritt-anzeige, .knopfreihe, .lokal-loeschen, .ausfuellhinweise, #formular { display: none !important; }
  body { padding-bottom: 0; }
}

/* --- Statusseite -------------------------------------------------------------- */
.klein-oben { margin: 0 0 2px; color: var(--text-gedaempft); font-size: .85rem; }
.status-kopf { margin-bottom: 1rem; }
.status-titel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-titel h1 { margin: 0; font-size: 1.4rem; }
.angaben-kurz { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 1rem; }
.angaben-kurz dt { font-weight: 700; color: var(--text-stark); }
.angaben-kurz dd { margin: 0; }
/* Aufruf-Kasten bei offener Rückfrage (Warnbox mit Hauptknopf) */
.box.aufruf { display: flex; align-items: center; gap: 12px; }
.box.aufruf::before { top: 50%; margin-top: -10px; }
.aufruf-text { flex: 1; min-width: 0; margin: 0; }
.box.aufruf .btn-primaer { flex: none; color: var(--akzent-text-auf); font-weight: 700; }
@media (max-width: 640px) {
  .box.aufruf { flex-wrap: wrap; align-items: flex-start; }
  .box.aufruf::before { top: 13px; margin-top: 0; }
  .box.aufruf .btn-primaer { flex: 1 1 100%; }
  .nur-breit { display: none; }
}
.begruendung { white-space: pre-wrap; }
/* Zeitleiste (Entscheidung 10): Punkt 14 px mittig auf der 2-px-Linie. grün = erledigt, gelb = wartet
   auf dich, blau = deine Antwort, rot = abgelehnt, Ring = kommt noch. */
.verlauf-titel { font-size: 1rem; margin: 1.25rem 0 .75rem; }
.zeitleiste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.zeitleiste li { position: relative; padding-left: 32px; font-size: .95rem; color: var(--text); }
.zeitleiste li::before {
  content: ""; position: absolute; left: 5px; top: 2px; width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%;
  background: var(--flaeche); border: 2px solid var(--rahmen-stark); z-index: 1;
}
.zeitleiste li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 9px; bottom: -27px; width: 2px; background: var(--rahmen-stark); }
.zeitleiste li.fertig::before { background: var(--erfolg-rand); border-color: var(--erfolg-rand); }
.zeitleiste li.jetzt::before { background: var(--warn-rand); border-color: var(--warn-rand); }
.zeitleiste li.du::before { background: var(--hinweis-rand); border-color: var(--hinweis-rand); }
.zeitleiste li.abgelehnt::before { background: var(--akzent); border-color: var(--akzent); }
.zeitleiste li.kommt { color: var(--text-gedaempft); }
.zeitleiste time, .zeitleiste .ohne-zeit { display: block; font-size: .8rem; color: var(--text-gedaempft); line-height: 18px; min-height: 18px; }
.zeitleiste strong { color: var(--text-stark); }
.zeitleiste li.kommt strong { color: var(--text-gedaempft); }
.zitat { margin: 6px 0 0; padding: 10px 12px; background: var(--flaeche-erhoben); border: 1px solid var(--rahmen); border-radius: 8px; color: var(--text); white-space: pre-wrap; max-width: 46rem; }
.zitat .von { display: block; font-size: .8rem; color: var(--text-gedaempft); margin-bottom: 2px; white-space: normal; }
.anhang { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .88rem; color: var(--text); }
.anhang svg { width: 16px; height: 16px; flex: none; }
textarea {
  font: inherit; color: var(--text-stark); background: var(--flaeche-eingabe);
  border: 1px solid var(--rahmen-stark); border-radius: 4px; padding: .5rem .6rem; width: 100%; resize: vertical;
}
.hinweis-text { color: var(--text-gedaempft); font-size: .88rem; }

/* --- Hilfe-Seite ---------------------------------------------------------------- */
.hilfe .einleitung { font-size: 1.1rem; }
.hilfe-inhalt { background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 8px; padding: .75rem 1.25rem; margin-bottom: 1.5rem; }
.hilfe-inhalt ol { margin: 0; padding-left: 1.2rem; columns: 2 16rem; }
.hilfe-abschnitt {
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: start;
  background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: 8px; padding: 1.25rem; margin-bottom: 1.25rem;
}
.hilfe-abschnitt.einspaltig { display: block; }
.hilfe-abschnitt h2 { margin-top: 0; }
.hilfe-abschnitt li { margin-bottom: .35rem; }
.hilfe-abschnitt img { width: 260px; height: auto; border: 1px solid var(--rahmen); border-radius: 8px; box-shadow: var(--schatten); background: #fff; }
.hilfe-abschnitt .bilder { display: flex; flex-direction: column; gap: 1rem; }
@media (max-width: 760px) {
  .hilfe-abschnitt { grid-template-columns: 1fr; }
  .hilfe-abschnitt img { width: min(300px, 100%); }
  .hilfe-abschnitt .bilder { flex-direction: row; overflow-x: auto; }
}
