/* LI-Dashboard: gemeinsame Gestaltung nach dem Vorbild vom 25.11.2026
 *
 * Übernommen aus der Stil-Vorlage (Repo sl-claude, werkzeuge/dashboard-stil,
 * stil.css). Maße und Farben des Vorbilds stehen dort in MASSE.md, die
 * Kriterien in der CLAUDE.md, Abschnitt "Gestaltung".
 *
 * Aufbau: links die Icon-Seitenleiste mit den Hauptbereichen, daneben die
 * zweite, schmale Leiste mit den Unterseiten des Bereichs, oben die Kopfleiste,
 * darunter der Inhalt im Raster des Vorbilds.
 * Bausteine der Vorlage: seitenleiste, kopfleiste, raster, kz-karte, karte,
 * pille, auswahl, kopfzahlen, diagramm (linien, balken), fortschritt, ring,
 * tabelle, tipp, rund-knopf, abzeichen, winkel, zeitraum, Dunkelmodus.
 * Eigenes des Dashboards: unterleiste, konto, Anmeldung, Knöpfe und Felder,
 * Meldungen, unterreiter, Verwaltung.
 *
 * Der Server erlaubt keine style-Attribute. Farben kommen über data-bereich
 * und die Klassen farbe-1 bis farbe-6, Längen setzt diagramme.js.
 * Farben stehen nie als fester Wert an einem Baustein, immer als Variable,
 * sonst bleibt die Stelle im Dunkelmodus hell.
 */

:root {
  color-scheme: light;

  /* Flächen und Linien */
  --flaeche: #f4f7ff;
  --karte: #ffffff;
  --linie: #ececec;
  --rahmen: #e4e4e6;
  --grau-flaeche: #ececee;
  --schiene: #ececec;
  --schiene-hell: #f1f1f1;
  --gitter: #ececef;
  --vergleich: #e6e6e9;
  --legende-flaeche: #f5f5f8;
  --tooltip: #3e4157;
  --tooltip-text: #c5c8d6;
  --vergleich-kraeftig: #cfd0d4;
  --lot: #d9dbe1;
  --reiter-rand: #f3f4f6;
  --knopf-hover: #e2e3e8;
  --schiene-aktiv: #e9e9ec;
  --legende-aktiv: #ecedf2;
  --marke-innen: #e6e7ec;
  --zeitraum-aktiv: #3e4157;
  --zeitraum-aktiv-text: #ffffff;
  --feld-hover: #f5f5f8;

  /* Schrift */
  --tinte: #3a3d55;
  --text: #474a5c;
  --text-leise: #8a8c96;
  --text-blass: #b4b6bc;
  --text-achse: #cbccd2;
  --icon: #d9dce6;
  --punkte: #c8c8cc;

  /* Akzentfarben aus dem Bild, Türkis und Beere ergänzt */
  --blau: #3b83fb;
  --rot: #f64444;
  --gruen: #2dad64;
  --violett: #8757f3;
  --orange: #f49b4a;
  --lila: #9b57e3;
  --tuerkis: #17b3c8;
  --beere: #e2559c;

  /* Farben der Bereiche: nie Rot oder Grün, die gehören der Wertung */
  --b-start: var(--blau);
  --b-marketing: var(--blau);
  --b-sales: var(--violett);
  --b-finanzen: var(--tuerkis);
  --b-fulfillment: var(--orange);
  --b-social: var(--beere);
  --b-steuerung: var(--tooltip);
  --b-verwaltung: var(--tooltip);

  /* Wertung: gut, braucht einen Blick, schlecht */
  --gut: var(--gruen);
  --mittel: #ee8f38;
  --schlecht: var(--rot);

  /* Maße */
  --seitenleiste-b: 66px;
  --unterleiste-b: 208px;
  --kopf-h: 66px;
  --inhalt-oben: 27px;
  --inhalt-links: 32px;
  --inhalt-rechts: 28px;
  --inhalt-unten: 41px;
  --reihe-abstand: 22px;
  --spalte-abstand: 16px;
  --kz-h: 110px;
  --reihe2-h: 363px;
  --reihe3-h: 315px;
  --radius: 12px;
  --radius-klein: 8px;
  --karte-innen: 20px;
  --kz-innen: 18px;
  --schatten: 0 2px 8px rgba(58, 61, 85, 0.035);
  --schatten-menue: 0 8px 24px rgba(58, 61, 85, 0.14);

  /* Deckkraft blasser Flächen: Mini-Balken, Kreis in der Fortschrittsliste, Wachstumspille */
  --blass: 0.1;
  --bild-anteil: 14%;
  --pille-anteil: 12%;

  /* Schrift: nichts wird nachgeladen. Nunito und Inter nur, wenn lokal vorhanden. */
  --schrift: "Nunito", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;
  --festbreit: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --fett: 700;
  --halbfett: 600;
  --mittelfett: 500;

  /* Kleine Zeichen als Maske, färbbar über background-color */
  --z-winkel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.6 1.8 6.8 5 3.6 8.2' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --z-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 8.6V1.6M2.2 4.3 5 1.5l2.8 2.8' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --z-pfeil-schraeg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M3.7 7.3 7.2 3.8M4.4 3.7h2.9v2.9' fill='none' stroke='%23fff' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --z-pfeil-seite: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M3 5.5h5M6.1 3.5l2 2-2 2' fill='none' stroke='%23fff' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Dunkelmodus: <html data-thema="dunkel">. Hell bleibt Standard.
   Es wechseln nur Werte der Variablen, kein Maß und kein Baustein.
   Farben gemessen am dunklen Fenster des Vorbilds (MASSE.md, Abschnitt 15).
   -------------------------------------------------------------------------- */

:root[data-thema="dunkel"] {
  color-scheme: dark;

  --flaeche: #314565;
  --karte: #405675;
  --linie: #384d6c;
  --rahmen: #5a6e8e;
  --grau-flaeche: #4f6381;
  --schiene: #54688a;
  --schiene-hell: #4a5f80;
  --gitter: #4d6483;
  --vergleich: #6c80a0;
  --legende-flaeche: #4a5f7f;
  --tooltip: #22314b;
  --tooltip-text: #b2c1d7;
  --vergleich-kraeftig: #8a9db8;
  --lot: #7388a6;
  --reiter-rand: #4a5f7f;
  --knopf-hover: #5a6e8e;
  --schiene-aktiv: #556a8b;
  --legende-aktiv: #54698a;
  --marke-innen: #405675;
  --zeitraum-aktiv: #ffffff;
  --zeitraum-aktiv-text: #314565;
  --feld-hover: #4a5f7f;

  --tinte: #ffffff;
  --text: #f1f6fb;
  --text-leise: #b2c1d7;
  --text-blass: #93a5c0;
  --text-achse: #8496b2;
  --icon: #637692;
  --punkte: #7286a3;

  /* Wertung als Schrift braucht auf dunkler Fläche hellere Töne */
  --gut: #54d893;
  --mittel: #ffc078;
  --schlecht: #ff9a9a;
  --b-steuerung: #aab8d0;
  --b-verwaltung: #aab8d0;

  --schatten: 0 2px 8px rgba(20, 30, 50, 0.12);
  --schatten-menue: 0 8px 24px rgba(10, 18, 34, 0.4);
  --blass: 0.22;
  --bild-anteil: 26%;
  --pille-anteil: 20%;
}

/* --------------------------------------------------------------------------
   Grundlage
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--flaeche);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.3;
  font-weight: var(--mittelfett);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.laedt { margin: 0; padding: 32px; font-size: 14px; color: var(--text-leise); }

/* Icon aus dem Skript: <i data-icon="marketing"></i> */
[data-icon] { display: inline-flex; width: 18px; height: 18px; }
[data-icon] svg { width: 100%; height: 100%; display: block; }

/* Linien-Symbole der Unterseiten: ein Stil, 18 px, Strich 1,5 px, Farbe der Schrift */
.symbol { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Nur für Vorleseprogramme sichtbar */
.nur-vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Bereichsfarben und Farbreihe
   Wer data-bereich trägt, gibt die Farbe an alles darin weiter. Der Bereich
   zeigt sich als kleines Quadrat mit Namen, die Wertung als Pille mit Pfeil
   oder als Abzeichen: zwei Formen, damit sie niemand verwechselt.
   -------------------------------------------------------------------------- */

[data-bereich="start"]       { --farbe: var(--b-start); }
[data-bereich="marketing"]   { --farbe: var(--b-marketing); }
[data-bereich="sales"]       { --farbe: var(--b-sales); }
[data-bereich="finanzen"]    { --farbe: var(--b-finanzen); }
[data-bereich="fulfillment"] { --farbe: var(--b-fulfillment); }
[data-bereich="social"]      { --farbe: var(--b-social); }
[data-bereich="steuerung"]   { --farbe: var(--b-steuerung); }
[data-bereich="verwaltung"]  { --farbe: var(--b-verwaltung); }
[data-bereich="ohne"]        { --farbe: var(--vergleich-kraeftig); }

/* Farbreihe für Dinge ohne eigenen Bereich (Funnels, Quellen, Zeilen einer
   Tabelle): ohne Rot und Grün, die gehören der Wertung */
:root { --reihe-1: var(--blau); --reihe-2: var(--violett); --reihe-3: var(--tuerkis); --reihe-4: var(--orange); --reihe-5: var(--beere); --reihe-6: var(--lila); }
.farbe-1 { --farbe: var(--reihe-1); }
.farbe-2 { --farbe: var(--reihe-2); }
.farbe-3 { --farbe: var(--reihe-3); }
.farbe-4 { --farbe: var(--reihe-4); }
.farbe-5 { --farbe: var(--reihe-5); }
.farbe-6 { --farbe: var(--reihe-6); }

.bereichspunkt { display: inline-block; flex: none; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; background: var(--farbe, var(--blau)); }

/* --------------------------------------------------------------------------
   Seitenleiste: schmal, nur Icons, Name als Tooltip (data-tipp)
   -------------------------------------------------------------------------- */

.seitenleiste {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--seitenleiste-b);
  background: var(--karte);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seitenleiste .logo {
  flex: none;
  width: var(--seitenleiste-b);
  height: var(--kopf-h);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--linie);
  border-right: 1px solid var(--linie);
  margin-bottom: 24px;
}
.logo svg { width: 37px; height: 35px; display: block; }
.logo-aussen { fill: var(--blau); }
.logo-schrift { fill: #fff; font-family: var(--schrift); font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }

/* Die Hauptbereiche: der Kasten selbst zählt im Aufbau nicht mit */
.hauptnav { display: contents; }

.reiter {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--icon);
  transition: color 0.15s, background-color 0.15s;
}
.reiter:hover, .reiter:focus-visible { color: var(--text-leise); outline: none; }
.reiter:focus-visible { box-shadow: 0 0 0 2px var(--blau); }
.reiter.aktiv {
  color: var(--blau);
  background: var(--grau-flaeche);
  box-shadow: 0 0 0 3px var(--karte), 0 0 0 4px var(--reiter-rand);
}
/* blauer Strich rechts neben dem aktiven Reiter */
.reiter.aktiv::before {
  content: "";
  position: absolute;
  left: 35px;
  top: 7px;
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background: var(--blau);
}

/* Tooltip mit dem Namen des Reiters */
[data-tipp] { position: relative; }
[data-tipp]::after {
  content: attr(data-tipp);
  position: absolute;
  z-index: 40;
  left: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--tooltip);
  color: #fff;
  font-size: 13px;
  font-weight: var(--halbfett);
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
[data-tipp]:hover::after, [data-tipp]:focus-visible::after { opacity: 1; }

.seitenleiste-trenner {
  flex: none;
  width: 49px;
  height: 1px;
  margin: 8px 0 23px;
  background: var(--linie);
}

/* Runder Knopf unten in der Seitenleiste (blauer Kreis mit weißem Zeichen) */
.seitenleiste-knopf {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: var(--grau-flaeche);
}
.seitenleiste-knopf [data-icon] {
  width: 20px;
  height: 20px;
  padding: 4px;
  border-radius: 50%;
  background: var(--blau);
  color: #fff;
}
.seitenleiste-knopf:hover { background: var(--knopf-hover); }
.seitenleiste-knopf:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Zweite Leiste: die Unterseiten des Bereichs, im Stil der Seitenleiste
   -------------------------------------------------------------------------- */

.rahmen { --links: var(--seitenleiste-b); }
.rahmen.mit-unterleiste { --links: calc(var(--seitenleiste-b) + var(--unterleiste-b)); }

.unterleiste {
  position: fixed;
  z-index: 25;
  inset: 0 auto 0 var(--seitenleiste-b);
  width: var(--unterleiste-b);
  padding: 0 12px 16px;
  background: var(--karte);
  border-right: 1px solid var(--linie);
  overflow-y: auto;
}
.unterleiste .schalter { display: none; }
.unterleiste .bereich {
  display: flex;
  align-items: center;
  height: var(--kopf-h);
  margin: 0 -12px 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--linie);
  font-size: 12px;
  font-weight: var(--fett);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tinte);
}
.unterleiste .liste { display: flex; flex-direction: column; gap: 4px; }
.unterleiste .liste a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 14.5px;
  line-height: 1.3;
  color: var(--text);
  overflow-wrap: break-word;
  transition: background-color 0.15s;
}
.unterleiste .liste a > span { flex: 1 1 auto; min-width: 0; }
.unterleiste .liste a .marke-klein { display: inline-block; margin-left: 4px; vertical-align: 1px; }
.unterleiste .symbol { color: var(--text-blass); }
.unterleiste .liste a:hover { background: var(--feld-hover); color: var(--tinte); }
.unterleiste .liste a.aktiv { background: var(--grau-flaeche); color: var(--tinte); font-weight: var(--halbfett); }
.unterleiste .liste a.aktiv .symbol { color: var(--farbe, var(--blau)); }
.unterleiste .liste a.folgt:not(.aktiv) { color: var(--text-blass); }
.unterleiste .liste a.folgt:not(.aktiv) .symbol { color: var(--punkte); }
.unterleiste .liste a:focus-visible, .unterleiste .schalter:focus-visible { outline: 2px solid var(--blau); outline-offset: -2px; }
.marke-klein { padding: 0 6px; border: 1px solid var(--rahmen); border-radius: 4px; font-size: 10px; font-weight: var(--halbfett); letter-spacing: 0.04em; line-height: 16px; color: var(--text-leise); white-space: nowrap; text-transform: uppercase; }

/* --------------------------------------------------------------------------
   Kopfleiste
   -------------------------------------------------------------------------- */

.kopfleiste {
  container: kopf / inline-size;
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: var(--kopf-h);
  margin-left: var(--links);
  padding-left: var(--inhalt-links);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
  background: var(--karte);
}

.kopf-titel {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 20px;
  line-height: 27px;
  font-weight: var(--fett);
  color: var(--tinte);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stand der Daten neben dem Titel. Solange Beispielwerte gezeigt werden, steht
   dort die Marke "Beispielwerte" und ab wann echte Zahlen kommen. */
.stand { flex: none; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 400; color: var(--text-leise); white-space: nowrap; }
.stand strong { font-weight: var(--mittelfett); color: var(--text); }
.beispiel {
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--mittel) var(--pille-anteil), transparent);
  color: color-mix(in srgb, var(--mittel) 72%, var(--tinte));
  font-size: 12px;
  line-height: 22px;
  font-weight: var(--halbfett);
  white-space: nowrap;
}

.kopf-rechts { margin-left: auto; align-self: stretch; min-height: var(--kopf-h); display: flex; }

/* Zeitraum-Umschalter: Pillen rechts in der Kopfleiste, vor den Zellen.
   Steht nur dort, wo er sichtbar etwas ändert. Die gewählte Pille trägt .aktiv. */
.zeitraum {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  padding: 0 22px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.zeitraum:empty { display: none; }
.zeitraum:not(:empty) + .kopf-rechts { margin-left: 0; }
.zeitraum-pille, select.zeitraum-wahl {
  flex: none;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--rahmen);
  border-radius: 17px;
  background-color: var(--karte);
  font-size: 13px;
  font-weight: var(--halbfett);
  color: var(--text-leise);
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.zeitraum-pille:hover, select.zeitraum-wahl:hover { color: var(--tinte); }
.zeitraum-pille:focus-visible, select.zeitraum-wahl:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.zeitraum-pille.aktiv, select.zeitraum-wahl.aktiv {
  border-color: var(--zeitraum-aktiv);
  background-color: var(--zeitraum-aktiv);
  color: var(--zeitraum-aktiv-text);
}
/* Auswahl mit Liste (Funnel, Weitere): gleiche Pille mit Winkel */
select.zeitraum-wahl {
  width: auto;
  max-width: 190px;
  padding-right: 30px;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%238a8c96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
select.zeitraum-wahl option { background: var(--karte); color: var(--text); font-weight: 400; }
.zeitraum-trenner { flex: none; width: 1px; height: 22px; margin: 0 4px; background: var(--linie); }

/* Reicht die Breite der Kopfleiste nicht für Titel, Stand, Auswahl und Zellen in
   einer Zeile, rutscht erst die Auswahl, dann auch der Stand in eine zweite Zeile. */
@container kopf (max-width: 1520px) {
  .zeitraum.voll { order: 5; flex: 1 1 100%; margin-left: 0; padding: 0 16px 14px 0; flex-wrap: wrap; }
  .zeitraum.voll + .kopf-rechts { margin-left: auto; }
}
@container kopf (max-width: 860px) {
  .kopf-titel { flex: 1 1 0; }
  .stand { order: 4; flex: 1 1 100%; flex-wrap: wrap; padding: 0 16px 12px 0; white-space: normal; }
  .zeitraum:not(:empty) { order: 5; flex: 1 1 100%; margin-left: 0; padding: 0 16px 14px 0; flex-wrap: wrap; }
  .zeitraum:not(:empty) + .kopf-rechts { margin-left: auto; }
  .zeitraum-trenner { display: none; }
}

.kopf-zelle {
  width: 59px;
  height: 100%;
  min-height: var(--kopf-h);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-left: 1px solid var(--linie);
  background: transparent;
  color: var(--icon);
}
.kopf-zelle [data-icon] { width: 22px; height: 22px; }
.kopf-zelle:hover, .kopf-zelle:focus-visible { color: var(--text-leise); outline: none; }
.kopf-zelle:focus-visible { box-shadow: inset 0 0 0 2px var(--blau); }

/* Konto: Bildfeld mit Rahmen in Blau, daneben der Winkel. Ein Klick öffnet das Menü. */
.konto { position: relative; display: flex; }
.kopf-zelle.konto-knopf { width: 112px; color: var(--punkte); }
.kopf-bild {
  width: 45px;
  height: 45px;
  padding: 2px;
  display: flex;
  border: 1.5px solid var(--blau);
  border-radius: 12px;
}
.kopf-zelle .kopf-bild > * {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 9px;
  background: var(--grau-flaeche);
  color: var(--text-leise);
}
.konto-menue {
  position: absolute;
  z-index: 35;
  right: 12px;
  top: calc(100% - 6px);
  min-width: 220px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--radius);
  background: var(--karte);
  box-shadow: var(--schatten-menue);
}
.konto-menue .name { padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--linie); font-size: 14px; font-weight: var(--halbfett); color: var(--tinte); overflow-wrap: anywhere; }
.konto-menue .name small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--text-leise); }
.konto-menue a, .konto-menue button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 14.5px;
  color: var(--text);
  text-align: left;
}
.konto-menue [data-icon] { color: var(--text-blass); }
.konto-menue a:hover, .konto-menue button:hover { background: var(--feld-hover); color: var(--tinte); }
.konto-menue a.aktiv { background: var(--grau-flaeche); color: var(--tinte); font-weight: var(--halbfett); }
.konto-menue a.aktiv [data-icon] { color: var(--blau); }
.konto-menue a:focus-visible, .konto-menue button:focus-visible { outline: 2px solid var(--blau); outline-offset: -2px; }

/* --------------------------------------------------------------------------
   Inhalt und Raster
   -------------------------------------------------------------------------- */

.inhalt {
  margin-left: var(--links);
  padding: var(--inhalt-oben) var(--inhalt-rechts) var(--inhalt-unten) var(--inhalt-links);
}
.inhalt > .meldung { margin: 0 0 var(--reihe-abstand); }
.platz:empty { display: none; }
.platz > .meldung { margin: 0 0 var(--reihe-abstand); }

.raster {
  display: grid;
  gap: var(--spalte-abstand);
  margin-bottom: var(--reihe-abstand);
}
.raster:last-child { margin-bottom: 0; }
.raster > * { min-width: 0; }

/* Reihe der Kennzahlkarten: so viele gleich breite Spalten wie Karten */
.raster-kz { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
/* Eine Karte über die ganze Breite */
.raster-1 { grid-template-columns: minmax(0, 1fr); }
/* Zwei große Karten nebeneinander */
.raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster-2 > .karte { min-height: var(--reihe2-h); }
/* Drei Karten nebeneinander */
.raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster-3 > .karte { min-height: var(--reihe3-h); }
/* Breite Karte links, schmale rechts: die schmale behält Platz für Ring und Legende */
.raster-2-1 { grid-template-columns: minmax(0, 2fr) minmax(400px, 1fr); }
.raster-2-1 > .karte { min-height: var(--reihe3-h); }

/* --------------------------------------------------------------------------
   Karte (groß) mit Kopf
   -------------------------------------------------------------------------- */

.karte, .kz-karte {
  position: relative;
  background: var(--karte);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}

.karte {
  display: flex;
  flex-direction: column;
  padding: 17px var(--karte-innen) 12px;
}

.karte-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 27px;
}

.karte-titel {
  margin: 0;
  min-width: 0;
  font-size: 20px;
  line-height: 27px;
  font-weight: var(--fett);
  color: var(--tinte);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.karte-werkzeug { flex: none; display: flex; align-items: center; gap: 12px; min-height: 22px; margin-top: 4px; }

/* Zeile unter dem Titel: links Untertitel, rechts Legende */
.karte-zeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.karte-unter {
  margin: 0;
  min-width: 0;
  font-size: 13px;
  line-height: 18px;
  font-weight: 400;
  color: var(--text-achse);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Erläuterung in einer Karte, etwa ein leerer Zustand */
.karte-text { margin: 18px 0 6px; font-size: 14px; line-height: 1.5; font-weight: 400; color: var(--text-leise); }
.karte-fuss { margin: 8px 0 0; font-size: 13px; font-weight: 400; color: var(--text-blass); }

/* Legende mit Punkt */
.legende { flex: none; display: flex; gap: 18px; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-leise); }
.legende > * { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legende > *::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--farbe, var(--blau));
}

/* Auswahlknopf im Kopf einer Karte */
.auswahl {
  height: 26px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--rahmen);
  border-radius: 6px;
  background: var(--karte);
  font-size: 13px;
  font-weight: var(--halbfett);
  color: var(--tinte);
  white-space: nowrap;
}
.auswahl-marke { width: 6px; height: 6px; border-radius: 1px; background: var(--farbe, var(--blau)); }

/* Winkel (Pfeilspitze), Farbe über color */
.winkel {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: currentColor;
  -webkit-mask: var(--z-winkel) center / contain no-repeat;
  mask: var(--z-winkel) center / contain no-repeat;
}
.winkel.unten { transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   Kennzahlkarte: Titel, große Zahl, Pille, Mini-Balken in Bereichsfarbe
   -------------------------------------------------------------------------- */

.kz-karte {
  display: block;
  height: var(--kz-h);
  padding: 10px var(--kz-innen) 0;
  overflow: hidden;
}
a.kz-karte { transition: box-shadow 0.15s; }
a.kz-karte:hover { box-shadow: var(--schatten), 0 0 0 1px var(--rahmen); }
a.kz-karte:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }

.kz-titel {
  margin: 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: var(--halbfett);
  color: var(--text-leise);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Name des Bereichs unter dem Titel, mit Quadrat in seiner Farbe (Startseite) */
.kz-marke {
  position: absolute;
  left: var(--kz-innen);
  top: 31px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 13px;
  font-weight: var(--halbfett);
  color: color-mix(in srgb, var(--farbe, var(--blau)) 80%, var(--tinte));
  white-space: nowrap;
}
.kz-marke::before { content: ""; width: 6px; height: 6px; border-radius: 1.5px; background: var(--farbe, var(--blau)); }

.kz-zahl {
  margin: 15px 0 0;
  font-size: 24px;
  line-height: 30px;
  font-weight: var(--fett);
  color: var(--tinte);
  white-space: nowrap;
}
.kz-karte.mit-marke .kz-zahl { margin-top: 17px; line-height: 28px; }
/* Ein längeres Wort statt einer Zahl steht kleiner */
.kz-karte.wort .kz-zahl { font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
.kz-karte.leer .kz-zahl { font-size: 16px; font-weight: var(--mittelfett); color: var(--text-blass); }
.kz-karte.leer .kz-titel { color: var(--text-blass); }

/* Mini-Balken unten rechts, vom Skript gefüllt (DS.miniBalken) */
.kz-balken {
  position: absolute;
  right: var(--kz-innen);
  bottom: 15px;
  width: 38%;
  max-width: 117px;
  height: 56px;
  color: var(--farbe, var(--blau));
}
.kz-balken svg { display: block; width: 100%; height: 100%; }
.kz-blass { fill-opacity: var(--blass); }

/* --------------------------------------------------------------------------
   Pille: runder Punkt mit Pfeil und kurzer Aussage (+12,4 % oder wenige Worte)
   Richtung: .hoch, .runter oder .seite. Farbe: Grün bei .hoch, Rot bei .runter,
   Orange bei .seite; mit .gut, .mittel oder .schlecht lässt sich die Farbe
   getrennt von der Richtung setzen (Kosten sinken = gut).
   -------------------------------------------------------------------------- */

.pille {
  --wertung: var(--text-leise);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-size: 11px;
  line-height: 14px;
  font-weight: var(--halbfett);
  color: var(--wertung);
  white-space: nowrap;
}
.pille::before {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor var(--z-pfeil-schraeg) center / 11px 11px no-repeat;
}
.pille.hoch { --wertung: var(--gut); }
.pille.runter { --wertung: var(--schlecht); }
.pille.seite { --wertung: var(--mittel); }
.pille.runter::before { transform: scaleY(-1); }
.pille.seite::before { background-image: var(--z-pfeil-seite); }
/* ohne Richtung: grauer Punkt ohne Pfeil */
.pille:not(.hoch):not(.runter):not(.seite)::before { background-image: none; }
.pille.gut { --wertung: var(--gut); }
.pille.mittel { --wertung: var(--mittel); }
.pille.schlecht { --wertung: var(--schlecht); }
/* Richtung ohne Urteil (etwa Werbekosten): Pfeil in Grau */
.pille.neutral { --wertung: var(--text-leise); }
.kz-karte .pille { display: flex; max-width: calc(62% - 26px); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.kz-karte.mit-marke .pille { margin-top: 2px; }
.kz-karte.ohne-balken .pille { max-width: 100%; }
.raster-2.flach > .karte { min-height: var(--reihe3-h); }

/* Wachstumspille mit Fläche, für Tabellen und Listen. Blasse Fläche in der Farbe
   der Wertung, kein Punkt. Vorzeichen oder Wort stehen im Text, damit die
   Wertung nicht allein an der Farbe hängt. Ohne Wertung grau. */
.pille.flaeche {
  justify-content: center;
  min-width: 52px;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--wertung) var(--pille-anteil), transparent);
  color: color-mix(in srgb, var(--wertung) 82%, var(--tinte));
  font-size: 12px;
  line-height: 20px;
}
.pille.flaeche::before { display: none; }

/* --------------------------------------------------------------------------
   Kopfzahlen über einem Diagramm: links Trend, rechts bis zu drei Zahlen
   -------------------------------------------------------------------------- */

.kopfzahlen { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 35px; margin-top: 22px; }
.kopfzahlen > :first-child { margin-right: auto; }

.kopfzahl { display: flex; flex-direction: column; gap: 2px; }
.kopfzahl-wert { font-size: 17px; line-height: 22px; font-weight: var(--fett); color: var(--tinte); white-space: nowrap; }
.kopfzahl-text { font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-blass); white-space: nowrap; }

.kopfzahl.hoch .kopfzahl-wert { color: var(--gut); }
.kopfzahl.runter .kopfzahl-wert { color: var(--schlecht); }
.kopfzahl.gut .kopfzahl-wert { color: var(--gut); }
.kopfzahl.mittel .kopfzahl-wert { color: var(--mittel); }
.kopfzahl.schlecht .kopfzahl-wert { color: var(--schlecht); }
.kopfzahl.hoch .kopfzahl-wert::before,
.kopfzahl.runter .kopfzahl-wert::before {
  content: "";
  display: inline-block;
  margin-right: 6px;
  border: 4.5px solid transparent;
  border-top-width: 0;
  border-bottom: 5px solid currentColor;
  vertical-align: 3px;
}
.kopfzahl.runter .kopfzahl-wert::before { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   Diagramme: das Skript zeichnet ein SVG in das Feld .diagramm
   -------------------------------------------------------------------------- */

.diagramm { position: relative; flex: 1 1 auto; min-height: 150px; margin-top: 4px; }
.diagramm svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.diagramm svg:focus-visible { outline: 2px solid var(--blau); outline-offset: 4px; border-radius: 4px; }

.d-gitter { stroke: var(--gitter); stroke-width: 1; stroke-dasharray: 4 4; fill: none; }
.d-achse { fill: var(--text-achse); font-size: 14px; font-weight: 400; }
.d-linie { fill: none; stroke: var(--farbe, var(--blau)); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.d-linie.vergleich { stroke: var(--vergleich); stroke-width: 2; }
.d-lot { stroke: var(--lot); stroke-width: 1; stroke-dasharray: 3 3; }
.d-punkt { fill: var(--farbe, var(--blau)); stroke: color-mix(in srgb, var(--farbe, var(--blau)) 28%, var(--karte)); stroke-width: 3; }
.d-balken { fill: var(--farbe, var(--blau)); }
.d-schiene { fill: var(--schiene-hell); }
.d-treffer { fill: transparent; }
.d-aktiv .d-balken { filter: brightness(0.92); }
.d-aktiv .d-schiene { fill: var(--schiene-aktiv); }

/* Tooltip an Diagrammen */
.tipp {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  min-width: 68px;
  padding: 6px 12px 7px;
  border-radius: 6px;
  background: var(--tooltip);
  color: #fff;
  font-size: 13px;
  line-height: 17px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 15px));
  box-shadow: 0 6px 16px rgba(58, 61, 85, 0.18);
}
.tipp::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--tooltip);
  border-bottom-width: 0;
}
.tipp[hidden] { display: none; }
.tipp-titel { display: block; font-weight: 500; color: var(--tooltip-text); }
.tipp-wert { display: block; font-weight: var(--fett); }
.tipp-zeile { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; color: var(--tooltip-text); }
.tipp-zeile::before { content: ""; width: 10px; height: 2px; border-radius: 1px; background: var(--farbe, var(--tooltip-text)); }

/* --------------------------------------------------------------------------
   Fortschrittsliste: Bild, Name, Balken in eigener Farbe, Wert, Pfeil-Knopf
   Farbe über data-bereich oder farbe-1 bis farbe-6, Länge setzt das Skript (--wert)
   -------------------------------------------------------------------------- */

/* Alle Zeilen teilen sich die Spalten: Bei kurzen Namen beginnt der Balken wie im
   Vorbild 139 px hinter dem Bild, lange Namen schieben ihn nach rechts. */
.fortschritt {
  list-style: none;
  margin: 18px 0 0;
  padding: 0 0 13px;
  display: grid;
  grid-template-columns: 34px fit-content(52%) minmax(70px, 164px) minmax(60px, 1fr) 21px;
  grid-auto-rows: 34px;
  row-gap: 13px;
  align-items: center;
}
.fortschritt > li { display: contents; }

.fortschritt-bild {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--farbe, var(--blau)) var(--bild-anteil), var(--karte));
  color: var(--farbe, var(--blau));
}
.fortschritt-bild [data-icon] { width: 16px; height: 16px; }

.fortschritt-name {
  min-width: 139px;
  padding: 0 10px 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fortschritt-balken { height: 6px; border-radius: 3px; background: var(--schiene); }
.fortschritt-balken::before {
  content: "";
  display: block;
  width: var(--wert, 0%);
  max-width: 100%;
  height: 100%;
  border-radius: 3px;
  background: var(--farbe, var(--blau));
}

.fortschritt-wert { padding-left: 7px; font-size: 14px; font-weight: var(--fett); color: var(--farbe, var(--blau)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-thema="dunkel"] .fortschritt-wert { color: color-mix(in srgb, var(--farbe, var(--blau)) 55%, #fff); }

/* Runder Knopf mit Winkel */
.rund-knopf {
  width: 21px;
  height: 21px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--grau-flaeche);
  color: var(--blau);
}
.rund-knopf::before {
  content: "";
  width: 9px;
  height: 9px;
  background-color: currentColor;
  -webkit-mask: var(--z-winkel) center / contain no-repeat;
  mask: var(--z-winkel) center / contain no-repeat;
}
.rund-knopf:hover { background: var(--knopf-hover); }
.rund-knopf:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Ring mit Legende in Kästchen (DS.ring füllt .ring-bild und .ring-legende)
   -------------------------------------------------------------------------- */

.ring { container-type: inline-size; flex: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 17px; padding: 0 2px 0 1px; }

.ring-bild { position: relative; flex: none; width: 218px; height: 218px; margin-top: 9px; }
.ring-bild svg { display: block; width: 100%; height: 100%; }
.ring-scheibe { fill: var(--grau-flaeche); }
.ring-teil { fill: none; stroke-width: 20; transition: stroke-width 0.12s; }
.ring-teil.d-aktiv { stroke-width: 24; }

.ring-mitte { position: absolute; inset: 0; padding: 0 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.ring-zahl { font-size: 38px; line-height: 40px; font-weight: var(--fett); color: var(--tinte); white-space: nowrap; }
.ring-zahl.lang { font-size: 28px; }
.ring-text { margin-top: 1px; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text); }

.ring-legende { flex: 1 1 178px; max-width: 184px; min-width: 0; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ring-legende > li {
  height: 36px;
  padding: 0 12px 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  background: var(--legende-flaeche);
}
.ring-legende > li.d-aktiv { background: var(--legende-aktiv); }
.ring-marke {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--farbe);
  border-radius: 3px;
  background: var(--marke-innen);
}
.ring-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring-wert { font-size: 18px; font-weight: var(--fett); color: var(--tinte); white-space: nowrap; }

/* Legende mit Wert und Anteil (DS.ring mit werte: true) */
.ring-anteil { font-size: 13px; font-weight: 400; color: var(--text-leise); white-space: nowrap; }
.ring.mit-werten .ring-legende { max-width: 240px; }
.ring.mit-werten .ring-legende > li { gap: 8px; padding: 0 11px; }
.ring.mit-werten .ring-wert { min-width: 14px; text-align: right; }
/* Lange Namen (DS.ring setzt die Klasse): kleiner und in zwei Zeilen, damit sie ganz dastehen */
.ring.lange-namen .ring-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; font-size: 13px; line-height: 15px; }
.ring.lange-namen .ring-legende { max-width: 240px; }
.ring.lange-namen .ring-wert { font-size: 16px; }
.ring.lange-namen .ring-legende > li { gap: 8px; padding: 0 10px 0 11px; }
/* Schmale Karte: der Ring wird kleiner, die Legende behält ihren Platz */
@container (max-width: 399px) {
  .ring-bild { width: 176px; height: 176px; margin-top: 30px; }
  .ring-zahl { font-size: 30px; line-height: 32px; }
  .ring-zahl.lang { font-size: 22px; }
  .ring-text { font-size: 13px; line-height: 17px; }
}

/* --------------------------------------------------------------------------
   Tabelle mit Pfeil-Abzeichen
   -------------------------------------------------------------------------- */

.tabelle { width: 100%; margin-top: 23px; border-collapse: collapse; }
.tabelle th {
  height: 22px;
  padding: 0 8px 4px 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-blass);
  text-align: left;
  white-space: nowrap;
}
.tabelle td { height: 43px; padding: 0 8px 0 0; white-space: nowrap; }
.tabelle th:first-child, .tabelle td:first-child { width: 33px; min-width: 33px; padding-right: 0; }
.tabelle.ohne-abzeichen th:first-child, .tabelle.ohne-abzeichen td:first-child { width: auto; min-width: 0; padding-right: 8px; }
/* Zeilenkopf (etwa der Zeitraum): sieht aus wie eine Zelle */
.tabelle tbody th, .tabelle tfoot th { height: 43px; padding: 0 8px 0 0; font-size: inherit; font-weight: var(--mittelfett); color: inherit; }
.tabelle .rechts { text-align: right; }
.tabelle td.rechts { padding-right: 13px; }
.tabelle th.rechts { padding-right: 13px; }
.tabelle tbody tr:hover td { color: var(--tinte); }
.tabelle td.leer { height: 86px; font-size: 14px; font-weight: 400; color: var(--text-leise); white-space: normal; }
.tabelle td.blass, .tabelle tr.ohne-daten td { color: var(--text-blass); }
.tabelle td.umbruch { white-space: normal; }
/* Langer Name in einer schmalen Karte: wird gekürzt, der ganze Name steht beim Überfahren */
.tabelle td.kuerzen { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.tabelle td small { font-size: 12px; font-weight: 400; color: var(--text-blass); }

/* Summenzeile: die einzige Linie in der Tabelle */
.tabelle tfoot td, .tabelle tfoot th { border-top: 1px solid var(--linie); font-weight: var(--fett); color: var(--tinte); }
.tabelle .pille.flaeche { vertical-align: middle; }

/* Gruppenzeile (etwa je Bereich): Name mit Quadrat, etwas Luft darüber */
.tabelle tr.gruppe td { height: 46px; padding-top: 12px; vertical-align: middle; }
.tabelle tr.gruppe .bereich-zelle { font-size: 13px; font-weight: var(--fett); letter-spacing: 0.06em; text-transform: uppercase; color: var(--tinte); }
.tabelle tr.gruppe:first-child td { height: 34px; padding-top: 0; }
/* Zeile, die sich anklicken lässt */
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:focus-visible { outline: 2px solid var(--blau); outline-offset: -2px; }
.tabelle tr.gewaehlt td, .tabelle tr.gewaehlt th { background: var(--legende-flaeche); color: var(--tinte); }
.tabelle tr.gewaehlt > :first-child { border-radius: 6px 0 0 6px; }
.tabelle tr.gewaehlt > :last-child { border-radius: 0 6px 6px 0; }

/* Breite oder lange Tabelle scrollt in ihrer Karte */
.tabelle-rahmen { position: relative; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabelle-rahmen.hoch { max-height: 452px; overflow-y: auto; margin-top: 16px; }
.tabelle-rahmen.hoch .tabelle { margin-top: 0; }
.tabelle-rahmen.hoch thead th { position: sticky; top: 0; z-index: 2; height: 30px; background: var(--karte); }
.tabelle-rahmen.hoch tfoot td, .tabelle-rahmen.hoch tfoot th { position: sticky; bottom: 0; z-index: 2; background: var(--karte); }

/* Abzeichen: grauer Kasten mit Pfeil, .hoch grün, .seite orange, .runter rot */
.abzeichen {
  position: relative;
  top: -2px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--grau-flaeche);
  color: var(--text-leise);
}
.abzeichen::before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: currentColor;
  -webkit-mask: var(--z-pfeil) center / contain no-repeat;
  mask: var(--z-pfeil) center / contain no-repeat;
}
.abzeichen.hoch { color: var(--gut); }
.abzeichen.seite { color: var(--mittel); }
.abzeichen.runter { color: var(--schlecht); }
.abzeichen.runter::before { transform: rotate(180deg); }
.abzeichen.seite::before { transform: rotate(90deg); }
.abzeichen:not(.hoch):not(.runter):not(.seite)::before { width: 6px; height: 6px; border-radius: 50%; -webkit-mask: none; mask: none; }

/* Zelle mit Bereich: Quadrat in Bereichsfarbe und Name */
.bereich-zelle { display: inline-flex; align-items: center; white-space: nowrap; }
/* Zelle mit zwei Zeilen: der Name, darunter klein der Bereich mit seinem Quadrat */
.zelle-zwei { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.zelle-name { overflow: hidden; text-overflow: ellipsis; line-height: 20px; }
.zelle-marke { display: flex; align-items: center; gap: 5px; font-size: 11px; line-height: 13px; font-weight: var(--halbfett); color: color-mix(in srgb, var(--farbe, var(--blau)) 80%, var(--tinte)); }
.zelle-marke::before { content: ""; width: 6px; height: 6px; border-radius: 1.5px; background: var(--farbe, var(--blau)); }

/* --------------------------------------------------------------------------
   Reiter innerhalb einer Karte (etwa Spaltengruppen einer Tabelle): fein,
   2 px Unterstreichung
   -------------------------------------------------------------------------- */

.unterreiter { display: flex; flex: none; gap: 4px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--linie); }
.unterreiter::-webkit-scrollbar { display: none; }
.unterreiter button {
  flex: none;
  padding: 9px 12px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 14px;
  color: var(--text-leise);
  white-space: nowrap;
}
.unterreiter button:first-child { padding-left: 0; }
.unterreiter button:hover { color: var(--tinte); }
.unterreiter button.aktiv { color: var(--tinte); font-weight: var(--halbfett); border-bottom-color: var(--farbe, var(--blau)); }
.unterreiter button:focus-visible { outline: 2px solid var(--blau); outline-offset: -3px; }

/* "So wird gezählt": ruhige Zeile zum Aufklappen unter den Karten */
details.zaehlweise { margin-bottom: var(--reihe-abstand); font-size: 13px; font-weight: 400; color: var(--text-leise); }
details.zaehlweise:last-child { margin-bottom: 0; }
details.zaehlweise summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; border-radius: 4px; font-weight: var(--mittelfett); }
details.zaehlweise summary::-webkit-details-marker { display: none; }
details.zaehlweise summary::before { content: ""; width: 10px; height: 10px; background-color: currentColor; -webkit-mask: var(--z-winkel) center / contain no-repeat; mask: var(--z-winkel) center / contain no-repeat; }
details.zaehlweise[open] summary::before { transform: rotate(90deg); }
details.zaehlweise summary:hover { color: var(--tinte); }
details.zaehlweise summary:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
details.zaehlweise p { margin: 8px 0 0; max-width: 92ch; line-height: 1.5; color: var(--text); }
details.zaehlweise .spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin-top: 4px; }
details.zaehlweise b { font-weight: var(--halbfett); color: var(--tinte); }

/* Zusatz zur Auswahl in der Kopfleiste, etwa die beiden Tage bei "Von-bis" */
.zusatzzeile { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: var(--reihe-abstand); font-size: 13px; font-weight: 400; color: var(--text-leise); }
.zusatzzeile b { font-weight: var(--halbfett); color: var(--tinte); }
.zusatzzeile input[type=date] { width: 150px; height: 34px; padding: 0 12px; border-radius: 17px; font-size: 13px; }

/* --------------------------------------------------------------------------
   Knöpfe, Felder, Meldungen
   -------------------------------------------------------------------------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--blau);
  border-radius: var(--radius-klein);
  background: var(--blau);
  color: #fff;
  font-size: 14px;
  font-weight: var(--halbfett);
  white-space: nowrap;
  transition: filter 0.15s, background-color 0.15s;
}
.knopf:hover { filter: brightness(0.94); }
.knopf:disabled { opacity: 0.45; cursor: default; filter: none; }
.knopf.leise, .knopf.warnung { background: var(--karte); border-color: var(--rahmen); color: var(--tinte); font-weight: var(--mittelfett); }
.knopf.leise:hover, .knopf.warnung:hover { background: var(--feld-hover); filter: none; }
.knopf.warnung { color: color-mix(in srgb, var(--schlecht) 82%, var(--tinte)); }
.knopf.klein { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.knopf.leise.stark { font-weight: var(--halbfett); }
.knopf:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.verweis { background: none; border: 0; padding: 0; color: var(--blau); cursor: pointer; text-decoration: none; }
.verweis:hover { text-decoration: underline; }

label.feld { display: block; margin: 0 0 16px; }
label.feld span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: var(--halbfett); color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=date], select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rahmen);
  border-radius: var(--radius-klein);
  background-color: var(--karte);
  font-size: 15px;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=date]:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--blau) 45%, transparent); outline-offset: 1px; border-color: var(--blau); }
input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--blau); flex: none; }
label.haken { display: flex; gap: 8px; align-items: center; margin: 0 0 16px; font-size: 14px; }
a:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }

/* Meldungen: schmale Linie links in der Farbe, sehr heller Grund */
.meldung {
  --wertung: var(--text-blass);
  margin: 0 0 16px;
  padding: 10px 14px;
  border-left: 3px solid var(--wertung);
  border-radius: var(--radius-klein);
  background: color-mix(in srgb, var(--wertung) 9%, var(--karte));
  font-size: 14px;
  color: var(--text);
}
.meldung.fehler { --wertung: var(--schlecht); }
.meldung.ok { --wertung: var(--gut); }
.meldung.hinweis { --wertung: var(--mittel); }
.klein-grau { font-size: 13px; color: var(--text-leise); font-weight: 400; }

/* --------------------------------------------------------------------------
   Anmeldung
   -------------------------------------------------------------------------- */

.anmeldung { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.anmeldung .marke { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; color: var(--tinte); font-size: 17px; font-weight: var(--fett); }
.anmeldung .marke .logo { display: block; }
.anmeldekarte { width: 100%; max-width: 420px; padding: 32px; background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); }
.anmeldekarte.breit { max-width: 540px; }
.anmeldekarte h1 { margin: 0 0 6px; font-size: 20px; line-height: 27px; font-weight: var(--fett); color: var(--tinte); }
.anmeldekarte p.unter { margin: 0 0 24px; font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--text-leise); }
.anmeldekarte .knopf.voll { width: 100%; height: 42px; margin-top: 4px; }
.anmeldekarte .fuss { margin: 16px 0 0; font-size: 13px; font-weight: 400; color: var(--text-leise); text-align: center; }
.anmeldekarte .fuss + .fuss { margin-top: 8px; }
.anmeldekarte .fuss a { color: var(--blau); }
.schritte { margin: 0 0 20px; padding-left: 20px; font-size: 14.5px; line-height: 1.5; }
.schritte li { margin-bottom: 6px; padding-left: 2px; }
.schritte li::marker { color: var(--text-leise); }
.qr { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 0 0 20px; }
/* Der QR-Code bleibt in beiden Ansichten schwarz auf weiß, damit ihn jede Kamera liest */
.qr svg { width: 168px; height: 168px; padding: 6px; border-radius: var(--radius-klein); background: #fff; box-shadow: 0 0 0 1px var(--rahmen); }
.qr > div { flex: 1 1 200px; min-width: 0; }
.qr p { margin: 12px 0 0; font-size: 13px; }
.qr p a { color: var(--blau); }
.schluessel {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-klein);
  background: var(--legende-flaeche);
  font: 500 14px/1.6 var(--festbreit);
  color: var(--tinte);
  word-break: break-all;
}
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.codes li {
  padding: 9px;
  border-radius: var(--radius-klein);
  background: var(--legende-flaeche);
  font: 500 15px var(--festbreit);
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--tinte);
}
.reihe { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

/* --------------------------------------------------------------------------
   Benutzerverwaltung
   -------------------------------------------------------------------------- */

.einladen form { display: grid; grid-template-columns: 1fr 1fr 240px; gap: 0 16px; align-items: end; margin-top: 18px; }
.einladen form > .breit { grid-column: 1 / -1; }
.einladen form > .breit:empty { display: none; }
.einladen form .knopf.voll { justify-self: start; margin-bottom: 8px; }
.einladen .klein-grau.breit { margin-bottom: 8px; }
.freigaben { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px; }
.freigaben label, .freigaben-zeile label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; white-space: nowrap; }
.link-feld { display: flex; gap: 8px; margin-top: 8px; }
.link-feld input { height: 30px; font-size: 12px; font-family: var(--festbreit); }
.verwaltung .tabelle td { height: auto; padding-top: 10px; padding-bottom: 10px; padding-right: 16px; vertical-align: middle; font-size: 14.5px; }
.verwaltung .tabelle td .freigaben-zeile { display: flex; flex-wrap: wrap; gap: 5px 16px; min-width: 300px; max-width: 420px; }
.verwaltung .tabelle td .freigaben-zeile label { font-size: 13px; font-weight: 400; }
.verwaltung .tabelle td select { width: auto; height: 32px; padding: 0 8px; font-size: 13.5px; }
.verwaltung .tabelle td .aktionen { display: flex; flex-wrap: wrap; gap: 6px; min-width: 232px; max-width: 330px; }
.status { display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vergleich-kraeftig); }
.status.aktiv::before { background: var(--gut); }
.status.eingeladen::before { background: var(--mittel); }
.status.gesperrt::before { background: var(--schlecht); }
.status.gesperrt { color: color-mix(in srgb, var(--schlecht) 82%, var(--tinte)); }

/* --------------------------------------------------------------------------
   Schmale Fenster: Raster bricht um, Kartenhöhen bleiben. Die Schwellen
   folgen der Breite, die einer Karte bleibt: Eine Kennzahlkarte braucht rund
   215 px für Zahl und Mini-Balken, eine Karte mit Ring rund 420 px. Mit der
   zweiten Leiste ist der Inhalt 208 px schmaler, die Schwellen liegen höher.
   -------------------------------------------------------------------------- */

/* Kennzahlkarten zu je drei: sechs Karten in zwei Reihen, fünf als drei und zwei */
@media (max-width: 1500px) {
  .raster-kz.n6 { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1700px) {
  .mit-unterleiste .raster-kz.n6 { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Drei Karten: zwei nebeneinander, die dritte über die ganze Breite */
  .mit-unterleiste .raster-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mit-unterleiste .raster-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; }
}
@media (max-width: 1500px) {
  .mit-unterleiste .raster-kz.n5 { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mit-unterleiste .raster-kz.n5 > * { grid-column: span 2; }
  .mit-unterleiste .raster-kz.n5 > :nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 1280px) {
  .raster-kz { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .raster-kz.n4, .raster-kz.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-kz.n5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .raster-kz.n5 > * { grid-column: span 2; }
  .raster-kz.n5 > :nth-child(n+4) { grid-column: span 3; }
  .raster-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; }
  .einladen form { grid-template-columns: 1fr 1fr; }
  details.zaehlweise .spalten { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  .mit-unterleiste .raster-2, .mit-unterleiste .raster-3, .mit-unterleiste .raster-2-1 { grid-template-columns: minmax(0, 1fr); }
  .mit-unterleiste .raster-kz, .mit-unterleiste .raster-kz.n6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mit-unterleiste .raster-kz.n5 > *, .mit-unterleiste .raster-kz.n5 > :nth-child(n+4) { grid-column: span 3; }
  .mit-unterleiste .raster-kz.n5 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  :root { --inhalt-links: 20px; --inhalt-rechts: 20px; --inhalt-oben: 20px; }
  .raster-2, .raster-3, .raster-2-1 { grid-template-columns: minmax(0, 1fr); }
  .raster-kz, .raster-kz.n4, .raster-kz.n5, .raster-kz.n6, .mit-unterleiste .raster-kz.n5, .mit-unterleiste .raster-kz.n6 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-kz.n5 > *, .raster-kz.n5 > :nth-child(n+4), .mit-unterleiste .raster-kz.n5 > *, .mit-unterleiste .raster-kz.n5 > :nth-child(n+4) { grid-column: auto; }
  .raster-kz.n5 > :last-child, .mit-unterleiste .raster-kz.n5 > :last-child { grid-column: 1 / -1; }
  .ring { flex-wrap: wrap; justify-content: center; }

  .zeitraum { gap: 6px; }
  .zeitraum-pille, select.zeitraum-wahl { padding: 0 12px; }
  select.zeitraum-wahl { padding-right: 28px; }
  .kopf-zelle.konto-knopf { width: 80px; }
  .kopf-zelle.konto-knopf .winkel { display: none; }

  /* Zweite Leiste eingeklappt: unter der Kopfleiste eine Zeile mit Symbol und
     Namen der aktuellen Unterseite, ein Tipp darauf klappt die Liste auf */
  .rahmen.mit-unterleiste { --links: var(--seitenleiste-b); }
  .unterleiste { position: static; width: auto; margin-left: var(--seitenleiste-b); padding: 0; border-right: 0; border-top: 1px solid var(--linie); overflow: visible; }
  .unterleiste .bereich { display: none; }
  .unterleiste .schalter {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 8px var(--inhalt-rechts) 8px var(--inhalt-links);
    border: 0;
    background: none;
    font-size: 15px;
    font-weight: var(--halbfett);
    line-height: 1.3;
    color: var(--tinte);
    text-align: left;
  }
  .unterleiste .schalter .symbol { color: var(--farbe, var(--blau)); }
  .unterleiste .schalter .seite { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .unterleiste .schalter::after { content: ""; flex: none; width: 10px; height: 10px; background-color: var(--text-leise); -webkit-mask: var(--z-winkel) center / contain no-repeat; mask: var(--z-winkel) center / contain no-repeat; transform: rotate(90deg); }
  .unterleiste.offen .schalter::after { transform: rotate(-90deg); }
  .unterleiste .liste { display: none; padding: 0 12px 12px; }
  .unterleiste.offen .liste { display: flex; }
  .unterleiste .liste a { min-height: 42px; }
  .einladen form { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --seitenleiste-b: 54px; --inhalt-links: 12px; --inhalt-rechts: 12px; --inhalt-oben: 14px; --karte-innen: 16px; --spalte-abstand: 12px; --reihe-abstand: 16px; }
  .seitenleiste .logo svg { width: 31px; height: 30px; }
  .reiter.aktiv::before { left: 34px; width: 2px; }
  .kopfleiste { column-gap: 8px; }
  .kopf-titel { font-size: 17px; white-space: normal; overflow: visible; padding: 8px 0; line-height: 22px; }
  .kopf-zelle { width: 46px; }
  .kopf-zelle.konto-knopf { width: 62px; }
  .kopf-bild { width: 38px; height: 38px; }
  .kopf-zelle .kopf-bild > * { width: 31px; height: 31px; padding: 6px; }
  .raster-kz, .raster-kz.n4, .raster-kz.n5, .raster-kz.n6, .mit-unterleiste .raster-kz, .mit-unterleiste .raster-kz.n5, .mit-unterleiste .raster-kz.n6 { grid-template-columns: minmax(0, 1fr); }
  .raster-kz.n5 > :last-child, .mit-unterleiste .raster-kz.n5 > :last-child { grid-column: auto; }
  .karte-titel { font-size: 18px; }
  /* Legende oder Werkzeug im Kopf einer Karte rutschen unter den Titel */
  .karte-kopf { flex-wrap: wrap; row-gap: 4px; }
  .tabelle td.kuerzen { max-width: 150px; }
  .kopfzahlen { flex-wrap: wrap; gap: 10px 22px; }
  .kopfzahlen > :first-child { flex-basis: 100%; }
  /* Fortschrittsliste am Handy: der Name steht ganz da, der Balken darunter */
  .fortschritt { display: block; padding-bottom: 4px; }
  .fortschritt > li { display: grid; grid-template-columns: 34px minmax(0, 1fr) max-content 21px; grid-template-areas: "bild name wert knopf" "bild balken balken knopf"; align-items: center; row-gap: 3px; margin-bottom: 14px; }
  .fortschritt-bild { grid-area: bild; }
  .fortschritt-name { grid-area: name; min-width: 0; padding: 0 8px 0 12px; font-size: 14.5px; }
  .fortschritt-balken { grid-area: balken; margin: 0 10px 0 12px; }
  .fortschritt-wert { grid-area: wert; padding: 0 8px 0 0; }
  .fortschritt > li > :last-child { grid-area: knopf; }
  .ring-legende { flex-basis: 100%; max-width: none; }
  .ring.mit-werten .ring-legende { max-width: none; }
  .tabelle td { font-size: 14.5px; }
  .anmeldekarte { padding: 24px 20px; }
  .qr { justify-content: center; }
  .konto-menue { right: 6px; }
}
