/* PB-5402: Homepage-Builder, Grundgerüst (templates/builder.php). Vorsilbe bd-. Chat links 270 px, Vorschau rechts; schmal untereinander.
   Nur Farben und Schriftstufen aus basis.css, hell und dunkel über die Variablen allein, keine Bewegung. */
.bd { display: flex; flex-direction: column; gap: var(--raum-3); }
.bd p, .bd ul, .bd h1, .bd h2 { margin: 0; }
/* PB-5197: eine Werkzeugzeile unter dem gemeinsamen Kopfbalken (PB-8215g: unter dem Seitenkopf) */
.bd-werkzeugzeile { display: flex; flex-direction: column; gap: var(--raum-2); padding: var(--raum-2) var(--raum-3); background: var(--flaeche-leise); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-zeile, .bd-unten { display: flex; flex-wrap: wrap; align-items: center; gap: var(--raum-2) var(--raum-3); }
.bd .bd-hilfe { margin-left: auto; }
main:has(> .bd) { max-width: none; padding-left: var(--raum-5); padding-right: var(--raum-5); }
.bd .bd-werkzeuge { margin-left: auto; }
.bd-lst-jetzt { font-weight: 400; }
/* PB-5197b: Werkzeuge als Knöpfe; nicht verfügbare sind blass und ohne Hover, Aussage im title */
.bd-werkzeugzeile .knopf { display: inline-flex; align-items: center; min-height: 2rem; text-decoration: none; }
.bd-knopf-aus { opacity: .6; cursor: default; }
.bd-knopf-an { font-weight: 700; border-color: var(--akzent); background: var(--akzent-leise); }
.bd-skills > summary { cursor: pointer; list-style: none; }
.bd-skills .knopf { gap: var(--raum-1, .25rem); } /* PB-5197c: Abstand zwischen ☰ und Wort (inline-flex schluckt das Leerzeichen) */
.bd-mehr { display: none; }
.bd-inhalte { padding: var(--raum-2); border-left: 3px solid var(--rand); }
.bd-inhalte h3 { font-size: var(--schrift-s); margin: 0 0 var(--raum-1, .25rem); }
.bd > .seitenkopf { margin: 0; } /* PB-8215g */
.bd > .seitenkopf h1 { font-size: var(--schrift-l); }
.bd-werkzeuge { display: flex; flex-wrap: wrap; gap: var(--raum-2); padding: 0; list-style: none; }
.bd-punkt { display: inline-block; width: 0.6rem; height: 0.6rem; margin-right: 0.35rem; border-radius: 999px; background: var(--st-aus); }
.bd-strahl { display: inline-block; width: 4rem; height: 0.3rem; margin-right: 0.35rem; border-radius: 999px; background: var(--rand); vertical-align: middle; }
.bd-werkzeugzeile .leise { font-size: var(--schrift-s); }
.bd-flaeche { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: var(--raum-3); align-items: start; }
.bd-chat, .bd-vorschau { display: flex; flex-direction: column; gap: var(--raum-2); padding: var(--raum-3); background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-vorschau-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--raum-2); }
.bd-geraete { display: flex; flex-wrap: wrap; gap: var(--raum-2); }
.bd-bild { display: flex; flex-direction: column; justify-content: center; gap: var(--raum-2); min-height: 24rem; margin: 0 auto; padding: var(--raum-3); width: 100%; border: 1px dashed var(--rand); border-radius: var(--radius); text-align: center; }
.bd-bild-tablet { max-width: 48rem; }
.bd-bild-handy { max-width: 24rem; }
.bd-bild-titel { font-weight: 700; }
@media (max-width: 60rem) {
    .bd-flaeche { grid-template-columns: minmax(0, 1fr); }
    .bd .bd-werkzeuge { margin-left: 0; }
}

.bd-sperre { margin: 0 0 .75rem; padding: .5rem .75rem; border: 1px solid currentColor; border-radius: .25rem; font-weight: 600; }
.bd-schritt { margin: 0 0 .75rem; padding: .5rem .75rem; border: 1px solid var(--rand, currentColor); border-radius: .25rem; }

/* PB-5403: Chat = Projekt-Agent. Verlauf scrollt in der Spalte; "denkt nach …" mit pulsierendem Punkt (nur ohne Wunsch nach weniger Bewegung). */
.bd-chat-verlauf { display: flex; flex-direction: column; gap: var(--raum-2); margin: 0; padding: 0; list-style: none; max-height: 32rem; overflow-y: auto; }
.bd-denkt { padding: var(--raum-2); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-denkt p { margin: 0; font-weight: 600; }
.bd-denkt-punkt { display: inline-block; width: 0.6rem; height: 0.6rem; margin-right: 0.35rem; border-radius: 999px; background: var(--st-arbeit); }
.bd-schritte { margin: var(--raum-2) 0 0; padding-left: 1.25rem; font-size: var(--schrift-s); }
@media (prefers-reduced-motion: no-preference) {
    .bd-denkt-punkt { animation: bd-pulsieren 1.2s ease-in-out infinite; }
    @keyframes bd-pulsieren { 50% { opacity: 0.3; } }
}
/* PB-5407: Frame-Auswahl. Die Farben sind die der fünf Frames (frame.php, Felder bg, ink, accent); Platzhalter statt Logo und Bilder. */
.bd-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--raum-3); padding: 0; list-style: none; }
.bd-frame { display: flex; flex-direction: column; gap: var(--raum-2); padding: var(--raum-3); background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-frame-gewaehlt { border-width: 3px; }
.bd-fr { display: flex; flex-direction: column; gap: .4rem; padding: .75rem; min-height: 9rem; border: 1px solid #8884; }
.bd-fr-logo { font-size: .75rem; opacity: .7; }
.bd-fr-titel { font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }
.bd-fr-bild { display: block; height: 2.5rem; background: currentColor; opacity: .15; }
.bd-fr-zeile { display: block; height: .35rem; background: currentColor; opacity: .35; }
.bd-fr-kurz { width: 60%; }
.bd-fr-klassisch { background: #fcfcfa; color: #17212f; border-radius: .25rem; }
.bd-fr-klassisch .bd-fr-titel { color: #1f4b85; font-family: Georgia, serif; }
.bd-fr-modern { background: #0e1217; color: #e6ebf1; border-radius: .5rem; }
.bd-fr-modern .bd-fr-titel { color: #5cc8ff; }
.bd-fr-sachlich { background: #f6f7f8; color: #1b1f24; border-radius: 0; }
.bd-fr-sachlich .bd-fr-titel { color: #00646e; }
.bd-fr-verspielt { background: #fffaf3; color: #2a1f3d; border-radius: 1.25rem; }
.bd-fr-verspielt .bd-fr-titel { color: #6a35b0; }
.bd-fr-warm { background: #fbf7f4; color: #301d10; border-radius: .5rem; }
.bd-fr-warm .bd-fr-titel { color: #a34a21; font-family: Georgia, serif; }

/* PB-5408: Abschnitte in der Vorschau mit Zeigen und Selbst ändern; Bezug über der Eingabe. */
.bd-abschnitte { display: flex; flex-direction: column; gap: var(--raum-1, 0.25rem); margin: 0; padding: 0; list-style: none; text-align: left; }
.bd-abschnitte-seite { margin-top: var(--raum-2); font-weight: 700; }
.bd-abschnitt { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--raum-2); padding: var(--raum-2); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-abschnitt:target { outline: 2px solid currentColor; }
.bd-abschnitt-name { flex: 1 1 12rem; }
/* PB-8507: Schloss am gesperrten Abschnitt; Hinweis nur beim Darüberfahren oder mit Fokus, sonst nur für Vorleser (wie .nur-leser) */
.bd-schloss { position: relative; cursor: help; }
.bd-schloss-hinweis { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bd-schloss:hover .bd-schloss-hinweis, .bd-schloss:focus .bd-schloss-hinweis { left: 0; top: 100%; z-index: 1; width: auto; height: auto; overflow: visible; clip: auto; padding: var(--raum-1, 0.25rem) var(--raum-2); background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-bezug { margin: 0; padding: var(--raum-2); border-left: 3px solid var(--st-offen); }

/* PB-5404: Leitstrahl über dem Chat, einklappbar; eingeklappt nur Titel, Prozent, Balken. Knopf "abschließen" klein und eckig. */
.bd-lst { padding: var(--raum-2); border: 1px solid var(--rand); border-radius: var(--radius); font-size: var(--schrift-s); }
.bd-lst > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--raum-2); cursor: pointer; font-weight: 600; }
.bd-lst-balken { flex: 1 1 4rem; height: 0.4rem; }
.bd-lst-schritte { margin: var(--raum-2) 0 0; padding-left: 1.25rem; }
.bd-lst-zeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--raum-1, 0.25rem) var(--raum-2); }
.bd-lst-stand { color: var(--text-leise, inherit); white-space: nowrap; }
.bd-lst-name { flex: 1 1 auto; min-width: 0; }
.bd-lst-laufend > .bd-lst-zeile .bd-lst-name { font-weight: 700; }
.bd-lst-erledigt > .bd-lst-zeile .bd-lst-name::before { content: "✓ "; color: var(--st-gut); font-weight: 700; } /* PB-8232: Haken statt Durchstreichen */
.bd-lst-form { display: inline; margin: 0 0 0 auto; }
.bd-lst-knopf { padding: 0.1rem 0.5rem; border: 1px solid currentColor; border-radius: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.bd-lst-unter { margin: var(--raum-1, 0.25rem) 0 0; padding-left: 1.25rem; list-style: disc; }
.bd-lst-meldung { margin: var(--raum-2) 0 0; }
/* PB-5426: Handy (375 px). Die Sprungleiste gibt es nur schmal; Vorschau zuerst (ansehen), darunter der Chat (kleine Änderungen).
   Bedienflächen mindestens 44 px hoch, Eingabefelder 16 px (kein Zoom), nichts läuft seitlich über. Ohne Skript. */
.bd-sprung { display: none; }
@media (max-width: 30rem) {
    .bd-werkzeugzeile { padding: var(--raum-2); }
    .bd-zeile { gap: var(--raum-2); }
    .bd-unten, .bd-werkzeuge { gap: var(--raum-2); }
    .bd-budget { display: none; }
    .bd-werkzeugzeile .knopf { padding: 0 var(--raum-2); font-size: var(--schrift-s); min-height: 2.25rem; }
    .bd-gestaltung { display: flex; flex-wrap: wrap; gap: var(--raum-2); }
    .bd .bd-hilfe { margin-left: 0; }
    .bd-sprung { display: flex; gap: var(--raum-2); }
    /* PB-5197c: am Handy Gestaltung und Postfach hinter "Mehr" (details, ohne Skript), Fähigkeiten und Mehr in einer Zeile */
    .bd-gestaltung { display: none; }
    .bd-mehr { display: block; }
    .bd-mehr > summary { cursor: pointer; list-style: none; }
    .bd-mehr[open] { flex-basis: 100%; }
    .bd-mehr .bd-gestaltung { display: flex; margin-top: var(--raum-2); }
    .bd-sprung a, .bd-geraete a, .bd-geraete .reiter-aktiv, .bd-zurueck { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 var(--raum-3); }
    .bd-sprung a { flex: 1; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); color: var(--text); text-decoration: none; font-weight: 600; }
    .bd-geraete { width: 100%; }
    .bd-geraete a, .bd-geraete .reiter-aktiv { flex: 1; }
    .bd-flaeche { display: flex; flex-direction: column; }
    .bd-vorschau { order: -1; }
    .bd-chat, .bd-vorschau { padding: var(--raum-2); min-width: 0; overflow-wrap: anywhere; }
    .bd-bild { min-height: 12rem; max-width: 100%; }
    .bd-chat-verlauf { max-height: 24rem; }
    .bd-chat input, .bd-chat textarea, .bd-chat select { font-size: 1rem; max-width: 100%; box-sizing: border-box; }
    .bd-chat button, .bd-chat input[type="submit"], .bd-chat input[type="file"] { min-height: 2.75rem; }
}
.bd-schnell { display: flex; flex-wrap: wrap; gap: var(--raum-2); margin: var(--raum-2) 0; padding: 0; list-style: none; }
.bd-schnell form { margin: 0; }

/* PB-4202: schattiertes Skelett neben der Karte der Datenerhebung; Unbeantwortetes grau und gestrichelt. Nur Variablen aus basis.css. */
.bd-erh-zeile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: var(--raum-3); align-items: start; }
.bd-skelett { display: flex; flex-direction: column; gap: var(--raum-2); padding: var(--raum-3); background: var(--flaeche-leise); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-skelett h2, .bd-skelett h3 { margin: 0; font-size: var(--schrift-s); }
.bd-skel-block { padding: var(--raum-2); background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-skel-block ul { margin: 0; padding-left: var(--raum-3); }
.bd-skel-offen { border-style: dashed; opacity: .7; }
@media (max-width: 60rem) { .bd-erh-zeile { grid-template-columns: minmax(0, 1fr); } }
.erh-knoepfe { display: flex; flex-wrap: wrap; gap: var(--raum-2); margin-top: var(--raum-2); } /* PB-4202c: Wahlknöpfe nebeneinander, schmal darunter */
.erh-knoepfe form { margin: 0; }
.bd-erh-antworten { margin-top: var(--raum-3); display: flex; flex-direction: column; gap: var(--raum-2); }
.bd-erh-antworten h2 { margin: 0; font-size: var(--schrift-s); }
.bd-erh-antwort { display: flex; flex-direction: column; gap: var(--raum-1, .25rem); padding: var(--raum-2); background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }

/* PB-4202d: Schnellantworten im schmalen Chat gleich breit und gleich hoch, Budget als kleine Karte, Zurück als Knopf */
.bd-schnell { flex-direction: column; align-items: stretch; }
.bd-schnell .knopf { width: 100%; min-height: 2.75rem; text-align: left; }
.bd-budget { display: inline-flex; align-items: center; gap: var(--raum-2); margin: 0; padding: 0.25rem var(--raum-2); border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche); }
.bd-erhebung a.knopf { text-decoration: none; }

/* PB-4202e: Erhebungsantworten auch schmal gleich breit; Budget-Beschriftung bricht nicht um */
.erh-knoepfe { flex-direction: column; align-items: stretch; }
.erh-knoepfe .knopf { width: 100%; }
.bd-budget-name { white-space: nowrap; }

/* PB-6105: Vorschau des Newsletters. Der Rahmen zeigt das Mail-HTML von Fast Mail in drei Postfach-Breiten (Klassen nl-breite-*,
   umgeschaltet per Link ohne Skript); daneben die Textfassung. */
.nl-kopf { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.nl-kopf dd { margin: 0; }
.nl-leiste { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.nl-neu-laden { margin: 0 0 var(--raum-4); } /* PB-6112b: Abstand zum Kasten "Bild oder Flyer hinzufügen" (F3/F5) */
.nl-buehne { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; margin: 1rem 0; }
.nl-postfach { flex: 1 1 24rem; min-width: 0; }
.nl-rahmen { display: block; height: 70vh; min-height: 30rem; border: 1px solid var(--rand); border-radius: .5rem; background: var(--flaeche, #fff); margin: 0 auto; }
.nl-breite-handy { width: 375px; max-width: 100%; }
.nl-breite-webmail { width: 640px; max-width: 100%; }
.nl-breite-rechner { width: 100%; }
.nl-text { flex: 0 1 22rem; min-width: 0; }
.nl-textfassung { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow: auto; font: inherit; }
/* PB-8463: Inhalt selbst schreiben (templates/newsletter_bausteine.php) */
.nl-tp-liste > li { padding-block: .75rem; border-bottom: 1px solid var(--rand); }
.nl-tp-liste input[type="text"], .nl-tp-liste textarea, #nl-tp-kopf input[type="text"], #nl-tp-neu input[type="text"], #nl-tp-neu textarea, .nl-tp-liste select, #nl-tp-neu select { width: 100%; max-width: 40rem; }
.nl-tp-handlungen { display: flex; flex-wrap: wrap; gap: .5rem; }
/* PB-8213a: Baustein-Kasten (templates/builder_bausteine.php); blättert nie, die Gruppen stehen untereinander */
.bd-kasten-suche { display: flex; flex-wrap: wrap; align-items: center; gap: var(--raum-2); margin-bottom: var(--raum-3); }
.bd-kasten-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: var(--raum-2); padding: 0; list-style: none; }
.bd-baustein { display: flex; flex-direction: column; gap: var(--raum-2); padding: var(--raum-3); background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.bd-baustein-name { font-weight: 600; }
.bd-baustein-grau { opacity: 0.6; }

/* PB-8232 (ENDSTAND 9, E-61): Leitstrahl-Karte mit zweispaltigen Schritten, Bezug-Chip, Erledigt mit Haken, Marke „gerade geändert“ */
.bd-lst-unter-titel { font-weight: 400; color: var(--text-leise, inherit); }
.bd-lst-schritte { columns: 2; column-gap: var(--raum-3, 1rem); }
.bd-lst-s { break-inside: avoid; }
@media (max-width: 40rem) { .bd-lst-schritte { columns: 1; } }
.bd-bezug-chip { display: inline-block; margin: 0 0 var(--raum-1, 0.25rem); padding: 0.1rem var(--raum-2); border: 1px solid var(--rand); border-radius: 999px; font-size: var(--schrift-s); }
.bd-erledigt { margin: var(--raum-2) 0 0; padding: 0; list-style: none; font-size: var(--schrift-s); }
.bd-erledigt li::before { content: "✓ "; color: var(--st-gut); font-weight: 700; }
.bd-abschnitt-neu { border-color: var(--st-gut); border-width: 2px; }
.bd-geaendert { padding: 0 var(--raum-1, 0.25rem); border: 1px solid var(--st-gut); border-radius: var(--radius); font-size: var(--schrift-s); }
/* PB-8608: Spalte „Bildschirme der App“ im App-Builder */
.abs { margin: 0 0 var(--raum-3, 1rem); }
.abs-liste { display: flex; flex-direction: column; gap: var(--raum-1, 0.25rem); margin: 0; padding: 0; list-style: none; text-align: left; }
.abs-karte { padding: var(--raum-2); border: 1px solid var(--rand); border-radius: var(--radius); }
.abs-an { border-color: var(--st-gut); border-width: 2px; }
.abs-name { font-weight: 700; }
.abs-zeile { margin: var(--raum-1, 0.25rem) 0 0; font-size: var(--schrift-s); }
/* PB-8464: Bausteine des Newsletters unter der Vorschau (Typ, erste Zeile, Text tippen, Dem Assistenten zeigen), ohne Skript */
.nl-bs-liste { display: flex; flex-direction: column; gap: var(--raum-1, 0.25rem); margin: 0; padding-left: 1.4rem; }
.nl-bs-zeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--raum-1, 0.25rem) var(--raum-2); }
.nl-bs-typ { font-weight: 600; }
.nl-bd .bd-chat .bd-lst-schritte { columns: 1; } /* PB-8464: in der schmalen Chat-Spalte des Builders untereinander, sonst überdeckt „Abschließen“ den nächsten Schritt */
/* PB-8526: Erhebung zuklappbar (details/summary, ohne Skript); der Titel bleibt eine Überschrift, daneben der Stand */
.nl-eh > summary { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: var(--raum-2); cursor: pointer; }
.nl-eh > summary > .leise { grid-column: 2; }
.nl-eh > summary h2 { margin: 0; }
.nl-eh > summary::before { content: "▸"; color: var(--text-leise, inherit); } /* grid blendet das eigene Dreieck aus: sichtbar, dass es sich aufklappen lässt */
.nl-eh[open] > summary::before { content: "▾"; }
