/*
 * Komponenten (UI-KONZEPT 4.3). Klassennamen nach dem Muster block__element--variante, deutsch.
 * Nur Tokens aus tokens.css. Jede Komponente ist im Styleguide /system/komponenten/ zu sehen.
 */

/* ================================================================ Getönte Flächen */

/* Nebentext (--ink-muted) erreicht auf getönten Flächen keine 4,5:1; dort gilt der dunklere Ton (tokens.css). */
.segment, .datenstand, .nav__zaehler--dezent, .karte--warnung, .karte--fehler, .karte--info, .karte--erfolg,
.hinweis--info, .hinweis--erfolg, .hinweis--warnung, .hinweis--fehler, .toast--fehler, .badge,
.arbeitskarte--fehler, .fehleruebersicht, .chip,
.tabelle tbody tr:hover td, .tabelle .tabelle__gruppe, .jobkarte--unterbrochen, .jobkarte:has(> .jobkarte__stand--unterbrochen),
.mehrfach__option:hover, .treffer__link:hover, .treffer__link:focus-visible {
  --ink-muted: var(--ink-muted-on-tint);
}

/* ================================================================ Seitenkopf (PageHeader) */

.seitenkopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.seitenkopf__text { min-width: 0; }
.seitenkopf__titel:focus { outline: none; }
/* Eine Zeile unter dem Titel (Anzahl, Zeitraum), wie bei FES friends in normaler Größe, gedämpft */
.seitenkopf__untertitel { margin: var(--space-1) 0 0; color: var(--ink-muted); font-size: var(--fs-base); }
.seitenkopf__aktionen { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
/* Hilfe als rundes Symbol neben den Aktionen (seit 08.11.2026); die Hilfe der Kopfzeile tritt dann zurück (base.css) */
.seitenkopf__hilfe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ziel-min);
  height: var(--ziel-min);
  border-radius: 50%;
  color: var(--ink-muted);
  text-decoration: none;
}
.seitenkopf__hilfe:hover { background: var(--surface-2); color: var(--ink); }

/* ================================================================ Brotkrumen */

.brotkrumen__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.brotkrumen__glied { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 600; }
.brotkrumen__glied + .brotkrumen__glied::before { content: "›"; margin: 0 var(--space-2); color: var(--ink-muted); }
.brotkrumen__glied a { color: var(--ink-muted); text-decoration: none; }
.brotkrumen__glied a:hover { color: var(--ink); text-decoration: underline; }
.brotkrumen__glied [aria-current] { color: var(--ink); font-weight: 700; }

/* ================================================================ Karte (Card) */

.karte {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-5) var(--space-5);
  min-width: 0;
}
.karte__kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.karte__titel { font-size: var(--fs-lg); font-weight: 700; }
.karte__aktion { font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
.karte--warnung { background: var(--warning-soft); border-color: var(--warning); }
.karte--fehler { background: var(--critical-soft); border-color: var(--critical); }
.karte--info { background: var(--accent-soft); }
.karte--erfolg { background: var(--success-soft); }

/* ================================================================ Steckbrief (KeyValue) und Schloss (LockHint) */

.kv { margin: 0; display: grid; gap: var(--space-2); }
.kv__zeile { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: var(--space-3); align-items: baseline; }
.kv__label { color: var(--ink-muted); font-size: var(--fs-sm); font-weight: 600; hyphens: auto; overflow-wrap: break-word; }
.kv__wert { margin: 0; overflow-wrap: anywhere; }
.kv__leer { color: var(--ink-muted); }

.schloss { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--ink-muted); font-size: var(--fs-xs); }
.schloss .icon { width: 13px; height: 13px; }
.schloss a .icon { width: 12px; height: 12px; margin-left: 2px; }

/* ================================================================ Datenstand (DataFreshness) */

.datenstand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 30px;
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.datenstand .icon { width: 14px; height: 14px; color: var(--ink-muted); }
/* In einer Schlüssel-Wert-Liste darf er umbrechen, sonst schiebt er bei 375 px die Seite breiter (Seite der Kampagne) */
.kv__wert .datenstand { white-space: normal; }
.datenstand__hinweis { color: var(--ink-muted); font-weight: 500; }
.datenstand--warnung { background: var(--warning-soft); color: var(--warning-ink); }
.datenstand--warnung .icon, .datenstand--warnung .datenstand__hinweis { color: var(--warning-ink); }
.datenstand--fehler { background: var(--critical-soft); color: var(--critical-ink); }
.datenstand--fehler .icon, .datenstand--fehler .datenstand__hinweis { color: var(--critical-ink); }
a.datenstand:hover { text-decoration: underline; }

/* ================================================================ Badge / StatusChip */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink);
}
.badge .icon { width: 13px; height: 13px; }
.badge--info { background: var(--accent-soft); color: var(--accent-2); }
.badge--erfolg { background: var(--success-soft); color: var(--success); }
.badge--warnung { background: var(--warning-soft); color: var(--warning-ink); }
.badge--fehler { background: var(--critical-soft); color: var(--critical-ink); }

/* ================================================================ Objektverweis (ObjectLink) */

.objektlink { display: inline-flex; align-items: baseline; gap: var(--space-1); font-weight: 600; text-decoration: none; min-width: 0; }
a.objektlink:hover .objektlink__name { text-decoration: underline; }
.objektlink__icon { align-self: center; }
.objektlink__id { color: var(--ink-muted); font-weight: 500; font-size: var(--fs-xs); }
.objektlink--traeger .objektlink__icon { color: var(--typ-traeger); }
.objektlink--einrichtung .objektlink__icon { color: var(--typ-einrichtung); }
.objektlink--person .objektlink__icon { color: var(--typ-person); }
.objektlink--veranstaltung .objektlink__icon { color: var(--typ-veranstaltung); }

/* ================================================================ Tabs */

.tabs { border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.tabs__liste { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-1); }
.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ziel-touch);
  padding: 0 var(--space-4);
  border-bottom: 3px solid transparent;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  white-space: nowrap;
}
.tabs__tab:hover { color: var(--ink); background: var(--surface-2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tabs__tab[aria-current="page"] { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.tabs__zaehler { padding: 0 7px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink); font-size: 11.5px; }

/* Startseite „Heute“: Zeilen unter „Als Nächstes“ */
.heute-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.heute-liste__zeile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.heute-liste__zeile:last-child { border-bottom: 0; }
.heute-liste__text { flex: 1 1 14rem; min-width: 0; }
.heute-liste__zahl { font-variant-numeric: tabular-nums; }
.heute-ruhe { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--success); font-weight: 600; }

/* ================================================================ Tabelle (DataTable) */

.tabelle-rahmen {
  container: tabelle / inline-size;
  /* Bezugsrahmen für absolut positionierte Kinder (``.sr-only`` in Zellen): Sonst ragen sie beim waagrechten Scrollen
     der Tabelle aus der Seite und die ganze Seite scrollt mit (Rücklauf bei etwa 800 px) */
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.tabelle { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabelle caption { text-align: left; padding: var(--space-3) var(--space-4); font-weight: 700; caption-side: top; }
.tabelle caption.sr-only { padding: 0; }
.tabelle th, .tabelle td {
  text-align: left;
  padding: 0 var(--space-4);
  height: var(--row-h);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: var(--fs-sm);
}
.tabelle td { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.tabelle thead th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 2;
  /* Kopf als helles Band über den Zeilen (wie FES friends) */
  background: var(--surface-2);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
}
.tabelle thead th:first-child { border-top-left-radius: var(--radius-lg); }
.tabelle thead th:last-child { border-top-right-radius: var(--radius-lg); }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle tbody tr:hover td { background: var(--surface-2); }
.tabelle tbody tr[data-zeilenlink] { cursor: pointer; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle__auswahl { width: 44px; }
/* Mehrere Knöpfe in einer Zeile (Zuordnen, Interessent …) und die Sammelaktion über einer Tabelle */
.zeilenaktionen { display: flex; flex-wrap: wrap; gap: var(--space-1); justify-content: flex-end; }
.sammelaktion { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; margin-bottom: var(--space-3); }
.tabelle__neben { display: block; color: var(--ink-muted); font-size: var(--fs-xs); }
.tabelle__leer td { height: auto; padding: var(--space-6); }
/* Zellen nur in einer Darstellung: Knöpfe „Anrufen“/„E-Mail“ gibt es nur im Kartenmodus (UI-KONZEPT 7),
   die ausgeschriebenen Adressen nur in der Tabelle */
.tabelle .tabelle__nur-karten { display: none; }
.kontaktknoepfe { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.telefonnummer { white-space: nowrap; }
/* Breite Listen schrumpfen statt aus dem Rahmen zu ragen: Köpfe dürfen umbrechen, E-Mail-Adressen auch ohne
   Bindestrich (UI-KONZEPT 6: breite Tabellen scrollen nur im eigenen Container, nie die Seite) */
.tabelle td a[href^="mailto:"] { overflow-wrap: anywhere; }
.tabelle__zeilen { display: flex; flex-direction: column; gap: 2px; }
/* Auswertungen (Summen- und Saldenliste, GuV, Bilanz, Altersliste, Liquiditätsvorschau): Gruppen-, Rubrik- und
   Summenzeilen, eingerückte Konten, Auswahl in einer Reihe. Der Druck blendet die Auswahl aus (base.css). */
.auswertung-filter { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4); }
.auswertung-filter .feld { min-width: 11rem; }
/* Der Knopf steht in derselben Reihe, auf Höhe der Eingaben (unter der Beschriftung), wie bei FES friends „Einzug“ */
.auswertung-filter__knopf { padding-top: calc(var(--fs-sm) * 1.5 + var(--space-1)); }
/* Eine Auswahl hat immer einen Wert: Sterne wären hier nur Lärm (Bildschirmleser hören „erforderlich“ am Feld) */
.auswertung-filter .feld__pflicht { display: none; }
/* Auswahl der Auswertungen (GuV, Kontenblatt): je Thema eine Zeile, Titel links, Bedienung rechts daneben; Zeitraum
   aus vier Auswahlen in einer Reihe, Schnellwahl als Chips, Segmente aus Radioknöpfen, Filter als Mehrfachauswahl */
.auswahl { display: flex; flex-direction: column; gap: var(--space-3); }
.auswahl__zeile { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--space-2) var(--space-4); align-items: center; }
.auswahl__titel { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-muted); }
.auswahl__inhalt { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); min-width: 0; }
.auswahl__zeitraum { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.auswahl__zeitraum select {
  min-height: 40px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface);
}
.auswahl__bis { font-size: var(--fs-sm); color: var(--ink-muted); }
.auswahl__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.auswahl__chips .chip { background: var(--surface); color: var(--ink); border: 1px solid var(--border); padding: 0 var(--space-3); }
.auswahl__chips .chip:hover { border-color: var(--control-border); }
.auswahl__chips .chip--aktiv { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-soft); }
.auswahl .segment__option { cursor: pointer; }
.segment__option:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segment__option:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.auswahl__haken { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.auswahl__haken input { width: 18px; height: 18px; accent-color: var(--accent-2); }
.auswahl__fehler { flex-basis: 100%; margin: 0; }
.auswahl__knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
@media (max-width: 640px) { .auswahl__zeile { grid-template-columns: minmax(0, 1fr); } }
.marke-datev {
  display: inline-block; padding: 0 var(--space-2); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-muted-on-tint); font-size: var(--fs-xs); font-weight: 600;
}
.tabelle tbody th.tabelle__titel, .tabelle tfoot th { text-align: left; font-weight: 400; }
.tabelle .tabelle__gruppe th, .tabelle .tabelle__gruppe td { background: var(--surface-2); font-weight: 700; }
.tabelle .tabelle__rubrik th, .tabelle .tabelle__rubrik td { font-weight: 600; }
.tabelle .tabelle__summe th, .tabelle .tabelle__summe td { font-weight: 700; border-top: 2px solid var(--ink-muted); }
.tabelle td.tabelle__einzug, .tabelle th.tabelle__einzug { padding-left: var(--space-8); }
.nur-druck { display: none; }

/* Kompakte Zeilen nur auf großen Bildschirmen mit Maus, nie auf Touch-Geräten (UI-KONZEPT 4.1) */
@media (min-width: 1280px) and (pointer: fine) {
  .tabelle--kompakt th, .tabelle--kompakt td { height: var(--row-h-compact); }
}

.sortierlink { display: inline-flex; align-items: center; gap: var(--space-1); color: inherit; text-decoration: none; min-height: var(--ziel-min); }
.sortierlink:hover { color: var(--ink); }
.sortierlink .icon { width: 13px; height: 13px; }
.sortierlink__neutral { opacity: .45; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--ink); }

/* Unter 1280 px scrollt der Rahmen selbst (dann ohne mitlaufenden Kopf, der braucht das Fenster als Scrollbereich);
   darüber passt die schrumpfbare Tabelle in den Inhalt (Laptop mit 1280 px und Zoom liegt darunter) */
@media (max-width: 1279px) {
  .tabelle-rahmen { overflow-x: auto; }
  .tabelle thead th { position: static; }
}

/* Kartenmodus unter 640 px Containerbreite: Zeilen werden Karten, Beschriftung aus data-label */
@container tabelle (max-width: 640px) {
  .tabelle--karten thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .tabelle--karten, .tabelle--karten tbody, .tabelle--karten tr, .tabelle--karten td { display: block; width: 100%; }
  .tabelle--karten tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .tabelle--karten tbody tr:last-child { border-bottom: 0; }
  /* Beschriftung links, der Zellinhalt rechts als eine Spalte: Text und Kinder stehen untereinander (Nebentext in
     eigener Zeile), statt als schmale Spalten nebeneinander mitten im Wort umzubrechen */
  .tabelle--karten td {
    height: auto; border: 0; padding: 2px 0;
    display: grid; grid-template-columns: 38% minmax(0, 1fr); column-gap: var(--space-3); align-items: start;
    overflow-wrap: break-word;
  }
  .tabelle--karten td > * { grid-column: 2; min-width: 0; }
  /* Lange E-Mail-Adressen ohne Bindestrich brechen um, statt aus der Karte zu ragen (WCAG 1.4.10) */
  .tabelle--karten td a { overflow-wrap: anywhere; }
  .tabelle--karten td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 9; color: var(--ink-muted); font-weight: 600; font-size: var(--fs-xs); }
  .tabelle--karten td[data-label=""], .tabelle--karten td:not([data-label]) { display: block; }
  .tabelle--karten td[data-label=""]::before, .tabelle--karten td:not([data-label])::before { content: none; }
  .tabelle--karten td.tabelle__haupt { font-size: var(--fs-base); font-weight: 600; padding-bottom: var(--space-1); }
  .tabelle--karten td.tabelle__haupt > .tabelle__neben { font-weight: 400; }
  .tabelle--karten .objektlink__id { white-space: nowrap; }
  .tabelle--karten td.zahl { text-align: left; }
  .tabelle--karten tbody tr:hover td { background: none; }
  .tabelle--karten .tabelle__nur-karten, .tabelle--karten td.tabelle__nur-karten { display: block; padding: var(--space-2) 0 var(--space-1); }
  .tabelle--karten td.tabelle__nur-tabelle { display: none; }
  .tabelle--karten .kontaktknoepfe .knopf { min-height: var(--ziel-touch); }
}

/* ================================================================ Filterleiste (FilterBar), Suchfeld, Mehrfachauswahl */

.ergebnis[aria-busy="true"], .htmx-request.ergebnis { opacity: .55; transition: opacity var(--dauer) ease; }
.ergebnis { display: flex; flex-direction: column; gap: var(--space-3); }
/* Zeile über der Tabelle: Trefferzahl links, Sortiermenü rechts (UI-KONZEPT 3.3) */
.ergebnis__kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.ergebnis__zahl { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-muted); }
.ergebnis__fuss { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); font-size: var(--fs-sm); }

/* Ansichten und Spalten-Sets nebeneinander; JobCard eines laufenden Syncs über einer Liste */
.ansichten-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.liste__lauf { max-width: 640px; }
/* Schlichte Liste von Objekten mit Badges (z. B. Einrichtungen im Überblick eines Trägers) */
.objektliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.objektliste > li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* Sortiermenü: dieselbe Gestalt wie die Mehrfachauswahl, rechtsbündig; im Kartenmodus fehlen die Spaltenköpfe */
.sortiermenue .mehrfach__panel { left: auto; right: 0; min-width: 240px; }
.sortiermenue__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
a.mehrfach__option { color: var(--ink); text-decoration: none; }
a.mehrfach__option[aria-current="true"] { font-weight: 700; color: var(--accent-2); }

.filterleiste { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.filterleiste__felder { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; flex: 1; }
/* Doppelte Klasse, damit .knopf (weiter unten) den Knopf am Desktop nicht wieder einblendet */
.filterleiste .filterleiste__oeffnen, .filterleiste__kopf-mobil { display: none; }
.filterleiste__titel-mobil { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); }

.suchfeld { position: relative; flex: 1 1 260px; max-width: 420px; }
.suchfeld__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.suchfeld__eingabe {
  width: 100%;
  min-height: 40px;
  padding: var(--space-2) var(--space-3) var(--space-2) 38px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mehrfach { position: relative; }
.mehrfach__knopf {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.mehrfach__knopf::-webkit-details-marker { display: none; }
.mehrfach[data-aktiv] .mehrfach__knopf { border-color: var(--accent-2); background: var(--accent-soft); color: var(--accent-2); }
.mehrfach__anzahl { padding: 0 7px; border-radius: var(--radius-pill); background: var(--accent-2); color: var(--on-accent); font-size: 11.5px; }
.mehrfach__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  max-height: 360px;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}
.mehrfach__suche {
  width: 100%;
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.mehrfach__optionen { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mehrfach__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.mehrfach__option:hover { background: var(--surface-2); }
.mehrfach__option input { width: 18px; height: 18px; accent-color: var(--accent-2); }

.filterchips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.filterchips__titel { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 600; }
.filterchips__liste { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; }
.filterchips__alle { font-size: var(--fs-sm); font-weight: 600; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 30px;
  padding: 0 var(--space-2) 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: none;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip .icon { width: 14px; height: 14px; }
.chip--unbekannt { background: var(--warning-soft); color: var(--warning-ink); }
.filterchips__hinweis { flex-basis: 100%; margin: 0; font-size: var(--fs-sm); color: var(--warning-ink); }

@media (max-width: 860px) {
  .filterleiste .filterleiste__oeffnen { display: inline-flex; }
  .filterleiste__felder { display: none; }
  .filterleiste--offen .filterleiste__felder {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 70;
    flex-direction: column;
    flex-wrap: nowrap; /* sonst bricht eine lange, aufgeklappte Auswahl in eine zweite Spalte um */
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-4);
    overflow-y: auto;
    background: var(--bg);
  }
  .filterleiste--offen .filterleiste__kopf-mobil { display: flex; justify-content: space-between; align-items: center; }
  .filterleiste--offen .suchfeld { max-width: none; flex: none; }
  .filterleiste--offen .filterleiste__feld select, .filterleiste--offen .filterleiste__feld input { flex: 1; }
  .filterleiste--offen .mehrfach__panel { position: static; box-shadow: none; max-height: none; }
}

/* ================================================================ Reiter einer Liste (ViewSwitch, ``ansichtswahl``)

   Seit 08.11.2026 wie bei FES friends: Links mit Unterstrich auf einer durchgehenden Linie, der aktive in der
   Akzentfarbe. Echte Links (jede Ansicht ist eine Adresse), kein ARIA-Tablist. */

.reiter { display: flex; flex-wrap: wrap; gap: 2px var(--space-1); border-bottom: 1px solid var(--border); }
.ansichten-leiste > .reiter { flex: 1 1 100%; }
.reiter__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--ziel-min);
  padding: 0 var(--space-3);
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
}
.reiter__link:hover { color: var(--ink); }
.reiter__link[aria-current="true"],
.reiter__link[aria-current="page"] { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* ================================================================ Segment (Umschalter mit wenigen Optionen) */

.segment {
  display: inline-flex;
  align-self: flex-start;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.segment__label { font-size: var(--fs-xs); color: var(--ink-muted); font-weight: 600; padding: 0 var(--space-2); }
.segment__option {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.segment__option:hover { color: var(--ink); }
.segment__option[aria-current="true"],
.segment__option[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ================================================================ Seiten (Pagination) */

.seiten { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.seiten__stand { margin: 0; color: var(--ink-muted); font-size: var(--fs-sm); }
.seiten__liste { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0; padding: 0; }
.seiten__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: 36px;
  min-height: 36px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
a.seiten__link:hover { background: var(--surface-2); }
.seiten__link--aktiv { background: var(--accent-2); color: var(--on-accent); }
.seiten__link--aus { color: var(--ink-muted); opacity: .6; }
.seiten__luecke { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink-muted); }

/* ================================================================ Knopf (Button) */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dauer) ease, border-color var(--dauer) ease, color var(--dauer) ease;
}
.knopf--klein { min-height: 32px; padding: 0 var(--space-3); font-size: var(--fs-xs); }
.knopf--primaer { background: var(--accent-2); color: var(--on-accent); }
.knopf--primaer:hover { background: var(--accent-2-hover); color: var(--on-accent); }
.knopf--sekundaer { background: var(--surface); color: var(--ink); border-color: var(--control-border); }
.knopf--sekundaer:hover { background: var(--surface-2); color: var(--ink); }
.knopf--ghost { background: transparent; color: var(--accent-2); }
.knopf--ghost:hover { background: var(--surface-2); color: var(--accent-2); }
.knopf--gefahr { background: var(--critical-ink); color: var(--on-critical); }
.knopf--gefahr:hover { background: var(--critical-hover); color: var(--on-critical); }
.knopf:disabled, .knopf[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.knopf[aria-busy="true"] { cursor: progress; }
.knopf-gruppe { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.kontakt-kopieren { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ohne-js .kontakt-kopieren { display: none; }  /* ohne Skript täte der Knopf nichts */
.kontakt-kopieren__status { font-size: var(--fs-xs); color: var(--ink-muted); }
.kontakt-kopieren__status--fehler { color: var(--ink); }
.knopf__grund { font-size: var(--fs-xs); color: var(--ink-muted); max-width: 32ch; white-space: normal; }

/* Touch-Ziele 44 px (UI-KONZEPT 4.1, 7): auf Touch-Geräten und unter 640 px */
@media (pointer: coarse), (max-width: 640px) {
  .knopf, .knopf--klein, .chip, .segment__option, .seiten__link, .seiten__luecke, .mehrfach__option,
  .mehrfach__knopf, .nutzermenu__gruppe label, .nutzermenu__option, .sortierlink, .tabs__tab {
    min-height: var(--ziel-touch);
  }
  .seiten__link { min-width: var(--ziel-touch); }
  .toast__schliessen { width: var(--ziel-touch); height: var(--ziel-touch); }
  .knopf--icon { min-width: var(--ziel-touch); }
  .chip { padding-left: var(--space-4); }
}

/* ================================================================ Dialog (ConfirmDialog) */

.dialog {
  width: min(520px, calc(100vw - 2 * var(--space-4)));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-dialog);
}
.dialog::backdrop { background: var(--overlay); }
.dialog__form { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.dialog__titel { font-size: var(--fs-h3); }
.dialog__aktionen { display: flex; justify-content: flex-end; gap: var(--space-2); flex-wrap: wrap; }

/* ================================================================ Formular, Feld, Fehlerübersicht */

.formular { display: flex; flex-direction: column; gap: var(--space-4); max-width: 640px; }
.feld { display: flex; flex-direction: column; gap: var(--space-1); }
.feld__label { font-size: var(--fs-sm); font-weight: 600; }
/* Pflichtfeld: Stern am Label (seit 08.11.2026 statt des Worts „Pflicht“), für Bildschirmleser „(Pflichtfeld)“ */
.feld__pflicht { margin-left: 2px; font-weight: 700; color: var(--critical-ink); }
.feld__hilfe { margin: 0; font-size: var(--fs-xs); color: var(--ink-muted); }
.feld__fehler { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--critical-ink); }
.feld input:not([type="checkbox"]):not([type="radio"]),
.feld select,
.feld textarea {
  width: 100%;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.feld textarea { min-height: 96px; resize: vertical; }
.feld [aria-invalid="true"] { border-color: var(--feld-fehler-rand); box-shadow: 0 0 0 1px var(--feld-fehler-rand); }
/* Geändert gegenüber dem bisherigen Wert (gelb) bzw. fehlerhaft (rot, geht vor); der Text sagt es zusätzlich.
   Nur die eigenen Elemente (>): Ein Feld kann weitere Felder enthalten (Auswahl mit Adressen darunter) */
.feld--geaendert > input:not([type="checkbox"]):not([type="radio"]),
.feld--geaendert > select,
.feld--geaendert > textarea { background: var(--feld-geaendert-flaeche); border-color: var(--feld-geaendert-rand); }
.feld--geaendert > .feld__gruppe { padding-left: var(--space-3); border-left: 3px solid var(--feld-geaendert-rand); }
.feld--fehler > input:not([type="checkbox"]):not([type="radio"]),
.feld--fehler > select,
.feld--fehler > textarea { background: var(--feld-fehler-flaeche); border-color: var(--feld-fehler-rand); }
.feld--fehler > .feld__gruppe { padding-left: var(--space-3); border-left: 3px solid var(--feld-fehler-rand); }
.feld__bisher { margin: 0; font-size: var(--fs-xs); color: var(--ink-muted); overflow-wrap: anywhere; }
.feld--geaendert > .feld__bisher { color: var(--feld-geaendert-text); }
.feld__marke {
  display: inline-block;
  padding: 0 var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--feld-geaendert-flaeche);
  color: var(--feld-geaendert-text);
  font-weight: 600;
}
.feld--checkbox { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.feld--checkbox .feld__hilfe, .feld--checkbox .feld__fehler, .feld--checkbox .feld__bisher { flex-basis: 100%; }
.feld input[type="checkbox"], .feld input[type="radio"] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent-2); }
.feld__gruppe { border: 0; margin: 0; padding: 0; }
.feld__gruppe > div { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-2); }
.feld__gruppe label { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; font-size: var(--fs-sm); }

.fehleruebersicht {
  padding: var(--space-4) var(--space-5);
  border: 2px solid var(--critical-ink);
  border-radius: var(--radius-md);
  background: var(--critical-soft);
}
.fehleruebersicht:focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.fehleruebersicht__titel { font-size: var(--fs-lg); color: var(--critical-ink); margin-bottom: var(--space-2); }
.fehleruebersicht__liste { margin: 0; padding-left: var(--space-5); }
.fehleruebersicht__liste a { color: var(--critical-ink); font-weight: 600; }

/* ================================================================ Hinweis (Alert) */

.hinweis {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface);
}
.hinweis__icon { width: 20px; height: 20px; margin-top: 2px; }
.hinweis__text { min-width: 0; flex: 1; }
.hinweis__titel { font-weight: 700; margin-bottom: var(--space-1); }
.hinweis__details { margin-top: var(--space-2); font-size: var(--fs-sm); }
.hinweis__details summary { cursor: pointer; color: var(--ink-muted); font-weight: 600; }
.hinweis--info { border-left-color: var(--accent-2); background: var(--accent-soft); }
.hinweis--info .hinweis__icon { color: var(--accent-2); }
.hinweis--erfolg { border-left-color: var(--success); background: var(--success-soft); }
.hinweis--erfolg .hinweis__icon { color: var(--success); }
.hinweis--warnung { border-left-color: var(--warning); background: var(--warning-soft); }
.hinweis--warnung .hinweis__icon, .hinweis--warnung .hinweis__titel { color: var(--warning-ink); }
.hinweis--fehler { border-left-color: var(--critical-ink); background: var(--critical-soft); }
.hinweis--fehler .hinweis__icon, .hinweis--fehler .hinweis__titel { color: var(--critical-ink); }

/* ================================================================ Toast */

.toasts {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(420px, calc(100vw - 2 * var(--space-4)));
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.toast__text { margin: 0; flex: 1; font-size: var(--fs-sm); font-weight: 600; }
.toast__form { margin: 0; }
.toast__schliessen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}
.toast__schliessen:hover { background: var(--surface-2); color: var(--ink); }
.toast--erfolg { border-left-color: var(--success); }
.toast--info, .toast--neutral { border-left-color: var(--accent-2); }
.toast--warnung { border-left-color: var(--warning); }
.toast--fehler { border-left-color: var(--critical-ink); background: var(--critical-soft); }
.toasts--statisch { position: static; width: auto; }

@media (max-width: 640px) {
  .toasts { right: var(--space-4); left: var(--space-4); bottom: var(--space-4); width: auto; }
}

/* Hinweis zur Datenqualität an einer Detailseite: Satz, darunter die Aktionen (UI-KONZEPT 3.4) */
.hinweiszeile { display: flex; flex-direction: column; gap: var(--space-1); }
.hinweiszeile + .hinweiszeile { padding-top: var(--space-3); border-top: 1px solid var(--warning); }
.hinweiszeile__aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.hinweiszeile__link { font-size: var(--fs-sm); font-weight: 600; }

/* ================================================================ Leerzustand und Skelett */

.leerzustand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-5);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.leerzustand__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-2);
}
.leerzustand__icon .icon { width: 22px; height: 22px; }
.leerzustand__titel { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); margin: 0; }
.leerzustand__text { color: var(--ink-muted); max-width: 52ch; margin: 0 0 var(--space-2); }

@keyframes skelett-einblenden { to { opacity: 1; } }
@keyframes skelett-puls { 50% { opacity: .55; } }
.skelett {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  opacity: 0;
  animation: skelett-einblenden 1ms linear var(--skelett-verzoegerung) forwards;
}
.skelett__zeile {
  display: block;
  height: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  animation: skelett-puls 1.4s ease-in-out infinite;
}
.skelett__zeile:nth-child(3n) { width: 72%; }
.skelett__zeile:nth-child(3n + 1) { width: 92%; }
@media (prefers-reduced-motion: reduce) {
  .skelett { opacity: 1; }
}

/* ================================================================ Zeitleiste (Timeline) */

.zeitleiste { display: flex; flex-direction: column; gap: var(--space-4); }
.zeitleiste__datum { font-size: var(--fs-sm); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--space-2); }
.zeitleiste__liste { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.zeitleiste__eintrag { position: relative; display: flex; gap: var(--space-3); padding: var(--space-1) 0 var(--space-2) var(--space-4); }
.zeitleiste__eintrag::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.zeitleiste__zeit { flex: none; width: 3.2em; color: var(--ink-muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.zeitleiste__text { font-size: var(--fs-sm); min-width: 0; }
.zeitleiste__akteur { font-weight: 600; }
.zeitleiste__leer { color: var(--ink-muted); }

/* ================================================================ Arbeitsvorrat (WorkCard, Stufen) */

.stufe { display: flex; flex-direction: column; gap: var(--space-3); }
.stufe__titel { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.stufe__anzahl { font-weight: 500; text-transform: none; letter-spacing: 0; }
.stufe__karten, .stapel { display: flex; flex-direction: column; gap: var(--space-2); }
.stufe__weitere > summary, .stufe__aufklappen > summary { cursor: pointer; font-weight: 600; color: var(--accent-2); min-height: var(--ziel-min); }
.stufe__aufklappen[open] > summary { margin-bottom: var(--space-3); }
.stufe__mehr { color: var(--ink-muted); font-size: var(--fs-sm); margin-top: var(--space-2); }
/* Seitenspalte des Arbeitsvorrats: Beiträge der Module („Läuft gerade“, „Zuletzt erledigt“), je eine Karte */
.arbeitsvorrat__neben { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); align-items: start; }
.arbeitsvorrat__ruhe { display: flex; align-items: center; gap: var(--space-2); color: var(--success); font-weight: 600; }

.arbeitskarte {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}
.arbeitskarte--erledigen { border-left-color: var(--critical-ink); }
.arbeitskarte--wartet { border-left-color: var(--accent-2); }
.arbeitskarte--im_blick { box-shadow: none; }
.arbeitskarte--fehler { border-left-color: var(--warning); background: var(--warning-soft); }
.arbeitskarte__satz { margin: 0; font-weight: 600; }
.arbeitskarte__zusatz { margin: var(--space-1) 0 0; font-size: var(--fs-sm); color: var(--ink-muted); display: flex; align-items: center; gap: var(--space-1); }
@media (max-width: 640px) {
  .arbeitskarte { grid-template-columns: 1fr; gap: var(--space-2); }
  .arbeitskarte__aktion { justify-self: start; }
}

/* ================================================================ Hintergrundlauf (JobCard) */

/* Der Stand (.jobkarte__stand) wird alle 2 s ersetzt; mit display: contents stehen seine Teile im Raster der
   Karte: Badge rechts neben dem Titel, alles Übrige darunter über die volle Breite. */
.jobkarte {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.jobkarte--kompakt { padding: var(--space-2) var(--space-3); gap: var(--space-1) var(--space-3); }
.jobkarte__kopf { grid-column: 1; grid-row: 1; min-width: 0; }
.jobkarte__stand { display: contents; }
.jobkarte__stand > .badge { grid-column: 2; grid-row: 1; justify-self: end; }
.jobkarte__stand > :not(.badge) { grid-column: 1 / -1; }
.abfrage-hinweis { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--warning-ink); }
.jobkarte__titel { font-weight: 700; text-decoration: none; }
a.jobkarte__titel:hover { text-decoration: underline; }
.jobkarte__fortschritt { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.jobkarte__zahl { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.jobkarte__phase, .jobkarte__meldung { margin: 0; font-size: var(--fs-sm); color: var(--ink-muted); }
.jobkarte__fehler { margin: 0; font-size: var(--fs-sm); color: var(--warning-ink); font-weight: 600; display: flex; align-items: center; gap: var(--space-1); }
.jobkarte--unterbrochen, .jobkarte:has(> .jobkarte__stand--unterbrochen) { border-color: var(--warning); background: var(--warning-soft); }
.jobkarte--fehlgeschlagen, .jobkarte:has(> .jobkarte__stand--fehlgeschlagen) { border-color: var(--critical); }

.fortschritt {
  flex: 1 1 200px;
  height: 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
  appearance: none;
}
.fortschritt::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--radius-pill); }
.fortschritt::-webkit-progress-value { background: var(--accent-2); border-radius: var(--radius-pill); }
.fortschritt::-moz-progress-bar { background: var(--accent-2); border-radius: var(--radius-pill); }
/* Läuft, aber die Gesamtzahl steht noch nicht fest: wandernder Abschnitt (ohne Bewegung bei reduced-motion) */
.fortschritt:indeterminate {
  background: linear-gradient(90deg, var(--surface-2) 0 35%, var(--accent-2) 35% 55%, var(--surface-2) 55% 100%);
  background-size: 200% 100%;
  animation: fortschritt-unbestimmt 1.4s linear infinite;
}
.fortschritt:indeterminate::-webkit-progress-bar { background: transparent; }
.fortschritt:indeterminate::-moz-progress-bar { background: transparent; }
@keyframes fortschritt-unbestimmt { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ================================================================ Topbar: Suche und Nutzermenü */

.topsuche { position: relative; flex: 1 1 340px; max-width: 520px; }
.topsuche__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); pointer-events: none; }
.topsuche__eingabe {
  width: 100%;
  min-height: 40px;
  padding: var(--space-2) 72px var(--space-2) 38px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--bg);
}
.topsuche__kuerzel {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 11px;
  pointer-events: none;
}
.topsuche__liste {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}
.topsuche__gruppe + .topsuche__gruppe { margin-top: var(--space-2); }
.topsuche__gruppentitel { margin: var(--space-1) var(--space-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.topsuche__leer, .topsuche__fehler { margin: var(--space-2); color: var(--ink-muted); font-size: var(--fs-sm); }
.topsuche__alle { display: block; margin-top: var(--space-2); padding: var(--space-2); border-top: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; }

.trefferliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.treffer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; border-radius: var(--radius-sm); }
.treffer__link { display: flex; align-items: center; gap: var(--space-3); flex: 1 1 240px; min-width: 0; padding: var(--space-2); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.treffer__link:hover, .treffer__link:focus-visible { background: var(--surface-2); }
.treffer__icon { width: 18px; height: 18px; color: var(--ink-muted); }
.treffer--traeger .treffer__icon { color: var(--typ-traeger); }
.treffer--einrichtung .treffer__icon { color: var(--typ-einrichtung); }
.treffer--person .treffer__icon { color: var(--typ-person); }
.treffer--veranstaltung .treffer__icon { color: var(--typ-veranstaltung); }
.treffer__text { display: flex; flex-direction: column; min-width: 0; }
.treffer__titel { font-weight: 600; }
.treffer__unter { font-size: var(--fs-xs); color: var(--ink-muted); }
.treffer__aktionen { display: flex; gap: var(--space-2); padding-right: var(--space-2); }

.suchseite__form { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.suchergebnis { display: flex; flex-direction: column; gap: var(--space-5); }
.suchergebnis__anzahl { color: var(--ink-muted); font-weight: 600; margin: 0; }
.suchgruppe { display: flex; flex-direction: column; gap: var(--space-2); }
.suchgruppe__titel { font-size: var(--fs-lg); }
.suchgruppe__alle { font-size: var(--fs-sm); font-weight: 600; }

.nutzermenu { position: relative; }
.nutzermenu__knopf { border: 0; padding: 2px; background: transparent; border-radius: 50%; cursor: pointer; display: inline-flex; }
.nutzermenu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}
.nutzermenu__name { margin: 0; font-weight: 700; }
.nutzermenu__rolle { margin: 0; font-size: var(--fs-xs); color: var(--ink-muted); }
.nutzermenu__gruppe { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--fs-sm); }
.nutzermenu__gruppe legend { font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); margin-bottom: var(--space-1); }
.nutzermenu__gruppe label, .nutzermenu__option { display: flex; align-items: center; gap: var(--space-2); min-height: 28px; font-size: var(--fs-sm); }
.nutzermenu form { margin: 0; }
/* Aufklappliste der Hintergrundläufe: Gestalt des Nutzermenüs, ohne Dreieck am summary; mobil linksbündig,
   sonst ragt das Panel links aus dem Bild */
.laeufe-topbar > summary { list-style: none; cursor: pointer; }
.laeufe-topbar > summary::-webkit-details-marker { display: none; }

/* Glocke der Kopfzeile (seit 08.11.2026): Systemhinweise gezählt und aufklappbar, statt Kästen über jeder Seite */
.glocke > summary { list-style: none; cursor: pointer; }
.glocke > summary::-webkit-details-marker { display: none; }
.glocke__knopf {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--ink-muted);
}
.glocke__knopf:hover, .glocke[open] > .glocke__knopf { background: var(--surface-2); color: var(--ink); }
.glocke__knopf .icon { width: 18px; height: 18px; }
.glocke__zahl {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--warning);
  background: var(--warning-soft);
  color: var(--warning-ink);  /* geprüftes Paar (tokens.css), hell und dunkel */
  font-size: 10.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.glocke__panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  width: min(440px, calc(100vw - 2 * var(--space-4)));
  max-height: 70vh;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}
.glocke__titel { margin: 0 0 var(--space-1); padding: 0 var(--space-1); font-size: var(--fs-sm); font-weight: 700; }
.glocke__panel .hinweis { margin: 0; font-size: var(--fs-sm); }

/* Menü „+ Neu“ und Umschalter „Alltag / Alles“ der Kopfzeile: je zweimal in der Seite (Topbar ab 861 px, Schublade
   darunter), CSS blendet je Breite eines aus. Die Einträge sind Links, die Knöpfe des Umschalters Formularknöpfe. */
.neumenu > summary { list-style: none; cursor: pointer; }
.neumenu > summary::-webkit-details-marker { display: none; }
.neumenu__liste {
  list-style: none;
  margin: 0;
  padding: var(--space-2);
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}
.neumenu__eintrag {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ziel-touch);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.neumenu__eintrag:hover, .neumenu__eintrag:focus-visible { background: var(--surface-2); color: var(--ink); }
.neumenu__eintrag .icon { width: 16px; height: 16px; color: var(--ink-muted); flex: none; }
.neumenu--seitenleiste, .ansichtswahl--seitenleiste { display: none; }
.neumenu--seitenleiste { margin: 0 var(--space-3) var(--space-3); }
.neumenu--seitenleiste .neumenu__knopf { width: 100%; min-height: var(--ziel-touch); }
.neumenu--seitenleiste .neumenu__liste { position: static; margin-top: var(--space-2); box-shadow: none; min-width: 0; }
.ansichtswahl { margin: 0; }
.ansichtswahl--seitenleiste { padding: var(--space-3); }
.ansichtswahl--topbar .segment { flex-wrap: nowrap; align-self: center; }
.ansichtswahl--seitenleiste .segment { display: flex; }
.ansichtswahl--seitenleiste .segment__option { flex: 1; justify-content: center; min-height: var(--ziel-touch); }

.topbar__suche-knopf { display: none; }

/* Mobil genau eine Zeile (UI-KONZEPT 3.1: „[=] Träger › FEBB [Suche]“). Das Suchfeld klappt über den Knopf
   „Suche“ unter der Topbar auf; ohne Skript steht es als zweite Zeile da. Der Datenstand steht dann im
   Seitenkopf, die Läufe nur als Symbol. */
@media (max-width: 860px) {
  .laeufe-topbar > .nutzermenu__panel { position: fixed; top: calc(var(--topbar-h) + var(--space-1)); left: var(--space-4); right: var(--space-4); width: auto; }
  .topsuche__kuerzel { display: none; }
  .topsuche__eingabe { padding-right: var(--space-3); }
  .topbar__suche-knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ziel-touch);
    height: var(--ziel-touch);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    flex: none;
  }
  .topbar__suche-knopf[aria-expanded="true"] { background: var(--surface-2); }
  .mit-js .topsuche { display: none; }
  .mit-js .topbar--suche-offen .topsuche {
    display: block;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    max-width: none;
    padding: var(--space-2) var(--space-4);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lift);
  }
  .mit-js .topbar--suche-offen .topsuche__icon { left: calc(var(--space-4) + 12px); }
  .ohne-js .topsuche { order: 6; flex-basis: 100%; max-width: none; }
  .topbar__status > .datenstand { display: none; }
  .neumenu--topbar, .ansichtswahl--topbar { display: none; }
  .neumenu--seitenleiste { display: block; }
  .ansichtswahl--seitenleiste { display: block; }
  .laeufe-topbar > summary > span:not(.sr-only) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .laeufe-topbar > summary > .icon:last-child { display: none; }
  .laeufe-topbar > summary { min-height: var(--ziel-touch); min-width: var(--ziel-touch); justify-content: center; }
}

/* ================================================================ Detailseite */

.detail { display: flex; flex-direction: column; gap: var(--space-5); }
.detail__kopf { display: flex; flex-direction: column; gap: var(--space-2); }
.detail__titel:focus { outline: none; }
.detail__chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.detail__chips:empty, .detail__meta:empty { display: none; }
.detail__meta { margin: 0; color: var(--ink-muted); font-size: var(--fs-sm); display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.detail__aktionen { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-top: var(--space-2); }
.detail__raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
.detail__steckbrief:empty { display: none; }
.detail__tab { padding-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5); }
.detail__tab.htmx-request { opacity: .55; }
@media (min-width: 1280px) {
  .detail__raster { grid-template-columns: minmax(0, 1fr) var(--breite-steckbrief); }
}
@media (max-width: 1279px) {
  .detail__steckbrief { order: -1; }
}

/* ================================================================ Kennzahlen, Vorschaurahmen, Codefeld, Textstelle (Newsletter) */

.seitenhinweis { margin: 0; max-width: 80ch; color: var(--ink-muted); font-size: var(--fs-sm); }
.kennzahlen { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kennzahl { margin: 0; }
.kennzahl__link {
  display: flex; flex-direction: column; gap: var(--space-1); height: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
}
.kennzahl__link:hover { background: var(--surface-2); }
.kennzahl__wert { font-family: var(--font-display); font-size: var(--fs-stat); font-weight: 700; line-height: 1.1; }
.kennzahl__titel { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 600; }
.kennzahl--klein .kennzahl__wert { font-size: var(--fs-h2); }
.kennzahl--erfolg .kennzahl__link { border-left-color: var(--success); }
.kennzahl--warnung .kennzahl__link { border-left-color: var(--warning); }
.kennzahl--fehler .kennzahl__link { border-left-color: var(--critical-ink); }

.vorschau { display: flex; justify-content: center; padding: var(--space-4); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.vorschau__rahmen { display: block; height: 78vh; min-height: 480px; max-width: 100%; border: 1px solid var(--border); background: var(--surface); }
.vorschau--desktop .vorschau__rahmen { width: 600px; }
.vorschau--mobil .vorschau__rahmen { width: 375px; }
.vorschau-umschalter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.vorschau-umschalter__liste { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); }

.codefeld { display: flex; flex-direction: column; gap: var(--space-2); }
.codefeld__kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.codefeld__text {
  width: 100%; padding: var(--space-3); resize: vertical;
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.5;
  border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
}

.textstellen { display: flex; flex-direction: column; gap: var(--space-4); }
.textstelle { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-md); }
.textstelle--knopf { border-left-color: var(--accent-2); }
.textstelle--bild { border-left-color: var(--warning); }
.textstelle__kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.textstelle__titel { font-size: var(--fs-base); font-weight: 700; }
.textstelle__kontext { margin: 0; font-size: var(--fs-xs); color: var(--ink-muted); }
.textstelle__bezeichnung { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); min-width: 0; flex: 1 1 8rem; }
.textstelle__kopf { justify-content: space-between; align-items: center; }
.textstelle__aktionen, .abschnitt__aktionen { display: inline-flex; gap: var(--space-1); margin-left: auto; }
.knopf--icon { min-height: 32px; min-width: 32px; padding: 0; }
.knopf--icon .icon { width: 1.1em; height: 1.1em; }
.knopf--loeschen, .knopf--loeschen:hover { color: var(--critical-ink); }

/* Baukasten: Abschnitte, „Darunter einfügen“ */
.abschnitt, .textstelle { scroll-margin-top: 5rem; }  /* Anker unter der festen Kopfleiste */
.textstellen__frei, .abschnitt__stellen { display: flex; flex-direction: column; gap: var(--space-3); }
.abschnitt { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.abschnitt__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.abschnitt__bezeichnung { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); min-width: 0; flex: 1 1 14rem; }
.abschnitt__titel { font-size: var(--fs-h3); overflow-wrap: anywhere; }
.abschnitt__zahl { margin: 0; font-size: var(--fs-xs); color: var(--ink-muted); }
.abschnitt__einfuegen { flex-basis: 100%; }
.abschnitt__inhalt > summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-muted); padding: var(--space-1) 0; }
.abschnitt__inhalt[open] > summary { margin-bottom: var(--space-2); }
.einfuegen__zusammenfassung { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--accent-2); }
.einfuegen[open] > .einfuegen__zusammenfassung { margin-bottom: var(--space-2); }
.einfuegen__inhalt { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); max-width: 36rem; padding: var(--space-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.einfuegen__inhalt .feld { align-self: stretch; }
.textstellen__leiste { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; background: var(--bg); border-top: 1px solid var(--border); }
.auszeichnungshilfe { display: grid; gap: var(--space-1) var(--space-4); grid-template-columns: max-content 1fr; margin: 0; font-size: var(--fs-sm); }
.auszeichnungshilfe dt { font-family: var(--font-mono); font-size: var(--fs-xs); }
.auszeichnungshilfe dd { margin: 0; }

/* ================================================================ Fehlerseite, Anmeldung, Hilfe */

.fehlerseite {
  max-width: 720px;
  padding: var(--space-7);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.fehlerseite__titel { margin-bottom: var(--space-4); }
.fehlerseite__titel:focus { outline: none; }
.fehlerseite__aktionen { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-5); }
.fehlerseite__id { font-size: var(--fs-xs); color: var(--ink-muted); }

.anmeldung {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 480px;
  margin: var(--space-7) auto 0;
  padding: var(--space-7);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.anmeldung__text { color: var(--ink-muted); }
.anmeldung__knopf { align-self: flex-start; }
.anmeldung__dev { font-size: var(--fs-sm); }
/* Wiederherstellungscodes des Notfall-Logins: zwei bis drei Spalten, gut abzuschreiben */
.liste-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--space-2); list-style: none; padding: 0; margin: 0; }

.prosa { max-width: 72ch; }
.prosa h2 { font-size: var(--fs-h3); margin: var(--space-6) 0 var(--space-2); }
.prosa h3 { font-size: var(--fs-lg); margin: var(--space-5) 0 var(--space-2); }
.prosa ul, .prosa ol { padding-left: var(--space-5); margin: 0 0 var(--space-3); }
.prosa li + li { margin-top: var(--space-1); }
.prosa table { border-collapse: collapse; margin: var(--space-3) 0; }
.prosa th, .prosa td { border: 1px solid var(--border); padding: var(--space-2) var(--space-3); text-align: left; font-size: var(--fs-sm); }
.prosa kbd { padding: 1px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.hilfe__themen { margin: 0; padding-left: var(--space-5); columns: 2 260px; }

/* Übersicht eines Arbeitsbereichs (/bereich/<key>/): seine Einträge als Kacheln, auch die der alten App */
.bereichsseite__liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--space-3);
}
.bereichsseite__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--ziel-touch);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.bereichsseite__link:hover { background: var(--surface-2); --ink-muted: var(--ink-muted-on-tint); }
.bereichsseite__icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.bereichsseite__titel { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bereichsseite__zusatz { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); color: var(--ink-muted); white-space: nowrap; }
.bereichsseite__zusatz .icon { width: 12px; height: 12px; }

/* ================================================================ Styleguide (/system/komponenten/) */

.sg { display: flex; flex-direction: column; gap: var(--space-7); }
.sg__inhalt { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.sg__abschnitt { display: flex; flex-direction: column; gap: var(--space-4); scroll-margin-top: calc(var(--topbar-h) + var(--space-4)); }
.sg__abschnitt > h2 { padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.sg__beschreibung { color: var(--ink-muted); font-size: var(--fs-sm); margin: 0; }
.sg__reihe { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.sg__schmal { max-width: 360px; }
.sg__spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); }
.sg__thema { padding: var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-3); }
.sg__code { font-size: var(--fs-xs); color: var(--ink-muted); }
.sg__farbe { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); }
.sg__muster { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.sg__muster--bg { background: var(--bg); }
.sg__muster--surface { background: var(--surface); }
.sg__muster--surface-2 { background: var(--surface-2); }
.sg__muster--ink { background: var(--ink); }
.sg__muster--ink-muted { background: var(--ink-muted); }
.sg__muster--accent { background: var(--accent); }
.sg__muster--accent-2 { background: var(--accent-2); }
.sg__muster--accent-soft { background: var(--accent-soft); }
.sg__muster--success { background: var(--success); }
.sg__muster--warning { background: var(--warning); }
.sg__muster--warning-ink { background: var(--warning-ink); }
.sg__muster--critical-ink { background: var(--critical-ink); }
.sg__muster--focus-ring { background: var(--focus-ring); }
.sg__icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.sg__icons li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); color: var(--ink-muted); }
.sg__icons .icon { color: var(--ink); width: 20px; height: 20px; }

/* ================================================================ BulkBar, Schrittleiste, Assistent (Serienmail) */

.bulkbar {
  position: sticky; bottom: var(--space-3); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.bulkbar[hidden] { display: none; }
.bulkbar__info { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.bulkbar__text { margin: 0; font-weight: 700; }
.bulkbar__aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.bulkbar__form { display: inline-flex; margin: 0; }
.tabelle__auswahl input[type="checkbox"] { width: 20px; height: 20px; }

.schritte__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.schritte__schritt { flex: 1 1 150px; min-width: 0; }
.schritte__link {
  display: flex; align-items: center; gap: var(--space-2); min-height: 48px; height: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--ink); font-weight: 600; text-decoration: none;
}
a.schritte__link:hover { background: var(--surface-2); }
.schritte__nr {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px;
  background: var(--surface-2); border-radius: var(--radius-pill); font-size: var(--fs-sm);
}
.schritte__text { display: flex; flex-direction: column; min-width: 0; }
.schritte__hinweis { font-size: var(--fs-xs); font-weight: 400; color: var(--ink-muted); }
.schritte__schritt--aktiv { --ink-muted: var(--ink-muted-on-tint); }
.schritte__schritt--aktiv .schritte__link { background: var(--accent-soft); border-color: var(--accent-2); }
.schritte__schritt--aktiv .schritte__nr { background: var(--accent-2); color: var(--on-accent); }
.schritte__schritt--fertig .schritte__nr { background: var(--success-soft); color: var(--success); }
.schritte__schritt--gesperrt .schritte__link { background: var(--bg); color: var(--ink-muted); }

/* Statusleiste (Lebenslauf einer Eingangsrechnung): acht Schritte, Zustand immer auch als Text */
.statusleiste { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.statusleiste__liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.statusleiste__schritt {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--space-2) var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--border); border-radius: var(--radius-md);
  overflow-wrap: break-word; hyphens: auto;
}
.statusleiste__kopf { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.statusleiste__nr {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px;
  background: var(--surface-2); border-radius: var(--radius-pill); font-size: var(--fs-xs);
}
.statusleiste__nr svg { width: 14px; height: 14px; }
.statusleiste__zustand, .statusleiste__wann, .statusleiste__zusatz { font-size: var(--fs-xs); color: var(--ink-muted); }
.statusleiste__wer { font-size: var(--fs-sm); }
.statusleiste__schritt--erreicht { border-left-color: var(--success); }
.statusleiste__schritt--erreicht .statusleiste__nr { background: var(--success-soft); color: var(--success); }
.statusleiste__schritt--aktuell { background: var(--accent-soft); border-color: var(--accent-2); --ink-muted: var(--ink-muted-on-tint); }
.statusleiste__schritt--aktuell .statusleiste__nr { background: var(--accent-2); color: var(--on-accent); }
.statusleiste__schritt--aktuell .statusleiste__zustand { font-weight: 700; color: var(--accent-2); }
.statusleiste__schritt--uebersprungen { border-style: dashed; color: var(--ink-muted); }
.statusleiste__satz { margin: 0; font-weight: 600; }
.statusleiste__sonder { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); margin: 0; }
@media (min-width: 640px) {
  .statusleiste__liste { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .statusleiste__schritt { border-left-width: 1px; border-top: 6px solid var(--border); }
  .statusleiste__schritt--erreicht { border-top-color: var(--success); }
  .statusleiste__schritt--aktuell { border-top-color: var(--accent-2); }
}
@media (min-width: 1500px) {
  .statusleiste__liste { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
.statuschip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }

.assistent { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.assistent__haupt, .assistent__seite { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
@media (min-width: 1100px) {
  .assistent { grid-template-columns: minmax(0, 1fr) 320px; }
  .assistent__seite { position: sticky; top: var(--space-4); }
}
.platzhalterleiste { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.platzhalterleiste__titel { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-muted); }
.mailtext { width: 100%; min-height: 16rem; padding: var(--space-3); font: inherit; line-height: 1.55; color: var(--ink); background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius-sm); resize: vertical; }
.pruefliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.pruefliste__punkt { display: flex; align-items: flex-start; gap: var(--space-2); }
.pruefliste__punkt .badge { flex: none; }
.zahlzeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none; }
.zahlzeile__wert { font-family: var(--font-display); font-weight: 700; }
.zusammenfassung { display: flex; flex-direction: column; gap: var(--space-3); }
.modusanzeige { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); font-weight: 700; font-size: var(--fs-sm); }
.modusanzeige--test { background: var(--mode-test-bg); color: var(--mode-test-ink); }
.modusanzeige--live { background: var(--mode-live-bg); color: var(--mode-live-ink); }
.abschnitt { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-5); }
.abschnitt > h3 { margin: 0; }
.vorschau-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.vorschau-kopf__betreff { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ================================================================ Belegeingang und Beleg-Seite (BUCHHALTUNG B1.4) */

/* Ablage: Dateien hierher ziehen oder auswählen; ohne JavaScript ein normales Formular mit Knopf */
.ablage {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 2px dashed var(--control-border); border-radius: var(--radius-md);
  background: var(--surface); text-align: center;
}
.ablage[data-ablage-aktiv] { border-color: var(--accent-2); background: var(--accent-soft); }
.ablage__icon { width: 28px; height: 28px; color: var(--accent-2); }
.ablage__text { margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.ablage__neben { color: var(--ink-muted); font-size: var(--fs-sm); }
.ablage__waehlen { color: var(--accent-2); text-decoration: underline; cursor: pointer; font-weight: 600; }
.ablage__felder { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-3); }
.ablage__eingabe { max-width: 100%; font-size: var(--fs-sm); }
/* Mit Skript sendet die Auswahl sofort ab: Das Feld bleibt mit der Tastatur erreichbar, der Rahmen zeigt den Fokus */
.mit-js .ablage__eingabe { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.ablage { position: relative; margin-bottom: var(--space-5); }
.ablage:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
label.knopf { cursor: pointer; }

.belegstand { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.belegstand .badge .icon { animation: drehen 1.4s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .belegstand .badge .icon { animation: none; } }
.tabelle__aktion { margin: 0; }

.belegkopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.belegkopf__neben { color: var(--ink-muted); font-size: var(--fs-sm); }
.belegkopf--rechnung { margin: var(--space-2) 0 0; }
.belegraster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.belegraster__spalte { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
@media (min-width: 1100px) {
  .belegraster { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}
.belegvorschau { display: flex; flex-direction: column; gap: var(--space-3); max-height: 82vh; overflow-y: auto; }
.belegvorschau__seite { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.belegvorschau__link { display: block; cursor: zoom-in; }
.belegvorschau__link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.belegvorschau__werkzeug { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); }

/* Beleg vergrößern: Dialog über fast die ganze Fläche, die Zoomstufe steht als data-zoom an der Fläche (kein style=) */
/* Belegfenster: nicht-modal (mit show() geöffnet), frei verschiebbar und in der Größe änderbar; die Maske dahinter bleibt bedienbar */
.dialog--beleg {
  position: fixed; inset: var(--space-8) var(--space-4) auto auto; margin: 0;
  width: min(640px, 46vw); height: 78vh; min-width: 320px; min-height: 240px; max-width: calc(100vw - var(--space-4)); max-height: calc(100vh - var(--space-4));
  overflow: hidden; resize: both; z-index: 40;
}
.dialog--beleg[open] { display: flex; }
@media (max-width: 700px) {
  /* Handy: Vollbild-Dialog (modal), keine freie Größe */
  .dialog--beleg { inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; resize: none; border-radius: 0; }
}
.beleggross { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; }
.beleggross__kopf { cursor: move; touch-action: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.beleggross__titel { font-size: var(--fs-h3); margin: 0; }
.beleggross__fuss { margin: 0; padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.beleggross__seitenanzeige { margin: 0; color: var(--ink-muted); font-size: var(--fs-sm); }
.beleggross__werkzeug { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin-left: auto; }
.beleggross__zoom { min-width: 4ch; text-align: center; font-variant-numeric: tabular-nums; }
.beleggross__flaeche { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--space-3); background: var(--surface-2); }
.beleggross__flaeche:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.beleggross__seite { display: block; width: 100%; max-width: none; height: auto; margin: 0 auto var(--space-3); border: 1px solid var(--border); }
.beleggross__flaeche[data-zoom="50"] .beleggross__seite { width: 50%; }
.beleggross__flaeche[data-zoom="75"] .beleggross__seite { width: 75%; }
.beleggross__flaeche[data-zoom="150"] .beleggross__seite { width: 150%; }
.beleggross__flaeche[data-zoom="200"] .beleggross__seite { width: 200%; }
.beleggross__flaeche[data-zoom="300"] .beleggross__seite { width: 300%; }
.beleggross__flaeche[data-zoom="400"] .beleggross__seite { width: 400%; }
.belegvorschau__fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-3); }
.belegliste { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); }
.belegaktionen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.belegaktionen form { margin: 0; }
.beleg-parken { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.beleg-parken .feld__label { flex: 1 1 100%; margin: 0; }
.beleg-parken select { flex: 1 1 14rem; min-height: 40px; padding: var(--space-2) var(--space-3); border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface); }
.kv__neben { display: block; color: var(--ink-muted); font-size: var(--fs-sm); }
/* Kreditor-Stammdaten zur IBAN-Kontrolle: Werte fett in der Akzentfarbe, die IBAN zusätzlich auf Fläche */
.kv--pruefung .kv__wert { font-weight: 700; color: var(--accent-2); }
.kv--pruefung .kv__wert .kv__leer { font-weight: 400; color: var(--ink-muted); }
.kv--pruefung .kv__neben { font-weight: 600; }
.kv--pruefung .kv__iban { display: inline-block; padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 1.05em; letter-spacing: 0.02em; }
.aufklapper { margin-top: var(--space-3); }
.aufklapper > summary { cursor: pointer; font-weight: 600; }
.aufklapper[open] > summary { margin-bottom: var(--space-3); }
.dublette { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; overflow-wrap: anywhere; }
.dublette__text { margin: 0; overflow-wrap: anywhere; }

/* Segment aus Knöpfen (eine Wahl, die sofort gespeichert wird): wie die Ansichtswahl, gewählt über aria-pressed */
button.segment__option { border: 0; background: transparent; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.segment__option[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segment--umbruch { border-radius: var(--radius-md); }
.segment__quelle { font-weight: 400; color: var(--ink-muted); }

/* ================================================================ Beleg einreichen vom Handy (BUCHHALTUNG B1.5) */

/* Dateifeld ohne eigenes Skript: Sein Knopf ist ein Touch-Ziel, den Namen der gewählten Datei zeigt das Feld selbst */
.feld input.dateiwahl[type="file"] { padding: var(--space-2); }
.dateiwahl::file-selector-button {
  min-height: var(--ziel-touch);
  margin-right: var(--space-3);
  padding: 0 var(--space-4);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.dateiwahl:hover::file-selector-button { background: var(--surface); }
/* Absenden auf dem Handy über die ganze Breite (der Knopf steckt in einer .knopf-gruppe) */
.handy__absenden > .knopf-gruppe { display: flex; }
.handy__absenden .knopf { flex: 1 1 auto; min-height: var(--ziel-touch); }
@media (min-width: 641px) {
  .handy__absenden > .knopf-gruppe { display: inline-flex; }
  .handy__absenden .knopf { flex: 0 0 auto; }
}
/* Langer Text neben dem Kästchen bricht um, statt in eine eigene Zeile zu rutschen (auch im Dialog, B2.6a) */
.handy .feld--checkbox > .feld__label,
.abarbeiten--einfach .feld--checkbox > .feld__label,
.dialog .feld--checkbox > .feld__label { flex: 1 1 0; min-width: 0; }

/* Meine letzten Belege: ein Eintrag je Beleg; auf dem Handy der Stand immer unter dem Text, sonst rechts daneben */
.eigene { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.eigene__eintrag {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2) var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border);
}
.eigene__eintrag:first-child { padding-top: 0; }
.eigene__eintrag:last-child { border-bottom: 0; }
.eigene__text { display: flex; flex-direction: column; gap: var(--space-1); flex: 1 1 100%; min-width: 0; }
@media (min-width: 641px) { .eigene__text { flex-basis: 14rem; } }
.eigene__titel { display: inline-block; padding: 2px 0; font-weight: 600; overflow-wrap: anywhere; }
.eigene__neben { color: var(--ink-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.eigene__notiz { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.eigene__stand { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.belegnotiz { margin: 0; overflow-wrap: anywhere; }

/* ================================================================ Kontierung eines Kartenumsatzes (BUCHHALTUNG B2.4) */

/* Positionen als Tabelle mit Eingaben in den Zellen: Das Formular darf so breit werden wie die Karte */
.formular--breit { max-width: none; }
.kontierung__eingabe { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.kontierung__eingabe input,
.kontierung__eingabe select {
  width: 100%;
  min-width: min(100%, 8rem);
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.positionen .kontierung__eingabe input[name$="-konto"] { min-width: 14rem; }
.kontierung__eingabe [aria-invalid="true"] { border-color: var(--feld-fehler-rand); box-shadow: 0 0 0 1px var(--feld-fehler-rand); }
td.zahl .kontierung__eingabe input { text-align: right; }

/* ================================================================ Mobilseite der Kreditkarte (BUCHHALTUNG B2.5) */

/* Beleg in Schritt 2: kleines Seitenbild neben den erkannten Daten, auf dem Handy darunter */
.handybeleg { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: flex-start; }
.handybeleg__bild { display: block; width: 7rem; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.handybeleg__daten { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }

/* Wahl des Umsatzes: je Umsatz eine große Fläche (Touch-Ziel), Händler und Datum links, Betrag rechts */
.umsatzwahl { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.umsatzwahl__gruppe { margin: var(--space-2) 0 0; color: var(--ink-muted); font-size: var(--fs-sm); font-weight: 700; }
/* label.… schlägt die Regel für Gruppen (.feld__gruppe label: mittig, klein) */
label.umsatzwahl__option {
  display: flex; align-items: flex-start; gap: var(--space-3);
  min-height: var(--ziel-touch); padding: var(--space-3); font-size: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer;
}
.umsatzwahl__option:has(input:checked) { border-color: var(--accent-2); background: var(--accent-soft); }
.umsatzwahl__option input[type="radio"] { margin-top: 2px; }
.umsatzwahl__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.umsatzwahl__titel { font-weight: 600; }
.umsatzwahl__neben, .umsatzwahl__gruende { color: var(--ink-muted); font-size: var(--fs-sm); }
.umsatzwahl__betrag { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.umsatzwahl__option--spaeter { border-style: dashed; }

/* Aufgeteilte Kontierung (nur lesend in Schritt 3) */
.handypositionen { margin: 0; padding-left: var(--space-4); overflow-wrap: anywhere; }

/* ================================================================ Unterschriftsfeld, Bewirtung, Eigenbeleg (BUCHHALTUNG B2.6) */

/* Die Fläche bleibt in beiden Themen hell wie Papier und die Tinte dunkel: So kommt die Unterschrift lesbar ins
   Bewirtungsblatt (app.js liest die Tinte aus „color“). Ohne Skript bleibt sie verborgen, es gilt das Kästchen. */
.unterschrift__gruppe { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.unterschrift--fehler > .unterschrift__gruppe { padding-left: var(--space-3); border-left: 3px solid var(--feld-fehler-rand); }
.unterschrift__bereich { display: flex; flex-direction: column; gap: var(--space-2); max-width: 36rem; }
.unterschrift__flaeche {
  display: block; width: 100%; height: 10rem;
  border: 1px solid var(--control-border); border-radius: var(--radius-md);
  background: var(--unterschrift-papier); color: var(--unterschrift-tinte);
  touch-action: none; cursor: crosshair;
}
.unterschrift__fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.unterschrift__fuss .feld__hilfe { flex: 1 1 12rem; }
/* Teilnehmende einer Bewirtung: eine Person je Zeile */
.teilnehmende { margin: 0; padding-left: var(--space-5); overflow-wrap: anywhere; }

/* Kartenumsatz: Angaben und Beleg nebeneinander (breit), auf dem Handy untereinander */
.vorgangsraster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--space-4); align-items: start; }
.vorgangsraster__angaben, .vorgangsraster__beleg { min-width: 0; }
@media (min-width: 1024px) {
  .vorgangsraster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================================================================ Eingangsrechnung kontieren (BUCHHALTUNG B3.1) */

/* Ein Formular über mehrere Karten (Mockup B1 „Beleg bearbeiten“), ohne die schmale Breite von .formular */
.kontierungsformular { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
/* Felder im Raster (seit 08.11.2026 wie FES friends): so viele Spalten, wie mit je mindestens 300 px Platz haben
   (Hilfetexte bleiben lesbar), auf dem Handy untereinander; --drei auf großen Bildschirmen genau drei */
.feldraster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-4) var(--space-5);
  align-items: start;
}
@media (min-width: 1280px) {
  .feldraster--drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.feldraster__breit { grid-column: 1 / -1; }
/* Eingaben in einer Tabellenzelle (Positionen): Beschriftung nur für Screenreader, Fehler direkt darunter */
.zelleneingabe { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.zelleneingabe input,
.zelleneingabe select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.zelleneingabe [aria-invalid="true"] { border-color: var(--feld-fehler-rand); box-shadow: 0 0 0 1px var(--feld-fehler-rand); }
td.zahl .zelleneingabe input { text-align: right; }
/* Positionen: als Tabelle wie im Mockup, wenn die Spalte breit genug ist, sonst im Kartenmodus (Beschriftung links);
   eine zu schmale Tabelle scrollt in ihrem Rahmen, nie die Seite (UI-KONZEPT 6) */
.positionen .tabelle-rahmen { overflow-x: auto; }
.positionen .tabelle th, .positionen .tabelle td { padding-left: var(--space-2); padding-right: var(--space-2); vertical-align: top; }
.positionen .tabelle thead th { position: static; }
.positionen input[name$="-konto"] { min-width: 14rem; }
/* Die Kontierung braucht rechts mehr Platz als die Vorschau links (Mockup B1 „Beleg bearbeiten“) */
@media (min-width: 1100px) {
  .belegraster--kontierung { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
}
/* „Position hinzufügen“ links, die Summe rechts */
.summenzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); }
.kontierung__lesend { display: flex; flex-direction: column; gap: var(--space-3); }

/* ================================================================ Freigaben und Vertretungen (BUCHHALTUNG B3.2) */

/* Karten mit Tabelle und Formularen untereinander (Mockup B3 „Freigaben, Vertretungen und Dauerfreigaben“) */
.freigaberechte { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.freigaberechte__titel { font-size: var(--fs-base); font-weight: 700; }
/* Formulare über die ganze Breite der Karte (die Tabelle der Rechte, die Zeile „Vertretung eintragen“): .formular--breit
   (B2.4, oben) */
/* Häkchen in einer Tabellenzelle bleiben klein (statt auf Zellbreite gezogen) */
.zelleneingabe input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; padding: 0; }
/* Eine Formularzeile: auf dem Handy untereinander, breit nebeneinander. Die Felder stehen an der Oberkante: Ein Hilfetext
   unter einem Feld macht es höher, und mit align-items: end rutschten sonst Beschriftung und Eingabe der Nachbarfelder
   auf verschiedene Höhen. Knopf und Checkbox stehen unten bündig. */
.formularzeile { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3) var(--space-4); align-items: start; }
.formularzeile > .feld--checkbox { min-height: 44px; flex-wrap: nowrap; }
.formularzeile > .feld--checkbox, .formularzeile > .formularzeile__knopf { align-self: end; }
/* Zahlen mit zwei Stellen brauchen kein breites Feld (Mockup B3 „Erinnerungen“) */
.formular--kurz input[type="number"] { max-width: 8rem; }
@media (min-width: 900px) {
  .formularzeile { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
}

/* ================================================================ Seminarauswertung (Akademie, Scheibe A2) */

/* Ein Filter mit einer Auswahl oder einem Datum (Zeitraum, Von, Bis, Prüfergebnis, Sortierung): seit 08.11.2026 ein
   Knopf wie die Mehrfachauswahl, die Beschriftung innen vor dem Wert, damit alle Filter eine gleich hohe Zeile bilden
   (Jens: „so dürfen Filter nicht aussehen“; vorher Beschriftung darüber, Hilfetexte über die ganze Breite). */
.filterleiste__feld {
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding-left: var(--space-3);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.filterleiste__feld:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.filterleiste__feld .feld__label { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-muted); white-space: nowrap; }
.filterleiste__feld select,
.filterleiste__feld input:not([type="checkbox"]):not([type="radio"]) {
  width: auto;
  min-height: 38px;
  padding: 0 var(--space-3) 0 0;
  border: 0;
  background: transparent;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.filterleiste__feld select:focus-visible, .filterleiste__feld input:focus-visible { outline: none; }
/* Nur im Filterdialog auf dem Handy (zum Beispiel die Sortierung: am Desktop sortieren die Spaltenköpfe) */
@media (min-width: 861px) {
  .filterleiste__feld--mobil { display: none; }
}
/* Von und Bis nur, wenn „Eigener Zeitraum“ gewählt ist (reines CSS, auch ohne Skript) */
.filterleiste:not(:has(select[name="zeitraum"] option[value="eigen"]:checked)) .filterleiste__feld--eigen { display: none; }
/* Erklärungen zu einem Filter stehen nicht in der Leiste: Bildschirmleser lesen sie über aria-describedby, der Filter
   trägt sie zusätzlich als Tooltip (title) */
.filterleiste__hilfe {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0;
}
.filterleiste__schalter { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); flex-basis: 100%; }
.veranstaltungswahl { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2); max-width: 56rem; }
.veranstaltungswahl .feld { flex: 1 1 24rem; }
.auswertung__hinweis { margin: 0; font-size: var(--fs-sm); color: var(--ink-muted); }
.auswertung__staende { margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--fs-sm); }
.auswertung__titel { margin: 0; font-size: var(--fs-h3); }
.auswertung__zeitraum { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-size: var(--fs-sm); }
.aufklappen > summary { cursor: pointer; font-weight: 600; }
.aufklappen__liste { margin: var(--space-2) 0 0; padding-left: var(--space-5); font-size: var(--fs-sm); }
.aufklappen__liste li { margin-bottom: var(--space-1); }

/* Balkendiagramm: Inline-SVG, Farben nur über Tokens (hell und dunkel), keine Skripte */
.diagramm { margin: 0; }
.diagramm__svg { display: block; width: 100%; height: auto; max-width: 100%; }
.diagramm__balken { fill: var(--accent-2); }
.diagramm__balken:hover { fill: var(--accent-2-hover); }
.diagramm__achse { stroke: var(--border); stroke-width: 1; }
.diagramm__wert, .diagramm__monat { fill: var(--ink-muted); font-size: 11px; font-family: var(--font-body, inherit); }

/* Datum und Beträge in Listen bleiben in einer Zeile */
.nicht-umbrechen { white-space: nowrap; }

/* Planung: GuV und Konten des Haushaltsplans (P1) */
.planzeile th.planzeile__titel { text-align: left; font-weight: 500; }
.planzeile--summe th, .planzeile--summe td, .planzeile--zwischen th, .planzeile--zwischen td,
.planzeile--ergebnis th, .planzeile--ergebnis td { font-weight: 700; background: var(--surface-2); }
.planzeile--rubrik th { font-weight: 600; }
.planzeile--konto th { padding-left: var(--space-6); font-weight: 400; }
.planzeile--konto td { color: var(--ink-muted); }
.planzeile--ohne th, .planzeile--ohne td { font-style: italic; }

/* Betriebsprüfung: Vorgangskette (Schritte untereinander, mit Abstand) */
.vorgangskette { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.vorgangskette__schritt { margin: 0; }
.hash { word-break: break-all; }

/* ================================================================ Karte abarbeiten (BUCHHALTUNG B2.9) */

/* Zwei Spalten: links je Umsatz eine Karte, rechts der Belegeingang; auf dem Handy untereinander */
.abarbeiten { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
@media (min-width: 1100px) {
  .abarbeiten { grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem); }
  .abarbeiten__rechts { position: sticky; top: var(--space-4); }
}
.abarbeiten__umsaetze, .abarbeiten__rechts { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.abarbeiten__leiste { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.abarbeiten__kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.abarbeiten__titelblock { min-width: 0; }
.abarbeiten__titel { font-size: var(--fs-lg); font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.abarbeiten__daten { margin: 0; color: var(--ink-muted); font-size: var(--fs-sm); }
.abarbeiten__stand { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.abarbeiten__betrag { font-size: var(--fs-h3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.abarbeiten__karte--fehler { border-color: var(--critical); }
.abarbeiten__koerper { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-4); align-items: flex-start; }
.abarbeiten__vorschau { flex: 0 0 11rem; max-width: 100%; min-width: 0; }
.abarbeiten__vorschau .belegvorschau { max-height: 15rem; }
.abarbeiten__vorschau .belegvorschau__werkzeug .seitenhinweis { display: none; }
.abarbeiten__formular { flex: 1 1 22rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }
.abarbeiten__hinweis { margin: 0; color: var(--ink-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
/* Zweck über die ganze Breite, darunter Konto (zwei Drittel) und KOST1 (ein Drittel); auf dem Handy untereinander */
.abarbeiten__felder { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3) var(--space-4); align-items: start; margin: 0; }
.abarbeiten__konto { min-width: 0; }
@media (min-width: 641px) {
  .abarbeiten__felder { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .abarbeiten__zweck { grid-column: 1 / -1; }
}
.abarbeiten__aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.abarbeiten__aktionen form { margin: 0; }
.abarbeiten__bewirtungsknopf[hidden], .abarbeiten__formular [hidden] { display: none; }
.abarbeiten__ablagefeld {
  display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4);
  border: 2px dashed var(--control-border); border-radius: var(--radius-md); background: var(--surface-2);
}
@media (min-width: 641px) {
  .abarbeiten__ablagefeld { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
  .abarbeiten__ablagefeld > p, .abarbeiten__ablagefeld > details { grid-column: 1 / -1; }
}
/* „Foto aufnehmen“ (Kamera) nur auf dem Handy, also bei Touch-Bedienung; am Rechner nur „Datei wählen“ (Jens, 09.11.2026) */
.abarbeiten__foto { display: none; }
@media (pointer: coarse) { .abarbeiten__foto { display: block; } }
.abarbeiten__formular[data-ablage-aktiv] .abarbeiten__ablagefeld { border-color: var(--accent-2); background: var(--accent-soft); }
.abarbeiten__ablagefeld, .abarbeiten__beleg--unklar { --ink-muted: var(--ink-muted-on-tint); }
.abarbeiten__wahl > summary { display: inline-flex; cursor: pointer; list-style: none; }
.abarbeiten__wahl > summary::-webkit-details-marker { display: none; }
.abarbeiten__wahl[open] > summary { margin-bottom: var(--space-2); }
.abarbeiten__wahl select, .abarbeiten__wahl input[type="text"] {
  width: 100%; min-height: 40px; margin: var(--space-1) 0 var(--space-2); padding: var(--space-2) var(--space-3);
  border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface);
}
.abarbeiten__seiten { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }

/* Belegeingang (rechts) */
.abarbeiten__ablage { margin-bottom: var(--space-4); }
.abarbeiten__belege { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.abarbeiten__beleg {
  display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.abarbeiten__beleg--unklar { border-style: dashed; border-color: var(--control-border); background: var(--surface-2); }
.abarbeiten__mini { flex: 0 0 3.5rem; }
.abarbeiten__mini img { display: block; width: 3.5rem; height: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.abarbeiten__belegtext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.abarbeiten__belegtitel { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.abarbeiten__belegneben { margin: 0; color: var(--ink-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.abarbeiten__beleg-aktion { margin: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); width: 100%; }
.abarbeiten__sammel { margin-top: var(--space-4); }
.abarbeiten__sammel > summary { display: flex; justify-content: center; cursor: pointer; list-style: none; }
.abarbeiten__sammel > summary::-webkit-details-marker { display: none; }
.abarbeiten__sammel[open] > summary { margin-bottom: var(--space-3); }
.abarbeiten__sammelliste { margin: 0 0 var(--space-3); padding-left: var(--space-5); overflow-wrap: anywhere; }
.abarbeiten__zuletzt { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--fs-sm); }
.abarbeiten__zuletzt li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.abarbeiten__zuletzt-text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.abarbeiten__rueckgaengig { margin: 0; }
.abarbeiten__zwischentitel { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-5) 0 var(--space-2); font-size: var(--fs-base); }

/* Handy: große Knöpfe (56 px), „Foto aufnehmen“ zuerst, alles untereinander */
@media (max-width: 640px) {
  .abarbeiten__aktionen { flex-direction: column; align-items: stretch; }
  .abarbeiten__aktionen .knopf-gruppe, .abarbeiten__aktionen .knopf { width: 100%; }
  .abarbeiten__aktionen .knopf, .abarbeiten__ablagefeld .knopf { min-height: 56px; justify-content: center; font-size: var(--fs-base); }
  .abarbeiten .dateiwahl::file-selector-button { min-height: 56px; }
  .abarbeiten__vorschau { flex-basis: 100%; }
  .abarbeiten__karte { padding: var(--space-4); }
  .abarbeiten .feld input:not([type="checkbox"]):not([type="radio"]), .abarbeiten .feld select { min-height: 48px; font-size: 16px; }
  .abarbeiten__beleg-aktion .knopf { min-height: var(--ziel-touch); }
}

/* ================================================================ Einfache Sicht (Rolle Mitarbeit, core.einfachsicht) */

.ohne-js .nur-mit-js { display: none; }

/* Startseite: große Kacheln mit einem Verb, einem Satz und, wo es etwas zu tun gibt, einer Zahl */
.einfach-kacheln { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.einfach-kachel {
  display: flex; align-items: flex-start; gap: var(--space-4); height: 100%; min-height: var(--ziel-touch);
  padding: var(--space-5) var(--space-4);
  background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--accent);
  border-radius: var(--radius-md); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
}
.einfach-kachel:hover { background: var(--surface-2); color: var(--ink); }
.einfach-kachel--warnung { border-left-color: var(--warning); }
.einfach-kachel--info { border-left-color: var(--accent-2); }
.einfach-kachel__icon { flex: none; display: inline-flex; padding: var(--space-3); border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent-2); }
.einfach-kachel__icon svg { width: 28px; height: 28px; }
.einfach-kachel__text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.einfach-kachel__titel { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700; line-height: 1.2; }
.einfach-kachel__erklaerung { color: var(--ink-muted); font-size: var(--fs-base); }
.einfach-kachel__zahl { margin-top: var(--space-1); font-weight: 700; color: var(--ink); }
.einfach-kachel--warnung .einfach-kachel__zahl { color: var(--warning-ink); }

/* Willkommenskarte (einmalig, wegklickbar) */
.willkommen { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--ink); }
.willkommen[hidden] { display: none; }
.willkommen__titel { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); }
.willkommen__text { margin: 0; }
.willkommen__aktionen { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.topbar__start { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--ziel-touch); padding: 0 var(--space-3); border-radius: var(--radius-md); font-weight: 700; color: var(--accent-2); text-decoration: none; }
.topbar__start:hover { background: var(--surface-2); color: var(--accent-2); }

/* „So geht’s“: drei kurze Sätze oben auf jeder Seite der einfachen Sicht, mit dem Link zur Hilfe in der Kopfzeile */
.sogehts { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--ink); font-size: var(--fs-sm); }
.sogehts__kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.sogehts__titel { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); }
.sogehts__liste { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); }
.sogehts__hilfe { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--ziel-touch); font-weight: 700; color: var(--accent-2); }

/* Foto aufnehmen als großer Hauptknopf: das Kamerafeld der einfachen Sicht */
.handy--einfach input.dateiwahl[capture]::file-selector-button { min-height: var(--ziel-touch); background: var(--accent-2); color: var(--on-accent); border-color: var(--accent-2); font-weight: 700; }
.handy--einfach input.dateiwahl[capture]:hover::file-selector-button { background: var(--accent-2-hover); }

/* Hat die Seite ein „So geht’s“ mit eigenem Hilfe-Link, entfällt der zweite im Seitenkopf */
.inhalt--einfach:has(.sogehts) .seitenkopf__hilfe { display: none; }

.abarbeiten__zusammen { margin: 0; font-weight: 700; color: var(--warning-ink); }
.abarbeiten--einfach .abarbeiten__wahl > summary { display: flex; justify-content: center; text-align: center; white-space: normal; height: auto; padding-block: var(--space-2); }

/* Rechnungen bestätigen (einfache Sicht): eine Karte je Rechnung */
.rechnungskarten { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.rechnungskarte { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--accent); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.rechnungskarte__text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; flex: 1 1 14rem; }
.rechnungskarte__titel { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); overflow-wrap: anywhere; }
.rechnungskarte__betrag { margin: 0; font-size: var(--fs-lg); font-weight: 700; }
.rechnungskarte__neben, .rechnungskarte__stand { margin: 0; color: var(--ink-muted); overflow-wrap: anywhere; }
.rechnungskarte .knopf { min-height: var(--ziel-touch); }
.inhalt--einfach .segment__label { display: none; }  /* die Wahl spricht für sich; der Name steht im aria-label */
.nav[data-einfach] .nav__titel { white-space: normal; overflow: visible; text-overflow: clip; }  /* „Rechnungen bestätigen“ passt auch neben dem Zähler */

/* ================================================================ Seminarrahmen (Akademie, 09.11.2026) */
/* Ein Kopf für alle Seiten eines Seminars: Stand, Reiter, bei „Mails“ eine zweite Ebene; die Vorab-Prüfung als
   kompakte Statuszeile mit aufklappbaren Meldungen statt eines roten Blocks */
.seminarstand { margin: calc(-1 * var(--space-2)) 0 var(--space-2); }
.seminarrahmen__unter { margin: var(--space-2) 0 var(--space-4); }
.pruefzeile {
  margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--surface-2); border: 1px solid var(--control-border); border-radius: var(--radius-md);
}
.pruefzeile__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.pruefzeile .aufklapper { margin-top: var(--space-2); }

/* Einsätze der Akademie (ADR 031): Vorschau der Angebotsmail */
.mailvorschau { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.mailvorschau__text p { margin: 0 0 var(--space-3); }
.mailvorschau__text p:last-child { margin-bottom: 0; }

/* ================================================================ Belegfenster (eigenes Fenster neben der Liste) */

.belegfenster { display: flex; flex-direction: column; gap: var(--space-4); }
.belegfenster__seite { display: block; width: 100%; height: auto; border: 1px solid var(--border); background: var(--surface); }
