/* ============================================================
   fluss.css — Bauteile Status-Chip, Fenster und Ablauf (fluss.js)
   fuer die Inhaltsseiten (inhalt.css). Nutzt die Tokens aus style.css.

   Diese Regeln stehen 1:1 auch in start.css (dort fuer den Hero der
   Startseite). Bewusst dupliziert statt geteilt: so bleibt die Live-
   Startseite beim Bau von /ki-automatisierung/ voellig unberuehrt. Beim
   naechsten Mal, wenn ein weiteres Bauteil beide Seiten braucht, aus
   start.css herausloesen und hier gemeinsam laden (Dedupe).
   ============================================================ */

/* ---------- Status-Chip ----------
   Farbe ist nie allein: jeder Chip traegt Symbol und Text (WCAG 1.4.1). */
.status {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; line-height: 1; color: var(--tinte);
  padding: 5px 9px 5px 7px; border: 1px solid var(--linie); background: var(--weiss);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.status .icon { width: 13px; height: 13px; }
.status[data-status="neu"] { background: var(--dunst); border-color: var(--linie); }
.status[data-status="manuell"] { background: var(--weiss); border-color: var(--linie); color: var(--knochen); }
.status[data-status="aktiv"] { background: color-mix(in oklch, var(--moos) 12%, var(--weiss)); border-color: var(--moos); }
.status[data-status="aktiv"] .icon { color: var(--moos); animation: status-dreh 1.4s linear infinite; }
.status[data-status="wartet"], .status[data-status="freigabe"] { background: var(--gold-hell); border-color: var(--gold); }
.status[data-status="wartet"] .icon, .status[data-status="freigabe"] .icon { color: oklch(0.52 0.1 80); }
.status[data-status="fertig"] { background: var(--ok-hell); border-color: var(--ok); }
.status[data-status="fertig"] .icon { color: var(--ok); }
.status[data-status="fehler"] { background: var(--fehler-hell); border-color: var(--fehler); }
.status[data-status="fehler"] .icon { color: var(--fehler); }
@keyframes status-dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .status .icon { animation: none !important; } }

/* ---------- Fenster: Rahmen fuer echte Oberflaechen ----------
   Keine Geraete-Attrappe: nur Titelleiste und Inhalt. */
.fenster {
  background: var(--weiss); color: var(--tinte);
  border: 1px solid var(--linie);
  box-shadow: 0 30px 60px -36px oklch(0.16 0.02 235 / 0.35);
  overflow: hidden;
}
.fenster-kopf {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--linie);
  background: var(--hell);
  font-family: var(--mono); font-size: 12px; color: var(--grau);
}
.fenster-kopf::before {
  content: ''; width: 34px; height: 8px; flex: none;
  background: radial-gradient(circle at 4px 4px, var(--linie) 3.5px, transparent 4px) 0 0 / 13px 8px repeat-x;
}
.fenster-titel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fenster-live { display: inline-flex; align-items: center; gap: 6px; }
.fenster-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.fenster-notiz { margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: var(--grau); }

/* ---------- Ablauf (WorkflowNode / Edge) ----------
   Senkrechte Knotenliste: Symbol | Titel + Detail | Status. Die Kante ist
   eine Linie durch die Symbol-Spalte, der Paket-Punkt wandert per transform
   darauf. Ohne Skript stehen alle Knoten auf "fertig". */
.fluss { position: relative; list-style: none; margin: 0; padding: 14px 18px 10px; }
.fluss::before {
  content: ''; position: absolute; left: calc(18px + 3px + 21px); top: 34px; bottom: 34px;
  width: 2px; margin-left: -1px; background: var(--linie);
}
.fluss-paket {
  position: absolute; left: calc(18px + 3px + 21px); top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--moos); box-shadow: 0 0 0 4px color-mix(in oklch, var(--moos) 20%, transparent);
  opacity: 0; transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.fluss-paket.ist-unterwegs { opacity: 1; }
.fluss-knoten {
  position: relative;
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px 10px 10px 0; margin-left: 0;
  border-left: 3px solid transparent;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}
.fluss-symbol {
  position: relative; z-index: 1;
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--weiss); border: 1px solid var(--linie); color: var(--knochen);
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}
.fluss-symbol .icon { width: 19px; height: 19px; }
.fluss-titel { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; }
.fluss-detail { display: block; font-size: 13.5px; line-height: 1.45; color: var(--grau); }
.fluss-detail + .fluss-detail { margin-top: 2px; }
.fluss-detail[data-feld="verarbeitung"], .fluss-detail[data-feld="ziel"] { min-height: 1.45em; }

/* Rollen */
.fluss-knoten[data-art="ki"] .fluss-symbol { color: var(--moos); }
.fluss-knoten[data-art="mensch"] .fluss-symbol { border-color: var(--gold); color: oklch(0.52 0.1 80); background: var(--gold-hell); }

/* Zustaende - nur das Skript setzt "wartet" und "aktiv". */
.fluss-knoten[data-status="wartet"] { opacity: 0.45; }
.fluss-knoten[data-status="wartet"] .status { visibility: hidden; }
.fluss-knoten[data-status="aktiv"] .fluss-symbol { border-color: var(--moos); }
/* Die goldene Stelle: Wartet der Ablauf auf einen Menschen, bekommt die
   ganze Zeile die Gold-Flaeche. Das ist der Moment, den man sich merken soll. */
.fluss-knoten[data-art="mensch"][data-status="aktiv"] { background: var(--gold-hell); border-left-color: var(--gold); }
.fluss-knoten[data-art="mensch"][data-status="aktiv"] .fluss-symbol { border-color: var(--gold); }
.fluss-knoten.ist-gedrueckt .fluss-symbol { transform: scale(0.9); background: var(--gold); color: var(--tinte); }

.fluss-protokoll {
  display: flex; gap: 12px; align-items: baseline;
  margin: 0; padding: 10px 18px;
  background: var(--tinte); color: var(--grau-hell);
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
}
.fluss-protokoll .zeit { color: var(--blatt); flex: none; }
.fluss-protokoll .text { color: var(--hell); }
.fluss-protokoll .text.ist-neu { animation: protokoll-ein 0.35s ease-out; }
@keyframes protokoll-ein { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  .fluss-paket { display: none; }
  .fluss-knoten, .fluss-symbol, .fluss-protokoll .text.ist-neu { transition: none; animation: none; }
}

@media (max-width: 900px) {
  /* Mobil bleiben alle vier Knoten stehen; nur-breit faellt weg, falls genutzt. */
  .fluss-knoten.nur-breit { display: none; }
}
@media (max-width: 480px) {
  .fluss { padding: 10px 12px 6px; }
  .fluss::before, .fluss-paket { left: calc(12px + 3px + 18px); }
  .fluss-knoten { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
  .fluss-symbol { width: 36px; height: 36px; }
  .fluss-knoten .status { grid-column: 2; justify-self: start; }
}
