/* Einstellungen der eigenen Automationen (Nachbau B2d, static/automation-einstellungen.js).
   Raster wie ManyChat: Unternavigation 196, Kopf 60, Rundungen 6/4/10, Knöpfe 36, Zeilen 44; Farben nur aus den
   Variablen der App (hell und dunkel über data-theme). */

/* Reiter der Automationen: fünf Reiter, am Handy waagerecht wischbar statt umbrechen */
.reiter-zeile.auto-reiter { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.reiter-zeile.auto-reiter::-webkit-scrollbar { display: none; }
.reiter-zeile.auto-reiter a { white-space: nowrap; flex: none; }

.ae, .ae-dialog, .ae-pop { --ae-r: 6px; --ae-r-klein: 4px; --ae-r-gross: 10px; --ae-zeile: 44px; }
.ae { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 32px; align-items: start; min-width: 0; }
/* B3f: Rundungen wie ManyChat 6 (Knöpfe, Felder), 4 (klein), 10 (Karten, Dialoge) statt der 12 der App */
.ae .knopf, .ae .icon-knopf, .ae-dialog .knopf, .ae .ae-wahl, .ae .ae-eingabe { border-radius: var(--ae-r); }
.ae .text-knopf { border-radius: var(--ae-r-klein); }
.ae.ae-ohne-nav { grid-template-columns: minmax(0, 1fr); }
.ae-inhalt { min-width: 0; display: grid; gap: 16px; align-content: start; }
.ae-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Unternavigation wie ManyChat (196 breit, aktive Zeile grau, 36 hoch) */
.ae-unternav { display: grid; gap: 2px; position: sticky; top: 16px; }
.ae-unternav a { display: flex; align-items: center; height: 36px; padding: 0 10px; border-radius: var(--ae-r); color: var(--text-2); font-size: var(--sg-14); font-weight: 500; text-decoration: none; }
.ae-unternav a[aria-current="page"] { background: var(--flaeche-2); color: var(--text); }
@media (hover: hover) { .ae-unternav a:hover { background: var(--flaeche); color: var(--text); text-decoration: none; } }

/* Kopf je Seite: Titel links, Steuerung rechts (60 hoch) */
.ae-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; min-height: 44px; flex-wrap: wrap; }
.ae-kopf-titel { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ae-kopf h2 { font: 600 var(--sg-20)/1.3 var(--schrift-marke); }
.ae-brot { color: var(--text-2); font-size: var(--sg-14); text-decoration: none; }
.ae-brot-pfeil { color: var(--text-3); }
.ae-kopf-rechts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.ae-knopf { height: 36px; border-radius: var(--ae-r); gap: 8px; }
.ae-knopf .ic { width: 16px; height: 16px; }
.ae-speicher { min-width: 84px; text-align: right; }
.ae-speicher[data-art="ok"]::before { content: "✓ "; color: var(--salbei-p); }
.ae-speicher[data-art="fehler"] { color: var(--koralle-t); min-width: 0; }

/* Umschalter Konto und Zeitraum */
.ae-segment { display: inline-flex; padding: 2px; border-radius: var(--ae-r); background: var(--flaeche-2); gap: 2px; flex: none; }
.ae-segment button { height: 32px; padding: 0 12px; border-radius: var(--ae-r-klein); color: var(--text-2); font-size: var(--sg-13); font-weight: 500; white-space: nowrap; }
.ae-segment button[aria-pressed="true"] { background: var(--grund); color: var(--text); box-shadow: var(--schatten-klein); }

.ae-info { padding: 10px 14px; border-radius: var(--ae-r); background: var(--meer-g); color: var(--meer-t); font-size: var(--sg-13); }
.ae-erklaer { margin-top: 4px; max-width: 640px; }
.ae-erklaer-oben { max-width: 640px; margin-top: -6px; }

/* Karte (weiß, Rand, r10) */
.ae-karte { background: var(--grund); border: var(--haar) solid var(--linie-stark); border-radius: var(--ae-r-gross); padding: 8px 16px; min-width: 0; }

/* Etiketten Live / Entwurf / Aus (Lozenge 12/16, r4) */
.ae-loz { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--ae-r-klein); font-size: var(--sg-12); font-weight: 500; letter-spacing: .2px; white-space: nowrap; flex: none;
  border: var(--haar) solid transparent; }
.ae-loz-live { background: var(--salbei-g); color: var(--salbei-t); border-color: color-mix(in oklab, var(--salbei-p) 55%, transparent); }
.ae-loz-entwurf { background: var(--sonne-g); color: var(--sonne-t); border-color: color-mix(in oklab, var(--sonne-p) 50%, transparent); }
.ae-loz-probe { background: var(--meer-g); color: var(--meer-t); border-color: color-mix(in oklab, var(--meer-p) 45%, transparent); }
.ae-loz-aus { background: var(--flaeche); color: var(--text-2); border-color: var(--linie-stark); }
.ae-loz-punkt { width: 6px; height: 6px; border-radius: 50%; background: var(--salbei-p); }

/* Basic Automations: eine Karte mit Zeilen */
.ae-basics { padding: 0 16px; }
.ae-basic-zeile { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: var(--haar) solid var(--linie); color: var(--text); text-decoration: none; min-width: 0; }
.ae-basic-zeile:last-child { border-bottom: 0; }
a.ae-basic-zeile:hover { text-decoration: none; }
@media (hover: hover) { a.ae-basic-zeile:hover .ae-basic-titel { text-decoration: underline; text-underline-offset: 3px; } }
.ae-rund-ic { width: 28px; height: 28px; border-radius: 50%; background: var(--flaeche); color: var(--text-2); display: grid; place-items: center; flex: none; }
.ae-rund-ic .ic { width: 15px; height: 15px; }
.ae-basic-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ae-basic-titel { font-size: var(--sg-15); font-weight: 500; }
.ae-pfeil { color: var(--text-3); display: grid; }
.ae-pfeil .ic { width: 16px; height: 16px; }
.ae-basic-leer { align-items: flex-start; }

/* Gesprächsstarter und Menü: Liste links, Handy rechts */
.ae-zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr) 304px; gap: 40px; align-items: start; }
.ae-spalte { min-width: 0; display: grid; gap: 8px; align-content: start; }
.ae-zustand-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.ae-spaltenkopf { display: flex; justify-content: space-between; padding: 0 2px; color: var(--text-2); font-size: var(--sg-13); font-weight: 500; }
.ae-liste { list-style: none; display: grid; gap: 8px; padding: 0; margin: 0; }
.ae-zeile { background: var(--grund); border: var(--haar) solid var(--linie-stark); border-radius: var(--ae-r); padding: 4px 4px 4px 10px; }
.ae-zeile:focus-within { border-color: var(--text-3); box-shadow: 0 0 0 3px color-mix(in oklab, var(--akzent) 18%, transparent); }
.ae-zeile-haupt { display: flex; align-items: center; gap: 8px; min-height: 36px; min-width: 0; }
.ae-nr { width: 16px; font-size: var(--sg-12); text-align: center; flex: none; font-variant-numeric: tabular-nums; }
.ae-text-feld { position: relative; flex: 1 1 200px; min-width: 0; display: flex; align-items: center; }
.ae-eingabe { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border-radius: var(--ae-r); border: var(--haar) solid var(--linie-stark); background: var(--grund); color: var(--text); font: inherit; font-size: var(--sg-14); }
.ae-eingabe:focus { outline: none; border-color: var(--text-3); }
.ae-inline { border-color: transparent; background: transparent; padding-right: 36px; }
.ae-inline:hover { background: var(--flaeche); }
.ae-inline:focus { background: var(--flaeche); border-color: transparent; }
.ae-rest { position: absolute; right: 8px; font-size: var(--sg-12); color: var(--text-3); font-variant-numeric: tabular-nums; pointer-events: none; }
.ae-rest.knapp { color: var(--sonne-t); }
.ae-rest.zu-lang { color: var(--koralle-t); font-weight: 600; }
.ae-wahl { height: 36px; max-width: 100%; padding: 0 28px 0 10px; border-radius: var(--ae-r); border: var(--haar) solid var(--linie-stark); background: var(--grund); color: var(--text); font: inherit; font-size: var(--sg-13); }
.ae-zeile .ae-wahl { flex: 0 1 210px; min-width: 120px; }
.ae-menue-aktion { display: flex; gap: 6px; flex: 0 1 380px; min-width: 0; }
.ae-menue-aktion .ae-wahl, .ae-menue-aktion .ae-url { flex: 1 1 50%; min-width: 0; }
.ae-zeile-knoepfe { display: flex; flex: none; }
.ae-zeile-knoepfe .icon-knopf { width: 30px; height: 30px; }
.ae-zeile-knoepfe .icon-knopf .ic { width: 15px; height: 15px; }
.ae-zeile-knoepfe .icon-knopf:disabled { opacity: .3; }
.ae-hinweis { margin: 4px 0 4px 24px; padding: 6px 10px; border-radius: var(--ae-r-klein); background: var(--sand-g); color: var(--sand-t); }
.ae-hinweis-zeile { margin: 0; list-style: none; }
.ae-leer { padding: 14px 4px; }
.ae-neu { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: var(--ae-r); border: 1px dashed var(--linie-stark); color: var(--text-2); font-weight: 500; font-size: var(--sg-14); background: transparent; }
.ae-neu .ic { width: 16px; height: 16px; }
@media (hover: hover) { .ae-neu:hover:not(:disabled) { border-color: var(--text-3); color: var(--text); background: var(--flaeche); } }
.ae-neu:disabled { opacity: .45; cursor: not-allowed; }

/* Stand bei Instagram (nur lesen) */
.ae-meta { margin-top: 12px; padding-top: 14px; border-top: var(--haar) solid var(--linie); display: grid; gap: 8px; justify-items: start; }
.ae-meta-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; flex-wrap: wrap; }
.ae-meta-titel { font-weight: 500; font-size: var(--sg-14); }
.ae-meta-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ae-meta-liste li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--rund-voll); background: var(--flaeche); font-size: var(--sg-13); color: var(--text-2); }
.ae-meta-liste .ic { width: 13px; height: 13px; }

/* Handy-Vorschau 304 x 632, innen r32, außen r42, Instagram-Look im Thema der App */
.ae-vorschau-spalte { position: sticky; top: 16px; display: grid; gap: 10px; justify-items: center; }
.ae-handy { width: 304px; height: 632px; padding: 10px; border-radius: 42px; background: var(--tinte); box-shadow: var(--schatten); }
.ae-handy-innen { position: relative; height: 100%; border-radius: 32px; overflow: hidden; background: var(--grund); color: var(--text); display: flex; flex-direction: column; font-size: 13px; }
.ae-ig-kopf { display: flex; align-items: center; gap: 8px; padding: 34px 14px 10px; border-bottom: var(--haar) solid var(--linie); }
.ae-ig-kopf img { border-radius: 50%; object-fit: cover; }
.ae-ig-zurueck .ic, .ae-ig-ics .ic { width: 18px; height: 18px; }
.ae-ig-name { flex: 1; font-weight: 600; font-size: 13px; }
.ae-ig-profil { display: grid; justify-items: center; gap: 4px; padding: 26px 0 10px; }
.ae-ig-profil img { border-radius: 50%; object-fit: cover; }
.ae-ig-profil b { font-size: 14px; }
.ae-ig-profil span { color: var(--text-3); font-size: 12px; }
.ae-ig-starter { margin-top: auto; display: grid; gap: 8px; padding: 10px 14px; justify-items: center; }
.ae-ig-pille { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 8px 14px; border-radius: 18px; background: var(--flaeche-2); color: var(--meer-t); font-size: 12.5px; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.ae-ig-starter .ae-ig-pille { width: 100%; justify-content: center; }
.ae-ig-pille .ic { width: 12px; height: 12px; flex: none; }
.ae-ig-leer { color: var(--text-3); font-size: 12px; padding: 8px; }
.ae-ig-blatt { margin-top: auto; display: grid; gap: 6px; justify-items: center; padding: 10px 16px 14px; border-radius: 18px 18px 0 0; background: var(--flaeche); box-shadow: 0 -1px 0 var(--linie); }
.ae-ig-griff { width: 36px; height: 4px; border-radius: 2px; background: var(--linie-stark); margin-bottom: 6px; }
.ae-ig-blatt b { font-size: 16px; }
.ae-ig-blatt-unter { color: var(--text-2); font-size: 11.5px; text-align: center; margin-bottom: 4px; }
.ae-ig-pillen { display: grid; gap: 7px; justify-items: center; max-height: 250px; overflow: hidden; }
.ae-ig-blatt .ae-ig-pille { background: var(--flaeche-2); }
.ae-ig-eingabe { display: flex; align-items: center; gap: 8px; margin: 8px 12px 18px; height: 38px; padding: 0 6px; border-radius: 19px; background: var(--flaeche); color: var(--text-3); font-size: 12.5px; }
.ae-ig-kamera { width: 26px; height: 26px; border-radius: 50%; background: var(--meer-p); }
.ae-vorschau-text { text-align: center; }

/* Regeln (Standardantwort, Keywords) als Karten-Zeilen wie ManyChat Keywords */
.ae-regeln { display: grid; gap: 10px; }
.ae-regel { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 72px; }
.ae-reihe { display: flex; flex-direction: column; align-items: center; flex: none; margin: -8px 0; }
.ae-reihe .icon-knopf { width: 26px; height: 22px; }
.ae-reihe .icon-knopf .ic { width: 14px; height: 14px; }
.ae-reihe .icon-knopf:disabled { opacity: .25; }
.ae-prio { font-size: var(--sg-12); color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.ae-regel-mitte { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ae-regel-text { color: var(--text-2); font-size: var(--sg-13); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-regel-kanal { color: var(--koralle-p); display: grid; flex: none; }
.ae-regel-kanal .ic { width: 16px; height: 16px; }
.ae-regel-ziel { flex: 0 1 220px; min-width: 0; font-size: var(--sg-14); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-regel-ziel a { color: var(--text); text-decoration: underline; text-decoration-color: var(--linie-stark); text-underline-offset: 4px; }
.ae-kw-regel { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ae-kw-modus { color: var(--text-2); font-size: var(--sg-15); margin-right: 2px; }
.ae-pille { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 18px; border: var(--haar) solid var(--linie-stark); color: var(--text-2); font-size: var(--sg-13); letter-spacing: .3px; }
.ae-kw-kopf { display: grid; grid-template-columns: 44px 52px minmax(0, 1fr) 40px 220px 120px; gap: 14px; padding: 0 16px; color: var(--text-2); font-size: var(--sg-12); font-weight: 500; }
.ae-kw-neu { display: grid; gap: 10px; padding: 16px; border-style: dashed; }
.ae-kw-neu h3 { font-size: var(--sg-15); font-weight: 600; }
.ae-kw-neu-zeile { display: flex; gap: 8px; flex-wrap: wrap; }
.ae-kw-neu-zeile .ae-eingabe { flex: 1 1 220px; }
.ae-leer-karte { display: grid; gap: 8px; justify-items: start; padding: 20px; }

/* Tags und Felder: Tabelle wie ManyChat (Kopf 20/32, Zeilen 45, Inline-Eingabe ohne sichtbaren Rand) */
.ae-unterreiter { display: flex; align-items: center; gap: 20px; border-bottom: var(--haar) solid var(--linie); flex-wrap: wrap; }
.ae-unterreiter button[role="tab"] { height: 40px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 500; font-size: var(--sg-14); }
.ae-unterreiter button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.ae-suche { margin-left: auto; position: relative; display: flex; align-items: center; width: 250px; max-width: 100%; margin-bottom: 6px; }
.ae-suche .ic { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.ae-suche input { width: 100%; height: 36px; padding: 0 12px 0 34px; border-radius: var(--ae-r); border: var(--haar) solid var(--linie-stark); background: var(--grund); color: var(--text); font: inherit; font-size: var(--sg-14); }
.ae-tabelle-karte { padding: 0; overflow: hidden; }
.ae-tabelle-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: var(--haar) solid var(--linie); flex-wrap: wrap; }
.ae-tabelle-kopf h3 { font: 600 var(--sg-20)/1.6 var(--schrift-marke); }
.ae-tz { display: grid; grid-template-columns: minmax(150px, 1.1fr) 140px minmax(0, 2fr) 44px; gap: 12px; align-items: center; min-height: 45px; padding: 4px 20px; border-bottom: var(--haar) solid var(--linie); }
.ae-tz:last-child { border-bottom: 0; }
.ae-tz-kopf { min-height: 40px; color: var(--text-2); font-size: var(--sg-13); font-weight: 500; background: var(--flaeche); }
@media (hover: hover) { .ae-tz:not(.ae-tz-kopf):hover { background: var(--flaeche); } }
.ae-tz .ae-inline { padding-right: 10px; height: 34px; margin-left: -10px; width: calc(100% + 10px); }
.ae-tz-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ae-feldname { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--sg-13); }
.ae-tz-name .ae-inline { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--sg-13); }
.ae-inline-wahl { border-color: transparent; background-color: transparent; }
.ae-inline-wahl:hover, .ae-inline-wahl:focus { border-color: var(--linie-stark); }
.ae-tz-beschr { min-width: 0; font-size: var(--sg-13); }
.ae-tz-beschr > .leise { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-tz-akt { display: flex; justify-content: flex-end; }
.ae-tags .ae-tz { grid-template-columns: minmax(0, 1fr) 140px 90px; }
.ae-tag-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--sg-14); }
.ae-tag-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--p); flex: none; }
.ae-rechts { text-align: right; justify-self: end; }
.ae-zahl { font-variant-numeric: tabular-nums; }
.ae-feld-form { display: grid; grid-template-columns: minmax(140px, 1fr) 140px minmax(0, 2fr) auto; gap: 8px; padding: 14px 20px; border-bottom: var(--haar) solid var(--linie); background: var(--flaeche); align-items: center; }
.ae-feld-form[hidden] { display: none; }
.ae-feld-form p { grid-column: 1 / -1; }
.ae-feld-form-knoepfe { display: flex; gap: 6px; }

/* Auswertung: Kacheln und Flächendiagramm */
.ae-kacheln { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.ae-kachel { display: grid; gap: 4px; padding: 16px; border-radius: var(--ae-r-gross); background: var(--grund); border: var(--haar) solid var(--linie-stark); min-width: 0; }
.ae-kachel-titel { font-size: var(--sg-13); color: var(--text-2); }
.ae-kachel-zahl { font: 600 var(--sg-24)/1.4 var(--schrift-marke); font-variant-numeric: tabular-nums; }
.ae-diagramm-karte { padding: 16px 16px 10px; display: grid; gap: 8px; }
.ae-diagramm-kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ae-kennzahl-wahl .ae-wahl { font-weight: 600; font-size: var(--sg-15); border-color: transparent; padding-left: 4px; }
.ae-diagramm { position: relative; min-width: 0; }
.ae-svg { display: block; max-width: 100%; overflow: visible; touch-action: pan-y; }
.ae-gitter { stroke: var(--linie); stroke-width: 1; }
.ae-achse, .ae-achse text { fill: var(--text-3); font-size: 11px; font-family: var(--schrift); font-variant-numeric: tabular-nums; }
.ae-linie { fill: none; stroke: var(--meer-p); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ae-stop-oben { stop-color: var(--meer-p); stop-opacity: .22; }
.ae-stop-unten { stop-color: var(--meer-p); stop-opacity: .02; }
.ae-punkt { fill: var(--grund); stroke: var(--meer-p); stroke-width: 1.5; }
.ae-hover-linie { stroke: var(--linie-stark); stroke-width: 1; }
.ae-hover-punkt { fill: var(--meer-p); stroke: var(--grund); stroke-width: 2; }
.ae-tip { position: absolute; top: 0; transform: translateX(-50%); display: grid; gap: 1px; padding: 6px 10px; border-radius: var(--ae-r); background: var(--tinte); color: var(--tinte-text); font-size: var(--sg-12); pointer-events: none; white-space: nowrap; }
.ae-tip span { opacity: .75; }

/* Eigener Dialog */
.ae-dialog { max-width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--ae-r-gross); background: var(--grund); color: var(--text); box-shadow: var(--schatten); }
.ae-dialog::backdrop { background: rgb(13 16 22 / .38); }
.ae-dialog form { display: grid; gap: 12px; padding: 22px; }
.ae-dialog h2 { font: 600 var(--sg-16)/1.35 var(--schrift-marke); }
.ae-dialog p { color: var(--text-2); font-size: var(--sg-14); line-height: 1.5; }
.ae-dialog-knoepfe { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.knopf.ae-gefahr { background: var(--koralle-p); border-color: var(--koralle-p); color: #fff; }
.ae-dialog .ae-eingabe { margin-top: 2px; }

/* ---------- Teil B3f ---------- */

/* Standardantwort: Takt und Story-Schalter unter der Regel-Zeile, als eine Karte */
.ae-std-block { display: grid; }
.ae-std-block > .ae-regel { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ae-std-optionen { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 40px; padding: 14px 16px 16px 66px; margin-top: calc(-1 * var(--haar));
  background: var(--flaeche); border: var(--haar) solid var(--linie-stark); border-radius: 0 0 var(--ae-r-gross) var(--ae-r-gross); }
.ae-takt { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.ae-takt legend, .ae-std-story .schalter-text { font-size: var(--sg-13); font-weight: 500; color: var(--text); padding: 0; margin-bottom: 4px; }
.ae-radio { display: flex; align-items: center; gap: 8px; font-size: var(--sg-14); cursor: pointer; min-height: 24px; }
.ae-radio input { width: 16px; height: 16px; margin: 0; accent-color: var(--tinte); }
.ae-std-story { display: grid; gap: 6px; max-width: 340px; padding-top: 2px; }

/* Klickzahl je Gesprächsstarter in der Zeile */
.ae-klicks { flex: none; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ae-klicks:empty { min-width: 0; }

/* Eigene Tags: Kopf mit Konto und Neu, Ordnerleiste, Ordner als Zeile, Tags darin eingerückt */
.ae-tabelle-kopf .ae-kopf-rechts { gap: 10px; }
.ae-tag-form { grid-template-columns: minmax(160px, 1.4fr) minmax(120px, 1fr) 130px auto; }
.ae-ordner-leiste { padding: 14px 20px; border-bottom: var(--haar) solid var(--linie); display: flex; }
.ae-ordner-neu { width: 262px; max-width: 100%; height: 42px; justify-content: flex-start; padding: 0 14px; border-radius: var(--ae-r-gross); }
.ae-ordner-neu[hidden] { display: none; }
.ae-ordner-form { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.ae-ordner-form[hidden] { display: none; }
.ae-ordner-form .ae-eingabe { flex: 1 1 200px; max-width: 320px; }
.ae-tags-eigen .ae-tz, .ae-tags-eigen .ae-tz-kopf { grid-template-columns: minmax(0, 1fr) 110px 44px; }
.ae-ordner-zeile { background: color-mix(in oklab, var(--flaeche) 60%, transparent); }
.ae-ordner-zeile .ae-tag-name { gap: 10px; }
.ae-ordner-zeile .ic { width: 16px; height: 16px; color: var(--text-2); flex: none; }
.ae-ordner-zeile b { font-weight: 600; font-size: var(--sg-14); }
.ae-im-ordner .ae-tag-name { padding-left: 26px; }
.ae-tag-zeile .ae-inline { font-family: inherit; font-size: var(--sg-14); margin-left: -6px; width: calc(100% + 6px); padding-left: 6px; }
.ae-mc-tags .ae-tabelle-kopf { justify-content: flex-start; }
.ae-mc-hinweis { padding: 10px 20px; border-bottom: var(--haar) solid var(--linie); }

/* Menü am Knopf (Kebab) */
.ae-pop { position: fixed; z-index: 60; min-width: 200px; max-width: min(280px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); overflow: auto;
  padding: 6px; border-radius: var(--ae-r-gross); background: var(--grund); border: var(--haar) solid var(--linie-stark); box-shadow: var(--schatten); }
.ae-pop-zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border-radius: var(--ae-r); font-size: var(--sg-14); text-align: left; color: var(--text); }
.ae-pop-zeile .ic { width: 15px; height: 15px; color: var(--text-2); }
@media (hover: hover) { .ae-pop-zeile:hover { background: var(--flaeche); } }
.ae-pop-zeile:focus-visible { background: var(--flaeche); outline: none; }
.ae-pop-gefahr { color: var(--koralle-t); }
.ae-pop-titel { padding: 8px 10px 4px; font-size: var(--sg-12); font-weight: 500; color: var(--text-3); }
.ae-pop-trenner { border: 0; border-top: var(--haar) solid var(--linie); margin: 6px 0; }
.ae-pop-farben { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px 6px 4px; }
.ae-pop-farben button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--ae-r); }
.ae-pop-farben button[aria-checked="true"] { box-shadow: inset 0 0 0 1.5px var(--text-2); }
.ae-pop-farben .ae-tag-punkt { width: 12px; height: 12px; }
@media (hover: hover) { .ae-pop-farben button:hover { background: var(--flaeche); } }

/* Broadcast */
.ae-bc-regel { line-height: 1.5; max-width: 860px; }
.ae-bc-karte { display: grid; gap: 12px; padding: 18px 20px 20px; justify-items: start; }
.ae-bc-karte > * { max-width: 100%; }
.ae-bc-schritt { display: flex; align-items: center; gap: 10px; font-size: var(--sg-15); font-weight: 600; margin-top: 4px; }
.ae-bc-schritt span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--flaeche-2); font-size: var(--sg-12); color: var(--text-2); }
.ae-bc-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ae-bc-filter .ae-wahl { min-width: 160px; }
.ae-bc-filter .ae-eingabe { width: 280px; max-width: 100%; }
.ae-bc-gleich { color: var(--text-3); font-weight: 600; }
.ae-bc-zahl { display: grid; gap: 8px; width: min(560px, 100%); padding: 12px 14px; border-radius: var(--ae-r); background: var(--flaeche); font-size: var(--sg-14); line-height: 1.5; min-height: 46px; align-content: center; }
.ae-bc-balken { height: 6px; border-radius: 3px; background: var(--flaeche-2); overflow: hidden; }
.ae-bc-balken span { display: block; height: 100%; border-radius: 3px; background: var(--salbei-p); }
.ae-bc-regel-wahl { min-width: 280px; }
.ae-bc-los { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.ae-bc-tabelle .ae-tz { grid-template-columns: 130px minmax(0, 1fr) 90px 110px 90px; }
.ae-bc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Antworten */
.ae-aw-steuer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ae-aw-steuer .ae-suche { margin: 0; width: 260px; }
.ae-aw-steuer [data-ae-aw-csv] { margin-left: auto; }
.ae-aw-scroll { overflow-x: auto; }
.ae-aw-tabelle { width: 100%; border-collapse: collapse; font-size: var(--sg-14); }
.ae-aw-tabelle th { text-align: left; font-size: var(--sg-13); font-weight: 500; color: var(--text-2); background: var(--flaeche); padding: 10px 20px; white-space: nowrap; }
.ae-aw-tabelle td { padding: 11px 20px; border-top: var(--haar) solid var(--linie); white-space: nowrap; }
.ae-aw-tabelle td a { color: var(--text); text-decoration: underline; text-decoration-color: var(--linie-stark); text-underline-offset: 4px; }
@media (hover: hover) { .ae-aw-tabelle tbody tr:hover { background: var(--flaeche); } }
.ae-aw-fuss, .ae-tabelle-fuss { padding: 10px 20px; border-top: var(--haar) solid var(--linie); }

/* Auswertung: Bestenliste und Gesprächsstarter */
.ae-bestenliste .ae-tz { grid-template-columns: minmax(0, 1fr) 70px 90px 84px 64px 84px; }
/* B4b: Bestenliste je Beitrag */
.ae-beitraege .ae-tz { grid-template-columns: minmax(0, 1fr) 76px 70px 84px 64px 84px; min-height: 64px; }
.ae-bb-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ae-bb-bild, .ae-bb-ohne { width: 40px; height: 50px; border-radius: var(--ae-r-klein); flex: none; object-fit: cover; background: var(--flaeche-2); }
.ae-bb-ohne { display: grid; place-items: center; color: var(--text-3); }
.ae-bb-ohne .ic { width: 18px; height: 18px; }
.ae-bb-text { display: grid; gap: 2px; min-width: 0; }
.ae-bb-titel, .ae-bb-text > .leise { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-bb-probe { display: block; }
/* B4b: Bot-Felder */
.ae-botfelder .ae-tz { grid-template-columns: minmax(150px, 1fr) minmax(0, 1.4fr) minmax(0, 1.4fr) 44px; }
.ae-bf-form { grid-template-columns: minmax(140px, 1fr) minmax(0, 1.4fr) minmax(0, 1.4fr) auto; }
.ae-bf-name { display: grid; gap: 2px; min-width: 0; }
.ae-bf-name .ae-feldname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-bf-var { font-family: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-botfelder .ae-tz-beschr { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ae-botfelder .ae-tz-beschr .ae-inline { flex: 1 1 auto; min-width: 0; }
.ae-bf-stand { flex: none; white-space: nowrap; }
.ae-bf-form code { font-family: inherit; font-weight: 600; color: var(--text); }
.ae-bl-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ae-bl-name > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-bl-platz { width: 22px; height: 22px; border-radius: var(--ae-r-klein); display: grid; place-items: center; flex: none; background: var(--flaeche-2); font-size: var(--sg-12); font-weight: 600; color: var(--text-2); }
.ae-starter-klicks { padding: 0 20px 14px; }
.ae-tabelle-kopf.ae-ohne-linie { border-bottom: 0; padding-left: 0; padding-right: 0; }
.ae-sk-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ae-sk-liste li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) 84px; align-items: center; gap: 14px; font-size: var(--sg-14); }
.ae-sk-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-sk-balken { height: 8px; border-radius: 4px; background: var(--flaeche-2); overflow: hidden; }
.ae-sk-balken span { display: block; height: 100%; border-radius: 4px; background: var(--meer-p); }
.ae-sk-zahl { text-align: right; color: var(--text-2); font-size: var(--sg-13); white-space: nowrap; }

/* Mittlere Breite: Kacheln in drei Spalten, Keyword-Kopf aus */
@media (max-width: 1180px) {
  .ae-kacheln { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ae-kw-kopf { display: none; }
}
@media (max-width: 1080px) {
  .ae-zweispaltig { grid-template-columns: minmax(0, 1fr); }
  .ae-vorschau-spalte { position: static; }
}
/* Ohne Platz für die Unternavigation: waagerechte Leiste wie die ManyChat-App */
@media (max-width: 979px) {
  .ae { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ae-unternav { position: static; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -8px 0 0; padding-bottom: 2px; }
  .ae-unternav::-webkit-scrollbar { display: none; }
  .ae-unternav a { flex: none; height: 32px; padding: 0 12px; border-radius: var(--rund-voll); background: var(--flaeche); font-size: var(--sg-13); }
  .ae-unternav a[aria-current="page"] { background: var(--tinte); color: var(--tinte-text); }
  /* Regel-Karte als Raster: oben Schalter und Regel, darunter Kanal, Ziel, Zustand, Bearbeiten */
  .ae-regel { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 8px 12px;
    grid-template-areas: "reihe schalter mitte mitte mitte" "reihe kanal ziel loz stift"; align-items: center; }
  .ae-regel:not(:has(> .ae-reihe)) { grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "schalter mitte mitte mitte" "kanal ziel loz stift"; }
  .ae-regel > .ae-reihe { grid-area: reihe; margin: 0; }
  .ae-regel > .schalter { grid-area: schalter; }
  .ae-regel > .ae-regel-mitte { grid-area: mitte; }
  .ae-regel > .ae-regel-kanal { grid-area: kanal; justify-self: center; }
  .ae-regel > .ae-regel-ziel { grid-area: ziel; }
  .ae-regel > .ae-loz { grid-area: loz; }
  .ae-regel > .icon-knopf { grid-area: stift; }
}
/* Handy */
@media (max-width: 759px) {
  .ae-kopf { align-items: flex-start; }
  .ae-kopf-rechts { justify-content: flex-start; width: 100%; }
  .ae-speicher { min-width: 0; text-align: left; flex: 1; }
  .ae-kopf-rechts .ae-knopf[data-ae-uebertragen] { width: 100%; justify-content: center; }
  .ae-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ae-kachel { padding: 12px 14px; }
  .ae-kachel-zahl { font-size: var(--sg-20); }
  .ae-basic-zeile { flex-wrap: wrap; }
  .ae-basic-text { flex-basis: calc(100% - 44px); }
  .ae-basic-zeile .ae-loz { margin-left: 40px; }
  .ae-basic-leer .knopf { margin-left: 40px; }
  .ae-pfeil { margin-left: auto; }
  .ae-zeile-haupt { flex-wrap: wrap; }
  .ae-text-feld { flex-basis: calc(100% - 24px); }
  .ae-zeile .ae-wahl, .ae-menue-aktion { flex: 1 1 100%; margin-left: 24px; }
  .ae-menue-aktion { flex-wrap: wrap; }
  .ae-menue-aktion .ae-wahl { margin-left: 0; }
  .ae-zeile-knoepfe { margin-left: auto; }
  .ae-hinweis { margin-left: 0; }
  .ae-handy { width: min(304px, 100%); height: 560px; }
  .ae-regel { gap: 8px 10px; padding: 12px; }
  .ae-tz { grid-template-columns: minmax(0, 1fr) 110px 40px; padding: 6px 14px; }
  .ae-tz .ae-tz-beschr { grid-column: 1 / -1; grid-row: 2; }
  .ae-tz-kopf .ae-tz-beschr, .ae-tz-kopf span:nth-child(3) { display: none; }
  .ae-tz-kopf { grid-template-columns: minmax(0, 1fr) 110px 40px; }
  .ae-tags .ae-tz { grid-template-columns: minmax(0, 1fr) 90px 64px; }
  .ae-tags .ae-tz-kopf span:nth-child(3) { display: block; }
  .ae-feld-form { grid-template-columns: minmax(0, 1fr); }
  .ae-suche { width: 100%; margin-left: 0; }
  .ae-std-optionen { padding: 12px 14px 14px; }
  .ae-klicks { margin-left: 24px; min-width: 0; text-align: left; }
  .ae-tags-eigen .ae-tz, .ae-tags-eigen .ae-tz-kopf { grid-template-columns: minmax(0, 1fr) 90px 40px; }
  .ae-tabelle-kopf .ae-kopf-rechts { width: 100%; justify-content: space-between; }
  .ae-tag-form { grid-template-columns: minmax(0, 1fr); }
  .ae-ordner-leiste { padding: 12px 14px; }
  .ae-mc-hinweis { padding: 10px 14px; }
  .ae-bc-karte { padding: 16px 14px; }
  .ae-bc-filter .ae-wahl, .ae-bc-filter .ae-eingabe, .ae-bc-regel-wahl { width: 100%; min-width: 0; }
  .ae-bc-gleich { display: none; }
  .ae-bc-los .knopf { width: 100%; justify-content: center; }
  .ae-bc-tabelle .ae-tz { grid-template-columns: minmax(0, 1fr) 60px 64px; }
  .ae-bc-tabelle .ae-tz > :first-child, .ae-bc-tabelle .ae-tz > :last-child { display: none; }
  .ae-aw-steuer .ae-wahl, .ae-aw-steuer .ae-suche { width: 100%; }
  .ae-aw-steuer [data-ae-aw-csv] { margin-left: 0; width: 100%; justify-content: center; }
  .ae-aw-tabelle th, .ae-aw-tabelle td { padding-left: 14px; padding-right: 14px; }
  .ae-bestenliste .ae-tz { grid-template-columns: minmax(0, 1fr) 54px 74px 66px; }
  .ae-beitraege .ae-tz { grid-template-columns: minmax(0, 1fr) 48px 66px; }
  .ae-beitraege .ae-bb-klicks, .ae-bb-probe { display: none; }
  .ae-bb-bild, .ae-bb-ohne { width: 32px; height: 40px; }
  .ae-botfelder .ae-tz, .ae-botfelder .ae-tz-kopf { grid-template-columns: minmax(0, 1fr) 40px; }
  .ae-botfelder .ae-tz .ae-bf-wert { grid-column: 1 / -1; grid-row: 2; }
  .ae-botfelder .ae-tz .ae-tz-beschr { grid-column: 1 / -1; grid-row: 3; }
  .ae-botfelder .ae-tz-kopf > :nth-child(2), .ae-botfelder .ae-tz-kopf > :nth-child(3) { display: none; }
  .ae-botfelder .ae-tz-kopf > :last-child { grid-column: 2; grid-row: 1; }
  .ae-bf-form { grid-template-columns: minmax(0, 1fr); }
  .ae-bl-breit { display: none; }
  .ae-starter-klicks { padding: 0 14px 12px; }
  .ae-sk-liste li { grid-template-columns: minmax(0, 1fr) 70px; gap: 4px 12px; }
  .ae-sk-balken { grid-column: 1 / -1; grid-row: 2; }
  .ae-segment button { padding: 0 10px; }
}

/* B3e: Freigabe-Liste KI-Vorschläge, Stand und Deckel, Zähler, Protokoll und Kommentar-Antworten im Lead */
.ae-ki-status { justify-self: start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ae-ki-aus { background: var(--sand-g); color: var(--sand-t); }
.ae-ki-liste { display: grid; gap: 12px; }
.ae-ki-karte { display: grid; gap: 10px; padding: 14px 16px; }
.ae-ki-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.ae-ki-wer { display: grid; gap: 2px; min-width: 0; }
.ae-ki-herkunft { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: var(--sg-13); color: var(--text-2); }
.ae-ki-herkunft.ae-ki-auto { color: var(--salbei-t); }
.ae-ki-herkunft.ae-ki-rueck { color: var(--sand-t); }
.ae-ki-bot { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--ae-r-klein); background: var(--flaeche-2); color: var(--text-2); font-size: var(--sg-12); font-weight: 600; }
.ae-ki-nachricht { margin: 0; padding: 8px 12px; border-left: 3px solid var(--linie-stark); background: var(--flaeche); border-radius: 0 var(--ae-r) var(--ae-r) 0; }
.ae-ki-nachricht p { overflow-wrap: anywhere; }
.ae-ki-ziel { overflow-wrap: anywhere; }
.ae-ki-fehler { color: var(--koralle-t); overflow-wrap: anywhere; }
.ae-ki-fehler[hidden] { display: none; }
.ae-ki-grund { color: var(--text-2); overflow-wrap: anywhere; }
.ae-ki-feld { display: grid; gap: 6px; }
.ae-ki-text { min-height: 96px; resize: vertical; border-radius: var(--ae-r); }
.ae-ki-fertig { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.ae-ki-fuss { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.ae-ki-platz { flex: 1; }
.ae-ki-bytes.zu-lang, .ae-ki-fenster.zu { color: var(--koralle-t); }
.ae-ki-fenster.knapp { color: var(--sand-t); }
.ae-ki-stand { padding: 4px 16px; }
.ae-ki-zeile { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: var(--haar) solid var(--linie); }
.ae-ki-zeile:last-child { border-bottom: 0; }
.ae-ki-balken { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--flaeche-2); overflow: hidden; }
.ae-ki-balken span { display: block; height: 100%; background: var(--salbei-p); border-radius: 4px; }
.ae-ki-balken.knapp span { background: var(--sand-p); }
.ae-ki-balken.voll span { background: var(--koralle-p); }
.sl-bereiche a .ki-zahl { margin-left: auto; }
.auto-reiter a .ki-zahl { margin-left: 6px; vertical-align: 1px; }
/* am Handy fehlt die Spalte "Text oder Grund", dann steht der KI-Hinweis unter der Aktion */
.ki-log-grund { display: none; overflow-wrap: anywhere; margin-top: 2px; color: var(--sand-t); font-size: var(--sg-12); line-height: 1.35; }
.ki-log-grund.auto { color: var(--salbei-t); }
.ki-kommentar { display: grid; gap: 8px; }
.ki-kommentar textarea { min-height: 56px; resize: vertical; }
.ki-kommentar .ki-knopf-box .knopf { gap: 6px; }
.ki-kommentar-ergebnis { display: grid; gap: 8px; }
.ki-kommentar-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (max-width: 759px) {
  .ki-log-grund { display: block; }
  .ae-ki-karte { padding: 12px; }
  .ae-ki-zeile { grid-template-columns: 96px minmax(0, 1fr); }
  .ae-ki-fuss .knopf { flex: 1 1 auto; }
  .ae-ki-platz { display: none; }
}
