/* KI-Anzeige in der Kopfzeile (data/ux-referenz/KIAnzeige-v1.html, Seitengerüst 1.8).
   Eigene Datei, damit auch die Verwaltung sie lädt; nur Tokens aus tokens.css. */
.ki-anzeige { position: relative; display: flex; align-items: center; }
.ki-pille { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--aktion-rand-pille); background: var(--aktion-hell); color: var(--aktion-dunkel); font: inherit; font-size: var(--s-neben); font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; }
.ki-pille.angehalten { border-color: var(--teils-rand-pille); background: var(--teils-flaeche); color: var(--teils); }
.ki-pille.fehler { border-color: var(--schlecht-rand-pille); background: var(--schlecht-flaeche); color: var(--schlecht); }
.ki-pille.fertig { border-color: var(--gut-rand); background: var(--gut-flaeche); color: var(--gut); }
.ki-pille:focus-visible, .ki-knopf:focus-visible, .ki-fenster a:focus-visible { outline: 2px solid var(--aktion); outline-offset: 2px; }
.ki-pille svg { flex: none; }
@keyframes ki-dreh { to { transform: rotate(360deg); } }
.ki-dreh { animation: ki-dreh 1.1s linear infinite; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: reduce) { .ki-dreh { animation: none; } }

/* Fenster: 360 px, rechtsbündig unter der Pille; ein unsichtbarer Steg hält es beim Überfahren offen */
.ki-fenster { position: absolute; top: 40px; right: 0; z-index: 50; width: 360px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 16px 16px 12px; background: var(--flaeche); border: 1px solid var(--rand-stark); border-radius: 12px; box-shadow: var(--schatten-fenster); color: var(--text); text-align: left; font-size: var(--s-neben); font-weight: 400; line-height: var(--zeile); }
.ki-fenster::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.ki-fenster[hidden] { display: none; }
.ki-fenster-titel { margin-bottom: 4px; font-size: var(--s-neben); font-weight: 600; color: var(--text-leise); }
.ki-liste { margin: 0; padding: 0; list-style: none; max-height: 60vh; overflow-y: auto; }
.ki-eintrag { padding: 12px 0; border-bottom: 1px solid var(--rand); }
.ki-eintrag-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ki-eintrag-titel { font-size: var(--s-text); font-weight: 600; }
.ki-eintrag-zustand { flex: none; font-size: var(--s-neben); font-weight: 600; white-space: nowrap; color: var(--text-leise); }
.ki-eintrag-zustand.laeuft { color: var(--aktion-dunkel); }
.ki-eintrag-zustand.angehalten { color: var(--teils); }
.ki-eintrag-zustand.fehler { color: var(--schlecht); }
.ki-eintrag-zustand.fertig { color: var(--gut); }
.ki-eintrag-wo { margin-top: 4px; font-size: var(--s-neben); color: var(--text-leise); }
.ki-eintrag-wo a { color: var(--text-leise); }
.ki-eintrag-wo a:hover { color: var(--aktion-dunkel); }
.ki-eintrag-stand { margin-top: 8px; }
.ki-eintrag-zeit { margin-top: 4px; font-size: var(--s-neben); color: var(--text-schwach); }
.ki-eintrag-aktion { margin-top: 8px; display: flex; justify-content: flex-end; }
.ki-eintrag-aktion form { margin: 0; }
.ki-knopf { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--rand-stark); border-radius: 8px; background: var(--flaeche); font: inherit; font-size: var(--s-neben); font-weight: 600; color: var(--text); white-space: nowrap; cursor: pointer; text-decoration: none; }
.ki-knopf:hover { border-color: var(--aktion); color: var(--aktion-dunkel); }
.ki-fenster-fuss { display: flex; justify-content: flex-end; padding-top: 12px; }
.ki-fenster-fuss a { font-size: var(--s-neben); font-weight: 600; color: var(--aktion); text-decoration: none; }
.ki-fenster-fuss a:hover { color: var(--aktion-dunkel); }
.ki-unsichtbar { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
  .ki-pille { padding: 0 10px; }
  .ki-fenster { position: fixed; top: 56px; right: 16px; left: 16px; width: auto; max-width: none; }
}

/* Autopilot (Vorlage Autopilot-Lauf-v1.html): neun Phasen im Fenster */
.ki-ap-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ki-ap-kopf .ki-fenster-titel { margin: 0; font-size: var(--s-lese); color: var(--text); }
.ki-ap-zaehler { font-size: var(--s-neben); color: var(--text-leise); white-space: nowrap; }
.ki-ap-zeile { margin-top: 4px; font-size: var(--s-neben); color: var(--text-leise); }
.ki-ap-phasen { margin: 12px 0 0; padding: 0; list-style: none; }
.ki-ap-phasen li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; padding: 4px 0; }
.ki-ap-marke { width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--rand-stark); display: inline-flex; align-items: center; justify-content: center; color: var(--conf); }
.ki-ap-phasen li.fertig .ki-ap-marke { border-color: var(--gut-flaeche); background: var(--gut-flaeche); color: var(--gut); }
.ki-ap-phasen li.laeuft .ki-ap-marke { border: 2px solid var(--aktion); box-shadow: inset 0 0 0 3px var(--flaeche); background: var(--aktion); }
.ki-ap-name { font-size: var(--s-text); line-height: var(--zeile); color: var(--text); }
.ki-ap-phasen li.offen .ki-ap-name, .ki-ap-phasen li.uebersprungen .ki-ap-name { color: var(--text-leise); }
.ki-ap-phasen li.laeuft .ki-ap-name { font-weight: 600; }
.ki-ap-detail { font-size: var(--s-neben); line-height: var(--zeile); color: var(--text-leise); }
.ki-ap-knoepfe { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rand); }
.ki-ap-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.ki-knopf.haupt { background: var(--aktion-gefuellt); border-color: var(--aktion-gefuellt); color: var(--auf-aktion); }
.ki-knopf.haupt:hover { background: var(--aktion-dunkel); color: var(--auf-aktion); }
.ki-ap-grenze { display: inline-flex; align-items: center; gap: 4px; font-size: var(--s-neben); color: var(--text-leise); }
.ki-ap-grenze input { width: 64px; height: 32px; padding: 0 8px; }
.ki-ap-hinweis { margin: 12px 0 0; font-size: var(--s-neben); line-height: var(--zeile); color: var(--text-leise); }

/* Autopilot: auf schmalen Bildschirmen die Kurzform in der Pille (die Kopfzeile bleibt einzeilig) */
.ki-text-kurz { display: none; }
@media (max-width: 480px) {
  .ki-text-lang { display: none; }
  .ki-text-kurz { display: inline; }
}
