/* CXA-Baukasten · komponenten.css
   Bausteine fuer alle Ansichten. Toene: ton-ok, ton-warn, ton-fehler, ton-info,
   ton-marke, ton-akzent, ton-neutral. */

/* ── Anordnung ───────────────────────────────────────────────────────── */
.cxa-stapel { display: flex; flex-direction: column; gap: 16px; }
.cxa-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cxa-zeile .rechts, .cxa-rechts { margin-left: auto; }
.cxa-raster { display: grid; gap: 16px; grid-template-columns: repeat(var(--spalten, 2), minmax(0, 1fr)); }
.cxa-raster.s3 { --spalten: 3; }
.cxa-raster.s4 { --spalten: 4; }
.cxa-raster .breit { grid-column: 1 / -1; }
.cxa-raster.haupt-neben { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .cxa-raster.s4 { --spalten: 2; } .cxa-raster.s3 { --spalten: 2; } }
@media (max-width: 760px) { .cxa-raster, .cxa-raster.haupt-neben { grid-template-columns: minmax(0, 1fr); } }

.cxa-abschnitt-kopf { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cxa-abschnitt-kopf h2 { font-size: 17px; font-weight: 700; }
.cxa-abschnitt-kopf p { margin: 2px 0 0; color: var(--cxa-text-2); font-size: var(--cxa-t-klein); }
.cxa-abschnitt-kopf .rechts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.cxa-label {
  font-size: var(--cxa-t-mikro); font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--cxa-text-3);
}
.cxa-leise { color: var(--cxa-text-2); }
.cxa-klein { font-size: var(--cxa-t-klein); }

/* ── Schaltflaechen ──────────────────────────────────────────────────── */
.cxa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--cxa-linie); border-radius: var(--cxa-radius);
  background: var(--cxa-flaeche); color: var(--cxa-text);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background var(--cxa-tempo), border-color var(--cxa-tempo), color var(--cxa-tempo), transform 80ms;
}
.cxa-btn:hover { border-color: rgba(16, 28, 45, .3); }
.cxa-btn:active { transform: translateY(1px); }
.cxa-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.cxa-btn .cxa-icon { width: 16px; height: 16px; }
.cxa-btn.haupt { background: var(--cxa-marke); border-color: var(--cxa-marke); color: var(--cxa-auf-marke); }
.cxa-btn.haupt:hover { background: var(--cxa-marke-dunkel); border-color: var(--cxa-marke-dunkel); }
.cxa-btn.akzent { background: var(--cxa-akzent); border-color: var(--cxa-akzent); color: #1d0f08; }
.cxa-btn.akzent:hover { background: var(--cxa-akzent-dunkel); border-color: var(--cxa-akzent-dunkel); color: #fff; }
.cxa-btn.gefahr { background: var(--cxa-fehler); border-color: var(--cxa-fehler); color: #fff; }
.cxa-btn.gefahr:hover { background: var(--cxa-fehler-text); }
.cxa-btn.still { background: none; border-color: transparent; color: var(--cxa-text-2); }
.cxa-btn.still:hover { background: var(--cxa-flaeche-2); color: var(--cxa-text); }
.cxa-btn.klein { height: 28px; padding: 0 10px; font-size: 12px; }
.cxa-btn.nur-icon { width: 36px; padding: 0; }
.cxa-btn.klein.nur-icon { width: 28px; }
@media (max-width: 900px) { .cxa-btn { min-height: 40px; } .cxa-btn.klein { min-height: 34px; } }

/* Umschalter (Woche/Monat, Ausbaustufe) */
.cxa-schalter { display: inline-flex; padding: 2px; border-radius: var(--cxa-radius); background: var(--cxa-flaeche-2); }
.cxa-schalter button {
  height: 30px; padding: 0 11px; border: 0; border-radius: 4px; background: none;
  font-size: 12.5px; font-weight: 500; color: var(--cxa-text-2);
}
.cxa-schalter button[aria-pressed='true'] { background: var(--cxa-flaeche); color: var(--cxa-text); font-weight: 650; box-shadow: 0 1px 2px rgba(16, 28, 45, .12); }

/* Filter-Chips */
.cxa-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cxa-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--cxa-linie); border-radius: 999px;
  background: var(--cxa-flaeche); color: var(--cxa-text-2);
  font-size: 12.5px; font-weight: 550;
}
.cxa-chip:hover { border-color: rgba(16, 28, 45, .3); color: var(--cxa-text); }
.cxa-chip[aria-pressed='true'] { background: var(--cxa-marke); border-color: var(--cxa-marke); color: var(--cxa-auf-marke); }
.cxa-chip .anzahl { font-size: 11px; font-weight: 700; opacity: .7; }

/* Reiter innerhalb einer Ansicht */
.cxa-reiter { display: flex; gap: 2px; border-bottom: 1px solid var(--cxa-linie); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.cxa-reiter button {
  position: relative; flex: none;
  height: 40px; padding: 0 14px; border: 0; background: none;
  font-size: 13.5px; font-weight: 550; color: var(--cxa-text-2);
}
.cxa-reiter button:hover { color: var(--cxa-text); }
.cxa-reiter button[aria-selected='true'] { color: var(--cxa-marke); font-weight: 700; }
.cxa-reiter button[aria-selected='true']::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: var(--cxa-akzent); border-radius: 2px 2px 0 0;
}
.cxa-reiter .anzahl { margin-left: 5px; font-size: 11px; color: var(--cxa-text-3); }

/* Einstellungen: Bereichsliste links, Inhalt rechts; unter 760 px eine Auswahl statt der Liste */
.cxa-einst { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.cxa-einst-inhalt { min-width: 0; }
.cxa-einst-wahl { display: none; width: 100%; min-height: 44px; margin-bottom: 16px; }
.cxa-einst-liste { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }
.cxa-einst-gruppe { display: flex; flex-direction: column; gap: 2px; }
.cxa-einst-gruppe h2 { margin: 0 0 4px 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cxa-text-3); }
.cxa-einst-gruppe button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
  font-size: 13.5px; font-weight: 550; color: var(--cxa-text-2);
}
.cxa-einst-gruppe button:hover { background: var(--cxa-flaeche); color: var(--cxa-text); }
.cxa-einst-gruppe button[aria-current='page'] { background: var(--cxa-flaeche); color: var(--cxa-marke); font-weight: 700; box-shadow: inset 3px 0 0 var(--cxa-akzent); }
.cxa-einst-gruppe .anzahl { font-size: 11px; color: var(--cxa-text-3); }
@media (max-width: 759px) {
  .cxa-einst { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cxa-einst-liste { display: none; }
  .cxa-einst-wahl { display: block; }
}
/* Bereiche stehen in der breiten Schiene (Person ohne Menue): Inhalt ueber die volle Breite */
@media (min-width: 1181px) {
  .cxa-bereiche-in-schiene .cxa-einst { grid-template-columns: minmax(0, 1fr); }
  .cxa-bereiche-in-schiene .cxa-einst-liste { display: none; }
}

/* Einrichtungs-Assistent: Schrittliste links, Erklaerung und Inhalt rechts; unter 760 px eine Spalte mit Balken */
.cxa-einr { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.cxa-einr-haupt { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cxa-einr-schritte { position: sticky; top: 16px; }
.cxa-einr-schritte ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cxa-einr-schritte button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; font-size: 13.5px; font-weight: 550; color: var(--cxa-text-2);
}
.cxa-einr-schritte button:hover { background: var(--cxa-flaeche); color: var(--cxa-text); }
.cxa-einr-schritte button[aria-current='step'] { background: var(--cxa-flaeche); color: var(--cxa-marke); font-weight: 700; box-shadow: inset 3px 0 0 var(--cxa-akzent); }
.cxa-einr-schritte .punkt {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; border: 1px solid var(--cxa-linie); font-size: 11.5px; font-weight: 700; color: var(--cxa-text-3);
}
.cxa-einr-schritte .punkt.fertig { background: var(--cxa-ok); border-color: var(--cxa-ok); color: #fff; }
.cxa-einr-schritte .punkt .cxa-icon { width: 13px; height: 13px; }
.cxa-einr-schritte .titel { flex: 1; min-width: 0; }
.cxa-einr-schritte .opt { font-size: 11px; font-weight: 500; color: var(--cxa-text-3); }
.cxa-einr-fortschritt { display: none; }
.cxa-einr-fortschritt p { margin: 0 0 6px; font-size: var(--cxa-t-klein); font-weight: 650; color: var(--cxa-text-2); }
.cxa-einr-erklaerung { padding: 14px 16px; border-radius: var(--cxa-radius-gr); background: var(--cxa-flaeche-2); border: 1px solid var(--cxa-linie-zart); }
.cxa-einr-erklaerung h2 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.cxa-einr-erklaerung p { margin: 0; color: var(--cxa-text-2); font-size: var(--cxa-t-klein); }
.cxa-einr-inhalt { min-width: 0; }
.cxa-einr-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cxa-einr-knoepfe .rechts { flex: 1; }
.cxa-einr-karte { display: grid; gap: 10px; }
.cxa-einr-karte p, .cxa-einr-karte ul { margin: 0; }
.cxa-einr-karte ul { padding-left: 18px; font-size: var(--cxa-t-klein); }
.cxa-einr-karte .cxa-btn { justify-self: start; }
@media (max-width: 759px) {
  .cxa-einr { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cxa-einr-schritte { display: none; }
  .cxa-einr-fortschritt { display: block; }
}

/* ── Marken und Hinweise ─────────────────────────────────────────────── */
.cxa-marke {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  border-radius: 999px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600;
  background: var(--cxa-flaeche-2); color: var(--cxa-text-2);
}
.cxa-marke::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.cxa-marke.ohne-punkt::before { display: none; }
.ton-ok.cxa-marke     { background: var(--cxa-ok-hell);     color: var(--cxa-ok-text); }
.ton-warn.cxa-marke   { background: var(--cxa-warn-hell);   color: var(--cxa-warn-text); }
.ton-fehler.cxa-marke { background: var(--cxa-fehler-hell); color: var(--cxa-fehler-text); }
.ton-info.cxa-marke   { background: var(--cxa-info-hell);   color: var(--cxa-info-text); }
.ton-marke.cxa-marke  { background: var(--cxa-marke-hell);  color: var(--cxa-marke); }
.ton-akzent.cxa-marke { background: var(--cxa-akzent-hell); color: var(--cxa-akzent-dunkel); }

.cxa-hinweis {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--cxa-linie); border-left: 3px solid var(--cxa-info);
  border-radius: var(--cxa-radius);
  background: var(--cxa-flaeche);
  font-size: 13px; color: var(--cxa-text-2);
}
.cxa-hinweis b { color: var(--cxa-text); }
.cxa-hinweis .cxa-icon { color: var(--cxa-info); margin-top: 1px; }
.cxa-hinweis.ton-warn { border-left-color: var(--cxa-warn); background: var(--cxa-warn-hell); }
.cxa-hinweis.ton-warn .cxa-icon { color: var(--cxa-warn-text); }
.cxa-hinweis.ton-fehler { border-left-color: var(--cxa-fehler); background: var(--cxa-fehler-hell); }
.cxa-hinweis.ton-fehler .cxa-icon { color: var(--cxa-fehler-text); }
.cxa-hinweis.ton-ok { border-left-color: var(--cxa-ok); background: var(--cxa-ok-hell); }
.cxa-hinweis.ton-ok .cxa-icon { color: var(--cxa-ok-text); }

.cxa-leer { padding: 34px 20px; text-align: center; color: var(--cxa-text-2); }
.cxa-leer b { display: block; color: var(--cxa-text); font-size: 14.5px; margin-bottom: 4px; }
.cxa-leer p { margin: 0 auto; max-width: 42ch; font-size: 13px; }

/* ── Karten ──────────────────────────────────────────────────────────── */
.cxa-karte {
  background: var(--cxa-flaeche);
  border: 1px solid var(--cxa-linie);
  border-radius: var(--cxa-radius-gr);
  box-shadow: var(--cxa-schatten);
  min-width: 0;
}
.cxa-karte-kopf {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--cxa-linie-zart);
}
.cxa-karte-kopf h2, .cxa-karte-kopf h3 { font-size: 14.5px; font-weight: 700; }
.cxa-karte-kopf .rechts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.cxa-karte-kopf p { margin: 2px 0 0; color: var(--cxa-text-2); font-size: var(--cxa-t-klein); }
.cxa-karte-kopf:last-child { border-bottom: 0; }
.cxa-karte-koerper { padding: 14px 16px; }
.cxa-karte-koerper.eng { padding: 0; }
.cxa-karte.klickbar { transition: border-color var(--cxa-tempo), box-shadow var(--cxa-tempo), transform var(--cxa-tempo); }
.cxa-karte.klickbar:hover { border-color: rgba(16, 28, 45, .26); box-shadow: var(--cxa-schatten-2); transform: translateY(-1px); }

/* Feld: Beschriftung ueber Wert, fuer Detailansichten */
.cxa-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 18px; }
.cxa-feld-anzeige .cxa-label { display: block; margin-bottom: 3px; }
.cxa-feld-anzeige .wert { font-size: 14px; font-weight: 550; }

/* ── Tabellen ────────────────────────────────────────────────────────────
   Bis 760 px wird jede Zeile zur Karte, die Spaltennamen kommen aus data-label. */
.cxa-tabelle-wrap { overflow-x: auto; }
.cxa-tabelle { width: 100%; border-collapse: collapse; font-size: 13px; }
.cxa-tabelle thead th {
  position: sticky; top: 0; z-index: 1;
  padding: 9px 14px; text-align: left; white-space: nowrap;
  background: var(--cxa-flaeche-2);
  border-bottom: 1px solid var(--cxa-linie);
  font-size: var(--cxa-t-mikro); font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--cxa-text-2);
}
.cxa-tabelle tbody td { padding: 9px 14px; height: var(--cxa-zeile); border-bottom: 1px solid var(--cxa-linie-zart); vertical-align: middle; }
.cxa-tabelle tbody tr:last-child td { border-bottom: 0; }
.cxa-tabelle tbody tr { transition: background var(--cxa-tempo); }
.cxa-tabelle tbody tr.klickbar:hover { background: color-mix(in srgb, var(--cxa-marke-hell) 45%, transparent); }
.cxa-tabelle tbody tr.klickbar td:first-child { box-shadow: inset 0 0 0 transparent; transition: box-shadow var(--cxa-tempo); }
.cxa-tabelle tbody tr.klickbar:hover td:first-child, .cxa-tabelle tbody tr.klickbar:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--cxa-akzent); }
.cxa-tabelle tbody tr.klickbar:focus-visible { outline: 2px solid var(--cxa-akzent); outline-offset: -2px; }
.cxa-tabelle .r { text-align: right; }
.cxa-tabelle .haupt { font-weight: 650; }
.cxa-tabelle .neben { display: block; color: var(--cxa-text-3); font-size: 12px; }
.cxa-tabelle tfoot td { padding: 10px 14px; border-top: 1px solid var(--cxa-linie); font-weight: 700; }
.cxa-tabelle th.sortierbar button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.cxa-tabelle th.sortierbar button:focus-visible { outline: 2px solid var(--cxa-akzent); }
.cxa-tabelle th[aria-sort] { color: var(--cxa-marke); }
.cxa-aufklappen { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 6px; color: var(--cxa-text-3); vertical-align: middle; }
.cxa-aufklappen:hover { background: var(--cxa-flaeche-2); color: var(--cxa-text); }
.cxa-aufklappen:focus-visible { outline: 2px solid var(--cxa-akzent); }
.cxa-aufklappen span { transition: transform var(--cxa-tempo); font-size: 18px; line-height: 1; }
.cxa-aufklappen[aria-expanded='true'] span { transform: rotate(90deg); }
.cxa-tabelle tbody tr.cxa-tabelle-detail td { background: var(--cxa-flaeche-2); padding: 12px 14px 14px 44px; height: auto; }

@media (max-width: 760px) {
  .cxa-tabelle-wrap.karten { overflow: visible; }
  .karten .cxa-tabelle, .karten .cxa-tabelle tbody, .karten .cxa-tabelle tr, .karten .cxa-tabelle td { display: block; width: 100%; }
  .karten .cxa-tabelle thead { display: none; }
  .karten .cxa-tabelle tbody tr {
    margin: 0 0 10px; padding: 4px 14px;
    border: 1px solid var(--cxa-linie); border-radius: var(--cxa-radius-gr);
    background: var(--cxa-flaeche);
  }
  .karten .cxa-tabelle tbody td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    height: auto; padding: 8px 0; text-align: right;
    border-bottom: 1px solid var(--cxa-linie-zart);
  }
  .karten .cxa-tabelle tbody tr td:last-child { border-bottom: 0; }
  .karten .cxa-tabelle tbody td::before {
    content: attr(data-label); flex: none; text-align: left;
    font-size: var(--cxa-t-mikro); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cxa-text-3);
  }
  .karten .cxa-tabelle tbody td[data-label='']::before { display: none; }
  /* Erste Spalte ist der Kartentitel: ohne Beschriftung, linksbuendig, etwas groesser */
  .karten .cxa-tabelle tbody td:first-child { display: block; text-align: left; padding: 11px 0 9px; font-size: 14px; }
  .karten .cxa-tabelle tbody td:first-child::before { display: none; }
  .karten .cxa-tabelle tbody td.leer-zeile { display: block; text-align: center; }
  .karten .cxa-tabelle tbody tr.klickbar td:first-child { box-shadow: none; }
  .karten .cxa-tabelle tbody tr.cxa-tabelle-detail { margin: -11px 0 10px; padding: 0; border-top: 0; border-radius: 0 0 var(--cxa-radius-gr) var(--cxa-radius-gr); }
  .karten .cxa-tabelle tbody tr.cxa-tabelle-detail td { display: block; text-align: left; padding: 12px 14px; }
  .karten .cxa-tabelle tbody tr.cxa-tabelle-detail[hidden] { display: none; }
  .karten .cxa-tabelle tfoot, .karten .cxa-tabelle tfoot tr { display: block; }
  .karten .cxa-tabelle tfoot td { display: flex; justify-content: space-between; }
}

/* ── Formulare ───────────────────────────────────────────────────────── */
.cxa-formular { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.cxa-formular .breit { grid-column: 1 / -1; }
@media (max-width: 640px) { .cxa-formular { grid-template-columns: minmax(0, 1fr); } }
.cxa-feld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cxa-feld > span { font-size: 12.5px; font-weight: 600; color: var(--cxa-text-2); }
.cxa-feld .pflicht { color: var(--cxa-fehler); margin-left: 2px; }
.cxa-feld input, .cxa-feld select, .cxa-feld textarea, .cxa-eingabe {
  width: 100%; min-height: 38px; padding: 7px 11px;
  border: 1px solid var(--cxa-linie); border-radius: var(--cxa-radius);
  background: var(--cxa-flaeche);
  transition: border-color var(--cxa-tempo), box-shadow var(--cxa-tempo);
}
.cxa-feld textarea { min-height: 84px; resize: vertical; }
.cxa-feld input:focus, .cxa-feld select:focus, .cxa-feld textarea:focus, .cxa-eingabe:focus {
  outline: none; border-color: var(--cxa-marke); box-shadow: 0 0 0 3px var(--cxa-marke-hell);
}
.cxa-feld.fehler input, .cxa-feld.fehler select, .cxa-feld.fehler textarea { border-color: var(--cxa-fehler); box-shadow: 0 0 0 3px var(--cxa-fehler-hell); }
.cxa-feld small { font-size: 12px; color: var(--cxa-text-3); }
.cxa-feld .fehlertext { color: var(--cxa-fehler-text); font-weight: 600; }
/* Ortsvorschlag unter der PLZ (plz-feld.js): Zeile bleibt reserviert, damit das Formular nicht springt */
.cxa-feld small[data-plz-hinweis] { min-height: 1.4em; }
.cxa-such-eingabe { position: relative; min-width: 220px; }
.cxa-such-eingabe .cxa-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--cxa-text-3); pointer-events: none; }
.cxa-such-eingabe .cxa-eingabe { padding-left: 34px; }

/* ── Dialog ──────────────────────────────────────────────────────────── */
.cxa-schleier {
  position: fixed; inset: 0; z-index: 500;
  display: none; align-items: flex-start; justify-content: center;
  padding: 7vh 16px 24px; overflow-y: auto;
  background: rgba(8, 16, 30, .48);
}
.cxa-schleier.offen { display: flex; animation: cxa-blenden 160ms ease-out; }
@keyframes cxa-blenden { from { opacity: 0; } }
.cxa-dialog {
  width: 100%; max-width: 560px;
  background: var(--cxa-flaeche); border-radius: 12px;
  box-shadow: var(--cxa-schatten-3);
  animation: cxa-heben 200ms cubic-bezier(.2, .7, .3, 1);
}
.cxa-dialog.gross { max-width: 860px; }
.cxa-dialog.klein { max-width: 420px; }
@keyframes cxa-heben { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.cxa-dialog-kopf { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--cxa-linie-zart); }
.cxa-dialog-kopf h2 { font-size: 17px; font-weight: 700; }
.cxa-dialog-kopf p { margin: 3px 0 0; color: var(--cxa-text-2); font-size: 13px; }
.cxa-dialog-kopf .cxa-btn { margin: -4px -6px 0 auto; }
.cxa-dialog-koerper { padding: 18px 20px; }
.cxa-dialog-fuss { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--cxa-linie-zart); background: color-mix(in srgb, var(--cxa-grund) 60%, var(--cxa-flaeche)); border-radius: 0 0 12px 12px; }
.cxa-dialog-fuss .links { margin-right: auto; }
@media (max-width: 640px) {
  .cxa-schleier { padding: 0; align-items: flex-end; }
  .cxa-dialog, .cxa-dialog.gross, .cxa-dialog.klein { max-width: none; border-radius: 14px 14px 0 0; max-height: 92dvh; display: flex; flex-direction: column; animation-name: cxa-hoch; }
  .cxa-dialog-koerper { overflow-y: auto; }
  .cxa-dialog-fuss { border-radius: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .cxa-dialog-fuss .cxa-btn { flex: 1; }
  @keyframes cxa-hoch { from { transform: translateY(40px); opacity: 0; } }
}

/* ── Toasts ──────────────────────────────────────────────────────────── */
.cxa-toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 600;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none;
}
.cxa-toast {
  display: flex; align-items: center; gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--cxa-marke-dunkel); color: #fff;
  box-shadow: var(--cxa-schatten-2);
  font-size: 13px; font-weight: 500;
  pointer-events: auto;
  animation: cxa-toast-rein 220ms cubic-bezier(.2, .7, .3, 1);
}
.cxa-toast .cxa-icon { width: 17px; height: 17px; }
.cxa-toast.ton-ok .cxa-icon { color: #7fd3ac; }
.cxa-toast.ton-fehler { background: var(--cxa-fehler-text); }
.cxa-toast.ton-info .cxa-icon { color: #7fd6d6; }
.cxa-toast.weg { opacity: 0; transform: translateY(6px); transition: opacity 200ms, transform 200ms; }
@keyframes cxa-toast-rein { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 640px) { .cxa-toasts { left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); align-items: stretch; } .cxa-toast { max-width: none; } }

/* ── Kennzahlen ──────────────────────────────────────────────────────── */
.cxa-kpi-reihe { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cxa-kpi {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px 15px;
  background: var(--cxa-flaeche);
  border: 1px solid var(--cxa-linie); border-radius: var(--cxa-radius-gr);
  box-shadow: var(--cxa-schatten);
  text-align: left; color: inherit;
}
.cxa-kpi::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--kpi-ton, transparent); }
button.cxa-kpi { font: inherit; transition: transform var(--cxa-tempo), box-shadow var(--cxa-tempo); }
button.cxa-kpi:hover { transform: translateY(-1px); box-shadow: var(--cxa-schatten-2); }
.cxa-kpi .wert { font-size: var(--cxa-t-zahl); font-weight: 750; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cxa-kpi .unter { font-size: 12px; color: var(--cxa-text-2); }
.cxa-kpi.ton-ok { --kpi-ton: var(--cxa-ok); }
.cxa-kpi.ton-warn { --kpi-ton: var(--cxa-warn); }
.cxa-kpi.ton-fehler { --kpi-ton: var(--cxa-fehler); }
.cxa-kpi.ton-fehler .wert { color: var(--cxa-fehler-text); }
.cxa-kpi.ton-info { --kpi-ton: var(--cxa-info); }
.cxa-kpi.ton-marke { --kpi-ton: var(--cxa-marke); }
.cxa-kpi.ton-akzent { --kpi-ton: var(--cxa-akzent); }
@media (max-width: 520px) { .cxa-kpi-reihe { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cxa-kpi .wert { font-size: 22px; } }

/* Ablesung: kompakte Kennzahl fuer die Kopfleiste */
.cxa-ablesung {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--cxa-linie); border-radius: var(--cxa-radius);
  background: var(--cxa-flaeche); font-size: 12px; color: var(--cxa-text-2);
}
.cxa-ablesung b { font-size: 15px; color: var(--cxa-text); font-variant-numeric: tabular-nums; }
.cxa-ablesung .lampe { width: 7px; height: 7px; border-radius: 50%; background: var(--lampe, var(--cxa-text-3)); }
.cxa-ablesung.ton-ok { --lampe: var(--cxa-ok); }
.cxa-ablesung.ton-warn { --lampe: var(--cxa-warn); }
.cxa-ablesung.ton-fehler { --lampe: var(--cxa-fehler); }
.cxa-ablesung.ton-fehler .lampe { box-shadow: 0 0 0 3px var(--cxa-fehler-hell); }
.cxa-ablesung.ton-info { --lampe: var(--cxa-info); }

/* Fortschrittsbalken */
.cxa-balken { position: relative; height: 7px; border-radius: 4px; background: var(--cxa-flaeche-2); overflow: hidden; }
.cxa-balken > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--balken, var(--cxa-marke)); }
.cxa-balken.ton-ok { --balken: var(--cxa-ok); }
.cxa-balken.ton-warn { --balken: var(--cxa-warn); }
.cxa-balken.ton-fehler { --balken: var(--cxa-fehler); }
.cxa-balken.ton-soll { --balken: var(--cxa-text-3); opacity: .45; }
.cxa-balken-vergleich { display: grid; gap: 4px; }
.cxa-balken-vergleich .kopf { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.cxa-balken-vergleich .kopf b { font-variant-numeric: tabular-nums; }
.cxa-balken.ton-akzent { --balken: var(--cxa-akzent); }
.cxa-balken-zeile { display: grid; gap: 4px; }
.cxa-balken-zeile .kopf { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.cxa-balken-zeile .kopf b { font-variant-numeric: tabular-nums; }

/* Saeulendiagramm (SVG) */
.cxa-saeulen { width: 100%; height: auto; overflow: visible; }
.cxa-saeulen .achse { fill: var(--cxa-text-3); font-size: 11px; font-family: var(--cxa-schrift); }
.cxa-saeulen .gitter { stroke: var(--cxa-linie-zart); }
.cxa-saeulen .saeule path { fill: var(--saeule, var(--cxa-marke)); transition: opacity var(--cxa-tempo); }
.cxa-saeulen .saeule:hover path { opacity: .82; }
.cxa-saeulen .saeule.ton-ok { --saeule: var(--cxa-ok); }
.cxa-saeulen .saeule.ton-warn { --saeule: var(--cxa-warn); }
.cxa-saeulen .saeule.ton-fehler { --saeule: var(--cxa-fehler); }
.cxa-saeulen .saeule.ton-akzent { --saeule: var(--cxa-akzent); }
.cxa-saeulen .saeule.ton-neutral { --saeule: var(--cxa-text-3); }
.cxa-saeulen .ziel { stroke: var(--cxa-akzent-dunkel); stroke-width: 1.5; stroke-dasharray: 5 4; }
.cxa-saeulen .ziel-text { fill: var(--cxa-akzent-dunkel); font-size: 11px; font-weight: 700; }
.cxa-saeulen .wert-text { fill: var(--cxa-text-2); font-size: 10.5px; font-weight: 600; }

/* ── Kanban ──────────────────────────────────────────────────────────── */
.cxa-kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.cxa-kb-spalte {
  display: flex; flex-direction: column; min-height: 160px; max-height: calc(100dvh - 210px);
  border-radius: var(--cxa-radius-gr);
  background: var(--cxa-flaeche-2);
  border: 1px dashed transparent;
  transition: background var(--cxa-tempo), border-color var(--cxa-tempo);
}
.cxa-kb-spalte.cxa-ueber { background: var(--cxa-akzent-hell); border-color: var(--cxa-akzent); }
.cxa-kb-kopf { display: flex; align-items: center; gap: 8px; padding: 11px 12px 9px; }
.cxa-kb-kopf::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--kb-ton, var(--cxa-text-3)); flex: none; }
.cxa-kb-kopf h3 { font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--cxa-text); }
.cxa-kb-kopf .anzahl { font-size: 11.5px; font-weight: 700; color: var(--cxa-text-3); }
.cxa-kb-kopf .summe { margin-left: auto; font-size: 11.5px; font-weight: 650; color: var(--cxa-text-2); font-variant-numeric: tabular-nums; }
.cxa-kb-spalte.ton-ok { --kb-ton: var(--cxa-ok); }
.cxa-kb-spalte.ton-warn { --kb-ton: var(--cxa-warn); }
.cxa-kb-spalte.ton-fehler { --kb-ton: var(--cxa-fehler); }
.cxa-kb-spalte.ton-info { --kb-ton: var(--cxa-info); }
.cxa-kb-spalte.ton-marke { --kb-ton: var(--cxa-marke); }
.cxa-kb-spalte.ton-akzent { --kb-ton: var(--cxa-akzent); }
.cxa-kb-karten { display: flex; flex-direction: column; gap: 7px; padding: 2px 8px 10px; overflow-y: auto; flex: 1; min-height: 60px; }
.cxa-kb-karte {
  position: relative;
  padding: 11px 12px;
  background: var(--cxa-flaeche);
  border: 1px solid var(--cxa-linie); border-radius: var(--cxa-radius);
  box-shadow: 0 1px 2px rgba(16, 28, 45, .07);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  /* Touch: Wischen scrollt in jede Richtung, Ziehen erst nach kurzem Halten (drag.js halten) */
  touch-action: manipulation;
  cursor: grab;
  transition: border-color var(--cxa-tempo), box-shadow var(--cxa-tempo), transform var(--cxa-tempo);
}
.cxa-kb-karte:hover { border-color: rgba(16, 28, 45, .28); box-shadow: var(--cxa-schatten); }
.cxa-kb-karte.cxa-zieht { opacity: .3; }
.cxa-kb-karte.cxa-bereit { transform: scale(1.03); box-shadow: var(--cxa-schatten-2); border-color: var(--cxa-akzent); }
.cxa-kb-karte.cxa-geist { cursor: grabbing; transform: rotate(1.5deg); box-shadow: var(--cxa-schatten-3); opacity: .96; }
.cxa-kb-karte .kb-titel { display: block; font-weight: 650; font-size: 13.5px; line-height: 1.3; padding-right: 26px; }
.cxa-kb-karte .kb-unter { display: block; color: var(--cxa-text-2); font-size: 12px; margin-top: 2px; }
.cxa-kb-karte .kb-fuss { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 9px; font-size: 11.5px; color: var(--cxa-text-3); }
.cxa-kb-karte .kb-fuss .rechts { margin-left: auto; font-weight: 650; color: var(--cxa-text-2); font-variant-numeric: tabular-nums; }
.cxa-kb-schieben {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 4px; background: none; color: var(--cxa-text-3);
  opacity: 0; transition: opacity var(--cxa-tempo), background var(--cxa-tempo);
}
.cxa-kb-karte:hover .cxa-kb-schieben, .cxa-kb-karte:focus-within .cxa-kb-schieben { opacity: 1; }
.cxa-kb-schieben:hover { background: var(--cxa-flaeche-2); color: var(--cxa-text); }
.cxa-kb-schieben .cxa-icon { width: 16px; height: 16px; }
@media (hover: none) { .cxa-kb-schieben { opacity: 1; } }
.cxa-kb-leer { padding: 18px 8px; text-align: center; font-size: 12px; color: var(--cxa-text-3); }
@media (max-width: 760px) {
  .cxa-kb { grid-auto-columns: 82%; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--cxa-abstand)); padding: 0 var(--cxa-abstand) 6px; scroll-padding: 0 var(--cxa-abstand); }
  .cxa-kb-spalte { scroll-snap-align: start; max-height: none; }
}
.cxa-ziel-liste { display: grid; gap: 6px; }
.cxa-ziel-liste .cxa-btn { justify-content: flex-start; height: 44px; }
.cxa-ziel-liste .cxa-btn[aria-current='true'] { background: var(--cxa-marke-hell); border-color: var(--cxa-marke); }

/* ── Ausbaustufen und Demo ───────────────────────────────────────────── */
.cxa-stufe-marke {
  display: inline-flex; align-items: center; gap: .3em; height: 17px; padding: 0 6px;
  border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: rgba(255, 127, 80, .18); color: var(--cxa-akzent);
}
.cxa-flaeche .cxa-stufe-marke { background: var(--cxa-akzent-hell); color: var(--cxa-akzent-dunkel); }
.cxa-stufen-schalter { display: flex; align-items: center; gap: 8px; }
.cxa-stufen-schiene { display: none; padding: 12px 18px; border-top: 1px solid rgba(255, 255, 255, .07); }
.cxa-stufen-schiene .cxa-schalter { background: rgba(255, 255, 255, .08); }
.cxa-stufen-schiene .cxa-schalter button { color: var(--cxa-schiene-text); }
.cxa-stufen-schiene .cxa-schalter button[aria-pressed='true'] { background: var(--cxa-schiene-2); color: #fff; }
@media (max-width: 900px) {
  .cxa-kopf .cxa-stufen-schalter { display: none; }
  .cxa-stufen-schiene { display: block; }
}
/* Alles einer hoeheren Stufe als gewaehlt bekommt diese Klasse, z. B. fuer Bausteine in Basis-Ansichten */
.cxa-ausser-stufe { position: relative; }
.cxa-ausser-stufe::after {
  content: attr(data-stufe-text); position: absolute; top: 8px; right: 8px;
  padding: 2px 7px; border-radius: 3px; font-size: 10px; font-weight: 700;
  background: var(--cxa-akzent-hell); color: var(--cxa-akzent-dunkel);
}

/* ── Vor der App: Anmelden, neues Passwort, Laden, Fehler (anmeldung.js) ── */
.cxa-vorab {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(120% 70% at 50% 0%, var(--cxa-schiene-2), transparent 70%),
    var(--cxa-schiene);
}
.cxa-vorab-karte {
  width: 100%; max-width: 380px;
  padding: 28px 26px 24px;
  background: var(--cxa-flaeche);
  border-radius: var(--cxa-radius-gr);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  animation: cxa-heben .25s ease-out;
}
.cxa-vorab-marke { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.cxa-vorab-marke img { max-height: 36px; width: auto; }
.cxa-vorab-marke b { display: block; font-size: 15px; font-weight: 700; line-height: 1.15; }
.cxa-vorab-marke small { display: block; font-size: 11.5px; color: var(--cxa-text-3); }
.cxa-vorab-karte h1 { font-size: var(--cxa-t-titel); font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.cxa-vorab-text { color: var(--cxa-text-2); margin-bottom: 16px; }
.cxa-vorab-karte .cxa-formular { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.cxa-vorab-karte .cxa-btn.breit { width: 100%; justify-content: center; }
.cxa-vorab-karte > .cxa-btn.breit + .cxa-btn.breit { margin-top: 8px; }
.cxa-vorab-fehler { min-height: 1.4em; margin: -2px 0 0; font-size: var(--cxa-t-klein); color: var(--cxa-fehler-text); }
.cxa-vorab-fehler:empty { min-height: 0; margin: 0; }
.cxa-vorab-laedt { display: flex; align-items: center; gap: 10px; color: var(--cxa-text-2); }
.cxa-kreisel {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid var(--cxa-linie); border-top-color: var(--cxa-marke);
  animation: cxa-drehen .8s linear infinite;
}
@keyframes cxa-drehen { to { transform: rotate(360deg); } }
.cxa-btn[aria-busy="true"] { cursor: progress; opacity: .7; }

.cxa-abmelden {
  margin-left: auto; flex: none;
  display: grid; place-items: center; width: 30px; height: 30px;
  border: 0; border-radius: var(--cxa-radius); background: none;
  color: var(--cxa-schiene-text); cursor: pointer;
}
.cxa-abmelden:hover, .cxa-abmelden:focus-visible { background: var(--cxa-schiene-2); color: var(--cxa-schiene-aktiv); }
@media (prefers-reduced-motion: reduce) { .cxa-vorab-karte, .cxa-kreisel { animation: none; } }

/* ── Startseite (startseite.js) ──────────────────────────────────────── */
.cxa-start-kopf { display: flex; justify-content: flex-end; margin-bottom: -6px; }
.cxa-start-raster { align-items: start; }
.cxa-start-raster > .breit { grid-column: 1 / -1; }
.cxa-start-gruppe h3 { font-size: var(--cxa-t-klein); font-weight: 700; color: var(--cxa-text-2); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.cxa-start-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cxa-start-zeile {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 6px 4px 10px;
  border: 1px solid var(--cxa-linie); border-radius: var(--cxa-radius); background: var(--cxa-flaeche);
  cursor: grab; touch-action: pan-y; user-select: none;
  transition: border-color var(--cxa-tempo), background var(--cxa-tempo);
}
.cxa-start-zeile:hover { border-color: var(--cxa-marke-hell); }
.cxa-start-zeile:focus-visible { outline: 2px solid var(--cxa-akzent); outline-offset: 2px; }
.cxa-start-zeile .griff { display: inline-flex; color: var(--cxa-text-3); }
.cxa-start-zeile input { width: 18px; height: 18px; margin: 0; accent-color: var(--cxa-marke); cursor: pointer; }
.cxa-start-zeile .titel { flex: 1; min-width: 0; font-weight: 600; }
.cxa-start-zeile.aus .titel { color: var(--cxa-text-3); text-decoration: line-through; }
.cxa-start-zeile.cxa-ueber { border-color: var(--cxa-akzent); background: var(--cxa-akzent-hell); }
.cxa-start-zeile.cxa-zieht { opacity: .35; }
.cxa-start-zeile.cxa-geist { cursor: grabbing; box-shadow: var(--cxa-schatten-3); opacity: .95; }
.cxa-start-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--cxa-linie-zart); }
.cxa-start-knoepfe .rechts { flex: 1; }
