/* --- 0. Schrift: liegt im Projekt, wird NICHT von Google geholt ----------
   Space Grotesk, SIL Open Font License 1.1 (frei weiterzugeben).
   Vorher wurden bei jedem Aufruf zwei Anfragen an Google gestellt — das ist
   fuer ein Firmenprogramm ungeschickt (jede IP geht zu Google) und macht die
   Seite vom Internet abhaengig. Die Datei deckt die Gewichte 500 und 600 ab.
   font-display: swap — falls die Datei fehlt, erscheint sofort die
   Systemschrift, die Seite bleibt lesbar. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("schriften/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("schriften/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
                 U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ===========================================================================
   BASTASIC AGENT CONTROL — Visuelles Grundsystem ("Agenten-OS")
   Stufe 1: Designsystem, Layout, Stil.
   Alle Groessen mit clamp(), damit die Oberflaeche auch bei vergroesserter
   Schrift auf dem iPhone nicht seitlich aus dem Bild laeuft.
   =========================================================================== */

/* --- 1. Farbwelt, Typografie, Masse -------------------------------------- */
:root {
  /* Grundflaechen — sehr dunkles Blau bis Schwarz */
  --grund-tief:    #04060c;
  --grund:         #070a13;
  --grund-hoch:    #0b1020;

  /* Glas-Panels */
  --panel:         rgba(17, 24, 42, 0.55);
  --panel-fest:    rgba(13, 19, 34, 0.92);
  --panel-hell:    rgba(30, 42, 68, 0.42);
  --rand:          rgba(125, 165, 225, 0.13);
  --rand-hell:     rgba(150, 190, 250, 0.26);

  /* Statusfarben */
  --aktiv:         #38f0a4;
  --aktiv-tief:    #0f7d54;
  --warnung:       #ffb43d;
  --warnung-tief:  #8a5a10;
  --fehler:        #ff4f6d;
  --fehler-tief:   #8e1f36;
  --ruhend:        #6f88ad;
  --info:          #4ec8ff;
  --navigation:    #7fa4ff;

  /* Text */
  --text:          #eef3fc;
  --text-leise:    #93a5c4;
  /* Auf dem Glaspanel gemessen: #5e6f8e ergab nur 3,4:1 und war damit fuer
     die kleinen Beschriftungen zu schwach. #7b8ca6 kommt auf 5,1:1 (hellster
     Panelrand) bis 5,3:1 (Panelmitte) und bleibt trotzdem klar unter
     --text-leise, die Abstufung bleibt also erhalten. */
  --text-schwach:  #7b8ca6;

  /* Schriften */
  --schrift-titel: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --schrift-text:  -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", sans-serif;

  /* Abstaende */
  --abstand-1: clamp(0.35rem, 0.8vw, 0.55rem);
  --abstand-2: clamp(0.7rem,  1.4vw, 1rem);
  --abstand-3: clamp(1.1rem,  2.2vw, 1.7rem);
  --abstand-4: clamp(1.7rem,  3.4vw, 2.8rem);

  --radius:      clamp(12px, 1.4vw, 18px);
  --radius-klein: 10px;

  /* Schatten und Glanz — dezent, nicht ueberladen */
  --schatten:      0 18px 48px -22px rgba(0, 0, 0, 0.95);
  --glanz-innen:   inset 0 1px 0 rgba(180, 210, 255, 0.10);
}

/* --- 2. Grundlagen ------------------------------------------------------- */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--grund-tief);
  color: var(--text);
  font-family: var(--schrift-text);
  font-size: clamp(0.9rem, 0.35vw + 0.84rem, 1rem);
  line-height: 1.55;
  letter-spacing: 0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ruhiger Farbschleier ueber der ganzen Seite — gibt Tiefe ohne Ablenkung */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(38, 84, 168, 0.20), transparent 62%),
    radial-gradient(70% 60% at 8% 105%, rgba(20, 120, 96, 0.13), transparent 68%),
    radial-gradient(60% 55% at 100% 40%, rgba(70, 40, 140, 0.13), transparent 70%);
}

h1, h2, h3, .zahl, .wortmarke {
  font-family: var(--schrift-titel);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.zahl {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* Sichtbarer Tastaturfokus — auch im dunklen Stil klar erkennbar */
:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 3px;
  border-radius: 6px;
}

.nur-fuer-vorleser {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- 3. Seitengeruest ---------------------------------------------------- */
.seite {
  position: relative;
  z-index: 1;
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 0 clamp(0.85rem, 2.5vw, 2.4rem) var(--abstand-4);
}

/* --- 4. Kopfleiste ------------------------------------------------------- */
.kopfleiste {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--abstand-2);
  flex-wrap: wrap;
  padding: clamp(0.6rem, 1.4vw, 0.95rem) 0;
  margin-bottom: var(--abstand-2);
  background: linear-gradient(180deg, rgba(4, 6, 12, 0.94) 40%, rgba(4, 6, 12, 0));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.marke {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.1vw, 0.8rem);
  min-width: 0;
}

.marke-zeichen {
  position: relative;
  width: clamp(30px, 3.2vw, 38px);
  aspect-ratio: 1;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(78, 200, 255, 0.30), rgba(56, 240, 164, 0.16));
  border: 1px solid var(--rand-hell);
  box-shadow: 0 0 22px -6px rgba(78, 200, 255, 0.55), var(--glanz-innen);
  display: grid;
  place-items: center;
}
.marke-zeichen::after {
  content: "";
  width: 34%; aspect-ratio: 1;
  border-radius: 50%;
  background: #dff6ff;
  box-shadow: 0 0 12px 2px rgba(140, 225, 255, 0.9);
}
.marke-zeichen::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(150, 220, 255, 0.45);
  border-right-color: transparent;
  border-bottom-color: transparent;
  animation: kreisen 7s linear infinite;
}

.wortmarke {
  font-size: clamp(0.92rem, 1.15vw, 1.08rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.1;
  min-width: 0;
}
.wortmarke span {
  display: block;
  font-family: var(--schrift-text);
  font-size: 0.62em;
  letter-spacing: 0.28em;
  color: var(--text-schwach);
  font-weight: 500;
}

.kopf-rechts {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 1.2vw, 0.9rem);
  flex-wrap: wrap;
  min-width: 0;
}

.uhr {
  font-family: var(--schrift-titel);
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.85rem, 1vw, 1rem);
  color: var(--text-leise);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* --- 5. Statuspillen ----------------------------------------------------- */
.pille {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.34em 0.8em;
  border-radius: 999px;
  border: 1px solid var(--rand);
  background: var(--panel);
  font-size: clamp(0.7rem, 0.75vw, 0.82rem);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-leise);
  white-space: nowrap;
}
.pille .punkt {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  flex: none;
}
.pille.ist-aktiv   { color: var(--aktiv);   border-color: rgba(56, 240, 164, 0.32); background: rgba(56, 240, 164, 0.07); }
.pille.ist-warnung { color: var(--warnung); border-color: rgba(255, 180, 61, 0.32); background: rgba(255, 180, 61, 0.07); }
.pille.ist-fehler  { color: var(--fehler);  border-color: rgba(255, 79, 109, 0.34); background: rgba(255, 79, 109, 0.08); }
.pille.ist-info    { color: var(--info);    border-color: rgba(78, 200, 255, 0.30); background: rgba(78, 200, 255, 0.07); }
.pille.ist-ruhend  { color: var(--ruhend); }

.pille.ist-aktiv .punkt,
.pille.ist-fehler .punkt { animation: pulsen 2.4s ease-in-out infinite; }

/* --- 6. Knopf ------------------------------------------------------------ */
.knopf {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0.95em;
  border-radius: 999px;
  border: 1px solid var(--rand);
  background: var(--panel);
  color: var(--text-leise);
  font-size: clamp(0.72rem, 0.8vw, 0.82rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}
.knopf:hover { border-color: var(--rand-hell); color: var(--text); background: var(--panel-hell); }
.knopf[aria-pressed="true"] {
  color: var(--info);
  border-color: rgba(78, 200, 255, 0.42);
  background: rgba(78, 200, 255, 0.10);
}

/* --- 7. Glas-Panel ------------------------------------------------------- */
.panel {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--rand);
  background:
    linear-gradient(180deg, rgba(36, 50, 80, 0.30), rgba(11, 16, 30, 0.55)),
    var(--panel);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: var(--schatten), var(--glanz-innen);
  overflow: hidden;
}
/* feiner Lichtstrich an der Oberkante */
.panel::before {
  content: "";
  position: absolute;
  inset: 0 12% auto 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 205, 255, 0.42), transparent);
  pointer-events: none;
}

.panel-kopf {
  display: flex;
  align-items: center;
  gap: var(--abstand-2);
  flex-wrap: wrap;
  padding: var(--abstand-2) var(--abstand-3);
  border-bottom: 1px solid var(--rand);
}
.panel-titel {
  font-size: clamp(0.72rem, 0.85vw, 0.82rem);
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--text-leise);
  font-family: var(--schrift-titel);
  font-weight: 500;
  min-width: 0;
}
.panel-koerper { padding: var(--abstand-3); }

/* --- 8. Der Kosmos (Hauptgrafik) ----------------------------------------- */
.kosmos {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--rand);
  overflow: hidden;
  background: radial-gradient(115% 95% at 50% 42%, #0a1120 0%, #05080f 58%, #030509 100%);
  box-shadow: var(--schatten);
  margin-bottom: var(--abstand-3);
}

.kosmos-leinwand {
  display: block;
  width: 100%;
  /* Die Hoehe war nur an die Fensterhoehe gebunden. Auf Tablets stand das
     Sonnensystem dadurch in einem viel zu hohen Kasten und darunter blieb
     ein grosses totes Feld: die Bahnen sind naemlich durch die BREITE
     begrenzt, nicht durch die Hoehe. Der zusaetzliche Riegel ueber die
     Breite haelt den Ausschnitt beisammen; am Schreibtisch aendert sich
     nichts, weil dort 66vh ohnehin kleiner ist. */
  height: clamp(430px, min(66vh, 56vw), 740px);
  touch-action: pan-y;
}

/* Eckmarken — geben den "Leitsystem"-Charakter */
.kosmos-ecke {
  position: absolute;
  width: 22px; height: 22px;
  border: 1px solid rgba(140, 185, 245, 0.28);
  pointer-events: none;
}
.kosmos-ecke.ol { top: 14px; left: 14px;  border-right: 0; border-bottom: 0; }
.kosmos-ecke.or { top: 14px; right: 14px; border-left: 0;  border-bottom: 0; }
.kosmos-ecke.ul { bottom: 14px; left: 14px;  border-right: 0; border-top: 0; }
.kosmos-ecke.ur { bottom: 14px; right: 14px; border-left: 0;  border-top: 0; }

/* Textebene ueber der Leinwand */
.kosmos-ebene {
  position: absolute;
  inset: 0;
  padding: clamp(1.1rem, 2.6vw, 2.2rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--abstand-2);
  pointer-events: none;
  overflow: hidden;
}
/* Die beiden Rahmen (.kosmos-oben / .kosmos-fuss) sind unsichtbar, waren
   aber anklickbar und haben dadurch grosse Teile der Leinwand abgedeckt:
   5 von 12 Knoten liessen sich weder anzeigen noch antippen. Nur die
   wirklich sichtbaren Kaesten bekommen deshalb Mausereignisse zurueck. */
.kosmos-ebene > * { pointer-events: none; min-height: 0; }
/* Beide Kaesten sind reine Anzeigen — es gibt darin nichts zu klicken.
   Mit pointer-events bleiben sie Sperrflaechen fuer die Knoten dahinter:
   die aeussere Bahn laeuft an drei Stellen genau durch sie hindurch.
   Darum bekommen sie sie NICHT zurueck. */

.kosmos-titel {
  max-width: min(470px, 40%);
  min-height: 0;
}

/* Kleine Kernanzeige oben rechts — Zustand des Servers auf einen Blick */
.kernanzeige {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-klein);
  border: 1px solid var(--rand);
  background: rgba(6, 10, 20, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 0;
  max-width: 260px;
  margin-top: var(--abstand-2);
}
.kernanzeige .name {
  font-family: var(--schrift-titel);
  font-size: clamp(0.68rem, 0.8vw, 0.78rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  display: flex; align-items: center; gap: 0.5em;
}
.kernanzeige .name i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--info); box-shadow: 0 0 8px 1px var(--info); flex: none;
}
.kernanzeige .beschreibung {
  font-size: clamp(0.63rem, 0.72vw, 0.72rem);
  color: var(--text-schwach);
  margin: 0.3rem 0 0.55rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kernanzeige .messzeile {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: clamp(0.63rem, 0.72vw, 0.72rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-leise);
}
.kernanzeige .messzeile .zahl { color: var(--text); font-variant-numeric: tabular-nums; }
.kernanzeige .balken { flex: 1 1 auto; width: auto; color: var(--info); }
.kosmos-titel .uebertitel {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: clamp(0.66rem, 0.78vw, 0.76rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--info);
  margin-bottom: 0.7em;
}
.kosmos-titel h1 {
  font-size: clamp(1.7rem, 2.4vw + 0.9rem, 3.1rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  background: linear-gradient(170deg, #ffffff 12%, #a9c6ef 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kosmos-titel p {
  margin: 0.7em 0 0;
  color: var(--text-leise);
  font-size: clamp(0.82rem, 1vw, 0.98rem);
  max-width: 34ch;
  text-wrap: pretty;
}

.kosmos-fuss {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--abstand-2);
  flex-wrap: wrap;
}

/* Legende */
.legende {
  display: flex;
  gap: clamp(0.5rem, 1.4vw, 1.1rem);
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--rand);
  background: rgba(6, 10, 20, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 0;
}
.legende-punkt {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: clamp(0.68rem, 0.74vw, 0.8rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-leise);
  white-space: nowrap;
}
.legende-punkt i {
  width: 8px; height: 8px; border-radius: 50%;
  display: block; flex: none;
}

.kosmos-hinweis {
  font-size: clamp(0.64rem, 0.74vw, 0.73rem);
  color: var(--text-schwach);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: right;
  min-width: 0;
}

/* Karteikarte beim Zeigen auf einen Knoten */
.knoten-karte {
  position: absolute;
  z-index: 20;
  min-width: 208px;
  max-width: min(280px, 74vw);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-klein);
  border: 1px solid var(--rand-hell);
  background: var(--panel-fest);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 22px 55px -20px #000;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.16s, transform 0.16s;
  pointer-events: none;
}
.knoten-karte.sichtbar { opacity: 1; transform: translateY(0); }
.knoten-karte h3 {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.15em;
}
.knoten-karte .karte-status {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.knoten-karte dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.24rem 0.9rem;
  font-size: 0.78rem;
}
.knoten-karte dt { color: var(--text-schwach); }
.knoten-karte dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.knoten-karte .karte-hinweis {
  margin: 0.6rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rand);
  font-size: 0.74rem;
  color: var(--warnung);
}

/* --- 9. Kennzahlen-Kacheln ---------------------------------------------- */
.kennzahlen {
  display: grid;
  /* Sieben Kacheln — die Aufteilung ist bewusst gesetzt, damit nie eine
     einzelne Kachel allein in einer zweiten Zeile haengt. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(0.6rem, 1.2vw, 1rem);
  margin-bottom: var(--abstand-3);
}
/* Ab Stufe 2 zeigt der Leitstand nur noch Kacheln, fuer die es auch wirklich
   eine Quelle gibt — mal sind es sieben, mal drei. Bei festen sieben Spalten
   klaffte rechts dann eine grosse Luecke. Die Spaltenzahl richtet sich deshalb
   nach der Anzahl. Kennt ein Browser :has() nicht, bleibt es bei sieben — das
   ist der bisherige Zustand, also kein Rueckschritt. */
@media (min-width: 1341px) {
  .kennzahlen:not(:has(> :nth-child(7))) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kennzahlen:not(:has(> :nth-child(6))) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kennzahlen:not(:has(> :nth-child(5))) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kennzahlen:not(:has(> :nth-child(4))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kennzahlen:not(:has(> :nth-child(3))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kennzahlen:not(:has(> :nth-child(2))) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1340px) { .kennzahlen { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width:  980px) { .kennzahlen { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Bei sieben Kacheln blieb in der Drei- und in der Zweispaltigkeit die letzte
   Kachel allein in der Schlusszeile stehen — das sah nach Versehen aus. Die
   letzte Kachel fuellt deshalb den Rest ihrer Zeile. Die Regel rechnet mit
   jeder Kachelanzahl, nicht nur mit sieben. */
@media (min-width: 981px) and (max-width: 1340px) {
  .kennzahlen > :last-child:nth-child(4n + 1) { grid-column: span 4; }
  .kennzahlen > :last-child:nth-child(4n + 2) { grid-column: span 3; }
  .kennzahlen > :last-child:nth-child(4n + 3) { grid-column: span 2; }
}
@media (min-width: 721px) and (max-width: 980px) {
  .kennzahlen > :last-child:nth-child(3n + 1) { grid-column: span 3; }
  .kennzahlen > :last-child:nth-child(3n + 2) { grid-column: span 2; }
}
@media (min-width: 341px) and (max-width: 720px) {
  .kennzahlen > :last-child:nth-child(2n + 1) { grid-column: span 2; }
}

.kachel {
  position: relative;
  padding: clamp(0.85rem, 1.6vw, 1.25rem);
  min-width: 0;
  transition: border-color 0.25s, transform 0.25s;
}
.kachel:hover { border-color: var(--rand-hell); transform: translateY(-2px); }

.kachel-name {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: clamp(0.66rem, 0.72vw, 0.8rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-schwach);
  margin-bottom: 0.55rem;
  min-width: 0;
}
.kachel-name b {
  width: 6px; height: 6px; border-radius: 50%;
  /* currentColor im Schatten war die Farbe der Beschriftung, nicht die des
     Punktes: der rote Fehlerpunkt bekam dadurch einen graublauen Hof. Der
     Punkt setzt seine Farbe jetzt selbst. */
  color: var(--info);
  background: currentColor; flex: none;
  box-shadow: 0 0 8px 1px currentColor;
}
.kachel-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kachel-wert {
  display: flex;
  align-items: baseline;
  gap: 0.2em;
  font-family: var(--schrift-titel);
  font-size: clamp(1.65rem, 3.1vw, 2.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.kachel-wert em {
  font-style: normal;
  font-size: 0.44em;
  color: var(--text-leise);
  letter-spacing: 0;
}
.kachel-zusatz {
  margin-top: 0.45rem;
  font-size: clamp(0.7rem, 0.78vw, 0.84rem);
  color: var(--text-leise);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kachel-verlauf {
  position: absolute;
  bottom: 0; left: 0;
  /* SVG ist ein ersetztes Element: ohne width:100% behaelt es die Breite
     aus dem viewBox (200px) und fuellt die Kachel nicht aus. */
  width: 100%;
  height: 42px;
  opacity: 0.55;
  pointer-events: none;
}
.kachel-verlauf path.flaeche { opacity: 0.16; }

.kachel.ist-fehler  .kachel-wert { color: var(--fehler); }
.kachel.ist-fehler  .kachel-name b { color: var(--fehler); }
.kachel.ist-warnung .kachel-wert { color: var(--warnung); }
.kachel.ist-warnung .kachel-name b { color: var(--warnung); }
.kachel.ist-aktiv   .kachel-name b { color: var(--aktiv); }

/* --- 10. Untere Spalten -------------------------------------------------- */
.spalten {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(0.7rem, 1.4vw, 1.1rem);
  align-items: start;
}

/* Projektliste */
.projektliste { display: flex; flex-direction: column; }
.projektzeile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.6rem, 1.3vw, 1rem);
  padding: clamp(0.6rem, 1.2vw, 0.85rem) var(--abstand-3);
  border-bottom: 1px solid rgba(125, 165, 225, 0.07);
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  width: 100%;
}
.projektzeile:last-child { border-bottom: 0; }
/* Das Panel schneidet ueber overflow:hidden alles ab, was ueber seinen Rand
   hinausragt. Der Fokusrahmen lag mit 3 px Abstand genau dort und war links
   und rechts abgeschnitten — sichtbar blieben nur zwei Striche. Er liegt
   deshalb innerhalb der Zeile. */
.projektzeile:focus-visible { outline-offset: -3px; }
.projektzeile:hover, .projektzeile.hervorgehoben { background: rgba(80, 130, 210, 0.09); }

.projektzeile .marker {
  width: 9px; height: 9px; border-radius: 50%;
  flex: none;
  box-shadow: 0 0 10px 1px currentColor;
  background: currentColor;
}
.projektzeile .titel {
  /* Muss Block sein: text-overflow greift nicht auf Inline-Elementen. */
  display: block;
  min-width: 0;
  font-size: clamp(0.86rem, 0.95vw, 1rem);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.projektzeile .unterzeile {
  display: block;
  font-size: clamp(0.7rem, 0.78vw, 0.82rem);
  color: var(--text-schwach);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.projektzeile .rechts {
  display: flex; align-items: center; gap: 0.7rem;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.68rem, 0.78vw, 0.78rem);
  color: var(--text-leise);
  white-space: nowrap;
}
.balken {
  width: clamp(38px, 6vw, 72px);
  height: 4px;
  border-radius: 999px;
  background: rgba(125, 165, 225, 0.15);
  overflow: hidden;
  flex: none;
}
.balken i { display: block; height: 100%; border-radius: 999px; background: currentColor; }

/* Ereignisstrom */
.ereignis {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.55rem 0.75rem;
  align-items: start;
  padding: clamp(0.55rem, 1.1vw, 0.75rem) var(--abstand-3);
  border-bottom: 1px solid rgba(125, 165, 225, 0.07);
}
.ereignis:last-child { border-bottom: 0; }
.ereignis .zeit {
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.7rem, 0.76vw, 0.8rem);
  color: var(--text-schwach);
  padding-top: 0.1em;
}
.ereignis .strich {
  width: 3px;
  align-self: stretch;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.75;
  min-height: 1.4em;
}
.ereignis .inhalt { min-width: 0; }
.ereignis .inhalt strong {
  display: block;
  font-size: clamp(0.68rem, 0.76vw, 0.8rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-schwach);
  font-weight: 500;
}
.ereignis .inhalt span {
  font-size: clamp(0.8rem, 0.9vw, 0.9rem);
  color: var(--text);
  text-wrap: pretty;
}

/* Agentenliste */
.agentenliste { display: flex; flex-direction: column; }
.agentenzeile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: clamp(0.55rem, 1.1vw, 0.78rem) var(--abstand-3);
  border-bottom: 1px solid rgba(125, 165, 225, 0.07);
}
.agentenzeile:last-child { border-bottom: 0; }
.agent-zeichen {
  width: clamp(26px, 3vw, 32px);
  aspect-ratio: 1;
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--schrift-titel);
  font-size: clamp(0.66rem, 0.8vw, 0.78rem);
  letter-spacing: 0.02em;
  border: 1px solid var(--rand);
  background: var(--panel-hell);
  flex: none;
}
.agentenzeile .titel {
  display: block;
  font-size: clamp(0.84rem, 0.92vw, 0.98rem);
}
.agentenzeile .unterzeile {
  display: block;
  font-size: clamp(0.7rem, 0.78vw, 0.82rem);
  color: var(--text-schwach);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- 11. Fussbereich ----------------------------------------------------- */
/* Die Fusszeile endete vorher abrupt mit einer Haarlinie und zwei grauen
   Versalzeilen. Jetzt bekommt sie Luft, ein kleines Markenzeichen und
   dieselbe zweizeilige Ordnung wie die Listen darueber. */
.fusszeile {
  margin-top: var(--abstand-4);
  padding-top: var(--abstand-3);
  border-top: 1px solid var(--rand);
  display: flex;
  gap: var(--abstand-2);
  flex-wrap: wrap;
  align-items: center;
  font-size: clamp(0.68rem, 0.76vw, 0.78rem);
  color: var(--text-schwach);
}
.fusszeile b {
  display: block;
  font-weight: 500;
  font-family: var(--schrift-titel);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-leise);
}
.fusszeile .fuss-stand { margin-left: auto; text-align: right; }

.fuss-marke {
  width: 22px; aspect-ratio: 1; flex: none;
  border-radius: 7px;
  border: 1px solid var(--rand);
  background: linear-gradient(150deg, rgba(78, 200, 255, 0.22), rgba(56, 240, 164, 0.10));
  display: grid; place-items: center;
}
.fuss-marke::after {
  content: "";
  width: 32%; aspect-ratio: 1; border-radius: 50%;
  background: #cdeeff;
  box-shadow: 0 0 8px 1px rgba(140, 225, 255, 0.7);
}

@media (max-width: 560px) {
  .fusszeile .fuss-stand { margin-left: 0; text-align: left; width: 100%; }
}

/* --- 12. Bewegungen ------------------------------------------------------ */
@keyframes pulsen {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 currentColor; }
  50%      { opacity: 0.5; box-shadow: 0 0 0 4px rgba(0,0,0,0); }
}
@keyframes kreisen { to { transform: rotate(360deg); } }

/* --- 13. Kleinere Bildschirme ------------------------------------------- */
@media (max-width: 900px) {
  .spalten { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .kosmos-leinwand { height: clamp(370px, 56vh, 500px); }
  .kosmos-titel { max-width: 100%; }
  .kosmos-ebene { justify-content: flex-start; gap: var(--abstand-2); }
  .kosmos-fuss { margin-top: auto; }
  .kosmos-hinweis { display: none; }
  .kernanzeige { display: none; }
  .legende { width: 100%; justify-content: space-between; }
  .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uhr { display: none; }
  /* Am Handy nur der erste Satz - der zweite steht ohnehin in der Legende */
  .kosmos-titel .nur-breit { display: none; }
  .panel-koerper { padding: var(--abstand-2); }

  /* Titel und Unterzeile sind inline. Am Handy passte mal beides in eine
     Zeile, mal nicht — die Liste wirkte dadurch unruhig, und die Zeilen
     blieben unter den 44 px, die eine Fingerflaeche braucht. Am Handy
     stehen sie deshalb immer untereinander. */
  .projektzeile .titel,
  .projektzeile .unterzeile,
  .agentenzeile .titel,
  .agentenzeile .unterzeile { display: block; }

  /* Fingerflaechen: 27 px hohe Navigationspunkte und ein 31 px hoher
     Schalter waren am Handy zu klein zum sicheren Treffen. */
  .hauptnavigation a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .knopf { min-height: 44px; }
}

/* Auch bei 320 px passen zwei Kacheln nebeneinander — sieben untereinander
   waeren ueber 1000 px reines Scrollen. */

/* --- 14. Ruhiger Modus (Systemeinstellung oder Schalter) ----------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
body.ruhig .marke-zeichen::before,
body.ruhig .pille .punkt { animation: none; }

/* --- 15. Hauptnavigation ------------------------------------------------- */
/* Stufe 1 ist eine Seite — die Punkte springen zu den Abschnitten. In Stufe 2
   werden daraus echte Seiten, ohne dass sich am Aussehen etwas aendert. */
.hauptnavigation {
  display: flex;
  align-items: center;
  gap: clamp(0.15rem, 0.6vw, 0.4rem);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--rand);
  background: rgba(9, 14, 26, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.hauptnavigation::-webkit-scrollbar { display: none; }

.hauptnavigation a {
  position: relative;
  padding: 0.42em 0.95em;
  border-radius: 999px;
  font-size: clamp(0.7rem, 0.78vw, 0.79rem);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-leise);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.hauptnavigation a:hover { color: var(--text); background: var(--panel-hell); }

.hauptnavigation a.ist-hier {
  color: var(--text);
  background: linear-gradient(180deg, rgba(78, 200, 255, 0.20), rgba(78, 200, 255, 0.07));
  box-shadow: inset 0 0 0 1px rgba(78, 200, 255, 0.34),
              0 0 18px -6px rgba(78, 200, 255, 0.55);
}

/* Die Kopfleiste klebt oben — Sprungziele brauchen Abstand darunter,
   sonst verschwindet die Ueberschrift des Abschnitts dahinter. */
#uebersicht, #projekte, #agenten, #aktivitaet { scroll-margin-top: 5.5rem; }

@media (max-width: 720px) {
  .hauptnavigation {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    /* Bei 320 px Breite und erst recht bei vergroesserter Schrift passt der
       vierte Punkt nicht mehr hinein. Die Leiste laesst sich schieben, das
       war aber nicht zu erkennen: der Balken ist ausgeblendet und der Text
       brach hart an der Kante ab. Der weiche Rand zeigt jetzt, dass rechts
       noch etwas kommt. */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  }
  .hauptnavigation a { padding: 0.42em 0.7em; }
}

/* --- 16. Nachtrag aus der Designpruefung --------------------------------- */

/* Hinweis, wenn JavaScript aus ist — sonst steht dort ein leerer schwarzer
   Kasten. Alle Angaben stehen ohnehin in den Listen darunter. */
.kosmos-ohne-js {
  position: absolute;
  inset: auto 0 42% 0;
  margin: 0;
  text-align: center;
  color: var(--text-leise);
  font-size: clamp(0.8rem, 0.95vw, 0.95rem);
  padding: 0 var(--abstand-3);
}

/* Waehrend die Karteikarte offen ist, tritt die Kernanzeige zurueck —
   zwei sich ueberlappende Glaskaesten wirken unsauber. */
.kosmos.karte-offen .kernanzeige { opacity: 0.25; }
.kernanzeige { transition: opacity 0.18s; }

/* Lange und kurze Beschriftung des Schalters */
.knopf-kurz { display: none; }

/* --- Handy: Kopfleiste entschlacken ------------------------------------- */
/* Gemessen waren es vier gestapelte Reihen = 203 px, bei vergroesserter
   Schrift 276 px — ein Viertel bis ein Drittel des iPhone-Bildschirms,
   und das dauerhaft klebend. Jetzt: Marke + Zustand + Schalter in einer
   Reihe, Navigation in der zweiten. */
@media (max-width: 720px) {
  .nur-breit { display: none; }
  .knopf-lang { display: none; }
  .knopf-kurz { display: inline; }

  .kopfleiste { padding: 0.45rem 0 0.35rem; gap: 0.4rem 0.5rem; }
  .kopf-rechts { gap: 0.4rem; }
  .marke-zeichen { width: 26px; }
  .wortmarke { font-size: 0.82rem; letter-spacing: 0.12em; }
  .wortmarke span { display: none; }

  .hauptnavigation { order: 3; width: 100%; }

  /* Fingerflaechen: der Designer hat 44 px gesetzt — beibehalten, aber die
     Innenabstaende so waehlen, dass die Reihe nicht hoeher wird als noetig. */
  .pille { padding: 0.3em 0.7em; }
}

/* --- Grosse Bildschirme: Grafik darf mitwachsen ------------------------- */
@media (min-width: 1600px) {
  .kosmos-leinwand { height: clamp(430px, min(64vh, 44vw), 820px); }
}

/* --- 17. Navigation am Handy: alle vier Punkte sichtbar ------------------ */
/* Der weiche Rand war die richtige Notloesung, solange die Leiste geschoben
   werden musste. Besser ist, dass gar nicht geschoben werden muss: vier
   gleich breite Felder, die sich der Breite anpassen. Gemessen bei 375 px
   und vergroesserter Schrift (21 px) — vorher ragte "AKTIVITÄT" 83 px aus
   dem Bild und war nur durch Schieben erreichbar. */
@media (max-width: 720px) {
  .hauptnavigation {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .hauptnavigation a {
    padding: 0.42em 0.3em;
    text-align: center;
    letter-spacing: 0.04em;
    font-size: clamp(0.62rem, 2.6vw, 0.74rem);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* --- 18. Warnungszentrale ------------------------------------------------ */
.meldungen { margin-bottom: clamp(0.7rem, 1.4vw, 1.1rem); }

.meldung {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  gap: 0.4rem 0.85rem;
  align-items: baseline;
  padding: clamp(0.5rem, 1vw, 0.7rem) var(--abstand-3);
  border-bottom: 1px solid rgba(125, 165, 225, 0.07);
  border-left: 3px solid currentColor;
  font-size: clamp(0.8rem, 0.9vw, 0.92rem);
}
.meldung:last-child { border-bottom: 0; }
.meldung.ist-fehler  { color: var(--fehler);  background: rgba(255, 79, 109, 0.05); }
.meldung.ist-warnung { color: var(--warnung); background: rgba(255, 180, 61, 0.04); }
.meldung.ist-info    { color: var(--info); }

.meldung-stufe {
  font-family: var(--schrift-titel);
  font-size: clamp(0.6rem, 0.7vw, 0.7rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  min-width: 4.6em;
}
.meldung-bereich {
  font-size: clamp(0.63rem, 0.72vw, 0.74rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-schwach);
  min-width: 7em;
}
.meldung-projekt { color: var(--text); font-weight: 500; min-width: 9em; }
.meldung-text { color: var(--text-leise); min-width: 0; text-wrap: pretty; }
.meldung-leer {
  margin: 0; padding: var(--abstand-3);
  color: var(--text-leise); text-wrap: pretty;
}

@media (max-width: 720px) {
  .meldung { grid-template-columns: auto minmax(0, 1fr); }
  .meldung-bereich { display: none; }
  .meldung-text { grid-column: 1 / -1; }
}

/* --- 19. API & KI -------------------------------------------------------- */
.api-zahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(130px, 13vw, 180px), 1fr));
  gap: clamp(0.7rem, 1.4vw, 1.2rem);
  padding-bottom: var(--abstand-3);
  border-bottom: 1px solid var(--rand);
  margin-bottom: var(--abstand-3);
}
.api-zahl { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.api-name {
  font-size: clamp(0.63rem, 0.72vw, 0.76rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-schwach);
}
.api-wert {
  font-family: var(--schrift-titel);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  display: flex; align-items: baseline; gap: 0.18em;
}
.api-wert em { font-style: normal; font-size: 0.46em; color: var(--text-leise); }
.api-zusatz { font-size: clamp(0.66rem, 0.76vw, 0.78rem); color: var(--text-leise); }
.api-zahl .balken { width: 100%; }

.api-tabellen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--abstand-3);
}
.api-titel {
  font-size: clamp(0.66rem, 0.76vw, 0.78rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-schwach);
  font-family: var(--schrift-titel);
  font-weight: 500;
  margin-bottom: 0.6rem;
}
.api-zeile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(50px, 8vw, 110px) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.34rem 0;
  font-size: clamp(0.76rem, 0.86vw, 0.88rem);
  color: var(--text-leise);
}
.api-zeile > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-zeile .zahl { color: var(--text); white-space: nowrap; font-size: 0.94em; }

.api-hinweis {
  margin: var(--abstand-2) 0 0;
  padding-top: var(--abstand-2);
  border-top: 1px solid var(--rand);
  font-size: clamp(0.76rem, 0.86vw, 0.88rem);
  color: var(--text-leise);
  text-wrap: pretty;
}
.api-hinweis b { color: var(--text); }

#warnungen, #api { scroll-margin-top: 5.5rem; }

/* --- 20. Klangschalter --------------------------------------------------- */
.knopf-klang {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding-inline: 0.7em;
}
.klang-zeichen { font-size: 0.95em; line-height: 1; filter: grayscale(1) brightness(1.7); }
.knopf-klang[data-stufe="0"] .klang-zeichen { opacity: 0.45; }

/* Vier kleine Balken zeigen die Stufe — ruhig, kein Ausschlag im Takt. */
.klang-balken { display: inline-flex; align-items: flex-end; gap: 2px; height: 0.85em; }
.klang-balken i {
  width: 2px;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.22;
  transition: opacity 0.25s, height 0.25s;
}
.klang-balken i:nth-child(1) { height: 30%; }
.klang-balken i:nth-child(2) { height: 52%; }
.klang-balken i:nth-child(3) { height: 76%; }
.klang-balken i:nth-child(4) { height: 100%; }
.knopf-klang[data-stufe="1"] .klang-balken i:nth-child(-n+1),
.knopf-klang[data-stufe="2"] .klang-balken i:nth-child(-n+2),
.knopf-klang[data-stufe="3"] .klang-balken i:nth-child(-n+3),
.knopf-klang[data-stufe="4"] .klang-balken i:nth-child(-n+4) { opacity: 1; }

.knopf-klang[data-stufe="0"] { color: var(--text-schwach); }
.knopf-klang:not([data-stufe="0"]) {
  color: var(--info);
  border-color: rgba(78, 200, 255, 0.34);
  background: rgba(78, 200, 255, 0.08);
}

/* Erster Hinweis, solange der Browser noch keinen Ton zulässt */
.klang-hinweis {
  position: absolute;
  right: clamp(1.1rem, 2.6vw, 2.2rem);
  bottom: clamp(1.1rem, 2.6vw, 2.2rem);
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 0.95em;
  border-radius: 999px;
  border: 1px solid rgba(78, 200, 255, 0.3);
  background: rgba(6, 12, 24, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--info);
  font-size: clamp(0.68rem, 0.78vw, 0.78rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}
.klang-hinweis.sichtbar { opacity: 1; transform: translateY(0); pointer-events: auto; }
.klang-hinweis:hover { border-color: rgba(78, 200, 255, 0.55); }

@media (max-width: 720px) {
  .klang-balken { display: none; }
  .klang-hinweis { right: auto; left: 50%; transform: translate(-50%, 6px); }
  .klang-hinweis.sichtbar { transform: translate(-50%, 0); }
}

/* --- 21. Claude API: Gesamtüberblick ------------------------------------- */
.ki-gross {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(140px, 15vw, 200px), 1fr));
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
  padding-bottom: var(--abstand-3);
  border-bottom: 1px solid var(--rand);
}
.ki-wert { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.ki-name {
  font-size: clamp(0.65rem, 0.74vw, 0.78rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-schwach);
  display: flex; align-items: baseline; gap: 0.7em; flex-wrap: wrap;
}
.ki-zahl {
  font-family: var(--schrift-titel);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  display: flex; align-items: baseline; gap: 0.16em;
  color: var(--text);
}
.ki-zahl.klein { font-size: clamp(1.2rem, 2vw, 1.7rem); color: var(--text-leise); }
.ki-zahl em { font-style: normal; font-size: 0.42em; color: var(--text-leise); }
.ki-zusatz {
  font-size: clamp(0.68rem, 0.76vw, 0.8rem);
  color: var(--text-leise);
  letter-spacing: 0;
  text-transform: none;
}

/* --- Budget --- */
.ki-budget { padding: var(--abstand-3) 0; border-bottom: 1px solid var(--rand); }
.ki-budget-kopf {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--abstand-2); flex-wrap: wrap; margin-bottom: 0.6rem;
}
.ki-budget-kopf .zahl {
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.82rem, 0.95vw, 0.98rem);
  color: var(--text);
}
.balken.gross { width: 100%; height: 9px; border-radius: 999px; }
.ki-budget.ist-aktiv   .balken.gross { color: var(--aktiv); }
.ki-budget.ist-warnung .balken.gross { color: var(--warnung); }
.ki-budget.ist-fehler  .balken.gross { color: var(--fehler); }
.ki-budget.ist-ruhend  .balken.gross { color: var(--ruhend); }
.ki-budget-text {
  margin: 0.55rem 0 0;
  font-size: clamp(0.74rem, 0.84vw, 0.86rem);
  color: var(--text-leise);
}
.ki-budget.ist-fehler .ki-budget-text { color: var(--fehler); }
.ki-budget.ist-warnung .ki-budget-text { color: var(--warnung); }

/* --- Diagramm --- */
.ki-diagramm { padding: var(--abstand-3) 0; border-bottom: 1px solid var(--rand); }
.ki-diagramm svg {
  display: block; width: 100%; height: clamp(70px, 9vw, 110px);
  margin-top: 0.7rem; overflow: visible;
}
.ki-diagramm rect {
  fill: var(--info);
  opacity: 0.72;
  transition: opacity 0.2s;
}
.ki-diagramm rect:hover { opacity: 1; }
.ki-diagramm rect.leer { fill: var(--text-schwach); opacity: 0.28; }

/* --- Aufklappbare Einzelheiten --- */
.ki-details { margin-top: var(--abstand-3); }
.ki-details > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: clamp(0.7rem, 0.8vw, 0.82rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-leise);
  padding: 0.45em 0.9em;
  border: 1px solid var(--rand);
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}
.ki-details > summary::-webkit-details-marker { display: none; }
.ki-details > summary::before { content: "▸"; transition: transform 0.2s; }
.ki-details[open] > summary::before { transform: rotate(90deg); }
.ki-details > summary:hover { color: var(--text); border-color: var(--rand-hell); }
.ki-details-inhalt {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--abstand-3);
  margin-top: var(--abstand-3);
}

/* --- Wenn noch keine Quelle da ist --- */
.ki-leer { color: var(--text-leise); text-wrap: pretty; }
.ki-leer p { margin: 0 0 0.7rem; }
.ki-leer-titel {
  font-family: var(--schrift-titel);
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  color: var(--warnung);
  letter-spacing: -0.01em;
}
.ki-leer b { color: var(--text); }
.ki-leer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(125, 165, 225, 0.1);
  border: 1px solid var(--rand);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  color: var(--info);
  overflow-wrap: anywhere;
}
.ki-schritte { margin: 0 0 0.9rem; padding-left: 1.3rem; }
.ki-schritte li { margin-bottom: 0.4rem; }
