:root {
  /* Ruhige Arbeitsoberfläche: helle Fläche, weiße Gruppen, eine Akzentfarbe, Status nur als Farbpunkt/Kapsel */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --fill: rgba(120, 120, 128, .12);        /* Sekundär-Buttons, Eingabefelder (readonly), Segment-Hintergrund */
  --fill-strong: rgba(120, 120, 128, .2);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, .14);           /* Haarlinien */
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --ring: rgba(0, 113, 227, .28);
  --ok: #248a3d;   --ok-bg: rgba(52, 199, 89, .14);
  --warn: #b25000; --warn-bg: rgba(255, 149, 0, .16);
  --bad: #d70015;  --bad-bg: rgba(255, 59, 48, .12);
  --info: #0058c4; --info-bg: rgba(0, 122, 255, .12);
  --material: rgba(255, 255, 255, .72);
  --toast: rgba(29, 29, 31, .86); --toast-ink: #f5f5f7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .02);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .06);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.32, .72, 0, 1);    /* sanftes Auslaufen, kein Überschwingen */
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #000000; --surface: #1c1c1e; --fill: rgba(118, 118, 128, .24); --fill-strong: rgba(118, 118, 128, .36);
    --ink: #f5f5f7; --muted: #98989d; --line: rgba(84, 84, 88, .55);
    --accent: #0a84ff; --ring: rgba(10, 132, 255, .4);
    --ok: #30d158; --ok-bg: rgba(48, 209, 88, .16); --warn: #ff9f0a; --warn-bg: rgba(255, 159, 10, .16);
    --bad: #ff453a; --bad-bg: rgba(255, 69, 58, .16); --info: #64a8ff; --info-bg: rgba(10, 132, 255, .18);
    --material: rgba(22, 22, 23, .72); --toast: rgba(58, 58, 60, .9); --toast-ink: #f5f5f7;
    --shadow: none; --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.47 var(--font); letter-spacing: -.008em;
  -webkit-font-smoothing: antialiased; font-optical-sizing: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .9em; background: var(--fill); padding: 1px 5px; border-radius: 5px; }

/* ---------- Kopfleiste: durchscheinendes Material, Inhalt läuft darunter ---------- */
header.top { position: sticky; top: 0; z-index: 20; background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--line); }
header.top .bar { max-width: 1400px; margin: 0 auto; padding: 10px 28px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
header.top .brand { font-weight: 600; font-size: 15px; letter-spacing: -.016em; display: flex; align-items: center; gap: 9px; color: var(--ink); }
header.top .brand::before { content: ""; width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, white), var(--accent)); }
header.top nav { display: flex; gap: 2px; padding: 2px; background: var(--fill); border-radius: 9px; }
header.top nav a { color: var(--ink); padding: 4px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; text-decoration: none; }
header.top nav a:hover { background: var(--fill); }
header.top nav a.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04); }
@media (prefers-color-scheme: dark) { header.top nav a.active { background: #636366; } }
header.top .user { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 14px; align-items: center; }

/* ---------- Seitenaufbau ---------- */
main { max-width: 1400px; margin: 0 auto; padding: 36px 28px 80px; display: grid; gap: 28px; }
.page-head { display: grid; gap: 4px; }
h1 { font: 700 32px/1.1 var(--font-display); letter-spacing: -.015em; margin: 0; text-wrap: balance; }
h2 { font: 600 19px/1.25 var(--font-display); letter-spacing: -.01em; margin: 0 0 14px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; letter-spacing: -.004em; }
.section { display: grid; gap: 10px; }
.section > .caption { color: var(--muted); font-size: 13px; padding: 0 4px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Kennzahlen ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tile { padding: 18px 20px; display: grid; gap: 4px; align-content: start; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.tile .value { font: 600 28px/1.1 var(--font-display); letter-spacing: -.022em; font-variant-numeric: tabular-nums; }
.tile .label { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.tile.ok .label::before, .tile.warn .label::before, .tile.bad .label::before, .tile.info .label::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.tile.ok .label::before { background: var(--ok); }
.tile.warn .label::before { background: var(--warn); }
.tile.bad .label::before { background: var(--bad); }
.tile.info .label::before { background: var(--accent); }

/* ---------- Listen (Aktionen, Einstellungen): Zeilen mit Haarlinie, Bedienelement rechts ---------- */
.list { padding: 0 24px; }
.list-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 0; min-height: 52px; }
.list-row + .list-row { box-shadow: 0 -1px 0 var(--line); }
.list-row .text { display: grid; gap: 2px; min-width: 0; }
.list-row .title { font-weight: 500; }
.list-row .control { flex: none; display: flex; gap: 8px; align-items: center; }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
label { font-weight: 500; font-size: 13px; }
.field > label { color: var(--muted); }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; min-height: 36px; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
input[readonly] { background: var(--fill); border-color: transparent; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
select { appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center; }
textarea { width: 100%; min-height: 84px; font-family: var(--mono); font-size: 13px; resize: vertical; }
input.mono, .mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
input.copyfield { width: 100%; }

/* Schalter statt Häkchen */
input[type=checkbox] { appearance: none; flex: none; width: 42px; height: 25px; margin: 0; border-radius: 999px; background: var(--fill-strong);
  position: relative; cursor: pointer; transition: background .25s var(--ease); }
input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .18), 0 0 1px rgba(0, 0, 0, .1); transition: transform .3s var(--ease); }
input[type=checkbox]:checked { background: #34c759; }
input[type=checkbox]:checked::after { transform: translateX(17px); }
input[type=checkbox]:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.switch-label { display: inline-flex; gap: 10px; align-items: center; font-weight: 400; font-size: 14px; cursor: pointer; }

/* ---------- Buttons: Kapseln, Rückmeldung beim Drücken ---------- */
button, .button { font: inherit; font-size: 14px; font-weight: 500; letter-spacing: -.01em; border: 0; background: var(--fill); color: var(--accent);
  border-radius: 999px; padding: 8px 16px; min-height: 34px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; white-space: nowrap; transition: background .2s, transform .1s ease-out, opacity .2s; }
button:hover, .button:hover { background: var(--fill-strong); text-decoration: none; }
button:active, .button:active { transform: scale(.97); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover, .button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
button.small { padding: 4px 12px; min-height: 28px; font-size: 13px; }
button.danger { color: var(--bad); }
button:disabled { opacity: .4; cursor: default; transform: none; }
button[data-job]:disabled { cursor: progress; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }

/* ---------- Kapseln für Status ---------- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.5;
  color: var(--muted); background: var(--fill); }
.pill.aktiv, .pill.fertig, .pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.pausiert, .pill.läuft { color: var(--warn); background: var(--warn-bg); }
.pill.gesperrt, .pill.fehlt, .pill.fehler, .pill.abgebrochen { color: var(--bad); background: var(--bad-bg); }
.pill.info { color: var(--info); background: var(--info-bg); }

/* ---------- Tabellen ---------- */
.table-box { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-box { box-shadow: none; border-radius: 0; margin: 0 -24px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 12px; text-align: left; vertical-align: top; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
td { box-shadow: inset 0 1px 0 var(--line); }
th { position: sticky; top: 0; background: var(--surface); font-size: 12px; font-weight: 500; color: var(--muted);
  white-space: nowrap; padding-top: 14px; padding-bottom: 8px; }
th a.sort { color: inherit; text-decoration: none; display: inline-block; }
th a.sort:hover { color: var(--ink); }
th a.sort.on { color: var(--accent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.title { min-width: 200px; max-width: 320px; }
td.reason { color: var(--muted); min-width: 180px; max-width: 280px; }
td.cap::first-letter { text-transform: uppercase; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.wide td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

td.pic { padding-top: 6px; padding-bottom: 6px; }
td.pic img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px var(--line); display: block; }

/* ---------- Werkzeugleiste und Blättern ---------- */
.toolbar { display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 280px; gap: 8px; }
.toolbar .search input { flex: 1; min-width: 0; }
.toolbar > :last-child { margin-left: auto; }
.pager { display: flex; gap: 12px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.toolbar .pager { flex: 1; }
.page-input { width: 56px; text-align: center; min-height: 28px !important; padding: 3px 6px !important; font-size: 13px !important; }
.button.disabled { opacity: .35; pointer-events: none; }

/* ---------- Popover für Zeilen-Aktionen: öffnet am Auslöser ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--fill); color: var(--accent); font-size: 11px; letter-spacing: 1px; user-select: none;
  transition: background .2s, transform .1s ease-out; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover { background: var(--fill-strong); }
details.menu > summary:active { transform: scale(.97); }
details.menu[open] > summary { background: var(--fill-strong); }
details.menu > summary.label { width: auto; height: auto; min-height: 34px; padding: 0 16px; border-radius: 999px; font-size: 14px;
  font-weight: 500; letter-spacing: -.01em; }
details.menu .pop.wide { width: min(640px, calc(100vw - 32px)); padding: 0; gap: 0; }
.pop-head, .pop-foot { justify-content: space-between; padding: 12px 14px; }
.pop-head { box-shadow: 0 1px 0 var(--line); }
.pop-foot { box-shadow: 0 -1px 0 var(--line); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 8px; padding: 8px; max-height: min(52vh, 460px); overflow-y: auto; }
.checks label { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 7px; font-weight: 400; cursor: pointer; min-width: 0; }
.checks label:hover { background: var(--fill); }
.checks label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.menu .pop .checks input[type=checkbox] { flex: none; min-height: 0; padding: 0; width: 18px; height: 18px; border-radius: 5px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--fill-strong); }
details.menu .pop .checks input[type=checkbox]::after { display: none; }
details.menu .pop .checks input[type=checkbox]:checked { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 5.5l3 3 6-7'/%3E%3C/svg%3E") no-repeat center; box-shadow: none; }
details.menu .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 240px; padding: 8px; display: grid; gap: 4px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop); transform-origin: top right; }
details.menu[open] .pop { animation: pop-in .28s var(--ease); }
details.menu .pop form { display: flex; gap: 6px; align-items: center; }
details.menu .pop button.item { width: 100%; justify-content: flex-start; background: transparent; color: var(--ink); border-radius: 8px; padding: 6px 10px; }
details.menu .pop button.item:hover { background: var(--fill); }
details.menu .pop button.item.danger { color: var(--bad); }
details.menu .pop input { flex: 1; min-width: 0; min-height: 30px; padding: 4px 10px; font-size: 13px; }
details.menu .pop .sep { height: 1px; background: var(--line); margin: 4px 2px; }
@keyframes pop-in { from { opacity: 0; transform: scale(.94); } }

/* ---------- Meldungen: schwebende Kapsel unten, verschiebt das Layout nicht ---------- */
.status-line { position: fixed; left: 50%; bottom: 28px; z-index: 30; max-width: min(640px, calc(100vw - 32px)); padding: 11px 20px;
  border-radius: 999px; background: var(--toast); color: var(--toast-ink); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  transform: translateX(-50%); transition: opacity .3s var(--ease), transform .4s var(--ease); }
.status-line:empty { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; padding: 0; }
.status-line.muted { color: var(--toast-ink); }
.status-line.muted::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -1px;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.status-line.delta-down { background: color-mix(in srgb, var(--bad) 92%, black); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.flash { padding: 12px 18px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 500; }

/* ---------- Einstellungen: gruppierte Listen ---------- */
fieldset.group { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; align-content: start; }
fieldset.group legend { padding: 0 4px 8px; font: 600 19px/1.25 var(--font-display); letter-spacing: -.01em; }
.setting { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label control" "help control"; column-gap: 20px;
  align-items: center; align-content: center; padding: 12px 0; min-height: 60px; }
.setting + .setting { box-shadow: 0 -1px 0 var(--line); }
.setting:not(:has(.help)) { grid-template-areas: "label control"; }
.setting > label { grid-area: label; font-size: 14px; font-weight: 400; }
.setting .help { grid-area: help; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.setting > input, .setting > select { grid-area: control; justify-self: end; }
.setting > input[type=text] { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.setting > select { min-width: 180px; }
.preview { display: grid; gap: 16px; }
.preview .tiles { box-shadow: none; background: var(--bg); }
.delta-up { color: var(--ok); } .delta-down { color: var(--bad); }

/* ---------- Anmeldung ---------- */
.login { width: min(380px, 100%); margin: 14vh auto 0; padding: 36px 32px; text-align: center; }
.login .mark { width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, white), var(--accent)); }
.login h1 { font-size: 26px; }
.login form { display: grid; gap: 12px; margin-top: 24px; text-align: left; }
.login input { width: 100%; }
.login button { width: 100%; margin-top: 8px; min-height: 40px; }

@media (max-width: 720px) {
  header.top .bar, main { padding-left: 16px; padding-right: 16px; }
  .setting > input[type=text] { width: 90px; }
  .setting > select { min-width: 0; }
}

/* ---------- Live-Anzeige des Laufs ---------- */
.live[hidden] { display: none; }
.live { margin-bottom: 20px; }
.live-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.live-head h2 { margin: 0 0 10px; }
.live-step { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 8px; }
.live-bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.live-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px;
  transition: width .6s var(--ease); }
.live.done .live-bar span { background: var(--ok); }
.live.failed .live-bar span { background: var(--bad); }
.terminal { margin: 14px 0 0; padding: 12px 14px; max-height: 280px; overflow: auto; border-radius: 10px;
  background: #0d1117; color: #c9d1d9; font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
.terminal:empty::before { content: "Warte auf erste Meldung …"; color: #8b949e; }
.terminal .err { color: #ff7b72; }
.terminal .warn { color: #e3b341; }

/* ---------- Info-Symbole und Info-Fenster ---------- */
.tile { position: relative; }
.info-btn { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; min-height: 0; padding: 0;
  border-radius: 50%; background: var(--fill); color: var(--muted); font: italic 600 12px/20px Georgia, serif;
  text-align: center; cursor: help; }
.info-btn:hover { background: var(--fill-strong); color: var(--ink); }
.info-btn.inline { position: static; display: inline-block; vertical-align: 2px; margin-left: 6px; }
.button.small { padding: 4px 12px; min-height: 28px; font-size: 13px; display: inline-flex; align-items: center; }
.pop { width: min(520px, calc(100vw - 32px)); max-height: min(80vh, 640px); overflow: auto; margin: auto;
  padding: 20px 22px; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-pop); font-size: 14px; line-height: 1.5; }
.pop::backdrop { background: rgba(0, 0, 0, .18); }
.pop h3 { margin: 0 0 8px; font: 600 17px var(--font-display); letter-spacing: -.015em; }
.pop p { margin: 0 0 10px; }
.pop .reasons { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
.pop .reasons td { padding: 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.pop .reasons td.num { width: 64px; padding-right: 12px; text-align: right; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.pop .reasons .hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pop dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.pop dt { font-weight: 600; } .pop dd { margin: 0; color: var(--muted); }

/* ---------- Datenfluss-Grafik ---------- */
.flow { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.flow .box { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.flow .hub .box { stroke: var(--accent); stroke-width: 1.4; }
.flow .t1 { fill: var(--ink); font: 600 14px var(--font); letter-spacing: -.01em; }
.flow .t2 { fill: var(--muted); font: 12px var(--font); }
.flow .st { fill: var(--muted); font: 11px var(--mono); }
.flow .badge.amber { fill: #ff9f0a; } .flow .badge.blue { fill: #0a84ff; }
.flow .badge.red { fill: #e10915; } .flow .badge.violet { fill: #8e5cf7; }
.flow .badge-t { fill: #fff; font: 700 15px var(--font); }
.flow .hub-icon { fill: var(--accent); font: 18px var(--font); }
.flow .spin { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 22 72; opacity: .25;
  transform-box: fill-box; transform-origin: center; }
.flow:not([data-phase=""]) .spin { opacity: 1; animation: flow-spin 1.1s linear infinite; }
@keyframes flow-spin { to { transform: rotate(360deg); } }

.flow .wire { fill: none; stroke: var(--fill-strong); stroke-width: 2; }
.flow .wire-hot { fill: none; stroke: var(--accent); stroke-width: 2.4; opacity: 0; transition: opacity .4s var(--ease);
  stroke-dasharray: 6 8; animation: flow-dash .7s linear infinite; }
@keyframes flow-dash { to { stroke-dashoffset: -14; } }
.flow .pk { transition: opacity .4s var(--ease); }
.flow .pk.idle { opacity: .55; }
.flow .pk.busy { opacity: 0; }
.flow .pk.data { fill: var(--accent); }
.flow .pk.resp { fill: var(--ok); }
.flow .pk.req { fill: #0a84ff; }
/* aktive Leitung je Lauf-Schritt */
.flow[data-phase="solute"] .edge[data-busy~="solute"] :is(.wire-hot, .pk.busy),
.flow[data-phase="produkte"] .edge[data-busy~="produkte"] :is(.wire-hot, .pk.busy),
.flow[data-phase="kaufland"] .edge[data-busy~="kaufland"] :is(.wire-hot, .pk.busy),
.flow[data-phase="feed"] .edge[data-busy~="feed"] :is(.wire-hot, .pk.busy),
.flow[data-phase="pruefen"] .edge[data-busy~="pruefen"] :is(.wire-hot, .pk.busy) { opacity: 1; }
.flow:not([data-phase=""]) .pk.idle { opacity: .2; }

/* Live-Punkte */
.flow .dot .core { fill: var(--muted); }
.flow .dot .ring { fill: none; stroke: var(--muted); stroke-width: 2; opacity: 0;
  transform-box: fill-box; transform-origin: center; }
.flow .dot.live .core { fill: var(--ok); }
.flow .dot.live .ring { stroke: var(--ok); animation: flow-pulse 1.8s var(--ease) infinite; }
.flow .dot.warn .core { fill: var(--warn); }
.flow .dot.down .core { fill: var(--bad); }
.flow .dot.down .ring { stroke: var(--bad); animation: flow-pulse .9s var(--ease) infinite; }
@keyframes flow-pulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.8); } }

.flow-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.flow-legend .lg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.lg-resp { background: var(--ok); } .lg-req { background: #0a84ff; }
.lg-live { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); } .lg-down { background: var(--bad); }

/* ---------- Barrierefreiheit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .status-line.muted::before { border-top-color: rgba(255, 255, 255, .3); }
}
@media (prefers-reduced-transparency: reduce) {
  header.top { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .status-line { -webkit-backdrop-filter: none; backdrop-filter: none; background: #1d1d1f; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, .4); --muted: #3a3a3c; }
  .card, .tiles, .table-box { box-shadow: 0 0 0 1px var(--line); }
}
