/* =============================================================================
   wp_mail – Sequenzen und Vorlagen wie Close (SPEC_UI_CLOSE_1ZU1 C-18), Paket WP8.
   Belege: Close „Workflows“ close-erkundung\E271–E278, E322–E331 (Liste, Zeile beim Überfahren, Leerzustand, Menüs,
           Übersicht, Bearbeiten, Bericht, Läufe; 75_workflows.md) – gemessen und auf CSS-px umgerechnet (Faktor 1,633);
           Nachtrag ABGLEICH_listen-berichte.md SEQ-01 bis SEQ-04;
           Einstellungsseiten close\M08, M09 (Reiter mit Zähler, Werkzeugzeile 32 px, Tabelle im Rahmen).
   Präfixe: .seq-*  Sequenzen (Liste, Kopf, Übersicht, Bericht, Läufe, Bearbeiten, „Sequenz starten“)
            .tpl-*  Vorlagen (Editor, Platzhalter, Vorschau)
            .mail-* gemeinsame Teile (Werkzeugzeile, Vorlagen-Liste, Unterseiten-Kopf, Formularfelder, Hinweise)
   Die Vorlagen-Seiten erben von crm/settings/base.html und bringen alles mit, was sie brauchen: sie sehen im
   heutigen wie im neuen Einstellungs-Layout (WP7) gleich aus. Bausteine aus app.css (WP0): .btn, .input, .select,
   .page-tabs, .pill-tabs, .table, .table-wrap, .status-pill, .mini-badge, .menu, .avatar, .page-head, .filter-bar.
   ============================================================================= */

/* ---------- gemeinsam: Suchfeld mit Lupe (Filterfeld 278 px [M M08]) ---------- */
.mail-search, .seq-search { position: relative; width: 278px; max-width: 100%; flex: none; margin: 0; }
.mail-search__icon, .seq-search__icon {
  position: absolute; left: 12px; top: 8px; display: inline-flex; color: var(--icon-default); pointer-events: none;
}
.mail-search .input, .seq-search .input { padding-left: 36px; }
.mail-search .input::-webkit-search-cancel-button, .seq-search .input::-webkit-search-cancel-button { cursor: pointer; }

/* =============================================================================
   Vorlagen & Textbausteine (Einstellungen › KOMMUNIKATION)
   ============================================================================= */
/* Reiter E-Mail-Vorlagen · SMS-Vorlagen: erstes Element des Inhalts. Im neuen Einstellungs-Layout docken sie per
   wp_settings.css an die Titelzone an; im heutigen Layout stehen sie als eigene Reiterzeile unter dem Titel. */
.mail-tabs { margin: 0 0 24px; }

/* Werkzeugzeile: 32 px, darunter 24 px; links Filterfeld + Ansichts-Pillen, rechts blau „+ Neue Vorlage“ [Close E467] */
.mail-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 32px; margin: 0 0 24px; }
.mail-toolbar__right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mail-views { flex-wrap: nowrap; min-width: 0; }
.mail-views__sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border-default); flex: none; }

/* Liste wie Close „Templates & Snippets“ (E467): kein Rahmen, über die ganze Inhaltsbreite – die Zeilen laufen durch den
   24-px-Innenabstand des Einstellungs-Inhalts bis an beide Ränder; Kopf 40 px #f9f9f9, Zeilen 40 px, einzeilig */
.mail-results { --mail-bleed: 24px; margin: 0 calc(-1 * var(--mail-bleed)); }
/* heutiges Einstellungs-Layout (page-default): der Innenabstand schrumpft unter 1024/768 px auf 16/12 px (app.css) */
@media (max-width: 1023.98px) { .page-default .mail-results { --mail-bleed: 16px; } }
@media (max-width: 767.98px) { .page-default .mail-results { --mail-bleed: 12px; } }
.mail-table-wrap { border-top: 1px solid var(--border-default); background: var(--surface); }
.mail-table { table-layout: fixed; width: 100%; }
.mail-table thead th { position: static; height: 40px; padding: 0 12px; }
.mail-table td { height: 40px; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-table th:first-child, .mail-table td:first-child { padding-left: var(--mail-bleed); }
.mail-table tbody tr:last-child > * { border-bottom: 1px solid var(--border-default); }
/* Freigabe beginnt 328 px vor dem rechten Rand, das Datum endet 72 px davor [E467] */
.mail-table col.mail-col-share { width: 112px; }
.mail-table col.mail-col-seq { width: 32px; }
.mail-table col.mail-col-date { width: 112px; }
.mail-table col.mail-col-menu { width: 72px; }
.mail-name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mail-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--link); }
.mail-attach { display: inline-flex; align-items: center; gap: 2px; flex: none; font-size: 12px; line-height: 16px; color: var(--text-light); }
.mail-attach .icon { color: var(--icon-light); }
.mail-share { display: inline-flex; align-items: center; gap: 6px; color: var(--text-medium); }
.mail-share .icon, .mail-seq .icon { color: var(--icon-light); flex: none; }
.mail-table .mail-cell-seq { padding: 0; text-align: center; }
.mail-seq { display: inline-flex; vertical-align: middle; }
.mail-table th.mail-head-date, .mail-table td.mail-cell-date { padding: 0; text-align: right; white-space: nowrap; }
.mail-table td.mail-cell-date { font-size: 14px; line-height: 20px; color: var(--text-light); font-variant-numeric: tabular-nums; }   /* Tabellenmaß 14/20 [E467, KV-05] */
.mail-table td.mail-cell-menu, .mail-table th.mail-cell-menu { padding: 0 var(--mail-bleed) 0 0; text-align: right; overflow: visible; }
/* ⋯ erscheint beim Überfahren der Zeile (Close), bleibt bei Tastaturfokus, offenem Menü und auf Touch-Geräten sichtbar */
.mail-row-menu { width: 28px; height: 28px; padding: 0; opacity: 0; }
.mail-table tr:hover .mail-row-menu, .mail-table tr:focus-within .mail-row-menu, .mail-row-menu[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .mail-row-menu { opacity: 1; } }
.mail-row-menu[aria-expanded="true"] { background: var(--bg-borderless-hover); }
[id^="tpl-menu-"] .menu-item[aria-disabled="true"], .tpl-tools [aria-disabled="true"] { opacity: .5; cursor: default; }
/* Spaltenköpfe sortieren (KV-13; E467: Pfeil hinter „Name“): Link im Kopf, Pfeil 14 px am aktiven Kopf */
.mail-table thead th a:hover { text-decoration: none; }
.mail-table thead th a .icon { color: var(--icon-default); flex: none; }
/* Leerzustand wie Close „No templates“ (E476; KV-14): keine Kopfzeile – unter der Linie mittig Überschrift 20 px, ein Satz,
   Knopf. In E476 gemessen (× 1,633): Überschrift beginnt ≈ 124 px unter der Linie, Satz 8 px darunter, Knopf 24 px darunter */
.mail-empty { padding: 124px 24px 96px; }
.mail-empty__title { margin: 0 0 8px; font: 400 20px/28px var(--font-sans); color: var(--text-default); }
.mail-empty .empty-state-text { margin-bottom: 24px; color: var(--text-light); }
.mail-empty .empty-state-text:last-child { margin-bottom: 0; }
.mail-results .pagination { padding: 12px 24px; }
@media (max-width: 900px) {
  .mail-table col.mail-col-date, .mail-table .mail-cell-date, .mail-table .mail-head-date { display: none; }
}

/* Unterseite (Formular, Vorschau, Archivieren): Zurück-Link + Titel 16/24 700 + Aktionen rechts */
.mail-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 32px; margin: 0 0 24px; }
.mail-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-medium); font-size: 14px; line-height: 20px; white-space: nowrap; }
.mail-back:hover { color: var(--text-default); text-decoration: none; }
.mail-back .icon { color: var(--icon-default); }
.mail-sub__title { min-width: 0; margin: 0; font: 700 16px/24px var(--font-sans); color: var(--text-default); overflow-wrap: anywhere; }
.mail-sub__right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Formulare [M M06]: 592 px, Label 14/20 600 über dem Feld (4 px), Zeilenabstand 16 px, Hauptknopf links unten */
.mail-form { max-width: var(--settings-form-w); min-width: 0; }
.mail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mail-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; grid-column: 1 / -1; }
.mail-field--half { grid-column: auto; }
.mail-field[hidden] { display: none; }
.mail-label, .mail-field > label { font: 600 14px/20px var(--font-sans); color: var(--text-default); }
.mail-field textarea.input { line-height: 20px; }
.mail-field input[type="file"].input { height: auto; padding: 5px 8px; }
.mail-help { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-light); }
.mail-help--warn { color: var(--text-warn); }
.mail-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; align-self: flex-start; }
.mail-field .errorlist, .mail-errors { margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 18px; color: var(--text-danger); }
.mail-field.has-error .input, .mail-field.has-error .select { border-color: var(--border-danger); }
.mail-form__actions { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-default); }
.mail-files { margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; line-height: 20px; }
.mail-files li { display: flex; align-items: center; gap: 6px; min-height: 24px; min-width: 0; overflow-wrap: anywhere; }
.mail-files .icon { color: var(--icon-light); flex: none; }
.mail-files small { color: var(--text-light); font-size: 13px; white-space: nowrap; }

/* Hinweiszeile (flach, B.6.12) und Info-Kasten (#fcfcfc, Rand #f1f1f1, Radius 8 [M M06]) */
.mail-alert, .seq-alert {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 8px;
  background: var(--gold-5); color: var(--gold-70); font-size: 14px; line-height: 20px;
}
.mail-alert { margin: 0 0 16px; }
.mail-alert > .icon, .seq-alert > .icon { flex: none; margin-top: 2px; color: var(--gold-50); }
.mail-alert--danger, .seq-alert--danger { background: var(--red-5); color: var(--red-70); }
.mail-alert--danger > .icon, .seq-alert--danger > .icon { color: var(--red-50); }
.mail-alert__text, .seq-alert__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mail-alert ul, .seq-alert ul { margin: 4px 0 0; padding-left: 18px; }
.mail-alert a, .seq-alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.mail-info { padding: 16px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--surface-light); min-width: 0; }
.mail-info__title { margin: 0 0 4px; font: 600 14px/20px var(--font-sans); color: var(--text-default); }
.mail-info__text { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-medium); }
.mail-info__text + .mail-info__text { margin-top: 8px; }
.mail-info a { color: var(--link); }

/* Vorlagen-Editor: Formular 592 px + Platzhalter-Kasten rechts */
/* Detailseite wie Close „Edit Email Template“ (E470–E472, E475, E477; ABGLEICH_einstellungen-2 KV-01 bis KV-03, KV-15):
   Formular einspaltig 600 px, Knopfreihe rechts in der Titelzone (neuer Einstellungs-Rahmen) und am Seitenende */
.settings-body > .mail-sub { display: none; }   /* neuer Rahmen: Rückweg und Titel stehen in der Titelzone (form_page.html) */
.tpl-title-name { font-weight: 400; color: var(--text-light); }
.tpl-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tpl-tools .btn-icon { color: var(--icon-default); }
.tpl-tools .btn-primary { margin-left: 4px; }
.tpl-tools__sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border-default); flex: none; }
.tpl-editor { display: block; min-width: 0; }
/* Formular einspaltig 600 px; die Fußzeile („Erstellt von“ links, Knopfreihe rechts) reicht wie in Close über die ganze Inhaltsbreite –
   ihre Knöpfe stehen unter denen der Titelzone [E471, E475; Abnahme ET-04] */
.tpl-form { max-width: none; }
.tpl-form > :not(.tpl-foot) { max-width: 600px; }
.tpl-form .mail-fields { grid-template-columns: minmax(0, 1fr); }
.tpl-field-name .input { height: 48px; padding: 0 12px; font-size: 18px; line-height: 24px; }
.tpl-subject { display: flex; align-items: center; gap: 8px; }
.tpl-subject .input { flex: 1; min-width: 0; }
.tpl-copies { gap: 12px; }
.tpl-copies__buttons { display: flex; gap: 8px; }
.tpl-copies__buttons[hidden] { display: none; }
.tpl-hint { font-size: 13px; line-height: 18px; }
/* Text: Kasten aus Editor (bzw. Quelltext-Feld) und Fußleiste; darüber schwebt die Formatierungs-Leiste */
.tpl-body { position: relative; border: 1px solid var(--border-default); border-radius: 8px; background: var(--surface); }
.tpl-body:focus-within { border-color: var(--border-focus); }
.mail-field.has-error .tpl-body { border-color: var(--border-danger); }
.tpl-body__editor { min-height: 200px; max-height: 415px; overflow: auto; padding: 12px; font: 400 14px/20px var(--font-sans); color: var(--text-default); outline: 0; overflow-wrap: anywhere; }
.tpl-body__editor[hidden] { display: none; }
.tpl-body__editor:empty::before { content: attr(data-empty-text); color: var(--text-light); pointer-events: none; }
.tpl-body__editor p { margin: 0 0 12px; }
.tpl-body__editor ul, .tpl-body__editor ol { margin: 0 0 12px; padding-left: 24px; }
.tpl-body__editor blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 2px solid var(--border-default); color: var(--text-medium); }
.tpl-body__editor a { color: var(--link); text-decoration: underline; }
.tpl-body__editor img, .tpl-body__editor table { max-width: 100%; height: auto; }
.tpl-body textarea.input { display: block; width: 100%; border: 0; border-radius: 8px 8px 0 0; box-shadow: none; resize: vertical; }
.tpl-body textarea.input:focus { outline: 0; box-shadow: none; }
.tpl-body.is-enhanced:not(.is-source) > textarea { display: none; }
.tpl-body.is-source > textarea { height: 320px; min-height: 200px; max-height: 415px; font: 400 12px/18px var(--font-mono); }
.tpl-body--plain textarea.input { min-height: 145px; }
.tpl-body__note { margin: 0; padding: 0 12px 8px; font-size: 13px; line-height: 18px; color: var(--text-light); }
.tpl-body__note[hidden], .tpl-body__bar[hidden], .tpl-body__formats[hidden] { display: none; }
.tpl-body__bar { display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 4px; border-top: 1px solid var(--border-light); }
.tpl-body__btn { width: 28px; height: 28px; min-height: 0; padding: 0; color: var(--icon-default); }
.tpl-body__btn--aa { font: 600 13px/18px var(--font-sans); }
.tpl-body__btn--code { font: 600 13px/18px var(--font-mono); white-space: nowrap; }
/* „<>“ steht wie in Close direkt neben „{ }“ (E470), beide als Icon */
.tpl-body__btn--strike { font-weight: 600; text-decoration: line-through; }
.tpl-body__btn--quote { font-weight: 600; }
.tpl-body__btn[aria-pressed="true"], .tpl-body__btn[aria-expanded="true"] { background: var(--bg-borderless-hover); }
.tpl-body__sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border-default); flex: none; }
.tpl-body__formats {
  position: absolute; left: 4px; bottom: 40px; z-index: 2; display: flex; align-items: center; gap: 2px; height: 36px; padding: 0 4px;
  border: 1px solid var(--border-default); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-4);
}
.tpl-body__count { margin-left: auto; padding-right: 8px; font-size: 12px; line-height: 16px; color: var(--text-light); font-variant-numeric: tabular-nums; }
.tpl-body__count.is-over { color: var(--text-danger); }
/* Anhänge: Knopf „Datei anhängen“ löst das Datei-Feld aus; Dateien lassen sich auf das Formular ziehen */
.tpl-attach { position: relative; }
.tpl-attach__row { display: flex; align-items: center; gap: 12px; }
.tpl-attach__row[hidden] { display: none; }
.tpl-attach__row .btn { cursor: pointer; }
.tpl-attach__drop { display: none; font-size: 13px; line-height: 18px; color: var(--text-light); }
.tpl-attach.is-dragover .tpl-attach__row { outline: 1px dashed var(--border-focus); outline-offset: 6px; border-radius: 6px; }
.tpl-attach.is-dragover .tpl-attach__drop { display: inline; }
.tpl-attach.is-enhanced .tpl-attach__input { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Karte „Mit dem Team teilen“ */
.tpl-share { padding: 12px 16px; border: 1px solid var(--border-default); border-radius: 8px; }
.tpl-share__head .icon { color: var(--icon-default); flex: none; }
.tpl-share__title { font-weight: 600; }
.tpl-share .tpl-hint { margin-top: 4px; }
.tpl-share .tpl-used { margin: 4px 0 0; font-size: 13px; line-height: 18px; }
/* Seitenende: „Erstellt von“ links, dieselbe Knopfreihe rechts */
.tpl-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-default); }
.tpl-foot__by { margin-right: auto; font-size: 13px; line-height: 18px; color: var(--text-light); }
/* Platzhalter-Menü an den { }-Knöpfen: Suche, Gruppen als Zwischenüberschriften, Einträge zweizeilig (Bezeichnung, Code) */
.tpl-tagmenu { width: 345px; max-width: calc(100vw - 32px); max-height: min(700px, 70vh); }
.tpl-tagmenu .menu-item__label { padding: 5px 0; }
.tpl-tagmenu .menu-item__hint { font-size: 12px; line-height: 16px; }
.tpl-tagmenu__empty { margin: 8px; font-size: 14px; line-height: 20px; color: var(--text-light); }
.tpl-group[hidden], .tpl-placeholder[hidden] { display: none; }
/* „Link einfügen“: kleines Popover am Link-Knopf (Menü-Baustein B.6.6) – Adresse, darunter rechts „Übernehmen“, links „Entfernen“ */
.tpl-linkmenu { width: 320px; max-width: calc(100vw - 32px); padding: 12px; }
.tpl-linkmenu .mail-label { display: block; margin: 0 0 4px; }
.tpl-linkmenu .input { width: 100%; }
.tpl-linkmenu__error { margin: 4px 0 0; font-size: 13px; line-height: 18px; color: var(--text-danger); }
.tpl-linkmenu__error[hidden], .tpl-linkmenu__remove[hidden] { display: none; }
.tpl-linkmenu__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tpl-linkmenu__remove { margin-right: auto; margin-left: -8px; color: var(--text-danger); }

/* Vorschau: Auswahl wirkt sofort (kein „Anwenden“), Nachricht im Rahmen */
.tpl-preview-controls { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 0 24px; }
.tpl-preview-controls .mail-field { width: 288px; max-width: 100%; }
.tpl-preview { max-width: 880px; border: 1px solid var(--border-default); border-radius: 8px; background: var(--surface); overflow: hidden; }
.tpl-preview__head { padding: 12px 16px; border-bottom: 1px solid var(--border-default); background: var(--surface-medium); }
.tpl-preview__label { display: block; font: 400 12px/16px var(--font-sans); text-transform: uppercase; color: var(--text-light); }
.tpl-preview__subject { margin: 2px 0 0; font: 600 16px/24px var(--font-sans); color: var(--text-default); overflow-wrap: anywhere; }
.tpl-preview__meta { margin: 4px 0 0; font-size: 13px; line-height: 18px; color: var(--text-medium); overflow-wrap: anywhere; }
.tpl-preview__frame { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
:root[data-theme="dark"] .tpl-preview__frame { outline: 1px solid var(--gray-30); }   /* Vorschau der E-Mail bleibt hell, mit Rahmen */
.tpl-preview__sms { max-width: 420px; margin: 16px; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--teal-5); color: var(--text-default); overflow-wrap: anywhere; }
.tpl-preview-note { margin: 12px 0 0; font-size: 14px; line-height: 20px; color: var(--text-light); }
.tpl-used { margin: 0 0 16px; padding-left: 18px; }

/* =============================================================================
   Sequenzen – Liste (Close „Workflows“ E271–E274, E330; ABGLEICH SEQ-01, SEQ-02)
   ============================================================================= */
.seq-page { display: flex; flex-direction: column; min-height: 100%; min-width: 0; background: var(--surface); }
/* unter 1024 px setzt app.css für page-default wieder einen Innenabstand – die Sequenz-Seiten bleiben randlos (page-flush) */
.app-content.page-flush:has(> .seq-page) { padding: 0; }
.seq-page--list { background: var(--surface-medium); }   /* unter den Zeilen bleibt #f9f9f9 sichtbar [E271] */
.seq-page > .page-head, .seq-page > .filter-bar { background: var(--surface); }
/* Werkzeugzeile 48 px: Suche (gefüllt #f1f1f1, 280×32) · Status-Reiter (aktiv #e2e2e2) · rechts „Alle Nutzer“ */
.seq-filter { gap: 16px; }
.seq-filter .seq-search { width: 280px; }
.seq-tabs { flex-wrap: nowrap; min-width: 0; }
.seq-tabs__sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border-default); flex: none; }
.seq-owner-btn:has(> .is-filtered) { background: var(--btn-bg-pressed); }
/* Popover „Alle Nutzer“ (wie OPP-06 ohne Gruppen): Suche · Alle auswählen · eigener Nutzer · Aktive · Inaktive; 265 px */
.seq-owner-menu { width: 265px; min-width: 0; }
.seq-owner-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.seq-owner-menu .menu-item__label { flex-direction: row; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seq-owner-group__head { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 0 0 8px; }
.seq-owner-group__head > .seq-owner-row { flex: 1; min-width: 0; font-weight: 600; }
.seq-owner-group__head .btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.seq-owner-group__list { padding-left: 8px; }

.seq-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: var(--surface); font: 400 14px/20px var(--font-sans); }
.seq-table thead th {
  position: sticky; top: 0; z-index: 2; height: 40px; padding: 0 12px; background: var(--table-header);
  border-bottom: 1px solid var(--border-default); font-weight: 600; color: var(--text-default); text-align: left; white-space: nowrap;
}
.seq-table td {
  height: 60px; padding: 0 12px; border-bottom: 1px solid var(--border-default); background: var(--surface); vertical-align: middle;
  color: var(--text-default); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seq-table th:first-child, .seq-table td:first-child { padding-left: 24px; }
.seq-table tbody tr:hover > td, .seq-table tbody tr:focus-within > td { background: var(--table-cell-hover); }
.seq-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.seq-table .seq-center { text-align: center; }
.seq-table col.seq-col-tasks { width: 124px; }
.seq-table col.seq-col-stats { width: 292px; }
.seq-table col.seq-col-date { width: 128px; }
.seq-table col.seq-col-owner { width: 104px; }
.seq-table col.seq-col-step { width: 128px; }
.seq-table col.seq-col-status { width: 30%; }
.seq-table col.seq-col-actions { width: 88px; }
.seq-table col.seq-col-run-actions { width: 196px; }
.seq-table--runs td { height: 52px; }
/* Name 14/600 blau + Status-Badge (+ „Prüfen“), darunter die Schritte als runde Mini-Icons 14 px in Reihenfolge [E271, E330] */
.seq-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.seq-name__link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--link); }
.seq-name > .status-pill, .seq-name > .mini-badge { flex: none; }
.seq-chips { display: flex; align-items: center; gap: 4px; min-height: 14px; margin-top: 6px; }
.seq-chips > .seq-chip { width: 14px; height: 14px; }
.seq-chips > .seq-chip .icon { width: 9px; height: 9px; }
.seq-chips__none { font-size: 12px; line-height: 14px; color: var(--text-light); }
/* Typ-Chip eines Schritts – Farben wie Close „Add Step“ [E324]: E-Mail blau, Anruf grün, SMS türkis, Aufgabe orange,
   Filter gelb; „Warten“ (nur Abschluss) grau. 16 px in Übersicht und Menü, 28 px im Kartenkopf [E322] */
.seq-chip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; flex: none; background: var(--gray-10); color: var(--gray-70); }
.seq-chip--lg { width: 28px; height: 28px; }
.seq-chip--email { background: var(--blue-10); color: var(--blue-70); }
.seq-chip--call { background: var(--green-10); color: var(--green-70); }
.seq-chip--sms { background: var(--teal-10); color: var(--teal-70); }
.seq-chip--task { background: var(--orange-10); color: var(--orange-70); }
.seq-chip--wait { background: var(--gray-10); color: var(--gray-70); }
.seq-chip--check { background: var(--gold-10); color: var(--gold-70); }
/* Status der Sequenz: Entwurf wie Close „Draft“ – in E272 gemessen Grund #f9f2cd, Schrift ≈ #735b00; Aktiv #c9f4c5,
   Pausiert #ffdbc1, Archiviert #e2e2e2 (in Close nicht belegt → ABGLEICH SEQ-02) */
.seq-status[data-status="active"] { background: var(--green-10); }
.seq-status[data-status="draft"] { background: var(--gold-5); color: var(--gold-60); }
.seq-status[data-status="paused"] { background: var(--orange-10); }
.seq-status[data-status="archived"] { background: var(--gray-10); }
.seq-check { background: var(--gold-10); color: var(--gold-70); cursor: default; }
/* Statistik: Zahl 13/600 über Bezeichnung 11 px grau, durch feine Linien getrennt [E271] */
.seq-stats { display: flex; align-items: stretch; justify-content: center; }
.seq-stat { display: flex; flex-direction: column; align-items: center; width: 88px; padding: 0 4px; border-left: 1px solid var(--border-default); min-width: 0; }
.seq-stat:first-child { border-left: 0; }
.seq-stat b { font: 600 13px/18px var(--font-sans); color: var(--text-default); font-variant-numeric: tabular-nums; }
.seq-stat small { font: 400 11px/14px var(--font-sans); color: var(--text-light); white-space: nowrap; }
.seq-dash { color: var(--text-light); }
.seq-table td.seq-date { font-size: 13px; line-height: 18px; color: var(--text-light); }
/* Zeilenwerkzeuge (Stift, ⋯) erscheinen beim Überfahren und bei Tastaturfokus [E272] */
.seq-table td.seq-actions { padding: 0 16px 0 0; text-align: right; overflow: visible; }
.seq-actions__inner { display: inline-flex; align-items: center; gap: 4px; opacity: 0; }
.seq-table tr:hover .seq-actions__inner, .seq-table tr:focus-within .seq-actions__inner,
.seq-actions__inner:has([aria-expanded="true"]) { opacity: 1; }
@media (hover: none) { .seq-actions__inner { opacity: 1; } }
.seq-actions .btn { width: 28px; height: 28px; padding: 0; }
.seq-actions .btn[aria-expanded="true"] { background: var(--bg-borderless-hover); }
.seq-results .pagination { padding: 12px 24px; }
/* Leerzustand [E273, E278]: weiße Fläche, Kreis 96 px #e2e2e2 mit dunklem Icon, Titel 20 px (normal), Text, Knopf */
.seq-empty { display: flex; flex-direction: column; align-items: center; padding: 72px 24px 64px; background: var(--surface); border-bottom: 1px solid var(--border-default); text-align: center; }
.seq-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 50%; background: var(--gray-10); color: var(--text-default); }
.seq-empty__title { margin: 24px 0 4px; font: 400 20px/28px var(--font-sans); color: var(--text-default); }
.seq-empty__text { max-width: 480px; margin: 0 0 16px; font-size: 14px; line-height: 20px; color: var(--text-medium); }
.seq-empty--plain { padding: 32px 16px; border-bottom: 0; }
.seq-empty--runs { border-bottom: 0; }
@media (max-width: 1240px) {
  .seq-table col.seq-col-tasks, .seq-table .seq-cell-tasks { display: none; }
}
@media (max-width: 1100px) {
  .seq-table col.seq-col-date, .seq-table .seq-date, .seq-table .seq-head-date { display: none; }
  .seq-table col.seq-col-stats { width: 256px; }
  .seq-stat { width: 76px; }
  .seq-filter .seq-search { width: 200px; }
}

/* =============================================================================
   Sequenzen – Kopf der Detailseiten (Close E275, E322): Zurück-Link, Name 24/700 + Status, Reiter
   ============================================================================= */
.seq-head { flex: none; padding: 12px 24px 0; background: var(--surface); border-bottom: 1px solid var(--border-default); min-width: 0; }
.seq-head__back { display: inline-flex; align-items: center; gap: 4px; font: 400 12px/16px var(--font-sans); color: var(--text-light); }
.seq-head__back:hover { color: var(--text-default); text-decoration: none; }
.seq-head__row { display: flex; align-items: center; gap: 16px; min-height: 32px; min-width: 0; }
.seq-head__title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; margin: 0; font: 700 24px/32px var(--font-sans); color: var(--text-default); }
.seq-head__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seq-head__title > .status-pill, .seq-head__title > .mini-badge { flex: none; }
.seq-head__tools { display: flex; align-items: center; gap: 8px; flex: none; }
.seq-head__tools form { margin: 0; }
.seq-head__tabs { height: 38px; border-bottom: 0; }
.seq-head--plain { padding-bottom: 12px; }
.seq-head--sticky { position: sticky; top: 0; z-index: 5; }      /* Bearbeiten: die Knöpfe bleiben erreichbar (B.1: Ausnahme per sticky) */
/* Bearbeiten: der Name ist im Titel direkt änderbar – Rand erst beim Überfahren/Fokus */
.seq-name-input {
  flex: 0 1 auto; width: 560px; min-width: 200px; max-width: 100%; height: 32px; margin-left: -9px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; font: 700 24px/30px var(--font-sans); color: var(--text-default); outline: 0; text-overflow: ellipsis;
  field-sizing: content;   /* so breit wie der Name – der Status steht direkt dahinter wie in Close (ältere Browser: feste Breite) */
}
@supports (field-sizing: content) { .seq-name-input { width: auto; } }
.seq-name-input::placeholder { color: var(--text-light); font-weight: 400; }
.seq-name-input:hover { border-color: var(--border-default); }
.seq-name-input:focus { border-color: var(--form-border-focus); background: var(--surface); }
.seq-head__title.has-error .seq-name-input { border-color: var(--border-danger); }
.seq-head__errors { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--text-danger); }

/* ---------- Übersicht: nummerierte Schrittliste über die ganze Breite [E275] ---------- */
.seq-body { padding: 32px 24px 40px; min-width: 0; }
.seq-section__title { margin: 0 0 16px; font: 700 18px/24px var(--font-sans); color: var(--text-default); }
.seq-steps { position: relative; margin: 0; padding: 0; list-style: none; }
.seq-steps::before { content: ""; position: absolute; left: 9px; top: 23px; bottom: 23px; width: 1px; background: var(--border-default); }
.seq-step { position: relative; display: flex; align-items: center; gap: 16px; }
.seq-step + .seq-step { margin-top: 8px; }
.seq-step__num {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none;
  border: 1px solid var(--border-default); border-radius: 50%; background: var(--surface); font: 600 11px/14px var(--font-sans); color: var(--text-medium);
}
.seq-step__card {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 46px; padding: 0 16px;
  border: 1px solid var(--border-default); border-radius: 6px; background: var(--surface);
}
.seq-step__day { width: 48px; flex: none; font: 400 11px/16px var(--font-sans); text-transform: uppercase; color: var(--text-light); white-space: nowrap; }
.seq-step__text { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.seq-step__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text-default); }
a.seq-step__title:hover { color: var(--link); text-decoration: none; }
.seq-step__meta { flex: none; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 18px; color: var(--text-light); }
.seq-step__count { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 13px; line-height: 18px; color: var(--text-medium); font-variant-numeric: tabular-nums; }
.seq-step__count .icon { color: var(--icon-light); }
.seq-step--imported .seq-step__card { border-style: dashed; background: var(--surface-light); }
.seq-step--imported .seq-step__title { font-weight: 400; }
.seq-step__flag { flex: none; }
.seq-steps-empty { padding: 16px; border: 1px dashed var(--border-default); border-radius: 8px; color: var(--text-medium); }
.seq-alert { margin: 16px 24px 0; }

/* ---------- Läufe (Close „Runs“): die Abos als Tabelle wie die Liste, Zeilen 52 px, Aktionen als kleine Knöpfe ---------- */
.seq-runs { padding: 0; }
.seq-sub { display: block; font-size: 13px; line-height: 18px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; }
.seq-run-status { display: flex; align-items: center; gap: 8px; min-width: 0; }
.seq-run-status .status-pill { flex: none; }
.seq-run-status[data-run="active"] .status-pill { background: var(--green-10); }
.seq-run-status[data-run="paused"] .status-pill { background: var(--orange-10); }
.seq-run-status[data-run="error"] .status-pill { background: var(--red-10); }
.seq-run-status[data-run="replied"] .status-pill { background: var(--blue-10); }
.seq-run-reason { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-light); }
.seq-table td.seq-run-actions { padding: 0 24px 0 0; text-align: right; }
.seq-run-actions form { display: inline-block; margin: 0 0 0 4px; }

/* ---------- Bericht „Nach Schritt“ (Close E277): Balkenpaar je Schritt (durchlaufen grau, beantwortet grün, A.5) + Tabelle im Rahmen ---------- */
.seq-chart { margin: 0 0 32px; }
.seq-chart__plot { position: relative; display: flex; align-items: flex-end; height: 180px; padding-left: 32px; border-bottom: 1px solid var(--border-default); }
/* Achse wie Close (E277): „0“ mittig auf der Grundlinie; der größte Wert mittig auf der Hilfslinie in Höhe der höchsten Säule (160 px) */
.seq-chart__axis { position: absolute; left: 0; bottom: -8px; z-index: 1; font: 400 12px/16px var(--font-sans); color: var(--text-light); background: var(--surface); padding-right: 8px; font-variant-numeric: tabular-nums; }
.seq-chart__axis--peak { bottom: 152px; }
.seq-chart__plot:has(.seq-chart__axis--peak)::before { content: ""; position: absolute; left: 0; right: 0; bottom: 160px; height: 1px; background: var(--border-light); }
.seq-chart__col { display: flex; flex: 1; align-items: flex-end; justify-content: center; gap: 4px; min-width: 56px; }
.seq-chart__bar { width: 20px; border-radius: 2px 2px 0 0; }
.seq-chart__bar--through { background: var(--gray-20); }
.seq-chart__bar--replied { background: var(--green-40); }
.seq-chart__labels { display: flex; padding: 8px 0 0 32px; }
.seq-chart__labels .seq-chart__col { flex-direction: column; align-items: center; gap: 4px; }
.seq-chart__label { font: 400 11px/14px var(--font-sans); text-transform: uppercase; color: var(--text-light); white-space: nowrap; }
.seq-chart__legend { display: flex; justify-content: center; gap: 16px; margin-top: 16px; font-size: 13px; line-height: 18px; color: var(--text-default); }
.seq-chart__legend span { display: inline-flex; align-items: center; gap: 8px; }
.seq-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.seq-dot--through { background: var(--gray-20); }
.seq-dot--replied { background: var(--green-40); }
.seq-report-table thead th { position: static; }
.seq-report-table td { height: 52px; }
.seq-report-table th.num, .seq-report-table td.num { width: 200px; }
.seq-report-step { display: flex; align-items: center; gap: 12px; min-width: 0; }
.seq-report-step__text { min-width: 0; }
.seq-report-step__title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =============================================================================
   Sequenzen – Bearbeiten (Close E322, E324, E327; ABGLEICH SEQ-04): graue Fläche #f1f1f1, mittig eine senkrechte
   Kette weißer Karten (360 px, Radius 8, leichter Schatten), verbunden durch 1-px-Linien mit Pfeilspitze
   ============================================================================= */
.seq-canvas { position: relative; flex: 1; padding: 32px 24px 64px; background: var(--surface-dark); }
.seq-editor { display: flex; flex-direction: column; align-items: center; margin: 0; }
.seq-editor > .mail-alert { width: 100%; max-width: 560px; }
.seq-confirm { margin-top: 8px; color: inherit; }
.seq-canvas__tools { position: absolute; top: 16px; right: 24px; display: flex; gap: 8px; }
.seq-chain { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 360px; }
.seq-chain > * { width: 100%; }
.seq-card { border: 1px solid var(--border-default); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-1); min-width: 0; }
.seq-card__head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 8px 8px 12px; min-width: 0; }
.seq-card__title { margin: 0; flex: none; font: 600 14px/20px var(--font-sans); color: var(--text-default); }
.seq-card__sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 18px; color: var(--text-light); }
.seq-card__sub.is-missing { color: var(--text-danger); }
.seq-card__badge { margin-left: auto; margin-right: 4px; }
.seq-card__line { margin: 0; padding: 8px 12px 10px; border-top: 1px solid var(--border-light); font-size: 13px; line-height: 18px; color: var(--text-light); }
.seq-card__tools { display: flex; align-items: center; gap: 0; margin-left: auto; flex: none; }
.seq-card__tools .btn { width: 24px; height: 24px; padding: 0; }
.seq-card__toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
/* aus Close übernommener, nicht eingerichteter Schritt (Filter [E322]): steht an seiner Stelle in der Kette, gestrichelt, nicht klickbar */
.seq-card--imported { border-style: dashed; border-color: var(--gray-20); background: var(--surface-light); box-shadow: none; }
.seq-card--imported .seq-card__line { color: var(--text-medium); }
/* Bedingungen des Filters in Worten, eine je Zeile („Mailfreigabe ist Ja“ – Close: „Mailfreigabe is any of Ja“) */
.seq-card--imported .seq-card__conds { display: flex; flex-direction: column; gap: 2px; color: var(--text-default); overflow-wrap: anywhere; }
/* Wartezeit als grauer Kopfstreifen der Karte („Wait 1 minute“ [E322]) */
.seq-card__strip { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-bottom: 1px solid var(--border-light); border-radius: 7px 7px 0 0; background: var(--surface-medium); font-size: 12px; line-height: 16px; color: var(--text-medium); }
.seq-card__strip .icon { color: var(--icon-light); }
/* Zusammenfassung der zugeklappten Karte: BETREFF + zwei Zeilen Textanfang bzw. Aufgabentext */
.seq-card__summary { padding: 8px 12px 10px; border-top: 1px solid var(--border-light); font-size: 13px; line-height: 18px; color: var(--text-light); min-width: 0; }
.seq-card__summary p { margin: 0; overflow: hidden; }
.seq-summary__subject { white-space: nowrap; text-overflow: ellipsis; color: var(--text-default); }
.seq-summary__subject small { margin-right: 6px; font: 400 11px/16px var(--font-sans); text-transform: uppercase; color: var(--text-light); }
.seq-summary__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; margin-top: 4px; }
.seq-card__body { padding: 12px; border-top: 1px solid var(--border-light); }
.seq-step-fields { display: flex; flex-direction: column; gap: 12px; }
/* aufgeklappter Schritt in der Reihenfolge des Close-Panels (E329; SEQ-08): Wartezeit mit Hinweis · Art · Vorlage mit Betreff und
   Text im Kasten (Rand #e2e2e2, Radius 6, höchstens 240 px, scrollt) · Schalter „Als neue Konversation senden“ · Aufgabentext */
.seq-step-hint { margin: 0; font-size: 12px; line-height: 16px; color: var(--text-light); }
.seq-tplbox { margin-top: 4px; border: 1px solid var(--border-default); border-radius: 6px; background: var(--surface); min-width: 0; }
.seq-tplbox__head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--border-light); min-width: 0; }
.seq-tplbox__subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px/20px var(--font-sans); color: var(--text-default); }
.seq-tplbox__head .btn { flex: none; }
.seq-tplbox__icon { display: inline-flex; }
.seq-tplbox__text { max-height: 240px; overflow: auto; padding: 8px 12px; font-size: 13px; line-height: 18px; color: var(--text-medium); white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-field > label.seq-thread { font-weight: 400; align-self: flex-start; }
.seq-thread__select { display: flex; flex-direction: column; gap: 4px; }
.seq-delay { display: flex; align-items: center; gap: 8px; }
.seq-delay .input { width: 96px; }
.seq-delay .select { flex: 1; min-width: 0; }
.seq-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.seq-remove { margin-left: -8px; color: var(--text-danger); }
.seq-remove .icon { color: var(--icon-danger); }
/* mit JavaScript: zugeklappt zeigt die Karte nur Kopf und Zusammenfassung; ein Klick auf den Kopf klappt die Felder auf */
.seq-editor.is-enhanced .seq-card__head[data-step-toggle] { cursor: pointer; }
.seq-editor.is-enhanced .seq-step-form:not([data-open]) .seq-card__body { display: none; }
.seq-editor.is-enhanced .seq-step-form[data-open] .seq-card__summary { display: none; }
.seq-editor.is-enhanced .seq-step-form__order { display: none; }
.seq-editor.is-enhanced .seq-step-form[data-step-kind="wait"]:not([data-open]) .seq-step-card { display: none; }
.seq-step-form[data-open] > .seq-pill--wait { display: none; }
.seq-kind-icon { display: none; }
[data-step-kind="email"] .seq-kind-icon[data-kind="email"], [data-step-kind="sms"] .seq-kind-icon[data-kind="sms"],
[data-step-kind="call_task"] .seq-kind-icon[data-kind="call_task"], [data-step-kind="task"] .seq-kind-icon[data-kind="task"],
[data-step-kind="wait"] .seq-kind-icon[data-kind="wait"] { display: inline-flex; }
[data-step-kind="email"] .seq-step-form__chip { background: var(--blue-10); color: var(--blue-70); }
[data-step-kind="sms"] .seq-step-form__chip { background: var(--teal-10); color: var(--teal-70); }
[data-step-kind="call_task"] .seq-step-form__chip { background: var(--green-10); color: var(--green-70); }
[data-step-kind="task"] .seq-step-form__chip { background: var(--orange-10); color: var(--orange-70); }
/* Verbindung zwischen den Karten: 1 px Linie #c6c6c6 mit Pfeilspitze, 32 px; beim Überfahren ein kleines „+“ (hier einfügen) [E322, E324] */
.seq-flow { display: flex; flex-direction: column; align-items: center; }
.seq-flow > * { width: 100%; }
.seq-step-form { display: flex; flex-direction: column; align-items: center; margin: 0; }
.seq-step-form > * { width: 100%; }
.seq-step-form[hidden] { display: none; }
.seq-link { position: relative; width: 100%; height: 32px; }
.seq-link::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 1px; width: 1px; background: var(--gray-20); }
.seq-link::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 7px; height: 7px; margin-left: -3px; border-right: 1px solid var(--gray-30); border-bottom: 1px solid var(--gray-30); transform: rotate(45deg); }
.seq-insert {
  position: absolute; left: 50%; top: 50%; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  margin: -12px 0 0 -12px; padding: 0; border: 1px solid var(--border-default); border-radius: 50%; background: var(--surface); color: var(--icon-default);
  cursor: pointer; opacity: 0; transition: opacity var(--dur-quick) var(--ease);
}
.seq-link--add:hover .seq-insert, .seq-insert:focus-visible, .seq-insert[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .seq-insert { opacity: 1; } }
/* Pillen auf der Linie: Schritt „Warten“ (klickbar) und das Ende der Kette (fester Text) */
.seq-pill {
  display: inline-flex; align-items: center; gap: 6px; width: auto !important; max-width: 100%; height: 28px; padding: 0 12px; border: 1px solid var(--gray-20);
  border-radius: 14px; background: transparent; font: 400 13px/18px var(--font-sans); color: var(--text-medium); white-space: nowrap;
}
button.seq-pill { cursor: pointer; background: var(--surface); }
button.seq-pill:hover { background: var(--btn-bg-hover); }
.seq-pill .icon { color: var(--icon-light); }
.seq-add { display: flex; flex-direction: column; align-items: center; }
.seq-add > .btn { width: auto; }
.seq-add-menu .menu-item { min-height: 36px; }
.seq-editor > .menu { width: auto; max-width: 360px; }
/* Zeitplan: Dialog im Modal-Stil (B.6.10); ohne JavaScript steht er als Karte in der Kette */
.seq-dialog { padding: 0; border: 1px solid var(--border-default); border-radius: 8px; background: var(--surface); color: var(--text-default); }
.seq-dialog:not(:modal) { position: static; width: 100%; margin: 32px 0 0; box-shadow: var(--shadow-1); }
.seq-dialog:not(:modal) .seq-dialog__close, .seq-dialog:not(:modal) .seq-dialog__foot { display: none; }
.seq-dialog:modal { width: calc(100% - 32px); max-width: 560px; border: 0; border-radius: 16px; box-shadow: var(--shadow-4); }   /* 560 px wie Close [E327] */
.seq-dialog::backdrop { background: var(--bg-backdrop); }
.seq-dialog .modal-header { position: relative; }
.seq-dialog__close { position: absolute; top: 12px; right: 12px; }
.seq-schedule { display: flex; flex-direction: column; gap: 16px; }
/* Versandtage als Knöpfe Mo–Fr (52×36; gewählt #eaf1ff mit Rand #2b6cf0 [E327]) – es sind die Kästchen „weekdays“ */
.seq-days > div { display: flex; flex-wrap: wrap; gap: 8px; }
.seq-days label {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 36px; border: 1px solid var(--border-default);
  border-radius: 6px; background: var(--surface); font: 400 14px/20px var(--font-sans); color: var(--text-default); cursor: pointer;
}
.seq-days label:has(input:checked) { background: var(--blue-5); border-color: var(--blue-50); }
.seq-days label:has(input:focus-visible) { outline: 2px solid var(--blue-40); outline-offset: 1px; }
.seq-days input[type="checkbox"] { position: absolute; inset: 0; width: 100% !important; height: 100% !important; margin: 0; opacity: 0; cursor: pointer; }
/* Sendefenster: zwei Auswahlfelder „9:00“ — „16:00“ (120 px wie Close [E327]) */
.seq-window { display: flex; align-items: center; gap: 8px; }
.seq-window .select { width: 120px; flex: none; }
@media (max-width: 900px) { .seq-canvas__tools { position: static; align-self: flex-end; margin: 0 0 16px; } }

/* =============================================================================
   „Sequenz starten“ (Modal von der Lead-Seite, B.6.10; als ganze Seite: schmale Karte)
   ============================================================================= */
.seq-subscribe { margin: 0; }
.seq-subscribe__lead { margin: 0 0 16px; font-size: 14px; line-height: 20px; color: var(--text-medium); overflow-wrap: anywhere; }
.seq-subscribe .mail-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
/* Close „Trigger Workflow“ (E134): Dialog 560 px breit – im Modal der Lead-Seite wie als ganze Seite (ABGLEICH LD-05) */
.modal-dialog:has(.seq-subscribe) { max-width: 560px; }
.seq-modal-page { width: 100%; max-width: 560px; margin: 32px auto; border: 1px solid var(--border-default); border-radius: 16px; background: var(--surface); }

/* =============================================================================
   Auswahl und Sammel-Leiste (Vorlagen: Close E474, KV-06 · Sequenzen: Close E331, SEQ-05)
   Die Leiste liegt genau über der Kopfzeile der Tabelle (40 px, gleicher Grund), sobald eine Zeile angekreuzt ist.
   ============================================================================= */
.mail-bulk {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 4px; height: 40px; margin: 0 0 -40px; padding: 0 12px 0 16px;
  background: var(--table-header); border-bottom: 1px solid var(--border-default); font: 400 14px/20px var(--font-sans); color: var(--text-default);
}
.mail-bulk[hidden] { display: none; }
.mail-bulk__count { margin: 0 8px 0 4px; font-weight: 600; white-space: nowrap; }
.mail-bulk__sep { width: 1px; height: 16px; margin: 0 4px; background: var(--border-default); flex: none; }
.mail-bulk .btn { height: 28px; }
.mail-bulk .btn-icon { width: 28px; }
.mail-bulk__danger, .mail-bulk__danger:hover { color: var(--text-danger); }
.mail-bulk__danger .icon { color: var(--icon-danger); }
.mail-pick, .seq-pick { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: none; }
.mail-pick input, .seq-pick input { margin: 0; }
/* gesperrtes Kästchen wie Close (E474, Zeile „… A Anfragebestätigung“): grau gefüllt, volle Deckkraft, kein Zeiger –
   der Selektor muss die Kästchen-Regel des Fundaments übertreffen (app.css: input[type="checkbox"]:not(.switch input):not([role="switch"])) */
.mail-table .mail-pick input[type="checkbox"]:not(.switch input):disabled { background: var(--gray-10); border-color: var(--gray-20); opacity: 1; cursor: default; }
.mail-name-cell > .mail-pick { margin-right: 2px; }
.mail-table tbody tr.is-selected > *, .seq-table tbody tr.is-selected > td { background: var(--table-cell-highlight); }
/* Sequenzen: Kästchen links vor dem Namen; Status und Schritt-Icons beginnen unter dem Namen */
.seq-table td.seq-cell-name { position: relative; padding-left: 52px; }
.seq-cell-name > .seq-pick { position: absolute; left: 24px; top: 12px; }
/* Gesprächsskripte (Live-Souffleur, crm/templates/crm/templates/scripts_list.html, _script_form.html): Regeln je Zeile, Art,
   Wissensbausteine an/aus, „Im Gespräch umgestellt“. Was nur für eine Art gilt (data-only), blendet :has() aus. */
.scripts-intro { margin: 0 0 12px; }
.scripts-rule { display: block; }
.mail-table td.scripts-cell-wrap { height: auto; padding-top: 10px; padding-bottom: 10px; white-space: normal; overflow-wrap: anywhere; }
[data-call-scripts] .cell-sub, .scripts-switches .cell-sub { display: block; font-size: 13px; line-height: 18px; color: var(--text-light); white-space: normal; }
.scripts-rule + .scripts-rule { margin-top: 2px; }
.scripts-kind { border: 0; padding: 0; margin: 0; }
.scripts-kind__option { display: flex; gap: 8px; align-items: baseline; margin-top: 4px; }
.scripts-rules { display: grid; gap: 12px; }
/* je Regel zwei Zeilen: [Wenn … | Vergleich] und [Werte | Pipeline] (.mail-field spannt sonst über alle Spalten) */
.scripts-rule-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px 12px; align-items: start;
  padding-top: 12px; border-top: 1px solid var(--border-default); }
.scripts-rule-row .mail-field { grid-column: auto; margin: 0; min-width: 0; }
.scripts-rule-row .select, .scripts-rule-row .input { width: 100%; }
.scripts-rule-row textarea { min-height: 36px; resize: vertical; }
@media (max-width: 720px) { .scripts-rule-row { grid-template-columns: minmax(0, 1fr); } }
.scripts-values summary { cursor: pointer; font-size: 13px; line-height: 18px; color: var(--text-info); }
.scripts-values dd { display: flex; flex-wrap: wrap; gap: 4px; }
.scripts-value { padding: 0 6px; border: 1px solid var(--border-default); border-radius: 4px; font-size: 12px; line-height: 18px; }
.tpl-form:has(input[name="kind"][value="knowledge"]:checked) [data-only="script"],
.tpl-form:has(input[name="kind"][value="script"]:checked) [data-only="knowledge"] { display: none; }
.scripts-toggle { margin: 0; }
.scripts-toggle .btn.is-on { color: var(--text-success); border-color: currentColor; }
.scripts-switches { margin-top: 32px; }
.scripts-switches__title { margin-bottom: 4px; }
/* Playbook (Souffleur lernt, scripts_playbook.html): Stand-Reiter, Einträge je Skript als Zeilen mit Linie, Knöpfe in einer Reihe,
   Bearbeiten aufklappbar. Nur Farb-Tokens (hell und dunkel). */
.playbook-filter { display: flex; gap: 8px; align-items: center; flex: 0 1 auto; max-width: 100%; margin: 0; }
.playbook-filter .select { width: 240px; min-width: 0; max-width: 100%; flex: 0 1 auto; }
.playbook-filter .btn { flex: none; }
.playbook-entry__head .scripts-rule { display: inline; font-weight: 600; }
.playbook-entry .cell-muted, .playbook-entry__kind { color: var(--text-light); }
.playbook-states { margin: 0 0 16px; }
.playbook-script { margin-bottom: 24px; }
.playbook-script > .mail-sub__title { margin-bottom: 4px; }
.playbook-entry { padding: 12px 0; border-top: 1px solid var(--border-default); overflow-wrap: anywhere; }
.playbook-entry > p { margin: 0 0 4px; }
.playbook-entry__say { font-size: 15px; line-height: 22px; }
.playbook-entry .cell-sub { display: block; font-size: 13px; line-height: 18px; color: var(--text-light); }
.playbook-entry__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 8px; }
.playbook-entry__actions form { margin: 0; }
.playbook-entry__edit[open] { flex-basis: 100%; }
.playbook-entry__edit > summary { list-style: none; display: inline-flex; }
.playbook-entry__edit > summary::-webkit-details-marker { display: none; }
.playbook-entry__edit[open] > form { margin-top: 8px; max-width: 640px; }
.playbook-entry__edit textarea { width: 100%; resize: vertical; }
