/* bepromoted · KI-Workflows (07.11.2026)
   Beispiel-Workflows nach dem Vorbild n8n.io: Reiter, Text links, Ablauf rechts im Projekt-Fenster.
   Knoten sind HTML mit den Tokens aus site.css, die Linien zeichnet assets/js/ki-workflows.js als SVG.
   Ab 735 px läuft der Ablauf von links nach rechts im Raster (--c, --r, --rs, --cs je Knoten aus dem Builder),
   darunter als Baum von oben nach unten. Bewegung nur einmal beim Hineinscrollen und beim Reiterwechsel,
   über opacity, transform und stroke-dashoffset, kein Glas, kein will-change. Geladen auf /ki-workflows und /leistungen. */

/* Wörter wie „KI-Agent“ in Überschriften nicht am Bindestrich trennen (Builder setzt die Klasse) */
.nobr { white-space: nowrap; }

/* Reiter */
.wf-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
html:not(.js) .wf-tabs { display: none; }   /* ohne JS stehen alle Beispiele untereinander */
.wf-tab {
  min-height: var(--btn-h); padding: 0 1.15rem; border-radius: var(--r-pill);
  font-size: 16px; font-weight: 600; color: var(--muted); white-space: nowrap;
  box-shadow: var(--ring);
  transition: color var(--t-base), background-color var(--t-base), box-shadow var(--t-base);
}
.wf-tab:hover { color: var(--ink); }
.wf-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--ring), var(--shadow-soft); }
.wf-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Ein Beispiel: Text und Fenster */
.wf-panel { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.wf-panel[hidden] { display: none; }
.wf-panel + .wf-panel { margin-top: var(--sec-pad); }   /* nur ohne JS sichtbar */
@media (min-width: 1100px) { .wf-panel { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); } }
.wf-text h3 { font-size: var(--t-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }
.wf-text > p { margin-top: .8rem; font-family: var(--font-heading); font-size: var(--t-sub2); line-height: var(--lh-sub2); letter-spacing: var(--ls-sub2); font-weight: 600; color: var(--muted); }
.wf-facts { display: grid; gap: .6rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.wf-facts p { font-size: var(--t-body); line-height: 1.45; color: var(--text); }
.wf-facts b { font-weight: 650; color: var(--ink); }

/* Fenster und Leinwand mit Punktraster */
.wf-window .win-state { font-size: .875rem; }
.wf-canvas {
  position: relative; padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1rem, 3vw, 2rem);
  background-color: var(--surface-alt);
  background-image: radial-gradient(circle at 1px 1px, var(--border-strong) 1px, transparent 1.5px);
  background-size: 18px 18px;
}
.wf-flow {
  position: relative; z-index: 1; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: 1rem; row-gap: 1.75rem; align-items: center;
}
.wf-lines { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

/* Knoten */
.wf-node {
  grid-column: var(--c) / span var(--cs, 1); grid-row: var(--r) / span var(--rs, 1);
  display: grid; justify-items: center; align-content: center; gap: .6rem; min-width: 0; text-align: center;
}
.wf-ico {
  position: relative; display: grid; place-items: center; width: 3.5rem; height: 3.5rem;
  border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  box-shadow: var(--ring), var(--shadow-soft);
}
.wf-ico .ic { width: 1.5rem; height: 1.5rem; }
.wf-label { max-width: 10rem; font-size: 14px; line-height: 1.3; font-weight: 600; color: var(--text); }
/* Haken oben rechts: Schritt ist gelaufen (wie im Ausführungsmodus von n8n) */
.wf-ico::after {
  content: ""; position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5l10 -10'/%3E%3C/svg%3E") center / 11px no-repeat;
  box-shadow: 0 0 0 2px var(--surface-alt);
}
/* Auslöser: links rund wie bei n8n */
.wf-node--start .wf-ico { border-radius: var(--r-pill) var(--r-md) var(--r-md) var(--r-pill); }
/* KI-Schritt: breit, Text in der Fläche, sanftes Blau */
.wf-node--ki { justify-items: stretch; }
.wf-node--ki .wf-ico {
  width: 100%; height: auto; min-height: 3.5rem; padding: .75rem 1rem;
  grid-auto-flow: column; justify-content: center; align-items: center; gap: .65rem;
  background: var(--primary-soft); color: var(--primary); box-shadow: var(--ring-blue), var(--shadow-soft);
}
.wf-node--ki .wf-label { max-width: none; text-align: left; color: var(--primary-ink); }
.wf-chips { display: none; }
/* Du gibst frei: der einzige Schritt beim Menschen, in Blau */
.wf-node--du .wf-ico { background: var(--primary); color: var(--on-primary); box-shadow: var(--key-solid), var(--shadow-soft); }
.wf-node--du .wf-label { color: var(--ink); }
/* Helfer des KI-Schritts: kleine Kreise unter ihm */
.wf-node--sub { align-self: start; gap: .45rem; }
.wf-node--sub .wf-ico { width: 2.75rem; height: 2.75rem; border-radius: 50%; color: var(--muted); }
.wf-node--sub .wf-ico .ic { width: 1.25rem; height: 1.25rem; }
.wf-node--sub .wf-ico::after { display: none; }
.wf-node--sub .wf-label { font-size: 12px; color: var(--muted); }

/* Linien (vom Skript gezeichnet) */
.wf-line { fill: none; stroke: var(--muted); stroke-opacity: .55; stroke-width: 1.5; }
.wf-line--sub { stroke-dasharray: 4 5; }
.wf-port { fill: var(--surface); stroke: var(--muted); stroke-opacity: .7; stroke-width: 1.5; }
.wf-pulse { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; opacity: 0; }

/* Erklärung: zwei Karten, darunter „Was dir das bringt“: drei Vorteile, je ein Schlagwort mit einer Szene (Philipp, 08.11.2026) */
.card-body .wf-gut { color: var(--text); }
.card-body .wf-gut b { font-weight: 650; color: var(--ink); }
.wf-vorteile-h { margin: clamp(3rem, 6vw, 4.5rem) 0 1.5rem; font-size: var(--t-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }

/* Ohne JS und bei reduzierter Bewegung stehen die Szenen untereinander, ab 1069 px Schlagwort links, Szene rechts */
.vt-rahmen { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
.vt-rahmen .wf-vorteile-h { margin-bottom: 0; }
.vt-szene { display: grid; gap: 1.25rem; align-content: start; min-width: 0; }
.vt-szene h4 { margin: 0; font-family: var(--font-heading); font-size: var(--t-h2s); line-height: var(--lh-h2s); letter-spacing: var(--ls-h2s); font-weight: 600; color: var(--ink); }
.vt-bild {
  min-width: 0; padding: var(--card-pad); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--glass-border);
  box-shadow: var(--rim-hi), var(--rim-lo), var(--ring), var(--shadow-soft);
}
@media (min-width: 1069px) {
  .vt-szene { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: var(--gap) calc(var(--gap) * 2); }
  .vt-bild { display: grid; align-content: center; min-height: 18rem; }
}

/* Bühne (ki-workflows.js, Teil 5 setzt .is-an): der Rahmen samt Überschrift bleibt unter der Menüleiste stehen, der Scrollweg der
   Bühne wählt die Szene. Alle drei liegen im selben Rasterfeld, sichtbar ist nur .is-aktiv, Wechsel über opacity und transform */
.vt-buehne.is-an { height: 260svh; }
.vt-buehne.is-an .vt-rahmen { position: sticky; top: 6rem; min-height: calc(100svh - 6rem); align-content: center; }
.vt-buehne.is-an .wf-vorteile-h { margin: 0; }
.vt-buehne.is-an .vt-szene { grid-area: 2 / 1; opacity: 0; transform: translateY(1.5rem); pointer-events: none; transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }
.vt-buehne.is-an .vt-szene.is-aktiv { opacity: 1; transform: none; pointer-events: auto; }

/* Schnellere Antworten: nur was passiert, Frage, „sofort“, Antwort */
.vt-chat { display: grid; gap: .6rem; align-content: center; }
.vt-msg { justify-self: start; max-width: 85%; padding: .65rem .9rem; border-radius: var(--r-md); background: var(--surface-alt); box-shadow: var(--ring); font-size: var(--t-body); line-height: 1.35; color: var(--ink); }
.vt-msg--wir { justify-self: end; background: var(--primary); color: var(--on-primary); box-shadow: none; }
.vt-zeit { display: block; margin-top: .2rem; font-size: 12px; color: var(--muted); }
.vt-msg--wir .vt-zeit { text-align: right; color: rgb(255 255 255 / .78); }
.vt-abstand { justify-self: center; display: flex; align-items: center; gap: .3rem; font-size: 14px; font-weight: 650; color: var(--primary-ink); }
.vt-abstand .ic { width: 1rem; height: 1rem; }

/* Weniger Routinearbeit: ein Durchgang, ein Tipp für dich; ab 735 px waagerecht mit Beschriftung abwechselnd oben und unten */
.vt-strahl { position: relative; list-style: none; margin: 0; padding: 0; }
.vt-strahl::before { content: ""; position: absolute; border-radius: var(--r-pill); background: var(--primary); }
.vt-dot { position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: linear-gradient(var(--primary-soft) 0 0), var(--surface); color: var(--primary); box-shadow: var(--ring-blue); }   /* deckend, die Linie läuft nicht durch den Kreis */
.vt-dot .ic { width: 1rem; height: 1rem; }
.vt-punkt--du .vt-dot { background: var(--primary); color: var(--on-primary); box-shadow: var(--key-solid); }
.vt-was { display: block; font-size: 14px; line-height: 1.3; font-weight: 500; color: var(--muted); }
.vt-punkt--du .vt-was { font-weight: 600; color: var(--ink); }
@media (min-width: 735px) {
  .vt-strahl { height: 8.5rem; margin-inline: .5rem; }
  .vt-strahl::before { left: 3%; right: 3%; top: 50%; height: 2px; margin-top: -1px; transform-origin: left center; }
  .vt-punkt { position: absolute; left: var(--x); top: 50%; transform: translate(-50%, -50%); }
  .vt-was { position: absolute; left: 50%; width: 8rem; transform: translateX(-50%); text-align: center; }
  .vt-punkt:nth-child(odd) .vt-was { bottom: calc(100% + .55rem); }
  .vt-punkt:nth-child(even) .vt-was { top: calc(100% + .55rem); }
  .vt-punkt:first-child .vt-was { left: -.25rem; transform: none; text-align: left; }
  .vt-punkt:last-child .vt-was { left: auto; right: -.25rem; transform: none; text-align: right; }
}
@media (max-width: 734px) {
  .vt-strahl { display: grid; gap: 1rem; }
  .vt-strahl::before { left: calc(.95rem - 1px); top: .95rem; bottom: .95rem; width: 2px; transform-origin: center top; }
  .vt-punkt { position: relative; display: flex; align-items: center; gap: .8rem; }
}

/* Weniger Fehler: ein Tippfehler im Namen, den man sofort sieht, gegen den übernommenen Namen (Philipp, 09.11.2026) */
.vt-daten { display: grid; gap: .6rem; align-content: center; }
.vt-zeile { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-radius: var(--r-md); background: var(--surface-alt); box-shadow: var(--ring); font-size: 14px; color: var(--muted); }
.vt-zeile b { margin-left: auto; font-size: var(--t-body); font-weight: 600; color: var(--ink); white-space: nowrap; }
.vt-zeile mark { padding: 0 .12em; border-radius: var(--r-pill); background: var(--amber-soft); color: var(--amber-ink); }
.vt-zeile .ic { flex: none; width: 1.15rem; height: 1.15rem; }
.vt-zeile--falsch .ic { color: var(--amber-ink); }
.vt-zeile--richtig { box-shadow: var(--ring-blue); }
.vt-zeile--richtig .ic { color: var(--primary); }

/* Jede Szene spielt beim Erscheinen einmal ab, was passiert (nur auf der Bühne, die es bei reduzierter Bewegung nicht gibt) */
.vt-szene.is-aktiv .vt-msg { animation: wf-in .4s var(--ease-out) .15s both; }
.vt-szene.is-aktiv .vt-abstand { animation: wf-fade .3s ease .5s both; }
.vt-szene.is-aktiv .vt-msg--wir { animation: wf-in .4s var(--ease-out) .75s both; }
.vt-szene.is-aktiv .vt-strahl::before { animation: vt-quer .7s var(--ease-out) .1s both; }
.vt-szene.is-aktiv .vt-dot .ic { animation: wf-ok .3s var(--ease-out) calc(.2s + var(--i) * .12s) both; }
.vt-szene.is-aktiv .vt-zeile--falsch { animation: wf-in .4s var(--ease-out) .15s both; }
.vt-szene.is-aktiv .vt-zeile--richtig { animation: wf-in .4s var(--ease-out) .6s both; }
@keyframes vt-quer { from { transform: scaleX(0); } }
@media (max-width: 734px) { @keyframes vt-quer { from { transform: scaleY(0); } } }

/* Preise: Betreuung monatlich oder jährlich (Philipp, 08.11.2026), ohne JS steht die jährliche Zahlweise da */
.wf-zahl { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
html:not(.js) .wf-zahl { display: none; }
.wf-tab[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--ring), var(--shadow-soft); }
.wf-preise[data-zahl="jahr"] [data-z="monat"], .wf-preise[data-zahl="monat"] [data-z="jahr"] { display: none; }

/* Mini-Fassung auf /leistungen: nur das Fenster */
.wf--mini .wf-window { box-shadow: var(--glass-edge), var(--ring), var(--shadow-soft); }

/* Handy: Baum von oben nach unten, Abzweige eingerückt, Helfer als Zeile im KI-Schritt */
@media (max-width: 734px) {
  .wf-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: .25rem var(--gutter) .5rem; scroll-snap-type: x proximity; }
  .wf-tabs::-webkit-scrollbar { display: none; }
  .wf-tab { flex: none; scroll-snap-align: start; scroll-margin-inline: var(--gutter); }
  .wf-flow { grid-template-columns: minmax(0, 1fr); row-gap: 1.5rem; }
  .wf-node { grid-column: 1; grid-row: auto; display: flex; align-items: center; gap: .9rem; text-align: left; }
  .wf-node.is-ein { margin-left: 2.25rem; }
  .wf-ico { flex: none; width: 3rem; height: 3rem; }
  .wf-ico .ic { width: 1.35rem; height: 1.35rem; }
  .wf-label { max-width: none; }
  .wf-node--ki { display: grid; }
  /* Helfer als zweite Zeile im KI-Kasten, damit die Linie darunter beginnt und keinen Text kreuzt */
  .wf-node--ki .wf-ico { grid-auto-flow: row; grid-template-columns: auto minmax(0, 1fr); justify-content: stretch; place-items: center start; column-gap: .7rem; row-gap: .1rem; padding: .7rem .9rem; }
  .wf-node--ki .wf-ico .ic { grid-row: 1 / span 2; }
  .wf-chips { display: block; font-size: 12px; line-height: 1.3; font-weight: 600; color: var(--primary-ink); opacity: .8; }
  .wf-node--sub { display: none; }
}

/* Ablauf: einmal beim Hineinscrollen, beim Reiterwechsel neu. Ohne JS und bei reduzierter Bewegung steht er fertig da */
@media (prefers-reduced-motion: no-preference) {
  .wf.is-armed .wf-panel:not(.is-play) :is(.wf-node, .wf-lines),
  .wf--mini.is-armed:not(.is-play) :is(.wf-node, .wf-lines) { opacity: 0; }
  :is(.wf-panel, .wf--mini).is-play .wf-node { animation: wf-in .5s var(--ease-out) var(--d, 0s) both; }
  :is(.wf-panel, .wf--mini).is-play .wf-ico::after { animation: wf-ok .35s var(--ease-out) calc(var(--d, 0s) + .3s) both; }
  :is(.wf-panel, .wf--mini).is-play .wf-line:not(.wf-line--sub) { stroke-dasharray: 100 100; animation: wf-draw .45s ease-in-out var(--ld, 0s) both; }
  :is(.wf-panel, .wf--mini).is-play :is(.wf-line--sub, .wf-port) { animation: wf-fade .4s ease var(--ld, 0s) both; }
  :is(.wf-panel, .wf--mini).is-play .wf-pulse { stroke-dasharray: 8 100; animation: wf-run .55s ease-in-out var(--ld, 0s) both; }
}
@keyframes wf-in { from { opacity: 0; transform: translateY(6px) scale(.94); } }
@keyframes wf-ok { from { opacity: 0; transform: scale(.4); } }
@keyframes wf-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes wf-fade { from { opacity: 0; } }
@keyframes wf-run { 0% { opacity: 1; stroke-dashoffset: 8; } 85% { opacity: 1; } 100% { opacity: 0; stroke-dashoffset: -100; } }

/* Squircle: Liste am Ende von site.css; Kreise bleiben rund, der Auslöser rund nur auf der linken Seite */
@supports (corner-shape: squircle) {
  .wf-node--sub .wf-ico { corner-shape: round; }
  .wf-node--start .wf-ico { corner-shape: round squircle squircle round; }
}
