/* Automationen-Baukasten (static/baukasten.js): links die Handy-Vorschau, rechts die Schrittliste.
   Nur Variablen aus :root in style.css (Haarlinie, Rundung, Tinte, Palette), damit ein Design-Umbau hier mitgreift.
   Ziele mindestens 44 px, viel Weißraum, Farbe nur in den Typ-Symbolen und Prüfhinweisen. */

.seite:has(.bk) { max-width: 1240px; }
.bk { --bk-ziel: 44px; --bk-handy: 330px; display: grid; gap: 20px; min-width: 0; }
.bk .knopf { height: auto; min-height: var(--bk-ziel); }
.bk .text-knopf { height: auto; min-height: var(--bk-ziel); padding: 0 10px; }
.bk .icon-knopf { width: var(--bk-ziel); height: var(--bk-ziel); }
.bk .icon-knopf:disabled { opacity: .35; cursor: default; }
@media (hover: hover) { .bk .icon-knopf:disabled:hover { background: none; } }
.bk .umschalter label, .bk .umschalter button { height: auto; min-height: var(--bk-ziel); }
.bk .schalter { min-height: var(--bk-ziel); }
.bk .feld { min-height: var(--bk-ziel); }
.bk select.feld { padding-right: 28px; }
.bk .raum { flex: 1; }
.bk .knopf.gefahr { background: var(--koralle-p); border-color: var(--koralle-p); color: #fff; }

/* Kopf: zurück, Name, Stand, Schalter, Speichern */
.bk-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-bottom: 16px; border-bottom: var(--haar) solid var(--linie); }
.bk-zurueck { margin-left: -10px; }
.bk-name { flex: 1 1 260px; min-width: 0; min-height: var(--bk-ziel); border: 0; border-radius: var(--rund-klein); background: none; padding: 4px 8px; font: 600 20px/1.25 var(--schrift-marke); letter-spacing: -.015em; outline: none; }
@media (hover: hover) { .bk-name:hover { background: var(--flaeche); } }
.bk-name:focus { background: var(--flaeche); box-shadow: 0 0 0 var(--haar) var(--linie-stark); }
.bk-name::placeholder { color: var(--text-3); }
.bk-kopf-rechts { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.bk-stand { white-space: nowrap; }
.bk-frage, .bk-fehler, .bk-info { flex-basis: 100%; }
.bk-frage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--rund); background: var(--flaeche); }
.bk-frage > span { flex: 1 1 160px; }
.bk-fehler { color: var(--koralle-t); font-size: 13.5px; }
.bk-umschalter { display: none !important; }

/* Fläche: Vorschau links, Schritte rechts */
.bk-flaeche { display: grid; grid-template-columns: var(--bk-handy) minmax(0, 1fr); gap: 40px; align-items: start; }
.bk-vorschau-spalte { position: sticky; top: 16px; display: grid; gap: 12px; justify-items: center; }
.bk-vorschau-text { max-width: var(--bk-handy); text-align: center; color: var(--text-3); }
.bk-schritte-spalte { min-width: 0; display: grid; gap: 16px; align-content: start; }
.bk-schritte { min-width: 0; display: flex; flex-direction: column; }

/* Karten */
.bk-karte { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border: var(--haar) solid var(--linie-stark); border-radius: var(--rund); background: var(--grund); cursor: pointer; min-width: 0; transition: box-shadow .15s, border-color .15s; }
@media (hover: hover) { .bk-karte:hover { border-color: var(--text-3); } }
.bk-karte.aktiv { border-color: var(--text); box-shadow: 0 0 0 .5px var(--text); }
.bk-karte.warn-fehler { border-color: var(--koralle-p); }
.bk-karte.blinkt { box-shadow: 0 0 0 3px var(--sonne-g), 0 0 0 4px var(--sonne-p); }
.bk-sym { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: #fff; background: var(--grau-p); }
.bk-sym .ic { width: 16px; height: 16px; }
.bk-sym.t-tinte { background: var(--tinte); color: var(--tinte-text); }
.bk-sym.t-sand { background: var(--sand-p); } .bk-sym.t-koralle { background: var(--koralle-p); } .bk-sym.t-meer { background: var(--meer-p); }
.bk-sym.t-lavendel { background: var(--lavendel-p); } .bk-sym.t-salbei { background: var(--salbei-p); } .bk-sym.t-sonne { background: var(--sonne-p); } .bk-sym.t-grau { background: var(--grau-p); }
.bk-karte-text { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; }
.bk-karte-titel { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-karte-zus { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-nr { flex: none; min-width: 22px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-3); }
.bk-warn { flex: none; display: inline-grid; color: var(--sonne-p); }
.bk-warn.fehler { color: var(--koralle-p); }
.bk-warn .ic { width: 16px; height: 16px; }

/* Verbindung mit "+" zwischen den Karten */
.bk-plus { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding-left: 27px; }
.bk-plus::before { content: ""; position: absolute; left: 28px; top: 0; bottom: 0; border-left: var(--haar) solid var(--linie-stark); }
.bk-plus-knopf { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: var(--bk-ziel); min-width: var(--bk-ziel); margin-left: -21px; padding: 0 10px; border-radius: 999px; color: var(--text-3); }
.bk-plus-knopf .ic { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--grund); box-shadow: 0 0 0 var(--haar) var(--linie-stark); }
.bk-plus.offen .bk-plus-knopf { color: var(--text); }
@media (hover: hover) { .bk-plus-knopf:hover { color: var(--text); } }
.bk-plus.offen .bk-plus-knopf .ic { box-shadow: 0 0 0 var(--haar) var(--text-3); }
@media (hover: hover) { .bk-plus-knopf:hover .ic { box-shadow: 0 0 0 var(--haar) var(--text-3); } }
.bk-plus.ende::before { bottom: 50%; }
.bk-plus.ende.offen::before { bottom: auto; height: 22px; }
.bk-plus-text { font-size: 13px; font-weight: 500; }
.bk-menue { position: relative; z-index: 1; width: min(420px, 100%); margin: 2px 0 8px -27px; padding: 6px; display: grid; border-radius: var(--rund); background: var(--grund); box-shadow: var(--schatten); }
.bk-menue-zeile { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px; border-radius: 8px; text-align: left; }
@media (hover: hover) { .bk-menue-zeile:hover { background: var(--flaeche); } }
.bk-menue-sprung { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-top: var(--haar) solid var(--linie); margin-top: 4px; }
.bk-menue-sprung .feld { margin-top: 6px; }
.bk-menue-zu { justify-self: end; }

/* Zweige eingerückt, Sprung als Chip statt Linie */
.bk-zweige { display: grid; gap: 10px; margin: 10px 0 0 28px; padding-left: 16px; border-left: var(--haar) solid var(--linie-stark); }
.bk-zweig { min-width: 0; }
.bk-zweig-kopf { display: flex; align-items: center; gap: 6px; width: 100%; min-height: var(--bk-ziel); padding: 0 8px 0 4px; margin-left: -4px; border-radius: 8px; text-align: left; font-size: 13.5px; min-width: 0; }
@media (hover: hover) { .bk-zweig-kopf:hover { background: var(--flaeche); } }
.bk-zweig-pfeil { width: 14px !important; height: 14px !important; color: var(--text-3); transform: rotate(90deg); transition: transform .15s; }
.bk-zweig.zu .bk-zweig-pfeil { transform: none; }
.bk-zweig-vor { flex: none; }
.bk-zweig-titel { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bk-zweig-zahl { margin-left: auto; flex: none; padding-left: 8px; }
.bk-zweig-inhalt { display: flex; flex-direction: column; padding-bottom: 4px; }
.bk-zweig-inhalt > .bk-karte:first-child { margin-top: 4px; }
.bk-sprung-zeile { display: flex; align-items: center; gap: 2px; }
.bk-sprung { display: inline-flex; align-items: center; gap: 8px; min-height: var(--bk-ziel); padding: 0 14px 0 10px; border-radius: var(--rund); border: var(--haar) dashed var(--linie-stark); color: var(--text-2); font-size: 13px; font-weight: 500; }
@media (hover: hover) { .bk-sprung:hover { border-color: var(--text-3); color: var(--text); } }
.bk-sprung .ic { width: 16px; height: 16px; }
.bk-sprung.kaputt { color: var(--koralle-t); border-color: var(--koralle-p); }
.bk-lose { margin-top: 28px; padding-top: 16px; border-top: var(--haar) solid var(--linie); display: flex; flex-direction: column; gap: 4px; }
.bk-lose-kopf { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.bk-lose-kopf .ic { width: 15px; height: 15px; color: var(--sonne-p); margin-top: 2px; }

/* Bearbeiten: Karte in voller Breite (Desktop) */
.bk-panel { display: grid; gap: 18px; margin: 8px 0 4px; padding: 16px 18px 12px; border: var(--haar) solid var(--linie-stark); border-radius: var(--rund); background: var(--grund); box-shadow: var(--schatten-klein); min-width: 0; }
.bk-panel-kopf { display: flex; align-items: center; gap: 12px; }
.bk-panel-titel { flex: 1; min-width: 0; display: grid; }
.bk-panel-titel h3 { font-size: 15px; }
.bk-panel-kopf .icon-knopf { margin: -6px -10px -6px 0; }
.bk-feld { display: grid; gap: 8px; min-width: 0; }
.bk-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.bk-label-zeile { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bk-feld > small, .bk-haken small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.4; }
.bk-feld > .text-knopf { justify-self: start; margin-left: -10px; }
.bk-haken { display: flex; gap: 10px; align-items: flex-start; min-height: var(--bk-ziel); padding: 10px 0 2px; cursor: pointer; font-size: 13.5px; }
.bk-haken input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--tinte); }
.bk-liste { display: grid; gap: 8px; min-width: 0; }
.bk-zeile { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bk-zeile > .feld { flex: 1; }
.bk-zeile-fuss { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-left: -10px; }
.bk-zahl { width: 96px !important; flex: none !important; }
.bk-einheit { width: auto !important; flex: 1 1 140px !important; }
.bk-uhrzeit .feld { flex: 0 1 130px; }
.bk-prozent { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.bk-prozent .bk-zahl { width: 76px !important; }
.bk-teile { display: grid; gap: 10px; }
.bk-teil { display: grid; gap: 2px; min-width: 0; }
.bk-teil textarea { min-height: 88px; }
.bk-teil-fuss { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.bk-vars { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.bk-var { min-height: var(--bk-ziel); padding: 0 8px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.bk-var::before { content: "+ "; color: var(--text-3); }
@media (hover: hover) { .bk-var:hover { background: var(--flaeche); color: var(--text); } }
.bk-medium { display: flex; align-items: center; gap: 12px; padding: 6px 4px 6px 12px; border: var(--haar) solid var(--linie-stark); border-radius: var(--rund); }
.bk-medium > .ic { color: var(--text-2); }
.bk-teil-knoepfe { display: flex; flex-wrap: wrap; gap: 2px; margin-left: -10px; }
.bk-rest { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-rest.knapp { color: var(--sonne-t); }
.bk-rest.zuviel { color: var(--koralle-t); font-weight: 600; }
.bk-titel-feld { position: relative; flex: 1; min-width: 0; display: flex; }
.bk-titel-feld .feld { padding-right: 38px; }
.bk-rest.mini { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.bk-knopf-zeile { display: grid; gap: 6px; padding: 10px 0 10px; border-bottom: var(--haar) solid var(--linie); }
.bk-knopf-zeile:first-child { padding-top: 0; }
.bk-knopf-zeile .bk-zeile { flex-wrap: wrap; }
.bk-knopf-zeile .umschalter { flex: none; }
.bk-aktion { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk-aktion > .feld, .bk-aktion > .bk-zeile { flex: 1 1 180px; }
.bk-aktion > select.feld:first-child { flex: 0 1 220px; }
.bk-tage { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-tag { position: relative; display: inline-grid; place-items: center; min-width: var(--bk-ziel); min-height: var(--bk-ziel); border-radius: 10px; border: var(--haar) solid var(--linie-stark); font-size: 13px; font-weight: 500; cursor: pointer; }
.bk-tag input { position: absolute; opacity: 0; pointer-events: none; }
.bk-tag:has(input:checked) { background: var(--tinte); border-color: var(--tinte); color: var(--tinte-text); }
.bk-tag:has(input:focus-visible) { outline: 2px solid var(--akzent); outline-offset: 2px; }
.bk-auswahl { display: grid; gap: 8px; padding: 10px; border-radius: var(--rund); background: var(--flaeche); }
.bk-auswahl-liste { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.bk-auswahl-zeile { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: 8px; text-align: left; min-width: 0; }
@media (hover: hover) { .bk-auswahl-zeile:hover { background: var(--grund); } }
.bk-auswahl-zeile .fp { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--grau-p); }
.bk-auswahl-zeile .fp.f-sand { background: var(--sand-p); } .bk-auswahl-zeile .fp.f-meer { background: var(--meer-p); } .bk-auswahl-zeile .fp.f-sonne { background: var(--sonne-p); }
.bk-auswahl-zeile .fp.f-koralle { background: var(--koralle-p); } .bk-auswahl-zeile .fp.f-lavendel { background: var(--lavendel-p); } .bk-auswahl-zeile .fp.f-salbei { background: var(--salbei-p); }
.bk-roh { margin: 0; padding: 10px; border-radius: 8px; background: var(--flaeche); font-size: 12px; overflow-x: auto; white-space: pre-wrap; }
.bk-panel-fuss { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding-top: 10px; border-top: var(--haar) solid var(--linie); }
.bk-panel-fuss > .text-knopf:first-child { margin-left: -10px; }
.bk-frage-klein { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* Prüfhinweise oben in der Schrittliste */
.bk-hinweis-box { border: var(--haar) solid var(--linie-stark); border-radius: var(--rund); background: var(--grund); }
.bk-hinweis-box summary { display: flex; align-items: center; gap: 10px; min-height: var(--bk-ziel); padding: 4px 14px; cursor: pointer; list-style: none; font-weight: 600; font-size: 13.5px; }
.bk-hinweis-box summary::-webkit-details-marker { display: none; }
.bk-hinweis-box summary .ic { width: 16px; height: 16px; color: var(--sonne-p); }
.bk-hinweis-unter { margin-left: auto; font-weight: 400; }
.bk-hinweis-box ul { list-style: none; margin: 0; padding: 0 14px 8px; display: grid; }
.bk-hinweis { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 8px 0; border-top: var(--haar) solid var(--linie); font-size: 13.5px; }
.bk-punkt { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--sonne-p); }
.bk-hinweis.fehler .bk-punkt { background: var(--koralle-p); }
.bk-hinweis-text { flex: 1 1 220px; min-width: 0; }
.bk-hinweis .text-knopf { margin: -6px 0; }
.bk-quelle { flex-basis: 100%; padding-left: 18px; color: var(--text-3); }
.bk-alles-gut { color: var(--text-3); }

/* Kurzzeile in der Regelkarte */
.bk-kurz { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.bk-kurz-ic { width: 13px !important; height: 13px !important; color: var(--text-3); }
.bk-kurz-warn { display: inline-flex; align-items: center; gap: 4px; color: var(--sonne-t); }
.bk-kurz-warn.fehler { color: var(--koralle-t); }
.bk-kurz-warn .ic { width: 13px; height: 13px; }

/* ---------- Handy-Vorschau im Instagram-Look ---------- */
.bk-handy { width: var(--bk-handy); padding: 9px; border-radius: 46px; background: var(--flaeche-2); box-shadow: inset 0 0 0 var(--haar) var(--linie-stark), var(--schatten-klein); }
.bkv-bildschirm { position: relative; height: min(640px, calc(100dvh - 160px)); min-height: 460px; display: flex; flex-direction: column; border-radius: 38px; overflow: hidden; background: var(--grund); box-shadow: 0 0 0 var(--haar) var(--linie-stark); }
.bkv-insel { position: absolute; top: 9px; left: 50%; width: 92px; height: 26px; margin-left: -46px; border-radius: 20px; background: #000; z-index: 2; }
.bkv-kopf { display: flex; align-items: center; gap: 8px; padding: 44px 14px 10px; border-bottom: var(--haar) solid var(--linie); }
.bkv-kopf > .ic { width: 20px; height: 20px; color: var(--text); }
.bkv-name { display: grid; line-height: 1.2; font-size: 13px; min-width: 0; }
.bkv-name strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bkv-name span { font-size: 11px; color: var(--text-3); }
.bkv-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--flaeche-2); }
.bkv-av.klein { width: 22px; height: 22px; }
.bkv-av-leer { display: inline-block; }
.bkv-verlauf { flex: 1; overflow-y: auto; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 4px; scrollbar-width: none; font-size: 13.5px; line-height: 1.38; }
.bkv-verlauf::-webkit-scrollbar { display: none; }
.bkv-gruppe { display: flex; align-items: flex-end; gap: 7px; margin-top: 6px; max-width: 86%; border-radius: 14px; cursor: pointer; }
.bkv-blasen { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.bkv-blase { padding: 7px 12px; border-radius: 18px; background: var(--blase-sie); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.bkv-blasen > .bkv-blase:not(:last-child), .bkv-blasen > .bkv-vorlage:not(:last-child) { border-bottom-left-radius: 6px; }
.bkv-blasen > :not(:first-child) { border-top-left-radius: 6px; }
.bkv-reihe { display: flex; flex-direction: column; align-items: flex-end; align-self: flex-end; max-width: 80%; margin-top: 6px; }
.bkv-reihe.sie .bkv-blase { background: var(--blase-ich); color: var(--blase-ich-text); }
.bkv-tipp { font-size: 10.5px; color: var(--text-3); margin: 2px 6px 0; }
.bkv-story { align-self: flex-end; font-size: 11px; margin-top: 4px; }
.bkv-vorlage { display: grid; min-width: 0; max-width: 100%; border-radius: 18px; overflow: hidden; background: var(--blase-sie); }
.bkv-vorlage-text { padding: 8px 12px 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bkv-knopf { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: var(--bk-ziel); padding: 4px 12px; border-top: var(--haar) solid var(--linie-stark); font-weight: 600; font-size: 13px; color: var(--akzent); background: var(--grund); }
@media (hover: hover) { .bkv-knopf:hover { background: var(--flaeche); } }
.bkv-knopf.gewaehlt { color: var(--text); background: var(--flaeche-2); }
.bkv-knopf .ic { width: 12px; height: 12px; }
.bkv-quick { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.bkv-qr { min-height: var(--bk-ziel); padding: 0 14px; border-radius: 22px; border: var(--haar) solid var(--akzent); color: var(--akzent); font-size: 13px; font-weight: 500; background: var(--grund); }
@media (hover: hover) { .bkv-qr:hover { background: var(--flaeche); } }
.bkv-system { align-self: center; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; max-width: 94%; margin: 10px 0 4px; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; color: var(--text-3); text-align: center; cursor: pointer; }
.bkv-system .ic { width: 13px; height: 13px; }
.bkv-system.wahl { padding: 6px 8px; background: var(--flaeche); }
.bkv-wahl { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.bkv-wahl button { min-height: var(--bk-ziel); min-width: var(--bk-ziel); padding: 0 10px; border-radius: 8px; font-size: 12px; color: var(--text-2); }
.bkv-wahl button.gewaehlt { background: var(--grund); color: var(--text); font-weight: 600; box-shadow: 0 0 0 var(--haar) var(--linie-stark); }
.bkv-trenner { align-self: center; margin: 14px 0 2px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.bkv-kommentar { display: grid; gap: 8px; padding: 10px; margin-bottom: 6px; border-radius: 14px; border: var(--haar) solid var(--linie); }
.bkv-post { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.bkv-post .ic { width: 14px; height: 14px; }
.bkv-k-zeile { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.35; border-radius: 8px; }
.bkv-k-zeile strong { font-weight: 600; }
.bkv-oeffentlich { display: grid; gap: 8px; padding-left: 22px; }
.bkv-oeffentlich:empty { display: none; }
.bkv-k-zeile.antwort { cursor: pointer; }
.bkv-leise { color: var(--text-3); font-size: 11.5px; }
.bkv-var { border-bottom: 1px dotted currentColor; }
.bkv-audio, .bkv-datei { display: inline-flex; align-items: center; gap: 8px; }
.bkv-audio .ic, .bkv-datei .ic { width: 16px; height: 16px; }
.bkv-welle { width: 90px; height: 14px; background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px); opacity: .45; -webkit-mask: linear-gradient(0deg, transparent 20%, #000 20% 80%, transparent 80%); }
.bkv-ende { align-self: center; margin-top: 14px; font-size: 11px; color: var(--text-3); }
.bkv-eingabe { margin: 8px 12px 16px; padding: 9px 14px; border-radius: 22px; border: var(--haar) solid var(--linie-stark); font-size: 13px; color: var(--text-3); }
.bkv-verlauf .gewaehlt[data-bk-waehle] { box-shadow: 0 0 0 2px var(--grund), 0 0 0 3.5px var(--text-3); }

/* Blatt von unten (Handy) */
.bk-blatt-hinter { position: fixed; inset: 0; z-index: 60; background: rgb(13 16 22 / .32); }
.bk-blatt { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(16px + var(--su)); border-radius: 16px 16px 0 0; background: var(--grund); box-shadow: var(--schatten); }
.bk-blatt-griff { width: 40px; height: 4px; border-radius: 2px; background: var(--linie-stark); margin: 2px auto 10px; }
.bk-blatt .bk-panel { margin: 0; padding: 0; border: 0; box-shadow: none; }
body.bk-blatt-auf #inhalt { overflow: hidden; }

@media (max-width: 1199px) {
  .bk { --bk-handy: 300px; }
  .bk-flaeche { gap: 28px; }
}
/* Unter 980 px: Umschalter Schritte/Vorschau statt zwei Spalten */
@media (max-width: 979px) {
  .bk-umschalter { display: flex !important; }
  .bk-flaeche { grid-template-columns: minmax(0, 1fr); }
  .bk[data-ansicht="schritte"] .bk-vorschau-spalte { display: none; }
  .bk[data-ansicht="vorschau"] .bk-schritte-spalte { display: none; }
  .bk-vorschau-spalte { position: static; }
}
@media (max-width: 759px) {
  .bk { gap: 14px; }
  .bk .feld { font-size: 16px; }
  .bk-kopf { padding-bottom: 12px; }
  .bk-name { flex-basis: 100%; order: -1; font-size: 18px; padding: 4px 0; }
  .bk-zurueck { margin-left: -10px; }
  /* Seit Veröffentlichen (B2b) und 44er-Tippflächen (D2) passt die Zeile nicht mehr in 390 px: umbrechen statt überlaufen */
  .bk-kopf-rechts { gap: 8px; flex-wrap: wrap; margin-left: 0; }
  .bk-handy { width: 100%; max-width: 360px; padding: 7px; border-radius: 40px; }
  .bkv-bildschirm { height: calc(100dvh - 230px); min-height: 420px; border-radius: 33px; }
  .bk-karte { padding: 10px 12px; gap: 10px; }
  .bk-zweige { margin-left: 13px; padding-left: 10px; }
  .bk-plus { padding-left: 12px; }
  .bk-plus::before { left: 13px; }
  .bk-plus-knopf { margin-left: -21px; }
  .bk-menue { margin-left: -12px; width: calc(100% + 12px); }
  .bk-zweig-zahl { display: none; }
  .bk-panel-fuss { position: sticky; bottom: calc(-16px - var(--su)); margin: 0 -16px; padding: 10px 16px calc(10px + var(--su)); background: var(--grund); }
}
@media (prefers-reduced-motion: reduce) { .bk-karte, .bk-zweig-pfeil { transition: none; } }

/* ---------- Dateien in Nachrichtenteilen: Hochladen, Fortschritt, Vorschau ---------- */
.bk-medium { display: grid; gap: 8px; padding: 8px 4px 8px 12px; align-items: stretch; }
.bk-medium.fehlt { border-style: dashed; }
.bk-medium-kopf { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bk-medium-kopf > .ic { color: var(--text-2); flex: none; }
.bk-medium.fehlt .bk-karte-zus { color: var(--koralle-t); }
.bk-medium-bild { display: block; max-width: 160px; max-height: 120px; width: auto; height: auto; border-radius: 8px; object-fit: cover; box-shadow: 0 0 0 var(--haar) var(--linie-stark); }
.bk-medium-audio { width: min(100%, 320px); height: var(--bk-ziel); }
.bk-medium-video { display: block; max-width: min(100%, 240px); max-height: 180px; border-radius: 8px; background: #000; }
.bk-medium-link { justify-self: start; margin-left: -10px; }
.bk-medium-fuss { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 10px; margin-left: -10px; }
.bk-medium .bk-fehler { margin: 0; }
.bk-fortschritt { height: 4px; margin-right: 8px; border-radius: 2px; background: var(--flaeche-2); overflow: hidden; }
.bk-fortschritt > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--tinte); transition: width .15s; }
.bk-datei-knopf { position: relative; cursor: pointer; }
.bk-datei-knopf.gesperrt { opacity: .5; cursor: default; }
.bk-datei-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 0; }
.bk-datei-knopf:focus-within { outline: 2px solid var(--akzent); outline-offset: 2px; }
.bkv-bild { max-width: 180px; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 var(--haar) var(--linie); }
.bkv-bild img { display: block; width: 100%; height: auto; }

/* Hinweis nach der Übernahme und Hinweise vom Import */
.bk-frisch { display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px 10px 12px; border-radius: var(--rund); background: var(--flaeche); font-size: 13.5px; line-height: 1.45; }
.bk-frisch > span .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--salbei-p); }
.bk-frisch p { flex: 1; margin: 0; }
.bk-frisch .icon-knopf { margin: -8px 0 -8px auto; }
.bk-import-kopf { padding: 10px 14px 0; border-top: var(--haar) solid var(--linie); }
.bk-hinweis-box ul.bk-import .bk-hinweis:first-child { border-top: 0; }
.bk-import .bk-punkt { background: var(--grau-p); }
.bk-import .bk-hinweis.fehler .bk-punkt { background: var(--koralle-p); }

/* ---------- Aus ManyChat übernehmen ---------- */
.bk-vl > h2 { margin-bottom: 6px; }
.bk-vl-einleitung { max-width: 62ch; margin-bottom: 16px; }
.bk-vl-konto + .bk-vl-konto { margin-top: 20px; }
.bk-vl-konto-kopf { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.bk-vl-liste { list-style: none; margin: 0; padding: 0; }
.bk-vl-zeile { padding: 12px 0; border-bottom: var(--haar) solid var(--linie); }
.bk-vl-zeile:last-child { border-bottom: 0; }
.bk-vl-haupt { display: flex; align-items: center; gap: 16px; min-width: 0; }
.bk-vl-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.bk-vl-name { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.bk-vl-name .normal { font-weight: 400; }
.bk-vl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.bk-vl-trenn { opacity: .6; }
.bk-vl-live { display: inline-flex; align-items: center; gap: 6px; }
.bk-vl-punkt { width: 6px; height: 6px; border-radius: 50%; background: var(--grau-p); }
.bk-vl-live.an .bk-vl-punkt { background: var(--salbei-p); }
.bk-vl-pruef { font-variant-numeric: tabular-nums; }
.bk-vl-status { display: inline-flex; align-items: center; gap: 5px; color: var(--salbei-t); }
.bk-vl-status .ic { width: 13px; height: 13px; }
.bk-vl-knoepfe { display: flex; align-items: center; gap: 4px; flex: none; }
.bk-vl-knoepfe .knopf, .bk-vl-frage .knopf, .bk-vl .text-knopf { height: auto; min-height: 44px; }
.bk-vl-knoepfe .text-knopf { padding: 0 10px; }
.bk-vl-frage { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border-radius: var(--rund); background: var(--flaeche); font-size: 13.5px; line-height: 1.45; }
.bk-vl-frage p { margin: 0; }
.bk-vl-frage-knoepfe { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.bk-vl-fehler { margin-top: 8px; }
.bk-vl-fehler ul { list-style: none; margin: 4px 0 0; padding: 0; }
.bk-vl-leer { padding: 12px 14px; border-radius: var(--rund); background: var(--flaeche); }
.bk-vl-leer p { margin: 0; }
.bk-vl-leer p + p { margin-top: 4px; }
.regeln-knoepfe { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.regeln-knoepfe .text-knopf { height: auto; min-height: 44px; padding: 0 10px; }

@media (max-width: 759px) {
  .bk-vl-haupt { flex-direction: column; align-items: stretch; gap: 8px; }
  .bk-vl-knoepfe { flex-wrap: wrap; }
  .bk-vl-knoepfe .knopf { flex: 1 1 auto; }
  .bk-vl-frage-knoepfe .knopf { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .bk-fortschritt > span { transition: none; } }
/* Textteil: Zähler und Entfernen-Knopf bleiben zusammen rechts, auch wenn die Zeile umbricht */
.bk-teil-rechts { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }

/* ----- Probechat in der Vorschau (T7): gleiche Handy-Optik, nichts wird gesendet ----- */
.bk-pv-modus { width: var(--bk-handy); max-width: 100%; }
.bk-pv-modus button { flex: 1 1 0; }
.bkp-leiste { width: var(--bk-handy); max-width: 100%; display: grid; gap: 8px; }
.bkp-leiste[hidden] { display: none; }
.bkp-arten { width: 100%; flex-wrap: wrap; }
.bkp-arten button { flex: 1 1 auto; font-size: 12.5px; padding: 0 8px; }
.bkp-text { display: grid; gap: 4px; }
.bkp-text .feld { width: 100%; min-height: var(--bk-ziel); }
.bkp-knoepfe { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bkp-knoepfe .text-knopf { height: auto; min-height: var(--bk-ziel); padding: 0 10px; }
.bkp-laedt .bkv-verlauf { opacity: .55; transition: opacity .15s; }
.bkp-zeit { align-self: center; max-width: 94%; margin: 10px 0 2px; font-size: 11px; color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
.bkp-zeit.bkp-zu, .bkp-grund.bkp-zu { color: var(--koralle-t); }
.bkp-zeit.bkp-zu strong { font-weight: 600; }
.bkp-grund { margin: 2px 0 4px 35px; font-size: 11px; color: var(--sand-t); overflow-wrap: anywhere; }
.bkp-gesperrt { opacity: .5; }
.bkp-gesperrt .bkv-blase, .bkp-gesperrt .bkv-vorlage { box-shadow: inset 0 0 0 1px var(--linie-stark); background: transparent; }
.bkp-warten { cursor: default; }
.bkp-weiche { cursor: default; }
.bkp-leise { align-self: center; display: inline-flex; align-items: center; gap: 6px; max-width: 94%; margin: 6px 0 2px; font-size: 11.5px; color: var(--text-3); text-align: center; overflow-wrap: anywhere; }
.bkp-leise .ic, .bkp-leise svg { width: 13px; height: 13px; flex: none; }
.bkp-leise.bkp-nicht { color: var(--sand-t); }
.bkp-fehler { margin: auto 8px; padding: 10px 12px; border-radius: 12px; background: var(--flaeche); color: var(--koralle-t); font-size: 12.5px; text-align: center; }
.bkp-verlauf .bkv-knopf:disabled { color: var(--text-3); cursor: default; }
.bkp-verlauf .bkv-knopf:disabled.gewaehlt { color: var(--text); }

/* Probelauf mit den DMs der letzten 7 Tage: unter der Vorschau und auf der Regel-Karte */
.bkp-dms { width: var(--bk-handy); max-width: 100%; display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--rund); background: var(--flaeche); font-size: 13.5px; line-height: 1.45; }
.bkp-dms[hidden] { display: none; }
.bkp-dms p, .bkp-dms-ergebnis p { margin: 0; }
.bkp-dms-ergebnis { display: grid; gap: 6px; font-size: 13.5px; line-height: 1.45; }
.bkp-dms-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bkp-dms-kopf .knopf { min-height: var(--bk-ziel); height: auto; }
.bkp-beispiele { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bkp-beispiele li { display: grid; gap: 1px; padding: 6px 10px; border-radius: 10px; background: var(--grund); overflow-wrap: anywhere; }

/* ----- Ablauf starten aus dem Chat (T7) ----- */
.popover.ablauf-pop { width: min(300px, calc(100vw - 32px)); }
.ca-zeile { height: auto; min-height: 44px; padding: 6px 10px; display: grid; justify-content: stretch; gap: 1px; }
.ca-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.ca-meta { font-size: 11.5px; color: var(--text-3); }
.ca-zeile:disabled { cursor: not-allowed; }
@media (hover: hover) { .ca-zeile:disabled:hover { background: none; } }
.ca-zeile.ca-zu .ca-name { color: var(--text-3); }
.ca-zeile.ca-zu .ca-meta { color: var(--sand-t); font-weight: 500; }
.ca-text { margin: 6px 10px 4px; line-height: 1.4; }
.ca-fehler { color: var(--koralle-t); }
.ca-ergebnis { display: flex; align-items: flex-start; gap: 8px; margin: 8px 4px 4px; padding: 9px 10px; border-radius: 10px; background: var(--salbei-g); color: var(--salbei-t); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.ca-ergebnis .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.ca-ergebnis.fehler { background: var(--koralle-g); color: var(--koralle-t); }
/* Am Handy steht der Knopf nicht ganz rechts: das Popover richtet sich an der Knopfleiste aus, nicht am Knopf */
.chat-aktionen { position: relative; }
.chat-aktionen .aufklapp.ablauf-start { position: static; }
/* Protokoll: Abstand zwischen den Spalten, jetzt mit längeren Schrittnamen */
.protokoll th, .protokoll td { padding-right: 12px; }

/* ----- B1c: alle Auslöser und Knoten, Reihenfolge der Regeln ----- */
/* Auslöser-Auswahl als ruhige Liste mit Haarlinien, gewählte Zeile mit Haken */
.bk-wahl-liste { display: grid; border: var(--haar) solid var(--linie-stark); border-radius: var(--rund); overflow: hidden; }
.bk-wahl-zeile { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 7px 12px 7px 14px; cursor: pointer; min-width: 0; }
.bk-wahl-zeile + .bk-wahl-zeile { border-top: var(--haar) solid var(--linie); }
.bk-wahl-zeile input { position: absolute; opacity: 0; pointer-events: none; }
@media (hover: hover) { .bk-wahl-zeile:hover { background: var(--flaeche); } }
.bk-wahl-zeile:has(input:focus-visible) { outline: 2px solid var(--akzent); outline-offset: -2px; }
.bk-wahl-haken { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; color: transparent; }
.bk-wahl-haken .ic { width: 16px; height: 16px; }
.bk-wahl-zeile.gewaehlt .bk-wahl-haken { color: var(--text); }
.bk-wahl-zeile.gewaehlt .bk-karte-titel { font-weight: 600; }
.bk-wahl-liste.zu .bk-wahl-zeile { cursor: default; }
@media (hover: hover) { .bk-wahl-liste.zu .bk-wahl-zeile:hover { background: none; } }
.bk-feld > .bk-wahl-aendern { justify-self: start; margin-left: -10px; }
.bk-wahl-aendern .ic { width: 15px; height: 15px; }
.bk-zeile-zwei { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.bk-zeile-zwei > .bk-feld { flex: 1 1 200px; }
.bk-zeile-zwei > .bk-feld-schmal { flex: 0 1 150px; }
.bk-unter { display: block; margin-top: -10px; color: var(--text-3); font-size: 12px; line-height: 1.4; }
.bk-info-zeile { margin: 0; font-size: 13.5px; line-height: 1.45; }
.bk-info-zeile.leise { color: var(--text-2); }
.bk-link-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bk-link { flex: 1 1 200px; min-width: 0; min-height: var(--bk-ziel); display: flex; align-items: center; padding: 0 12px; border-radius: var(--rund-klein); background: var(--flaeche); font: 500 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; user-select: all; }
.bk-link.leer { color: var(--text-3); user-select: none; }
.bk-link-zeile .knopf { min-height: var(--bk-ziel); height: auto; }
.bk-ziel { display: flex; align-items: center; gap: 8px; margin: -6px 0 0; }
.bk-ziel .ic { width: 14px; height: 14px; flex: none; }

/* Reihenfolge an der Regelkarte */
.bk-rang-kopf { margin: -4px 0 12px; max-width: 70ch; }
.bk-rang { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding-top: 8px; border-top: var(--haar) solid var(--linie); }
.bk-rang-platz { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.bk-rang-knoepfe { display: inline-flex; margin-left: auto; }
.bk-rang-knoepfe .icon-knopf { width: 44px; height: 44px; }
.bk-rang-knoepfe .icon-knopf:disabled { opacity: .3; cursor: default; }
@media (hover: hover) { .bk-rang-knoepfe .icon-knopf:disabled:hover { background: none; } }
.bk-rang-knoepfe .ic { width: 17px; height: 17px; }
.bk-rang-gleich { flex-basis: 100%; display: flex; gap: 8px; align-items: flex-start; margin: 0 0 4px; color: var(--sand-t); line-height: 1.4; }
.bk-rang-gleich .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--sonne-p); }

/* Vorschau: wie der Ablauf beginnt (ig.me-Link, von Hand, aus einem Ablauf) */
.bkv-start { cursor: default; margin-top: 4px; }

/* B3e: KI als Vorschlag. Knopf "Text verbessern" mit Menü, Absichten des Auslösers, Block KI-Vorschlag, Vorschau.
   Ruhig wie die übrigen Panels: Sand für KI, keine Verläufe, keine Pillen-Wolken. */
.ki-knopf-box { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.bk-var.ki-knopf { display: inline-flex; align-items: center; gap: 5px; color: var(--sand-t); }
.bk-var.ki-knopf::before { content: none; }
.ki-knopf .ic, .ki-knopf-kurz .ic { width: 14px; height: 14px; }
.ki-knopf-kurz { color: var(--sand-t); }
[data-ki-knopf]:disabled { color: var(--text-3); cursor: not-allowed; opacity: .75; }
.ki-grund { color: var(--text-3); font-size: 12px; line-height: 1.35; }
.ki-grund[hidden] { display: none; }
.ki-menue { display: grid; gap: 8px; margin: 6px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--grund); border: var(--haar) solid var(--linie-stark); box-shadow: inset 3px 0 0 var(--sand-p); min-width: 0; }
.ki-menue-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.ki-menue-kopf .icon-knopf { width: 28px; height: 28px; }
.ki-arten { display: flex; flex-wrap: wrap; gap: 6px; }
.ki-arten .knopf.klein { min-height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.ki-leise { color: var(--text-3); font-size: 12px; line-height: 1.4; }
.ki-fehler { color: var(--koralle-t); font-size: 13px; }
.ki-vorschlag { display: grid; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--flaeche); min-width: 0; }
.ki-vorschlag p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.45; }
.ki-vorschlag-fuss { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ki-vorschlag-fuss .knopf.klein { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 6px; }

.bk-absichten { display: grid; gap: 8px; }
.bk-absicht { display: grid; gap: 6px; padding: 8px; border-radius: 8px; background: var(--flaeche); min-width: 0; }
.bk-absicht-kopf { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bk-absicht-kopf .feld { flex: 1; min-width: 0; font-weight: 600; }
.bk-absicht-nr { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--sand-g); color: var(--sand-t); font-size: 12px; font-weight: 600; }
.bk-ki-aus { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--sand-g); color: var(--sand-t); font-size: 13px; line-height: 1.4; }
.bk-ki-aus .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.bk-ki-ablauf { padding: 10px 12px; border-radius: 8px; background: var(--flaeche); font-size: 13px; line-height: 1.45; color: var(--text-2); }
.bk-ki-ablauf ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.bk-ki-zweige { margin-left: 12px; }
.bkv-ki-text { display: grid; gap: 4px; }
.bkv-bot-zeile { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .2px; color: var(--sand-t); }
.bk-haken-gesperrt { cursor: default; }
.bk-haken-gesperrt input:disabled { opacity: .7; }
