/* AVB-Analyse – Oberfläche
   Dunkler Rahmen, helle abgerundete Arbeitsfläche, Karten ohne Linien, Pillen für Menü und Filter.
   Farbe nur für Status (Markierungsfarben mit validate_palette.js geprüft, Schrift auf Statusflächen
   mit WCAG-Kontrast >= 5:1) und eine Akzentfarbe (Limette) für Markierungen. */

:root {
  color-scheme: light;
  --rahmen: #2b2b29;
  --leinwand: #e4e3de;
  --karte: #f8f8f5;
  --karte-2: #efeeea;
  --weiss: #ffffff;
  --pille: #d9d8d3;
  --pille-hover: #ebeae6;
  --linie: rgba(31, 31, 29, 0.08);
  --text: #1f1f1d;
  --text-2: #5e5d59;
  --text-3: #6f6e69;          /* nur auf Karten */
  --text-hell: #f3f3ef;
  --akzent: #e3f24f;
  --markierung: rgba(222, 240, 50, 0.62);
  --schatten-klein: 0 1px 3px rgba(0, 0, 0, 0.08);
  --schatten: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --schatten-panel: 0 24px 70px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius-l: 28px;
  --radius-m: 22px;
  --radius-s: 14px;
  --kopfhoehe: 68px;
  --schrift: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Status: Fläche | Schrift | Markierung */
  --st-gedeckt-flaeche: #d6eedb;        --st-gedeckt-text: #1d6a3a;        --st-gedeckt: #2e9d5c;
  --st-teilweise-flaeche: #f4ebc3;      --st-teilweise-text: #715100;      --st-teilweise: #e0a800;
  --st-bedingt-flaeche: #f6dccb;        --st-bedingt-text: #8a3f12;        --st-bedingt: #d8692c;
  --st-optional-flaeche: #d6e6f9;       --st-optional-text: #1e5799;       --st-optional: #3b82d6;
  --st-nicht_gedeckt-flaeche: #f4d5d5;  --st-nicht_gedeckt-text: #972b2b;  --st-nicht_gedeckt: #d24848;
  --st-unklar-flaeche: #e3ddf5;         --st-unklar-text: #54468a;         --st-unklar: #8a73d6;
  --st-nicht_genannt-flaeche: #f8e7e7;  /* gleiche Farbe wie "ausgeschlossen", heller und schraffiert */
  --schraffur-nicht_genannt: repeating-linear-gradient(135deg, rgba(210, 72, 72, 0.16) 0 2px, transparent 2px 7px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--rahmen); color: var(--text);
  font: 14px/1.55 var(--schrift); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration-color: rgba(31, 31, 29, 0.25); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[hidden] { display: none !important; }
button { font-family: inherit; }
h1, h2, h3 { margin: 0; color: var(--text); }
p { margin: 0 0 10px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.leise { color: var(--text-2); }
.klein { font-size: 12.5px; }
.icon { width: 16px; height: 16px; flex: none; }
.glyph { width: 10px; height: 10px; flex: none; }
.code { font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--text-3); white-space: nowrap; }
a.code { text-decoration: none; }
a.code:hover { color: var(--text); text-decoration: underline; }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
  background: var(--rahmen); color: var(--text-hell); font-size: 10.5px; font-weight: 600; white-space: nowrap; letter-spacing: 0.01em;
}
.tag.hell { background: var(--karte-2); color: var(--text-2); }

/* ------------------------------------------------------------------ Rahmen, Reiter, Menü */
.app { height: 100vh; display: flex; flex-direction: column; padding: 10px 12px 12px; }
.rahmenkopf { flex: none; height: var(--kopfhoehe); display: flex; align-items: stretch; justify-content: space-between; gap: 24px; }
.reiter {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 8px 30px 0 11px;
  background: var(--leinwand); border-radius: 30px 30px 0 0;
}
.reiter::after {
  content: ""; position: absolute; right: -28px; bottom: 0; width: 28px; height: 28px;
  background: radial-gradient(circle at 100% 0, transparent 27.5px, var(--leinwand) 28px);
}
.logo {
  width: 46px; height: 46px; border-radius: 50%; background: var(--weiss); color: var(--text);
  display: grid; place-items: center; box-shadow: var(--schatten-klein); transition: transform 0.15s ease;
}
.logo:hover { transform: scale(1.04); }
.logo svg { width: 24px; height: 24px; }
.reiter-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; white-space: nowrap; }
.reiter-produkt { font-size: 11.5px; font-weight: 500; color: var(--text-2); margin: 5px 0 0 12px; }
/* Bereich: Privat oder Gewerbe, als Schalter mit zwei Feldern */
.bereichswahl { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--pille); }
.bereichswahl a {
  display: inline-flex; align-items: center; height: 30px; padding: 0 16px; border-radius: 999px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.bereichswahl a:hover { color: var(--text); }
.bereichswahl a[aria-current="true"] { background: var(--weiss); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.14); }
.menue { display: flex; align-items: center; gap: 8px; padding: 0 4px 8px; }
.menuepille {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px 0 15px; border-radius: 999px;
  background: var(--pille); color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.menuepille:hover { background: var(--pille-hover); }
.menuepille[aria-current="page"] { background: var(--weiss); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25); }
.menuepille:focus-visible, .logo:focus-visible { outline-color: var(--akzent); }

.leinwand {
  position: relative; flex: 1; min-height: 0; overflow: auto; background: var(--leinwand);
  border-radius: 0 var(--radius-l) var(--radius-l) var(--radius-l); padding: 28px 32px 48px;
}
.leinwand > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.leinwand.breit > * { max-width: 1520px; }
.leinwand.voll { display: flex; flex-direction: column; overflow: hidden; overflow-y: auto; padding-bottom: 16px; }  /* passt die Seite nicht ins Fenster, scrollt sie */
.leinwand.voll > * { flex: none; max-width: none; width: 100%; }
.leinwand.voll > .matrix-rahmen { flex: 1 1 auto; min-height: 300px; }
/* Matrix und Vergleich einer Sparte: Der Teil zählt im Layout nicht (display: contents), seine Leisten und die Tabelle
   stehen wie direkt in der Seite; die Tabelle füllt den Rest und scrollt allein. Mehrere Sparten untereinander
   (mehrteilig): die Seite scrollt, jede Tabelle in ihrem Rahmen, der Spaltenkopf bleibt stehen. */
.leinwand.voll > .seitenteil { display: contents; }
.leinwand.voll > .seitenteil > * { flex: none; max-width: none; width: 100%; }
.leinwand.voll > .seitenteil > .matrix-rahmen { flex: 1 1 auto; min-height: 300px; }
.leinwand.mehrteilig { overflow-x: hidden; }  /* wie "voll": zu breite Leisten laufen nicht seitlich aus der Seite */
.leinwand.mehrteilig > * { max-width: none; }
.leinwand.mehrteilig .matrix-rahmen { max-height: calc(100vh - 190px); }
.leinwand > .panel, .leinwand.voll > .panel { max-width: none; width: min(580px, calc(100vw - 52px)); margin: 0; }

/* ------------------------------------------------------------------ Seitenkopf */
.brotkrumen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 12.5px; color: var(--text-2); }
.brotkrumen a { color: var(--text-2); text-decoration: none; }
.brotkrumen a:hover { color: var(--text); text-decoration: underline; }
.brotkrumen .trenner { opacity: 0.5; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; margin-bottom: 22px; }
.seitenkopf h1 { font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; }
.ueberzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.untertitel { color: var(--text-2); margin: 8px 0 0; max-width: 720px; }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kennzahlen-leiste { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 0; }
.kennzahlen-leiste > div { display: flex; flex-direction: column; gap: 3px; }
.kennzahlen-leiste dt { font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.kennzahlen-leiste dd { margin: 0; font-size: 26px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; }
.kennzahlen-leiste dd small { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
/* Seiten mit mehreren Sparten (Inhalt und Betriebsunterbrechung): je Sparte ein Teil mit eigenem Kopf, durch eine Linie getrennt */
.seitenteil + .seitenteil, .seitenkopf + .seitenteil { margin-top: 30px; }
.teilkopf { padding-top: 22px; border-top: 1px solid var(--linie); margin-bottom: 16px; }
.teilkopf h2 { font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.teilkopf .kennzahlen-leiste dd { font-size: 22px; }

/* ------------------------------------------------------------------ Karten */
.karte { background: var(--karte); border-radius: var(--radius-m); padding: 22px 24px; margin-bottom: 16px; }
.karte.schmal { max-width: 820px; }
.karte.dunkel { background: var(--rahmen); color: var(--text-hell); }
.karte.dunkel .abschnittstitel { color: var(--weiss); }
.karte.dunkel .leise { color: #b9b8b2; }
.tabellenkarte { padding: 20px 8px 8px; }
.tabellenkarte > .abschnittstitel, .tabellenkarte > p { padding: 0 16px; }
.abschnittstitel { font-size: 16px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; }
.unterabschnitt { font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
.raster { display: grid; gap: 16px; margin-bottom: 16px; }
.raster.zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster > .karte { margin-bottom: 0; }
.leerzustand { max-width: 640px; }
.leerzustand h1 { font-size: 24px; font-weight: 600; margin-bottom: 10px; }

/* ------------------------------------------------------------------ Knöpfe, Pillen, Formulare */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border: 0; border-radius: 999px; background: var(--text); color: var(--weiss);
  font: 600 13.5px/1 var(--schrift); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.knopf:hover { background: #3c3c3a; }
.knopf:active { transform: scale(0.98); }
.knopf.zweitrangig { background: var(--weiss); color: var(--text); box-shadow: var(--schatten-klein); }
.knopf.zweitrangig:hover { background: var(--pille-hover); }
.knopf.akzent { background: var(--akzent); color: var(--text); }
.knopf.klein { height: 32px; padding: 0 14px; font-size: 12.5px; gap: 6px; }
.knopf[disabled] { opacity: 0.6; cursor: progress; }
.knopf[disabled][data-gesperrt] { cursor: not-allowed; }
.kreisknopf {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--karte-2); color: var(--text); cursor: pointer; transition: background-color 0.15s ease;
}
.kreisknopf:hover { background: var(--pille); }

.pillen { display: flex; flex-wrap: wrap; gap: 6px; }
.pille {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--pille); color: var(--text); font: 500 13px/1 var(--schrift); white-space: nowrap; cursor: pointer;
  text-decoration: none; transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.pille:hover { background: var(--pille-hover); }
.pille[aria-pressed="true"], .pille[aria-current="true"] { background: var(--weiss); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.09); }
.pille .zahl-klein { font-size: 11.5px; color: var(--text-2); }
/* Sparte: Schalterleiste wie Privat/Gewerbe (Navigation), die Pillen darunter filtern nur */
.spartenwahl { display: flex; margin-bottom: 18px; }
.spartenwahl.mittig { justify-content: center; }
.spartenleiste {  /* bricht auf schmalen Fenstern um; einzeilig wirkt der Radius wie eine Pille */
  display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 4px; border-radius: 22px; background: var(--pille);
}
.spartenleiste .pille { flex: none; height: 32px; padding: 0 15px; background: transparent; }
.spartenleiste .pille:hover { background: var(--pille-hover); }
.spartenleiste .pille[aria-current="true"] { background: var(--weiss); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.14); }
.spartenleiste .pille.ohne-katalog:not([aria-current="true"]) { color: var(--text-2); }

input[type="text"], input[type="url"], input[type="search"], select {
  height: 40px; width: 100%; padding: 0 14px; border: 0; border-radius: var(--radius-s);
  background: var(--weiss); color: var(--text); font: 13.5px var(--schrift);
  box-shadow: inset 0 0 0 1px rgba(31, 31, 29, 0.1);
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.suchpille { position: relative; display: flex; align-items: center; flex: 0 1 270px; min-width: 200px; }
.suchpille .icon { position: absolute; left: 14px; color: var(--text-2); pointer-events: none; }
.suchpille input { border-radius: 999px; padding-left: 40px; box-shadow: none; height: 38px; }

.schalter { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; }
.schalter input {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 36px; height: 22px; margin: 0;
  border-radius: 999px; background: var(--pille); cursor: pointer; transition: background-color 0.15s ease;
}
.schalter input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--weiss); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s ease;
}
.schalter input:checked { background: var(--text); }
.schalter input:checked::after { transform: translateX(14px); }
.karte.dunkel .schalter input { background: #4a4a47; }

/* ------------------------------------------------------------------ Werkzeugleiste (Matrix, Listen) */
.werkzeugleiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 12px; }
.werkzeugleiste .rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.filterzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.trefferzahl { font-size: 12.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.filterzeile .trefferzahl { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 4px; border: 0; border-radius: 999px;
  background: var(--chip-flaeche); color: var(--chip-text); font: 600 12.5px/1 var(--schrift); cursor: pointer;
  box-shadow: inset 0 0 0 0 var(--chip-text); transition: box-shadow 0.15s ease, opacity 0.15s ease;
}
.chips.aktiv .chip:not([aria-pressed="true"]) { opacity: 0.55; }
.chip:hover { opacity: 1 !important; }
.chip[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--chip-text); }
.spaltenwahl { position: relative; }
.spaltenwahl summary { list-style: none; }
.spaltenwahl summary::-webkit-details-marker { display: none; }
.spaltenwahl summary .icon:last-child { width: 14px; height: 14px; color: var(--text-2); }
.spaltenwahl[open] summary { background: var(--weiss); }
.spaltenwahl-liste {
  position: absolute; z-index: 25; top: 44px; right: 0; min-width: 320px; max-height: 60vh; overflow: auto;
  padding: 8px; background: var(--weiss); border-radius: 18px; box-shadow: var(--schatten-panel);
}
.spaltenwahl-liste label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; font-size: 13px; cursor: pointer; }
.spaltenwahl-liste label:hover { background: var(--karte-2); }
.spaltenwahl-liste input { accent-color: var(--text); width: 16px; height: 16px; margin: 0; }
.spaltenwahl-liste small { margin-left: auto; padding-left: 12px; color: var(--text-3); }
.spaltenwahl-aktionen { display: flex; gap: 6px; padding: 8px 6px 2px; margin-top: 4px; border-top: 1px solid var(--linie); }

/* ------------------------------------------------------------------ Status */
.st-gedeckt { --chip-flaeche: var(--st-gedeckt-flaeche); --chip-text: var(--st-gedeckt-text); --st-farbe: var(--st-gedeckt); }
.st-teilweise { --chip-flaeche: var(--st-teilweise-flaeche); --chip-text: var(--st-teilweise-text); --st-farbe: var(--st-teilweise); }
.st-bedingt { --chip-flaeche: var(--st-bedingt-flaeche); --chip-text: var(--st-bedingt-text); --st-farbe: var(--st-bedingt); }
.st-optional { --chip-flaeche: var(--st-optional-flaeche); --chip-text: var(--st-optional-text); --st-farbe: var(--st-optional); }
.st-nicht_gedeckt { --chip-flaeche: var(--st-nicht_gedeckt-flaeche); --chip-text: var(--st-nicht_gedeckt-text); --st-farbe: var(--st-nicht_gedeckt); }
.st-unklar { --chip-flaeche: var(--st-unklar-flaeche); --chip-text: var(--st-unklar-text); --st-farbe: var(--st-unklar); }
.st-ausgeschlossen { --chip-flaeche: var(--st-nicht_gedeckt-flaeche); --chip-text: var(--st-nicht_gedeckt-text); --st-farbe: var(--st-nicht_gedeckt); }
.st-laut_police { --chip-flaeche: var(--st-optional-flaeche); --chip-text: var(--st-optional-text); --st-farbe: var(--st-optional); }
.st-nicht_vereinbart { --chip-flaeche: var(--st-nicht_gedeckt-flaeche); --chip-text: var(--st-nicht_gedeckt-text); --st-farbe: var(--st-nicht_gedeckt); }
.st-nicht_genannt { --chip-flaeche: var(--st-nicht_genannt-flaeche); --chip-text: var(--st-nicht_gedeckt-text); --st-farbe: var(--st-nicht_gedeckt); }
.chip.st-nicht_genannt, .badge.st-nicht_genannt, .kachel.st-nicht_genannt, .zelle.st-nicht_genannt > a {
  background: var(--schraffur-nicht_genannt), var(--chip-flaeche);
}
.profil .segment.st-nicht_genannt, .farbfeld.st-nicht_genannt {
  background: repeating-linear-gradient(135deg, var(--st-nicht_gedeckt) 0 2px, var(--st-nicht_genannt-flaeche) 2px 4px);
}

.punkt { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.82); color: var(--chip-text); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px 0 3px; border-radius: 999px;
  background: var(--chip-flaeche); color: var(--chip-text); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge .punkt { width: 20px; height: 20px; }
/* Lange Texte (z. B. "nicht vereinbart, es gilt die gesetzliche Regel …") umbrechen statt aus schmalen Spalten zu laufen */
.badge.gross {
  height: auto; min-height: 34px; max-width: 100%; padding: 4px 15px 4px 4px; border-radius: 17px;
  font-size: 13.5px; line-height: 1.3; gap: 8px; white-space: normal;
}
.badge.gross .punkt { width: 26px; height: 26px; }
.badge.gross .glyph { width: 12px; height: 12px; }
.farbfeld { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--st-farbe); }

.profil { display: flex; gap: 2px; height: 6px; margin-top: 10px; }
.profil .segment { min-width: 3px; background: var(--st-farbe); }
.profil .segment:first-child { border-radius: 999px 0 0 999px; }
.profil .segment:last-child { border-radius: 0 999px 999px 0; }
.profil .segment:only-child { border-radius: 999px; }

.pruefung { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--st-gedeckt-text); }
.pruefung::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pr-unscharf, .pr-andere_klausel { color: var(--st-teilweise-text); }
.pr-nicht_gefunden { color: var(--st-nicht_gedeckt-text); }

/* ------------------------------------------------------------------ Matrix und Vergleich */
.matrix-rahmen { overflow: auto; background: var(--karte); border-radius: var(--radius-m); }
.matrix, .vergleich { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.matrix th, .matrix td, .vergleich th, .vergleich td { text-align: left; vertical-align: top; }
.matrix thead th, .vergleich thead th {
  position: sticky; top: 0; z-index: 3; background: var(--karte); padding: 16px 8px 12px; font-weight: 400; vertical-align: bottom;
  box-shadow: 0 1px 0 var(--linie);
}
.matrix thead .ecke, .vergleich thead .ecke { left: 0; z-index: 5; padding-left: 20px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.spaltenkopf { width: 176px; min-width: 176px; max-width: 176px; }
.vergleich .spaltenkopf { width: 270px; min-width: 270px; max-width: 320px; }
.spaltenkopf a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.sk-titel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.sk-bezeichnung { font-size: 11.5px; line-height: 1.35; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sk-stand { font-size: 11px; color: var(--text-3); }
.spaltenkopf a:hover .sk-titel { text-decoration: underline; text-underline-offset: 3px; }

.codezelle { position: sticky; left: 0; z-index: 2; background: var(--karte); width: 276px; min-width: 276px; max-width: 276px; padding: 9px 14px 9px 20px; font-weight: 400; }
.codezelle a { display: flex; flex-direction: column; gap: 1px; text-decoration: none; }
.codezelle .code { font-size: 10.5px; }
.codezelle .codename { font-size: 13px; font-weight: 500; line-height: 1.35; }
.codezelle a:hover .codename { text-decoration: underline; text-underline-offset: 3px; }
.vermerk { display: block; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }

.gruppenzeile th { position: sticky; left: 0; z-index: 1; background: var(--karte); padding: 16px 0 6px; }
.gruppenzeile th span { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 8px; padding-left: 20px; font-size: 13.5px; font-weight: 600; }
.gruppenzeile th span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }
.gruppenzeile th small { font-size: 12px; font-weight: 500; color: var(--text-3); }

.matrix td.zelle { padding: 3px; }
.zelle > a, .zelle.leer > span {
  display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 58px; padding: 7px 10px 8px 6px;
  border-radius: 14px; background: var(--chip-flaeche); color: var(--text); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}
.zelle.leer > span { background: var(--karte-2); color: var(--text-3); font-size: 11.5px; justify-content: center; padding-left: 12px; }
.zelle > a:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); }
.zelle > a[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--text); }
.zelle-status { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--chip-text); }
.zelle-status .punkt { width: 20px; height: 20px; }
.zelle-hinweis { margin-left: auto; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--text); color: var(--akzent); font-size: 10px; font-weight: 700; }
.zelle-text { padding-left: 4px; font-size: 11.5px; line-height: 1.4; color: #4f4e4a; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.zelle.gedimmt > a { opacity: 0.25; }

.legende { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.legende-eintrag { display: inline-flex; align-items: center; gap: 7px; }
.legende-text { flex-basis: 100%; font-weight: 400; font-size: 12px; }

.vergleich tbody td, .vergleich tbody th.codezelle { border-top: 1px solid var(--linie); }
.vergleichszelle { width: 270px; padding: 14px 16px 14px 10px; }
.merkmale { margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.merkmale li {
  padding: 3px 0 3px 12px; position: relative; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.merkmale li::before { content: ""; position: absolute; left: 1px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
.merkmale strong { font-weight: 600; }
.merkmale span { color: var(--text-2); }
.vergleichszelle .klein { margin: 10px 0 0; }
.mehr { display: block; width: fit-content; margin-top: 10px; font-size: 12.5px; font-weight: 500; color: var(--text); }

.auswahlkarte { padding: 0; }
.auswahlkarte > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px 12px 20px; font-size: 13px; }
.auswahlkarte > summary::-webkit-details-marker { display: none; }
.auswahlkarte > summary .pille { height: 30px; padding: 0 13px; background: var(--weiss); cursor: inherit; }
.auswahlkarte > summary .aendern { margin-left: auto; }
.auswahlkarte[open] > summary .aendern { display: none; }
.auswahlkarte > form { padding: 6px 20px 20px; }
.vergleichswahl fieldset { border: 0; margin: 0; padding: 0; }
.vergleichswahl legend { padding: 0; margin-bottom: 12px; font-weight: 600; }
.wahlgitter { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px;
  background: var(--karte-2); cursor: pointer; transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.wahl:hover { background: var(--pille); }
.wahl input { appearance: none; -webkit-appearance: none; margin: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--weiss); display: grid; place-items: center; flex: none; cursor: pointer; }
.wahl input:checked { background: var(--text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.8 8.4 6.6 11.2l5.6-6.2' fill='none' stroke='%23e3f24f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.wahl:has(input:checked) { background: var(--weiss); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08); }
.wahl span { display: flex; flex-direction: column; line-height: 1.25; }
.wahl strong { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.wahl small { font-size: 11px; color: var(--text-3); }
.formularzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.ergebniszeile { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--text-2); }

/* ------------------------------------------------------------------ Seitenleiste */
.panel {
  position: fixed; z-index: 40; top: calc(var(--kopfhoehe) + 26px); right: 26px; bottom: 26px; width: min(580px, calc(100vw - 52px));
  display: flex; flex-direction: column; overflow: hidden; background: var(--weiss); border-radius: 26px; box-shadow: var(--schatten-panel);
  animation: einblenden 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes einblenden { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-kopf { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 24px; border-bottom: 1px solid var(--linie); }
.panel-voll { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.panel-inhalt { flex: 1; overflow: auto; padding: 24px 26px 48px; }
.panel-inhalt.laedt { opacity: 0.45; transition: opacity 0.2s; }

/* ------------------------------------------------------------------ Bewertung */
.bewertung-kopf { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--linie); }
.bewertung-kopf .ueberzeile { color: var(--text-3); }
.bewertung-kopf h2 { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 14px; }
.bewertung-kopf h2:focus { outline: none; }
.statuszeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.grund { font-size: 13px; color: var(--text-2); }
.baustein { margin: 14px 0 0; font-size: 13px; }
.warnhinweis { margin-top: 14px; margin-bottom: 0; padding: 10px 14px; border-radius: var(--radius-s); background: var(--st-teilweise-flaeche); color: var(--st-teilweise-text); font-size: 12.5px; }
.abschnitt { margin-bottom: 24px; }
.abschnitt h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.anzahl { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--karte-2); font-size: 11px; font-weight: 600; color: var(--text-2); }
.begruendung { line-height: 1.65; color: #3a3a37; }
.einschraenkungen, .belege, .linkliste, .verlauf { list-style: none; margin: 0; padding: 0; }
.einschraenkungen > li { padding: 14px 0; border-top: 1px solid var(--linie); }
.einschraenkungen > li:first-child { border-top: 0; padding-top: 0; }
.e-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.e-art { font-weight: 600; }
.e-betrag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--text); color: var(--akzent); font-size: 12px; font-weight: 600; }
.belege > li + li { margin-top: 14px; }
.beleg { margin: 10px 0 0; }
.beleg blockquote, .zitat { margin: 0; padding: 13px 16px; border-radius: 16px; background: var(--karte-2); font-size: 14px; line-height: 1.6; color: var(--text); }
.beleg figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; padding: 0 4px; font-size: 12px; color: var(--text-3); }
.rolle { font-weight: 600; color: var(--text-2); }
.fundstelle { font-weight: 500; }
.pdf-link { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--text); color: var(--weiss); font-weight: 600; text-decoration: none; }
.pdf-link:hover { background: #3c3c3a; }
.pdf-link .icon { width: 14px; height: 14px; }
.pruefhinweise ul { margin: 0; padding-left: 18px; color: var(--st-bedingt-text); }
.aufklapper { border-top: 1px solid var(--linie); padding: 14px 0; }
.aufklapper summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.aufklapper[open] summary { margin-bottom: 12px; }
.regeln { margin: 0; display: grid; gap: 12px; }
.regeln > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: start; }
.regeln dt { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.regeln dd { margin: 0; }
.meta { margin: 0; display: grid; }
.meta > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--linie); font-size: 13px; }
.meta > div:first-child { border-top: 0; }
.meta dt { color: var(--text-3); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.meta.kompakt > div { grid-template-columns: 92px minmax(0, 1fr); }
.bewertung > .meta { margin-top: 10px; padding-top: 4px; border-top: 1px solid var(--linie); }
.verlauf li { display: flex; align-items: center; gap: 10px; padding: 5px 0; }

/* ------------------------------------------------------------------ PDF-Ansicht */
.pdf-ansicht { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 24px; align-items: start; }
.pdf-leiste { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pdf-datei { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); overflow-wrap: anywhere; }
.pdf-seite { margin: 0 0 22px; }
.pdf-blatt { position: relative; width: 100%; max-width: 920px; overflow: hidden; background: #fff; border-radius: 16px; box-shadow: var(--schatten); }
.pdf-blatt img { display: block; width: 100%; height: 100%; }
.markierung { position: absolute; pointer-events: none; }
.markierung.zitat { background: var(--markierung); mix-blend-mode: multiply; border-radius: 3px; }
.markierung.klausel { border: 1.5px solid rgba(31, 31, 29, 0.45); border-radius: 8px; background: rgba(31, 31, 29, 0.025); }
.pdf-seite figcaption { margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.pdf-info { position: sticky; top: 0; }
.pdf-info .karte { padding: 22px; }
.info-titel { font-size: 22px; font-weight: 600; line-height: 1.2; margin: 2px 0 14px; }
.pdf-info .statuszeile { margin-bottom: 14px; }
.pdf-info .zitat { margin: 14px 0 16px; }
.klauseltext { white-space: pre-line; font-size: 13px; line-height: 1.65; max-height: 420px; overflow: auto; margin: 10px 0 14px; }
.klauseltext mark { background: var(--akzent); color: inherit; border-radius: 3px; padding: 0 1px; }
.blaettern { display: flex; justify-content: space-between; max-width: 920px; }
.linkliste li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--linie); font-size: 13px; }
.linkliste li:first-child { border-top: 0; }

/* ------------------------------------------------------------------ Listen und Tabellen */
.liste { width: 100%; border-collapse: collapse; font-size: 13px; }
.liste th { padding: 8px 14px 10px; border-bottom: 1px solid var(--linie); text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.liste td { padding: 12px 14px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.liste tbody tr:last-child td { border-bottom: 0; }
.liste tbody tr { transition: background-color 0.15s ease; }
.liste tbody tr:hover { background: rgba(31, 31, 29, 0.03); }
.liste td:first-child, .liste th:first-child { padding-left: 16px; }
.liste td:last-child, .liste th:last-child { padding-right: 16px; }
.liste td a:not(.knopf) { text-decoration: none; font-weight: 500; }
.liste td a:not(.knopf):hover { text-decoration: underline; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.liste th.zahl { text-align: right; }
.aktionen-zelle { white-space: nowrap; text-align: right; }
.aktionen-zelle a { font-weight: 500; }
.versicherer { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--rahmen); color: var(--weiss); font-size: 13px; font-weight: 600; }
.avatar.muster { background: var(--akzent); color: var(--text); }
.werkstatus { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.werkstatus::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pille); }
.ws-bewertet { color: var(--st-gedeckt-text); }
.ws-bewertet::before { background: var(--st-gedeckt); }
.ws-offen { color: var(--st-unklar-text); }
.ws-offen::before { background: var(--st-unklar); }

/* ------------------------------------------------------------------ Vollständigkeit */
.karte-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.karte-kopf .abschnittstitel { margin-bottom: 0; }
.grundlagen { margin-top: 14px; }
.grundlagen td { vertical-align: top; }
.knopfreihe { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 0; }
.vg-status { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.vg-offen { background: var(--st-unklar-flaeche); color: var(--st-unklar-text); }
.vg-fehlt { background: var(--st-nicht_gedeckt-flaeche); color: var(--st-nicht_gedeckt-text); }
.vg-vorhanden { background: var(--st-gedeckt-flaeche); color: var(--st-gedeckt-text); }
.vg-nicht_noetig { background: var(--karte-2); color: var(--text-2); }
.vs-formulare { margin: 18px 0 0; }
.grundlagen .zeilenkopf { font-weight: 400; text-align: left; }
.klauselstatus { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.klauselstatus li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-top: 1px solid var(--linie); }
.formulargitter.einspaltig { grid-template-columns: minmax(0, 1fr); align-content: start; }

/* ------------------------------------------------------------------ Police */
.karteninhalt { padding: 12px 16px 8px; }
.karteninhalt form { margin-top: 10px; }
.zuordnung { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.zuordnung label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.zuordnung select { min-width: 280px; max-width: 100%; }
.abgleich td, .abgleich th { vertical-align: top; }
.abgleich td:first-child { width: 28%; }
.abgleich td:nth-child(2) { width: 22%; }
.abgleich p { margin: 6px 0 0; }
.tag.warn { background: var(--st-teilweise-flaeche); color: var(--st-teilweise-text); }
.klein.ok { color: var(--st-gedeckt-text); }
.nowrap { white-space: nowrap; }
.abgleich .zeilenkopf { font-weight: 400; text-align: left; }
.definition-kurz { margin: 3px 0 0; font-size: 12px; color: var(--text-3); max-width: 640px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.katalogliste td { vertical-align: top; }
.katalogliste td:first-child { white-space: nowrap; }

.kacheln { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.kacheln.police-kacheln { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.kachel { display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 12px; border-radius: 18px; background: var(--chip-flaeche, var(--karte-2)); }
.kachel-wert { font-size: 26px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; color: var(--text); }
.kachel-text { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--chip-text, var(--text-2)); }
.verteilung + .verteilung { margin-top: 22px; }
.verteilung h3 { font-size: 14px; font-weight: 600; }
.verteilung .profil { margin: 10px 0 12px; height: 8px; }
.kennzahl-reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kennzahl { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 18px; background: var(--karte-2); }
.kennzahl-wert { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.kennzahl-text { font-size: 12px; font-weight: 500; color: var(--text-2); }

.schritte { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: schritt; }
.schritte li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; counter-increment: schritt; }
.schritte li::before { content: counter(schritt); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--akzent); color: var(--text); font-size: 12px; font-weight: 700; }
.schritte li span { flex: 1; min-width: 200px; }
code[data-kopieren], .leerzustand code {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); color: inherit; font: 500 12.5px var(--schrift); letter-spacing: 0.01em; cursor: copy; white-space: nowrap;
}
.leerzustand code { background: var(--karte-2); }
code.kopiert { background: var(--akzent); color: var(--text); }
.meldung { margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius-s); background: var(--karte); font-size: 13px; font-weight: 500; }
.meldung.erfolg { background: var(--st-gedeckt-flaeche); color: var(--st-gedeckt-text); }
.schlagworte { display: flex; flex-wrap: wrap; gap: 6px; }
.schlagwort { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--karte-2); font-size: 12.5px; }
.fliesstext { line-height: 1.7; }
.hinweiszeile { margin-top: 14px; margin-bottom: 0; }
/* Hinweise direkt auf der Arbeitsfläche: zentriert wie die übrigen Blöcke, Abstand nach unten statt nach oben */
.leinwand > .warnhinweis { margin-top: 0; margin-bottom: 12px; }

/* ------------------------------------------------------------------ Import */
.importformular { display: grid; gap: 16px; margin-top: 8px; }
.dateiwahl {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 104px; padding: 16px;
  border: 1.5px dashed rgba(31, 31, 29, 0.22); border-radius: var(--radius-m); background: var(--karte-2);
  color: var(--text-2); font-weight: 500; text-align: center; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dateiwahl:hover, .dateiwahl.ziehen { border-color: var(--text); color: var(--text); background: var(--weiss); }
.dateiwahl input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.formulargitter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.formulargitter label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.formulargitter .breit { grid-column: 1 / -1; }
.spartenformular { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 14px; }
.spartenformular label { display: grid; gap: 6px; flex: 1 1 220px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.einfache-liste { margin: 10px 0 0; padding-left: 18px; }
.einfache-liste li { margin: 4px 0; }

/* ------------------------------------------------------------------ Analyse */
.analyse-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.analyse-kopf .leise { max-width: 720px; }
.dauer { flex: none; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.karte:not(.dunkel) .dauer { background: var(--karte-2); }
.fortschritt { margin-top: 16px; }
.balken { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.karte:not(.dunkel) .balken { background: var(--karte-2); }
.balken span { display: block; height: 100%; min-width: 10px; border-radius: 999px; background: var(--akzent); transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.schrittliste { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.schrittliste li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.schritt-punkt { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.28); }
.karte:not(.dunkel) .schritt-punkt { border-color: var(--pille); }
.schritt-titel { font-weight: 600; }
.schritt-text { margin-left: auto; font-size: 12.5px; color: #b9b8b2; font-variant-numeric: tabular-nums; }
.karte:not(.dunkel) .schritt-text { color: var(--text-3); }
[data-status="laeuft"] .schritt-punkt { border-color: var(--akzent); }
[data-status="laeuft"] .schritt-punkt::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--akzent); animation: puls 1.4s ease-in-out infinite; }
[data-status="fertig"] .schritt-punkt, [data-status="uebersprungen"] .schritt-punkt { border: 0; background: var(--st-gedeckt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4 6.7 11l5.3-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
[data-status="uebersprungen"] .schritt-punkt { opacity: 0.5; }
[data-status="fehler"] .schritt-punkt { border: 0; background: var(--st-nicht_gedeckt); }
[data-status="teilweise"] .schritt-punkt, [data-status="wartet"] .schritt-punkt { border: 0; background: var(--st-teilweise); }
@keyframes puls { 0%, 100% { transform: scale(0.7); opacity: 0.6; } 50% { transform: scale(1); opacity: 1; } }
.ergebnis { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius-s); font-size: 13px; font-weight: 500; background: var(--karte-2); }
.ergebnis-fertig { background: var(--st-gedeckt-flaeche); color: var(--st-gedeckt-text); }
.ergebnis-teilweise, .ergebnis-wartet_auf_antworten { background: var(--st-teilweise-flaeche); color: var(--st-teilweise-text); }
.ergebnis-fehler { background: var(--st-nicht_gedeckt-flaeche); color: var(--st-nicht_gedeckt-text); }
.protokoll-rahmen { margin-top: 12px; }
.protokoll-rahmen summary { cursor: pointer; font-size: 12.5px; font-weight: 600; }
.protokoll { list-style: none; margin: 8px 0 0; padding: 10px 14px; border-radius: var(--radius-s); background: rgba(255, 255, 255, 0.06); font-size: 12.5px; line-height: 1.7; max-height: 220px; overflow: auto; }
.karte:not(.dunkel) .protokoll { background: var(--karte-2); }
.protokoll:empty::after { content: "Noch keine Einträge."; opacity: 0.6; }
.protokoll li::before { content: "·"; margin-right: 8px; opacity: 0.6; }
.zugang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; font-size: 13px; }
.zugang-punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--st-gedeckt); flex: none; }
.zugang.fehlt .zugang-punkt { background: var(--st-teilweise); }
.analyseformular { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.kommandozeile { margin-top: 16px; font-size: 13px; }
.kommandozeile summary { cursor: pointer; font-size: 12.5px; font-weight: 600; opacity: 0.8; }
.karte:not(.dunkel) code[data-kopieren] { background: var(--karte-2); }
.ws-laeuft { color: var(--text); font-weight: 600; text-decoration: none; }
.ws-laeuft::before { background: var(--akzent); box-shadow: 0 0 0 3px rgba(227, 242, 79, 0.35); }
.laufpille {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 16px 0 14px; margin-right: 6px; border-radius: 999px;
  background: rgba(227, 242, 79, 0.14); color: var(--akzent); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.laufpille:hover { background: rgba(227, 242, 79, 0.22); }
.puls { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--akzent); }
.puls::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--akzent); animation: puls 1.4s ease-in-out infinite; }

/* ------------------------------------------------------------------ Klauseln */
.dokumentblock { margin-bottom: 24px; }
.klauseln { list-style: none; margin: 0; padding: 6px 0; background: var(--karte); border-radius: var(--radius-m); }
.klausel { padding: 13px 22px; border-top: 1px solid var(--linie); }
.klausel:first-child { border-top: 0; }
.klausel:target { background: rgba(227, 242, 79, 0.25); }
.klausel.verzeichnis { opacity: 0.6; }
.klausel-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 4px; }
.klausel-label { font-weight: 600; }
.klausel-ueberschrift { font-weight: 500; }
.klausel-ort { font-size: 12px; color: var(--text-3); }
.klausel-link { margin-left: auto; font-size: 12.5px; font-weight: 500; }
.klausel-text { margin: 0; font-size: 13px; color: #3a3a37; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.klausel-text.offen { display: block; }

/* ------------------------------------------------------------------ Tooltip */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none; padding: 6px 11px; border-radius: 10px;
  background: var(--rahmen); color: var(--weiss); font-size: 12px; font-weight: 500; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px)); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------------------------ Kundenakte */
input[type="email"], input[type="tel"], input[type="date"], input[type="number"], textarea {
  height: 40px; width: 100%; padding: 0 14px; border: 0; border-radius: var(--radius-s);
  background: var(--weiss); color: var(--text); font: 13.5px var(--schrift);
  box-shadow: inset 0 0 0 1px rgba(31, 31, 29, 0.1);
}
textarea { height: auto; min-height: 72px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.kopfleiste { padding: 0 12px 6px; }
.kundenliste td { vertical-align: middle; }
.kundenname { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.liste td a.kundenname { color: inherit; }
.kundenname > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.kundenname small { font-size: 11.5px; color: var(--text-3); }
.kundenname:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.leerkarte .knopf { margin-top: 18px; }
.artwahl { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; border: 0; }
.mehrzeilig { white-space: pre-line; }
.kundenraster { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.abschnitt-kopf { margin-top: 8px; margin-bottom: 12px; }
/* Betriebsprofil-Assistent: nur Vorschau ohne Funktion (avb.assistent); sandfarben, damit er nicht wie ein Status wirkt */
.tag.vorschau { background: #efe7d8; color: #6a5631; }
.assistent-quellen { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; padding: 0; list-style: none; }
.assistent-quellen li { padding: 4px 10px; border-radius: 999px; background: var(--karte-2); font-size: 12px; color: var(--text-2); }
.assistent-zwischentitel { margin: 18px 0 2px; font-size: 13px; font-weight: 600; }
.assistent-funde { margin: 0 0 12px; padding: 0; list-style: none; }
.assistent-funde li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--linie); }
.assistent-funde .fund-datum { padding-top: 1px; font-size: 12px; color: var(--text-3); }
.assistent-funde p { margin: 0; font-size: 13px; line-height: 1.45; }
.assistent-funde .fund-folge { margin-top: 3px; font-size: 12px; color: var(--text-2); }
.assistent-notiz { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.frage-hinweis { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; padding: 6px 10px; border-radius: 10px; background: #f6f1e7; font-size: 12px; line-height: 1.4; color: #4f4128; }
.vertragsgitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.vertragskarte { display: flex; flex-direction: column; gap: 14px; margin-bottom: 0; color: inherit; text-decoration: none; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.vertragskarte:hover { box-shadow: var(--schatten); }
.vertragskopf { display: flex; align-items: center; gap: 12px; }
.vertragskopf > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.vertragskopf strong { font-size: 15px; font-weight: 600; }
.vertragskopf small { font-size: 12.5px; color: var(--text-3); }
.vertragsfuss { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--linie); }
.mini-kacheln { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mini-kacheln .badge { height: 24px; font-size: 11.5px; padding-right: 9px; }
.mini-kacheln .badge .punkt { width: 18px; height: 18px; }
.gefahrzone summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--st-nicht_gedeckt-text); }
.gefahrzone .formularzeile { margin-top: 12px; }
.bestaetigung { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.knopf.gefahr { background: var(--st-nicht_gedeckt-text); }
.knopf.gefahr:hover { background: #7a2323; }
.st-hinweis { --chip-flaeche: var(--karte-2); --chip-text: var(--text-2); --st-farbe: var(--text-3); }
.reiterleiste { margin-top: -6px; margin-bottom: 18px; }  /* links/rechts zentriert wie die übrigen Blöcke */

.vorlaeufig {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin: 0 0 16px;
  padding: 12px 14px 12px 16px; border-radius: var(--radius-s); background: var(--st-teilweise-flaeche); color: var(--st-teilweise-text); font-size: 13px;
}
.vorlaeufig p { margin: 0; max-width: 820px; }
.befund-kacheln { margin-top: 4px; }
/* Kopf der Befunde: Ergebnissatz, Kacheln in Gruppen (zu klären, abgesichert, weiteres); Nullen gedämpft statt farbig */
.ergebnissatz { margin: 0 0 16px; font-size: 14px; line-height: 1.55; max-width: 920px; }
.ergebnissatz strong { font-weight: 600; }
.kachelgruppen { display: grid; grid-template-columns: 3fr 2fr 2fr; gap: 12px 18px; }
.kachelgruppe { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kachelgruppe-titel { font-size: 12px; font-weight: 600; color: var(--text-3); }
.kachelgruppe .kacheln { flex: 1; grid-template-columns: repeat(var(--spalten, 2), minmax(0, 1fr)); margin-top: 0; }  /* gleich hohe Kacheln über alle Gruppen */
.kachel.leer { --chip-flaeche: var(--karte-2); --chip-text: var(--text-2); }  /* --text-3 reicht auf --karte-2 nicht für 4,5:1 */
.kachel.leer .kachel-wert { color: var(--text-3); }
.kachel.leer .glyph { opacity: 0.45; }
.regelung-wert { font-size: 12.5px; }
.abschnittskopf { margin-bottom: 12px; }
.tabellenkarte > .karte-kopf { padding: 0 16px; margin-bottom: 14px; }
.befundliste { list-style: none; margin: 0; padding: 0; }
.befund { padding: 16px 0; border-top: 1px solid var(--linie); }
.befund:first-child { border-top: 0; padding-top: 2px; }
.befund-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.befund-titel { font-size: 14px; font-weight: 600; }
.befund-text { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--text-2); max-width: 860px; }
.befund-zusatz { margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.regelung { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; padding: 8px 12px; border-radius: 14px; background: var(--karte-2); font-size: 12.5px; }
.regelung-kopf { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.regelung .alternativen { flex-basis: 100%; margin: 0; color: var(--text-2); }
.anlass { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; font-size: 12px; color: var(--text-3); }
.anlass strong { font-weight: 600; color: var(--text-2); }
.aufklapper-karte > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; cursor: pointer; list-style: none; }
.aufklapper-karte > summary::-webkit-details-marker { display: none; }
.aufklapper-karte > summary .abschnittstitel { margin-bottom: 0; }
.aufklapper-karte > summary .abschnittstitel::after { content: "+"; margin-left: 4px; color: var(--text-3); font-weight: 500; }
.aufklapper-karte[open] > summary { margin-bottom: 10px; }
.aufklapper-karte[open] > summary .abschnittstitel::after { content: "–"; }
.staende li { flex-wrap: wrap; align-items: center; }
.staende form { margin-left: auto; }
.importformular.kompakt { margin-top: 18px; }
.importformular.kompakt .dateiwahl { min-height: 72px; }
.importformular.kompakt .formularzeile { margin-top: 0; }
.verlaufsliste { list-style: none; margin: 0; padding: 0; }
.verlaufsliste > li { padding: 14px 0; border-top: 1px solid var(--linie); }
.verlaufsliste > li:first-child { border-top: 0; padding-top: 2px; }
.verlauf-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.aenderungen { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.aenderungen li { padding: 2px 0; }
.ablegen select { min-width: 260px; }
.blaetterleiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 14px 12px 6px; }
.zusatzangaben { margin-top: 14px; }
.zusatzangaben .meta.kompakt > div { grid-template-columns: 210px minmax(0, 1fr); }

/* Fragebogen */
.fragebogen-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
.fragebogen-intro .abschnittstitel { margin-bottom: 6px; }
.fragebogen-intro p { margin: 0; max-width: 820px; }
.fragengruppe .karte-kopf { margin-bottom: 4px; }
.frage { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding: 12px 0; border-top: 1px solid var(--linie); }
.frage[hidden] { display: none; }
.karte-kopf + .frage { border-top: 0; }
.frage.folgefrage { margin-left: 18px; padding-left: 16px; border-left: 2px solid var(--pille); }
.frage-text { flex: 1 1 340px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; }
.frage-text small { flex-basis: 100%; font-size: 12px; color: var(--text-3); }
.frage.abweichend .police-wert { background: var(--st-teilweise-flaeche); color: var(--st-teilweise-text); }
.frage-antwort { flex: 0 1 auto; max-width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.antwort { position: relative; display: inline-flex; }
.antwort input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.antwort span {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--karte-2);
  font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; user-select: none; transition: background-color 0.15s ease;
}
.antwort:hover span { background: var(--pille); }
.antwort input:checked + span { background: var(--text); color: var(--weiss); }
.antwort input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.antwort input:disabled + span { cursor: default; opacity: 0.5; }
.antwort.weissnicht span { color: var(--text-3); }
.antwort.weissnicht input:checked + span { background: var(--st-unklar-flaeche); color: var(--st-unklar-text); }
.zahlfeld { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.zahlfeld input[type="text"] { width: 130px; text-align: right; }
.speicherleiste { position: sticky; bottom: -48px; z-index: 5; box-shadow: var(--schatten); }

/* ------------------------------------------------------------------ Schmalere Fenster */
@media (max-width: 1180px) {
  .menuepille span, .laufpille span:last-child { display: none; }
  .laufpille { padding: 0 16px; }
  .menuepille { width: 42px; padding: 0; justify-content: center; }
  .pdf-ansicht { grid-template-columns: minmax(0, 1fr); }
  .pdf-info { position: static; }
  .kacheln, .kacheln.police-kacheln { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kachelgruppen { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kachelgruppe:first-child { grid-column: 1 / -1; }
  .kundenraster { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app { padding: 6px; }
  .rahmenkopf { gap: 8px; }
  .reiter { padding: 6px 22px 0 8px; gap: 10px; }
  .reiter-produkt { display: none; }
  .bereichswahl a { height: 28px; padding: 0 11px; font-size: 12.5px; }
  .logo { width: 40px; height: 40px; }
  /* Menü in eigener Zeile über dem Reiter, damit alle Symbole sichtbar bleiben und der Reiter an der Leinwand hängt */
  :root { --kopfhoehe: 108px; }
  .rahmenkopf { flex-wrap: wrap; align-content: flex-end; row-gap: 8px; }
  .reiter { flex: none; height: 62px; }
  .menue { order: -1; flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; gap: 4px; padding: 0 2px; }
  .menuepille { flex: none; width: 38px; height: 38px; }
  .leinwand { padding: 20px 16px 40px; border-radius: 0 20px 20px 20px; }
  .seitenkopf h1 { font-size: 24px; }
  .raster.zwei, .formulargitter, .kennzahl-reihe { grid-template-columns: minmax(0, 1fr); }
  .frage-antwort { justify-content: flex-start; }
  .speicherleiste { position: static; }  /* auf dem Telefon nicht über den Fragen kleben */
  .frage.folgefrage { margin-left: 6px; padding-left: 12px; }
  .vertragsgitter { grid-template-columns: minmax(0, 1fr); }
  .kundenliste th:nth-child(2), .kundenliste td:nth-child(2), .kundenliste th:nth-child(5), .kundenliste td:nth-child(5) { display: none; }
  .kacheln, .kacheln.police-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kachelgruppen { grid-template-columns: minmax(0, 1fr); }
  .codezelle { width: 176px; min-width: 176px; max-width: 176px; }
  .meta > div, .regeln > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .panel { top: calc(var(--kopfhoehe) + 12px); left: 8px; right: 8px; bottom: 8px; width: auto; }
  .werkzeugleiste .rechts { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body { background: #fff; }
  .app { height: auto; padding: 0; }
  .rahmenkopf, .werkzeugleiste, .filterzeile, .panel, .aktionen, .blaettern, .legende { display: none !important; }
  .leinwand { overflow: visible; border-radius: 0; padding: 0; }
  .matrix-rahmen { overflow: visible; max-height: none !important; }
}
