/* ─────────────────────────────────────────────────────────────────────────
   System · Mission Control — futuristic ops console.
   Inherits the hub's palette (style.css :root) and extends it with neon /
   glass tokens. No framework, no build.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #070a18;
  --bg-2: #0b0e1c;
  --panel: rgba(18, 24, 52, 0.55);
  --panel-solid: #11152a;
  --border: rgba(108, 140, 255, 0.22);
  --border-strong: rgba(108, 140, 255, 0.45);
  --text: #e8ecff;
  /* Kontrast gegen den Panelgrund, gemessen: Text 16,2:1 · gedämpft 9,1:1 ·
     leise 6,3:1. Die frühere Stufe --faint #5a628f lag bei 3,2:1 und damit
     unter dem AA-Minimum von 4,5:1 — bei 10-px-Fließtext war sie kaum zu
     lesen (Arno, 03.09.2026). Angehoben wurde die GANZE Leiter, damit die
     Dreistufigkeit erhalten bleibt: der alte --muted ist der neue --faint. */
  --muted: #aab2d6;
  --faint: #8a93bf;
  --accent: #6c8cff;
  --accent-2: #8a6cff;
  --cyan: #22d3ee;
  --ok: #4fd3a5;
  --warn: #f0b454;
  --err: #ff6b8a;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
  --glow-cyan: 0 0 18px rgba(34, 211, 238, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 800px at 50% 32%, #12183a 0%, var(--bg-2) 45%, var(--bg) 100%);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100vh;
}

/* animated faint grid + scanline backdrop */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(108, 140, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 140, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  animation: gridDrift 60s linear infinite;
}
@keyframes gridDrift { to { background-position: 44px 44px, 44px 44px; } }

/* HUD-Paneel: abgeschraegte Ecke oben rechts, Lichtkante oben. Der Schnitt
   ist rein optisch — er sagt nichts ueber Daten, macht aber aus einem
   Rechteck ein Instrument. */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(34, 211, 238, 0.22);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
}
.hidden { display: none !important; }

/* ───────────── vitals bar ───────────── */

.vitals {
  position: relative; z-index: 2;
  margin: 10px 12px 0;
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.vitals-brand { display: flex; align-items: center; gap: 10px; }
.vitals-glyph {
  font-size: 22px;
  filter: drop-shadow(var(--glow-cyan));
}
.vitals-title { display: flex; flex-direction: column; line-height: 1.15; }
.vitals-title strong { letter-spacing: 3px; font-size: 13px; color: var(--cyan); }
.vitals-sub { font: 11px var(--mono); color: var(--muted); letter-spacing: 1px; }

.vitals-stats {
  display: flex; align-items: center; gap: 16px;
  margin-left: auto; flex-wrap: wrap;
}

/* Claude-CLI-Token — sitzt in der freien Fläche zwischen Brand und
   Fleet-Zählern; eigene Umrandung, weil es eine fremde Datenquelle ist
   (lokale CLI-Transkripte, nicht der Hub). */
.vitals-tokens {
  display: flex; align-items: center; gap: 14px;
  margin-left: 22px;
  /* knapp gehalten: der Block darf die Kopfzeile nicht höher machen als
     die Fleet-Zähler rechts daneben */
  padding: 3px 13px 3px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(34, 211, 238, 0.045);
  cursor: default;
}
.vt-badge {
  font: 700 9px/1.2 var(--mono);
  letter-spacing: 1.4px;
  color: var(--cyan);
  opacity: 0.8;
  text-align: right;
}
.vitals-tokens .stat { min-width: 62px; }
.vitals-tokens .stat b { font-size: 15px; }
.vitals-tokens .stat[data-k="ctsession"] b { color: var(--cyan); }
.vitals-tokens .stat[data-k="ctweek"] b { color: var(--accent-2); }
.vitals-tokens .stat span { text-transform: none; letter-spacing: 0.2px; }
.vitals-tokens .stat span i { font-style: normal; }
/* Hauptzahl ist normalerweise das freie Restkontingent. Wird es knapp,
   soll die Farbe das sagen — die beiden Grundfarben (cyan/violett) tragen
   diese Information nicht. */
.vitals-tokens .stat.warn b { color: var(--warn) !important; }
.vitals-tokens .stat.crit b { color: var(--err) !important; }
/* Ohne Prozentwert steht dort eine Tokenmenge — leicht abgesetzt, damit
   niemand die eine Zahl für die andere hält. */
.vitals-tokens.no-quota .stat b { font-size: 14px; opacity: 0.9; }
.vitals-tokens.stale { opacity: 0.55; }
.vitals-tokens.stale .stat b { color: var(--faint); }

/* Schmale Fenster: die Kopfzeile umbricht sonst auf zwei Reihen und frisst
   Bühnenfläche. Zuerst fällt die Reset-Restzeit weg (steht weiterhin im
   Tooltip) — die Herkunftsangabe „CLAUDE CLI" bleibt, sonst wären die zwei
   Zahlen im Launchpad-Kontext nicht mehr zuzuordnen. */
@media (max-width: 1320px) {
  .vitals-tokens { margin-left: 14px; gap: 10px; padding-left: 9px; padding-right: 10px; }
  .vitals-tokens .stat { min-width: 54px; }
  .vitals-tokens .stat b { font-size: 13px; }
  #ctSessionLeft, #ctWeekLeft { display: none; }
}
.stat {
  display: flex; flex-direction: column; align-items: center;
  min-width: 46px; position: relative;
}
.stat b { font: 600 18px/1 var(--mono); }
.stat span { font-size: 10px; color: var(--muted); letter-spacing: 0.4px; margin-top: 2px; text-transform: uppercase; }
.stat.sep::before {
  content: ""; position: absolute; left: -8px; top: 2px; bottom: 2px;
  width: 1px; background: var(--border);
}
.stat[data-k="running"] b { color: var(--ok); }
.stat[data-k="starting"] b { color: var(--warn); }
.stat[data-k="paused"] b { color: var(--accent); }
.stat[data-k="crashed"] b { color: var(--err); }
.stat[data-k="stopped"] b { color: var(--faint); }

.gpu-meter {
  width: 54px; height: 6px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden; margin-bottom: 3px;
}
.gpu-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--accent-2));
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
  transition: width 0.6s ease;
}
.stat[data-k="gpu"] b { font-size: 12px; }

.vitals-conn {
  display: flex; align-items: center; gap: 7px;
  font: 11px var(--mono); color: var(--muted);
}
.conn-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 8px var(--warn);
}
.conn-dot.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.conn-dot.err { background: var(--err); box-shadow: 0 0 10px var(--err); }

/* ───────────── alerts (opinions) ───────────── */

.alerts {
  position: relative; z-index: 2;
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px 0;
  max-height: 64px; overflow: hidden;
}
.alerts:empty { padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; line-height: 1.2;
  border: 1px solid var(--border);
  background: rgba(20, 26, 54, 0.6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip.info::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.chip.warn { border-color: rgba(240, 180, 84, 0.45); }
.chip.warn::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.chip.crit { border-color: rgba(255, 107, 138, 0.5); }
.chip.crit::before { background: var(--err); box-shadow: 0 0 10px var(--err); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ───────────── stage / constellation ───────────── */

.stage { position: relative; z-index: 1; min-height: 0; overflow: hidden; }
#constellation { display: block; width: 100%; height: 100%; cursor: default; position: relative; z-index: 1; }

/* Hermann orb = the constellation's core, layered transparently BEHIND the 2D
   canvas. pointer-events:none so hover/click still land on #constellation. */
#hermannCore { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#hermannCore .horb, #hermannCore .horb-stage, #hermannCore .horb-orbwrap { width: 100%; height: 100%; }
#hermannCore .horb-orbwrap { aspect-ratio: auto; background: transparent; border-radius: 0; }

.legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 2;
  display: flex; gap: 14px; align-items: center;
  padding: 7px 12px; border-radius: 10px;
  font-size: 11px; color: var(--muted);
}
.legend i.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot.ok { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.dot.warn { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.dot.pause { background: var(--accent); box-shadow: 0 0 7px var(--accent); }
.dot.err { background: var(--err); box-shadow: 0 0 7px var(--err); }
.dot.idle { background: var(--faint); }
.legend-hint { color: var(--faint); border-left: 1px solid var(--border); padding-left: 12px; }

/* ───────────── detail popover ───────────── */

/* Docked side-rail — slides in from the right, morphs to whatever is focused. */
.detail {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 430px; max-width: 94%;
  border-radius: 16px 0 0 16px; padding: 20px 18px 16px;
  z-index: 4; overflow-y: auto;
  transform: translateX(0); transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .22s;
}
.detail.hidden { display: block; transform: translateX(104%); opacity: 0; pointer-events: none; }

/* Ephemeral hover-snack (L1): one key fact in Hermann's voice, near the cursor. */
.mc-snack {
  position: fixed; z-index: 30; pointer-events: none; max-width: 264px;
  padding: 8px 11px; border-radius: 9px;
  background: rgba(12, 16, 28, 0.94); border: 1px solid var(--border, #263244);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5); backdrop-filter: blur(5px);
  font: 12px/1.45 var(--mono, ui-monospace), monospace; color: var(--text, #e5e7eb);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.mc-snack.on { opacity: 1; transform: none; }

/* Kopfzeilen-Tooltip: dieselbe Sprache wie der Hover-Snack, nur breiter und
   mit Zeilen. Er zeigt, WAS hinter einer Zahl steckt — Apps, Prozesse,
   Ereignisse. `pointer-events: none` ist Pflicht: er steht direkt unter der
   Kachel und dürfte einen Klick darauf nie abfangen. */
.mc-snack.vt { max-width: 420px; min-width: 260px; padding: 9px 12px 10px; }
.vt-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 4px 10px; padding: 2px 0; font-size: 11px;
}
.vt-row:has(.vt-bar) { grid-template-columns: 1fr 54px auto; }
.vt-name { color: var(--text, #e5e7eb); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-meta { color: var(--faint, #8a93bf); font-size: 10px; white-space: nowrap; }
/* Der Balken ist eine Messgröße (Anteil an der größten Zeile), keine Zierde. */
.vt-bar { display: block; height: 3px; border-radius: 2px; background: rgba(148,163,184,.22); overflow: hidden; }
.vt-bar > i { display: block; height: 100%; background: var(--brain, #a370ff); border-radius: 2px; }
.vt-empty { color: var(--muted, #aab2d6); font-size: 11px; padding: 3px 0; }
.vt-note {
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border, #263244);
  /* Fließtext, kein Datenfeld — 10 px waren hier zu klein. */
  color: var(--faint, #8a93bf); font-size: 11px; line-height: 1.5; white-space: normal;
}
.vt-note + .vt-note { margin-top: 3px; padding-top: 0; border-top: 0; }
/* Sichtbarer Hinweis, dass hinter der Zahl mehr steckt. */
#vitalsStats .stat, .vitals-conn { cursor: help; }
.mc-snack b {
  display: block; font-weight: 700; color: var(--brain, #a370ff);
  margin-bottom: 2px; font-size: 11px; letter-spacing: .3px;
}
.detail-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: 0; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.detail-close:hover { color: var(--text); }
.detail-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.detail-icon { font-size: 24px; }
.detail-name { font-weight: 600; font-size: 15px; }
.detail-status { font: 11px var(--mono); color: var(--muted); margin-top: 1px; }
.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0 0 10px; }
.detail-grid dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; align-self: center; }
.detail-grid dd { margin: 0; font: 13px var(--mono); text-align: right; }
.detail-sub { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 10px; }
.detail-sub:empty { display: none; }
.sub-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 4px 0; }
.sub-row .sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.sub-row .sdot.on { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.sub-row .sdot.off { background: var(--err); box-shadow: 0 0 7px var(--err); }
.sub-row .sname { color: var(--text); }
.sub-row .smeta { margin-left: auto; color: var(--muted); font: 11px var(--mono); }
.detail-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.detail-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.detail-section-title {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 7px; color: var(--muted); font: 10px var(--mono);
  letter-spacing: 1.1px; text-transform: uppercase;
}
.op-summary {
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: rgba(8, 12, 29, .48);
}
.op-summary.live { border-color: rgba(79, 211, 165, .36); }
.op-summary.stale { border-color: rgba(240, 180, 84, .4); }
.op-title { font-weight: 650; font-size: 12px; }
.op-meta { margin-top: 3px; color: var(--muted); font: 10px var(--mono); }
.op-progress {
  height: 5px; overflow: hidden; margin-top: 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}
.op-progress span {
  display: block; width: 0; height: 100%;
  background: linear-gradient(90deg, var(--ok), var(--cyan));
}
.traffic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.traffic-cell {
  min-width: 0; padding: 6px 7px; border: 1px solid var(--border);
  border-radius: 7px; background: rgba(8, 12, 29, .38);
}
.traffic-cell b { display: block; font: 13px var(--mono); }
.traffic-cell span {
  display: block; overflow: hidden; color: var(--muted); font-size: 9px;
  text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap;
}
.timeline-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px;
  padding: 6px 0; border-top: 1px solid rgba(108, 140, 255, .12);
}
.timeline-row:first-child { border-top: 0; padding-top: 0; }
.timeline-time { color: var(--faint); font: 10px var(--mono); }
.timeline-main { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-meta { grid-column: 2; color: var(--muted); font: 9px var(--mono); }
.log-actions { display: flex; align-items: center; gap: 8px; }
.log-load {
  padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 7px;
  background: rgba(34, 211, 238, .06); color: var(--cyan); cursor: pointer;
  font: 10px var(--mono);
}
.log-load:hover { background: rgba(34, 211, 238, .12); }
.log-output {
  max-height: 220px; overflow: auto; margin: 7px 0 0; padding: 8px;
  border: 1px solid var(--border); border-radius: 7px;
  background: rgba(3, 6, 16, .72); color: #cbd5e1;
  font: 10px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word;
}
.detail-open {
  display: inline-block; font-size: 12px; color: var(--cyan);
  text-decoration: none; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px 12px;
}
.detail-open:hover { background: rgba(34, 211, 238, 0.1); }

/* ───────────── ticker ───────────── */

.ticker {
  position: relative; z-index: 2;
  margin: 0 12px 10px; border-radius: 12px;
  display: flex; align-items: stretch;
  height: 40px; overflow: hidden;
}
.ticker-label {
  flex: none; display: flex; align-items: center;
  padding: 0 14px; letter-spacing: 2px; font: 600 11px var(--mono);
  color: var(--cyan); border-right: 1px solid var(--border);
  background: rgba(34, 211, 238, 0.06);
}
.ticker-feed {
  flex: 1; display: flex; align-items: center; gap: 22px;
  padding: 0 16px; overflow: hidden; white-space: nowrap;
}
.ticker-empty { color: var(--faint); font: 12px var(--mono); }
.ev {
  display: inline-flex; align-items: center; gap: 8px;
  font: 12px var(--mono); flex: none;
  animation: evIn 0.35s ease;
}
@keyframes evIn { from { opacity: 0; transform: translateX(-8px); } }
.ev .et { color: var(--faint); }
.ev .es { color: var(--cyan); }
.ev .ey { color: var(--text); }
.ev .el { color: var(--muted); }
.ev.warn .ey { color: var(--warn); }
.ev.crit .ey { color: var(--err); }
.ev .arrow { color: var(--accent-2); }

@media (prefers-reduced-motion: reduce) {
  .grid-bg, .chip.crit::before, .ev { animation: none; }
  .gpu-fill { transition: none; }
}

@media (max-width: 720px) {
  .vitals-stats { gap: 11px; }
  .stat { min-width: 38px; }
  .detail { width: calc(100% - 32px); }
}

/* ───────────── Ansichtsumschalter + Datenfluss ─────────────
   Zweite Ansicht auf derselben Bühne: die Konstellation zeigt, WAS läuft,
   der Datenfluss zeigt, WOHIN es redet. Markup in index.html, Logik in
   flow.js. */

/* Die Leiste trägt die Position, die beiden Gruppen darin sitzen nebeneinander.
   Vorher lag die Position am Umschalter selbst — dann hätte der Vollbild-Knopf
   einen festen Abstand gebraucht, den die Breite der drei Reiter bestimmt. */
.viewbar {
  position: absolute; left: 14px; top: 14px; z-index: 5;
  display: flex; align-items: center; gap: 8px;
}
.viewswitch {
  display: flex; gap: 3px; padding: 3px; border-radius: 10px;
}
.vs-btn {
  appearance: none; border: 0; cursor: pointer;
  padding: 6px 13px; border-radius: 8px;
  font: 600 11px/1 var(--mono); letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted); background: transparent;
  transition: color .15s, background .15s;
}
.vs-btn:hover { color: var(--text); }
.vs-btn.active { color: #06121a; background: var(--cyan); box-shadow: var(--glow-cyan); }

/* Außerhalb der Konstellation verschwindet der globale LIVE-FEED: der Fluss
   hat seinen eigenen, reicheren Verlauf, das Kosmogramm braucht die Fläche. */
body[data-view="flow"] #tickerWrap,
body[data-view="ring"] #tickerWrap,
body[data-view="art"] #tickerWrap { display: none; }

/* Solange eine andere Ansicht vorn ist, ruht die Konstellation vollständig. */
.stage.flow-active #constellation,
.stage.flow-active #hermannCore,
.stage.flow-active .legend,
.stage.ring-active #constellation,
.stage.ring-active #hermannCore,
.stage.ring-active .legend,
.stage.art-active #constellation,
.stage.art-active #hermannCore,
.stage.art-active .legend { display: none; }

/* Die Ansicht selbst scrollt NICHT — sonst würden Kopfzeile, Verlaufsleiste
   und Detailschiene mit dem Diagramm wegwandern. Gescrollt wird nur innen. */
/* --fd-w  = Breite der Detailschiene (EINE Stelle: Schiene, Kopfzeile,
              Legende, Verlauf und die Anordnung in flow.js richten sich danach)
   --fd-open = dieselbe Breite, aber nur solange etwas ausgewaehlt ist
   --fm-reserve = was links der Kopfzeile schon belegt ist (Reiter + Vollbild) */
.flowview {
  position: absolute; inset: 0; z-index: 3;
  /* `clip` statt `hidden`: das Bodenraster (::before) ist perspektivisch
     gekippt und ragt ~455 px nach rechts hinaus. Mit `hidden` bleibt die
     Buehne heimlich SCROLLBAR — ein scrollIntoView (Tastatur-Fokus in der
     Detailschiene) schob dann die ganze Ansicht zur Seite. `clip` klippt
     genauso, macht aber gar keinen Scrollbereich erst auf. */
  overflow: clip;
  --fd-w: clamp(300px, 30%, 400px);
  --fd-open: 0px;
  --fm-reserve: 490px;      /* Notnagel; flow.js MISST die Leiste und setzt nach */
}
.flowview.detail-open { --fd-open: var(--fd-w); }

/* HUD-Boden: eine perspektivisch gekippte Rasterebene unter dem Graphen.
   Sie gibt der Bühne einen Fussboden, damit die Plaettchen ueber etwas
   schweben statt im Nichts zu haengen. AUSDRUECKLICH DEKORATION — sie traegt
   keine Messgroesse, und die Legende sagt das. */
.flowview::before {
  content: "";
  position: absolute; left: -30%; right: -30%; bottom: -2%; height: 68%;
  z-index: 0; pointer-events: none; opacity: 0.62;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.30) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.20) 1px, transparent 1px);
  background-size: 100% 56px, 88px 100%;
  transform: perspective(430px) rotateX(69deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 2%, rgba(0, 0, 0, 0.5) 46%, transparent 88%);
  mask-image: linear-gradient(to top, #000 2%, rgba(0, 0, 0, 0.5) 46%, transparent 88%);
  animation: hudFloor 11s linear infinite;
}
@keyframes hudFloor { to { background-position: 0 56px, 0 0; } }

/* Horizont, Vignette und ein langsam wanderndes Streiflicht. Ebenfalls
   Darstellung: es misst nichts, es macht die Flaeche lesbar. */
.flowview::after {
  content: "";
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(100deg, transparent 38%, rgba(34, 211, 238, 0.055) 47%, transparent 56%),
    radial-gradient(120% 60% at 50% 42%, rgba(108, 140, 255, 0.10), transparent 70%),
    radial-gradient(100% 78% at 50% 50%, transparent 52%, rgba(2, 4, 12, 0.55) 100%);
  background-size: 260% 100%, 100% 100%, 100% 100%;
  animation: hudSweep 17s linear infinite;
}
@keyframes hudSweep { from { background-position: 130% 0, 0 0, 0 0; } to { background-position: -130% 0, 0 0, 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .flowview::before, .flowview::after { animation: none; }
}
/* Im Kinomodus darf der Boden eine Spur weiter aufmachen. */
body[data-cinema="on"] .flowview::before { opacity: 0.68; }

.flow-scroll { position: absolute; inset: 0; overflow: auto; z-index: 1; }
#flowSvg { display: block; }
#flowSvg.pointing { cursor: pointer; }

/* Kanten. Deckkraft trägt Bedeutung: eine stehende Verbindung ohne zählbare
   Aufbauten bekommt den laufenden Strich statt Partikel — Verkehr, dessen
   Menge niemand kennt. */
.flink { opacity: 0.5; transition: opacity .2s; }
.flink.out { stroke-dasharray: none; }
.flink.standing { stroke-dasharray: 5 7; animation: flowDash 1.6s linear infinite; opacity: 0.42; }
@keyframes flowDash { to { stroke-dashoffset: -24; } }
.flink.sel { opacity: 1; filter: url(#fGlow); }
.flink.off { opacity: 0.12; }
.flink.flash { opacity: 1; }
/* Diese Zeile MUSS nach `.flash` stehen: gleiche Spezifitaet, die spaetere
   gewinnt. Ohne sie hebt ein Bus-Ereignis die abgeblendete Kante auf volle
   Deckkraft — dann blitzt neben der Auswahl genau das auf, was gerade
   zuruecktreten sollte. */
.flink.off.flash { opacity: 0.12; }
/* Die KETTE: was der Impuls jenseits des Nachbarn noch erreicht. Naeher an
   der Auswahl = heller. Hop 0/1 tragen `sel` (volle Deckkraft und Schein),
   ab Hop 2 wird abgestuft — sonst waere „weiter verfolgen" nur ein zweites
   Wort fuer „alles hell". Der Wert kommt aus `hopAlpha()` in flow.js: die
   Kette laeuft bis ans Ende, eine CSS-Regel je Schritt waere ein Deckel. */
.flink.chain { opacity: var(--hop-a, 0.5); }
.flink-hit { stroke: transparent; stroke-width: 16; cursor: pointer; }
/* Pfeil und Linienschatten gehoeren zur Kante und treten mit ihr zurueck —
   sonst bleibt von der abgeblendeten Verbindung eine helle Spitze stehen. */
.farrow { opacity: 0.75; }
.farrow.off { opacity: 0.09; }
.farrow.chain { opacity: var(--hop-a, 0.5); }
.flink-sh.off { opacity: 0.08; }
.fpart { pointer-events: none; transition: opacity .2s; }
.fpart.off { opacity: 0.12; }
/* Weitergereichter Punkt: derselbe Impuls, einen Schritt weiter. Etwas
   blasser als der gemessene Aufbau, weil er Darstellung ist. */
.fpart.relay { opacity: 0.8; }

.fnode { cursor: pointer; }
.fnode-box { fill: rgba(16, 22, 46, 0.88); stroke-opacity: 0.55; stroke-width: 1; }
.fnode-plate { pointer-events: none; }
.fnode:hover .fnode-box { stroke-opacity: 1; fill: rgba(26, 34, 70, 0.95); }
.fnode.sel .fnode-box { stroke-opacity: 1; fill: rgba(24, 32, 66, 0.95); }
.fnode.off { opacity: 0.3; }
/* Ruhend: lauscht, hat aber gerade keine offene Verbindung. Liegt flach auf
   dem Raster (kein Schatten, s. paint()), gestrichelte Kante, blasser. Das
   ist eine MESSUNG — der Port lauscht nachweislich, es fehlt der Verkehr. */
.fnode.idle .fnode-box { stroke-dasharray: 4 4; stroke-opacity: 0.3; fill: rgba(12, 17, 36, 0.6); }
.fnode.idle .fnode-label { fill: var(--muted); }
.fnode.idle .fnode-bar { opacity: 0.35; }
.fnode.idle .fnode-plate { opacity: 0.35; }

/* Ueberschriften der drei Gruppen — sie benennen die Bereiche, damit das
   Bild ohne Legende verstaendlich ist. */
.f-caps { pointer-events: none; }
.fcap-t { fill: var(--cyan); font: 600 9px var(--mono); letter-spacing: 2.4px; opacity: 0.72; }
.fcap-l { fill: none; stroke: rgba(34, 211, 238, 0.26); stroke-width: 1; }

/* Zielkreuz auf der Auswahl. */
.f-reticle { pointer-events: none; }
.fret-c { fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: square; opacity: 0.9; }
@media (prefers-reduced-motion: no-preference) {
  .fret-c { animation: retPulse 1.9s ease-in-out infinite; }
}
@keyframes retPulse { 50% { opacity: 0.35; } }

/* Schattenebene: dunkel, weich, ohne eigene Aussage ausser der Hoehe. */
.f-shadow { pointer-events: none; }
.flink-sh { fill: none; }
.fnode-icon { font-size: 13px; dominant-baseline: middle; }
.fnode-label { fill: var(--text); font: 12px system-ui, sans-serif; }
.fnode-sub { fill: var(--faint); font: 10px var(--mono); }
.fnode.kind-external .fnode-box, .fnode.kind-lan .fnode-box { stroke-dasharray: 3 3; }

/* Kopfzeile der Ansicht — nennt ausdrücklich, was gemessen wird und was nicht. */
.flow-meta {
  position: absolute; right: calc(14px + var(--fd-open)); top: 14px; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 7px 13px; border-radius: 10px;
  font: 11px var(--mono); color: var(--muted);
  /* Links daneben sitzen drei Reiter UND der Vollbild-Knopf — ohne diese
     Schranke schiebt sich die Kopfzeile darunter. */
  max-width: calc(100% - var(--fm-reserve) - var(--fd-open));
  /* UMBRECHEN statt abschneiden: bei offener Schiene bleiben von der Zeile
     keine 500 px mehr uebrig, und eine abgeschnittene Zahl ist eine falsche
     Zahl. Zwei Reihen passen noch bequem ueber die Buehne (padTop = 124). */
  flex-wrap: wrap; justify-content: flex-end; row-gap: 3px;
  overflow: hidden;
}
.flow-meta b { color: var(--text); font-size: 12px; }
.fm-k {
  padding: 2px 7px; border-radius: 999px; letter-spacing: 1px;
  color: var(--ok); background: rgba(79, 211, 165, 0.12);
}
.fm-k.bad { color: var(--err); background: rgba(255, 107, 138, 0.12); }
.fm-note { color: var(--faint); border-left: 1px solid var(--border); padding-left: 12px; cursor: help; }
/* Offene Schiene = bis zu 400 px weniger Kopfzeile. Dann weicht der Hinweis,
   nicht die Zaehler: die Zahlen sind Messwerte, der Hinweis erklaert sie nur
   und kommt beim Schliessen zurueck. Sonst schnitte der Zeilenrand genau die
   Zahlen ab, wegen derer man ueberhaupt hinsieht. */
.flowview.detail-open .fm-note { display: none; }
.fm-at { color: var(--faint); }
.fm-idle { color: var(--faint); font-size: 10px; letter-spacing: 0.6px; }

/* Steuerleiste: Anhalten, Suchen, Filtern, Legende. Sitzt unter dem
   Ansichtswechsler; die Anordnung des Graphen spart diesen Streifen aus
   (padTop in flow.js). */
.flow-controls {
  position: absolute; left: 14px; top: 58px; z-index: 6;
  display: flex; align-items: center; gap: 7px; flex-wrap: nowrap;
  max-width: calc(100% - 28px - var(--fd-open)); overflow-x: auto;
  padding: 6px 9px; border-radius: 10px;
}
.fc-btn, .fc-chip {
  appearance: none; cursor: pointer; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(20, 26, 54, 0.6);
  color: var(--muted); font: 600 10px/1 var(--mono); letter-spacing: 0.7px;
  transition: color .15s, border-color .15s, background .15s;
}
.fc-btn:hover:not(:disabled), .fc-chip:hover { color: var(--text); border-color: var(--border-strong); }
.fc-btn:disabled { opacity: 0.38; cursor: default; }
.fc-chip.active { color: #06121a; background: var(--accent); border-color: var(--accent); }
.fc-btn.active { color: #06121a; background: var(--cyan); border-color: var(--cyan); }
.fc-btn.wide { min-width: 84px; }
.fc-btn.ghost { padding: 5px 9px; }
.fc-btn.ghost.hot { color: var(--warn); border-color: var(--warn); }
.fc-sep { width: 1px; height: 18px; background: var(--border); flex: none; }
.fc-group { display: flex; gap: 4px; }
.fc-search input {
  width: 190px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(10, 14, 30, 0.6);
  color: var(--text); font: 11px var(--mono); outline: none;
}
.fc-search input:focus { border-color: var(--cyan); }
.fc-search input::placeholder { color: var(--faint); }

/* Angehalten: die Laufschrift der stehenden Verbindungen steht ebenfalls
   still — „angehalten" muss angehalten heißen. */
.flowview.paused .flink.standing { animation-play-state: paused; }
.flowview.paused .flow-scroll::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(240, 180, 84, 0.25);
}
.fm-k.hold { color: var(--warn); background: rgba(240, 180, 84, 0.14); }
.fm-hold { color: var(--warn); }

/* Legende: eine Zeile, die Farben und Linienformen erklärt. */
.flow-legend {
  position: absolute; left: 14px; right: calc(14px + var(--fd-open)); bottom: 126px; z-index: 5;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 7px 12px; border-radius: 10px;
  font: 10px var(--mono); color: var(--muted);
}
.flow-legend b { color: var(--text); font-weight: 600; }
.lg-elev {
  width: 15px; height: 9px; border-radius: 2px;
  background: rgba(34, 211, 238, 0.5);
  box-shadow: 3px 5px 5px rgba(0, 0, 0, 0.85);
}
.lg-idle {
  width: 15px; height: 9px; border-radius: 2px;
  border: 1px dashed var(--faint); background: transparent;
}
.lg-deco { color: var(--faint); }
.lg-title { color: var(--cyan); letter-spacing: 2px; font-weight: 600; }
.lg-i { display: inline-flex; align-items: center; gap: 7px; }
.lg-i i { flex: none; width: 22px; height: 10px; border-radius: 2px; }
.lg-cols { background: linear-gradient(90deg, #6c8cff 0 6px, transparent 6px 8px, #22d3ee 8px 14px, transparent 14px 16px, #64748b 16px 22px); }
.lg-node { background: linear-gradient(90deg, #10a37f, #7c3aed, #64748b); }
.lg-line { background: linear-gradient(180deg, transparent 3px, #6c8cff 3px 7px, transparent 7px); }
.lg-arrow { background: none; position: relative; }
.lg-arrow::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  border: 4px solid transparent; border-left-color: #6c8cff;
}
.lg-dash { background: repeating-linear-gradient(90deg, #6c8cff 0 4px, transparent 4px 8px); height: 3px !important; }
.lg-dot { background: radial-gradient(circle at 6px 5px, #22d3ee 0 2px, transparent 3px), radial-gradient(circle at 16px 5px, rgba(34,211,238,0.45) 0 2px, transparent 3px); }
.lg-flash { background: radial-gradient(circle at 11px 5px, #fff 0 2px, rgba(34,211,238,0.55) 3px 6px, transparent 7px); }
.lg-chain {
  background: linear-gradient(90deg, #22d3ee 0 6px, transparent 6px 8px,
              rgba(34, 211, 238, 0.62) 8px 14px, transparent 14px 16px,
              rgba(34, 211, 238, 0.34) 16px 22px);
  height: 3px !important;
}
.lg-off {
  background: linear-gradient(180deg, transparent 3px, #22d3ee 3px 7px, transparent 7px) 0 0 / 10px 100% no-repeat,
              linear-gradient(180deg, transparent 4px, rgba(108, 140, 255, 0.16) 4px 6px, transparent 6px) 12px 0 / 10px 100% no-repeat;
}

/* Verlauf: die drei Quellen bleiben unterscheidbar (TCP / HTTP / Ereignis).
   Bodenleiste über die volle Breite — die Anordnung in flow.js spart genau
   diesen Streifen aus (padBottom), damit kein Knoten darunter verschwindet. */
.flow-log {
  position: absolute; left: 14px; right: calc(14px + var(--fd-open)); bottom: 12px; z-index: 5;
  height: 106px; padding: 0; border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden;
  font: 11px var(--mono);
  transition: none;
}
/* Vergrößert: der Verlauf nimmt die Bühne ein, lässt aber Umschalter und
   Steuerleiste stehen — die Suche filtert auch den Verlauf, und genau die
   will man beim Lesen zur Hand haben. Esc schließt.
   (Ein echtes `inset: 14px` brächte nichts: .flowview ist ein eigener
   Stapelkontext, der Umschalter läge trotzdem darüber.) */
.flow-log.expanded {
  top: 96px; bottom: 14px; height: auto; z-index: 9;
}
/* Eingeklappt: nur die Kopfzeile. Die Anordnung misst diese Höhe, das Bild
   bekommt die frei gewordene Fläche also wirklich — nicht nur optisch. */
.flow-log.folded { height: 30px; }
.flow-log.folded .fl-body { display: none; }
.flowview.log-expanded .flow-legend { display: none; }
.flow-log.expanded .fl-row { white-space: normal; align-items: flex-start; }
.flow-log.expanded .fl-x { white-space: normal; }
.fl-head {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 7px 12px 6px; border-bottom: 1px solid var(--border);
  background: rgba(18, 24, 52, 0.55);
}
.fl-title { color: var(--cyan); letter-spacing: 2px; font-weight: 600; }
.fl-sp { flex: 1; }
.fl-badge { color: var(--warn); }
.fl-badge.on::before { content: "\25CF"; margin-right: 5px; }
.fl-btn {
  appearance: none; cursor: pointer;
  padding: 4px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: rgba(20, 26, 54, 0.6);
  color: var(--muted); font: 600 10px/1 var(--mono); letter-spacing: 0.6px;
}
.fl-btn:hover { color: var(--text); border-color: var(--border-strong); }
.fl-btn.active { color: #06121a; background: var(--warn); border-color: var(--warn); }
.fl-body { flex: 1; overflow-y: auto; padding: 6px 12px 8px; }
.fl-empty { color: var(--faint); }
.fl-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 2px 0; white-space: nowrap; overflow: hidden;
  animation: evIn .3s ease;
}
.fl-t { color: var(--faint); flex: none; }
.fl-k { flex: none; padding: 0 5px; border-radius: 4px; font-size: 9px; letter-spacing: 1px; }
.fl-tcp { color: var(--accent); background: rgba(108, 140, 255, 0.14); }
.fl-http { color: var(--cyan); background: rgba(34, 211, 238, 0.14); }
.fl-event { color: var(--accent-2); background: rgba(138, 108, 255, 0.16); }
.fl-p { color: var(--text); flex: none; }
.fl-p i { color: var(--accent-2); font-style: normal; }
.fl-x { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.fl-x i { color: var(--cyan); font-style: normal; }
.fl-row.warn .fl-x { color: var(--warn); }
.fl-row.crit .fl-x { color: var(--err); }

/* Detailschiene rechts, gleiche Sprache wie die Konstellations-Details.
   Sie LIEGT ueber der Buehne, verdeckt sie aber nicht mehr: solange sie
   offen ist, rechnet flow.js ihren Streifen aus der Buehne heraus und die
   Aussenwelt-Spalte rueckt davor. */
.flow-detail {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 6;
  width: var(--fd-w); max-width: none;
  border-radius: 16px 0 0 16px; padding: 18px 16px;
  overflow-y: auto;
  animation: fdIn .18s ease;
}
@keyframes fdIn { from { transform: translateX(18px); opacity: 0; } }
@keyframes fdUp { from { transform: translateY(18px); opacity: 0; } }
.fd-close {
  position: absolute; right: 10px; top: 8px;
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 20px; line-height: 1;
}
.fd-head { display: flex; gap: 10px; align-items: flex-start; margin: 2px 22px 12px 0; }
.fd-head b { font-size: 14px; }
.fd-head span:first-child { font-size: 18px; }
.fd-sub { display: block; color: var(--muted); font: 11px var(--mono); margin-top: 3px; }
.fd-nums { display: flex; gap: 16px; margin-bottom: 12px; }
.fd-nums div { display: flex; flex-direction: column; }
.fd-nums b { font: 600 16px var(--mono); color: var(--cyan); }
.fd-nums span { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; }
.fd-tab { width: 100%; border-collapse: collapse; font: 11px var(--mono); }
.fd-tab th { text-align: left; color: var(--faint); font-weight: 500; padding-bottom: 4px; }
.fd-tab td { padding: 2px 6px 2px 0; color: var(--muted); border-top: 1px solid var(--border); }
.fd-sec {
  margin: 14px 0 6px; color: var(--cyan);
  font: 600 10px var(--mono); letter-spacing: 1.5px; text-transform: uppercase;
}
.fd-ev { display: flex; gap: 8px; padding: 2px 0; font: 11px var(--mono); color: var(--muted); }
.fd-ev span { color: var(--faint); flex: none; }
.fd-ev i { color: var(--faint); font-style: normal; margin-left: auto; }
.fd-empty { color: var(--faint); font: 12px var(--mono); }
.fd-note { margin-top: 14px; color: var(--faint); font-size: 11px; line-height: 1.5; }
/* Mehrfachauswahl: ein Zaehler oben, eine Linie zwischen den Bloecken. */
.fd-count {
  margin: 2px 22px 10px 0; padding: 3px 9px; border-radius: 999px;
  display: inline-block; background: rgba(34, 211, 238, 0.12);
  color: var(--cyan); font: 600 10px var(--mono); letter-spacing: 1.2px;
  text-transform: uppercase;
}
.fd-split { height: 1px; margin: 16px 0 14px; background: var(--border-strong); }
.fd-hold {
  margin-top: 10px; padding: 6px 9px; border-radius: 7px;
  background: rgba(240, 180, 84, 0.1); border: 1px solid rgba(240, 180, 84, 0.3);
  color: var(--warn); font: 10px var(--mono);
}

@media (prefers-reduced-motion: reduce) {
  .flink.standing { animation: none; }
  .fl-row { animation: none; }
}

@media (max-width: 1200px) {
  .fm-note { display: none; }
}
@media (max-width: 900px) {
  .flow-log { height: 84px; }
  .flow-meta { gap: 9px; }
  /* Rechts ist kein Streifen mehr uebrig, den man aussparen koennte: die
     Erklaerung legt sich unten an. `detailInset()` MISST das (Breite = volle
     Buehne) und spart dann unten aus — die Umschaltung steht nur hier. */
  .flowview { --fd-w: 0px; }
  .flow-detail {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; height: min(54%, 330px);
    border-radius: 16px 16px 0 0;
    animation-name: fdUp;
  }
  /* Eng wird der Vollbild-Knopf zum reinen Sinnbild. */
  .cn-t { display: none; }
  .cn-btn { padding: 6px 9px; }
  .fc-search input { width: 120px; }
  .flow-legend { display: none; }
}

/* ───────────── Kinomodus (Vollbild) ─────────────
   Drei Stufen, jede für sich wirksam: Rahmen weg (hier), Fenster weg
   (Fullscreen-API in cinema.js), Bedienung weg (.cinema-idle). Was
   BEDIENUNG ist, blendet weg; was MESSWERT oder SCHLÜSSEL ist, bleibt —
   ein Bild ohne Schlüssel wäre Dekoration statt Darstellung. */

.cinemabar { display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 10px; }
.cn-btn {
  appearance: none; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  font: 600 11px/1 var(--mono); letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted); background: transparent;
  transition: color .15s, background .15s;
}
.cn-btn:hover { color: var(--text); }
.cn-btn[aria-pressed="true"] { color: #06121a; background: var(--cyan); box-shadow: var(--glow-cyan); }
.cn-i { font-size: 13px; line-height: 1; }

/* Stufe 1: die Bühne bekommt die ganze Fläche. */
body[data-cinema="on"] { grid-template-rows: 1fr; }
body[data-cinema="on"] > .vitals,
body[data-cinema="on"] > .alerts,
body[data-cinema="on"] > .ticker { display: none; }

/* Stufe 3: die Bedienelemente treten ab. */
body[data-cinema="on"] .viewbar,
body[data-cinema="on"] .flow-controls,
body[data-cinema="on"] .art-chips {
  transition: opacity .45s ease, transform .45s ease;
}
body[data-cinema="on"].cinema-idle .viewbar,
body[data-cinema="on"].cinema-idle .flow-controls,
body[data-cinema="on"].cinema-idle .art-chips {
  opacity: 0; transform: translateY(-7px); pointer-events: none;
}
/* Messwerte und Schlüssel bleiben stehen, treten aber einen Schritt zurück. */
body[data-cinema="on"] .flow-meta,
body[data-cinema="on"] .flow-legend,
body[data-cinema="on"] .flow-log,
body[data-cinema="on"] .art-key,
body[data-cinema="on"] .legend { transition: opacity .45s ease; }
body[data-cinema="on"].cinema-idle .flow-meta,
body[data-cinema="on"].cinema-idle .flow-legend,
body[data-cinema="on"].cinema-idle .flow-log,
body[data-cinema="on"].cinema-idle .art-key,
body[data-cinema="on"].cinema-idle .legend { opacity: 0.62; }

/* Im Vollbild darf das Raster weiter atmen — der Blick hat mehr Fläche. */
body[data-cinema="on"] .grid-bg { opacity: 0.75; }

/* Der Hinweis beim Betreten. Steht nur im Kinomodus und fasst nichts an.
   MITTIG, nicht oben: oben liegen in jeder Ansicht schon Leiste und
   Kopfzeile — dort verdeckte der Hinweis die Messwerte, statt sie
   einzuleiten. In der Mitte ist er eine Einblendung wie am Fernseher. */
.cinema-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 6; padding: 11px 22px; border-radius: 999px;
  background: rgba(10, 14, 32, 0.72);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 12px var(--mono); color: var(--text); letter-spacing: 0.3px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity .5s ease;
}
.cinema-hint b { color: var(--cyan); font-weight: 600; }
.cinema-hint.on { opacity: 1; }
body:not([data-cinema="on"]) .cinema-hint { display: none; }

@media (prefers-reduced-motion: reduce) {
  body[data-cinema="on"] .viewbar,
  body[data-cinema="on"] .flow-controls,
  body[data-cinema="on"] .art-chips,
  .cinema-hint { transition: none; }
  body[data-cinema="on"].cinema-idle .viewbar,
  body[data-cinema="on"].cinema-idle .flow-controls,
  body[data-cinema="on"].cinema-idle .art-chips { transform: none; }
}

/* ───────────── Orbit ─────────────
   Drehbares Ringsystem auf einer gekippten Scheibe. Gezeichnet auf ein
   Canvas (eigene Projektion, kein WebGL) — Markup ist nur die Huelle plus
   Schluessel, Ableseleiste und Bedienhinweis. Siehe ring.js. */

.ringview { position: absolute; inset: 0; z-index: 3; overflow: hidden; }
#ringCanvas { display: block; cursor: grab; }
#ringCanvas:active { cursor: grabbing; }

/* Der Schluessel — eine Zeile je Kanal. Ohne ihn waere das Bild Dekoration. */
.ring-key {
  position: absolute; right: 14px; top: 14px; z-index: 5;
  max-width: min(420px, 40vw); padding: 6px 12px 10px; border-radius: 12px;
  display: flex; flex-direction: column;
  font: 11px/1.5 var(--mono); color: var(--muted);
}
.rk-head {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 4px 0; color: inherit; font: inherit; text-align: left;
}
.rk-head b { color: var(--cyan); letter-spacing: 2px; font-size: 10px; }
.rk-head i { margin-left: auto; font-style: normal; color: var(--faint); font-size: 11px; }
.rk-head:hover i { color: var(--cyan); }
.rk-body { display: flex; flex-direction: column; gap: 3px; padding-top: 4px; }
.ring-key.collapsed { padding-bottom: 6px; }
.ring-key.collapsed .rk-body { display: none; }
.rk-body i { color: var(--text); font-style: normal; display: inline-block; min-width: 58px; }

/* Ableseleiste: was gerade unter dem Zeiger oder in der Auswahl liegt. */
.ring-read {
  position: absolute; left: 14px; bottom: 46px; z-index: 5;
  min-width: 260px; max-width: min(520px, 46vw);
  padding: 10px 14px; border-radius: 12px;
  font: 11px var(--mono); color: var(--muted);
}
.rr-name { color: var(--text); font-size: 13px; font-weight: 600; }
.rr-name i { color: var(--faint); font-style: normal; font-weight: 400; font-size: 10px; }
.rr-fact { margin-top: 3px; }
.rr-fact b { color: var(--cyan); font-size: 13px; }
.rr-edges { margin-top: 7px; display: flex; flex-direction: column; gap: 2px; }
.rr-e { color: var(--text); font-size: 11px; }
.rr-e i { color: var(--faint); font-style: normal; margin-left: 6px; }

.ring-hint {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 5;
  text-align: center; pointer-events: none;
  font: 10px var(--mono); color: var(--faint); letter-spacing: 0.4px;
}
.ring-hint b { color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
  .ring-key { max-width: 46vw; font-size: 9px; }
  .ring-read { max-width: calc(100% - 28px); }
}

/* ───────────── Kosmogramm ─────────────
   Künstlerische Lesart derselben Messwerte. Jede optische Eigenschaft steht
   für eine Zahl — der Schlüssel steht als Legende auf dem Bild (art.js). */

.artview { position: absolute; inset: 0; z-index: 3; overflow: hidden; }
#artCanvas { display: block; cursor: crosshair; }

/* Perspektiven: drei Plakate desselben Bestands. */
.art-chips {
  position: absolute; left: 14px; top: 60px; z-index: 5;
  display: flex; gap: 6px;
}
.ac-chip {
  appearance: none; cursor: pointer;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(20, 26, 54, 0.6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 600 11px/1 var(--mono); letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.ac-chip:hover { color: var(--text); border-color: var(--border-strong); }
.ac-chip.active {
  color: #06121a; background: var(--cyan);
  border-color: var(--cyan); box-shadow: var(--glow-cyan);
}

/* Der Schlüssel — eine Zeile je Plakat. Ohne ihn wäre das Bild Dekoration
   statt Darstellung, mit einem Kasten voller Symbole wäre es wieder
   kleinteilig. */
.art-key {
  position: absolute; right: 14px; top: 14px; z-index: 5;
  max-width: min(430px, 42vw); padding: 10px 14px; border-radius: 12px;
  display: flex; flex-direction: column; gap: 4px;
  font: 11px/1.5 var(--mono); color: var(--muted);
}
.art-key b {
  color: var(--cyan); letter-spacing: 2px; font-size: 10px;
  text-transform: uppercase;
}
.ak-note { color: var(--faint); }

/* Ableseleiste: was auch immer gerade unter dem Zeiger liegt, in Zahlen. */
.art-read {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 5; max-width: min(900px, calc(100% - 60px));
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  padding: 9px 18px; border-radius: 12px; text-align: center;
  font: 11px var(--mono); color: var(--muted);
}
.ar-name { color: var(--text); font-size: 12px; font-weight: 600; }
.ar-name i { color: var(--accent-2); font-style: normal; }
.ar-fact b { color: var(--cyan); }
.ar-hint { color: var(--faint); }

@media (max-width: 900px) {
  .art-key { max-width: 46vw; font-size: 9px; }
  .art-read { max-width: calc(100% - 28px); }
  .ac-chip { padding: 5px 10px; letter-spacing: 0.6px; }
}

/* Schmal (Handy, Kasten auf der öffentlichen Seite): die Steuerleiste darf
   umbrechen, der Schlüssel wandert unter das Bild, die Ableseleiste stapelt
   sich darüber. art.js MISST beides (topPad/footPad) und setzt die Chips
   unter die umgebrochene Leiste — nichts liegt mehr über der Riesenzahl. */
@media (max-width: 620px) {
  .viewbar { right: 14px; flex-wrap: wrap; row-gap: 6px; }
  .vs-btn { padding: 6px 9px; font-size: 10px; letter-spacing: 0.4px; }
  .ac-chip { padding: 5px 9px; font-size: 10px; letter-spacing: 0.6px; }
  .art-key {
    top: auto; right: 10px; left: 10px; bottom: 10px;
    max-width: none; padding: 7px 10px; gap: 2px;
    font-size: 9px; line-height: 1.4;
  }
  .art-key b { font-size: 9px; letter-spacing: 1.4px; }
  /* Eingeklappt bleibt nur die Kopfzeile stehen; ein Tipp öffnet (art.js). */
  .art-key { cursor: pointer; }
  .art-key b::after { content: ' · Schlüssel ▾'; color: var(--faint); letter-spacing: 0.6px; }
  .art-key.folded b::after { content: ' · Schlüssel ▸'; }
  .art-key.folded span { display: none; }
  .art-read {
    left: 10px; right: 10px; transform: none; max-width: none;
    padding: 6px 10px; font-size: 10px; gap: 1px;
  }
  .ar-name { font-size: 11px; }

  /* Orbit: offen bekommt der Schlüssel die ganze Breite statt einer
     Textsäule von 46 vw; ring.js klappt ihn schmal von sich aus ein. */
  .ring-key { max-width: calc(100% - 28px); }

  /* Datenfluss: die Kopfzeile passt nicht mehr NEBEN die Reiter — sie
     rutscht unter die Steuerleiste; flow.js misst ihre Unterkante und
     beginnt die Spalten darunter (padTop). */
  .flow-meta {
    top: 104px; left: 14px; right: 14px;
    max-width: none; gap: 8px 12px; font-size: 10px;
  }
}
