/* ============================================================
   Prozessautomatisierung: Seitenstile (pz-*)
   Grundzustand = fertiger Zustand. Choreografien laufen ueber .rv.in
   oder (Hero-Protokoll) ueber JS mit .armed. Bei prefers-reduced-motion
   bleibt alles im fertigen Zustand.
   ============================================================ */

:root {
  --pz-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pz-travel: cubic-bezier(0.65, 0, 0.35, 1);
  --pz-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-loop]:not(.live) *,
[data-loop]:not(.live) { animation-play-state: paused !important; }

@keyframes pz-pop { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- Hero: Ablaufprotokoll ---------- */
.pz-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: center; }
.pz-hero-grid h1 { font-size: clamp(38px, 4.8vw, 62px); }
.pz-log {
  position: relative; width: 100%; max-width: 460px; margin-left: auto; padding: 16px 18px 18px;
  border-radius: 20px; background: rgba(6, 18, 24, 0.55); border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}
.pz-log-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(230, 238, 242, 0.6); }
.pz-log-head em { margin-left: auto; font-style: normal; color: var(--orange-soft); }
.pz-lines { list-style: none; display: grid; gap: 4px; }
.pz-lines li { display: grid; grid-template-columns: 62px minmax(0, 1fr) 14px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.05); font-size: 13px; color: #E6EEF2; }
.pz-lines time { font-family: var(--font-mono); font-size: 11px; color: rgba(230, 238, 242, 0.5); }
.pz-lines .dot { width: 10px; height: 10px; border-radius: 50%; background: #35C26B; box-shadow: 0 0 0 3px rgba(53, 194, 107, 0.2); transition: background 0.4s var(--pz-out), box-shadow 0.4s var(--pz-out); }
.pz-lines li.warn { background: rgba(237, 152, 42, 0.14); }
.pz-lines li.warn .dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(237, 152, 42, 0.25); animation: pz-pulse 1.8s var(--pz-travel) infinite; }
@keyframes pz-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(237, 152, 42, 0.25); } 50% { box-shadow: 0 0 0 8px rgba(237, 152, 42, 0); } }
.pz-lines.armed li { opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--pz-out), transform 0.5s var(--pz-out); }
.pz-lines.armed li.on { opacity: 1; transform: none; }
.pz-lines.armed li .dot { background: rgba(255, 255, 255, 0.25); box-shadow: none; }
.pz-lines.armed li.on .dot { background: #35C26B; box-shadow: 0 0 0 3px rgba(53, 194, 107, 0.2); transition-delay: 0.45s; }
.pz-lines.armed li.warn.on .dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(237, 152, 42, 0.25); }
.pz-lines.snap, .pz-lines.snap * { transition: none !important; }
.pz-log-foot { margin-top: 12px; display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(230, 238, 242, 0.45); }

/* ---------- Von Hand gegen automatisch ---------- */
.pz-vs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.pz-col { padding: 26px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 16px; }
.pz-col.auto { background: linear-gradient(160deg, #16354A, var(--night) 80%); border-color: transparent; color: #E6EEF2; box-shadow: 0 30px 70px rgba(16, 40, 53, 0.3); }
.pz-col-head b { display: block; font-family: var(--font-head); font-size: 21px; margin-top: 8px; }
.pz-col.auto .mono-label, .pz-col.auto .mono-label::before { color: var(--orange-soft); }
.pz-col.auto .pz-col-head b { color: #fff; }
.pz-steps { list-style: none; display: grid; gap: 7px; }
.pz-steps li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 13px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line-soft); font-size: 15px; }
.pz-col.auto .pz-steps li { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.08); }
.pz-steps em { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: rgba(237, 152, 42, 0.18); color: #B5560E; white-space: nowrap; }
.pz-col.auto .pz-steps em { background: rgba(53, 194, 107, 0.18); color: #7CE0A3; }
.pz-col.auto .pz-steps li.human { background: rgba(237, 152, 42, 0.16); border-color: rgba(237, 152, 42, 0.4); }
.pz-col.auto .pz-steps li.human em { background: rgba(237, 152, 42, 0.3); color: var(--orange-soft); }
.pz-barwrap { margin-top: auto; }
.pz-bar { height: 8px; border-radius: 99px; background: rgba(16, 40, 53, 0.08); overflow: hidden; }
.pz-col.auto .pz-bar { background: rgba(255, 255, 255, 0.1); }
.pz-bar span { display: block; height: 100%; border-radius: inherit; transform-origin: 0 50%; background: linear-gradient(90deg, var(--orange-soft), var(--orange)); }
.pz-col.auto .pz-bar span { background: linear-gradient(90deg, #7CE0A3, #35C26B); }
.pz-bar-l { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray); }
.pz-col.auto .pz-bar-l { color: rgba(230, 238, 242, 0.5); }
.pz-vs-note { margin-top: 14px; font-size: 13px; color: var(--gray); }

.rv.in .pz-col.hand .pz-steps li { animation: pz-pop 0.6s var(--pz-out) both; }
.rv.in .pz-col.hand .pz-steps li:nth-child(1) { animation-delay: 0.2s; }
.rv.in .pz-col.hand .pz-steps li:nth-child(2) { animation-delay: 1.1s; }
.rv.in .pz-col.hand .pz-steps li:nth-child(3) { animation-delay: 1.7s; }
.rv.in .pz-col.hand .pz-steps li:nth-child(4) { animation-delay: 2.7s; }
.rv.in .pz-col.hand .pz-steps li:nth-child(5) { animation-delay: 3.2s; }
.rv.in .pz-col.hand .pz-steps li:nth-child(6) { animation-delay: 4.2s; }
.rv.in .pz-col.hand .pz-bar span { animation: pz-fill 4.6s var(--pz-travel) 0.2s both; }
.rv.in .pz-col.auto .pz-steps li { animation: pz-pop 0.45s var(--pz-out) both; }
.rv.in .pz-col.auto .pz-steps li:nth-child(1) { animation-delay: 0.2s; }
.rv.in .pz-col.auto .pz-steps li:nth-child(2) { animation-delay: 0.32s; }
.rv.in .pz-col.auto .pz-steps li:nth-child(3) { animation-delay: 0.4s; }
.rv.in .pz-col.auto .pz-steps li:nth-child(4) { animation-delay: 0.62s; }
.rv.in .pz-col.auto .pz-steps li:nth-child(5) { animation-delay: 0.7s; }
.rv.in .pz-col.auto .pz-steps li:nth-child(6) { animation-delay: 0.95s; }
.rv.in .pz-col.auto .pz-steps li:nth-child(7) { animation: pz-pop 0.6s var(--pz-spring) 1.9s both; }
.rv.in .pz-col.auto .pz-bar span { animation: pz-fill 1.3s var(--pz-travel) 0.2s both; }
@keyframes pz-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Typische Abläufe: Route je Karte ---------- */
.pz-route { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.pz-route span { padding: 6px 11px; border-radius: 9px; background: var(--bg-alt); border: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; font-family: var(--font-head); }
.pz-route i { position: relative; flex: 1 1 16px; min-width: 16px; max-width: 40px; height: 2px; background: repeating-linear-gradient(90deg, var(--orange) 0 5px, transparent 5px 9px); }
.pz-route i::after { content: ""; position: absolute; right: -1px; top: -3px; width: 7px; height: 7px; border-top: 2px solid var(--orange); border-right: 2px solid var(--orange); transform: rotate(45deg); }
.pz-route i::before { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(237, 152, 42, 0.2); opacity: 0; }
.rv.in .pz-route i::before { animation: pz-run 1.1s var(--pz-travel) 0.5s 1 both; }
.card:hover .pz-route i::before { animation: pz-run 0.9s var(--pz-travel) 1 both; }
@keyframes pz-run { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 6px); opacity: 0; } }
.card.on-dark .pz-route span { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---------- Prozesslandkarte ---------- */
.pz-map-wrap { display: grid; gap: 16px; }
.pz-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; padding: 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.pz-node { position: relative; padding: 9px 14px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); font-family: var(--font-head); font-weight: 600; font-size: 14.5px; isolation: isolate; }
.pz-node::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: var(--orange); opacity: var(--h, 0.2); }
.pz-chain .sep { color: var(--steel); font-size: 14px; }
.rv.in .pz-chain .sep { animation: pz-pop 0.5s var(--pz-out) 0.2s both; }
.pz-node.top { border-color: var(--orange-deep); }
.pz-node.top::after {
  content: "Größter Hebel"; position: absolute; left: 50%; top: -30px; transform: translateX(-50%); white-space: nowrap;
  padding: 3px 10px; border-radius: 99px; background: var(--ink); color: #fff; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
}
.rv.in .pz-node { animation: pz-pop 0.55s var(--pz-out) both; animation-delay: var(--d, 0s); }
.rv.in .pz-node::before { animation: pz-heat 0.9s var(--pz-out) both; animation-delay: calc(var(--d, 0s) + 2.6s); }
.rv.in .pz-node.top::after { animation: pz-badge 0.6s var(--pz-spring) 4.6s both; }
.rv.in .pz-node.top { animation: pz-pop 0.55s var(--pz-out) both, pz-ring 2.2s var(--pz-travel) 5s 2; animation-delay: var(--d, 0s), 5s; }
@keyframes pz-heat { from { opacity: 0; } to { opacity: var(--h, 0.2); } }
@keyframes pz-badge { from { opacity: 0; transform: translate(-50%, 8px) scale(0.9); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes pz-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(237, 152, 42, 0.45); } 50% { box-shadow: 0 0 0 9px rgba(237, 152, 42, 0); } }
.pz-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--gray); }
.pz-legend span { display: inline-flex; align-items: center; gap: 8px; }
.pz-legend i { width: 38px; height: 10px; border-radius: 99px; background: linear-gradient(90deg, rgba(237, 152, 42, 0.12), var(--orange)); }
.pz-photo { position: relative; }
.pz-photo figcaption { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(10, 26, 34, 0.74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: rgba(230, 238, 242, 0.78); font-size: 13px; }
.pz-photo figcaption b { display: block; color: #fff; font-family: var(--font-head); font-size: 15px; }

/* ---------- Vorgehen: Schritte mit Verlauf ---------- */
.audience-item .idx { transition: background 0.3s, color 0.3s; }
.audience-item:hover .idx { background: var(--orange); color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .pz-hero-grid { grid-template-columns: 1fr; }
  .pz-log { display: none; }
  .pz-vs { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .pz-col { padding: 20px; }
  .pz-chain { padding: 18px 14px; gap: 30px 6px; }
  .pz-node { font-size: 13.5px; padding: 8px 11px; }
  .pz-node.top::after { top: -27px; }
  .pz-lines li { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .rv.in .pz-col .pz-steps li, .rv.in .pz-col .pz-bar span, .rv.in .pz-route i::before,
  .rv.in .pz-node, .rv.in .pz-node::before, .rv.in .pz-node.top::after { animation: none !important; }
  .pz-lines li.warn .dot { animation: none; }
  .pz-lines.armed li { opacity: 1; transform: none; transition: none; }
}
