/* GL-Immo-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;
  --tabellen-linie: #eceef3;
  --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;
  --ki-flaeche: #f5f2ff;
  --ki-rand: #e4ddff;
  --ki-akzent: #6d4fe0;
  --ki-innen: #ffffff;
  --laufend-flaeche: #fffbe8;
  --zuletzt-flaeche: #f0f5ff;

  /* 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: #12a594;   /* Türkisgrün, nie Orange: Orange wirkt wie schlecht (Sebastian 02.12.2026) */
  --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;
  --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-weiss: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 8.4V1.8M2.4 4.3 5 1.7l2.6 2.6' fill='none' stroke='%23fff' stroke-width='1.7' 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.
   Kräftiges Dunkelblau statt milchigem Graublau (Sebastian 02.12.2026: "der Dark Mode ein bisschen kräftiger ... sieht so
   milchig aus"): Fläche im Ton des Menüs, Karten eine Stufe heller, das Menü selbst noch dunkler (siehe unten).
   -------------------------------------------------------------------------- */

:root[data-thema="dunkel"] {
  color-scheme: dark;

  --flaeche: #18213a;
  --karte: #222d4b;
  --linie: #2c385a;
  --tabellen-linie: #33416a;
  --ki-flaeche: #29295a;
  --ki-rand: #43438a;
  --ki-akzent: #c4b6ff;
  --ki-innen: #222d4b;
  --laufend-flaeche: #2e3450;
  --zuletzt-flaeche: #26365e;
  --rahmen: #3a4870;
  --grau-flaeche: #2d3a5f;
  --schiene: #323f66;
  --schiene-hell: #2a3659;
  --gitter: #2c385a;
  --vergleich: #4a5a82;
  --legende-flaeche: #2a3657;
  --tooltip: #0c1222;
  --tooltip-text: #b2c1d7;
  --vergleich-kraeftig: #6a7ca3;
  --lot: #55678f;
  --reiter-rand: #2c385a;
  --knopf-hover: #38476f;
  --schiene-aktiv: #36446d;
  --legende-aktiv: #35436c;
  --marke-innen: #222d4b;
  --zeitraum-aktiv: #ffffff;
  --zeitraum-aktiv-text: #18213a;
  --feld-hover: #2a3657;

  --tinte: #ffffff;
  --text: #f1f6fb;
  --text-leise: #a9b8d2;
  --text-blass: #8191b2;
  --text-achse: #6f7fa2;
  --icon: #4f6189;
  --punkte: #5b6d94;

  /* 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 10px rgba(5, 10, 25, 0.35);
  --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); --reihe-7: #d4a017; --reihe-8: #6f7f95; --reihe-9: #a0522d; --reihe-10: #4b4a9c; }
.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); }
.farbe-7 { --farbe: var(--reihe-7); }
.farbe-8 { --farbe: var(--reihe-8); }
.farbe-9 { --farbe: var(--reihe-9); }
.farbe-10 { --farbe: var(--reihe-10); }

.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); }

.unterleiste {
  position: fixed;
  z-index: 25;
  inset: 0 auto 0 var(--seitenleiste-b);
  width: auto;
  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; }

/* --------------------------------------------------------------------------
   Dunkles Menü links (Sebastian, 25.11.2026: "versuch bitte mal das linke menü
   mit dunkleren hintergrudn zu machen dass es sich absetzt von dem andreen ...
   das grunddesign kannst du aber beibehalten."). Vorbild Impuls 6: dunkelblaue,
   rechts abgerundete Leiste, helle Symbole und Schrift, aktiver Punkt hell
   hinterlegt. Es wechseln nur Farbwerte innerhalb der beiden Leisten, Maße und
   Aufbau bleiben. Gilt hell wie dunkel.
   -------------------------------------------------------------------------- */

.seitenleiste,
.unterleiste {
  --karte: #1f2a44;
  --linie: #2c3a59;
  --rahmen: #3b4b6d;
  --grau-flaeche: #34466c;
  --reiter-rand: #3b4f78;
  --knopf-hover: #3b4f78;
  --feld-hover: #2a3757;
  --tinte: #ffffff;
  --text: #dfe6f3;
  --text-leise: #c3cde0;
  --text-blass: #8d9bb8;
  --icon: #8d9bb8;
  --punkte: #5f6f90;
  color-scheme: dark;
}
.seitenleiste .reiter:hover, .seitenleiste .reiter:focus-visible { color: #ffffff; }
.seitenleiste .reiter.aktiv { color: #ffffff; background: var(--blau); }
.seitenleiste .logo { border-right-color: transparent; }
.unterleiste .liste a.aktiv .symbol { color: #ffffff; }
.unterleiste .liste a.aktiv { background: var(--grau-flaeche); color: #ffffff; }
.unterleiste { border-right: 0; border-radius: 0 18px 18px 0; box-shadow: 4px 0 18px rgba(20, 30, 55, 0.12); }

.seitenleiste { border-radius: 0 18px 18px 0; box-shadow: 4px 0 18px rgba(20, 30, 55, 0.12); }

/* Im Dunkelmodus ist die Fläche selbst dunkelblau, das Menü setzt sich mit fast Schwarzblau davon ab */
:root[data-thema="dunkel"] .seitenleiste,
:root[data-thema="dunkel"] .unterleiste {
  --karte: #0d1324;
  --linie: #1b2440;
  --rahmen: #27335a;
  --grau-flaeche: #1f2b4d;
  --reiter-rand: #243058;
  --knopf-hover: #243058;
  --feld-hover: #19223d;
  box-shadow: 4px 0 18px rgba(0, 0, 0, 0.35);
}

/* Namen der Hauptbereiche stehen neben den Symbolen (Sebastian, 25.11.2026: "und
   links ds hauptmenü da müsen die begriffe stehen ... man weiß inks nicht direkt
   was ist markteitng, was ist slaes usw."). Das Aufklappen der zweiten Leiste
   bleibt. Am Handy bleibt die Leiste schmal mit Symbolen und Tooltip. */
:root { --seitenleiste-b: 224px; }
.seitenleiste { align-items: stretch; }
.seitenleiste .logo { width: 100%; justify-items: start; padding-left: 16px; }
.seitenleiste .reiter {
  width: auto;
  height: 40px;
  margin: 0 12px 6px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  font-size: 14.5px;
  font-weight: var(--halbfett);
  color: var(--text-leise);
  white-space: nowrap;
}
.seitenleiste .reiter [data-icon] { flex: none; color: var(--icon); }
.seitenleiste .reiter:hover, .seitenleiste .reiter:focus-visible { background: var(--feld-hover); color: #ffffff; }
.seitenleiste .reiter:hover [data-icon], .seitenleiste .reiter:focus-visible [data-icon] { color: #ffffff; }
.seitenleiste .reiter.aktiv { box-shadow: none; }
.seitenleiste .reiter.aktiv [data-icon] { color: #ffffff; }
.seitenleiste .reiter.aktiv::before { display: none; }
.seitenleiste .reiter-name { overflow: hidden; text-overflow: ellipsis; }
.seitenleiste .reiter[data-tipp]::after { display: none; }
.seitenleiste .seitenleiste-trenner { width: auto; margin: 8px 12px 20px; }
.seitenleiste .seitenleiste-knopf { margin-left: 24px; }

@media (max-width: 640px) {
  :root { --seitenleiste-b: 54px; }
  .seitenleiste { align-items: center; }
  .seitenleiste .logo { justify-items: center; padding-left: 0; }
  .seitenleiste .reiter { width: 34px; height: 34px; margin: 0 0 16px; padding: 0; justify-content: center; }
  .seitenleiste .reiter-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .seitenleiste .reiter[data-tipp]::after { display: block; }
  .seitenleiste .seitenleiste-trenner { width: 40px; margin: 8px 0 23px; }
  .seitenleiste .seitenleiste-knopf { margin-left: 0; }
}

/* --------------------------------------------------------------------------
   Eine Leiste (Sebastian, 25.11.2026: "Nur noch eine Leiste. Die Unterpunkte
   klappen direkt unter dem gewählten Bereich auf, leicht eingerückt; die
   anderen Bereiche rutschen nach unten"). Die Leiste bleibt so breit wie die
   Hauptleiste allein. Ein Knopf klappt sie auf reine Symbole zusammen. Die
   zweite Leiste (.unterleiste) gibt es nur noch am Handy, als Zeile im Inhalt.
   -------------------------------------------------------------------------- */

.unterleiste { display: none; }
.seitenleiste { overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--punkte) transparent; }

.unterliste {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 12px 10px 28px;
  padding-left: 8px;
  border-left: 1px solid var(--linie);
}
.unterliste a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--text);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  transition: background-color 0.15s;
}
.unterliste a > span { flex: 1 1 auto; min-width: 0; }
.unterliste .symbol { flex: none; width: 16px; height: 16px; color: var(--text-blass); }
.unterliste a .marke-klein { display: inline-block; margin-left: 4px; padding: 0 4px; font-size: 9px; line-height: 14px; vertical-align: 1px; }
.unterliste a:hover, .unterliste a:focus-visible { background: var(--feld-hover); color: #ffffff; outline: none; }
.unterliste a:focus-visible { box-shadow: 0 0 0 2px var(--blau); }
.unterliste a.aktiv { background: var(--grau-flaeche); color: #ffffff; font-weight: var(--halbfett); }
.unterliste a.aktiv .symbol { color: #ffffff; }
.unterliste a.folgt:not(.aktiv) { color: var(--text-blass); }
.unterliste a.folgt:not(.aktiv) .symbol { color: var(--punkte); }

.seitenleiste-fuss { display: flex; gap: 8px; margin-left: 24px; padding-bottom: 16px; }
.seitenleiste .seitenleiste-fuss .seitenleiste-knopf { margin-left: 0; }
.seitenleiste-ein [data-icon] { background: transparent; color: var(--text-leise); padding: 2px; width: 22px; height: 22px; transition: transform 0.2s; }
.seitenleiste-ein:hover [data-icon] { color: #ffffff; }
.eingeklappt .seitenleiste-ein [data-icon] { transform: rotate(180deg); }

@media (min-width: 641px) {
  .rahmen.eingeklappt { --seitenleiste-b: 64px; }
  .eingeklappt .seitenleiste { align-items: center; overflow: visible; }
  .eingeklappt .seitenleiste .logo { justify-items: center; padding-left: 0; }
  .eingeklappt .seitenleiste .reiter { width: 40px; height: 40px; margin: 0 0 8px; padding: 0; justify-content: center; }
  .eingeklappt .seitenleiste .reiter-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .eingeklappt .seitenleiste .reiter[data-tipp]::after { display: block; }
  .eingeklappt .unterliste { display: none; }
  .eingeklappt .seitenleiste .seitenleiste-trenner { width: 40px; margin: 8px 0 16px; }
  .eingeklappt .seitenleiste-fuss { flex-direction: column; align-items: center; margin-left: 0; }
}
@media (max-width: 640px) {
  .unterliste, .seitenleiste-ein { display: none; }
  .seitenleiste-fuss { margin-left: 0; justify-content: center; }
  .seitenleiste { overflow-y: auto; }
}

/* Am Handy bleibt die zweite Leiste eine helle Zeile im Inhalt */
@media (max-width: 640px) {
  .unterleiste {
    --karte: inherit; --linie: inherit; --rahmen: inherit; --grau-flaeche: inherit;
    --reiter-rand: inherit; --knopf-hover: inherit; --feld-hover: inherit; --tinte: inherit;
    --text: inherit; --text-leise: inherit; --text-blass: inherit; --icon: inherit; --punkte: inherit;
    color-scheme: inherit;
  }
  .unterleiste .liste a.aktiv { color: var(--tinte); }
  .unterleiste .liste a.aktiv .symbol { color: var(--farbe, var(--blau)); }
  .unterleiste {
    border-radius: 0;
    box-shadow: none;
  }
}

/* --------------------------------------------------------------------------
   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. Über Beispielwerten steht dort die Marke
   "Beispielwerte", ohne eingespielte Daten "noch keine". */
.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);
}

/* Zeitraum grau hinter dem Titel, in derselben Zeile ("Umsatzkette letzte 30 Tage").
   Reicht die Breite nicht, rutscht er ganz in die nächste Zeile, nie abgeschnitten. */
.karte-zeitraum { display: inline-block; margin-left: 10px; font-size: 13px; line-height: 20px; font-weight: 400; color: var(--text-blass); white-space: nowrap; }
/* Fehlende Zahl: deutlich, aber gedämpft, nie ein erfundener Wert */
.ohne-wert { font-size: 13px; font-weight: var(--mittelfett); color: var(--text-blass); white-space: nowrap; }
.karte-text.ohne-daten { margin: 26px 0 18px; font-size: 15px; font-weight: var(--mittelfett); color: var(--text-blass); }
/* Eine Karte ohne Daten braucht die feste Höhe ihrer Reihe nicht */
.raster > .karte:has(> .karte-text.ohne-daten) { min-height: 0; }
/* Schlank (30.11.2026): ein Diagramm allein in der Reihe behält die Höhe der großen Karten,
   eine kleine Tabelle allein nimmt nur ihre eigene Höhe */
.raster-1 > .karte.hoch { min-height: var(--reihe2-h); }
.raster > .karte.kompakt { min-height: 0; }

.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));
}

/* Legendeneintrag für die gestrichelte Zielmarke */
.legende > .strich::before { width: 14px; height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--text-leise); }
/* Legendeneintrag für den hellen Teil (gebucht) */
.legende > .hell::before { border-radius: 2px; background: color-mix(in srgb, var(--farbe, var(--blau)) 24%, var(--karte)); }

/* 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); }
.kz-luecke { fill: var(--schiene); }
/* Mit Tooltip je Balken: der überfahrene Balken tritt hervor */
.kz-balken.mit-tipp g:hover .kz-blass { fill-opacity: 0.55; }
.kz-balken.mit-tipp .d-treffer { cursor: default; pointer-events: all; }

/* --------------------------------------------------------------------------
   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); }
/* Chips in Tabellen (Status, Prio), Farbe nach Art */
.pille.chip-gut { --wertung: var(--gut); }
.pille.chip-blau { --wertung: var(--blau); }
.pille.chip-violett { --wertung: var(--violett); }
.pille.chip-neutral { --wertung: var(--tinte); }
.pille.chip-leise { --wertung: var(--text-leise); }
.pille[class*="chip-"]::before { display: none; }
.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; }
/* Veränderung mit Richtung: kleiner Pfeil nach oben oder unten vor der Zahl, in der Farbe des Urteils */
.pille.flaeche.mittel { --wertung: var(--mittel); }
.pille.flaeche.hoch::before, .pille.flaeche.runter::before {
  display: block;
  width: 0;
  height: 0;
  border-radius: 0;
  background: none;
  border: 4px solid transparent;
  border-top-width: 0;
  border-bottom: 5px solid currentColor;
}

/* --------------------------------------------------------------------------
   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 neben einer aufklappbaren Tabelle: feste Höhe, die Karte wächst nicht mit der Nachbarkarte */
.karte.nicht-strecken { align-self: start; }
.diagramm.feste-hoehe { flex: none; height: 370px; }
.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); }
/* Gestrichelte Zielmarke im Balkendiagramm */
.d-ziel-text { font-size: 12px; font-weight: var(--halbfett); fill: var(--text-leise); paint-order: stroke; stroke: var(--karte); stroke-width: 4px; stroke-linejoin: round; }
.d-ziel { fill: none; stroke: var(--text-leise); stroke-width: 2; stroke-dasharray: 6 4; stroke-linejoin: round; }
/* Paare: der helle Teil ist die Farbe des Balkens, blass gemischt */
.d-schiene[style*="--farbe"] { fill: color-mix(in srgb, var(--farbe) 24%, var(--karte)); }
.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: var(--pfeil, 50%);
  top: 100%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--tooltip);
  border-bottom-width: 0;
}
.tipp[hidden] { display: none; }
/* Tooltip an einem beliebigen Element (DS.tipp): hängt am body, bleibt im Fenster, bricht um */
.tipp.schwebend {
  position: fixed;
  z-index: 80;
  max-width: min(300px, calc(100vw - 16px));
  padding: 8px 12px 9px;
  text-align: left;
  white-space: normal;
  transform: none;
}
.tipp.schwebend::after { left: var(--pfeil, 50%); }
.tipp.schwebend.unten::after { top: auto; bottom: 100%; border-top-width: 0; border-bottom: 6px solid var(--tooltip); }
.tipp.schwebend .tipp-titel { margin-bottom: 1px; }
.tipp.schwebend .tipp-wert { font-size: 15px; line-height: 20px; }
.tipp.schwebend .tipp-zeile { justify-content: flex-start; margin-top: 3px; line-height: 17px; }
.tipp.schwebend .tipp-zeile:not(.mit-farbe)::before { display: none; }
.tipp.schwebend .tipp-zeile:only-child { margin-top: 0; color: #fff; }
.tipp-paar { display: flex; justify-content: space-between; gap: 18px; margin-top: 3px; font-weight: 500; color: var(--tooltip-text); font-variant-numeric: tabular-nums; }
.tipp-paar > :last-child { color: #fff; font-weight: var(--halbfett); white-space: nowrap; }
.tipp-wert + .tipp-paar, .tipp-titel + .tipp-paar { margin-top: 6px; }
.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: der eine Baustein für alle Seiten (DS.tabelle, Sebastian 26.11.2026)
   Ruhige Kopfzeile, ganz dünne waagerechte Trennlinien zwischen den Zeilen,
   Zahlen rechts mit gleicher Ziffernbreite, vorn das Abzeichen mit Pfeil,
   Veränderungen als Pille mit Pfeil. Die Namensspalte bleibt stehen, wenn die
   Tabelle in ihrem Rahmen nach rechts scrollt. Seitenmodule legen keine
   eigenen Tabellenregeln an.
   -------------------------------------------------------------------------- */

/* Lesbarkeit (Sebastian 02.12.2026): Zahlen kleiner, 14 px statt der Grundschrift */
.tabelle { width: 100%; margin-top: 16px; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: 14px; }
/* Jede Zelle trägt die Fläche ihrer Zeile, damit die feste Spalte beim Scrollen deckt */
.tabelle tr { --zeile: var(--karte); }
.tabelle th, .tabelle td { background: var(--zeile); padding: 0 8px; white-space: nowrap; text-align: left; }
.tabelle th:first-child, .tabelle td:first-child { padding-left: 2px; }
.tabelle th:last-child, .tabelle td:last-child { padding-right: 2px; }

/* Kopfzeile: klein, grau, darunter ein durchgehender blauer Strich, in allen Tabellen gleich (Sebastian 02.12.2026) */
.tabelle thead th {
  height: 34px;
  font-size: 12.5px;
  font-weight: var(--halbfett);
  color: var(--text-leise);
  vertical-align: middle;
  border-bottom: 2px solid var(--blau);
}
.tabelle thead th.mit-tipp { cursor: help; }
/* Zeile mit Spaltengruppen über dem Kopf (etwa Ads, Vertrieb) */
.tabelle thead tr.spaltengruppen th { height: 24px; font-size: 11px; font-weight: var(--halbfett); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-blass); border-bottom: 0; }

/* Zeilen: 42 px hoch, dazwischen die dünne Trennlinie */
.tabelle tbody td, .tabelle tbody th, .tabelle tfoot td, .tabelle tfoot th { height: 42px; font-size: inherit; font-weight: inherit; color: inherit; }
.tabelle tbody td, .tabelle tbody th { border-bottom: 1px solid var(--tabellen-linie); }
.tabelle tbody tr:last-child td, .tabelle tbody tr:last-child th { border-bottom: 0; }
.tabelle tbody th.name { font-weight: var(--mittelfett); color: var(--tinte); }
.tabelle tbody tr:not(.gruppe):not(.leer-zeile):hover { --zeile: var(--feld-hover); }
.tabelle.dicht { margin-top: 4px; }
.tabelle.dicht tbody td, .tabelle.dicht tbody th { height: 36px; }

/* Schmale Spalte für das Abzeichen */
.tabelle .abz { width: 31px; min-width: 31px; padding-right: 0; }
.tabelle .rechts { text-align: right; }
/* Namensspalte: gekürzt, wenn sie zu lang wird; der ganze Name steht beim Überfahren */
.tabelle .name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.tabelle td.kuerzen, .tabelle th.kuerzen { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.tabelle td.umbruch { white-space: normal; }
/* Kopfzeilen dürfen umbrechen, wenn viele Spalten in eine halbe Karte müssen (Tabelle mit Klasse kopf-umbruch) */
.tabelle.kopf-umbruch thead th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.tabelle td.blass, .tabelle tr.ohne-daten td { color: var(--text-blass); }
.tabelle td.stark { font-weight: var(--fett); color: var(--tinte); }
.tabelle td.leer { height: 86px; font-size: 15px; font-weight: var(--mittelfett); color: var(--text-blass); white-space: normal; }
.tabelle small { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--text-blass); }
.tabelle .pille.flaeche { vertical-align: middle; }
/* Beginn einer Spaltengruppe: feine senkrechte Linie */
.tabelle .ab { border-left: 1px solid var(--tabellen-linie); padding-left: 12px; }

/* Summenzeile: fett, darüber die kräftigere Linie */
.tabelle tfoot td, .tabelle tfoot th { border-top: 1px solid var(--linie); font-weight: var(--fett); color: var(--tinte); }
.tabelle tbody:has(+ tfoot) tr:last-child td, .tabelle tbody:has(+ tfoot) tr:last-child th { border-bottom: 0; }

/* Gruppenkopf (etwa ein Splittest oder eine Kampagne) und eingerückte Unterzeilen */
.tabelle tr.gruppe th { height: 38px; padding-top: 6px; border-bottom: 1px solid var(--tabellen-linie); font-size: 13px; font-weight: var(--fett); color: var(--tinte); }
.tabelle .gruppen-name { position: sticky; left: 2px; display: inline-flex; align-items: center; }
.tabelle tr.unterzeile th.name { padding-left: 20px; font-weight: 400; color: var(--text); }
.tabelle.mit-abzeichen tr.unterzeile th.name { padding-left: 14px; }
.tabelle tr.unterzeile .abz { padding-left: 12px; }

/* Zeile, die sich anklicken lässt */
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:focus-visible { outline: 2px solid var(--blau); outline-offset: -2px; }
/* Laufender Zeitraum ganz leicht gelb (Sebastian 02.12.2026) */
.tabelle tbody tr.laufend { --zeile: var(--laufend-flaeche); }
/* Zuletzt Gelaufenes ganz leicht blau (Sebastian 02.12.2026) */
.tabelle tbody tr.zuletzt { --zeile: var(--zuletzt-flaeche); }
.tabelle tbody tr.gewaehlt { --zeile: var(--legende-flaeche); color: var(--tinte); }

/* Sortieren: jede Spaltenüberschrift ist ein Knopf, das kleine Dreieck zeigt die Richtung */
.tabelle thead th .sortier-knopf {
  display: flex; align-items: center; gap: 5px; width: 100%; max-width: 100%; padding: 0; margin: 0; line-height: inherit; text-align: inherit;
  border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
  white-space: nowrap; cursor: pointer;
}
.tabelle thead th .sortier-knopf:hover { color: var(--tinte); }
.tabelle thead th .sortier-knopf:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; border-radius: 3px; }
.tabelle thead th .sortier-knopf::after { content: ''; flex: none; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: 0; }
.tabelle thead th[aria-sort="descending"] .sortier-knopf::after { border-top: 5px solid currentColor; opacity: 1; }
.tabelle thead th[aria-sort="ascending"] .sortier-knopf::after { border-bottom: 5px solid currentColor; opacity: 1; }
.tabelle thead th[aria-sort] .sortier-knopf { color: var(--tinte); }
.tabelle thead th.rechts .sortier-knopf { flex-direction: row-reverse; justify-content: flex-start; }

/* Aufklappbare Zeile mit ruhiger Detailzeile darunter: je Angabe Bezeichnung und Wert */
.tabelle tr.aufklappbar { cursor: pointer; }
.tabelle tr.aufklappbar:focus-visible { outline: 2px solid var(--blau); outline-offset: -2px; }
.tabelle tr.detailzeile { --zeile: var(--legende-flaeche); }
.tabelle tbody tr.detailzeile td { height: auto; padding: 10px 14px 12px; white-space: normal; border-bottom: 1px solid var(--tabellen-linie); }
.tabelle .detail-paare { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 20px; margin: 0; font-size: 13.5px; line-height: 20px; }
.tabelle .detail-paare dt { margin: 0; color: var(--text-leise); }
.tabelle .detail-paare dd { margin: 0; color: var(--tinte); font-weight: var(--halbfett); }
/* Zeile "N weitere": ein Knopf, der die übrigen Zeilen auf- und zuklappt */
.tabelle tbody tr.weitere-zeile td { height: 38px; padding: 0 2px; }
.tabelle .weitere-knopf { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--text-leise); cursor: pointer; }
.tabelle .weitere-knopf:hover { color: var(--tinte); }
.tabelle .weitere-knopf:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; border-radius: 3px; }
.tabelle .weitere-knopf::before { content: ''; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 5px solid currentColor; transition: transform 0.12s; }
.tabelle .weitere-knopf[aria-expanded="true"]::before { transform: rotate(90deg); }

/* Name mit Farbpunkt davor (ein Funnel hat überall dieselbe Farbe) */
.zelle-punkt { display: inline-flex; align-items: center; max-width: 100%; min-width: 0; vertical-align: middle; }
.zelle-punkt .bereichspunkt { width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; }
.zelle-punkt > :last-child { overflow: hidden; text-overflow: ellipsis; }
/* Roter Punkt als Markierung einer Zeile (etwa eine Anzeige zum Abschalten) */
.zeilen-punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--schlecht); }

/* Breite oder lange Tabelle scrollt in ihrem Rahmen (DS.tabellenRahmen), die Namensspalte bleibt stehen */
.tabelle-rahmen { position: relative; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabelle-rahmen .fest { position: sticky; left: 0; z-index: 1; }
.tabelle-rahmen .mit-abzeichen .name.fest { left: 31px; }
.tabelle-rahmen.gescrollt .name.fest { box-shadow: inset -1px 0 0 var(--linie); }
.tabelle-rahmen.hoch { max-height: 560px; overflow-y: auto; margin-top: 14px; padding-right: 14px; }
.tabelle-rahmen.hoch .tabelle { margin-top: 0; }
.tabelle-rahmen.hoch thead th { position: sticky; top: 0; z-index: 2; }
/* Mit Spaltengruppen darüber rückt die zweite Kopfzeile unter die erste */
.tabelle-rahmen.hoch thead tr.spaltengruppen + tr th { top: 24px; }
.tabelle-rahmen.hoch thead th.fest { z-index: 3; }
.tabelle-rahmen.hoch tfoot td, .tabelle-rahmen.hoch tfoot th { position: sticky; bottom: 0; z-index: 2; }
.tabelle-rahmen.hoch tfoot .fest { z-index: 3; }

/* 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; }


/* 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: sehr heller Grund, kleiner Punkt in der Farbe, keine Kante links */
.meldung {
  --wertung: var(--text-blass);
  margin: 0 0 16px;
  position: relative;
  padding: 10px 14px 10px 32px;
  border-radius: var(--radius-klein);
  background: color-mix(in srgb, var(--wertung) 9%, var(--karte));
  font-size: 14px;
  color: var(--text);
}
.meldung::before { content: ""; position: absolute; left: 14px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--wertung); }
.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 tbody td, .verwaltung .tabelle tbody th { height: auto; padding-top: 10px; padding-bottom: 10px; padding-right: 16px; vertical-align: middle; font-size: 14.5px; }
.verwaltung .tabelle tbody th.name { font-weight: 400; color: inherit; }
.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.
   -------------------------------------------------------------------------- */

/* Sieben Karten (Dashboard mit Werbebudget, 02.12.2026): unter 1800 px vier und drei */
@media (max-width: 1800px) {
  .raster-kz.n7 { grid-auto-flow: row; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .raster-kz.n7 > * { grid-column: span 3; }
  .raster-kz.n7 > :nth-child(n+5) { grid-column: span 4; }
}
@media (max-width: 1000px) {
  .raster-kz.n7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-kz.n7 > *, .raster-kz.n7 > :nth-child(n+5) { grid-column: auto; }
  .raster-kz.n7 > :last-child { grid-column: 1 / -1; }
}

/* Beträge nach Vorzeichen: Gewinn grün, Verlust rot (Sebastian 02.12.2026) */
.tabelle .betrag-plus { color: var(--gut); font-weight: var(--fett); }
.tabelle .betrag-minus { color: var(--schlecht); font-weight: var(--fett); }

/* 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: 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; }
}
/* Ring und Legende nebeneinander brauchen Platz: im schmalen Fenster untereinander */
@media (max-width: 1100px) and (min-width: 901px) {
  .ring { flex-wrap: wrap; justify-content: center; }
}
@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 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-kz.n5 > *, .raster-kz.n5 > :nth-child(n+4) { grid-column: auto; }
  .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; }

  .einladen form { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* Zweite Leiste eingeklappt: unter der Kopfleiste eine Zeile mit Symbol und
     Namen der aktuellen Unterseite, ein Tipp darauf klappt die Liste auf */
  .unterleiste:not([hidden]) { display: block; }
  .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; }
  :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 { grid-template-columns: minmax(0, 1fr); }
  .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, .tabelle th.kuerzen { max-width: 150px; }
  .tabelle .name { max-width: 150px; }
  .tabelle .schmal-aus { display: none; }
  .tabelle th, .tabelle td { padding: 0 8px; }
  .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 tbody td, .tabelle tbody th, .tabelle tfoot td, .tabelle tfoot th { font-size: 14.5px; }
  .anmeldekarte { padding: 24px 20px; }
  .qr { justify-content: center; }
  .konto-menue { right: 6px; }
}

/* --------------------------------------------------------------------------
   Datumsauswahl wie bei Meta-Werbeanzeigen (DS.datumsauswahl): Zeitraum mit Datum
   als Knopf, beim Aufklappen links die Schnellauswahl, rechts der Kalender.
   -------------------------------------------------------------------------- */

.dw { position: relative; }
.dw-knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--rahmen);
  border-radius: 10px;
  background: var(--karte);
  color: var(--tinte);
  font-size: 14px;
  font-weight: var(--halbfett);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dw-knopf [data-icon] { display: grid; color: var(--text-leise); }
.dw-knopf [data-icon] svg { width: 18px; height: 18px; }
.dw-knopf:hover { background: var(--feld-hover); }
.dw-knopf[aria-expanded="true"] { border-color: var(--blau); }
.dw-knopf:focus-visible, .dw button:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }

.dw-panel {
  position: absolute;
  z-index: 50;
  right: 0;
  top: calc(100% + 8px);
  display: flex;
  width: max-content;
  max-width: calc(100vw - 24px);
  border-radius: 12px;
  background: var(--karte);
  box-shadow: 0 8px 30px rgba(20, 30, 55, 0.18), 0 0 0 1px var(--rahmen);
  color: var(--text);
  font-weight: 400;
}
.dw-panel[hidden] { display: none; }

.dw-schnell { list-style: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 176px; border-right: 1px solid var(--linie); }
.dw-schnell-knopf {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 14px;
  font-weight: var(--mittelfett);
  text-align: left;
  color: var(--text);
}
.dw-schnell-knopf:hover { background: var(--feld-hover); color: var(--tinte); }
.dw-schnell-knopf.aktiv { background: var(--zeitraum-aktiv); color: var(--zeitraum-aktiv-text); }

.dw-kalender { padding: 14px 16px 12px; }
.dw-monate { display: flex; gap: 28px; }
.dw-monat { width: 252px; }
.dw-monat-kopf { display: flex; align-items: center; justify-content: space-between; height: 32px; margin-bottom: 6px; }
.dw-monat-name { font-size: 14.5px; font-weight: var(--fett); color: var(--tinte); }
.dw-pfeil {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-leise);
  position: relative;
}
.dw-pfeil::before { content: ""; position: absolute; inset: 9px; border: solid currentColor; border-width: 0 0 2px 2px; transform: translateX(2px) rotate(45deg); }
.dw-pfeil.weiter::before { transform: translateX(-2px) rotate(-135deg); }
.dw-pfeil:hover { background: var(--feld-hover); }
.dw-pfeil.leer { visibility: hidden; }
.dw-raster { display: grid; grid-template-columns: repeat(7, 36px); row-gap: 2px; }
.dw-wochentag { height: 28px; display: grid; place-items: center; font-size: 12px; font-weight: var(--halbfett); color: var(--text-blass); }
.dw-tag {
  position: relative;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 13.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dw-tag:hover:not(:disabled) { background: var(--feld-hover); border-radius: 8px; }
.dw-tag:disabled { color: var(--punkte); }
.dw-tag.im-bereich { background: color-mix(in srgb, var(--blau) 12%, var(--karte)); }
.dw-tag.rand { background: var(--blau); color: #fff; font-weight: var(--halbfett); }
.dw-tag.anfang { border-radius: 8px 0 0 8px; }
.dw-tag.ende { border-radius: 0 8px 8px 0; }
.dw-tag.einzeln { border-radius: 8px; }
.dw-fuss { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--linie); }
.dw-fuss-text { font-size: 13px; color: var(--text-leise); font-variant-numeric: tabular-nums; }
.dw-uebernehmen {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--blau);
  color: #fff;
  font-size: 14px;
  font-weight: var(--halbfett);
}
.dw-uebernehmen:disabled { background: var(--grau-flaeche); color: var(--text-blass); }

/* Schmale Kopfleiste: der Zeitraum steht links in einer eigenen Zeile, das Fenster öffnet nach rechts */
@container kopf (max-width: 860px) {
  .dw-panel { right: auto; left: 0; }
}
/* Mittlere Breite: nur ein Monat, damit das Fenster ins Bild passt */
@container kopf (max-width: 1000px) {
  .dw-monat + .dw-monat { display: none; }
  .dw-monat .dw-pfeil.leer { visibility: visible; }
}
/* Handy: Schnellauswahl und Kalender untereinander, ein Monat */
@media (max-width: 640px) {
  .dw { max-width: 100%; }
  .dw-panel { flex-direction: column; width: calc(100vw - var(--seitenleiste-b) - 2 * var(--inhalt-links)); max-width: none; max-height: 78vh; overflow-y: auto; }
  .dw-schnell { flex-direction: row; flex-wrap: wrap; gap: 6px; min-width: 0; border-right: 0; border-bottom: 1px solid var(--linie); }
  .dw-schnell li { flex: 1 1 calc(50% - 6px); }
  .dw-schnell-knopf { text-align: center; padding: 0 6px; font-size: 13px; background: var(--feld-hover); }
  .dw-schnell-knopf.aktiv { background: var(--zeitraum-aktiv); }
  .dw-monate { gap: 0; }
  .dw-monat + .dw-monat { display: none; }
  .dw-monat { width: 100%; }
  .dw-monat .dw-pfeil.leer { visibility: visible; }
  .dw-raster { grid-template-columns: repeat(7, 1fr); }
  .dw-kalender { padding: 12px; }
  .dw-fuss { flex-wrap: wrap; }
}

/* Tabelle: Wert gegen einen Vergleich (grün besser, rot schlechter, der Wert steht immer dabei) und
   hervorgehobene Spalten (Kopf mit feiner Linie in der Bereichsfarbe, Zahlen kräftiger) */
/* Ausreißer: runder Chip mit weißem Pfeil links neben der Zahl, die Zahl bleibt rechtsbündig (Sebastian 02.12.2026) */
.tabelle .wert.gut::before, .tabelle .wert.schlecht::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border-radius: 50%;
  background: var(--gut) var(--z-pfeil-weiss) center / 9px 9px no-repeat;
}
.tabelle .wert.schlecht::before { background-color: var(--schlecht); transform: rotate(180deg); }
.tabelle th.hervor { color: var(--tinte); font-weight: var(--fett); }
.tabelle td.hervor { font-weight: var(--fett); }

/* Tabelle: Wert mit kleinem Balken dahinter (etwa Conversion), Länge in --wert, die führende Zeile grün */
.tabelle .zellbalken { display: inline-flex; align-items: center; justify-content: flex-end; gap: 12px; }
.tabelle .zellbalken i { display: block; flex: none; position: relative; width: 84px; height: 6px; border-radius: 3px; background: var(--schiene); overflow: hidden; }
.tabelle .zellbalken i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--wert, 0); border-radius: 3px; background: var(--farbe, var(--blau)); }
.tabelle .zellbalken.gut { --farbe: var(--gut); color: var(--gut); font-weight: var(--fett); }

/* Liniendiagramm: Fläche zwischen zwei Reihen (etwa wenigste bis meiste) */
.d-band { fill: color-mix(in srgb, var(--farbe, var(--blau)) 14%, transparent); stroke: none; }

/* --------------------------------------------------------------------------
   Handy (Sebastian, 28.11.2026): dichter, ohne seitliches Scrollen der Seite.
   Kennzahlkarten zu zweit, Diagramme niedriger, die Unterseiten des Bereichs
   als Leiste mit Tipp-Feldern oben im Inhalt (ein Tipp, nichts klappt auf).
   Nur bis 640 px; Desktop und mittlere Breite bleiben unverändert.
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root { --reihe2-h: 0px; --reihe3-h: 0px; --kz-innen: 14px; }
  html, body { overflow-x: hidden; }

  /* Kennzahlkarten: zwei je Reihe, Balken als schmaler Streifen unten */
  .raster-kz, .raster-kz.n2, .raster-kz.n3, .raster-kz.n4, .raster-kz.n5, .raster-kz.n6 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .raster-kz > *, .raster-kz.n5 > :last-child, .raster-kz.n5 > :nth-child(n+4) { grid-column: auto; }
  .raster-kz > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kz-karte { height: auto; min-height: 0; padding: 10px var(--kz-innen) 10px; }
  .kz-titel { font-size: 13px; line-height: 17px; white-space: normal; overflow: visible; text-overflow: clip; }
  .tabelle th, .tabelle td { padding: 0 6px; }
  .kz-marke { position: static; margin-top: 1px; }
  .kz-zahl, .kz-karte.mit-marke .kz-zahl { margin-top: 4px; font-size: 21px; line-height: 27px; }
  .kz-karte .pille, .kz-karte.mit-marke .pille { max-width: 100%; margin-top: 3px; }
  .kz-balken { position: static; display: block; width: 100%; max-width: none; height: 22px; margin-top: 8px; }
  .kz-karte.ohne-balken .kz-balken { display: none; }
  /* Marke und Vergleich dürfen umbrechen statt abgeschnitten zu werden (Handy-Prüfung 02.12.2026) */
  .kz-marke, .kz-karte .pille { white-space: normal; align-items: flex-start; overflow: visible; }
  .kz-marke::before, .kz-karte .pille::before { flex: none; margin-top: 3px; }
  /* Zeitraum am Handy immer bündig in eigener Zeile unter dem Titel, nie eingerückt */
  .karte-zeitraum { display: block; margin: 2px 0 0; white-space: normal; }
  /* Legenden im Kartenkopf brechen um, statt die Seite zu verbreitern */
  .karte-kopf .legende, .karte-zeile .legende { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-start; gap: 4px 14px; min-width: 0; }
  /* Kurze Tabellen (Name und ein Wert) bleiben Zeilen, der Name bricht um statt abgeschnitten zu werden */
  .tabelle.quer .name, .tabelle.quer td { white-space: normal; max-width: none; text-overflow: clip; }

  /* Große Karten: weniger Innenabstand, Diagramme niedriger */
  .raster { gap: 12px; }
  .karte .diagramm { max-height: 210px; }
  .karte .diagramm svg { max-height: 210px; }

  /* Unterseiten: eine Leiste mit Tipp-Feldern, seitlich blätterbar nur in der Leiste */
  .unterleiste:not([hidden]) { display: block; border-top: 0; background: var(--karte); box-shadow: 0 1px 0 var(--linie); }
  .unterleiste .schalter, .unterleiste .bereich { display: none; }
  .unterleiste .liste, .unterleiste.offen .liste {
    display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px;
    padding: 10px var(--inhalt-rechts) 10px var(--inhalt-links);
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .unterleiste .liste::-webkit-scrollbar { display: none; }
  .unterleiste .liste a {
    flex: none; min-height: 36px; padding: 0 14px; gap: 7px; border-radius: 18px;
    font-size: 14px; white-space: nowrap; color: var(--text-leise);
    background: var(--feld-hover); border: 1px solid transparent;
  }
  .unterleiste .liste a > span { flex: none; }
  .unterleiste .liste a .symbol { width: 15px; height: 15px; }
  .unterleiste .liste a.aktiv { background: color-mix(in srgb, var(--farbe, var(--blau)) 12%, var(--karte)); border-color: color-mix(in srgb, var(--farbe, var(--blau)) 40%, transparent); color: var(--tinte); }
}

/* --------------------------------------------------------------------------
   KI-Hinweise (DS.hinweise): eigene helle Fläche mit KI-Zeichen, je Hinweis
   eine Zeile mit Maßnahme und Wirkung, der Rest klappt auf (Sebastian
   30.11.2026). Farben nur über Variablen, keine Erklärtexte.
   -------------------------------------------------------------------------- */

.ki-flaeche { display: flex; flex-direction: column; gap: 8px; background: var(--ki-flaeche); border: 1px solid var(--ki-rand); border-radius: var(--radius); padding: 16px 18px; }
.karte .ki-flaeche { margin-top: 2px; }
.ki-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; }
.ki-marke { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--ki-akzent); background: var(--ki-innen); border: 1px solid var(--ki-rand); border-radius: 20px; padding: 2px 8px 2px 6px; }
.ki-marke svg { width: 11px; height: 11px; fill: var(--ki-akzent); }
.ki-titel { margin: 0; font-size: 15px; font-weight: var(--fett); color: var(--tinte); }
.ki-summe { margin-left: auto; font-size: 13px; color: var(--text-leise); }
.ki-summe b { color: var(--tinte); font-weight: var(--fett); }

.hinweis { background: var(--ki-innen); border: 1px solid transparent; border-radius: 10px; }
.hinweis[open] { border-color: var(--ki-rand); }
.hinweis-kopf { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 10px; }
.hinweis-kopf::-webkit-details-marker { display: none; }
.hinweis-kopf:focus-visible { outline: 2px solid var(--ki-akzent); outline-offset: 2px; }
.hinweis-massnahme { font-size: 14.5px; font-weight: var(--fett); color: var(--tinte); overflow-wrap: anywhere; }
.hinweis-wirkung { font-size: 13px; font-weight: 800; color: var(--gut); background: color-mix(in srgb, var(--gut) 12%, var(--ki-innen)); border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
.hinweis-erledigt { font-size: 13px; color: var(--text-leise); white-space: nowrap; }
.hinweis.umgesetzt .hinweis-massnahme { color: var(--text-leise); font-weight: var(--halbfett); }
.hinweis-pfeil { width: 7px; height: 7px; border-right: 2px solid var(--text-leise); border-bottom: 2px solid var(--text-leise); transform: rotate(45deg); justify-self: center; margin-top: -4px; transition: transform .15s; }
.hinweis[open] .hinweis-pfeil { transform: rotate(-135deg); margin-top: 4px; }
.hinweis-detail { padding: 4px 14px 14px; border-top: 1px solid var(--tabellen-linie); }
.hinweis-zeile { margin: 10px 0 0; display: grid; grid-template-columns: 70px minmax(0, 1fr); column-gap: 12px; font-size: 14px; line-height: 1.45; color: var(--text); }
.hinweis-name { color: var(--text-leise); font-weight: var(--mittelfett); }
.hinweis-text { overflow-wrap: anywhere; }
.hinweis-folgen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; }
.hinweis-folgen-name { font-size: 12.5px; color: var(--text-leise); margin-right: 2px; }
.hinweis-verworfen { font-size: 13px; color: var(--text-leise); }
.hinweis-verworfen summary { cursor: pointer; width: fit-content; }
.hinweis-verworfen summary:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.hinweis-verworfen ul { margin: 6px 0 0; padding-left: 18px; }
.hinweis-fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.hinweis-link { font-size: 13.5px; font-weight: var(--halbfett); color: var(--blau); text-decoration: none; }
.hinweis-link:hover { text-decoration: underline; }
.hinweis-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.hinweis-fehler { font-size: 12.5px; color: var(--text-leise); }
.ki-flaeche > .karte-text { margin: 0; }
.karte-zwischentitel { margin: 18px 0 4px; font-size: 13px; font-weight: var(--mittelfett); color: var(--text-leise); }
.hinweise-reihe { margin-bottom: var(--reihe-abstand); }

@media (max-width: 640px) {
  .ki-flaeche { padding: 12px; }
  .ki-summe { margin-left: 0; width: 100%; }
  .hinweis-kopf { grid-template-columns: minmax(0, 1fr) 16px; row-gap: 6px; padding: 10px 12px; }
  .hinweis-kopf .hinweis-wirkung, .hinweis-kopf .hinweis-erledigt { grid-column: 1; grid-row: 2; justify-self: start; }
  .hinweis-kopf .hinweis-pfeil { grid-column: 2; grid-row: 1 / span 2; }
  .hinweis-detail { padding: 2px 12px 12px; }
  .hinweis-zeile { grid-template-columns: minmax(0, 1fr); row-gap: 1px; }
  .hinweis-aktionen { width: 100%; margin-left: 0; }
  .hinweis-aktionen .knopf { flex: 1 1 0; min-height: 44px; }
  .hinweis-folgen .pille { max-width: 100%; white-space: normal; }
}

/* Logo oben links (Sebastian 02.12.2026): weißes Logo auf der dunklen Leiste, eingeklappt und am Handy nur das Zeichen */
.logo.mit-bild img { display: block; }
/* Größer und bis zum rechten Rand der Leiste (Sebastian 03.12.2026: "sieht klein und grisselig aus") */
.logo.mit-bild .logo-voll { width: 188px; height: auto; max-height: 52px; }
.logo.mit-bild .logo-klein { display: none; width: 32px; height: 32px; border-radius: 8px; }
.eingeklappt .logo.mit-bild .logo-voll { display: none; }
.eingeklappt .logo.mit-bild .logo-klein { display: block; }
@media (max-width: 640px) {
  .logo.mit-bild .logo-voll { display: none; }
  .logo.mit-bild .logo-klein { display: block; }
}

/* --------------------------------------------------------------------------
   Tabellen am Handy als Stapel (Sebastian 02.12.2026: "dass man nicht ellenlang seitwärts scrollen muss"):
   Jede Zeile wird ein Block, oben der Name, darunter je Spalte "Spaltenname ... Wert". Der Kopf entfällt,
   Spalten mit schmalAus bleiben weg. Eine Tabelle mit der Klasse quer behält die Queransicht.
   GL Immo (03.12.2026): schon bis 900 px, damit auch am Tablet keine Tabelle seitwärts scrollt.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .tabelle-rahmen:has(> .tabelle:not(.quer)) { overflow-x: visible; }
  .tabelle:not(.quer), .tabelle:not(.quer) tbody, .tabelle:not(.quer) tfoot { display: block; width: 100%; }
  .tabelle:not(.quer) thead { display: none; }
  .tabelle:not(.quer) tr { display: block; padding: 10px 2px; border-bottom: 1px solid var(--tabellen-linie); }
  .tabelle:not(.quer) tbody tr:last-child { border-bottom: 0; }
  .tabelle:not(.quer) tfoot tr { border-top: 1px solid var(--linie); border-bottom: 0; }
  .tabelle:not(.quer) th, .tabelle:not(.quer) td { position: static; height: auto; padding: 0; border: 0; white-space: normal; max-width: none; overflow: visible; }
  .tabelle:not(.quer) tbody td, .tabelle:not(.quer) tbody th, .tabelle:not(.quer) tfoot td, .tabelle:not(.quer) tfoot th { height: auto; border: 0; }
  .tabelle:not(.quer) .name { display: inline; font-weight: var(--fett); color: var(--tinte); }
  .tabelle:not(.quer) .abz { display: inline-block; width: auto; min-width: 0; margin-right: 8px; vertical-align: middle; }
  .tabelle:not(.quer) td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 5px; text-align: right; }
  .tabelle:not(.quer) td[data-label]::before { content: attr(data-label); flex: none; max-width: 55%; text-align: left; font-weight: 400; color: var(--text-leise); }
  .tabelle:not(.quer) td:empty, .tabelle:not(.quer) .schmal-aus { display: none; }
  .tabelle:not(.quer) tr.gruppe { padding: 14px 2px 6px; }
  .tabelle:not(.quer) tr.gruppe th { display: block; height: auto; padding: 0; border: 0; }
  .tabelle:not(.quer) tr.unterzeile th.name { padding-left: 0; }
  .tabelle:not(.quer) td.leer { display: block; height: auto; padding: 16px 0; text-align: left; }
  .tabelle:not(.quer) td[colspan] { display: block; text-align: left; }
  .tabelle:not(.quer).ohne-abzeichen .name { display: block; }
  .tabelle:not(.quer) td[data-label] { flex-wrap: wrap; }
  .tabelle:not(.quer) td[data-label] > * { min-width: 0; max-width: 100%; }
  .verwaltung .tabelle:not(.quer) td .freigaben-zeile, .verwaltung .tabelle:not(.quer) td .aktionen { min-width: 0; max-width: 100%; justify-content: flex-end; }
}

/* --------------------------------------------------------------------------
   GL Immo: Grundfarbe dunkles Lila statt Blau (Sebastian 03.12.2026: "es soll
   nur von der Farbe anders sein, damit ich auf einen Blick den Unterschied
   erkenne"; Feedbackrunde 1: "mach die Grundfarbe mal so dunkel lila"). Es wechseln nur Farbwerte, Maße und Bausteine bleiben wie im
   LI-Dashboard. Die Wertung behält ihr eigenes Grün und Rot.
   -------------------------------------------------------------------------- */

:root {
  --flaeche: #f6f4fa;
  --gl-akzent: #5b3a8c;
  --gl-akzent-hell: #7a52b3;
  --zuletzt-flaeche: #f2eefa;
  --b-start: var(--gl-akzent);
  --b-woche: var(--blau);
  --b-vermietung: var(--beere);
  --b-objekte: var(--orange);
  --b-finanzen: var(--tuerkis);
}
:root[data-thema="dunkel"] {
  --flaeche: #1a1526;
  --karte: #241d33;
  --linie: #312840;
  --tabellen-linie: #3a3050;
  --rahmen: #463a5e;
  --grau-flaeche: #2e2540;
  --schiene: #342a47;
  --schiene-hell: #2b2340;
  --gitter: #312840;
  --legende-flaeche: #2b2340;
  --marke-innen: #241d33;
  --feld-hover: #2b2340;
  --knopf-hover: #3b3052;
  --reiter-rand: #312840;
  --zuletzt-flaeche: #2e2445;
  --gl-akzent: #b394e6;
  --gl-akzent-hell: #8a63c4;
}
[data-bereich="woche"]      { --farbe: var(--b-woche); }
[data-bereich="vermietung"] { --farbe: var(--b-vermietung); }
[data-bereich="objekte"]    { --farbe: var(--b-objekte); }

.seitenleiste,
.unterleiste {
  --karte: #2a1a42;
  --linie: #372452;
  --rahmen: #4a3568;
  --grau-flaeche: #44306a;
  --reiter-rand: #4a3568;
  --knopf-hover: #4a3568;
  --feld-hover: #36244f;
  --text: #ece6f5;
  --text-leise: #d2c6e4;
  --text-blass: #a493c0;
  --icon: #a493c0;
  --punkte: #6f5a90;
}
.seitenleiste .reiter.aktiv { background: var(--gl-akzent-hell); }
.seitenleiste, .unterleiste { box-shadow: 4px 0 18px rgba(40, 20, 60, 0.16); }
:root[data-thema="dunkel"] .seitenleiste,
:root[data-thema="dunkel"] .unterleiste {
  --karte: #150d22;
  --linie: #21162f;
  --rahmen: #33254a;
  --grau-flaeche: #2d2045;
  --reiter-rand: #2d2045;
  --knopf-hover: #2d2045;
  --feld-hover: #1e1430;
}
:root[data-thema="dunkel"] .seitenleiste .reiter.aktiv { background: #5b3a8c; }

/* Überschuss je Monat: Monate mit Minus gehen ab der Nulllinie nach unten */
.d-balken.d-negativ { fill: var(--schlecht); }
.d-gitter.d-null { stroke: var(--text-achse); stroke-dasharray: none; }

/* Agenda: Zeilen "Nur zur Info" unter der Tabelle */
.gl-info { margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-leise); }
.gl-info li { padding: 4px 0; }
.logo-aussen { fill: var(--gl-akzent); }
.pille.chip-mittel { --wertung: var(--mittel); }
.pille.chip-schlecht { --wertung: var(--schlecht); }
.seitenleiste-knopf [data-icon] { background: var(--gl-akzent-hell); }
/* Am Handy bleibt die zweite Leiste auch bei GL Immo eine helle Zeile im Inhalt */
@media (max-width: 640px) {
  :root .unterleiste, :root[data-thema="dunkel"] .unterleiste {
    --karte: inherit; --linie: inherit; --rahmen: inherit; --grau-flaeche: inherit;
    --reiter-rand: inherit; --knopf-hover: inherit; --feld-hover: inherit;
    --text: inherit; --text-leise: inherit; --text-blass: inherit; --icon: inherit; --punkte: inherit;
    box-shadow: none;
  }
}

/* Feedbackrunde 1 (03.12.2026): Personen und Dinge als unterscheidbare Chips, Quellenzeile, Knöpfe nach außen */
.pille.chip-f1 { --wertung: var(--reihe-1); }
.pille.chip-f2 { --wertung: var(--reihe-2); }
.pille.chip-f3 { --wertung: var(--reihe-3); }
.pille.chip-f4 { --wertung: var(--reihe-4); }
.pille.chip-f5 { --wertung: var(--reihe-5); }
.pille.chip-f6 { --wertung: var(--reihe-6); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.tabelle td.umbruch .chips { display: flex; }
.karte-quelle { margin: 12px 0 0; font-size: 12px; color: var(--text-blass); }
.knopf.aussen { text-decoration: none; white-space: nowrap; }
.tabelle td.umbruch { min-width: 160px; line-height: 1.4; padding-top: 8px; padding-bottom: 8px; }

/* Aufklappbare Zeilen (Protokolle, Instandhaltung): eine Zeile je Punkt, Inhalt klappt darunter auf */
.gl-auf-liste { margin-top: 8px; }
.gl-auf { border-top: 1px solid var(--tabellen-linie); }
.gl-auf:first-child { border-top: 0; }
.gl-auf > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 16px; padding: 11px 4px 11px 22px; cursor: pointer; list-style: none; position: relative; }
.gl-auf > summary::-webkit-details-marker { display: none; }
.gl-auf > summary::before { content: ""; position: absolute; left: 4px; top: 50%; width: 9px; height: 9px; margin-top: -5px; background-color: var(--text-leise); -webkit-mask: var(--z-winkel) center / contain no-repeat; mask: var(--z-winkel) center / contain no-repeat; transition: transform 0.15s; }
.gl-auf[open] > summary::before { transform: rotate(90deg); }
.gl-auf > summary:hover { background: var(--feld-hover); }
.gl-auf-datum { font-weight: var(--fett); color: var(--tinte); font-variant-numeric: tabular-nums; }
.gl-auf-titel { display: flex; flex-wrap: wrap; gap: 2px 10px; min-width: 0; color: var(--text); }
.gl-auf-titel strong { color: var(--tinte); font-weight: var(--fett); }
.gl-auf-was { color: var(--text); }
.gl-auf-zahlen { display: flex; gap: 12px; font-size: 13px; color: var(--text-leise); white-space: nowrap; }
.gl-auf-betrag { font-variant-numeric: tabular-nums; font-weight: var(--halbfett); color: var(--tinte); text-align: right; min-width: 96px; white-space: nowrap; }
.gl-auf > summary:has(.gl-auf-datum) { grid-template-columns: auto minmax(0, 1fr) auto; }
.gl-auf-inhalt { padding: 4px 4px 16px 22px; }
.gl-abschnitt { margin: 12px 0 6px; font-size: 12px; font-weight: var(--halbfett); color: var(--text-leise); text-transform: uppercase; letter-spacing: 0.04em; }
.gl-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.gl-punkte { margin: 8px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.5; color: var(--text); }
.gl-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 4px 0 0; font-size: 14px; }
.gl-dl dt { color: var(--text-leise); }
.gl-dl dd { margin: 0; color: var(--text); }
.gl-reiter { margin-top: 4px; }
@media (max-width: 640px) {
  .gl-auf > summary, .gl-auf > summary:has(.gl-auf-datum) { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-left: 20px; }
  .gl-auf-betrag { text-align: left; min-width: 0; }
  .gl-auf-inhalt { padding-left: 4px; }
  .gl-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gl-dl dd { margin-bottom: 6px; }
}

/* Exporte für die Bank: je Datei ein Knopf */
.gl-exporte { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* Kein abgeschnittener Text (Feedbackrunde 1, 03.12.2026): die Namensspalte bricht um statt "..." */
.tabelle th.name { white-space: normal; overflow: visible; text-overflow: clip; min-width: 110px; max-width: 300px; line-height: 1.35; padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 900px) { .tabelle th.name { min-width: 0; max-width: none; } }

/* Responsiv (Feedbackrunde 1, 03.12.2026): Spaltenköpfe brechen um statt die Tabelle zu verbreitern,
   der Seitentitel bricht bis 1024 px um, am Handy brechen die Unterseiten-Chips in eine zweite Zeile um */
.tabelle thead th { white-space: normal; line-height: 1.25; vertical-align: bottom; padding-bottom: 8px; }
.gl-auf > summary::before { top: 17px; margin-top: 0; }
@media (max-width: 1024px) {
  .kopf-titel { white-space: normal; overflow: visible; text-overflow: clip; font-size: 18px; line-height: 22px; }
}
@media (max-width: 640px) {
  .unterleiste .liste, .unterleiste.offen .liste { flex-wrap: wrap; overflow-x: visible; }
}
.tabelle thead th .sortier-knopf { white-space: normal; text-align: inherit; }
@media (max-width: 900px) {
  .tabelle:not(.quer) td, .tabelle:not(.quer) th { overflow-wrap: anywhere; }
}
/* Am Handy stehen die Kacheln untereinander, damit Beträge mit zwei Nachkommastellen ganz lesbar sind (03.12.2026) */
@media (max-width: 480px) {
  .raster-kz, .raster-kz.n2, .raster-kz.n3, .raster-kz.n4, .raster-kz.n5, .raster-kz.n6, .raster-kz.n7 { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); }
  .raster-kz > *, .raster-kz.n7 > *, .raster-kz.n7 > :nth-child(n+5), .raster-kz.n7 > :last-child { grid-column: auto; }
  .kz-karte { min-height: 0; }
}
/* Knöpfe in der Grundfarbe Lila statt Blau */
.knopf:not(.leise):not(.warnung) { background: var(--gl-akzent-hell); border-color: var(--gl-akzent-hell); }

/* --------------------------------------------------------------------------
   Feedbackrunde 2 (03.12.2026): ein Stil für Tabellen und Aufklapp-Listen. Maßstab ist die Tabelle im
   Objektbestand: 14 px, Zeilen 42 px, Namensspalte mittelfett, Kopf 12,5 px grau mit Strich in der Grundfarbe.
   -------------------------------------------------------------------------- */
.tabelle thead th { border-bottom-color: var(--gl-akzent-hell); }
.gl-auf-liste { font-size: 14px; }
.gl-auf-kopf { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: end; min-height: 34px; padding: 0 4px 6px 22px;
  font-size: 12.5px; font-weight: var(--halbfett); color: var(--text-leise); border-bottom: 2px solid var(--gl-akzent-hell); }
.gl-auf-kopf .rechts { text-align: right; min-width: 96px; }
.gl-auf > summary { min-height: 42px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; color: var(--text); }
.gl-auf > summary::before { top: 17px; }
.gl-auf-titel strong, .gl-auf-datum { font-weight: var(--mittelfett); color: var(--tinte); }
.gl-auf-titel { color: var(--text); }
.gl-auf-zahlen { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.gl-auf-betrag { font-weight: 400; color: var(--text); }
.gl-abschnitt { font-size: 12.5px; font-weight: var(--halbfett); color: var(--text-leise); text-transform: none; letter-spacing: 0; }
.gl-auf-inhalt { font-size: 14px; }
.gl-reiter button { font-size: 14px; }
@media (max-width: 640px) { .gl-auf-kopf { display: none; } }

/* Übersicht: Grafiken und "Wichtig jetzt" unter den Kacheln */
.gl-wichtig { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.gl-wichtig li { border-top: 1px solid var(--tabellen-linie); }
.gl-wichtig li:first-child { border-top: 0; }
.gl-wichtig a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 42px; padding: 6px 4px; color: var(--text); }
.gl-wichtig a:hover { background: var(--feld-hover); }
.gl-wichtig .gl-w-text { min-width: 0; }
.gl-wichtig .gl-w-wert { font-variant-numeric: tabular-nums; color: var(--tinte); font-weight: var(--mittelfett); white-space: nowrap; }
.gl-wichtig .gl-w-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--text-blass); }
.gl-wichtig .gl-w-punkt.schlecht { background: var(--schlecht); }
.gl-wichtig .gl-w-punkt.mittel { background: var(--mittel); }
.gl-wichtig .gl-w-punkt.info { background: var(--gl-akzent-hell); }
.gl-auf-kopf-datum { grid-template-columns: auto minmax(0, 1fr) auto; }
/* Feste Spalten, damit Kopf und Zeilen der Aufklapp-Listen untereinander stehen wie in einer Tabelle */
@media (min-width: 641px) {
  .gl-liste-instand .gl-auf-kopf, .gl-liste-instand .gl-auf > summary { grid-template-columns: minmax(0, 1fr) 190px 110px; }
  .gl-liste-prot .gl-auf-kopf, .gl-liste-prot .gl-auf > summary:has(.gl-auf-datum) { grid-template-columns: 100px minmax(0, 1fr) 230px; }
  .gl-liste-prot .gl-auf-zahlen { justify-content: flex-start; }
}
.gl-mehr { display: inline-block; color: var(--gl-akzent-hell); font-weight: var(--halbfett); }
.gl-mehr:hover { text-decoration: underline; }
.gl-liste-instand .gl-auf-titel { flex-direction: column; gap: 0; }
