/* Planwerx – animiertes Ablauf-Schaubild (Büroautomatisierung) */
.ablauf { padding: clamp(18px, 3vw, 30px); border-radius: var(--radius); }
.ablauf-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.ablauf-kopf h2 { margin: 0; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.01em; }
.ablauf-live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; }
.ablauf-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(240, 58, 58, .6); animation: ablaufPuls 1.6s infinite; }
@keyframes ablaufPuls { 0% { box-shadow: 0 0 0 0 rgba(240, 58, 58, .55); } 70% { box-shadow: 0 0 0 9px rgba(240, 58, 58, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 58, 58, 0); } }

.ablauf-buehne { display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1.1fr) 54px minmax(0, 1fr); align-items: stretch; }
.ablauf-spalte { background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-height: 290px; display: flex; flex-direction: column; gap: 10px; }
.ablauf-titel { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.ablauf-titel svg { width: 16px; height: 16px; color: var(--muted); }

/* Eingang */
.ablauf-liste { display: grid; gap: 8px; }
.ablauf-mail { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid transparent; transition: background .5s var(--ease), border-color .5s var(--ease), opacity .5s; }
.ablauf-mail .ab-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); font-size: 14px; }
.ablauf-mail .ab-ico svg { width: 16px; height: 16px; color: var(--muted); }
.ablauf-mail b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ablauf-mail small { display: block; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ablauf-mail.neu { animation: ablaufRein .6s var(--ease); }
.ablauf-mail.aktiv { background: var(--red-soft); border-color: rgba(240, 58, 58, .4); }
.ablauf-mail.erledigt { opacity: .45; }
@keyframes ablaufRein { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Pfeile mit laufendem Punkt */
.ablauf-pfeil { position: relative; }
.ablauf-pfeil::before { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; border-top: 2px dashed var(--line-strong); }
.ablauf-pfeil::after { content: ""; position: absolute; right: 6px; top: calc(50% - 5px); border: 6px solid transparent; border-left-color: var(--line-strong); border-right: 0; }
.ablauf-pfeil i { position: absolute; left: 6px; top: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 14px rgba(240, 58, 58, .8); opacity: 0; }
.ablauf-pfeil.laeuft i { animation: ablaufPunkt .7s var(--ease) forwards; }
@keyframes ablaufPunkt { 0% { left: 6px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 18px); opacity: 0; } }

/* KI-Assistent */
.ablauf-ki { position: relative; }
.ablauf-ki.denkt .ablauf-titel svg { animation: ablaufDreh 1.2s linear infinite; color: var(--red); }
@keyframes ablaufDreh { to { transform: rotate(360deg); } }
.ablauf-felder { display: grid; gap: 7px; }
.ablauf-feld { display: grid; grid-template-columns: 92px 1fr; gap: 8px; font-size: 13.5px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .035); opacity: 0; transform: translateX(-8px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.ablauf-feld span { color: var(--dim); }
.ablauf-feld b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ablauf-feld.an { opacity: 1; transform: none; }
.ablauf-datei { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px; border: 1px dashed var(--line-strong); font: 600 12.5px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); opacity: 0; transition: opacity .4s; word-break: break-all; }
.ablauf-datei.an { opacity: 1; border-color: rgba(60, 207, 142, .5); }
.ablauf-datei svg { flex: none; width: 16px; height: 16px; color: var(--ok); }

/* Ziele */
.ablauf-ziel { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); transition: border-color .4s, background .4s, transform .4s var(--ease); }
.ablauf-ziel.treffer { border-color: rgba(60, 207, 142, .55); background: rgba(60, 207, 142, .08); transform: scale(1.02); }
.ablauf-ziel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ablauf-ziel-kopf b { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.ablauf-ziel-kopf b svg { width: 18px; height: 18px; color: var(--muted); }
.ablauf-zahl { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ablauf-balken { height: 6px; margin-top: 10px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ablauf-balken i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), #ff7a5c); border-radius: 6px; transition: width .6s var(--ease), background .4s; }
.ablauf-balken.voll i { background: var(--ok); }
.ablauf-status { margin-top: 8px; font-size: 12.5px; color: var(--dim); min-height: 1.3em; }
.ablauf-status.ok { color: var(--ok); }
.ablauf-aufgabe { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.ablauf-aufgabe div { display: flex; gap: 6px; align-items: baseline; }
.ablauf-aufgabe div::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--line-strong); transform: translateY(1px); }
.ablauf-aufgabe .neu { animation: ablaufRein .5s var(--ease); color: var(--text); }

.ablauf-bank { margin-top: 8px; display: grid; gap: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ablauf-bank div { display: grid; grid-template-columns: 16px 44px 1fr auto; gap: 6px; align-items: center; color: var(--muted); padding: 2px 4px; border-radius: 6px; transition: background .4s, color .4s; }
.ablauf-bank div::before { content: ""; width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--line-strong); }
.ablauf-bank div span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ablauf-bank b { font-weight: 600; color: var(--text); }
.ablauf-bank div.ok { color: var(--text); background: rgba(60, 207, 142, .07); }
.ablauf-bank div.ok::before { content: "✓"; border-color: var(--ok); background: var(--ok); color: #0b0c0e; font: 800 9px/8px var(--font); text-align: center; }
.ablauf-quelle { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px; }
.ablauf-zahl.ok { color: var(--ok); }
.ablauf-spalte .ablauf-ziel + .ablauf-ziel { margin-top: 0; }
.ablauf-fuss { margin: 16px 0 0; font-size: 13px; color: var(--dim); }

@media (max-width: 900px) {
  .ablauf-buehne { grid-template-columns: 1fr; }
  .ablauf-spalte { min-height: 0; }
  .ablauf-pfeil { height: 40px; }
  .ablauf-pfeil::before { left: 50%; right: auto; top: 6px; bottom: 6px; border-top: 0; border-left: 2px dashed var(--line-strong); }
  .ablauf-pfeil::after { right: auto; left: calc(50% - 5px); top: auto; bottom: 4px; border: 6px solid transparent; border-top-color: var(--line-strong); border-bottom: 0; }
  .ablauf-pfeil i { left: calc(50% - 5px); top: 4px; }
  .ablauf-pfeil.laeuft i { animation-name: ablaufPunktV; }
  @keyframes ablaufPunktV { 0% { top: 4px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: calc(100% - 16px); opacity: 0; } }
  .ablauf-liste .ablauf-mail:nth-child(n+3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ablauf *, .ablauf *::before, .ablauf *::after { animation: none !important; transition: none !important; }
}
