/* expenia Cockpit: Komponenten (Stand 12.11.2026)
   Reihenfolge der Einbindung: bootstrap.min.css → tokens.css → expenia-ui.css → expenia-components.css,
   danach höchstens eine Seiten-CSS (assets/css/pages/*.css) mit rein seitenbezogenen Regeln.
   Hier stehen alle wiederverwendbaren Bausteine, die auf den Beispielseiten entstanden sind.
   expenia-ui.css bleibt Basis (Rahmen, Bootstrap-Umgestaltung, Grundbausteine); Regeln, die nur
   Bootstrap-Klassen umgestalten, stehen dort, alles mit eigener exp-Klasse hier.
   Präfix exp-, keine Hex- oder RGB-Werte: alles aus tokens.css. Varianten über data-Attribute. */

/* =========================================================
   1. Ergänzungen zu Kern-Bausteinen
   Zweck: Panel-Zwischentitel, Suche im Panel-Kopf, große Avatare, kleinere Kennzahl, Badge-Gruppe.
   Beispiel: pages/mandant.html, pages/belege.html
   ========================================================= */
/* Kartenkopf mit h3 statt h2 (unter einem Abschnittstitel) */
.exp-panel-head h3 { font-weight: 600; }
/* Zwischentitel in einer Karte */
.exp-panel-group { padding: var(--exp-space-sm) var(--exp-space-lg) 0; font-size: var(--exp-text-sm); font-weight: 600; color: var(--exp-text-2); font-family: var(--exp-font); }
/* Suchfeld rechts im Panel-Kopf */
.exp-panel-search { width: min(20rem, 100%); }
/* Großer Avatar im Seitenkopf eines Mandanten */
.exp-avatar-xl { width: 56px; height: 56px; font-size: var(--exp-text-lg); font-family: var(--exp-font-display); font-weight: 600; letter-spacing: 0; }
/* Gestapelte Avatare (benachrichtigte Personen) */
.exp-avatars { display: inline-flex; }
.exp-avatars > .exp-avatar { box-shadow: 0 0 0 2px var(--exp-surface); }
.exp-avatars > .exp-avatar + .exp-avatar { margin-inline-start: -6px; }
/* Kennzahl, deren Wert kein Zähler ist (Datum, Betrag): etwas kleiner */
.exp-stat-value.exp-stat-value-sm { font-size: var(--exp-text-2xl); line-height: 1.25; }
/* Mehrere Badges nebeneinander */
.exp-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs); }

@media (max-width: 639.98px) {
  .exp-panel-search { width: 100%; }
  .exp-panel-group { padding-inline: var(--exp-space-md); }
  .exp-panel-foot .pagination { width: 100%; justify-content: center; }
  /* Umschalter im Panel-Kopf füllt die Breite, Optionen enger */
  .exp-panel-head > .exp-segmented { display: flex; width: 100%; }
  .exp-panel-head > .exp-segmented > .btn { flex: 1 1 auto; --bs-btn-padding-x: 6px; }
  .exp-avatar-xl { width: 48px; height: 48px; }
  .exp-stat-value.exp-stat-value-sm { font-size: var(--exp-text-xl); }
}

/* =========================================================
   2. Anordnung
   Zweck: Karten oder Abschnitte untereinander (.exp-stack), Container für Container-Abfragen (.exp-cq),
   Fußzeile von Werkzeugen (.exp-tool-foot).
   Beispiel: pages/mandant.html, pages/belege.html (Schnellansicht), komponenten/dokumente.html
   ========================================================= */
.exp-stack { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--exp-space-lg); min-width: 0; }
/* minmax(0, 1fr): sonst weitet ein breiter Inhalt (Tabelle, Formularzeile) die einzige Spalte über die Bildschirmbreite */
/* width nötig: in Flex- und Grid-Spalten misst Chrome sonst Breite 0 */
.exp-cq { container-type: inline-size; width: 100%; min-width: 0; }
/* Status links, Aktionen rechts, bricht um */
.exp-tool-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--exp-space-sm) var(--exp-space-lg);
}

/* =========================================================
   3. Tabellen: Zellen und Zeilen
   Zweck: Dateiname als Link, Zustand mit Hinweis, Name und Zahl als Link, Werte unter der Hauptzelle
   (schmal), Leerzustand als Zeile, kleine Tabelle ohne Panel-Einzug, Spalten ein- und ausblenden.
   Beispiel: pages/belege.html, pages/mandanten.html, komponenten/daten.html
   ========================================================= */
/* Dateiname als Link, darunter Quelle und Zeilenzahl */
.exp-file { display: grid; gap: 2px; min-width: 0; color: var(--exp-text); text-decoration: none; }
.exp-file-name { font-weight: 600; overflow-wrap: anywhere; }
.exp-file:hover { color: var(--exp-text); }
.exp-file:hover .exp-file-name { color: var(--exp-text-accent); text-decoration: underline; text-underline-offset: 3px; }
.exp-file:focus-visible { border-radius: var(--exp-radius-sm); }
.exp-file-meta { display: inline-flex; align-items: center; gap: var(--exp-space-2xs); }
.exp-file-meta .lucide { width: 14px; height: 14px; color: var(--exp-text-2); }
/* Ab 1400 px: Dateiname bekommt Platz, lange Hinweise brechen statt die Spalte aufzublähen */
@media (min-width: 1400px) {
  .exp-file { min-width: 16rem; }
}
/* Schmal: Partner, Datum und Zustand untereinander unter dem Dateinamen */
.exp-file-extra { display: grid; justify-items: start; gap: var(--exp-space-2xs); margin-block-start: var(--exp-space-2xs); }
/* Zustand: Badge und darunter ggf. Hinweiszeile */
.exp-state { display: grid; justify-items: start; gap: var(--exp-space-2xs); max-width: 17rem; }
/* Datei-Icon vor dem Namen */
.exp-doc-name { display: inline-flex; align-items: center; gap: var(--exp-space-xs); min-width: 0; }
.exp-doc-name .lucide { color: var(--exp-text-2); }

/* Name als Link in der Hauptzelle */
.exp-client-link { color: var(--exp-text); text-decoration: none; overflow-wrap: break-word; }
.exp-client-link:hover { color: var(--exp-text-accent); text-decoration: underline; }
/* Zahl als Link (offene Belege): Akzentfarbe, Unterstrich erst beim Überfahren */
.exp-num-link { color: var(--exp-text-accent); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.exp-num-link:hover { text-decoration: underline; }

/* Schmal: Nebenwerte nebeneinander unter der Hauptzelle; nach .exp-client bündig zum Namen */
.exp-row-extra { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs) var(--exp-space-xs); margin-block-start: var(--exp-space-2xs); }
.exp-client + .exp-row-extra { padding-inline-start: calc(28px + var(--exp-space-sm)); }
.exp-row-extra > .exp-sub { flex-basis: 100%; }

/* Leerzustand als Tabellenzeile (ohne Hover) */
.table > tbody > tr.exp-row-empty > td { background: transparent; }
.table-hover > tbody > tr.exp-row-empty:hover > * { --bs-table-bg-state: transparent; }

/* Kleine Tabelle ohne Panel-Einzug und ohne getönten Kopf (Buchungszeilen in einer Seitenleiste) */
.table.exp-lines { font-size: var(--exp-text-sm); }
.table.exp-lines > :not(caption) > * > * { padding: var(--exp-space-xs); vertical-align: top; }
.table.exp-lines > :not(caption) > * > *:first-child { padding-inline-start: 0; }
.table.exp-lines > :not(caption) > * > *:last-child { padding-inline-end: 0; }
.table.exp-lines > thead > tr > th { background: transparent; padding-block: var(--exp-space-xs); }
.table.exp-lines > tfoot > tr > * { border-block-end-width: 0; font-weight: 600; }

/* Dropdown mit Kästchen (Spalten ein- und ausblenden) */
.exp-dropdown-check {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  margin: 0;
  padding: 7px 10px;
  border-radius: var(--exp-radius-sm);
  cursor: pointer;
}
.exp-dropdown-check:hover { background: var(--exp-surface-muted); }
.exp-dropdown-check > .form-check-input { flex: none; margin: 0; }
.exp-dropdown-check:has(:disabled) { color: var(--exp-text-2); cursor: default; }
.exp-dropdown-check:has(:disabled):hover { background: none; }
/* Ausgeblendete Spalte: schlägt Bootstraps d-*-table-cell (ebenfalls !important) */
[data-col][hidden] { display: none !important; }

/* =========================================================
   4. Filter und Werkzeugleisten
   Zweck: Filterleiste unter dem Panel-Kopf (.exp-filterbar), freie Leiste über einer Liste (.exp-toolbar),
   umschaltbarer Filter (.exp-filterchip), Marken und Tag-Feld (.exp-chip, .exp-tagfield),
   Operatoren-Hilfe der Suche (.exp-ops).
   Beispiel: pages/mandanten.html, pages/aufgaben.html, komponenten/daten.html
   ========================================================= */
.exp-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--exp-space-xs) var(--exp-space-sm);
  padding: var(--exp-space-sm) var(--exp-space-lg);
  border-block-end: 1px solid var(--exp-border);
}
.exp-filterbar-search { flex: 1 1 16rem; min-width: 0; max-width: 26rem; }
.exp-filterbar .form-select { width: auto; min-width: 11rem; }
.exp-filterbar-reset { margin-inline-start: auto; }

.exp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-xs) var(--exp-space-sm); }
.exp-toolbar-field { width: 14rem; }
.exp-toolbar-search { width: 16rem; }
.exp-toolbar-end { margin-inline-start: auto; }

/* Umschaltbarer Filter (aria-pressed): getönt, gewählt mit Akzentfläche und -rahmen */
.exp-filterchip {
  display: inline-flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  min-height: 36px;
  padding: 0 var(--exp-space-sm);
  border: 1px solid transparent;
  border-radius: var(--exp-radius-pill);
  background: var(--exp-neutral-bg);
  color: var(--exp-text);
  font: inherit;
  font-size: var(--exp-text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--exp-dur-1) var(--exp-ease), border-color var(--exp-dur-1) var(--exp-ease);
}
.exp-filterchip .lucide { width: 15px; height: 15px; color: var(--exp-text-2); }
.exp-filterchip:hover { background: color-mix(in srgb, var(--exp-neutral-bg), var(--exp-text) 6%); }
.exp-filterchip[aria-pressed='true'] { background: var(--exp-accent-muted); border-color: var(--exp-accent); }
.exp-filterchip[aria-pressed='true'] .lucide { color: var(--exp-text-accent); }

/* Marke (Chip): Wert mit optionalem Entfernen-Knopf */
.exp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  max-width: 100%;
  padding: 0 4px 0 10px;
  border-radius: var(--exp-radius-pill);
  background: var(--exp-neutral-bg);
  color: var(--exp-text);
  font-size: var(--exp-text-sm);
  font-weight: 500;
  white-space: nowrap;
}
.exp-chip:not(:has(.exp-chip-remove)) { padding-inline-end: 10px; }
.exp-chip[hidden] { display: none; }
.exp-chip > span:not(.exp-avatar) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.exp-chip-key { color: var(--exp-text-2); font-weight: 400; }
.exp-chip > .exp-avatar { width: 20px; height: 20px; margin-inline-start: -6px; font-size: 8px; background: var(--exp-surface); }
.exp-chip-remove {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--exp-text-2);
  cursor: pointer;
  transition: background-color var(--exp-dur-1) var(--exp-ease), color var(--exp-dur-1) var(--exp-ease);
}
.exp-chip-remove:hover { background: color-mix(in srgb, var(--exp-text) 10%, transparent); color: var(--exp-text); }
.exp-chip-remove .lucide { width: 14px; height: 14px; }
.exp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-xs); min-width: 0; }

/* Feld mit Marken und Eingabe; sieht aus wie .form-control */
.exp-tagfield {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: var(--exp-control);
  padding: 5px 8px;
  border: 1px solid var(--exp-border-strong);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
  cursor: text;
  transition: border-color var(--exp-dur-1) var(--exp-ease), box-shadow var(--exp-dur-1) var(--exp-ease);
}
.exp-tagfield:hover { border-color: var(--exp-text-2); }
.exp-tagfield:focus-within { border-color: var(--exp-focus); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.exp-tagfield-input {
  flex: 1 0 9rem;
  min-width: 0;
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--exp-text);
  font: inherit;
}
.exp-tagfield-input:focus-visible { outline: 0; }
.exp-tagfield-input::placeholder { color: var(--exp-text-2); opacity: 0.85; }
.exp-tagfield-input:disabled { cursor: not-allowed; }

/* Empfängerfeld (public/assets/js/exp-recipients.js): Tag-Feld mit Chips, Fehlerzeile und Vorschlagsliste.
   .exp-recipients > .exp-recipients-box.exp-tagfield (.exp-recipients-chip.exp-chip + .exp-recipients-input),
   .exp-recipients-error (aria-live); .exp-recipients-list (role=listbox, hängt am Ende von body) >
   .exp-recipients-option. Zustände: .is-selected, .is-dragging (Chip), .is-dragover (Feld).
   Beispiel: pages/editor.html */
.exp-recipients { display: grid; min-width: 0; }
.exp-recipients > input[type='hidden'] { display: none; }
.exp-recipients-chip { cursor: grab; user-select: none; }
.exp-recipients-chip:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: 1px; }
.exp-recipients-chip.is-selected { background: var(--exp-accent-muted); color: var(--exp-text-accent); box-shadow: inset 0 0 0 1px var(--exp-accent); }
.exp-recipients-chip.is-dragging { opacity: 0.5; }
.exp-recipients-box.is-dragover { border-color: var(--exp-accent); background: var(--exp-accent-muted); }
.exp-recipients-error { margin: 0; color: var(--exp-danger-text); font-size: var(--exp-text-sm); }
.exp-recipients-error:not(:empty) { margin-block-start: var(--exp-space-3xs); }
.exp-recipients-list {
  position: fixed;
  z-index: var(--exp-z-popover);
  max-height: 16rem;
  overflow-y: auto;
  padding: var(--exp-space-2xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-raised);
  box-shadow: var(--exp-shadow-pop);
}
.exp-recipients-list[hidden] { display: none; }
.exp-recipients-option {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--exp-space-xs);
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border-radius: var(--exp-radius-sm);
  cursor: pointer;
}
.exp-recipients-option[aria-selected='true'] { background: var(--exp-accent-muted); }
.exp-recipients-option-name { font-weight: 500; overflow-wrap: anywhere; }
.exp-recipients-option-mail { min-width: 0; color: var(--exp-text-2); font-size: var(--exp-text-sm); overflow-wrap: anywhere; }

/* Operatoren im Hilfemenü der Suche */
.exp-ops { width: 21rem; max-width: calc(100vw - 2rem); }
.exp-ops .dropdown-item code { min-width: 9ch; }
.exp-ops-head { display: grid; gap: 2px; padding: 6px 10px 6px; }

@media (max-width: 991.98px) {
  .exp-filterbar-reset { margin-inline-start: 0; }
  .exp-toolbar-end { margin-inline-start: 0; }
}
@media (max-width: 639.98px) {
  .exp-filterbar { padding-inline: var(--exp-space-md); }
  .exp-filterbar-search { flex-basis: 100%; max-width: none; }
  .exp-filterbar .form-select { flex: 1 1 calc(50% - var(--exp-space-sm)); min-width: 0; }
  .exp-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exp-toolbar > .exp-segmented { display: flex; }
  .exp-toolbar > .exp-segmented > .btn { flex: 1; }
  .exp-toolbar-field, .exp-toolbar-search { width: auto; grid-column: 1 / -1; }
  .exp-toolbar > .exp-filterchip { justify-content: center; }
  .exp-toolbar-end { grid-column: 1 / -1; }
}

/* =========================================================
   5. Kleine Anzeigen
   Zweck: Fälligkeit (.exp-due[data-tone=soon|today|overdue]), Priorität (.exp-prio[data-level]),
   Zähler mit Icon (.exp-counter), Wert mit Kopier-Button (.exp-copy), Blättern (.exp-pager),
   Zoomanzeige (.exp-zoom-label). Text trägt die Bedeutung, Farbe nur zusätzlich.
   Beispiel: pages/aufgaben.html, pages/mandanten.html, pages/beleg-detail.html, komponenten/rueckmeldung.html
   ========================================================= */
/* Fälligkeit: einzeilig („in 3 Tagen“) oder mit Datum darunter (.exp-cell) */
.exp-due { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.exp-due > .lucide { width: 14px; height: 14px; color: var(--exp-text-2); }
.exp-due:has(> .exp-cell) { align-items: flex-start; gap: 6px; }
.exp-due:has(> .exp-cell) > .lucide { width: 16px; height: 16px; margin-block-start: 2px; }
.exp-due .exp-cell > :first-child { font-weight: 400; }
/* Bald, heute, überfällig: fett; überfällig in Warnfarbe, immer mit Text („3 Tage überfällig“) */
.exp-due[data-tone],
.exp-due[data-tone] .exp-cell > :first-child { font-weight: 600; }
.exp-due[data-tone='soon'], .exp-due[data-tone='today'] { color: var(--exp-text); }
.exp-due[data-tone='soon'] > .lucide { color: var(--exp-warning-fg); }
.exp-due[data-tone='today'] > .lucide { color: var(--exp-text-accent); }
.exp-due[data-tone='overdue'] { color: var(--exp-warning-text); }
.exp-due[data-tone='overdue'] > .lucide { color: var(--exp-warning-fg); }

/* Priorität: urgent | high | normal | low */
.exp-prio { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.exp-prio .lucide { width: 16px; height: 16px; color: var(--exp-text-2); }
.exp-prio[data-level='urgent'] { font-weight: 600; }
.exp-prio[data-level='urgent'] .lucide { color: var(--exp-danger-fg); }
.exp-prio[data-level='high'] .lucide { color: var(--exp-warning-fg); }
.exp-prio[data-level='normal'], .exp-prio[data-level='low'] { color: var(--exp-text-2); }

/* Zähler mit Icon (Kommentare, Anhänge) */
.exp-counters { display: inline-flex; align-items: center; gap: var(--exp-space-sm); }
.exp-counter { display: inline-flex; align-items: center; gap: 4px; font-size: var(--exp-text-sm); color: var(--exp-text-2); font-variant-numeric: tabular-nums; }
.exp-counter .lucide { width: 15px; height: 15px; }

/* Wert mit Kopier-Button daneben (UID, IBAN); der Icon-Button verändert die Zeilenhöhe nicht */
.exp-copy { display: inline-flex; align-items: center; gap: var(--exp-space-3xs); }
.exp-copy > .btn-icon { margin-block: -6px; color: var(--exp-text-2); }
.exp-copy > .btn-icon:hover { color: var(--exp-text); }
.exp-copy > .btn-icon .lucide { width: 15px; height: 15px; }
.btn.is-copied .lucide { color: var(--exp-success-fg); }
.exp-copylist { display: flex; flex-wrap: wrap; gap: var(--exp-space-lg) var(--exp-space-2xl); }

/* Blättern im Seitenkopf, Metadaten daneben */
.exp-pager { display: flex; align-items: center; gap: var(--exp-space-2xs); }
.exp-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-xs); }
/* Zoomanzeige in der Werkzeugleiste eines Belegs */
.exp-zoom-label { min-width: 3.2rem; text-align: center; }

/* =========================================================
   6. Eckdaten (Definitionsliste)
   Zweck: Bezeichnung über dem Wert, zwei Spalten (.exp-span-2 über beide); data-layout="rows":
   Bezeichnung links, Wert rechts (Details, Popover, Zusammenfassung).
   Beispiel: pages/mandant.html, pages/belege.html (Schnellansicht), pages/postkorb.html, komponenten/rueckmeldung.html
   ========================================================= */
.exp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--exp-space-sm) var(--exp-space-md); margin: 0; }
.exp-facts > div { display: grid; gap: 2px; align-content: start; min-width: 0; }
.exp-facts dt { font-size: var(--exp-text-sm); font-weight: 400; color: var(--exp-text-2); }
.exp-facts dd { margin: 0; overflow-wrap: anywhere; }
.exp-facts .exp-span-2 { grid-column: 1 / -1; }
.exp-facts[data-layout='rows'] { grid-template-columns: minmax(0, 1fr); gap: var(--exp-space-xs); }
.exp-facts[data-layout='rows'] > div { grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: var(--exp-space-md); min-height: 24px; }
.exp-facts[data-layout='rows'] dd { min-width: 0; font-size: var(--exp-text-sm); color: var(--exp-text); }

@media (max-width: 639.98px) {
  .exp-facts { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================
   7. Tabs in einer Zeile
   Zweck: Bootstrap .nav-tabs in .exp-tabs, schmal seitlich scrollbar, Zähler im Tab.
   Beispiel: pages/mandant.html
   ========================================================= */
.exp-tabs { position: relative; min-width: 0; overflow-x: auto; scrollbar-width: none; border-block-end: 1px solid var(--exp-border); scroll-margin-top: calc(var(--exp-topbar-h) + var(--exp-space-lg)); }
.exp-tabs::-webkit-scrollbar { display: none; }
.exp-tabs .nav-tabs { flex-wrap: nowrap; border-block-end: 0; }
.exp-tabs .nav-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; margin-block-end: 0; padding-block: 10px; }
.exp-tabs .nav-link .exp-countpill { height: 20px; padding: 0 7px; }
.exp-tabs .nav-link.active .exp-countpill { background: var(--exp-accent-muted); color: var(--exp-text-accent); }
.exp-main > .tab-content,
.exp-stack > .tab-content { min-width: 0; }

/* =========================================================
   8. Listen in Karten
   Zweck: Personen mit Kontakt-Buttons (.exp-people), offene Aufgaben (.exp-tasklist), Hinweise zum Beleg
   (.exp-issues), Abhaken (.exp-checklist, .exp-todo-list), Zeilen mit Seitenleiste (.exp-rowlist),
   Fristen (.exp-deadlines), Hilfe (.exp-help-list), Dateien mit Kontextmenü (.exp-filelist).
   Beispiel: pages/mandant.html, pages/beleg-detail.html, pages/aufgaben.html, komponenten/rueckmeldung.html
   ========================================================= */
/* Personen: Avatar, Name, Rolle, rechts Kontakt-Buttons */
.exp-people { list-style: none; margin: 0; padding: var(--exp-space-2xs) 0; }
.exp-person { display: flex; align-items: center; gap: var(--exp-space-sm); padding: var(--exp-space-xs) var(--exp-space-lg); }
.exp-person-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.exp-person-name { font-weight: 600; }
.exp-person-actions { display: flex; flex: none; gap: var(--exp-space-3xs); }
.exp-people + .exp-panel-group { border-block-start: 1px solid var(--exp-border); padding-block-start: var(--exp-space-md); }

/* Offene Aufgaben: Kästchen, Titel, Fälligkeit, optional Badge */
.exp-tasklist { list-style: none; margin: 0; padding: 0; }
.exp-tasklist li { display: flex; align-items: flex-start; gap: var(--exp-space-sm); padding: var(--exp-space-sm) var(--exp-space-lg); }
.exp-tasklist li + li { border-block-start: 1px solid var(--exp-border); }
.exp-tasklist .form-check-input { flex: none; margin-block-start: 1px; cursor: pointer; }
.exp-tasklist label { display: grid; gap: 1px; min-width: 0; flex: 1; cursor: pointer; }
.exp-tasklist li > .exp-badge { flex: none; }
.exp-tasklist li:has(.form-check-input:checked) .exp-tasklist-title { color: var(--exp-text-2); text-decoration: line-through; }

/* Hinweise zum Beleg: offen mit Aktion, erledigt (data-done) gedämpft */
.exp-issues { display: grid; margin: 0; padding: 0; list-style: none; }
.exp-issues li { display: flex; align-items: center; gap: var(--exp-space-xs); padding: var(--exp-space-xs) var(--exp-space-lg); font-size: var(--exp-text-sm); }
.exp-issues li + li { border-block-start: 1px solid var(--exp-border); }
.exp-issues li > span { flex: 1; min-width: 0; }
.exp-issues li > .lucide { width: 16px; height: 16px; color: var(--exp-warning-fg); }
.exp-issues li[data-done] { min-height: calc(var(--exp-control-sm) + 2 * var(--exp-space-xs)); color: var(--exp-text-2); }
.exp-issues li[data-done] > .lucide { color: var(--exp-success-fg); }

/* Checkliste ohne Rahmen (in Seitenleisten) */
.exp-checklist { display: grid; gap: var(--exp-space-xs); margin: 0; padding: 0; list-style: none; }
.exp-checklist .form-check { margin: 0; }
.exp-checklist .form-check-input:checked + .form-check-label { color: var(--exp-text-2); text-decoration: line-through; }

/* Aufgabenliste mit Rahmen und Abhaken (.is-done) */
.exp-todo-list { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--exp-border); border-radius: var(--exp-radius); }
.exp-todo { padding: var(--exp-space-sm) var(--exp-space-md); }
.exp-todo + .exp-todo { border-block-start: 1px solid var(--exp-border); }
.exp-todo .form-check { margin: 0; }
.exp-todo.is-done .form-check-label { color: var(--exp-text-2); text-decoration: line-through; }

/* Zeilen, die eine Seitenleiste öffnen (.is-active = geöffnet) */
.exp-rowlist { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--exp-border); border-radius: var(--exp-radius); overflow: hidden; }
.exp-rowlist > li + li { border-block-start: 1px solid var(--exp-border); }
.exp-rowlist-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--exp-space-lg);
  width: 100%;
  padding: var(--exp-space-sm) var(--exp-space-md);
  border: 0;
  background: transparent;
  color: var(--exp-text);
  font: inherit;
  text-align: start;
  transition: background-color var(--exp-dur-1) var(--exp-ease);
}
.exp-rowlist-item:hover { background: var(--exp-surface-muted); }
.exp-rowlist-item:focus-visible { outline-offset: -2px; }
.exp-rowlist-item.is-active { background: var(--exp-accent-muted); box-shadow: inset 3px 0 0 var(--exp-accent); }
.exp-rowlist-item > .lucide { width: 16px; height: 16px; color: var(--exp-text-2); }
.exp-rowlist-item .exp-client > .d-grid { min-width: 0; }

/* Fristen in einer Seitenleiste */
.exp-deadlines { display: grid; margin: 0; padding: 0; list-style: none; }
.exp-deadlines > li { display: flex; align-items: center; justify-content: space-between; gap: var(--exp-space-md); padding-block: var(--exp-space-sm); }
.exp-deadlines > li + li { border-block-start: 1px solid var(--exp-border); }
/* Hilfe-Liste mit Pille oder Taste vorne */
.exp-help-list { display: grid; gap: var(--exp-space-sm); margin: 0; padding: 0; list-style: none; font-size: var(--exp-text-sm); }
.exp-help-list > li { display: flex; align-items: center; gap: var(--exp-space-xs); }

/* Dateien mit Kontextmenü (Rechtsklick oder Umschalt F10) */
.exp-filelist { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--exp-border); border-radius: var(--exp-radius); overflow: hidden; }
.exp-filelist > li + li { border-block-start: 1px solid var(--exp-border); }
.exp-filelist-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--exp-space-md);
  padding: var(--exp-space-xs) var(--exp-space-xs) var(--exp-space-xs) var(--exp-space-md);
  cursor: context-menu;
  transition: background-color var(--exp-dur-1) var(--exp-ease);
}
.exp-filelist-item:hover { background: var(--exp-surface-muted); }
.exp-filelist-item:focus-visible { outline-offset: -2px; }
.exp-filelist-item > .lucide { color: var(--exp-text-2); }
.exp-filelist-item > .d-grid { min-width: 0; }
.exp-filelist-item .exp-strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 767.98px) {
  .exp-rowlist-item { gap: var(--exp-space-md); }
}
@media (max-width: 639.98px) {
  .exp-person, .exp-tasklist li { padding-inline: var(--exp-space-md); }
  .exp-issues li { padding-inline: var(--exp-space-md); }
  .exp-filelist-item { gap: var(--exp-space-sm); }
}

/* =========================================================
   9. Sortierbare Liste und Baum
   Zweck: Checkliste mit Ziehen und Pfeiltasten (.exp-sortlist, .exp-grip), Ordnerbaum (role="tree", .exp-tree).
   Beispiel: komponenten/daten.html
   ========================================================= */
.exp-sortlist { margin: 0; padding: 0; list-style: none; }
.exp-sortlist > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--exp-space-sm);
  padding: 10px var(--exp-space-lg) 10px var(--exp-space-sm);
  background: var(--exp-surface);
  transition: background-color var(--exp-dur-1) var(--exp-ease), opacity var(--exp-dur-1) var(--exp-ease);
}
.exp-sortlist > li + li { border-block-start: 1px solid var(--exp-border); }
.exp-sortlist > li:hover { background: var(--exp-surface-muted); }
.exp-sortlist .form-check { margin: 0; }
.exp-sortlist .form-check .exp-sub { display: block; }
/* Erledigt: bleibt an seiner Stelle, Text leiser und durchgestrichen */
.exp-sortlist > li.is-done .form-check-label { color: var(--exp-text-2); text-decoration: line-through; }
/* Beim Ziehen: Zeile blass, Ablagestelle als Linie im CI-Blau */
.exp-sortlist > li.is-dragging { opacity: 0.45; }
.exp-sortlist > li.is-drop-before { box-shadow: inset 0 2px 0 var(--exp-accent); }
.exp-sortlist > li.is-drop-after { box-shadow: inset 0 -2px 0 var(--exp-accent); }
.exp-grip {
  display: grid;
  place-items: center;
  width: 28px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: var(--exp-text-2);
  cursor: grab;
  touch-action: none;
}
.exp-grip:hover { background: var(--exp-neutral-bg); color: var(--exp-text); }
.exp-grip:active { cursor: grabbing; }
.exp-grip .lucide { width: 16px; height: 16px; }
.exp-sortlist-end { display: flex; align-items: center; gap: var(--exp-space-xs); }
/* Pfeil-Buttons erscheinen beim Überfahren und bei Fokus, auf Touch immer */
.exp-sortlist-moves { display: flex; opacity: 0; transition: opacity var(--exp-dur-1) var(--exp-ease); }
.exp-sortlist > li:hover .exp-sortlist-moves,
.exp-sortlist > li:focus-within .exp-sortlist-moves { opacity: 1; }
@media (hover: none) { .exp-sortlist-moves { opacity: 1; } }

.exp-tree, .exp-tree [role='group'] { margin: 0; padding: 0; list-style: none; }
.exp-tree [role='group'] {
  margin-inline-start: 17px;
  padding-inline-start: 6px;
  border-inline-start: 1px solid var(--exp-border);
}
.exp-tree [aria-expanded='false'] > [role='group'] { display: none; }
.exp-tree [role='treeitem'] { outline: 0; }
.exp-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin-block: 1px;
  padding: 0 var(--exp-space-xs) 0 2px;
  border-radius: var(--exp-radius-sm);
  color: var(--exp-text);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--exp-dur-1) var(--exp-ease);
}
.exp-tree-row:hover { background: var(--exp-surface-muted); }
.exp-tree [role='treeitem']:focus-visible > .exp-tree-row { outline: 2px solid var(--exp-focus); outline-offset: -2px; }
/* Gewählter Knoten: die einzige Akzentfläche im Baum */
.exp-tree [aria-selected='true'] > .exp-tree-row { background: var(--exp-accent-muted); font-weight: 600; }
.exp-tree [aria-selected='true'] > .exp-tree-row > .lucide { color: var(--exp-text-accent); }
.exp-tree-toggle { display: grid; place-items: center; flex: none; width: 20px; height: 20px; color: var(--exp-text-2); }
.exp-tree-toggle .lucide { width: 14px; height: 14px; transition: transform var(--exp-dur-2) var(--exp-ease); }
[aria-expanded='true'] > .exp-tree-row .exp-tree-toggle .lucide { transform: rotate(90deg); }
.exp-tree-row > .lucide { width: 16px; height: 16px; color: var(--exp-text-2); }
.exp-tree-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exp-tree-count { font-size: var(--exp-text-xs); color: var(--exp-text-2); font-variant-numeric: tabular-nums; }
/* Ungelesene Anzahl fett, andere Zahlen leise */
.exp-tree-count.is-unread { color: var(--exp-text); font-weight: 700; }
.exp-tree-head { padding: 0 var(--exp-space-xs) var(--exp-space-xs); font-weight: 600; }

@media (max-width: 639.98px) {
  .exp-sortlist > li { padding-inline-end: var(--exp-space-md); gap: var(--exp-space-xs); }
}

/* =========================================================
   10. Verlauf
   Zweck: Ereignisse mit Icon im Kreis und Linie dazwischen (.exp-timeline > .exp-event, kompakt mit
   .exp-timeline-compact, direkt im Panel mit Innenabstand), nach Tagen gruppiert (.exp-feed),
   schlichter Verlauf ohne Kreise (.exp-history).
   Beispiel: komponenten/kommunikation.html, pages/mandant.html (Letzte Aktivität), pages/aufgaben.html (Detail)
   ========================================================= */
.exp-feed { display: grid; gap: var(--exp-space-lg); justify-items: start; }
.exp-feed > .exp-feed-day { width: 100%; }
.exp-feed-day { display: grid; gap: var(--exp-space-sm); }
.exp-feed-day[hidden] { display: none; }
.exp-feed-day-head { font-size: var(--exp-text-sm); font-weight: 600; color: var(--exp-text-2); }
.exp-feed-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-sm); }

.exp-timeline { display: grid; margin: 0; padding: 0; list-style: none; }
/* Direkt im Panel (ohne .exp-panel-body): Innenabstand wie eine Panel-Zeile */
.exp-panel > .exp-timeline { padding: var(--exp-space-md) var(--exp-space-lg); }
.exp-event { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--exp-space-sm); padding-block-end: var(--exp-space-md); }
.exp-event[hidden] { display: none; }
.exp-event:last-child,
.exp-event.is-end { padding-block-end: 0; }
/* Senkrechte Linie verbindet die Ereignisse (neutral, kein Farbstreifen) */
.exp-event::before {
  content: '';
  position: absolute;
  inset-block: 32px 0;
  inset-inline-start: 15.5px;
  width: 1px;
  background: var(--exp-border);
}
.exp-event:last-child::before,
.exp-event.is-end::before { display: none; }
.exp-event-node {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--exp-border);
  border-radius: 50%;
  background: var(--exp-surface);
  color: var(--exp-text-2);
}
.exp-event-node .lucide { width: 16px; height: 16px; }
.exp-event-node[data-tone='success'] { border-color: var(--exp-success-fg); color: var(--exp-success-fg); }
.exp-event-node[data-tone='danger'] { border-color: var(--exp-danger-fg); color: var(--exp-danger-fg); }
.exp-event-body { display: grid; gap: var(--exp-space-3xs); min-width: 0; padding-block-start: 5px; }
.exp-event-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--exp-space-2xs) var(--exp-space-xs); }
.exp-event-detail {
  justify-self: start;
  max-width: 100%;
  margin-block-start: var(--exp-space-2xs);
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-muted);
  font-size: var(--exp-text-sm);
  overflow-wrap: anywhere;
}
.exp-event-change { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-xs); }
.exp-event-change .lucide { width: 14px; height: 14px; color: var(--exp-text-2); }

.exp-timeline-compact .exp-event { grid-template-columns: 24px minmax(0, 1fr); padding-block-end: var(--exp-space-sm); }
.exp-timeline-compact .exp-event::before { inset-block-start: 24px; inset-inline-start: 11.5px; }
.exp-timeline-compact .exp-event-node { width: 24px; height: 24px; }
.exp-timeline-compact .exp-event-node .lucide { width: 13px; height: 13px; }
.exp-timeline-compact .exp-event-body { padding-block-start: 1px; }

/* Schlichter Verlauf: Icon, Ereignis, Zeitpunkt; keine Punkte ohne Text */
.exp-history { display: grid; gap: var(--exp-space-sm); margin: 0; padding: 0; list-style: none; font-size: var(--exp-text-sm); }
.exp-history > li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 2px var(--exp-space-xs); }
.exp-history > li > .lucide { width: 16px; height: 16px; margin-block-start: 2px; color: var(--exp-text-2); }
.exp-history > li > .exp-sub { grid-column: 2; font-size: var(--exp-text-xs); }

@media (max-width: 639.98px) {
  .exp-panel > .exp-timeline { padding-inline: var(--exp-space-md); }
}

/* =========================================================
   11. Kommentare mit @Erwähnung
   Zweck: Kommentarliste mit Antworten, Eingabe mit Personenliste beim Tippen von @.
   Beispiel: komponenten/kommunikation.html, pages/aufgaben.html (Detail)
   ========================================================= */
.exp-comment-thread { display: grid; gap: var(--exp-space-lg); }
.exp-comments { display: grid; gap: var(--exp-space-md); margin: 0; padding: 0; list-style: none; }
/* Der leere Kommentarbereich bleibt im Dokumentfluss unter dem Eingabefeld. */
.exp-task-comments-empty { display: grid; position: static; justify-items: center; gap: var(--exp-space-xs); padding: var(--exp-space-lg); text-align: center; }
.exp-task-comments-empty > .lucide { width: 28px; height: 28px; color: var(--exp-text-2); }
.exp-comment { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--exp-space-sm); }
.exp-comment-body { display: grid; gap: var(--exp-space-3xs); min-width: 0; }
.exp-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--exp-space-2xs) var(--exp-space-xs); }
.exp-comment-text { margin: 0; line-height: 1.6; color: var(--exp-text); overflow-wrap: anywhere; }
/* Ghost-Button bündig zum Text */
.exp-comment-actions { margin-inline-start: -10px; }
.exp-comment-replies { margin-block-start: var(--exp-space-sm); }
.exp-mention { font-weight: 600; color: var(--exp-text-accent); }
.exp-mention.is-me { padding: 0 var(--exp-space-3xs); border-radius: var(--exp-radius-sm); background: var(--exp-accent-muted); }

.exp-comment-composer { display: grid; gap: var(--exp-space-xs); min-width: 0; }
.exp-comment-composer textarea.form-control { min-height: 72px; resize: vertical; }
.exp-comment-composer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--exp-space-xs) var(--exp-space-sm); }

/* Personenliste beim Tippen von @: öffnet nach oben, weil die Eingabe unten steht */
.exp-mention-wrap { position: relative; }
.exp-mention-menu {
  position: absolute;
  inset-block-end: calc(100% + var(--exp-space-2xs));
  inset-inline-start: 0;
  z-index: 10;
  display: grid;
  gap: var(--exp-space-3xs);
  width: min(100%, 300px);
  padding: var(--exp-space-2xs);
  border: 1px solid var(--exp-card-edge);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-raised);
  box-shadow: var(--exp-shadow-pop);
}
.exp-mention-menu[hidden] { display: none; }
.exp-mention-menu ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.exp-mention-menu-head,
.exp-mention-empty { padding: var(--exp-space-2xs) var(--exp-space-xs); font-size: var(--exp-text-xs); font-weight: 600; color: var(--exp-text-2); }
.exp-mention-empty { font-weight: 400; }
.exp-mention-option {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  min-height: 36px;
  padding: 0 var(--exp-space-xs);
  border-radius: var(--exp-radius-sm);
  cursor: pointer;
}
.exp-mention-option .exp-sub { margin-inline-start: auto; font-size: var(--exp-text-xs); }
.exp-mention-option:hover { background: var(--exp-surface-muted); }
.exp-mention-option[aria-selected='true'] { background: var(--exp-accent-muted); }
.exp-mention-option .exp-avatar { width: 24px; height: 24px; font-size: 9px; }

/* =========================================================
   12. Board
   Zweck: Spalten nach Status mit Karten darin (Karten selbst sind seitenbezogen).
   Beispiel: pages/aufgaben.html (Ansicht „Board“)
   ========================================================= */
.exp-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--exp-space-md); align-items: start; }
.exp-board[hidden] { display: none; }
.exp-board-col { display: grid; gap: var(--exp-space-sm); padding: var(--exp-space-sm); border-radius: var(--exp-radius-lg); background: var(--exp-surface-muted); }
.exp-board-head { display: flex; align-items: center; gap: var(--exp-space-xs); padding: var(--exp-space-2xs) var(--exp-space-2xs) 0; }
.exp-board-list { display: grid; gap: var(--exp-space-xs); margin: 0; padding: 0; list-style: none; }

@media (max-width: 1199.98px) {
  .exp-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639.98px) {
  .exp-board { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================
   13. Belegpapier: Ergänzungen zu .exp-paper (expenia-ui.css, Abschnitt 13)
   Zweck: Kopf mit Absender und Empfänger, Positionen, Steuersummen, Titel, Fließtext, Unterschriftslinie,
   Miniatur (Textzeilen werden zu Balken).
   Beispiel: pages/beleg-detail.html, pages/postkorb.html, komponenten/dokumente.html
   ========================================================= */
.exp-paper-head { display: flex; justify-content: space-between; gap: 4cqw; }
.exp-paper-head > div:last-child { text-align: end; }
.exp-paper-items { display: grid; gap: 0.4cqw; }
.exp-paper-sums { display: grid; gap: 0.4cqw; justify-self: start; min-width: 62cqw; }
.exp-paper-sum { display: grid; grid-template-columns: minmax(0, 1fr) 14cqw 6cqw 12cqw; gap: 2cqw; }
.exp-paper-sum > .num { text-align: end; }
.exp-paper-sums > .exp-paper-total { margin-block-start: 1cqw; }
.exp-paper-inner .exp-paper-title { font-size: 3.8cqw; font-weight: 600; line-height: 1.25; }
.exp-paper-text { display: grid; gap: 0.4cqw; color: var(--exp-text-2); }
.exp-paper-signline {
  display: grid;
  gap: 0.6cqw;
  width: 55cqw;
  margin-block-start: 10cqw;
  padding-block-start: 1.2cqw;
  border-block-start: 1px solid var(--exp-text-2);
  color: var(--exp-text-2);
}
.exp-paper-thumb { pointer-events: none; overflow: hidden; }
.exp-paper-thumb span { color: transparent; background: var(--exp-border); border-radius: 1px; }
.exp-paper-thumb .exp-paper-from span,
.exp-paper-thumb .exp-paper-title span { background: var(--exp-text-2); opacity: 0.5; }

/* =========================================================
   14. Buchungssatz und Summenprüfung
   Zweck: Buchungszeilen mit festen Spalten, Zeile zum Bearbeiten aufgeklappt (.exp-edit),
   Summenprüfung im Panel-Fuß (.exp-sum[data-ok]).
   Beispiel: pages/beleg-detail.html
   ========================================================= */
.table.exp-booking { min-width: 560px; table-layout: fixed; font-size: var(--exp-text-sm); }
.table.exp-booking > :not(caption) > * > * { padding-inline: var(--exp-space-xs); }
.table.exp-booking > :not(caption) > * > *:first-child { padding-inline-start: var(--exp-space-lg); }
.table.exp-booking > :not(caption) > * > *:last-child { padding-inline-end: var(--exp-space-md); }
.table.exp-booking > thead > tr > th:nth-child(1) { width: 80px; }
.table.exp-booking > thead > tr > th:nth-child(3) { width: 70px; }
.table.exp-booking > thead > tr > th:nth-child(4) { width: 66px; }
.table.exp-booking > thead > tr > th:nth-child(5) { width: 56px; }
.table.exp-booking > thead > tr > th:nth-child(6) { width: 36px; }
.table.exp-booking > thead > tr > th:nth-child(7) { width: 46px; }
.table.exp-booking > thead > tr > th:nth-child(8) { width: 52px; }
.table.exp-booking .exp-cell > .exp-sub { overflow-wrap: anywhere; }
.table.exp-booking > tbody > tr[data-editing] > * { border-block-end-color: transparent; background: var(--exp-surface-muted); }
.table.exp-booking > tbody > tr.exp-edit-row > * { background: var(--exp-surface-muted); }
.exp-edit { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--exp-space-sm); align-items: end; padding-block: var(--exp-space-2xs) var(--exp-space-xs); }
.exp-edit-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--exp-space-xs); }

.exp-sum { display: inline-flex; align-items: center; gap: var(--exp-space-2xs); color: var(--exp-text); }
.exp-sum > .lucide { width: 16px; height: 16px; color: var(--exp-warning-fg); }
.exp-sum[data-ok] { color: var(--exp-text-2); }
.exp-sum[data-ok] > .lucide { color: var(--exp-success-fg); }

@media (max-width: 639.98px) {
  /* Die Tabelle scrollt seitlich; das Bearbeitungsformular bleibt in Bildschirmbreite stehen */
  .exp-edit {
    grid-template-columns: minmax(0, 1fr);
    position: sticky;
    inset-inline-start: var(--exp-space-md);
    width: calc(100vw - 4 * var(--exp-space-md) - 2px);
  }
  .table.exp-booking > :not(caption) > * > *:first-child { padding-inline-start: var(--exp-space-md); }
}

/* =========================================================
   15. Dialoge
   Zweck: Dialog-Vorschau ohne .modal-Hülle (.exp-modal-inline), Kopf mit Zusatz rechts, Beleg und Buchung
   nebeneinander im XL-Dialog (.exp-booking-split, .exp-receipt), Assistent mit Schrittanzeige
   (.exp-stepper, .exp-step[data-state=done|current|upcoming]), Unterzeichner (.exp-signers).
   Beispiel: komponenten/rueckmeldung.html
   ========================================================= */
.exp-modal-inline {
  --bs-modal-width: 560px;
  --bs-modal-margin: 0;
  --bs-modal-padding: var(--exp-space-lg);
  --bs-modal-color: var(--exp-text);
  --bs-modal-bg: var(--exp-surface-raised);
  --bs-modal-border-color: var(--exp-card-edge);
  --bs-modal-border-width: 1px;
  --bs-modal-border-radius: var(--exp-radius-lg);
  --bs-modal-inner-border-radius: calc(var(--exp-radius-lg) - 1px);
  --bs-modal-box-shadow: var(--exp-shadow-pop);
  --bs-modal-header-padding-x: var(--exp-space-lg);
  --bs-modal-header-padding-y: var(--exp-space-md);
  --bs-modal-header-padding: var(--exp-space-md) var(--exp-space-lg);
  --bs-modal-header-border-color: var(--exp-border);
  --bs-modal-header-border-width: 1px;
  --bs-modal-title-line-height: 1.3;
  --bs-modal-footer-gap: var(--exp-space-xs);
  --bs-modal-footer-bg: transparent;
  --bs-modal-footer-border-color: var(--exp-border);
  --bs-modal-footer-border-width: 1px;
}
.exp-modal-inline > .modal-dialog { width: 100%; max-width: min(100%, var(--bs-modal-width)); margin: 0; pointer-events: auto; }

/* Kopf mit Zusatz rechts (Konfidenz) vor dem Schließen */
.exp-modal-head-end { display: flex; align-items: center; gap: var(--exp-space-sm); margin-inline-start: auto; }
.exp-modal-head-end .btn-close { margin: 0; }

/* XL: Beleg links, Buchung rechts */
.exp-booking-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--exp-space-lg); align-items: start; }
.exp-receipt {
  display: grid;
  gap: var(--exp-space-md);
  margin: 0;
  padding: var(--exp-space-md);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
  box-shadow: var(--exp-shadow-xs);
}
.exp-receipt-head { display: grid; gap: var(--exp-space-3xs); }
.exp-receipt-meta,
.exp-receipt-sum {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--exp-space-2xs) var(--exp-space-md);
  margin: 0;
  font-size: var(--exp-text-sm);
}
.exp-receipt-meta { grid-template-columns: auto minmax(0, 1fr); }
.exp-receipt-meta dt { white-space: nowrap; }
.exp-receipt-meta dt, .exp-receipt-sum dt { font-weight: 400; color: var(--exp-text-2); }
.exp-receipt-meta dd, .exp-receipt-sum dd { margin: 0; text-align: end; }
.exp-receipt-sum { padding-block-start: var(--exp-space-sm); border-block-start: 1px solid var(--exp-border); }
.exp-receipt-sum dt.exp-strong { color: var(--exp-text); font-weight: 600; }

/* Assistent: Schrittanzeige, ein Schritt pro Ansicht */
.exp-wizard-body { display: grid; gap: var(--exp-space-lg); }
/* Schritte mit Hilfsklassen (.d-grid) trotzdem verbergen */
.exp-wizard-body > [hidden] { display: none !important; }
.exp-wizard-foot { justify-content: space-between; }
.exp-wizard-narrow { max-width: 280px; }
.exp-stepper { display: flex; align-items: center; gap: var(--exp-space-sm); margin: 0; padding: 0; list-style: none; }
.exp-step { display: flex; flex: 1 1 0; align-items: center; gap: var(--exp-space-sm); min-width: 0; }
.exp-step:last-child { flex: 0 1 auto; }
.exp-step:not(:last-child)::after { content: ''; flex: 1 1 var(--exp-space-md); min-width: var(--exp-space-md); height: 1px; background: var(--exp-border); }
.exp-step[data-state='done']:not(:last-child)::after { background: var(--exp-accent); }
.exp-step-btn {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  min-width: 0;
  margin: calc(-1 * var(--exp-space-2xs));
  padding: var(--exp-space-2xs);
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: var(--exp-text);
  font: inherit;
  text-align: start;
}
.exp-step-btn:disabled { cursor: default; }
.exp-step-btn:not(:disabled):hover .exp-step-label { text-decoration: underline; }
.exp-step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--exp-border-strong);
  border-radius: 50%;
  color: var(--exp-text-2);
  font-size: var(--exp-text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.exp-step-num .lucide { display: none; width: 16px; height: 16px; }
.exp-step[data-state='current'] .exp-step-num { border-color: var(--exp-accent); background: var(--exp-accent); color: var(--exp-on-accent); }
.exp-step[data-state='done'] .exp-step-num { border-color: transparent; background: var(--exp-accent-muted); color: var(--exp-text-accent); }
.exp-step[data-state='done'] .exp-step-num > span { display: none; }
.exp-step[data-state='done'] .exp-step-num .lucide { display: block; }
.exp-step-text { display: grid; min-width: 0; line-height: 1.3; }
.exp-step-label { overflow: hidden; font-size: var(--exp-text-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.exp-step[data-state='upcoming'] .exp-step-label { color: var(--exp-text-2); font-weight: 500; }
.exp-step-desc { overflow: hidden; font-size: var(--exp-text-xs); color: var(--exp-text-2); text-overflow: ellipsis; white-space: nowrap; }

/* Unterzeichner */
.exp-signers { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--exp-border); border-radius: var(--exp-radius); }
.exp-signer {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--exp-space-sm);
  padding: var(--exp-space-xs) var(--exp-space-xs) var(--exp-space-xs) var(--exp-space-md);
}
.exp-signer + .exp-signer { border-block-start: 1px solid var(--exp-border); }
.exp-signer-empty { display: block; padding: var(--exp-space-sm) var(--exp-space-md); }
.exp-signer-no { font-size: var(--exp-text-sm); color: var(--exp-text-2); text-align: center; }
.exp-signer .exp-client > .d-grid { min-width: 0; }
.exp-signer .exp-client .exp-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-signer-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: var(--exp-space-md); }

/* Inhalt reagiert auf die Breite des Dialogs (.modal-body ist Container, siehe expenia-ui.css) */
@container (max-width: 640px) {
  .exp-booking-split { grid-template-columns: minmax(0, 1fr); }
  .exp-step-desc { display: none; }
}
@container (max-width: 480px) {
  .modal-body .exp-form-grid,
  .exp-signer-add { grid-template-columns: minmax(0, 1fr); }
  .exp-step:not([data-state='current']) .exp-step-text { display: none; }
}

/* =========================================================
   16. Toast, Seitenleiste, Popover, Vorschaukarte
   Zweck: Toast mit Aktion und Fehlerton (data-tone="danger"), schmale Seitenleiste (360 px),
   UVA-Zeiträume (.exp-period[data-status=done|review|missing|open|future]), Popover ohne Innenabstand
   (.exp-popover-flush, .exp-pop), Vorschaukarte im Fließtext (.exp-hover-trigger).
   Beispiel: komponenten/rueckmeldung.html
   ========================================================= */
.toast:has(.exp-toast-action) { --bs-toast-max-width: 440px; }
.exp-toast-text { flex: 1; min-width: 0; }
.exp-toast-action { flex: none; }
.toast[data-tone='danger'] .toast-body > .lucide { color: var(--exp-danger-fg); }

.exp-offcanvas-sm { --bs-offcanvas-width: 360px; }

.exp-uva { display: grid; gap: var(--exp-space-md); }
.exp-uva-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: center;
  gap: var(--exp-space-lg);
  padding-block-end: var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
}
.exp-periods { display: flex; flex-wrap: wrap; gap: var(--exp-space-xs); }
.exp-period {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--exp-space-2xs);
  min-width: 52px;
  height: var(--exp-control-sm);
  padding-inline: var(--exp-space-sm);
  border: 1px solid transparent;
  border-radius: var(--exp-radius-sm);
  font: inherit;
  font-size: var(--exp-text-sm);
  font-weight: 600;
  cursor: pointer;
}
.exp-period .lucide { width: 13px; height: 13px; }
.exp-period[data-status='done'] { background: var(--exp-success-bg); color: var(--exp-success-text); }
.exp-period[data-status='review'] { background: var(--exp-info-bg); color: var(--exp-info-text); }
.exp-period[data-status='missing'] { background: var(--exp-warning-bg); color: var(--exp-warning-text); }
.exp-period[data-status='open'] { background: var(--exp-neutral-bg); color: var(--exp-neutral-text); }
.exp-period[data-status='future'] { border-style: dashed; border-color: var(--exp-border-strong); background: transparent; color: var(--exp-text-2); font-weight: 500; }
/* Die sieben Fachstatus des Moduls accounting (eigene Farben wie im alten Design, Tokens
   --exp-period-*; siehe DESIGN.md Abschnitt 8). Storniert bleibt neutral. Der Kurztext und
   ein Lucide-Symbol stehen immer dabei, die Farbe trägt nie allein. */
.exp-period[data-status='pending'] { background: var(--exp-period-pending-bg); color: var(--exp-period-pending-text); }
.exp-period[data-status='received'] { background: var(--exp-period-received-bg); color: var(--exp-period-received-text); }
.exp-period[data-status='booking'] { background: var(--exp-period-booking-bg); color: var(--exp-period-booking-text); }
.exp-period[data-status='booked'] { background: var(--exp-period-booked-bg); color: var(--exp-period-booked-text); }
.exp-period[data-status='awaiting'] { background: var(--exp-period-awaiting-bg); color: var(--exp-period-awaiting-text); }
.exp-period[data-status='approved'] { background: var(--exp-period-approved-bg); color: var(--exp-period-approved-text); }
.exp-period[data-status='submitted'] { background: var(--exp-period-submitted-bg); color: var(--exp-period-submitted-text); }
.exp-period[data-status='cancelled'] { background: var(--exp-neutral-bg); color: var(--exp-neutral-text); }
/* Zukunft ergänzt den Fachstatus: gestrichelter Rahmen, kein Flächenfarbe; der Status bleibt
   im zugänglichen Namen und Popover erhalten. */
.exp-period[data-future] { border-style: dashed; border-color: var(--exp-border-strong); background: transparent; color: var(--exp-text-2); }
/* Zusatzhinweis „überfällig“: kleines Warnsymbol in der Farbe der Chipschrift */
.exp-period .exp-period-flag { width: 11px; height: 11px; flex: none; }
/* Kein Unterstrich am Periodenchip (auch nicht beim Überfahren oder offenem Popover):
   Rückmeldung gibt der Zeiger, die Tastatur behält den globalen Fokus-Ring. */
.exp-period,
.exp-period:hover,
.exp-period:focus,
.exp-period:active,
.exp-period:visited,
.exp-period > span { text-decoration: none; }
/* Laufender Zeitraum: Ring außen in Akzentfarbe */
.exp-period[data-current='true'] { box-shadow: 0 0 0 2px var(--exp-surface), 0 0 0 4px var(--exp-accent); }
.exp-period-mini { min-width: 0; width: 24px; height: 18px; padding: 0; border-radius: 4px; cursor: default; }
.exp-period-mini .lucide { width: 11px; height: 11px; }
.exp-period-legend { display: flex; flex-wrap: wrap; gap: var(--exp-space-xs) var(--exp-space-lg); margin: 0; padding: 0; list-style: none; font-size: var(--exp-text-xs); color: var(--exp-text-2); }
.exp-period-legend > li { display: inline-flex; align-items: center; gap: var(--exp-space-xs); }

/* Popover ohne Innenabstand: Inhalt gliedert sich selbst */
.popover.exp-popover-flush { --bs-popover-max-width: 320px; --bs-popover-body-padding-x: 0; --bs-popover-body-padding-y: 0; width: 300px; max-width: calc(100vw - 2 * var(--exp-space-md)); }
.exp-pop { display: grid; }
.exp-pop > * { margin: 0; padding: var(--exp-space-sm) var(--exp-space-md); }
.exp-pop > * + * { border-block-start: 1px solid var(--exp-border); }
.exp-pop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--exp-space-sm); }
.exp-pop-months { display: grid; gap: var(--exp-space-2xs); }
.exp-pop-months > div { display: grid; grid-template-columns: minmax(0, 1fr) auto 88px; gap: var(--exp-space-sm); font-size: var(--exp-text-sm); }
.exp-pop-months dt { font-weight: 400; }
.exp-pop-months dd { margin: 0; text-align: end; }
.exp-pop .exp-facts[data-layout='rows'] > div { grid-template-columns: 96px minmax(0, 1fr); }
.exp-pop-foot { font-size: var(--exp-text-sm); }

/* Vorschaukarte: gestrichelt unterstrichener Auslöser im Fließtext */
.exp-hover-prose { max-width: 64ch; line-height: 1.8; }
.exp-hover-trigger {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--exp-text);
  font: inherit;
  font-weight: 600;
  text-decoration: underline dashed var(--exp-border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: default;
}
.exp-hover-trigger:hover, .exp-hover-trigger[aria-describedby] { text-decoration-color: var(--exp-text-2); }
.exp-hovercard-body { display: grid; gap: var(--exp-space-md); padding: var(--exp-space-md); }

@media (max-width: 767.98px) {
  .exp-uva-row { grid-template-columns: minmax(0, 1fr); gap: var(--exp-space-sm); }
}

/* =========================================================
   17. Benachrichtigungen, Kontextmenü, Aufklappen
   Zweck: Benachrichtigungsmenü (.exp-inbox-menu, .exp-note[data-unread]), Kontextmenü an Mausposition mit
   Untermenü (.exp-ctxmenu, .exp-submenu.is-open|.is-flipped), Zeile mit Details (.exp-line, .exp-disclosure),
   Akkordeon mit Lucide-Pfeil (.exp-accordion), lange Liste mit „Mehr anzeigen“ (.exp-more-list).
   Beispiel: komponenten/rueckmeldung.html
   ========================================================= */
.dropdown-menu.exp-inbox-menu {
  --bs-dropdown-padding-x: 0;
  --bs-dropdown-padding-y: 0;
  width: 380px;
  max-width: calc(100vw - 2 * var(--exp-space-md));
  overflow: hidden;
}
.exp-inbox-card {
  display: grid;
  width: 380px;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--exp-card-edge);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-raised);
  box-shadow: var(--exp-shadow-pop);
}
.exp-inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--exp-space-sm);
  min-height: 48px;
  padding: var(--exp-space-sm) var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
}
.exp-notes { max-height: 320px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.exp-inbox-card .exp-notes { max-height: none; }
.exp-notes > li + li { border-block-start: 1px solid var(--exp-border); }
.exp-note {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: var(--exp-space-sm);
  width: 100%;
  padding: var(--exp-space-sm) var(--exp-space-md);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  transition: background-color var(--exp-dur-1) var(--exp-ease);
}
.exp-note:hover { background: var(--exp-surface-muted); }
.exp-note:focus-visible { outline-offset: -2px; }
/* Ungelesen: fett mit Akzentkante links, zusätzlich „ungelesen“ für Screenreader */
.exp-note[data-unread='true'] { box-shadow: inset 3px 0 0 var(--exp-accent); }
.exp-note-lead { display: grid; place-items: center; width: 32px; height: 32px; color: var(--exp-text-2); }
.exp-note-lead .lucide { width: 16px; height: 16px; }
.exp-note-body { display: grid; gap: var(--exp-space-3xs); min-width: 0; }
.exp-note-text { font-size: var(--exp-text-sm); line-height: 1.45; color: var(--exp-text-2); }
.exp-note-text strong { font-weight: 600; color: var(--exp-text); }
.exp-note[data-unread='true'] .exp-note-text { font-weight: 600; color: var(--exp-text); }
/* Eintrag als Link (a.exp-note) mit Umschalter gelesen/ungelesen daneben: li > a.exp-note + button.exp-note-toggle */
a.exp-note { text-decoration: none; }
.exp-notes > li:has(> .exp-note-toggle) { display: flex; align-items: center; }
.exp-notes > li:has(> .exp-note-toggle) > .exp-note { flex: 1; min-width: 0; }
.exp-note-text { overflow-wrap: anywhere; }
/* Zweite Textzeile (Meldung unter dem Titel): ruhig und auf zwei Zeilen begrenzt, auch bei ungelesenen */
.exp-note-text + .exp-note-text,
.exp-note[data-unread='true'] .exp-note-text + .exp-note-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-weight: 400;
  color: var(--exp-text-2);
}
.exp-note-toggle { flex: none; margin-inline-end: var(--exp-space-xs); color: var(--exp-text-disabled); }
.exp-note-toggle .lucide { width: 10px; height: 10px; }
.exp-note[data-unread='true'] + .exp-note-toggle { color: var(--exp-accent); }
/* Leer-, Lade- und Fehlerzustand der Liste */
.exp-note-state { display: grid; justify-items: center; gap: var(--exp-space-xs); padding: var(--exp-space-lg) var(--exp-space-md); color: var(--exp-text-2); font-size: var(--exp-text-sm); text-align: center; }
.exp-note-state .lucide { width: 24px; height: 24px; color: var(--exp-text-disabled); }
.exp-inbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--exp-space-sm);
  padding: var(--exp-space-xs) var(--exp-space-md) var(--exp-space-xs) var(--exp-space-xs);
  border-block-start: 1px solid var(--exp-border);
  font-size: var(--exp-text-sm);
}

/* Ein Menü an Mausposition; Untermenü seitlich, kippt nach links, wenn rechts kein Platz ist */
.dropdown-menu.exp-ctxmenu { position: fixed; z-index: var(--exp-z-popover); min-width: 15rem; margin: 0; }
.exp-submenu { position: relative; }
.exp-submenu-chevron { margin-inline-start: auto; }
.exp-submenu > .dropdown-menu {
  position: absolute;
  inset-block-start: calc(-1 * var(--bs-dropdown-padding-y) - 1px);
  inset-inline-start: calc(100% + var(--bs-dropdown-padding-x));
  min-width: 13rem;
  margin: 0;
}
.exp-submenu.is-open > .dropdown-menu { display: block; }
.exp-submenu.is-flipped > .dropdown-menu { inset-inline-start: auto; inset-inline-end: calc(100% + var(--bs-dropdown-padding-x)); }
.exp-submenu.is-open > .exp-submenu-toggle { background: var(--bs-dropdown-link-hover-bg); }

.exp-line { display: grid; gap: var(--exp-space-sm); padding: var(--exp-space-md); border: 1px solid var(--exp-border); border-radius: var(--exp-radius); }
.exp-line-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--exp-space-md); }
.exp-line-head .exp-client > .d-grid { min-width: 0; }
.exp-line-detail { display: grid; gap: var(--exp-space-sm); padding-block-start: var(--exp-space-xs); }
.exp-disclosure {
  display: inline-flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  justify-self: start;
  margin-inline: calc(-1 * var(--exp-space-2xs));
  padding: var(--exp-space-3xs) var(--exp-space-2xs);
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: var(--exp-text-accent);
  font: inherit;
  font-size: var(--exp-text-sm);
  font-weight: 600;
}
.exp-disclosure:hover { text-decoration: underline; text-underline-offset: 3px; }
.exp-disclosure .lucide { width: 16px; height: 16px; transition: transform var(--exp-dur-2) var(--exp-ease); }
.exp-disclosure:not(.collapsed) .lucide { transform: rotate(90deg); }
.table.exp-entries { max-width: 560px; font-size: var(--exp-text-sm); }
.table.exp-entries > :not(caption) > * > * { padding-inline: var(--exp-space-sm); }

/* Akkordeon: Bootstrap-Pfeil (Bild mit fester Farbe) durch Lucide ersetzt */
.exp-accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-color: var(--exp-text);
  --bs-accordion-border-color: var(--exp-border);
  --bs-accordion-border-radius: var(--exp-radius);
  --bs-accordion-inner-border-radius: calc(var(--exp-radius) - 1px);
  --bs-accordion-btn-padding-x: var(--exp-space-md);
  --bs-accordion-btn-padding-y: var(--exp-space-sm);
  --bs-accordion-btn-color: var(--exp-text);
  --bs-accordion-btn-bg: transparent;
  --bs-accordion-btn-focus-box-shadow: inset 0 0 0 2px var(--exp-focus);
  --bs-accordion-active-color: var(--exp-text);
  --bs-accordion-active-bg: transparent;
  --bs-accordion-body-padding-x: var(--exp-space-md);
  --bs-accordion-body-padding-y: var(--exp-space-md);
}
.exp-accordion .accordion-button { gap: var(--exp-space-md); font-size: var(--exp-text-md); transition: background-color var(--exp-dur-1) var(--exp-ease); }
.exp-accordion .accordion-button::after { display: none; }
.exp-accordion .accordion-button:hover { background: var(--exp-surface-muted); }
.exp-accordion-title { display: grid; flex: 1; gap: var(--exp-space-3xs); min-width: 0; }
.exp-accordion-title .exp-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-accordion-chevron { color: var(--exp-text-2); transition: transform var(--exp-dur-2) var(--exp-ease); }
.accordion-button.collapsed .exp-accordion-chevron { transform: rotate(-90deg); }

.exp-more-list { display: grid; margin: 0; padding: 0; list-style: none; }
.exp-more-list > li { display: grid; gap: var(--exp-space-3xs); padding-block: var(--exp-space-sm); }
.exp-more-list > li + li { border-block-start: 1px solid var(--exp-border); }

/* =========================================================
   18. Texteditor
   Zweck: Rahmen für Rich-Text. Teil A: statische Demo der Rahmenklassen (Werkzeugleiste, Linkzeile,
   Fläche, Fuß mit Zähler; .is-invalid, .is-readonly, .exp-editor-sm) zum Ausprobieren im Styleguide.
   Teil B: Baustein exp-editor auf Tiptap (public/assets/js/exp-editor.js), Profile mail, template,
   signature, task über data-profile; der im Cockpit verwendete Editor.
   Beispiel: komponenten/kommunikation.html (Teil A), pages/editor.html (Teil B)
   ========================================================= */
.exp-editor {
  display: grid;
  min-width: 0;
  border: 1px solid var(--exp-border-strong);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
  transition: border-color var(--exp-dur-1) var(--exp-ease), box-shadow var(--exp-dur-1) var(--exp-ease);
}
.exp-editor:hover:not(.is-readonly) { border-color: var(--exp-text-2); }
/* Fokus nur, wenn die Fläche selbst den Fokus hat; Werkzeuge zeigen ihren eigenen Ring */
.exp-editor:has(.exp-editor-area:focus) { border-color: var(--exp-focus); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.exp-editor.is-invalid,
.exp-editor.is-invalid:hover { border-color: var(--exp-danger-fg); }
.exp-editor.is-readonly { border-color: var(--exp-border); background: var(--exp-surface-muted); }

.exp-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--exp-space-3xs);
  padding: var(--exp-space-2xs);
  border-block-end: 1px solid var(--exp-border);
}
/* Werkzeug mit Zustand (fett an der Schreibmarke): Akzentfläche */
.exp-editor-toolbar .btn[aria-pressed='true'] { background: var(--exp-accent-muted); color: var(--exp-text-accent); }
.exp-editor-toolbar .btn .lucide { width: 16px; height: 16px; }
.exp-editor-sep { width: 1px; height: 20px; margin-inline: var(--exp-space-2xs); background: var(--exp-border); }

/* Linkzeile statt Dialog */
.exp-editor-linkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--exp-space-xs);
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border-block-end: 1px solid var(--exp-border);
  background: var(--exp-surface-muted);
}
.exp-editor-linkbar .form-control { flex: 1 1 240px; width: auto; min-width: 0; }

.exp-editor-area {
  min-height: 160px;
  padding: var(--exp-space-sm) var(--exp-space-md);
  line-height: 1.6;
  color: var(--exp-text);
  outline: none;
  overflow-wrap: anywhere;
}
.exp-editor-sm .exp-editor-area { min-height: 96px; }
.exp-editor-area p,
.exp-editor-area ul,
.exp-editor-area ol { margin: 0 0 var(--exp-space-xs); }
.exp-editor-area > :last-child { margin-block-end: 0; }
.exp-editor-area ul,
.exp-editor-area ol { padding-inline-start: var(--exp-space-lg); }
.exp-editor-area a { text-decoration: underline; }
.exp-editor-area b,
.exp-editor-area strong { font-weight: 600; }
.exp-editor-area.is-empty::before { content: attr(data-placeholder); color: var(--exp-text-2); pointer-events: none; }
.exp-editor.is-readonly .exp-editor-area { color: var(--exp-text); }
.exp-editor.is-readonly .exp-editor-area:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; border-radius: var(--exp-radius-sm); }

.exp-editor-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--exp-space-2xs) var(--exp-space-sm);
  min-height: var(--exp-control);
  padding: var(--exp-space-2xs) var(--exp-space-sm) var(--exp-space-2xs) var(--exp-space-md);
  border-block-start: 1px solid var(--exp-border);
  font-size: var(--exp-text-sm);
  color: var(--exp-text-2);
}
.exp-editor-count { font-variant-numeric: tabular-nums; }
.exp-editor.is-invalid .exp-editor-count { color: var(--exp-danger-text); font-weight: 600; }
.exp-editor-note { display: inline-flex; align-items: center; gap: var(--exp-space-2xs); }
.exp-editor-note .lucide { width: 14px; height: 14px; }

/* ---------- Teil B: Baustein exp-editor (Tiptap) ----------
   .exp-editor[data-profile][data-format=on|off][data-plain] > .exp-editor-format (role=toolbar),
   .exp-editor-msg, .exp-editor-surface (> .exp-editor-mount > .exp-editor-body, .exp-editor-plain).
   Profil mail: Leiste unten, Fläche als helles Blatt (.exp-editor-paper, Tokens hell über tokens.css);
   template und signature ebenso hell, Leiste oben; task folgt dem Theme. .exp-editor-bare ohne Rahmen
   (im Verfassen-Fenster). Popover hängen am Ende von body: .exp-editor-pop, .exp-editor-menu,
   .exp-emoji.exp-editor-emoji. Feste Blöcke: .exp-editor-raw[data-kind=legacy|signature|quote], mit
   .is-editable beim ersten Klick bearbeitbar (alle Profile außer task). Bearbeitbares Zitat:
   .exp-editor-quote > .exp-editor-raw-bar + .exp-editor-quote-content > .exp-editor-quote-frame (Rahmenstil). */
.exp-editor[data-profile] { display: flex; flex-direction: column; overflow: clip; }
.exp-editor[data-profile]:has(.exp-editor-body:focus, .exp-editor-plain:focus) { border-color: var(--exp-focus); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
.exp-editor.exp-editor-bare,
.exp-editor.exp-editor-bare:hover,
.exp-editor.exp-editor-bare:has(.exp-editor-body:focus, .exp-editor-plain:focus) { border: 0; border-radius: 0; background: transparent; box-shadow: none; }

.exp-editor-format {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--exp-space-3xs);
  padding: var(--exp-space-2xs);
  border-block-end: 1px solid var(--exp-border);
}
.exp-editor[data-profile='mail'] .exp-editor-format { border-block-end: 0; border-block-start: 1px solid var(--exp-border); }
.exp-editor[data-format='off'] .exp-editor-format { display: none; }
/* Ausgelagerte Leiste (Option formatHost): wird über hidden geschaltet */
.exp-editor-format[hidden] { display: none; }
.exp-editor-format .btn[aria-pressed='true'] { background: var(--exp-accent-muted); color: var(--exp-text-accent); }
.exp-editor-format .btn .lucide { width: 16px; height: 16px; }
.exp-editor-menu-btn { display: inline-flex; align-items: center; gap: var(--exp-space-3xs); padding-inline: var(--exp-space-xs); }
.exp-editor-menu-btn .lucide { width: 14px; height: 14px; color: var(--exp-text-2); }
.exp-editor-color { position: relative; }
.exp-editor-swatch {
  position: absolute;
  inset-inline: 30%;
  inset-block-end: 5px;
  height: 3px;
  border-radius: var(--exp-radius-sm);
  background: var(--exp-editor-swatch, currentColor);
}
/* Der Farbwähler des Browsers öffnet sich am (unsichtbaren) Feld neben dem Knopf */
.exp-editor-color-input { position: absolute; inset-block-end: 0; inset-inline-start: 50%; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

.exp-editor-msg {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  padding: var(--exp-space-3xs) var(--exp-space-3xs) var(--exp-space-3xs) var(--exp-space-sm);
  border-block-end: 1px solid var(--exp-border);
  background: var(--exp-warning-bg);
  color: var(--exp-warning-text);
  font-size: var(--exp-text-sm);
}
.exp-editor-msg[hidden] { display: none; }
.exp-editor-msg-text { flex: 1; min-width: 0; }

.exp-editor-surface { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; min-height: 160px; overflow: auto; cursor: text; }
.exp-editor-paper .exp-editor-surface { background: var(--exp-paper); color: var(--exp-paper-text); color-scheme: light; }
.exp-editor-mount { display: flex; flex: 1 1 auto; flex-direction: column; }
.exp-editor-mount[hidden] { display: none; }
.exp-editor-body,
.exp-editor-plain {
  flex: 1 1 auto;
  min-height: 160px;
  padding: var(--exp-space-sm) var(--exp-space-md);
  color: inherit;
  line-height: 1.6;
  outline: none;
  overflow-wrap: anywhere;
}
.exp-editor-plain { display: block; width: 100%; border: 0; background: transparent; resize: vertical; font: inherit; }
.exp-editor-plain[hidden] { display: none; }
/* HTML-Code der Vorlage (Option source: true) */
.exp-editor-source {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 240px;
  padding: var(--exp-space-sm) var(--exp-space-md);
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--exp-font-mono);
  font-size: var(--exp-text-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  resize: vertical;
  outline: none;
}
.exp-editor-source[hidden] { display: none; }
.exp-editor[data-profile]:has(.exp-editor-source:focus) { border-color: var(--exp-focus); box-shadow: 0 0 0 3px var(--bs-focus-ring-color); }
/* Mail, Vorlage, Signatur: Grundschrift und Absatzränder wie das verschickte HTML (ExpEditorCore.buildMailHtml) */
.exp-editor-paper .exp-editor-body,
.exp-editor-paper .exp-editor-plain { font-family: var(--exp-font-mail); font-size: var(--exp-text-md); line-height: 1.5; }
.exp-editor-paper .exp-editor-body p { margin: 0; }
.exp-editor-paper .exp-editor-body a { color: var(--exp-paper-link); }
.exp-editor[data-profile='task'] .exp-editor-body :is(p, ul, ol) { margin: 0 0 var(--exp-space-xs); }
.exp-editor[data-profile='task'] .exp-editor-body > :last-child { margin-block-end: 0; }
/* Aufgaben: zwei Textzeilen; die Leiste bleibt bei Inhalt oder Fokus sichtbar. */
.exp-editor[data-profile='task'] .exp-editor-surface { min-height: 0; }
.exp-editor[data-profile='task'] :is(.exp-editor-body, .exp-editor-plain) {
  min-height: calc(3em + 2 * var(--exp-space-xs));
  padding: var(--exp-space-xs) var(--exp-space-sm);
}
.exp-editor[data-profile='task']:not(:focus-within):not(.has-content) .exp-editor-format { display: none; }
.exp-task-text-locked {
  margin-block: var(--exp-space-xs) 0;
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border-radius: var(--exp-radius-sm);
  background: var(--exp-warning-bg);
  color: var(--exp-warning-text);
  font-size: var(--exp-text-sm);
}
.exp-editor-body a { text-decoration: underline; cursor: pointer; }
.exp-editor-body :is(ul, ol) { margin-block: 0; padding-inline-start: var(--exp-space-lg); }
.exp-editor-body blockquote { margin: 0 0 0 0.8ex; padding-inline-start: 1ex; border-inline-start: 2px solid var(--exp-border-strong); }
.exp-editor-body hr { border-color: var(--exp-border-strong); opacity: 1; }
.exp-editor-body img { max-width: 100%; height: auto; }
.exp-editor-body img.ProseMirror-selectednode { outline: 2px solid var(--exp-focus); outline-offset: 1px; }
/* Bearbeitbare Tabellen: markierte Zellen (Klasse von prosemirror-tables) und Zellgrenzen beim Überfahren.
   Innenschatten und Umriss ändern keine Maße; der Schatten wirkt auch über einem Hintergrund im style-Attribut.
   Der Umriss sitzt 2px innen: neben einem Rahmen der Tabelle (bis 2px, hier mit border-collapse) statt darauf. */
.exp-editor-body .selectedCell { box-shadow: inset 0 0 0 100vmax var(--exp-accent-muted); }
.exp-editor-body table:hover :is(td, th) { outline: 1px dashed var(--exp-border); outline-offset: -2px; }
/* Bild im Text mit Ziehgriffen (Bildgröße ändern): Griffe nur am markierten Bild, Seitenverhältnis bleibt */
.exp-editor-img { position: relative; display: inline-block; max-width: 100%; vertical-align: bottom; line-height: 0; }
.exp-editor-img > img { display: inline-block; }
.exp-editor-img.ProseMirror-selectednode > img { outline: 2px solid var(--exp-focus); outline-offset: 1px; }
.exp-editor-img.is-resizing { user-select: none; }
.exp-editor-img-handle {
  position: absolute;
  z-index: 1;
  display: none;
  width: 10px;
  height: 10px;
  border: 1px solid var(--exp-paper);
  border-radius: 2px;
  background: var(--exp-focus);
}
.exp-editor-img.ProseMirror-selectednode .exp-editor-img-handle { display: block; }
.exp-editor-img-handle[data-corner='nw'] { inset-block-start: -5px; inset-inline-start: -5px; cursor: nwse-resize; }
.exp-editor-img-handle[data-corner='ne'] { inset-block-start: -5px; inset-inline-end: -5px; cursor: nesw-resize; }
.exp-editor-img-handle[data-corner='sw'] { inset-block-end: -5px; inset-inline-start: -5px; cursor: nesw-resize; }
.exp-editor-img-handle[data-corner='se'] { inset-block-end: -5px; inset-inline-end: -5px; cursor: nwse-resize; }
/* Bild, dessen Datei noch gelesen wird */
.exp-editor-body img[data-upload-id] { filter: blur(3px); opacity: 0.6; transition: filter var(--exp-dur-2) var(--exp-ease); }
/* Bild mit Platzhalter-Quelle ([URL_ZUM_TRACKING_PIXEL], {logo_url}): lädt nichts, neutraler Rahmen mit alt-Text */
.exp-editor-body img[data-exp-ph-src],
.exp-editor-body .exp-editor-img-blocked > img {
  display: inline-block;
  min-width: 1.5em;
  min-height: 1.5em;
  border: 1px dashed currentColor;
  border-radius: var(--exp-radius-sm);
  font-family: var(--exp-font);
  font-size: var(--exp-text-xs);
  opacity: 0.7;
  vertical-align: middle;
}
/* Platzhalter {name} als farbig markierter Text (Entscheidung 3, auch getippt) */
.exp-editor-body .exp-editor-var {
  padding-inline: 0.15em;
  border-radius: var(--exp-radius-sm);
  background: var(--exp-info-bg);
  color: var(--exp-info-text);
  box-decoration-break: clone;
}
/* Abstand vor Signatur und Zitat wie im verschickten HTML */
.exp-editor-body > .email-signature { margin-block-start: 1em; }
/* Platzhalter nur in der ersten leeren Zeile (die übrigen tragen ein leeres data-placeholder) */
.exp-editor-body p.is-empty[data-placeholder]:not([data-placeholder=''])::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  color: var(--exp-text-2);
  pointer-events: none;
}

/* Fester Block: zeigt das Original; auswählbar, kopierbar, löschbar */
.exp-editor-raw { position: relative; border-radius: var(--exp-radius-sm); }
.exp-editor-raw[data-kind='signature'],
.exp-editor-raw[data-kind='quote'] { margin-block-start: 1em; }
.exp-editor-raw:hover,
.exp-editor-raw:focus-within { outline: 1px dashed var(--exp-border-strong); outline-offset: 2px; }
.exp-editor-raw.is-selected { outline: 2px solid var(--exp-focus); outline-offset: 2px; }
.exp-editor-raw-content { overflow-x: auto; cursor: default; }
/* Beim ersten Klick bearbeitbar: sieht aus wie normaler Text – Schreibmarke als Zeiger, Leiste ohne Etikett */
.exp-editor-raw.is-editable .exp-editor-raw-content { cursor: text; }
.exp-editor-raw.is-editable:not([data-kind='quote']) .exp-editor-raw-bar { padding: var(--exp-space-3xs); }
.exp-editor-raw-content[hidden] { display: none; }
/* Unsichtbarer fester Block (UUID-Feld der UVA-Mail): geht unverändert hinaus, im Editor nicht sichtbar */
.exp-editor-raw.exp-editor-raw-hidden { display: none; }
.exp-editor-raw-bar {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  padding: var(--exp-space-3xs) var(--exp-space-3xs) var(--exp-space-3xs) var(--exp-space-xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius-sm);
  background: var(--exp-surface-raised);
  color: var(--exp-text-2);
  font-family: var(--exp-font);
  font-size: var(--exp-text-xs);
  line-height: 1.2;
  opacity: 0;
  transition: opacity var(--exp-dur-1) var(--exp-ease);
}
.exp-editor-raw:hover .exp-editor-raw-bar,
.exp-editor-raw:focus-within .exp-editor-raw-bar,
.exp-editor-raw.is-selected .exp-editor-raw-bar { opacity: 1; }
/* Zitat (fester Block und bearbeitbar): die Leiste steht immer da (eingeklappt nur der Schalter) */
.exp-editor-raw[data-kind='quote'] .exp-editor-raw-bar,
.exp-editor-quote .exp-editor-raw-bar { position: static; justify-content: space-between; padding: 0; border: 0; background: none; opacity: 1; }
.exp-editor-raw[data-kind='quote'] .exp-editor-raw-content,
.exp-editor-quote-content { margin-block-start: var(--exp-space-xs); }
/* Das Zitat geht unverändert hinaus (buildMailHtml lässt seine Absätze stehen): Absatzränder wie beim Empfänger */
.exp-editor-raw[data-kind='quote'] .exp-editor-raw-content p,
.exp-editor-body .exp-editor-quote-content p { margin: revert; }
/* Zelle, deren Text ohne <p> hinausgeht (data-exp-bare): dort gibt es beim Empfänger keinen Absatzrand */
.exp-editor-body .exp-editor-quote-content :is(td, th)[data-exp-bare] > p { margin: 0; }
.exp-editor-raw[data-kind='quote'] .exp-editor-raw-more,
.exp-editor-quote .exp-editor-raw-more { opacity: 0; }
.exp-editor-raw[data-kind='quote']:is(:hover, :focus-within, .is-selected) .exp-editor-raw-more,
.exp-editor-quote:is(:hover, :focus-within) .exp-editor-raw-more { opacity: 1; }
/* Bearbeitbares Zitat: Abstand und Rahmen beim Überfahren wie der feste Block; den Rahmen des Originals
   (blaue Linie) trägt der Inhalt als Stil */
.exp-editor-quote { position: relative; margin-block-start: 1em; border-radius: var(--exp-radius-sm); }
.exp-editor-quote:hover,
.exp-editor-quote:focus-within { outline: 1px dashed var(--exp-border-strong); outline-offset: 2px; }
.exp-editor-quote-content[hidden] { display: none; }
.exp-editor-raw-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  padding: var(--exp-space-3xs) var(--exp-space-xs);
  border: 0;
  border-radius: var(--exp-radius-pill);
  background: var(--exp-surface-muted);
  color: var(--exp-text-2);
  font-family: var(--exp-font);
  font-size: var(--exp-text-xs);
  cursor: pointer;
}
.exp-editor-raw-toggle:hover { color: var(--exp-text); }
.exp-editor-raw-toggle:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: 1px; }
.exp-editor-raw-toggle .lucide { width: 14px; height: 14px; }
.exp-editor-raw-toggle[hidden] { display: none; }
.exp-editor-raw-start { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs); }
/* Zitat: fremdes Bild, das erst nach „Bilder anzeigen“ lädt (Platzhalter mit dem alt-Text) */
.exp-editor-raw-img {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: var(--exp-space-3xs) var(--exp-space-xs);
  border: 1px dashed currentColor;
  border-radius: var(--exp-radius-sm);
  font-family: var(--exp-font);
  font-size: var(--exp-text-xs);
  opacity: 0.7;
}

/* Popover des Bausteins (Link, Rückfrage); Menüs und Emoji darunter */
.exp-editor-pop {
  position: fixed;
  z-index: var(--exp-z-popover);
  display: grid;
  gap: var(--exp-space-xs);
  width: min(22rem, calc(100vw - 2 * var(--exp-space-xs)));
  padding: var(--exp-space-sm);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-raised);
  color: var(--exp-text);
  box-shadow: var(--exp-shadow-pop);
  font-size: var(--exp-text-md);
}
.exp-editor-pop[hidden],
.exp-editor-pop-face[hidden] { display: none; }
.exp-editor-pop-face { display: grid; gap: var(--exp-space-2xs); }
.exp-editor-pop-face .form-label { margin: var(--exp-space-2xs) 0 0; font-size: var(--exp-text-sm); }
.exp-editor-pop-title { font-weight: 600; }
.exp-editor-pop-text { margin: 0; color: var(--exp-text-2); font-size: var(--exp-text-sm); }
.exp-editor-pop-list { display: grid; gap: var(--exp-space-3xs); margin: 0; padding-inline-start: var(--exp-space-md); color: var(--exp-text); font-size: var(--exp-text-sm); }
.exp-editor-pop-list[hidden] { display: none; }
/* Auswahlliste im Popover (Vorlagen im Verfassen): Einträge als Knöpfe, Name und Betreff untereinander */
.exp-editor-pop-choices { display: grid; gap: var(--exp-space-3xs); max-height: 14rem; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.exp-editor-pop-choices .dropdown-item { display: grid; gap: 0; white-space: normal; text-align: start; }
.exp-editor-pop-choice-sub { color: var(--exp-text-2); font-size: var(--exp-text-xs); overflow-wrap: anywhere; }
.exp-editor-pop-error { margin: 0; color: var(--exp-danger-text); font-size: var(--exp-text-sm); }
.exp-editor-pop-error[hidden] { display: none; }
.exp-editor-pop-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--exp-space-2xs); margin-block-start: var(--exp-space-2xs); }
.exp-editor-pop-gap { flex: 1; }
.exp-editor-pop-view { grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; }
.exp-editor-link-href { overflow: hidden; color: var(--exp-text-accent); text-overflow: ellipsis; white-space: nowrap; }
/* Popover „Bildgröße“: Schnellwahl als Knopfreihe */
.exp-editor-img-presets { display: flex; flex-wrap: wrap; gap: var(--exp-space-2xs); margin-block: var(--exp-space-2xs) var(--exp-space-xs); }
.dropdown-menu.exp-editor-menu { position: fixed; z-index: var(--exp-z-popover); min-width: 11rem; max-height: min(60vh, 26rem); margin: 0; overflow-y: auto; }
.exp-editor-menu .dropdown-item { display: flex; align-items: center; gap: var(--exp-space-xs); }
.exp-editor-menu .dropdown-item .lucide { width: 16px; height: 16px; flex: none; }
.exp-editor-check { display: inline-flex; color: var(--exp-text-accent); visibility: hidden; }
.exp-editor-menu [aria-checked='true'] .exp-editor-check { visibility: visible; }
.exp-editor-menu-icon { display: inline-flex; color: var(--exp-text-2); }
/* Deaktivierter Menüpunkt: mit den Pfeiltasten erreichbar, löst nichts aus (Werkzeug „Tabelle“) */
.exp-editor-menu .dropdown-item[aria-disabled='true'] { color: var(--exp-text-disabled); cursor: default; }
.exp-editor-menu .dropdown-item[aria-disabled='true'] .exp-editor-menu-icon { color: inherit; }
.exp-emoji.exp-editor-emoji { position: fixed; width: min(24rem, calc(100vw - 2 * var(--exp-space-xs))); }
.exp-emoji.exp-editor-emoji[hidden] { display: none; }
/* Raster „Tabelle einfügen“ der Formatleiste: Kästchen für Zeilen × Spalten, darunter die gewählte Größe. */
.exp-editor-pop.exp-editor-grid { width: auto; gap: var(--exp-space-2xs); padding: var(--exp-space-xs); }
.exp-editor-grid-cells { display: grid; grid-template-columns: repeat(8, auto); gap: var(--exp-space-3xs); }
.exp-editor-grid-cell {
  width: calc(var(--exp-space-md) + var(--exp-space-2xs));
  height: calc(var(--exp-space-md) + var(--exp-space-2xs));
  padding: 0;
  border: 1px solid var(--exp-border-strong);
  border-radius: 0;
  background: var(--exp-surface);
  cursor: pointer;
}
.exp-editor-grid-cell.is-on { border-color: var(--exp-accent); background: var(--exp-accent-muted); }
.exp-editor-grid-cell:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: 1px; }
.exp-editor-grid-size { color: var(--exp-text-2); font-size: var(--exp-text-sm); text-align: center; }

/* =========================================================
   19. Upload-Zone
   Zweck: Ablagefläche mit Zuständen (.is-hover, .is-over, .is-disabled), Liste der Uploads mit Fortschritt
   und Ergebnis (.exp-upload-meta[data-tone=success|danger]).
   Beispiel: komponenten/kommunikation.html
   ========================================================= */
.exp-dropzone {
  display: grid;
  justify-items: center;
  gap: var(--exp-space-xs);
  padding: var(--exp-space-xl) var(--exp-space-lg);
  border: 2px dashed var(--exp-border-strong);
  border-radius: var(--exp-radius-lg);
  background: var(--exp-surface);
  color: var(--exp-text-2);
  text-align: center;
  transition: border-color var(--exp-dur-1) var(--exp-ease), background-color var(--exp-dur-1) var(--exp-ease);
}
.exp-dropzone > .lucide { width: 28px; height: 28px; }
.exp-dropzone > .btn { margin-block-start: var(--exp-space-xs); }
.exp-dropzone-sm { padding: var(--exp-space-lg) var(--exp-space-md); }
.exp-dropzone-sm > .lucide { width: 24px; height: 24px; }
.exp-dropzone-title { font-weight: 600; color: var(--exp-text); }
.exp-dropzone:hover:not(.is-disabled):not(.is-over),
.exp-dropzone.is-hover { border-color: var(--exp-text-2); background: var(--exp-surface-muted); }
.exp-dropzone.is-over { border-style: solid; border-color: var(--exp-accent); background: var(--exp-accent-muted); color: var(--exp-text-accent); }
.exp-dropzone.is-disabled { border-color: var(--exp-border); background: var(--exp-surface-muted); color: var(--exp-text-disabled); }
.exp-dropzone.is-disabled .exp-dropzone-title { color: var(--exp-text-2); }
/* Kinder sollen dragleave nicht auslösen */
.exp-dropzone.is-over > * { pointer-events: none; }

.exp-upload-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--exp-space-xs); }
.exp-upload-list { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--exp-border); border-radius: var(--exp-radius); }
.exp-upload-list:empty { display: none; }
.exp-upload-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--exp-space-sm);
  padding: var(--exp-space-sm) var(--exp-space-xs) var(--exp-space-sm) var(--exp-space-md);
}
.exp-upload-row + .exp-upload-row { border-block-start: 1px solid var(--exp-border); }
.exp-upload-row > .lucide { color: var(--exp-text-2); }
.exp-upload-main { display: grid; gap: var(--exp-space-2xs); min-width: 0; }
.exp-upload-name { overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.exp-upload-main .progress { --bs-progress-height: 4px; }
.exp-upload-meta { display: inline-flex; align-items: center; gap: var(--exp-space-2xs); font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-upload-meta .lucide { width: 14px; height: 14px; }
.exp-upload-meta[data-tone='success'] { color: var(--exp-success-text); }
.exp-upload-meta[data-tone='success'] .lucide { color: var(--exp-success-fg); }
.exp-upload-meta[data-tone='danger'] { color: var(--exp-danger-text); }
.exp-upload-meta[data-tone='danger'] .lucide { color: var(--exp-danger-fg); }
.exp-upload-actions { display: inline-flex; gap: var(--exp-space-3xs); }

@media (max-width: 639.98px) {
  .exp-dropzone { padding: var(--exp-space-lg) var(--exp-space-md); }
}

/* =========================================================
   20. Chat (WhatsApp-Posteingang, KI-Chat)
   Zweck: Verlauf mit Tagestrenner, Nachricht (.exp-msg[data-from=client|staff|ai]) mit Blase, Zustellstatus
   (.exp-msg-status[data-status]), Zitat, Foto, Dateianhang (.exp-filechip), Reaktion, Eingabe, KI-Arbeitsschritt.
   Beispiel: komponenten/kommunikation.html
   ========================================================= */
.exp-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 620px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius-lg);
  background: var(--exp-bg);
}
.exp-chat-ai { grid-template-rows: minmax(0, 1fr) auto; height: 480px; }
.exp-chat-head {
  display: flex;
  align-items: center;
  gap: var(--exp-space-sm);
  padding: var(--exp-space-sm) var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
  background: var(--exp-surface);
}
.exp-chat-who { display: grid; flex: 1; min-width: 0; }
.exp-chat-who > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exp-chat-body {
  display: flex;
  flex-direction: column;
  gap: var(--exp-space-sm);
  min-height: 0;
  padding: var(--exp-space-md);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.exp-chat-body:focus-visible { outline-offset: -2px; }
/* Tagestrenner: Linie, Text, Linie */
.exp-chat-day {
  display: flex;
  align-items: center;
  gap: var(--exp-space-sm);
  margin-block: var(--exp-space-2xs);
  font-size: var(--exp-text-xs);
  font-weight: 600;
  color: var(--exp-text-2);
}
.exp-chat-day::before,
.exp-chat-day::after { content: ''; flex: 1; height: 1px; background: var(--exp-border); }

/* Nachricht: Mandant links mit Avatar, Kanzlei rechts */
.exp-msg { display: flex; align-items: flex-start; gap: var(--exp-space-xs); max-width: min(80%, 560px); }
.exp-msg > .exp-avatar { margin-block-start: 18px; }
.exp-msg[data-from='staff'] { align-self: flex-end; }
.exp-msg[data-from='ai'] { max-width: 100%; }
.exp-msg-stack { display: grid; justify-items: start; gap: var(--exp-space-2xs); min-width: 0; }
.exp-msg[data-from='staff'] .exp-msg-stack { justify-items: end; }
.exp-msg-name { display: inline-flex; align-items: center; gap: var(--exp-space-2xs); font-size: var(--exp-text-xs); font-weight: 600; color: var(--exp-text-2); }
.exp-msg-name .lucide { width: 14px; height: 14px; color: var(--exp-text-accent); }
.exp-msg-bubble {
  display: grid;
  gap: var(--exp-space-xs);
  max-width: 100%;
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border: 1px solid var(--exp-card-edge);
  border-radius: var(--exp-radius-lg);
  border-start-start-radius: var(--exp-radius-sm);
  background: var(--exp-surface);
  box-shadow: var(--exp-shadow-xs);
  color: var(--exp-text);
  overflow-wrap: anywhere;
}
.exp-msg[data-from='staff'] .exp-msg-bubble {
  border-color: transparent;
  border-start-start-radius: var(--exp-radius-lg);
  border-start-end-radius: var(--exp-radius-sm);
  background: var(--exp-accent-muted);
  box-shadow: none;
}
.exp-msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs) var(--exp-space-xs); min-height: 24px; font-size: var(--exp-text-xs); color: var(--exp-text-2); }
.exp-msg[data-from='staff'] .exp-msg-meta { justify-content: flex-end; }
.exp-msg-meta .btn-sm { min-height: 24px; --bs-btn-padding-x: 6px; --bs-btn-font-size: var(--exp-text-xs); }
.exp-msg-meta .btn-icon.btn-sm { width: 24px; }
.exp-msg-meta .btn .lucide { width: 14px; height: 14px; }

/* Zustellstatus: immer Icon und Text */
.exp-msg-status { display: inline-flex; align-items: center; gap: 3px; font-size: var(--exp-text-xs); color: var(--exp-text-2); white-space: nowrap; }
.exp-msg-status .lucide { width: 14px; height: 14px; }
.exp-msg-status[data-status='read'] .lucide { color: var(--exp-text-accent); }
.exp-msg-status[data-status='failed'] { font-weight: 600; color: var(--exp-danger-text); }
.exp-msg-status[data-status='failed'] .lucide { color: var(--exp-danger-fg); }

/* Zitat: die einzige farbige Kante im System */
.exp-quote {
  display: grid;
  gap: var(--exp-space-3xs);
  min-width: 0;
  padding: var(--exp-space-2xs) var(--exp-space-sm);
  border-inline-start: 3px solid var(--exp-accent);
  border-radius: var(--exp-radius-sm);
  background: var(--exp-surface-muted);
  font-size: var(--exp-text-sm);
}
.exp-quote-author { font-weight: 600; color: var(--exp-text-accent); }
.exp-quote-text { overflow: hidden; color: var(--exp-text-2); white-space: nowrap; text-overflow: ellipsis; }

/* Foto und Dateianhang in der Blase */
.exp-photo { display: grid; gap: var(--exp-space-3xs); margin: 0; }
.exp-photo-slot {
  display: grid;
  place-items: center;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--exp-radius);
  background: var(--exp-surface-muted);
  color: var(--exp-text-2);
}
.exp-photo-slot .lucide { width: 28px; height: 28px; }
.exp-photo figcaption { font-size: var(--exp-text-xs); color: var(--exp-text-2); }
.exp-filechip {
  display: inline-flex;
  align-items: center;
  gap: var(--exp-space-xs);
  max-width: 100%;
  min-height: var(--exp-control);
  padding: 0 var(--exp-space-sm);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
  color: var(--exp-text-2);
  text-decoration: none;
  transition: border-color var(--exp-dur-1) var(--exp-ease);
}
a.exp-filechip:hover { border-color: var(--exp-border-strong); color: var(--exp-text-2); }
.exp-filechip-name { overflow: hidden; font-size: var(--exp-text-sm); font-weight: 500; color: var(--exp-text); white-space: nowrap; text-overflow: ellipsis; }
.exp-filechip-size { flex: none; font-size: var(--exp-text-xs); font-variant-numeric: tabular-nums; }

/* Reaktion: Emoji ist Inhalt, kein Icon */
.exp-reaction {
  display: inline-flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  height: 24px;
  padding: 0 var(--exp-space-xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius-pill);
  background: var(--exp-surface);
  font-size: var(--exp-text-xs);
  color: var(--exp-text-2);
}

/* Eingabe */
.exp-chat-composer { display: grid; gap: var(--exp-space-xs); padding: var(--exp-space-sm); border-block-start: 1px solid var(--exp-border); background: var(--exp-surface); }
.exp-chat-replybar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--exp-space-xs); color: var(--exp-text-2); }
.exp-chat-replybar[hidden] { display: none; }
.exp-chat-inputrow { display: flex; align-items: flex-end; gap: var(--exp-space-xs); }
textarea.form-control.exp-chat-input {
  flex: 1;
  min-width: 0;
  min-height: var(--exp-control);
  max-height: 140px;
  padding-block: 9px;
  resize: none;
  field-sizing: content;
}

/* KI: Arbeitsschritt, entstehende Antwort */
.exp-chat-step {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--exp-space-2xs) var(--exp-space-xs);
  max-width: 100%;
  min-height: var(--exp-control-sm);
  padding: var(--exp-space-2xs) var(--exp-space-sm);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
  font-size: var(--exp-text-sm);
}
.exp-chat-step .lucide { width: 16px; height: 16px; color: var(--exp-text-2); }
.exp-chat-step-state { display: inline-flex; align-items: center; gap: 3px; font-size: var(--exp-text-xs); color: var(--exp-text-2); }
.exp-chat-step-state .lucide { width: 14px; height: 14px; }
.exp-chat-step[data-state='done'] .exp-chat-step-state .lucide { color: var(--exp-success-fg); }
.exp-chat-step[data-state='error'] .exp-chat-step-state { color: var(--exp-danger-text); }
.exp-chat-step[data-state='error'] .exp-chat-step-state .lucide { color: var(--exp-danger-fg); }
.exp-chat-answer { line-height: 1.6; color: var(--exp-text); }
.exp-chat-answer p,
.exp-chat-answer ol,
.exp-chat-answer ul { margin: 0 0 var(--exp-space-xs); }
.exp-chat-answer > :last-child { margin-block-end: 0; }
.exp-chat-answer ol,
.exp-chat-answer ul { padding-inline-start: var(--exp-space-lg); }
.exp-chat-answer strong { font-weight: 600; }
.exp-chat-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-inline-start: 2px;
  vertical-align: text-bottom;
  background: var(--exp-accent);
  animation: exp-blink 1s steps(2, start) infinite;
}
/* Icon-Größen über dem Regelmaß (18 px); die kleine Stufe .exp-icon-sm steht in expenia-ui.css */
.exp-icon-lg .lucide, .lucide.exp-icon-lg { width: 24px; height: 24px; }
.exp-icon-xl .lucide, .lucide.exp-icon-xl { width: 32px; height: 32px; }
/* Gefülltes Icon für den Zustand „an“ (Stern markiert, Glocke aktiv); ohne die Klasse nur Umriss */
.lucide.exp-icon-filled { fill: currentColor; }
.exp-icon-filled > .lucide { fill: currentColor; }
/* Drehendes Icon (Arbeitsschritt läuft) */
.exp-spin { animation: exp-spin 0.9s linear infinite; }
@keyframes exp-spin { to { transform: rotate(360deg); } }
@keyframes exp-blink { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .exp-editor,
  .exp-dropzone,
  .exp-filechip { transition: none; }
  .exp-spin,
  .exp-chat-caret { animation: none; }
}
@media (max-width: 639.98px) {
  .exp-chat { height: 560px; }
  .exp-chat-ai { height: 440px; }
  .exp-msg { max-width: 92%; }
  .exp-chat-body { padding: var(--exp-space-sm); }
}

/* =========================================================
   21. Combobox
   Zweck: Feld mit Trefferliste (Konto, Mandant, Personen), Gruppen, Treffer hervorgehoben, Tastaturhinweis.
   Beispiel: komponenten/daten.html
   ========================================================= */
.exp-combo { position: relative; min-width: 0; }
.exp-combo-field { position: relative; }
.exp-combo-field > .form-control { padding-inline-end: 36px; }
/* Pfeil rechts im Feld; als span, damit .exp-input-icon > .lucide ihn nicht nach links schiebt */
.exp-combo-caret {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 10px;
  display: flex;
  align-items: center;
  color: var(--exp-text-2);
  pointer-events: none;
}
.exp-combo-caret .lucide { width: 16px; height: 16px; }
.exp-combo-menu {
  position: absolute;
  z-index: var(--exp-z-dropdown);
  inset-inline: 0;
  inset-block-start: calc(100% + 4px);
  display: grid;
  min-width: 15rem;
  overflow: hidden;
  border: 1px solid var(--exp-card-edge);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-raised);
  box-shadow: var(--exp-shadow-pop);
}
.exp-combo-menu[hidden] { display: none; }
.exp-combo-list { position: relative; max-height: 272px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; scrollbar-width: thin; }
.exp-combo-list [role='group'][hidden] { display: none; }
.exp-combo-group { padding: 8px 10px 4px; font-size: var(--exp-text-sm); font-weight: 600; color: var(--exp-text-2); }
.exp-combo-option {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--exp-radius-sm);
  color: var(--exp-text);
  cursor: pointer;
}
.exp-combo-option[hidden] { display: none; }
.exp-combo-option:hover { background: var(--exp-surface-muted); }
/* Aktiv = per Tastatur oder Maus angesteuert; gewählt = Häkchen rechts */
.exp-combo-option.is-active { background: var(--exp-accent-muted); }
.exp-combo-option > .exp-combo-check { margin-inline-start: auto; width: 16px; height: 16px; color: var(--exp-text-accent); visibility: hidden; }
.exp-combo-option[aria-selected='true'] > .exp-combo-check { visibility: visible; }
.exp-combo-option[aria-selected='true'] { font-weight: 600; }
.exp-combo-option > .lucide:not(.exp-combo-check) { width: 16px; height: 16px; color: var(--exp-text-2); }
.exp-combo-text { display: grid; min-width: 0; line-height: 1.3; }
.exp-combo-text > .exp-sub { font-weight: 400; }
.exp-combo-no { min-width: 4ch; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Treffer im Text hervorheben */
.exp-combo-option mark { padding: 0; background: none; color: var(--exp-text-accent); font-weight: 700; }
.exp-combo-empty { padding: var(--exp-space-sm); font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-combo-empty[hidden] { display: none; }
/* Tastaturhinweis am Fuß der Liste */
.exp-combo-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--exp-space-2xs) var(--exp-space-sm);
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border-block-start: 1px solid var(--exp-border);
  font-size: var(--exp-text-xs);
  color: var(--exp-text-2);
}
.exp-combo-foot > span { display: inline-flex; align-items: center; gap: 3px; }
.exp-combo-foot kbd { min-width: 18px; height: 18px; justify-content: center; }

/* =========================================================
   22. Diagramme (Inline-SVG, Beschriftung in HTML)
   Zweck: Säulen und Linien mit Achsen, Cursor und Tooltip, Legende (auch als Schalter), Anteilsbalken,
   Sparkline in Tabellen, Werte als Tabelle. Serienfarbe über data-series="1|2|3|4" (setzt --exp-series).
   Raster: links y-Achse, rechts Zeichenfläche, darunter x-Achse; Höhe über --exp-chart-h.
   Beispiel: komponenten/daten.html
   ========================================================= */
[data-series='1'] { --exp-series: var(--exp-chart-1); }
[data-series='2'] { --exp-series: var(--exp-chart-2); }
[data-series='3'] { --exp-series: var(--exp-chart-3); }
[data-series='4'] { --exp-series: var(--exp-chart-4); }

.exp-chart {
  --exp-chart-h: 240px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: var(--exp-chart-h) auto;
  column-gap: var(--exp-space-xs);
  margin: 0;
  padding-block-start: 8px;
}
.exp-chart-sm { --exp-chart-h: 160px; }
/* y-Achse: Werte gleichmäßig verteilt, jeweils mittig auf der Gitterlinie */
.exp-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: var(--exp-text-xs);
  color: var(--exp-text-2);
  font-variant-numeric: tabular-nums;
}
.exp-chart-y > span { display: flex; align-items: center; justify-content: flex-end; height: 0; white-space: nowrap; }
.exp-chart-area { position: relative; min-width: 0; touch-action: pan-y; }
.exp-chart-area > svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; overflow: visible; }
.exp-chart-x {
  grid-column: 2;
  position: relative;
  height: 26px;
  font-size: var(--exp-text-xs);
  color: var(--exp-text-2);
  font-variant-numeric: tabular-nums;
}
.exp-chart-x > span { position: absolute; inset-block-start: 8px; transform: translateX(-50%); white-space: nowrap; }
.exp-chart-x > span[data-align='start'] { transform: none; }
.exp-chart-x > span[data-align='end'] { transform: translateX(-100%); }
/* Beschriftung einer Schwelle links über der Linie */
.exp-chart-mark {
  position: absolute;
  z-index: 1;
  inset-inline-start: 4px;
  transform: translateY(calc(-100% - 2px));
  font-size: var(--exp-text-xs);
  font-weight: 600;
  color: var(--exp-warning-text);
  pointer-events: none;
}
/* Cursor: Band hinter der Säule bzw. senkrechte Linie */
.exp-chart-cursor { position: absolute; inset-block: 0; z-index: 0; background: var(--exp-neutral-bg); border-radius: 3px; pointer-events: none; }
.exp-chart-cursor[data-kind='line'] { z-index: 1; width: 0; background: none; border-inline-start: 1px solid var(--exp-border-strong); border-radius: 0; }
.exp-chart-cursor[hidden], .exp-chart-tip[hidden], .exp-chart-dot[hidden] { display: none; }
.exp-chart-dot {
  position: absolute;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--exp-series);
  box-shadow: 0 0 0 2px var(--exp-surface);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
/* Tooltip im Diagramm */
.exp-chart-tip {
  position: absolute;
  z-index: 3;
  inset-block-start: 0;
  display: grid;
  gap: 3px;
  min-width: 168px;
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border: 1px solid var(--exp-card-edge);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-raised);
  box-shadow: var(--exp-shadow-pop);
  font-size: var(--exp-text-sm);
  white-space: nowrap;
  pointer-events: none;
}
.exp-chart-tip-head { margin-block-end: 2px; font-size: var(--exp-text-xs); color: var(--exp-text-2); }
.exp-chart-tip-row { display: flex; align-items: center; gap: var(--exp-space-xs); }
.exp-chart-tip-row > .num { margin-inline-start: auto; padding-inline-start: var(--exp-space-sm); font-weight: 600; }

/* Legende: Farbfeld + Bezeichnung; als Button blendet sie Serien aus und ein */
.exp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin: 0; padding: 0; list-style: none; font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-legend-item { display: inline-flex; align-items: center; gap: var(--exp-space-xs); }
button.exp-legend-item {
  margin: -4px -8px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: var(--exp-text-2);
  font: inherit;
  cursor: pointer;
}
button.exp-legend-item:hover { background: var(--exp-surface-muted); color: var(--exp-text); }
button.exp-legend-item[aria-pressed='false'] { text-decoration: line-through; }
button.exp-legend-item[aria-pressed='false'] .exp-swatch { background: none; box-shadow: inset 0 0 0 1.5px var(--exp-series); }
.exp-swatch { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--exp-series); }
/* Gestrichelte Vergleichslinie (Vorjahr) */
.exp-swatch-dash { width: 16px; height: 0; border-radius: 0; background: none; border-block-start: 2px dashed var(--exp-series); }

/* Kennzahl über einem Diagramm */
.exp-chart-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--exp-space-sm) var(--exp-space-md); }
.exp-chart-figure { display: grid; gap: 2px; }
.exp-chart-figure .exp-stat-value { font-size: var(--exp-text-2xl); }
.exp-chart-figure-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-xs); }

/* Anteilsbalken: Segmente in Serienfarbe, darunter Liste mit Wert und Prozent */
.exp-share { display: flex; gap: 2px; height: 12px; overflow: hidden; border-radius: var(--exp-radius-pill); }
.exp-share > span { min-width: 3px; background: var(--exp-series); }
.exp-share-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 var(--exp-space-xl); margin: 0; }
.exp-share-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--exp-space-sm); padding-block: var(--exp-space-xs); border-block-start: 1px solid var(--exp-border); }
.exp-share-list dt { display: flex; align-items: center; gap: var(--exp-space-xs); min-width: 0; font-weight: 400; color: var(--exp-text-2); }
.exp-share-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-share-pct { margin-inline-start: var(--exp-space-xs); font-weight: 400; color: var(--exp-text-2); }

/* Sparkline in Tabellenzellen */
.exp-spark { display: block; width: 120px; height: 28px; overflow: visible; }

/* Werte des Diagramms als Tabelle (aufklappbar) */
.exp-chart-data > summary { display: inline-flex; align-items: center; gap: var(--exp-space-2xs); color: var(--exp-text-accent); font-size: var(--exp-text-sm); cursor: pointer; }
.exp-chart-data > summary::marker, .exp-chart-data > summary::-webkit-details-marker { display: none; content: ''; }
.exp-chart-data > summary .lucide { width: 16px; height: 16px; transition: transform var(--exp-dur-2) var(--exp-ease); }
.exp-chart-data[open] > summary .lucide { transform: rotate(90deg); }
.exp-chart-data .table-responsive { max-height: 280px; margin-block-start: var(--exp-space-xs); border: 1px solid var(--exp-border); border-radius: var(--exp-radius); }
.exp-chart-data thead th { position: sticky; inset-block-start: 0; z-index: 1; background: var(--exp-surface) !important; box-shadow: inset 0 -1px 0 var(--exp-border); }

@media (max-width: 639.98px) {
  .exp-chart { --exp-chart-h: 200px; }
  .exp-chart-sm { --exp-chart-h: 140px; }
  /* Zwischenbeschriftungen auf schmalen Bildschirmen weglassen */
  .exp-chart-x > span[data-minor] { display: none; }
  .exp-spark { width: 72px; }
}

/* =========================================================
   23. Spezialfelder
   Zweck: Schieberegler mit Wert und Marken (Spur selbst: .form-range in expenia-ui.css), Farbwahl als
   Radiogruppe (.exp-colorpick, Farbe über --exp-swatch), Farbmarke (.exp-cat), Passwortstärke
   (.exp-strength[data-level=1…4]).
   Beispiel: komponenten/daten.html
   ========================================================= */
.exp-range-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--exp-space-sm); }
.exp-range-value { font-size: var(--exp-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Marken unter der Spur; --p = Lage 0…1, Daumenradius 10 px berücksichtigt */
.exp-range-marks { position: relative; height: 18px; font-size: var(--exp-text-xs); color: var(--exp-text-2); }
.exp-range-marks > span { position: absolute; inset-inline-start: calc(10px + (100% - 20px) * var(--p, 0)); transform: translateX(-50%); white-space: nowrap; }
.exp-range-marks > span[data-align='start'] { transform: translateX(-10px); }
.exp-range-marks > span[data-align='end'] { transform: translateX(calc(-100% + 10px)); }

.exp-colorpick { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 4px 0 0; border: 0; }
.exp-colorpick > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.exp-colorpick > label {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--exp-swatch);
  color: var(--exp-on-accent);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--exp-text) 14%, transparent);
  transition: box-shadow var(--exp-dur-1) var(--exp-ease);
}
.exp-colorpick > label .lucide { width: 16px; height: 16px; stroke-width: 2.5; opacity: 0; }
.exp-colorpick > input:checked + label { box-shadow: 0 0 0 2px var(--exp-surface), 0 0 0 4px var(--exp-swatch); }
.exp-colorpick > input:checked + label .lucide { opacity: 1; }
.exp-colorpick > input:focus-visible + label { outline: 2px solid var(--exp-focus); outline-offset: 5px; }
/* Farbmarke einer Kategorie in Listen */
.exp-cat { display: inline-flex; align-items: center; gap: var(--exp-space-xs); }
.exp-cat-mark { flex: none; width: 4px; height: 20px; border-radius: var(--exp-radius-pill); background: var(--exp-swatch); }

/* Passwortstärke: vier Stufen, Text darunter trägt die Bedeutung */
.exp-strength { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-block-start: var(--exp-space-xs); }
.exp-strength > span { height: 4px; border-radius: var(--exp-radius-pill); background: var(--exp-neutral-bg); transition: background-color var(--exp-dur-2) var(--exp-ease); }
.exp-strength[data-level='1'] > span:nth-child(-n + 1) { background: var(--exp-danger-fg); }
.exp-strength[data-level='2'] > span:nth-child(-n + 2) { background: var(--exp-warning-fg); }
.exp-strength[data-level='3'] > span:nth-child(-n + 3),
.exp-strength[data-level='4'] > span { background: var(--exp-success-fg); }

/* =========================================================
   24. Belegansicht mit Miniaturen und Teilen
   Zweck: Werkzeugleiste, Miniaturen links (.exp-thumb[aria-current]), Bühne mit Papier; Teilen mit
   Schnittmarken (.exp-cut-mark[aria-pressed]). Breiten folgen dem Container (.exp-cq), nicht dem Fenster.
   Beispiel: komponenten/dokumente.html
   ========================================================= */
.exp-viewer {
  display: grid;
  min-width: 0;
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  overflow: hidden;
  background: var(--exp-surface);
}
.exp-viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--exp-space-xs) var(--exp-space-md);
  min-height: 56px;
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border-block-end: 1px solid var(--exp-border);
}
.exp-viewer-group { display: flex; align-items: center; gap: var(--exp-space-2xs); }
.exp-viewer-group > label { margin-inline-start: var(--exp-space-2xs); }
.exp-viewer-select { width: auto; min-width: 4.25rem; }
.exp-viewer-body { display: grid; grid-template-columns: 112px minmax(0, 1fr); height: 600px; }
.exp-thumbs {
  display: grid;
  align-content: start;
  gap: var(--exp-space-sm);
  padding: var(--exp-space-sm);
  overflow-y: auto;
  border-inline-end: 1px solid var(--exp-border);
  scrollbar-width: thin;
}
.exp-thumb {
  display: grid;
  justify-items: center;
  gap: var(--exp-space-2xs);
  padding: var(--exp-space-2xs);
  border: 2px solid transparent;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: var(--exp-text-2);
  font: inherit;
  font-size: var(--exp-text-xs);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.exp-thumb:hover { background: var(--exp-surface-muted); }
.exp-thumb[aria-current='true'] { border-color: var(--exp-accent); color: var(--exp-text); font-weight: 600; }
.exp-thumb-paper { display: block; width: 72px; }
.exp-viewer-stage { overflow: auto; background: var(--exp-surface-muted); outline: none; }
.exp-viewer-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--exp-focus); }
.exp-viewer-stage-inner {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: max-content;
  padding: var(--exp-space-lg);
}
.exp-viewer-stage .exp-paper { flex: none; width: 480px; overflow: hidden; }

/* Teilen: Seiten mit Schnittmarken dazwischen */
.exp-cut-wrap { display: grid; background: var(--exp-surface-muted); }
.exp-cut {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: var(--exp-space-md);
  padding: var(--exp-space-lg) var(--exp-space-md);
}
.exp-cut-page {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: var(--exp-space-2xs);
  width: 128px;
  padding: var(--exp-space-xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
  font-size: var(--exp-text-sm);
}
.exp-cut-thumb { display: block; width: 100%; margin-block-end: var(--exp-space-2xs); }
/* Schnittmarke: gestrichelte Linie mit Schere; gedrückt = hier wird getrennt */
.exp-cut-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--exp-text-2);
  cursor: pointer;
}
.exp-cut-mark::before {
  content: '';
  position: absolute;
  inset-block: var(--exp-space-2xs);
  inset-inline-start: calc(50% - 1px);
  border-inline-start: 2px dashed var(--exp-border-strong);
  opacity: 0.45;
  transition: opacity var(--exp-dur-1) var(--exp-ease), border-color var(--exp-dur-1) var(--exp-ease);
}
.exp-cut-mark .lucide {
  position: relative;
  box-sizing: content-box;
  width: 16px;
  height: 16px;
  padding: 7px;
  border: 1px solid var(--exp-border-strong);
  border-radius: var(--exp-radius-pill);
  background: var(--exp-surface);
  transition: background-color var(--exp-dur-1) var(--exp-ease), border-color var(--exp-dur-1) var(--exp-ease);
}
.exp-cut-mark:hover::before { opacity: 1; }
.exp-cut-mark:hover .lucide { border-color: var(--exp-text-2); color: var(--exp-text); }
.exp-cut-mark[aria-pressed='true'] { color: var(--exp-text-accent); }
.exp-cut-mark[aria-pressed='true']::before { border-color: var(--exp-accent); opacity: 1; }
.exp-cut-mark[aria-pressed='true'] .lucide { border-color: var(--exp-accent); background: var(--exp-accent-muted); color: var(--exp-text-accent); }
.exp-cut-mark:focus-visible { outline: none; }
.exp-cut-mark:focus-visible .lucide { outline: 2px solid var(--exp-focus); outline-offset: 2px; }
.exp-cut-foot {
  align-items: flex-end;
  padding: var(--exp-space-sm) var(--exp-space-md);
  border-block-start: 1px solid var(--exp-border);
  background: var(--exp-surface);
}
.exp-cut-choice { display: grid; }
.exp-cut-choice .form-select { width: auto; min-width: 13rem; }
.exp-cut-result { display: grid; flex: 1; gap: var(--exp-space-3xs); min-width: 14rem; margin: 0; padding: 0; list-style: none; }
.exp-cut-result li { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--exp-space-xs); font-size: var(--exp-text-sm); }
.exp-cut-result .lucide { width: 16px; height: 16px; color: var(--exp-text-2); }

@container (max-width: 559.98px) {
  .exp-viewer-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 520px; }
  .exp-thumbs {
    grid-auto-flow: column;
    grid-auto-columns: 60px;
    overflow-x: auto;
    overflow-y: hidden;
    border-inline-end: 0;
    border-block-end: 1px solid var(--exp-border);
  }
  .exp-thumb-paper { width: 44px; }
  .exp-cut-page { width: 100px; }
  .exp-cut-mark { width: 40px; }
  .exp-cut-choice, .exp-cut-choice .form-select { width: 100%; }
}

/* =========================================================
   25. Mail-Client
   Zweck: Ordner, Nachrichtenliste (.exp-mail-item[data-unread|aria-current]), Lesebereich, Anhang,
   verschiebbare Spaltentrenner (.exp-resizer[role=separator]); schmal eine Spalte nach der anderen
   (.exp-mail[data-pane=folders|list|message]). Spaltenbreiten über --exp-mail-w1, --exp-mail-w2.
   Beispiel: komponenten/dokumente.html
   ========================================================= */
.exp-mail {
  display: grid;
  grid-template-columns: var(--exp-mail-w1, 184px) auto var(--exp-mail-w2, 300px) auto minmax(0, 1fr);
  height: 560px;
  min-width: 0;
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  overflow: hidden;
  background: var(--exp-surface);
}
.exp-mail-col { min-width: 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.exp-mail-folders { padding: var(--exp-space-xs); background: var(--exp-surface-muted); }
.exp-mail-head { padding: var(--exp-space-xs) var(--exp-space-sm) var(--exp-space-2xs); font-size: var(--exp-text-sm); font-weight: 600; color: var(--exp-text-2); }
.exp-folders { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.exp-folder {
  display: flex;
  align-items: center;
  gap: var(--exp-space-sm);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--exp-space-sm);
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: var(--exp-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.exp-folder > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exp-folder .lucide { width: 16px; height: 16px; color: var(--exp-text-2); }
.exp-folder:hover { background: var(--exp-neutral-bg); }
.exp-folder[aria-current='true'] { background: var(--exp-accent-muted); font-weight: 600; }
.exp-folder[aria-current='true'] .lucide { color: var(--exp-text-accent); }
.exp-folder-count { font-size: var(--exp-text-xs); font-weight: 600; color: var(--exp-text-2); font-variant-numeric: tabular-nums; }
.exp-mail-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  min-height: 48px;
  padding: var(--exp-space-xs) var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
  background: var(--exp-surface);
}
.exp-mail-bar > .exp-sub:last-child { margin-inline-start: auto; }
.exp-mail-back, .exp-mail-readbar { display: none !important; }
.exp-mail-items { margin: 0; padding: 0; list-style: none; }
.exp-mail-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: var(--exp-space-sm) var(--exp-space-md);
  border: 0;
  border-block-end: 1px solid var(--exp-border);
  background: none;
  color: var(--exp-text);
  font: inherit;
  font-size: var(--exp-text-sm);
  text-align: start;
  cursor: pointer;
}
.exp-mail-item:hover { background: var(--exp-surface-muted); }
.exp-mail-item:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }
.exp-mail-item[aria-current='true'] { background: var(--exp-accent-muted); box-shadow: inset 3px 0 0 var(--exp-accent); }
.exp-mail-item-row { display: flex; align-items: baseline; gap: var(--exp-space-xs); min-width: 0; }
.exp-mail-item-from, .exp-mail-item-subject { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exp-mail-item-from { font-size: var(--exp-text-md); }
.exp-mail-item-time { flex: none; font-size: var(--exp-text-xs); color: var(--exp-text-2); font-variant-numeric: tabular-nums; }
.exp-mail-item-clip { flex: none; display: inline-flex; align-self: center; color: var(--exp-text-2); }
.exp-mail-item-clip .lucide { width: 14px; height: 14px; }
.exp-mail-item-snippet { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--exp-text-2); }
/* Ungelesen: fett, nicht farbig */
.exp-mail-item[data-unread] .exp-mail-item-from, .exp-mail-item[data-unread] .exp-mail-item-subject { font-weight: 600; }
.exp-read { display: grid; align-content: start; gap: var(--exp-space-md); padding: var(--exp-space-lg); }
.exp-read .exp-mail-readbar { margin: calc(-1 * var(--exp-space-lg)) calc(-1 * var(--exp-space-lg)) 0; }
.exp-read-subject { font-size: var(--exp-h2); font-weight: 600; overflow-wrap: anywhere; }
.exp-read-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--exp-space-sm);
  padding-block-end: var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
}
.exp-read-who { display: grid; gap: 2px; min-width: 0; }
.exp-read-who .exp-sub { overflow-wrap: anywhere; }
/* Aktionen in eigener Zeile unter dem Absender, damit lange Namen Platz haben */
.exp-read-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs); }
.exp-read-body { display: grid; gap: var(--exp-space-sm); max-width: 64ch; }
.exp-read-body p { white-space: pre-line; line-height: 1.6; }
.exp-attach {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--exp-space-sm);
  padding: var(--exp-space-sm) var(--exp-space-md);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
}
.exp-attach > .lucide { color: var(--exp-text-2); }
.exp-attach-name { display: grid; flex: 1; min-width: 10rem; }
.exp-attach-name .exp-strong { overflow-wrap: anywhere; }
/* Spaltentrenner: Haarlinie mit sichtbarem Griff; Tastatur über role="separator" */
.exp-resizer {
  position: relative;
  z-index: 2;
  width: 12px;
  margin-inline: -6px;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
.exp-resizer::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: calc(50% - 0.5px);
  width: 1px;
  background: var(--exp-border);
  transition: background-color var(--exp-dur-1) var(--exp-ease);
}
.exp-resizer::after {
  content: '';
  position: absolute;
  inset-block-start: calc(50% - 16px);
  inset-inline-start: calc(50% - 3px);
  width: 6px;
  height: 32px;
  border: 1px solid var(--exp-border-strong);
  border-radius: var(--exp-radius-pill);
  background: var(--exp-surface);
  transition: background-color var(--exp-dur-1) var(--exp-ease), border-color var(--exp-dur-1) var(--exp-ease);
}
.exp-resizer:hover::before, .exp-resizer:focus-visible::before, .exp-resizer[data-dragging]::before { background: var(--exp-accent); }
.exp-resizer:hover::after, .exp-resizer:focus-visible::after, .exp-resizer[data-dragging]::after { border-color: var(--exp-accent); background: var(--exp-accent); }
.exp-resizer:focus-visible::after { box-shadow: 0 0 0 2px var(--exp-surface), 0 0 0 4px var(--exp-focus); }

/* Schmal: eine Spalte nach der anderen (unter 992 px Fenster oder unter 760 px Container) */
@media (max-width: 991.98px) {
  .exp-mail { grid-template-columns: minmax(0, 1fr); height: 520px; }
  .exp-mail > .exp-resizer, .exp-mail > .exp-mail-col { display: none; }
  .exp-mail[data-pane='folders'] > .exp-mail-folders,
  .exp-mail[data-pane='list'] > .exp-mail-list,
  .exp-mail[data-pane='message'] > .exp-mail-read { display: block; }
  .exp-mail-folders { background: var(--exp-surface); }
  .exp-mail-back { display: inline-flex !important; }
  .exp-mail-readbar { display: flex !important; }
}
@container (max-width: 759.98px) {
  .exp-mail { grid-template-columns: minmax(0, 1fr); height: 520px; }
  .exp-mail > .exp-resizer, .exp-mail > .exp-mail-col { display: none; }
  .exp-mail[data-pane='folders'] > .exp-mail-folders,
  .exp-mail[data-pane='list'] > .exp-mail-list,
  .exp-mail[data-pane='message'] > .exp-mail-read { display: block; }
  .exp-mail-folders { background: var(--exp-surface); }
  .exp-mail-back { display: inline-flex !important; }
  .exp-mail-readbar { display: flex !important; }
}

/* =========================================================
   26. Zeiterfassung
   Zweck: Stempeln mit laufender Uhr (.exp-stamp[data-away]), Woche (.exp-day[data-today|data-kind=free|leave]),
   Monatsübersicht mit Kennzahlen.
   Beispiel: komponenten/dokumente.html
   ========================================================= */
.exp-stamp {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--exp-space-lg);
  align-items: start;
}
.exp-stamp-col { display: grid; gap: var(--exp-space-xs); min-width: 0; }
/* Uhrzeit: DM Sans mit tabellarischen Ziffern, damit die Ziffern beim Laufen nicht springen */
.exp-clock {
  font-family: var(--exp-font);
  font-size: calc(var(--exp-text-3xl) * 1.3);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--exp-text);
}
.exp-stamp-run { display: grid; gap: 2px; }
.exp-stamp-time { font-size: var(--exp-text-xl); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.exp-stamp[data-away] .exp-stamp-time { color: var(--exp-text-2); font-weight: 400; }
.exp-stamp-today { display: grid; gap: var(--exp-space-2xs); max-width: 16rem; }
.exp-stamp-action { justify-items: start; }
.exp-segments { display: grid; gap: var(--exp-space-2xs); margin: 0; padding: 0; list-style: none; font-size: var(--exp-text-sm); }
.exp-segments li { display: flex; gap: var(--exp-space-sm); }

.exp-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--exp-space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
.exp-day {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--exp-space-2xs);
  min-width: 0;
  padding: var(--exp-space-sm);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
}
.exp-day > .progress { width: 100%; margin-block: var(--exp-space-2xs); }
.exp-day[data-today] { border-color: var(--exp-accent); box-shadow: inset 0 0 0 1px var(--exp-accent); }
.exp-day[data-kind='free'] { border-color: transparent; background: var(--exp-surface-muted); }
.exp-day[data-kind='leave'] .progress-bar { background: var(--exp-chart-4); }
.exp-day-head { display: flex; align-items: baseline; gap: var(--exp-space-xs); }
.exp-day-hours { font-size: var(--exp-text-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.exp-day-empty { font-weight: 400; color: var(--exp-text-2); }
.exp-week-sum {
  display: flex;
  flex-wrap: wrap;
  gap: var(--exp-space-sm) var(--exp-space-xl);
  margin: var(--exp-space-md) 0 0;
  padding-block-start: var(--exp-space-md);
  border-block-start: 1px solid var(--exp-border);
}
.exp-week-sum > div, .exp-month-stats > div { display: grid; gap: 2px; }
.exp-week-sum dt, .exp-month-stats dt { font-weight: 400; }
.exp-week-sum dd, .exp-month-stats dd { margin: 0; font-size: var(--exp-text-lg); font-weight: 600; font-variant-numeric: tabular-nums; }

.exp-month { display: grid; gap: var(--exp-space-md); width: 100%; max-width: 560px; }
.exp-month-nav { display: flex; align-items: center; gap: var(--exp-space-xs); }
.exp-month-label { min-width: 11rem; text-align: center; font-size: var(--exp-text-lg); font-weight: 600; }
.exp-month-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--exp-space-md);
  margin: 0;
  padding: var(--exp-space-md);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
}
.exp-month > .exp-tool-foot { justify-content: flex-start; min-height: var(--exp-control-sm); }

@container (max-width: 699.98px) {
  .exp-stamp { grid-template-columns: minmax(0, 1fr); gap: var(--exp-space-md); }
}
@container (max-width: 759.98px) {
  .exp-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (max-width: 419.98px) {
  .exp-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479.98px) {
  .exp-month-label { min-width: 0; flex: 1; }
  .exp-month-stats { gap: var(--exp-space-sm); padding: var(--exp-space-sm); }
}

/* =========================================================
   27. Passwort-Tresor
   Zweck: Zugangsdaten mit Anzeigen und Kopieren (.exp-secret), Einmalcode mit Countdown-Ring
   (.exp-totp, .exp-ring[data-low]), Liste mit Dichte (.exp-vault-list[data-density=compact]),
   Gerät koppeln mit QR (.exp-pair[data-state]).
   Beispiel: komponenten/dokumente.html
   ========================================================= */
.exp-vault {
  display: grid;
  width: 100%;
  max-width: 640px;
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
}
.exp-vault-head {
  display: flex;
  align-items: center;
  gap: var(--exp-space-sm);
  padding: var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
}
.exp-vault-head > .lucide { color: var(--exp-text-2); }
.exp-vault-title { display: grid; flex: 1; min-width: 0; }
.exp-secret {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--exp-space-sm);
  min-height: 52px;
  padding: var(--exp-space-xs) var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
}
/* Kennungen, Passwörter und Codes sind technische Zeichenfolgen: Mono */
.exp-secret-value { font-family: var(--exp-font-mono); font-size: var(--exp-text-sm); overflow-wrap: anywhere; }
.exp-secret-actions { display: flex; gap: 2px; }
.exp-totp { border-block-end: 0; padding-block: var(--exp-space-sm); }
.exp-totp-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-xs) var(--exp-space-sm); }
.exp-totp-code { display: inline-flex; gap: 0.5ch; font-family: var(--exp-font-mono); font-size: var(--exp-text-2xl); line-height: 1.1; }
/* Countdown-Ring: Kreis mit pathLength = Periode, Strich = Restsekunden */
.exp-ring { position: relative; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; }
.exp-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.exp-ring circle { fill: none; stroke-width: 3; }
.exp-ring-track { stroke: var(--exp-border); }
.exp-ring-fill { stroke: var(--exp-accent); stroke-linecap: round; transition: stroke-dasharray 1s linear; }
.exp-ring[data-low] .exp-ring-fill { stroke: var(--exp-warning-fg); }
.exp-ring[data-reset] .exp-ring-fill { transition: none; }
.exp-ring-num { font-size: var(--exp-text-xs); font-weight: 600; }
.exp-vault-live { min-height: 1.5em; padding: 0 var(--exp-space-md) var(--exp-space-sm); }

.exp-vault-list { display: grid; gap: var(--exp-space-md); width: 100%; max-width: 640px; }
.exp-vault-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-sm); }
.exp-vault-search { flex: 1; min-width: 14rem; }
.exp-vault-tools .exp-segmented .lucide { width: 14px; height: 14px; }
.exp-vault-items .list-group-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs) var(--exp-space-sm); }
.exp-vault-items .list-group-item > .exp-badge { margin-inline-start: auto; }
.exp-vault-items .list-group-item > .lucide { color: var(--exp-text-2); }
.exp-vault-item-text { display: grid; flex: 1 1 12rem; min-width: 0; }
.exp-vault-item-text .exp-sub { overflow-wrap: break-word; }
.exp-vault-list[data-density='compact'] .exp-vault-item-text .exp-sub { display: none; }
.exp-vault-list[data-density='compact'] .list-group-item { padding-block: var(--exp-space-xs); }

.exp-pair { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--exp-space-lg); align-items: start; max-width: 720px; }
.exp-qr {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: var(--exp-space-sm);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
}
.exp-pair[data-state='idle'] .exp-qr { border: 2px dashed var(--exp-border-strong); background: var(--exp-surface-muted); }
/* Platzhalter-Raster 21 × 21, Module in Textfarbe; kein echter Code */
.exp-qr-grid { display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); width: 100%; aspect-ratio: 1; }
.exp-qr-grid > span { aspect-ratio: 1; }
.exp-qr-grid > span[data-on] { background: var(--exp-text); }
.exp-qr-state { display: grid; justify-items: center; gap: var(--exp-space-xs); padding: var(--exp-space-sm); text-align: center; color: var(--exp-text-2); }
.exp-qr-state .lucide { width: 32px; height: 32px; }
.exp-pair-steps { display: grid; gap: var(--exp-space-sm); }
.exp-pair-steps ol { display: grid; gap: var(--exp-space-2xs); margin: 0; padding-inline-start: var(--exp-space-lg); }

@container (max-width: 479.98px) {
  .exp-secret { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .exp-secret > .exp-sub:first-child { grid-column: 1 / -1; }
}
@container (max-width: 519.98px) {
  .exp-pair { grid-template-columns: minmax(0, 1fr); }
  .exp-qr { width: 200px; max-width: 100%; }
}

/* =========================================================
   28. Signatur und Scan
   Zweck: Felder auf dem Dokument platzieren (.exp-sign-field[aria-pressed]), Unterschrift zeichnen (.exp-pad),
   Foto zuschneiden mit Griffen (.exp-crop, .exp-handle).
   Beispiel: komponenten/dokumente.html
   ========================================================= */
.exp-sign { display: grid; grid-template-columns: minmax(0, 440px) minmax(14rem, 1fr); gap: var(--exp-space-lg); align-items: start; }
.exp-sign-page { display: grid; gap: var(--exp-space-lg); min-width: 0; }
.exp-sign-sheet { position: relative; touch-action: none; }
/* Feld auf dem Dokument: Rahmen mit Beschriftung (Art) oben links, Unterzeichner im Feld */
.exp-sign-field {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0 var(--exp-space-2xs);
  border: 1.5px dashed var(--exp-text-2);
  border-radius: 0 var(--exp-radius-sm) var(--exp-radius-sm) var(--exp-radius-sm);
  background: color-mix(in srgb, var(--exp-surface) 88%, transparent);
  color: var(--exp-text-2);
  font-size: var(--exp-text-xs);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.exp-sign-field:active { cursor: grabbing; }
.exp-sign-field:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: 2px; }
.exp-sign-field-tag {
  position: absolute;
  inset-block-end: 100%;
  inset-inline-start: -1.5px;
  padding: 1px 6px;
  border-radius: var(--exp-radius-sm) var(--exp-radius-sm) 0 0;
  background: var(--exp-text-2);
  color: var(--exp-surface);
  font-size: var(--exp-text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.exp-sign-field-who { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exp-sign-field img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; pointer-events: none; }
.exp-sign-field[aria-pressed='true'] { border-style: solid; border-color: var(--exp-accent); background: var(--exp-accent-muted); color: var(--exp-text); }
.exp-sign-field[aria-pressed='true'] .exp-sign-field-tag { background: var(--exp-accent); color: var(--exp-on-accent); }
.exp-sign-list { display: grid; gap: var(--exp-space-sm); min-width: 0; }
.exp-sign-list ul { display: grid; gap: var(--exp-space-2xs); margin: 0; padding: 0; list-style: none; }
.exp-sign-list li {
  display: flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  padding-inline-end: var(--exp-space-2xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
}
.exp-sign-list li[data-selected] { border-color: var(--exp-accent); box-shadow: inset 0 0 0 1px var(--exp-accent); }
.exp-fieldrow {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border: 0;
  border-radius: var(--exp-radius);
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.exp-fieldrow:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }

.exp-pad { display: grid; gap: var(--exp-space-xs); width: 100%; max-width: 560px; }
.exp-pad > .form-label { margin: 0; }
.exp-pad-surface { position: relative; height: 180px; border: 1px solid var(--exp-border-strong); border-radius: var(--exp-radius); background: var(--exp-surface); }
/* Strichfarbe liest dokumente.js aus color, also aus --exp-text */
.exp-pad-surface canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border-radius: inherit; color: var(--exp-text); touch-action: none; cursor: crosshair; }
.exp-pad-hint {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 36%;
  text-align: center;
  font-size: var(--exp-text-sm);
  color: var(--exp-text-2);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--exp-dur-1) var(--exp-ease);
}
.exp-pad-surface[data-empty] .exp-pad-hint { opacity: 1; }
.exp-pad-line { position: absolute; inset-inline: var(--exp-space-lg); inset-block-end: 40px; border-block-end: 1px dashed var(--exp-border-strong); pointer-events: none; }
.exp-pad > .exp-tool-foot { margin-block-start: var(--exp-space-2xs); }

.exp-crop { display: grid; gap: var(--exp-space-sm); width: 100%; max-width: 640px; }
/* Grund wie ein Tisch unter dem Foto: hell dunkelgrau, dunkel hellgrau, damit das Blatt in beiden Modi absticht */
.exp-crop-slot { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--exp-radius); background: var(--exp-text-2); touch-action: none; }
.exp-crop-paper { position: absolute; inset-inline-start: 50%; inset-block-start: 50%; width: 38%; transform: translate(-50%, -50%) rotate(-5deg); box-shadow: var(--exp-shadow-pop); }
.exp-crop-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.exp-crop-shade { fill: var(--exp-overlay); }
.exp-crop-edge { fill: none; stroke: var(--exp-accent); stroke-width: 2; }
.exp-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--exp-accent);
  border-radius: var(--exp-radius-pill);
  background: var(--exp-surface);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
}
.exp-handle::before { content: ''; position: absolute; inset: -11px; }   /* 44 px Trefferfläche */
.exp-handle:active { cursor: grabbing; }
.exp-handle:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: 2px; }

@container (max-width: 639.98px) {
  .exp-sign { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================
   29. Belegung und gesperrte Einträge
   Zweck: Verbrauch gegen ein Kontingent (Speicher, Postfächer, Lizenzen) als Balken mit Zahl,
   groß als Raster (.exp-usage > .exp-usage-row) oder klein in der Tabelle (.exp-mini-meter);
   ab 90 % data-tone="warning". Eintrag, den nur expenia ändern darf: .exp-lock (Schloss mit Tooltip).
   Beispiel: kundenportal/webspace.html, kundenportal/mail.html, kundenportal/dns.html, komponenten/daten.html
   ========================================================= */
.exp-usage { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: var(--exp-space-lg) var(--exp-space-xl); }
.exp-usage-row { display: grid; gap: var(--exp-space-2xs); align-content: start; }
.exp-usage-row > .exp-sub { font-size: var(--exp-text-sm); }
.exp-usage-head { display: flex; justify-content: space-between; gap: var(--exp-space-sm); }
.exp-usage-row[data-tone="warning"] .progress-bar,
.exp-mini-meter[data-tone="warning"] .progress-bar { background: var(--exp-warning-fg); }
.exp-mini-meter { display: grid; gap: var(--exp-space-3xs); min-width: 8rem; max-width: 12rem; }
.exp-lock { display: inline-flex; padding: var(--exp-space-2xs); color: var(--exp-text-2); }
.exp-lock > .lucide { width: 16px; height: 16px; }

@media (max-width: 575.98px) {
  .exp-mini-meter { min-width: 5.5rem; }
}

/* =========================================================
   30. Anmeldeseiten und öffentliche Seiten
   Zweck: Seite ohne Menü und Kopfleiste (layouts/bare): Logo über einer mittig gesetzten Karte auf dem
   Seitengrund (.exp-auth > .exp-auth-main > .exp-auth-logo + .card.exp-auth-card), darunter optional
   eine Fußzeile (.exp-auth-foot). Breite Karte für Ergebnisse und Freigaben: .exp-auth-wide.
   Das Logo wechselt mit dem Theme (.exp-auth-logo-light, .exp-auth-logo-dark).
   Beispiel: pages/anmeldung.html
   ========================================================= */
.exp-auth { min-height: 100dvh; background: var(--exp-bg); }
.exp-auth-main {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--exp-space-lg);
  min-height: 100dvh;
  padding: var(--exp-space-xl) var(--exp-space-md);
}
.exp-auth-logo { display: inline-flex; }
.exp-auth-logo img { height: 36px; width: auto; }
.exp-auth-logo-dark,
[data-bs-theme='dark'] .exp-auth-logo-light { display: none; }
[data-bs-theme='dark'] .exp-auth-logo-dark { display: block; }
.exp-auth-card { width: min(100%, 26rem); }
.exp-auth-wide .exp-auth-card { width: min(100%, 32rem); }
.exp-auth-card > .card-body { display: grid; gap: var(--exp-space-lg); padding: var(--exp-space-xl); }
.exp-auth-head { display: grid; gap: var(--exp-space-2xs); }
.exp-auth-form { display: grid; gap: var(--exp-space-md); }
.exp-auth-link { justify-self: center; font-size: var(--exp-text-sm); }
.exp-auth-card .alert { margin: 0; }
/* Code-Eingabe (Bestätigung in zwei Schritten): groß, mittig, tabellarische Ziffern */
.exp-auth-code { font-size: var(--exp-text-xl); text-align: center; font-variant-numeric: tabular-nums; }
.exp-auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--exp-space-xs) var(--exp-space-md); font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-auth-foot a { color: inherit; }
@media (max-width: 479.98px) {
  .exp-auth-main { align-content: start; padding-block-start: var(--exp-space-lg); }
  .exp-auth-card > .card-body { padding: var(--exp-space-lg); }
}

/* =========================================================
   30b. Anmeldeseite mit Bühne
   Zweck: Anmeldung des Cockpits (auth/login) über layouts/bare mit body.exp-login: links eine dunkle Bühne mit
   dem blauen Schrägstrich aus dem Logo, einem Lichtfleck unter dem Zeiger und der Begrüßung, rechts das helle
   Formularblatt (unter 900 px darunter). Die Seite hat keinen Dunkelmodus (html trägt data-exp-theme-lock).
   Bewegung steuert public/assets/js/exp-login.js über Klassen am html-Element: .exp-login-intro (voller Auftritt
   aus dem Logo, einmal pro Tag und Gerät) und .exp-login-quick (kurzes Einblenden); ohne Skript läuft die
   Grundanimation unten. Unter prefers-reduced-motion gibt es nur ein kurzes Einblenden.
   Aufbau: .exp-login-page > .exp-login-beam (+ .exp-login-glow), .exp-login-stage, .exp-login-sheet-wrap > .exp-login-sheet.
   Beispiel: keines im Styleguide (eigene Seite mit Skript)
   ========================================================= */
.exp-login {
  --exp-login-slant: -21deg;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--exp-stage-bg);
  color: var(--exp-text);
  caret-color: var(--exp-ci-blue);
}
.exp-login ::selection { background: var(--exp-ci-blue); color: var(--exp-stage-white); }
.exp-login-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 468px);
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

/* ---------- Schrägstrich und Lichtfleck ---------- */
.exp-login-beam {
  position: absolute;
  z-index: -1;
  left: -25%;
  top: calc(50% - 13vh);
  width: 150%;
  height: 26vh;
  overflow: hidden;
  pointer-events: none;
  transform-origin: 50% 50%;
  transform: translate(0px, var(--exp-login-ty, 0px)) rotate(calc(var(--exp-login-slant) + var(--exp-login-tilt, 0deg))) scale(1, 1);
  background: linear-gradient(90deg, var(--exp-ci-blue-700) 0%, var(--exp-ci-blue) 45%, var(--exp-ci-blue-500) 70%, var(--exp-ci-blue) 100%);
  animation: exp-login-draw 900ms var(--exp-ease) both;
}
.exp-login-glow {
  position: absolute;
  inset: 0;
  opacity: var(--exp-login-go, 0);
  transition: opacity 500ms;
  background: radial-gradient(460px circle at var(--exp-login-gx, 50%) var(--exp-login-gy, 50%), var(--exp-glow), var(--exp-glow-soft) 45%, transparent 70%);
}
@keyframes exp-login-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Bühne ---------- */
.exp-login-stage {
  display: flex;
  flex-direction: column;
  gap: var(--exp-space-xl);
  min-width: 0;
  padding: var(--exp-space-xl) 56px 36px;
  color: var(--exp-stage-text);
}
.exp-login-stage :focus-visible { outline-color: var(--exp-stage-white); }
.exp-login-stage-logo { display: block; height: 28px; width: auto; align-self: flex-start; transition: opacity 400ms; }
.exp-login-greet { max-width: 34rem; margin-block: auto; }
.exp-login-greet h1 { margin: 0; font-family: var(--exp-font-display); font-weight: 600; font-size: clamp(2.6rem, 6vw, 5.25rem); line-height: 0.98; text-wrap: balance; color: inherit; }
.exp-login-greet p { margin: 20px 0 0; max-width: 26rem; font-size: var(--exp-text-lg); color: var(--exp-stage-text-2); }
.exp-login-wipe { display: block; animation: exp-login-wipe 820ms var(--exp-ease) both; animation-delay: var(--exp-login-delay, 180ms); }
@keyframes exp-login-wipe { from { clip-path: polygon(0 0, 0 0, -14% 100%, -14% 100%); } to { clip-path: polygon(0 0, 114% 0, 100% 100%, -14% 100%); } }

/* ---------- Blatt mit dem Formular ---------- */
.exp-login-sheet-wrap { display: flex; min-width: 0; padding: var(--exp-space-lg) var(--exp-space-lg) var(--exp-space-lg) 0; }
.exp-login-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 28px var(--exp-space-xl) var(--exp-space-lg);
  border-radius: var(--exp-radius-lg);
  background: var(--exp-surface);
  color: var(--exp-text);
  font-size: 0.9375rem;
  box-shadow: var(--exp-shadow-sheet);
  animation: exp-login-sheet-in 760ms var(--exp-ease) 240ms both;
}
@keyframes exp-login-sheet-in {
  from { clip-path: polygon(34% 0, 100% 0, 100% 100%, 46% 100%); transform: translateX(28px); opacity: 0.4; }
  to { clip-path: polygon(-12% 0, 100% 0, 100% 100%, 0 100%); transform: none; opacity: 1; }
}
.exp-login-view { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: var(--exp-space-md) 0 var(--exp-space-lg); }
.exp-login-view h2 { margin: 0 0 6px; font-family: var(--exp-font-display); font-weight: 600; font-size: var(--exp-text-3xl); line-height: 1.15; color: var(--exp-text); }
.exp-login-lead { margin: 0 0 26px; color: var(--exp-text-2); }
.exp-login-form { display: grid; gap: 18px; }
.exp-login-field .form-label { margin-block-end: 6px; }
.exp-login-control { position: relative; }
.exp-login-control .form-control { padding-inline-end: 46px; font-size: 1rem; }
.exp-login-mark,
.exp-login-eye { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; display: grid; place-items: center; width: 40px; height: 40px; }
.exp-login-mark svg,
.exp-login-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.exp-login-mark { color: var(--exp-success-fg); pointer-events: none; }
.exp-login-mark path { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset 320ms var(--exp-ease); }
.exp-login-field[data-valid='true'] .exp-login-mark path { stroke-dashoffset: 0; }
.exp-login-eye { border: 0; border-radius: var(--exp-radius-sm); background: none; color: var(--exp-text-2); cursor: pointer; transition: background-color 150ms, color 150ms; }
.exp-login-eye:hover { background: var(--exp-bg); color: var(--exp-text); }
.exp-login-eye .exp-login-slash { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 220ms var(--exp-ease); }
.exp-login-eye[aria-pressed='true'] .exp-login-slash { stroke-dashoffset: 0; }

/* Aufklappbare Zeilen: Fehlermeldung des Servers und Hinweis auf die Feststelltaste */
.exp-login-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 240ms var(--exp-ease); }
.exp-login-fold > div { overflow: hidden; }
.exp-login-fold[data-open='true'] { grid-template-rows: 1fr; }
.exp-login-fold .alert { margin: 0 0 18px; }
.exp-login-note { display: flex; gap: var(--exp-space-xs); align-items: flex-start; padding-block-start: var(--exp-space-xs); font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-login-note svg { width: 16px; height: 16px; margin-block-start: 2px; }
.exp-login-view[data-error='true'] .form-control { border-color: var(--exp-danger-fg); }
.exp-login-view[data-error='true'] .exp-login-form { animation: exp-login-nudge 260ms var(--exp-ease) 450ms; }
@keyframes exp-login-nudge { 30% { transform: translateX(-6px); } 65% { transform: translateX(4px); } }
.exp-login-form .form-check { margin: 2px 0 4px; font-size: var(--exp-text-md); }

.exp-login-submit { position: relative; overflow: hidden; font-size: 1rem; font-weight: 600; transition: background-color 150ms, border-color 150ms, transform 120ms; }
.exp-login-submit:active { transform: scale(0.985); }
.exp-login-submit::before { content: ''; position: absolute; inset: 0 -30%; background: linear-gradient(90deg, transparent, var(--exp-shine), transparent); transform: translateX(-100%) skewX(-21deg); }
.exp-login-submit[aria-busy='true'] { --bs-btn-bg: var(--exp-accent-hover); --bs-btn-border-color: var(--exp-accent-hover); cursor: progress; }
.exp-login-submit[aria-busy='true']::before { animation: exp-login-run 900ms linear infinite; }
@keyframes exp-login-run { to { transform: translateX(100%) skewX(-21deg); } }
.exp-login-below { margin: 20px 0 0; color: var(--exp-text-2); }
.exp-login-foot { display: flex; justify-content: space-between; gap: var(--exp-space-sm); font-size: var(--exp-text-xs); color: var(--exp-text-2); }
.exp-login-foot a { color: inherit; }

/* ---------- Auftritt: das Logo steht zuerst allein, sein blauer Strich wird zur Bühne ---------- */
.exp-login-intro-logo { position: fixed; z-index: 5; left: 50%; top: 50%; display: none; width: min(300px, 62vw); transform: translate(-50%, -50%); pointer-events: none; }
.exp-login-intro-logo svg { display: block; width: 100%; height: auto; }
.exp-login-intro-logo .exp-login-slash-fill { fill: var(--exp-ci-blue); }
.exp-login-intro-logo .exp-login-logo-fill { fill: var(--exp-stage-white); }
.exp-login-intro .exp-login-intro-logo { display: block; }
/* Bis der Strich startet, ist außer dem Logo nichts zu sehen, auch kein halb aufgedecktes Blatt */
.exp-login-intro .exp-login-beam { animation-play-state: paused; }
.exp-login-intro .exp-login-page:not(.exp-login-go) .exp-login-wipe,
.exp-login-intro .exp-login-page:not(.exp-login-go) .exp-login-sheet { animation: none; }
.exp-login-intro .exp-login-beam,
.exp-login-intro .exp-login-stage-logo,
.exp-login-intro .exp-login-page:not(.exp-login-go) .exp-login-sheet,
.exp-login-intro .exp-login-page:not(.exp-login-go) .exp-login-wipe { opacity: 0; }
.exp-login-go .exp-login-sheet { animation-delay: 80ms; }
.exp-login-go .exp-login-wipe { animation-delay: calc(var(--exp-login-delay, 180ms) - 140ms); }

/* ---------- Kurzfassung (zweiter Besuch am Tag) und reduzierte Bewegung: nur kurzes Einblenden ---------- */
@keyframes exp-login-fade { from { opacity: 0; } }
.exp-login-quick .exp-login-beam,
.exp-login-quick .exp-login-wipe,
.exp-login-quick .exp-login-sheet { animation: exp-login-fade 320ms ease-out both; animation-delay: 0s; }
.exp-login-quick .exp-login-sheet { animation-delay: 80ms; }

/* ---------- Übergang ins Cockpit: der blaue Strich deckt die erste Seite nach der Anmeldung auf ----------
   public/assets/js/exp-login-open.js setzt html.exp-login-opening vor dem ersten Zeichnen und nimmt es nach
   der Animation (höchstens 700 ms) wieder weg. Feste Farben wie die Bühne, in beiden Modi gleich. */
.exp-login-opening::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: linear-gradient(90deg, var(--exp-ci-blue-700) 0%, var(--exp-ci-blue) 45%, var(--exp-ci-blue-500) 70%, var(--exp-ci-blue) 100%);
  animation: exp-login-open 640ms var(--exp-ease) both;
}
@keyframes exp-login-open {
  0%, 14% { clip-path: polygon(0 0, 130% 0, 100% 100%, -30% 100%); }
  100% { clip-path: polygon(130% 0, 130% 0, 100% 100%, 100% 100%); }
}

@media (max-width: 899.98px) {
  .exp-login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .exp-login-stage { gap: 22px; padding: var(--exp-space-lg) var(--exp-space-lg) 22px; }
  .exp-login-greet h1 { font-size: clamp(2.2rem, 11vw, 3.2rem); }
  .exp-login-greet p { display: none; }
  .exp-login-beam { top: 60px; height: 150px; }
  .exp-login-sheet-wrap { padding: 0; }
  .exp-login-sheet { padding: 20px var(--exp-space-lg) calc(20px + env(safe-area-inset-bottom)); border-radius: var(--exp-radius-lg) var(--exp-radius-lg) 0 0; animation-name: exp-login-sheet-up; }
  .exp-login-view { justify-content: flex-start; }
  @keyframes exp-login-sheet-up { from { transform: translateY(32px); opacity: 0.4; } to { transform: none; opacity: 1; } }
}

@media (prefers-reduced-motion: reduce) {
  .exp-login-beam,
  .exp-login-wipe,
  .exp-login-sheet { animation: exp-login-fade 200ms ease-out both; animation-delay: 0s; }
  .exp-login-submit[aria-busy='true']::before,
  .exp-login-view[data-error='true'] .exp-login-form { animation: none; }
  .exp-login-glow { display: none; }
}

/* =========================================================
   Modul dashboard: Zeilenliste im Panel
   Zweck: bündige Liste in einer Karte (.exp-itemlist > li.exp-item). Vorne optional ein Icon
   (.exp-item-lead), in der Mitte Titel mit Unterzeile (.exp-item-main, als Link oder als Block),
   hinten Status, Priorität, Fälligkeit oder eine Aktion (.exp-item-end). Titel und Unterzeile kürzen
   mit Auslassung, die Angaben hinten brechen nicht um; unter 640 px stehen zwei Angaben in einer eigenen Zeile.
   Beispiel: komponenten/daten.html (Zeilenliste), Dashboard im Cockpit
   ========================================================= */
.exp-itemlist { margin: 0; padding: 0; list-style: none; }
.exp-item { display: flex; align-items: center; gap: var(--exp-space-sm); min-width: 0; padding: var(--exp-space-sm) var(--exp-space-lg); }
.exp-item + .exp-item { border-block-start: 1px solid var(--exp-border); }
.exp-item-lead { display: inline-flex; flex: none; color: var(--exp-text-2); }
.exp-item-lead .lucide { width: 16px; height: 16px; }
.exp-item-main { display: grid; flex: 1; gap: 1px; min-width: 0; color: var(--exp-text); text-decoration: none; }
.exp-item-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.exp-item-main:hover > :first-child { color: var(--exp-text-accent); text-decoration: underline; }
.exp-item-end { display: flex; flex: none; align-items: center; gap: var(--exp-space-sm); font-size: var(--exp-text-sm); }
/* Schmal: zwei Angaben hinten (Priorität und Fälligkeit) rücken unter den Titel, bündig zu ihm */
@media (max-width: 639.98px) {
  .exp-item { flex-wrap: wrap; row-gap: var(--exp-space-2xs); padding-inline: var(--exp-space-md); }
  .exp-item-end:has(> :nth-child(2)) { flex-basis: 100%; }
  .exp-item-lead ~ .exp-item-end:has(> :nth-child(2)) { padding-inline-start: calc(16px + var(--exp-space-sm)); }
}

/* =========================================================
   Hilfsklasse Kleben
   Zweck: Alles, das beim Blättern unter der Kopfleiste oben bleiben soll, bekommt .exp-sticky
   (position sticky mit dem Abstand aus tokens.css; --exp-sticky-top rechnet das Hinweisband mit).
   Kein fester Abstand und kein eigenes top in Views.
   Beispiel: klebendes Inhaltsverzeichnis der Hilfe (timetracking/help/topic.php)
   ========================================================= */
.exp-sticky { position: sticky; top: var(--exp-sticky-top); }

/* =========================================================
   Modul customers: Kopf des Kunden
   Zweck: Identität und Aktionen eines Kunden über beiden Spalten der Kundenseiten
   (Abschnitt page_head): großer Initialen-Avatar, Name, Kurzangaben und Badges in
   .exp-client-id, rechts die Aktionen in .exp-actions. View customers/_head.php
   liefert das Markup; andere Module binden dasselbe Partial in ihren page_head ein.
   Beispiel: pages/rahmen-mandant.html, pages/mandant.html
   ========================================================= */
.exp-client-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--exp-space-md); }
.exp-client-id { display: flex; align-items: center; gap: var(--exp-space-md); min-width: 0; }
.exp-client-id > div { display: grid; gap: var(--exp-space-2xs); min-width: 0; }
.exp-client-id h1 { overflow-wrap: anywhere; }
@media (max-width: 639.98px) {
  .exp-client-head .exp-actions { width: 100%; }
  .exp-client-head .exp-actions .btn { flex: 1; }
}

/* =========================================================
   Modul tasks: Fließtext und Avatare mit Farbe aus der Datenbank
   Zweck: .exp-prose gibt HTML aus Beschreibung, Kommentaren und Verlauf
   Absatzabstände (der Kern setzt p { margin: 0 }); .exp-avatar übernimmt eine
   Farbe aus --exp-swatch, wenn sie als einzige erlaubte Inline-Angabe
   (style="--exp-swatch: …") gesetzt ist, etwa die Avatar-Farbe aus den
   Benutzer-Einstellungen. Textfarbe --exp-paper bleibt in beiden Modi hell.
   Beispiel: pages/aufgaben.html, Komponenten dashboard und rahmen-mandant
   ========================================================= */
.exp-prose > * + * { margin-block-start: var(--exp-space-sm); }
.exp-prose ul, .exp-prose ol { padding-inline-start: 1.25rem; }
.exp-prose img { max-width: 100%; height: auto; }
.exp-avatar[style*='--exp-swatch'] { background: var(--exp-swatch); color: var(--exp-paper); }

/* =========================================================
   Modul webmail: Postfach als Werkzeugseite
   Zweck: Ergänzungen zum Mail-Client (Abschnitt 25) für die Webmail-Ansicht: Ordnerbaum mit
   Zählern und Unterordnern (.exp-folder-item[data-depth]), Listenkopf mit Suche und Filtern
   (.exp-mail-listhead), Nachrichtenzeile mit Avatar bzw. Kästchen und Schnellaktionen
   (.exp-mail-row[data-selected|data-pinned|data-new|data-swipe]), Abschnittstitel (.exp-mail-section),
   Leseansicht mit Tabs, Anhängen und Lesepapier (.exp-mail-paper, in beiden Modi hell), Unterhaltung
   (.exp-comments[data-kind=mails] mit .exp-mail-paper), Verfassen (.exp-compose), Ablage per Ziehen
   (.exp-mail-drop).
   Beispiel: pages/webmail.html
   ========================================================= */

/* ---------- Ordnerspalte ---------- */
.exp-mail { position: relative; }
.exp-main[data-layout='tool'] > .exp-mail { --exp-mail-w1: 208px; --exp-mail-w2: 360px; }
.exp-mail-folders > * { min-width: 0; }
.exp-mail-folders .exp-folders { grid-template-columns: minmax(0, 1fr); }
.exp-mail-folders { display: flex; flex-direction: column; gap: var(--exp-space-2xs); }
.exp-mail-new { display: grid; padding: var(--exp-space-3xs) var(--exp-space-3xs) var(--exp-space-xs); }
button.exp-mail-head {
  display: flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  width: 100%;
  border: 0;
  background: none;
  text-align: start;
  cursor: pointer;
}
button.exp-mail-head .lucide { width: 14px; height: 14px; transition: transform var(--exp-dur-2) var(--exp-ease); }
button.exp-mail-head[aria-expanded='false'] .lucide { transform: rotate(-90deg); }
button.exp-mail-head:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; border-radius: var(--exp-radius-sm); }
.exp-folder-item { position: relative; display: flex; align-items: center; padding-inline-start: calc(var(--exp-depth, 0) * 14px); }
.exp-folder-item[data-depth='1'] { --exp-depth: 1; }
.exp-folder-item[data-depth='2'] { --exp-depth: 2; }
.exp-folder-item[data-depth='3'] { --exp-depth: 3; }
.exp-folder-item[data-depth='4'] { --exp-depth: 4; }
.exp-folder-item[hidden] { display: none; }
.exp-folder-toggle, .exp-folder-gap { display: grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: var(--exp-text-2); }
.exp-folder-toggle { border-radius: var(--exp-radius-sm); cursor: pointer; }
.exp-folder-toggle:hover { background: var(--exp-neutral-bg); }
.exp-folder-toggle:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }
.exp-folder-toggle .lucide { width: 14px; height: 14px; transition: transform var(--exp-dur-2) var(--exp-ease); }
.exp-folder-toggle[aria-expanded='false'] .lucide { transform: rotate(-90deg); }
.exp-folder-item > .exp-folder { flex: 1; min-width: 0; }
/* Anzahl ungelesener Mails: fett, in Akzentfarbe; die Gesamtzahl bleibt neutral */
.exp-folder-count[data-unread] { color: var(--exp-text-accent); font-weight: 700; }
/* Favorit und Menü erscheinen beim Überfahren anstelle des Zählers */
.exp-folder-tools { position: absolute; inset-inline-end: 2px; display: none; align-items: center; gap: 2px; padding-inline-start: var(--exp-space-3xs); border-radius: var(--exp-radius-sm); background: var(--exp-surface-muted); }
.exp-folder-tools .btn-icon { width: 28px; height: 28px; min-height: 28px; }
.exp-folder-item:hover .exp-folder-tools, .exp-folder-item:focus-within .exp-folder-tools { display: inline-flex; }
.exp-folder-item:hover .exp-folder-count, .exp-folder-item:focus-within .exp-folder-count { visibility: hidden; }
@media (hover: none) {
  .exp-folder-item .exp-folder-tools { display: none; }
  .exp-folder-item:hover .exp-folder-count { visibility: visible; }
}
.exp-mail-foot { position: sticky; inset-block-end: 0; margin: auto calc(-1 * var(--exp-space-xs)) calc(-1 * var(--exp-space-xs)); padding: var(--exp-space-xs); border-block-start: 1px solid var(--exp-border); background-color: var(--exp-surface); background-image: linear-gradient(var(--exp-surface-muted), var(--exp-surface-muted)); }
.exp-mail-foot .btn { width: 100%; justify-content: flex-start; }

/* ---------- Zwischen 992 und 1199 px: Liste und Lesebereich nebeneinander, die Ordner öffnen als Ebene ---------- */
.exp-mail-folder-toggle, .exp-mail-backdrop { display: none; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .exp-mail { grid-template-columns: var(--exp-mail-w2, 300px) auto minmax(0, 1fr); }
  .exp-mail > .exp-mail-folders, .exp-mail > .exp-resizer[data-resize='--exp-mail-w1'] { display: none; }
  .exp-mail[data-folders='open'] > .exp-mail-folders { position: absolute; inset-block: 0; inset-inline-start: 0; z-index: 6; display: flex; width: min(280px, 85%); background: var(--exp-surface); box-shadow: var(--exp-shadow-pop); }
  .exp-mail[data-folders='open'] > .exp-mail-backdrop { position: absolute; inset: 0; z-index: 5; display: block; background: var(--exp-overlay); }
  .exp-mail-folder-toggle { display: inline-flex; }
}

/* ---------- Listenkopf: Titel, Suche, Filter, Sammelleiste ---------- */
.exp-mail-title-row { display: flex; align-items: center; gap: var(--exp-space-2xs); min-width: 0; }
.exp-mail-title-row .exp-mail-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exp-mail-filter { min-width: 17rem; padding: var(--exp-space-xs) var(--exp-space-sm); }
.exp-mail-filter-group { display: grid; gap: var(--exp-space-3xs); min-width: 0; margin: 0 0 var(--exp-space-sm); padding: 0; border: 0; }
.exp-mail-filter-group legend { float: none; margin: 0 0 var(--exp-space-3xs); padding: 0; font-size: var(--exp-text-sm); font-weight: 600; color: var(--exp-text-2); }
.exp-mail-filter-dates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--exp-space-xs); margin-block-start: var(--exp-space-2xs); }
.exp-mail-filter-dates[hidden] { display: none; }
.exp-mail-filter-foot { display: flex; justify-content: space-between; gap: var(--exp-space-xs); padding-block-start: var(--exp-space-xs); border-block-start: 1px solid var(--exp-border); }
.exp-mail-listhead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  display: grid;
  gap: var(--exp-space-xs);
  padding: var(--exp-space-xs) var(--exp-space-sm);
  border-block-end: 1px solid var(--exp-border);
  background: var(--exp-surface);
}
.exp-mail-title { display: flex; align-items: baseline; gap: var(--exp-space-xs); margin: 0; font-family: var(--exp-font); font-size: var(--exp-text-md); font-weight: 600; }
.exp-mail-title .exp-sub { font-weight: 400; }
.exp-mail-search { position: relative; }
.exp-mail-search .form-control { padding-inline-end: 68px; }
.exp-mail-search-end { position: absolute; inset-block: 0; inset-inline-end: 4px; display: flex; align-items: center; gap: 2px; }
.exp-mail-tools { display: flex; align-items: center; gap: var(--exp-space-3xs); }
.exp-mail-tools .btn-icon[aria-pressed='true'] { background: var(--exp-accent-muted); color: var(--exp-text-accent); }
.exp-mail-tools-end { margin-inline-start: auto; display: inline-flex; align-items: center; gap: var(--exp-space-3xs); }
.exp-mail-chips { display: flex; flex-wrap: wrap; gap: var(--exp-space-2xs); }
.exp-mail-chips[hidden] { display: none; }
/* Die Sammelleiste ersetzt die Werkzeugzeile; der Zähler steht vorn */
.exp-mail-listhead .exp-bulkbar { flex-wrap: nowrap; gap: var(--exp-space-3xs); margin: 0; padding-inline: var(--exp-space-sm) var(--exp-space-2xs); }
.exp-mail-listhead .exp-bulkbar[hidden] { display: none; }
.exp-mail-listhead .exp-bulkbar-count { order: -1; margin-inline: 0 auto; color: var(--exp-text); font-weight: 600; }
.exp-mail-section {
  display: flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  margin: 0;
  padding: var(--exp-space-2xs) var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
  background: var(--exp-surface-muted);
  font-size: var(--exp-text-xs);
  font-weight: 600;
  color: var(--exp-text-2);
}
.exp-mail-section .lucide { width: 13px; height: 13px; }

/* ---------- Nachrichtenzeile ---------- */
.exp-mail-row { position: relative; }
.exp-mail-row > .exp-mail-item { padding-inline: 52px var(--exp-space-md); }
.exp-mail-lead { position: absolute; inset-block-start: 10px; inset-inline-start: var(--exp-space-sm); display: grid; place-items: center; width: 28px; height: 28px; cursor: pointer; }
.exp-mail-lead > .form-check-input { position: absolute; inset: 0; margin: auto; opacity: 0; cursor: pointer; }
.exp-mail-lead > .form-check-input:focus-visible, .exp-mail-lead > .form-check-input:checked { opacity: 1; }
.exp-mail-row:hover .exp-mail-lead > .form-check-input, .exp-mail-list[data-selecting] .exp-mail-lead > .form-check-input { opacity: 1; }
.exp-mail-row:hover .exp-mail-lead > .exp-avatar, .exp-mail-list[data-selecting] .exp-mail-lead > .exp-avatar,
.exp-mail-lead:has(.form-check-input:checked) > .exp-avatar, .exp-mail-lead:has(.form-check-input:focus-visible) > .exp-avatar { visibility: hidden; }
@media (hover: none) {
  .exp-mail-row:hover .exp-mail-lead > .form-check-input { opacity: 0; }
  .exp-mail-row:hover .exp-mail-lead > .exp-avatar { visibility: visible; }
  .exp-mail-lead { inset-block-start: 4px; inset-inline-start: 4px; width: 44px; height: 44px; }
  .exp-mail-lead > .form-check-input { inset: 14px; width: 16px; height: 16px; }
}
.exp-mail-row[data-selected] { background: var(--exp-accent-muted); }
.exp-mail-row[data-selected] > .exp-mail-item:hover { background: transparent; }
.exp-mail-row[data-pinned] > .exp-mail-item { box-shadow: inset 3px 0 0 var(--exp-warning-fg); }
.exp-mail-row[data-pinned] > .exp-mail-item[aria-current='true'] { box-shadow: inset 3px 0 0 var(--exp-accent); }
/* Neu eingetroffen (Polling): der Hintergrund blendet nach etwa 2 Sekunden aus */
.exp-mail-row[data-new] { animation: exp-mail-new 2.4s var(--exp-ease) 1; }
@keyframes exp-mail-new { from { background: var(--exp-info-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .exp-mail-row[data-new] { animation: none; background: var(--exp-info-bg); } }
.exp-mail-marks { display: inline-flex; flex: none; align-items: center; gap: var(--exp-space-3xs); color: var(--exp-text-2); }
.exp-mail-marks .lucide { width: 14px; height: 14px; }
.exp-mail-mark[data-tone='flag'] { color: var(--exp-warning-fg); }
.exp-mail-mark[data-tone='replied'] { color: var(--exp-text-accent); }
.exp-mail-marks .exp-countpill, .exp-mail-marks .exp-badge { height: 18px; padding: 0 6px; }
.exp-mail-item-who { flex: none; width: 18px; height: 18px; font-size: 9px; }
.exp-mail-item-draft { font-style: italic; }
/* Schnellaktionen beim Überfahren; auf Touch öffnet „Mehr“ das Kontextmenü der Zeile */
.exp-mail-actions { position: absolute; inset-block-end: var(--exp-space-2xs); inset-inline-end: var(--exp-space-xs); display: none; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--exp-border); border-radius: var(--exp-radius); background: var(--exp-surface-raised); box-shadow: var(--exp-shadow-xs); }
.exp-mail-row:hover .exp-mail-actions, .exp-mail-row:focus-within .exp-mail-actions { display: inline-flex; }
.exp-mail-actions .btn-icon { width: 28px; height: 28px; min-height: 28px; }
.exp-mail-more { display: none; }
@media (hover: none) {
  .exp-mail-row .exp-mail-actions { display: none; }
  .exp-mail-more { position: absolute; inset-block-start: 4px; inset-inline-end: 0; display: inline-flex; }
}
/* Wischgeste (nur Touch): die Zeile gleitet, darunter erscheint die Aktion; links löschen, rechts gelesen/ungelesen */
.exp-mail-row[data-swipe] { overflow: hidden; }
.exp-mail-swipe { position: absolute; inset-block: 0; display: none; align-items: center; gap: var(--exp-space-xs); padding-inline: var(--exp-space-md); font-size: var(--exp-text-sm); font-weight: 600; }
.exp-mail-swipe .lucide { width: 18px; height: 18px; }
.exp-mail-swipe[data-side='start'] { inset-inline-start: 0; background: var(--exp-info-bg); color: var(--exp-info-text); }
.exp-mail-swipe[data-side='end'] { inset-inline-end: 0; background: var(--exp-danger-bg); color: var(--exp-danger-text); }
.exp-mail-row[data-swipe='right'] > .exp-mail-swipe[data-side='start'], .exp-mail-row[data-swipe='left'] > .exp-mail-swipe[data-side='end'] { display: flex; }
.exp-mail-row[data-swipe] > .exp-mail-item { background: var(--exp-surface); transition: transform var(--exp-dur-1) var(--exp-ease); }
.exp-mail-row[data-swipe='right'] > .exp-mail-item { transform: translateX(96px); }
.exp-mail-row[data-swipe='left'] > .exp-mail-item { transform: translateX(-96px); }
.exp-mail-row[data-swipe] > .exp-mail-lead, .exp-mail-row[data-swipe] > .exp-mail-more { display: none; }
.exp-mail-end { display: flex; align-items: center; justify-content: center; gap: var(--exp-space-xs); padding: var(--exp-space-md); font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-mail-state { display: flex; align-items: center; gap: var(--exp-space-xs); padding: var(--exp-space-xs) var(--exp-space-md); border-block-end: 1px solid var(--exp-border); font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-mail-skeleton { display: grid; gap: var(--exp-space-xs); padding: var(--exp-space-sm) var(--exp-space-md) var(--exp-space-sm) 52px; border-block-end: 1px solid var(--exp-border); }

/* ---------- Leseansicht ---------- */
.exp-mail-read { position: relative; }
.exp-mail-bar > .exp-tabs { flex: 1; min-width: 0; border-block-end: 0; }
.exp-mail-bar:has(> .exp-tabs) { padding-block: 0; }
.exp-mail-bar-end { margin-inline-start: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-3xs); }
.exp-read-head { display: grid; gap: var(--exp-space-xs); }
.exp-read-subject .exp-countpill { margin-inline-start: var(--exp-space-xs); vertical-align: middle; }
.exp-read-line { display: flex; flex-wrap: wrap; gap: var(--exp-space-3xs) var(--exp-space-xs); min-width: 0; font-size: var(--exp-text-sm); color: var(--exp-text-2); overflow-wrap: anywhere; }
.exp-read-line > .exp-strong { flex: none; }
.exp-read-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs); }
.exp-attachments { display: grid; gap: var(--exp-space-xs); }
.exp-attachments-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-xs); }
.exp-attachments-head > .exp-strong { display: inline-flex; align-items: center; gap: var(--exp-space-2xs); margin: 0 auto 0 0; font-family: var(--exp-font); font-size: var(--exp-text-md); }
.exp-attachments-head .lucide { width: 16px; height: 16px; }
.exp-attachments-list { display: grid; gap: var(--exp-space-2xs); margin: 0; padding: 0; list-style: none; }
.exp-attachments-list .exp-attach { padding-block: var(--exp-space-xs); }
.exp-attach > .form-check-input { flex: none; margin: 0; }
/* Lesepapier: Der Inhalt einer Mail steht in beiden Modi auf hellem Grund (Absender gestalten für Hell).
   Im Cockpit liegt hier der iframe mit eigenem Grund-Stylesheet. */
.exp-mail-paper {
  min-width: 0;
  padding: var(--exp-space-lg);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-paper);
  color: var(--exp-paper-text);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.exp-mail-paper p { margin: 0 0 var(--exp-space-sm); }
.exp-mail-paper > :last-child { margin-block-end: 0; }
.exp-mail-paper a { color: var(--exp-paper-link); text-decoration: underline; }
/* Signaturliste (Webmail-Einstellungen): große Logos laufen nicht über die Zeile hinaus. */
.exp-signature-preview img { max-width: 100%; height: auto; }
.exp-mail-paper blockquote { margin: 0 0 var(--exp-space-sm); padding-inline-start: var(--exp-space-sm); border-inline-start: 2px solid var(--exp-border-strong); color: var(--exp-text-2); }
.exp-mail-paper iframe { display: block; width: 100%; border: 0; background: var(--exp-paper); }
.exp-mail-paper-note { display: flex; align-items: center; gap: var(--exp-space-xs); margin-block-end: var(--exp-space-xs); font-size: var(--exp-text-sm); color: var(--exp-text-2); }
/* Unterhaltung: eine Karte je Mail, ältere sind eingeklappt und zeigen nur den Anfang */
.exp-comments[data-kind='mails'] .exp-comment-head { flex-wrap: wrap; }
.exp-comments[data-kind='mails'] > .exp-comment[data-open='false'] .exp-mail-paper { display: none; }
.exp-comments[data-kind='mails'] > .exp-comment[data-open='true'] .exp-mail-snippet { display: none; }
.exp-mail-snippet { overflow: hidden; color: var(--exp-text-2); white-space: nowrap; text-overflow: ellipsis; }

/* ---------- Verfassen ---------- */
.exp-mail-bar-title { margin: 0; font-family: var(--exp-font); font-size: var(--exp-text-md); font-weight: 600; }
/* Schwebendes Fenster: section.exp-compose[data-state=float|expanded|min] > .exp-compose-window (role=dialog) >
   .exp-compose-grip, .exp-compose-head, form.exp-compose-form (.exp-compose-scroll mit .exp-compose-row und
   .exp-compose-editor, dann .exp-compose-files) und .exp-compose-foot (.exp-compose-actions, .exp-compose-meta).
   Ab 992 px unten rechts über der Seite (float), mittig groß mit abgedunkeltem Hintergrund (expanded) oder nur die
   Titelleiste (min); darunter bildschirmfüllend, die Zustände gelten dort nicht. Die Schicht lässt Klicks durch,
   nur das Fenster nimmt sie an, die Liste dahinter bleibt bedienbar. Größe über --exp-compose-w und --exp-compose-h.
   Beispiel: pages/webmail.html */
.exp-compose {
  position: fixed;
  inset: 0;
  z-index: var(--exp-z-offcanvas);
  display: flex;
  pointer-events: none;
  --exp-compose-row-h: var(--exp-control);
}
.exp-compose-window {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: clip;
  background: var(--exp-surface);
  pointer-events: auto;
}
.exp-compose[hidden] { display: none; }
.exp-compose-grip, .exp-compose-edge { display: none; }
.exp-compose-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--exp-space-2xs);
  min-height: 48px;
  padding: var(--exp-space-2xs) var(--exp-space-xs) var(--exp-space-2xs) var(--exp-space-md);
  border-block-end: 1px solid var(--exp-border);
}
.exp-compose-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family: var(--exp-font);
  font-size: var(--exp-text-md);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Auf anderen Seiten (Lader webmail-compose-dock.js): unter Offcanvas, Modalen und deren Hintergrund, damit ein offenes Modal bedienbar bleibt */
/* Der Hintergrund eines Offcanvas (Bootstrap: 1040) dunkelt das Fenster ab und sperrt es, solange ein Offcanvas offen ist;
   Modale und deren Hintergrund liegen höher. Die Werte darunter: --exp-z-offcanvas - 6 = 1039. Im Webmail selbst bleibt die
   Schichtung (1045, eigene Ordnerleiste unter 1200 px) unverändert. */
.exp-compose[data-dock],
.exp-compose[data-dock] + .exp-compose-handoff { z-index: calc(var(--exp-z-offcanvas) - 6); }
/* Gerüst des Fensters auf fremden Seiten, solange der Lader Inhalt, Skripte und Entwurf holt (webmail-compose-dock.js):
   section.exp-compose.exp-compose-ghost[data-dock][data-state] > .exp-compose-window > .exp-compose-head und
   .exp-compose-ghost-body mit Platzhaltern. Lage, Größe und Zustand wie das Fenster (--exp-compose-w/-h aus dem Zeiger). */
.exp-compose-ghost-body { display: grid; flex: 1 1 auto; align-content: start; gap: var(--exp-space-sm); padding: var(--exp-space-md); }
.exp-compose-ghost[data-state='min'] .exp-compose-ghost-body { display: none; }
@media (max-width: 991.98px) {
  .exp-compose-ghost { display: none; }
}
/* Besitz über Tabs: Hinweis „E-Mail in anderem Tab geöffnet – Hierher holen“ unten rechts statt des Fensters (nur ab 992 px),
   unter Offcanvas und Modalen. Aufbau: div.exp-compose-handoff > Icon, .exp-compose-handoff-text, Knopf */
.exp-compose-handoff { display: none; }
@media (min-width: 992px) {
  .exp-compose-handoff {
    position: fixed;
    inset-block-end: 0;
    inset-inline-end: var(--exp-space-lg);
    z-index: calc(var(--exp-z-offcanvas) - 1);
    display: flex;
    align-items: center;
    gap: var(--exp-space-xs);
    max-width: calc(100vw - 2 * var(--exp-space-lg));
    padding: var(--exp-space-xs) var(--exp-space-xs) var(--exp-space-xs) var(--exp-space-md);
    border: 1px solid var(--exp-border);
    border-block-end: 0;
    border-radius: var(--exp-radius-lg) var(--exp-radius-lg) 0 0;
    background: var(--exp-surface);
    color: var(--exp-text-2);
    font-size: var(--exp-text-sm);
    box-shadow: var(--exp-shadow-pop);
  }
  .exp-compose-handoff[hidden] { display: none; }
  .exp-compose-handoff > .lucide { flex: none; width: 16px; height: 16px; }
  .exp-compose-handoff-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .exp-compose-handoff > .btn { flex: none; }
}
.exp-compose-head-end { display: flex; flex: none; align-items: center; gap: var(--exp-space-3xs); }
.exp-compose-head-end > .exp-compose-popout,
.exp-compose-head-end > .exp-compose-min,
.exp-compose-head-end > .exp-compose-expand { display: none; }

.exp-compose-form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.exp-compose-scroll { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow-y: auto; }
.exp-compose-scroll > .alert { flex: none; margin: var(--exp-space-xs) var(--exp-space-md) 0; }
.exp-compose-scroll > .alert[hidden] { display: none; }

/* Kopfzeilen: Etikett links, Feld rechts; die Felder sind randlos, der Fokus zeigt sich an der Zeile */
.exp-compose-row {
  display: grid;
  flex: none;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: start;
  column-gap: var(--exp-space-xs);
  min-height: var(--exp-compose-row-h);
  padding-inline: var(--exp-space-md);
}
.exp-compose-row[hidden] { display: none; }
.exp-compose-row-to { grid-template-columns: 3.5rem minmax(0, 1fr) auto; }
.exp-compose-row:focus-within { box-shadow: inset 0 -2px 0 var(--exp-focus); }
.exp-compose-row > .form-label { display: flex; align-items: center; min-height: var(--exp-compose-row-h); margin: 0; color: var(--exp-text-2); font-size: var(--exp-text-sm); }
.exp-compose-row .form-control,
.exp-compose-row .form-control:focus,
.exp-compose-row .form-select,
.exp-compose-row .form-select:focus {
  border-color: transparent;
  background-color: transparent;
  box-shadow: none;
}
.exp-compose-row .form-control,
.exp-compose-row .form-select { min-height: var(--exp-compose-row-h); }
.exp-compose-row .form-control { padding-inline: 0; }
.exp-compose-row .form-select { padding-inline-start: 0; }
.exp-compose-row .exp-recipients-box,
.exp-compose-row .exp-recipients-box:hover,
.exp-compose-row .exp-recipients-box:focus-within {
  min-height: var(--exp-compose-row-h);
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.exp-compose-row .exp-recipients-box.is-dragover { background: var(--exp-accent-muted); }
.exp-compose-row .exp-recipients-error:not(:empty) { padding-block-end: var(--exp-space-2xs); }
/* Platzhalter nur im leeren Feld (mit Chip stünde er abgeschnitten daneben) */
.exp-compose-row .exp-recipients-box:has(.exp-recipients-chip) .exp-recipients-input::placeholder { color: transparent; }
/* Neben Chips reicht ein schmales Eingabefeld: keine leere zweite Zeile */
.exp-compose-row .exp-recipients-box:has(.exp-recipients-chip) .exp-recipients-input { flex-basis: 3rem; }
.exp-compose-from-text { display: flex; align-items: center; min-width: 0; min-height: var(--exp-compose-row-h); overflow-wrap: anywhere; font-size: var(--exp-text-sm); }
.exp-compose-more { align-self: start; justify-self: end; margin-block-start: calc((var(--exp-compose-row-h) - var(--exp-control-sm)) / 2); white-space: nowrap; }
/* Cc/Bcc-Schalter: ab 992 px Textknopf der Demo, darunter Pfeil (siehe unten) */
.exp-compose-more .lucide { display: none; width: 18px; height: 18px; transition: transform var(--exp-dur-1) var(--exp-ease); }
.exp-compose-more[aria-expanded='true'] .lucide { transform: rotate(180deg); }
.exp-compose-row-subject { margin-block-start: var(--exp-space-2xs); border-block: 1px solid var(--exp-border); }

/* Schreibfläche: Host des Editors, nimmt den Rest der Höhe */
.exp-compose-editor {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 12rem;
  /* Theme-Werte außerhalb des hellen Blatts festhalten: unter 992 px folgt die Schreibfläche dem Theme
     (die Tokens im Blatt sind sonst immer die hellen, siehe tokens.css) */
  --exp-compose-text: var(--exp-text);
  --exp-compose-text-2: var(--exp-text-2);
  --exp-compose-text-accent: var(--exp-text-accent);
  --exp-compose-surface-muted: var(--exp-surface-muted);
  --exp-compose-surface-raised: var(--exp-surface-raised);
  --exp-compose-border: var(--exp-border);
  --exp-compose-border-strong: var(--exp-border-strong);
  --exp-compose-accent-muted: var(--exp-accent-muted);
}
.exp-compose-editor > .exp-editor { flex: 1 1 auto; min-width: 0; }
.exp-compose-editor .exp-editor-surface { overflow: visible; }

/* Formatleiste des Editors (ExpEditor formatHost): zwischen Anhängen und Aktionsleiste */
.exp-compose-format { flex: none; }
.exp-compose-format > .exp-editor-format { padding-inline: var(--exp-space-sm); border-block-end: 0; border-block-start: 1px solid var(--exp-border); }

/* Anhänge: Liste unter der Schreibfläche, leer ohne Höhe */
.exp-compose-files { display: grid; flex: none; justify-items: start; gap: var(--exp-space-2xs); padding-inline: var(--exp-space-md); }
.exp-compose-files:has(.exp-upload-row) { padding-block: var(--exp-space-2xs) var(--exp-space-xs); }
.exp-compose-files > .exp-upload-list { width: 100%; }
/* Die Zeilen aus webmail-inbox.js haben vier Teile: Icon, Name, Größe und Entfernen-Knopf */
.exp-compose-files .exp-upload-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
/* Viele Anhänge: die Liste scrollt in sich, die Schreibfläche behält ihre Höhe. Die Zeile darüber meldet den Stand der Uploads. */
.exp-compose-files > .exp-upload-list { max-height: 10rem; overflow-y: auto; }
.exp-compose-files .exp-upload-row { padding-block: var(--exp-space-xs); }
.exp-compose-files > .exp-upload-summary { font-size: var(--exp-text-sm); color: var(--exp-text-2); }

/* Aktionsleiste: erste Zeile Senden und Werkzeuge links, Entwurf speichern und Verwerfen immer rechts in derselben Zeile;
   der Speicherhinweis (auch Fehler, „Sitzung abgelaufen“) steht in einer eigenen, immer reservierten Zeile darunter und
   bricht die Knopfzeile nie um. .exp-compose-meta löst sich auf (display: contents), seine Kinder liegen im Raster. */
.exp-compose-foot {
  display: grid;
  flex: none;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: 'actions save discard' 'status status status';
  align-items: center;
  column-gap: var(--exp-space-3xs);
  row-gap: var(--exp-space-3xs);
  padding: var(--exp-space-xs) var(--exp-space-md) var(--exp-space-xs);
  border-block-start: 1px solid var(--exp-border);
  background: var(--exp-surface);
}
.exp-compose-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs); min-width: 0; }
.exp-compose-actions > .btn-primary { margin-inline-end: var(--exp-space-2xs); }
.exp-compose-meta { display: contents; }
.exp-compose-meta > #btn-save-draft { grid-area: save; }
.exp-compose-meta > #btn-discard { grid-area: discard; }
.exp-compose-draft {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: var(--exp-space-2xs);
  min-width: 0;
  min-height: 1.25rem;
  overflow: hidden;
  font-size: var(--exp-text-sm);
  color: var(--exp-text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exp-compose-draft .lucide { width: 14px; height: 14px; }
.exp-compose-draft[data-state='saved'] .lucide { color: var(--exp-success-fg); }
.exp-compose-draft[data-state='error'] { color: var(--exp-danger-text); }
.exp-compose-draft[data-state='error'] .lucide { color: var(--exp-danger-fg); }
.exp-compose-menu { min-width: 14rem; }
.exp-compose-check { display: inline-flex; visibility: hidden; }
.exp-compose-check .lucide { width: 16px; height: 16px; color: var(--exp-text-accent); }
.exp-compose-menu [aria-checked='true'] .exp-compose-check { visibility: visible; }

/* Unter 992 px schlank wie ein Mailprogramm am Handy: nur Text und Anhang. Felder ruhig und randlos
   (Beschriftung gedämpft links, Betreff als Platzhalter, feine Trennlinien), Von bei nur einem Konto aus,
   Cc/Bcc über einen Pfeil. Formatleiste, Link, Emoji, Bild, Signatur, Mehr-Menü, Entwurf speichern und
   Verwerfen sind ausgeblendet (nicht per Tab erreichbar); gespeichert wird automatisch, Verwerfen über
   Schließen/Zurück. Die Schreibfläche folgt dem Theme; Zitat und Signatur behalten den hellen Grund. */
@media (max-width: 991.98px) {
  .exp-compose { --exp-compose-row-h: var(--exp-control); }
  .exp-compose-row { grid-template-columns: 2.5rem minmax(0, 1fr); border-block-end: 1px solid var(--exp-border); }
  .exp-compose-row-to { grid-template-columns: 2.5rem minmax(0, 1fr) auto; }
  .exp-compose-row:focus-within { box-shadow: none; border-block-end-color: var(--exp-focus); }
  .exp-compose-row-from-single { display: none; }
  .exp-compose-row-subject { grid-template-columns: minmax(0, 1fr); margin-block-start: 0; border-block-start: 0; }
  .exp-compose-row-subject > .form-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .exp-compose-more { display: inline-flex; align-items: center; justify-content: center; min-width: var(--exp-control); min-height: var(--exp-control); margin-block-start: 0; padding: 0; }
  .exp-compose-more .lucide { display: inline-block; }
  .exp-compose-more-text { display: none; }

  .exp-compose-format,
  .exp-compose-actions > :not(.btn-primary, .exp-compose-attach),
  .exp-compose-meta > .btn { display: none; }
  .exp-compose-foot { display: flex; flex-wrap: nowrap; gap: var(--exp-space-2xs) var(--exp-space-sm); padding-block-end: calc(var(--exp-space-sm) + env(safe-area-inset-bottom)); }
  .exp-compose-meta { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: var(--exp-space-2xs); min-width: 0; }
  .exp-compose-draft { flex: 1 1 auto; min-height: 0; }
  .exp-compose-actions { flex-wrap: nowrap; }
  .exp-compose-attach { min-width: var(--exp-control-lg); min-height: var(--exp-control-lg); }

  .exp-compose-editor .exp-editor.exp-editor-paper .exp-editor-surface {
    --exp-text: var(--exp-compose-text);
    --exp-text-2: var(--exp-compose-text-2);
    --exp-text-accent: var(--exp-compose-text-accent);
    --exp-surface-muted: var(--exp-compose-surface-muted);
    --exp-surface-raised: var(--exp-compose-surface-raised);
    --exp-border: var(--exp-compose-border);
    --exp-border-strong: var(--exp-compose-border-strong);
    --exp-accent-muted: var(--exp-compose-accent-muted);
    background: transparent;
    color: var(--exp-text);
    color-scheme: inherit;
  }
  .exp-compose-editor .exp-editor-paper .exp-editor-body a { color: var(--exp-text-accent); }
  .exp-compose-editor .exp-editor-raw:is([data-kind='quote'], [data-kind='signature']) .exp-editor-raw-content,
  .exp-compose-editor .exp-editor-quote-content,
  .exp-compose-editor .exp-editor-body > .email-signature {
    padding: var(--exp-space-xs);
    border-radius: var(--exp-radius-sm);
    background: var(--exp-paper);
    color: var(--exp-paper-text);
    color-scheme: light;
  }
  .exp-compose-editor .exp-editor-raw:is([data-kind='quote'], [data-kind='signature']) .exp-editor-raw-content a,
  .exp-compose-editor .exp-editor-quote-content a,
  .exp-compose-editor .exp-editor-body > .email-signature a { color: var(--exp-paper-link); }
}
@media (max-width: 575.98px) {
  .exp-compose-foot { padding-inline: var(--exp-space-sm); }
}

/* Ab 992 px schwebend; --exp-compose-w und --exp-compose-h kommen vom Merken der Größe */
@media (min-width: 992px) {
  .exp-compose { align-items: flex-end; justify-content: flex-end; padding-inline-end: var(--exp-space-lg); }
  .exp-compose-window {
    flex: none;
    width: min(var(--exp-compose-w, 560px), calc(100vw - 2 * var(--exp-space-lg)));
    height: min(var(--exp-compose-h, 620px), calc(100dvh - var(--exp-head-h) - var(--exp-space-sm)));
    border: 1px solid var(--exp-border);
    border-block-end: 0;
    border-radius: var(--exp-radius-lg) var(--exp-radius-lg) 0 0;
    box-shadow: var(--exp-shadow-pop);
  }
  /* Größe ändern: Ecke oben links (Knopf mit sichtbarem, dezentem Winkel, auch per Tastatur) sowie linke und obere Kante
     (8 px breite Greifzone, nur Maus). Das Fenster hängt unten rechts und wächst nach links und oben. */
  .exp-compose-grip {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 3;
    display: block;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: var(--exp-radius-lg) 0 var(--exp-radius-sm) 0;
    background: transparent;
    cursor: nwse-resize;
    touch-action: none;
  }
  /* Bootstrap setzt für button:not(:disabled) den Zeiger pointer: hier gilt der Größen-Zeiger */
  button.exp-compose-grip:not(:disabled) { cursor: nwse-resize; }
  .exp-compose-grip::before {
    content: '';
    position: absolute;
    inset-block-start: 5px;
    inset-inline-start: 5px;
    width: 9px;
    height: 9px;
    border-block-start: 2px solid var(--exp-border-strong);
    border-inline-start: 2px solid var(--exp-border-strong);
    border-start-start-radius: 4px;
    transition: border-color var(--exp-dur-1) var(--exp-ease);
  }
  .exp-compose-grip:hover::before,
  .exp-compose-grip:focus-visible::before,
  .exp-compose.is-resizing .exp-compose-grip::before { border-color: var(--exp-accent); }
  .exp-compose-grip:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }
  .exp-compose-edge { position: absolute; z-index: 2; display: block; touch-action: none; }
  .exp-compose-edge-left { inset-block: 22px 0; inset-inline-start: 0; width: 8px; cursor: ew-resize; }
  .exp-compose-edge-top { inset-block-start: 0; inset-inline: 22px 0; height: 8px; cursor: ns-resize; }
  .exp-compose-edge:hover { background: var(--exp-accent-muted); }
  .exp-compose.is-resizing .exp-compose-edge { background: var(--exp-accent-muted); }
  .exp-compose-head-end > .exp-compose-popout,
  .exp-compose-head-end > .exp-compose-min,
  .exp-compose-head-end > .exp-compose-expand { display: inline-flex; }
  /* Eigenes Browserfenster (layouts/compose_window.php, data-standalone): das Fenster füllt die Seite, ohne Rand,
     Ziehgriff, Minimieren, Vergrößern und „In eigenem Fenster öffnen“ */
  .exp-compose[data-standalone] { align-items: stretch; justify-content: stretch; padding: 0; }
  .exp-compose[data-standalone] .exp-compose-window { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .exp-compose[data-standalone] :is(.exp-compose-grip, .exp-compose-edge),
  .exp-compose[data-standalone] .exp-compose-head-end > :is(.exp-compose-popout, .exp-compose-min, .exp-compose-expand) { display: none; }
  .exp-compose[data-state='expanded'] {
    align-items: center;
    justify-content: center;
    padding: calc(var(--exp-head-h) + var(--exp-space-sm)) var(--exp-space-lg) var(--exp-space-lg);
    background: var(--exp-overlay);
    pointer-events: auto;
  }
  .exp-compose[data-state='expanded'] .exp-compose-window { width: min(960px, 100%); height: 100%; border-block-end: 1px solid var(--exp-border); border-radius: var(--exp-radius-lg); }
  .exp-compose[data-state='expanded'] :is(.exp-compose-grip, .exp-compose-edge) { display: none; }
  .exp-compose[data-state='min'] .exp-compose-window { height: auto; }
  .exp-compose[data-state='min'] .exp-compose-head { border-block-end: 0; cursor: pointer; }
  .exp-compose.is-resizing { user-select: none; }
  .exp-compose[data-state='min'] .exp-compose-form,
  .exp-compose[data-state='min'] .exp-compose-foot,
  .exp-compose[data-state='min'] :is(.exp-compose-grip, .exp-compose-edge) { display: none; }
}

/* ---------- Rückgängig-Leiste: unten in der Mitte des Postfachs ---------- */
.exp-mail-undo { z-index: 5; }
.exp-mail-ticket .form-label { display: block; }

/* ---------- Ablage per Ziehen: deckt das Postfach ab ---------- */
.exp-mail-drop { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; margin: var(--exp-space-sm); border: 2px dashed var(--exp-accent); border-radius: var(--exp-radius-lg); background: var(--exp-accent-muted); color: var(--exp-text-accent); text-align: center; pointer-events: none; }
.exp-mail-drop[hidden] { display: none; }
.exp-mail-drop > div { display: grid; justify-items: center; gap: var(--exp-space-xs); }
.exp-mail-drop .lucide { width: 32px; height: 32px; }
/* Auf anderen Seiten (Lader webmail-compose-dock.js) deckt die Ablagefläche das ganze Fenster ab, unter Offcanvas und Modalen */
.exp-mail-drop-page { position: fixed; z-index: calc(var(--exp-z-offcanvas) - 6); }
.exp-mail-read > .exp-empty, .exp-mail-list > .exp-empty { align-content: center; min-height: 60%; }

/* ---------- Lesebereich: Ansichten, Unterhaltung, Ticket (M4 Stufe 3) ---------- */
/* Eine Ansicht des Lesebereichs: Leiste oben, darunter der scrollende Inhalt */
.exp-mail-view { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; }
.exp-mail-pane { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; }
.exp-mail-pane:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }
.exp-mail-pane > .exp-read { display: flex; flex-direction: column; flex: 1 0 auto; min-width: 0; }
.exp-read-top { display: grid; gap: var(--exp-space-md); }
.exp-read-meta > .exp-avatar { align-self: start; }
.exp-read-line > .exp-strong { color: var(--exp-text); }
@media (max-width: 575.98px) {
  /* Schmal: die Aktionen stehen rechtsbündig in einer eigenen Zeile unter den Reitern */
  .exp-mail-bar:has(> .exp-tabs) { flex-wrap: wrap; row-gap: 0; }
  .exp-mail-bar:has(> .exp-tabs) > .exp-mail-bar-end { flex: 0 0 100%; justify-content: flex-end; padding-block-end: var(--exp-space-3xs); }
}

/* Anhänge: Name und Größe sind der Knopf für Vorschau bzw. Herunterladen */
button.exp-attach-name { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
button.exp-attach-name:hover .exp-strong { text-decoration: underline; text-underline-offset: 3px; }
button.exp-attach-name:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: 2px; border-radius: var(--exp-radius-sm); }
.exp-attachments-list > .exp-attach { background: var(--exp-surface); }

/* Lesepapier mit iframe: der Rahmen der Mail füllt das Papier; ohne iframe (Klartext) bleibt der Innenabstand */
/* Der iframe ist so hoch wie sein Inhalt (webmail-paper.js misst nach); bis dahin eine kleine Vorgabe */
.exp-mail-paper > iframe { height: 4rem; }
.exp-mail-paper > pre { margin: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Leseansicht: die Mail steht ohne Rahmen direkt unter dem Kopf; dunkel bleibt sie ein helles Blatt */
.exp-mail-pane > .exp-read > .exp-mail-paper { padding: 0; border: 0; border-radius: 0; }
[data-bs-theme='dark'] .exp-mail-pane > .exp-read > .exp-mail-paper { padding: var(--exp-space-lg); border-radius: var(--exp-radius); }

/* Unterhaltung: Kopf der Karte ist ein Knopf über die ganze Zeile */
.exp-conv { display: grid; gap: var(--exp-space-md); }
.exp-conv-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-xs); }
.exp-comments[data-kind='mails'] .exp-conv-head { align-items: center; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.exp-comments[data-kind='mails'] .exp-conv-head:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: 2px; border-radius: var(--exp-radius-sm); }
.exp-conv-head > .lucide { flex: none; width: 16px; height: 16px; margin-inline-start: auto; transition: transform var(--exp-dur-2) var(--exp-ease); }
.exp-conv-head[aria-expanded='true'] > .lucide { transform: rotate(90deg); }
.exp-conv-detail { display: grid; gap: var(--exp-space-xs); min-width: 0; }
.exp-comments[data-kind='mails'] > .exp-comment[data-open='false'] .exp-conv-detail { display: none; }
.exp-conv-meta { display: grid; gap: 2px; }
.exp-comments[data-kind='mails'] > .exp-conv-stale { display: flex; align-items: center; gap: var(--exp-space-sm); margin: 0; }

/* Ticket: Vorschläge und Zuordnung */
.exp-ticket-confirmed { margin-block-start: var(--exp-space-xs); }
.exp-ticket-confirmed[hidden] { display: none; }
#ticket-suggestions[hidden] { display: none; }
.exp-ticket-suggestions { display: grid; gap: var(--exp-space-2xs); margin-block-end: var(--exp-space-2xs); }
.exp-ticket-suggestion { display: flex; align-items: center; justify-content: space-between; gap: var(--exp-space-sm); padding: var(--exp-space-xs) var(--exp-space-sm); border: 1px solid var(--exp-border); border-radius: var(--exp-radius); }
.exp-ticket-suggestion-main { display: grid; min-width: 0; overflow-wrap: anywhere; }
.exp-ticket-suggestion .btn { flex: none; }
.exp-mail-pane .exp-comment-composer { margin-block-start: var(--exp-space-xs); }

/* Dateiliste als Knopfzeilen (Nextcloud-Ordner) */
button.exp-filelist-item { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
button.exp-filelist-item:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }

/* Chip als Link (Kunde im Kopf einer Mail, Anhang in der Unterhaltung) */
a.exp-chip { color: inherit; text-decoration: none; }
a.exp-chip:hover { background: var(--exp-neutral-bg); }

.exp-mail-view > .exp-mail-bar { flex: none; }

/* ---------- Verfassen: Speicherstand ---------- */
.exp-compose-draft[data-state='saving'], .exp-compose-draft[data-state='paused'], .exp-compose-draft[data-state='dirty'] { color: var(--exp-text-2); }

/* =========================================================
   Modul accounting: Monatsstatistik und Periodenraster
   Zweck: Zwölf Monatsspalten der Buchhaltungsübersicht (/accounting).
   .exp-acc-months: Monatsspalten als flacher Streifen (data-layout="strip", in der Übersicht
   Kopfzeile der Tabelle, je Monat Bezeichnung, schmaler Balken und Zähler „x/y“) oder als
   Kacheln; laufender Monat blau markiert ([data-current]), Zukunft gedämpft ([data-future]).
   .exp-acc-grid: Raster der Periodenchips über dieselben zwölf Spalten — Monat spannt 1 Spalte
   ([data-span="month"]), Quartal 3 ([data-span="quarter"]), Jahresblock alle 12
   ([data-span="year"]); eine fehlende Periode behält ihren Platz als „—“ (.exp-acc-gap).
   Beispiel: pages/buchhaltung.html
   ========================================================= */
.exp-acc-months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--exp-space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
.exp-acc-month {
  display: grid;
  gap: var(--exp-space-3xs);
  justify-items: stretch;
  padding: var(--exp-space-xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
  font-size: var(--exp-text-sm);
}
/* Flacher Streifen in der Tabellenkopfzeile: ohne Kartenrahmen, Balken schmal */
.exp-acc-months[data-layout='strip'] { gap: var(--exp-space-2xs); }
.exp-acc-months[data-layout='strip'] .exp-acc-month {
  padding: var(--exp-space-3xs) var(--exp-space-2xs);
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: transparent;
  font-size: var(--exp-text-xs);
}
.exp-acc-months[data-layout='strip'] .progress { height: 4px; }
.exp-acc-month[data-current] { border-color: var(--exp-accent); box-shadow: inset 0 0 0 1px var(--exp-accent); }
.exp-acc-month[data-future] { border-style: dashed; border-color: var(--exp-border-strong); background: transparent; }
.exp-acc-month[data-future] .exp-acc-month-count { color: var(--exp-text-2); }
.exp-acc-month-label { font-weight: 600; color: var(--exp-text-2); }
.exp-acc-month-count { font-variant-numeric: tabular-nums; }
@media (max-width: 991.98px) {
  .exp-acc-months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .exp-acc-months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Periodenraster: zwölf Spalten über die volle Breite; Kopfstatistik und Kundenzeilen teilen
   dieselben Spaltenbreiten. */
.exp-acc-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--exp-space-3xs);
}
.exp-acc-grid > .exp-period {
  width: auto;
  min-width: 0;
  padding-inline: var(--exp-space-3xs);
  font-size: var(--exp-text-xs);
  overflow: hidden;
}
.exp-acc-grid > .exp-period > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-acc-grid > .exp-period[data-span='quarter'] { grid-column: span 3; }
.exp-acc-grid > .exp-period[data-span='year'] { grid-column: span 12; }
/* Fehlende Periode: „—“ an ihrem Platz (Monat spannt 1 Spalte, Quartal 3, Jahr 12) */
.exp-acc-grid > .exp-acc-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--exp-control-sm);
  border-radius: var(--exp-radius-sm);
  color: var(--exp-text-2);
  font-size: var(--exp-text-xs);
}
.exp-acc-grid > .exp-acc-gap[data-span='month'], .exp-acc-grid > .exp-acc-gap:not([data-span]) { grid-column: span 1; }
.exp-acc-grid > .exp-acc-gap[data-span='quarter'] { grid-column: span 3; }
.exp-acc-grid > .exp-acc-gap[data-span='year'] { grid-column: span 12; }
/* Unter 1200 px bleibt das zwölfspaltige Raster, die Chips werden kompakt: Monat
   spannt 2 Spalten (sechs je Reihe → zwei Reihen), Quartal 3 (vier je Reihe → eine
   Reihe), der Jahresblock alle 12 — bei jeder Breite darunter, auch 360/390 px.
   Das Statussymbol stapelt über der Beschriftung (statt daneben), die Überfällig-
   Warnflagge rückt in die untere Ecke (die XML-Marke behält die obere), Touchhöhe
   var(--exp-control) und der globale Fokusring bleiben. */
@media (max-width: 1199.98px) {
  .exp-acc-grid > .exp-period,
  .exp-acc-grid > .exp-acc-gap { min-height: var(--exp-control); }
  .exp-acc-grid > .exp-period { position: relative; flex-direction: column; }
  .exp-acc-grid > .exp-period .exp-period-flag { position: absolute; inset-block-end: 2px; inset-inline-end: 2px; }
  .exp-acc-grid > .exp-period[data-span='month'],
  .exp-acc-grid > .exp-acc-gap[data-span='month'],
  .exp-acc-grid > .exp-acc-gap:not([data-span]) { grid-column: span 2; }
}

/* Ablege-Hinweis über einem Panel (Modul accounting): erscheint, während Dateien über
   dem Panel gezogen werden — Überlagerung mit gestricheltem Rahmen, ohne eigenen
   Eingriff (pointer-events: none), das Panel selbst nimmt das Ablegen an. */
.exp-drop-hint {
  position: absolute;
  inset: 0;
  z-index: var(--exp-z-dropdown);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: var(--exp-overlay);
  pointer-events: none;
}
/* Seitenweit: Überlagerung über dem ganzen Fenster, über allem außer Toasts */
.exp-drop-hint[data-scope='page'] {
  position: fixed;
  z-index: var(--exp-z-popover);
  border-radius: 0;
}
.exp-drop-hint-box {
  display: grid;
  justify-items: center;
  gap: var(--exp-space-2xs);
  padding: var(--exp-space-lg) var(--exp-space-xl);
  border: 2px dashed var(--exp-accent);
  border-radius: var(--exp-radius-lg);
  background: var(--exp-surface);
  box-shadow: var(--exp-shadow-pop);
  font-weight: 600;
}
.exp-drop-hint-box p { margin: 0; }
.exp-drop-hint-box .lucide { width: 24px; height: 24px; color: var(--exp-text-accent); }

/* Gestoppte Kundenzeile (Modul accounting): heller Gefahr-Ton über Prio, Kunde,
   Perioden und Aktion; der Hover-Ton bleibt erkennbar (kräftiger), die Periodenchips
   behalten ihre eigene Farbe und Lesbarkeit. Im Dunkelmodus sind die Töne
   halbtransparent — Farbe liegt deshalb nie auf Zeile UND Zelle übereinander
   (sonst doppelt getönte Zellen neben einfachen Rasterlücken): Ab 1200 px färben die
   Zellen der echten Tabelle, unter 1200 px (Kartenraster, regelt das Seiten-CSS) die
   Zeile selbst, inklusive der Rasterlücken. Hover wirkt nur mit Zeigergerät — Touch
   behält den Ruheton statt eines hängenden Hover. */
.exp-acc-list tbody tr.is-stopped > * { background: var(--exp-danger-bg); }
@media (hover: hover) and (min-width: 1200px) {
  .exp-acc-list tbody tr.is-stopped:hover > * { background: var(--exp-danger-bg-strong); }
}
@media (max-width: 1199.98px) {
  .exp-acc-list tbody tr.is-stopped { background: var(--exp-danger-bg); }
  .exp-acc-list tbody tr.is-stopped > * { background: transparent; }
}
@media (hover: hover) and (max-width: 1199.98px) {
  .exp-acc-list tbody tr.is-stopped:hover { background: var(--exp-danger-bg-strong); }
}

/* =========================================================
   Modul whatsapp: Posteingang als Werkzeugseite
   Zweck: Zweispaltiger Posteingang (Chatliste und Verlauf, Breite der Liste über
   --exp-wa-w; Split.js bleibt im Cockpit) mit Bereichen samt Konto-Status
   (.exp-wa-account mit .exp-wa-account-dot[data-state]), Chatzeile (.exp-wa-chat
   mit Avatar, Name, Zeit, Vorschau .exp-wa-preview, Markierungen .exp-wa-flag,
   Ungelesen-Zähler), Konto-Status im Verlaufskopf (.exp-wa-state), Klingelzeile
   laufender Anrufe (.exp-wa-call), Emoji-Auswahl (.exp-emoji) und Player für
   Sprachnachrichten (.exp-audio-player, Regeln aus whatsapp-inbox.css hierher
   gezogen, Klassennamen unverändert). Konto-Status außerhalb des Postfachs
   (z. B. Einstellungen): .exp-badge mit Icon und Text, Stufe nach Zustand
   (verbunden success, wird gekoppelt warning, getrennt neutral, Fehler danger).
   Beispiel: pages/whatsapp.html, komponenten/kommunikation.html (Chat)
   ========================================================= */
.exp-main[data-layout='tool'] > .exp-wa { --exp-wa-w: 360px; }
.exp-wa {
  display: grid;
  grid-template-columns: var(--exp-wa-w) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-width: 0;
  background: var(--exp-surface);
}
/* Gateway- und Fehlermeldungen gelten für beide Spalten und stehen oben über die volle Breite */
.exp-wa > .alert { grid-column: 1 / -1; margin: 0; border-radius: 0; border-inline: 0; }
.exp-wa .exp-chat { height: 100%; border: 0; border-radius: 0; background: var(--exp-surface); }
.exp-wa-chatpane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.exp-wa-chatpane > .alert { margin: 0; border-radius: 0; border-inline: 0; }
.exp-wa-chatpane .exp-chat-body { flex: 1 1 auto; background: var(--exp-bg); }
.exp-wa-chatpane .exp-chat-composer { flex: none; }
.exp-wa-list {
  display: flex;
  flex-direction: column;
  gap: var(--exp-space-xs);
  min-height: 0;
  padding: var(--exp-space-sm);
  border-inline-end: 1px solid var(--exp-border);
  overflow: hidden;
}

/* Kopf der Liste: Werkzeugname, Neuer Chat, Desktop-Export */
.exp-wa-head { display: flex; align-items: center; gap: var(--exp-space-xs); }
.exp-wa-head > .exp-strong { display: inline-flex; align-items: center; gap: var(--exp-space-2xs); flex: 1; min-width: 0; }
.exp-wa-head > .exp-strong .lucide { color: var(--exp-text-2); }

/* Bereiche (Konten) mit Konto-Status: Punkt mit Zustand, sichtbarem Statustext
   und Ungelesen-Zähler; der Zustand steht nie nur über Farbe */
.exp-wa-accounts { display: grid; gap: 2px; }
.exp-wa-account {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  width: 100%;
  padding: var(--exp-space-2xs) var(--exp-space-xs);
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: var(--exp-text-2);
  font-size: var(--exp-text-sm);
  text-align: start;
  cursor: pointer;
}
.exp-wa-account:hover { background: var(--exp-surface-muted); color: var(--exp-text); }
.exp-wa-account[aria-pressed='true'] { background: var(--exp-accent-muted); color: var(--exp-text); font-weight: 600; }
.exp-wa-account:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }
.exp-wa-account-main { display: grid; flex: 1; min-width: 0; }
.exp-wa-account-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exp-wa-account-state { font-size: var(--exp-text-xs); font-weight: 400; }
.exp-wa-account-count { font-size: var(--exp-text-xs); font-weight: 600; color: var(--exp-text-accent); font-variant-numeric: tabular-nums; }
.exp-wa-account-dot { flex: none; width: 8px; height: 8px; border-radius: var(--exp-radius-pill); background: var(--exp-neutral-fg); }
.exp-wa-account-dot[data-state='connected'] { background: var(--exp-success-fg); }
.exp-wa-account-dot[data-state='connecting'] { background: var(--exp-warning-fg); }
.exp-wa-account-dot[data-state='disconnected'] { background: var(--exp-danger-fg); }

/* Konto-Status im Kopf des Verlaufs: Icon und Text */
.exp-wa-state { display: inline-flex; align-items: center; gap: var(--exp-space-3xs); font-size: var(--exp-text-xs); color: var(--exp-text-2); white-space: nowrap; }
.exp-wa-state .lucide { width: 14px; height: 14px; }
.exp-wa-state[data-state='connected'] .lucide { color: var(--exp-success-fg); }
.exp-wa-state[data-state='connecting'] .lucide { color: var(--exp-warning-fg); }
.exp-wa-state[data-state='disconnected'] { color: var(--exp-danger-text); }
.exp-wa-state[data-state='disconnected'] .lucide { color: var(--exp-danger-fg); }

/* Filter über der Chatliste */
.exp-wa-filters { display: grid; gap: var(--exp-space-2xs); }
.exp-wa-filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--exp-space-2xs) var(--exp-space-xs); }

/* Chatliste: Zeilen mit Avatar, Name, Zeit, Vorschau, Markierungen */
.exp-wa-chats { display: flex; flex-direction: column; gap: var(--exp-space-3xs); min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0; list-style: none; scrollbar-width: thin; }
.exp-wa-section { padding: var(--exp-space-2xs) var(--exp-space-3xs) var(--exp-space-3xs); font-size: var(--exp-text-xs); font-weight: 600; color: var(--exp-text-2); }
.exp-wa-chat { border-radius: var(--exp-radius-sm); }
.exp-wa-chat > button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--exp-space-xs);
  width: 100%;
  padding: var(--exp-space-2xs) var(--exp-space-xs);
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.exp-wa-chat > button:hover { background: var(--exp-surface-muted); }
.exp-wa-chat > button:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }
.exp-wa-chat[aria-current] > button { background: var(--exp-accent-muted); }
.exp-wa-chat[data-done] .exp-wa-chat-name { color: var(--exp-text-2); }
.exp-wa-chat-col { display: grid; gap: 2px; min-width: 0; }
.exp-wa-chat-row { display: flex; align-items: baseline; gap: var(--exp-space-xs); }
.exp-wa-chat-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.exp-wa-chat-time { flex: none; font-size: var(--exp-text-xs); color: var(--exp-text-2); font-variant-numeric: tabular-nums; }
.exp-wa-chat-row2 { display: flex; align-items: center; gap: var(--exp-space-2xs); }
.exp-wa-chat-sub { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-wa-flags { display: inline-flex; align-items: center; gap: var(--exp-space-3xs); color: var(--exp-text-2); }
.exp-wa-flags .lucide { width: 14px; height: 14px; }
.exp-wa-flags .exp-wa-stop { color: var(--exp-danger-fg); }
.exp-wa-count { min-width: 20px; padding: 0 6px; border-radius: var(--exp-radius-pill); background: var(--exp-accent); color: var(--exp-on-accent); font-size: var(--exp-text-xs); font-weight: 600; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.exp-wa-preview { display: flex; align-items: center; gap: var(--exp-space-3xs); min-width: 0; font-size: var(--exp-text-sm); color: var(--exp-text-2); }
.exp-wa-preview .lucide { flex: none; width: 14px; height: 14px; }
.exp-wa-preview > span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.exp-wa-state-line { padding: var(--exp-space-xs) var(--exp-space-sm); font-size: var(--exp-text-sm); color: var(--exp-text-2); text-align: center; }

/* Klingelzeile laufender Anrufe über der Chatliste */
.exp-wa-call {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  padding: var(--exp-space-2xs) var(--exp-space-xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-muted);
  font-size: var(--exp-text-sm);
}
.exp-wa-call-main { flex: 1; min-width: 0; display: grid; }
.exp-wa-call .spinner-border { width: 14px; height: 14px; border-width: 2px; flex: none; }

/* Hinweiszeile unter der Eingabe: Meldung links, Zeichen rechts */
.exp-wa-hint { display: flex; justify-content: space-between; gap: var(--exp-space-sm); font-size: var(--exp-text-xs); color: var(--exp-text-2); }
.exp-wa-hint .num { font-variant-numeric: tabular-nums; }

/* Eingabe gesperrt (kein Senderecht, STOP, Bereich getrennt): Text statt Feld */
.exp-wa-locked {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  padding: var(--exp-space-sm) var(--exp-space-md);
  border-block-start: 1px solid var(--exp-border);
  background: var(--exp-surface-muted);
  font-size: var(--exp-text-sm);
  color: var(--exp-text-2);
}

/* ---------- Emoji-Auswahl ----------
   Panel über der Eingabe (oder als schwebende Auswahl an einer Nachricht): Kategorien
   als Reiter, Suche, Raster mit Emojis. Emojis sind Daten (keine Icons im Sinne von
   Abschnitt 9), das Emojifont der Plattform stellt sie dar. Die schwebende Variante
   (data-floating) nimmt ihre Position vom Skript (left/top/max-height). */
.exp-emoji {
  position: absolute;
  inset-block-end: calc(100% + var(--exp-space-xs));
  inset-inline-start: 0;
  z-index: var(--exp-z-popover);
  display: flex;
  flex-direction: column;
  gap: var(--exp-space-2xs);
  box-sizing: border-box;
  width: min(24rem, calc(100% - 2 * var(--exp-space-xs)));
  max-height: min(26rem, calc(100dvh - 10rem));
  padding: var(--exp-space-xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-raised);
  color: var(--exp-text);
  box-shadow: var(--exp-shadow-pop);
}
.exp-emoji[data-floating] { inset-block-end: auto; inset-inline-start: auto; }
.exp-emoji-head { display: flex; align-items: center; justify-content: space-between; gap: var(--exp-space-xs); color: var(--exp-text-2); font-size: var(--exp-text-sm); }
.exp-emoji-cats { display: flex; overflow-x: auto; gap: 2px; }
.exp-emoji-cats .exp-emoji-item { flex: none; }
.exp-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--exp-control-sm), 1fr)); align-content: start; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
button.exp-emoji-item {
  display: inline-grid;
  place-items: center;
  min-width: var(--exp-control-sm);
  min-height: var(--exp-control-sm);
  padding: var(--exp-space-3xs);
  border: 0;
  border-radius: var(--exp-radius-sm);
  background: none;
  color: var(--exp-text-2);
  font-size: var(--exp-text-xl);
  cursor: pointer;
}
button.exp-emoji-item:hover { background: var(--exp-surface-muted); }
button.exp-emoji-item[aria-selected='true'] { background: var(--exp-surface-muted); color: var(--exp-text-accent); box-shadow: inset 0 -2px var(--exp-accent); }
button.exp-emoji-item:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }
/* Emojis im Raster: Emojifont der Plattform (Farbe, Metriken), Reiter tragen SVG-Icons */
.exp-emoji-grid .exp-emoji-item { font-family: var(--exp-font-emoji); }
.exp-emoji-empty { grid-column: 1 / -1; margin: 0; padding: var(--exp-space-xs); color: var(--exp-text-2); font-size: var(--exp-text-sm); }
.exp-emoji-note { grid-column: 1 / -1; margin: 0; padding: var(--exp-space-xs); font-size: var(--exp-text-sm); color: var(--exp-text-2); }
button.exp-emoji-note { text-align: start; border: 0; border-radius: var(--exp-radius-sm); background: var(--exp-surface-muted); color: var(--exp-text-accent); cursor: pointer; }
button.exp-emoji-note:hover { background: var(--exp-neutral-bg); }
button.exp-emoji-note:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: -2px; }

/* ---------- Player für Sprachnachrichten ----------
   Abspielknopf, Positionsbalken, Zeit „aktuell / gesamt“ und Tempo in der Blase;
   das <audio> liegt verborgen daneben. Klassen unverändert aus whatsapp-inbox.css
   hierher gezogen (Teil A des Modul-Umbaus), damit das bestehende JS weiter läuft. */
.exp-audio-player {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: var(--exp-space-xs);
  row-gap: var(--exp-space-3xs);
  width: 20rem;
  max-width: 100%;
  padding: var(--exp-space-xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
}
.exp-audio-player audio { display: none; }
.exp-audio-player-toggle {
  display: inline-grid;
  place-items: center;
  width: var(--exp-control-sm);
  height: var(--exp-control-sm);
  padding: 0;
  border: 0;
  border-radius: var(--exp-radius);
  background: var(--exp-accent);
  color: var(--exp-on-accent);
  cursor: pointer;
}
.exp-audio-player-toggle:hover { background: var(--exp-accent-hover); }
.exp-audio-player-toggle:focus-visible { outline: 2px solid var(--exp-focus); outline-offset: 2px; }
.exp-audio-player-time { color: var(--exp-text-2); font-size: var(--exp-text-xs); font-variant-numeric: tabular-nums; }
.exp-audio-player-rate {
  padding: var(--exp-space-3xs) var(--exp-space-2xs);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius);
  background: var(--exp-surface);
  color: var(--exp-text);
  font-size: var(--exp-text-xs);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.exp-audio-player-rate:hover { border-color: var(--exp-accent); }
.exp-audio-player-seek { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--exp-accent); }
.exp-audio-player-hint { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: var(--exp-space-xs); margin: 0; color: var(--exp-danger-text); font-size: var(--exp-text-xs); }
.exp-audio-player-hint[hidden] { display: none; }
.exp-audio-player-retry { padding: 0; border: 0; background: none; color: var(--exp-text-accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* Spalten des Postfachs auf schmalen Fenstern: eine Spalte nach der anderen */
@media (max-width: 991.98px) {
  .exp-wa { grid-template-columns: minmax(0, 1fr); }
  .exp-wa-list { border-inline-end: 0; }
  .exp-wa[data-pane='chat'] .exp-wa-list { display: none; }
  .exp-wa[data-pane='list'] .exp-wa-chatpane { display: none; }
}

/* =========================================================
   Modul signatures: Feld-Editor
   Zweck: Editor der Signatur-Anfrage (eigene Seite über bare.php): links die
   Werkzeugleiste (.exp-sign-tools), Mitte die Bühne mit dem Dokument
   (.exp-sign-stage, .exp-sign-sheet), rechts Eigenschaften und Feldliste
   (.exp-sign-side). Das Blatt ist in beiden Modi weißes Papier mit dunkler Tinte
   (--exp-paper, --exp-paper-text), die Unterschrift landet so im PDF. Felder
   liegen über dem Blatt, ihre Lage kommt aus den Eigenschaften --exp-x, --exp-y,
   --exp-w, --exp-h (Prozent der Seite) statt fester Inline-Positionen.
   Beispiel: pages/signaturen.html
   ========================================================= */
.exp-sign-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(16rem, 22rem);
  gap: var(--exp-space-md);
  align-items: start;
}
.exp-sign-tools { display: flex; flex-direction: column; gap: var(--exp-space-3xs); position: sticky; top: var(--exp-sticky-top); }
.exp-sign-tools-label { padding-inline: var(--exp-space-2xs); font-size: var(--exp-text-xs); font-weight: 600; color: var(--exp-text-2); }
.exp-sign-tools .btn { justify-content: flex-start; width: 100%; }
.exp-sign-tools hr { margin: var(--exp-space-2xs) 0; border: 0; border-block-start: 1px solid var(--exp-border); opacity: 1; }
.exp-sign-stage {
  display: grid;
  justify-items: center;
  gap: var(--exp-space-sm);
  padding: var(--exp-space-md);
  border: 1px solid var(--exp-border);
  border-radius: var(--exp-radius-lg);
  background: var(--exp-surface-muted);
}
/* Blatt: feste Breite statt Inhaltsbreite (das Papier misst sich in cqw und fiele sonst auf null zusammen) */
.exp-sign-stage > .exp-sign-sheet { width: min(100%, 36rem); }
/* Das Dokument bleibt Papier: helle Fläche und dunkle Schrift in beiden Modi */
.exp-sign-stage .exp-paper { background: var(--exp-paper); color: var(--exp-paper-text); border-color: var(--exp-border-strong); }
.exp-sign-stage .exp-paper-text { color: color-mix(in srgb, var(--exp-paper-text) 78%, transparent); }
.exp-sign-stage .exp-paper-rule { background: color-mix(in srgb, var(--exp-paper-text) 24%, transparent); }
/* Felder und Kopf auf dem Blatt: Farben richten sich nach dem Papier, nicht nach dem Theme (im Dunkelmodus sonst helle Schrift auf hellem Grund) */
.exp-sign-stage .exp-paper-from { color: var(--exp-paper-link); }
.exp-sign-stage .exp-paper-muted { color: color-mix(in srgb, var(--exp-paper-text) 62%, transparent); }
.exp-sign-stage .exp-sign-field { border-color: color-mix(in srgb, var(--exp-paper-text) 55%, transparent); background: color-mix(in srgb, var(--exp-paper) 88%, transparent); color: color-mix(in srgb, var(--exp-paper-text) 72%, transparent); }
.exp-sign-stage .exp-sign-field-tag { background: color-mix(in srgb, var(--exp-paper-text) 72%, transparent); color: var(--exp-paper); }
.exp-sign-stage .exp-sign-field[aria-pressed='true'] { border-color: var(--exp-paper-link); background: color-mix(in srgb, var(--exp-paper-link) 12%, var(--exp-paper)); color: var(--exp-paper-text); }
.exp-sign-stage .exp-sign-field[aria-pressed='true'] .exp-sign-field-tag { background: var(--exp-paper-link); color: var(--exp-paper); }
.exp-sign-sheet .exp-sign-field { left: var(--exp-x, 10%); top: var(--exp-y, 80%); width: var(--exp-w, 36%); height: var(--exp-h, 8%); }
.exp-sign-side { display: grid; gap: var(--exp-space-md); position: sticky; top: var(--exp-sticky-top); }
.exp-sign-side fieldset { display: grid; gap: var(--exp-space-sm); margin: 0; padding: 0; border: 0; }
.exp-sign-side legend { font-size: var(--exp-text-sm); font-weight: 600; color: var(--exp-text-2); padding: 0; }
@media (max-width: 1199.98px) {
  .exp-sign-editor { grid-template-columns: minmax(0, 1fr); }
  .exp-sign-tools { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .exp-sign-tools .btn { width: auto; }
  .exp-sign-side { position: static; }
}

/* =========================================================
   Modul cash_registers: drei Kennzahlen in einer Reihe
   Zweck: .exp-facts mit drei Werten (Monatsliste: Soll, noch nicht verrechnet,
   offen) steht nebeneinander statt in zwei Spalten mit Umbruch; unter 640 px
   wieder zweispaltig bzw. einspaltig.
   Beispiel: pages/registrierkassen.html
   ========================================================= */
.exp-facts[data-cols='3'] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 639.98px) {
  .exp-facts[data-cols='3'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   Modul timetracking: Wochenjournal des Leistungszettels
   Zweck: Mehrere Wochentabellen untereinander (KW 46, KW 47, …) brauchen
   gleiche Spaltenbreiten, sonst springen Soll/Ist/Diff von Tabelle zu Tabelle.
   Feste Breiten für Tag und die drei Zahlenspalten, der Rest gehört den Buchungen;
   schmaler als 860 px rollt die Tabelle seitlich (.table-responsive).
   Beispiel: pages/zeiterfassung-bericht.html
   ========================================================= */
.table.exp-weekly { table-layout: fixed; min-width: 860px; }
.table.exp-weekly > thead > tr > th:nth-child(1) { width: 9rem; }
.table.exp-weekly > thead > tr > th:nth-child(2),
.table.exp-weekly > thead > tr > th:nth-child(3),
.table.exp-weekly > thead > tr > th:nth-child(4) { width: 6.5rem; }

/* =========================================================
   Modul accounting: Kundenliste mit Perioden
   Zweck: Die Periodenspalte braucht Platz für mehrere Chips nebeneinander;
   schmaler als 760 px rollt die Tabelle seitlich (.table-responsive), statt
   die Perioden in eine Spalte zu quetschen.
   Beispiel: pages/buchhaltung.html
   ========================================================= */
.table.exp-acc-list { min-width: 760px; }

/* =========================================================
   Tabellen in Panels der Moduldesigns: seitlich rollen statt quetschen
   Zweck: Schmaler als die Mindestbreite rollt die Tabelle im .table-responsive;
   die Spalten bleiben lesbar (IBAN, Beträge und Zeiten brechen nicht mehr in
   Einzelzeichen um). Stufen nach Spaltenzahl: s (bis 4), m (5 bis 6), l (ab 7).
   Beispiel: pages/banking.html, pages/registrierkassen.html, pages/zeiterfassung-admin.html
   ========================================================= */
.table.exp-scroll-s { min-width: 540px; }
.table.exp-scroll-m { min-width: 760px; }
.table.exp-scroll-l { min-width: 980px; }
.table[class*='exp-scroll-'] .num { white-space: nowrap; }

/* =========================================================
   Modul call_notes: Trefferliste der Telefonsuche im Anrufnotiz-Dialog
   Zweck: Das Anrufnotiz-Modal (_modal.php) wird vom Rahmen auf JEDER Seite
   eingebunden; die Trefferliste unter dem Telefonfeld (callnotes.js) liegt über
   den folgenden Formularfeldern, ohne von einem Seiten-CSS abzuhängen. Lage und
   Breite kommen aus den Bootstrap-Klassen im Markup, die Ebene hier als Baustein.
   Beispiel: app/Views/call_notes/_modal.php, public/assets/js/callnotes.js
   ========================================================= */
#callNotePhoneSuggestions { z-index: var(--exp-z-dropdown); }

/* =========================================================
   Baustein exp-prose: Fließtext aus Markdown (Parsedown)
   Zweck: .exp-prose gestaltet von Parsedown erzeugtes HTML (Benutzerhandbuch,
   Changelog-Einträge). Der Block aus „Modul tasks“ oben setzt bereits Absatz-
   abstände (p { margin: 0 } im Kern), Listen-Einzug und Bildbreite; dieser
   Baustein ergänzt Überschriften h1–h4, verschachtelte Listen, Tabellen, Code
   inline und als Block, Zitate, Links und Trennlinien — nur Tokens, in hell und
   dunkel gleich gut lesbar, mit begrenzter Zeilenlänge. Der Markdown-Inhalt
   selbst bleibt unverändert (Daten); Inline-Styles darin sind Daten.
   Beispiel: pages/rahmen-cockpit.html (Styleguide „Typografie“), Dokumentation und
   Changelog im Cockpit; Beschreibungen der Aufgaben nutzen denselben Baustein.
   ========================================================= */
.exp-prose { max-width: 75ch; }
.exp-prose h1, .exp-prose h2, .exp-prose h3, .exp-prose h4 { margin-block-start: var(--exp-space-lg); line-height: 1.3; }
.exp-prose > h1:first-child, .exp-prose > h2:first-child, .exp-prose > h3:first-child, .exp-prose > h4:first-child { margin-block-start: 0; }
.exp-prose h1 { font-size: var(--exp-text-xl); }
.exp-prose h2 { font-size: var(--exp-text-lg); }
.exp-prose h3, .exp-prose h4 { font-size: var(--exp-text-md); }
.exp-prose ul ul, .exp-prose ol ol, .exp-prose ul ol, .exp-prose ol ul { margin-block: var(--exp-space-2xs); }
.exp-prose li + li { margin-block-start: var(--exp-space-2xs); }
.exp-prose a { color: var(--exp-text-accent); text-decoration: underline; }
.exp-prose a:hover { color: var(--exp-text-accent); }
.exp-prose blockquote {
    margin-inline-start: 0;
    padding-inline-start: var(--exp-space-md);
    border-inline-start: 3px solid var(--exp-border-strong);
    color: var(--exp-text-2);
}
.exp-prose code {
    font-family: var(--exp-font-mono);
    font-size: 0.9em;
    padding: 1px 5px;
    border-radius: var(--exp-radius-sm);
    background: var(--exp-surface-muted);
}
.exp-prose pre {
    padding: var(--exp-space-md);
    border-radius: var(--exp-radius);
    background: var(--exp-surface-muted);
    overflow-x: auto;
}
.exp-prose pre code { padding: 0; background: none; }
.exp-prose hr { margin-block: var(--exp-space-lg); border: 0; border-block-start: 1px solid var(--exp-border); }
.exp-prose table { width: 100%; border-collapse: collapse; }
.exp-prose table th, .exp-prose table td {
    padding: var(--exp-space-xs) var(--exp-space-sm);
    border: 1px solid var(--exp-border);
    text-align: start;
    vertical-align: top;
}
.exp-prose table th { background: var(--exp-surface-muted); font-weight: 600; }

/* =========================================================
   Baustein exp-send-toast: „Wird gesendet … Rückgängig“ (Webmail, Senden rückgängig)
   Aufbau: div.exp-send-toast-dock > je Auftrag ein div.exp-send-toast[data-state] mit
   role="status", aria-live="polite" und tabindex="-1". Text und Countdown (aria-hidden) stehen vor den
   Aktionsknöpfen mit den Zusätzen -undo, -now, -open, -close. Stufe 1 verwendet zusätzlich ein Lucide-Icon.
   Das Dock ist eine höhenbegrenzte, scrollbar bleibende Liste. Unter 992 px nutzt sie die verfügbare Breite
   mit Designrand und Abstand zur unteren Safe Area. Daneben bleiben Klicks frei.
   Ebene 1046 liegt über dem Verfassen-Fenster und unter Modalen. Bei geöffneter Haupt- oder Subnavigation
   setzt das Skript data-navigation-open. Dann liegt das Dock unter dem Bootstrap-Offcanvas-Backdrop (1040).
   Ausweichen: Bei data-place="anchored" setzt das Skript die Abstände über --exp-send-toast-end und
   --exp-send-toast-bottom sowie die Desktopbreite über --exp-send-toast-width.
   Beispiel: komponenten/rueckmeldung.html
   ========================================================= */
.exp-send-toast-dock {
  --exp-send-toast-inset: var(--exp-space-lg);
  --exp-send-toast-offset: var(--exp-send-toast-bottom, var(--exp-send-toast-inset));
  position: fixed;
  inset-inline: var(--exp-space-md);
  inset-block-end: var(--exp-send-toast-offset);
  z-index: calc(var(--exp-z-offcanvas) + 1);
  display: flex;
  flex-direction: column;
  gap: var(--exp-space-xs);
  max-inline-size: 420px;
  max-block-size: min(50dvh, calc(100dvh - var(--exp-send-toast-offset) - var(--exp-space-md)));
  margin-inline: auto;
  overflow-y: auto;
}
.exp-send-toast-dock[data-navigation-open] { z-index: calc(var(--exp-z-offcanvas) - 6); }
.exp-send-toast-dock > .exp-send-toast { flex: none; max-width: none; }
@media (max-width: 991.98px) {
  .exp-send-toast-dock {
    --exp-send-toast-inset: calc(var(--exp-space-md) + env(safe-area-inset-bottom, 0px));
    --exp-send-toast-offset: max(var(--exp-send-toast-inset), var(--exp-send-toast-bottom, 0px));
    max-inline-size: none;
  }
}
@media (min-width: 992px) {
  .exp-send-toast-dock[data-place='anchored'] {
    inset-inline-start: auto;
    inset-inline-end: var(--exp-send-toast-end, var(--exp-space-md));
    inline-size: var(--exp-send-toast-width, 420px);
    margin-inline: 0;
  }
}
.exp-send-toast {
  display: flex;
  align-items: center;
  gap: var(--exp-space-xs);
  width: 100%;
  min-width: 0;
  max-width: 420px;
  min-height: 58px;   /* gleich hoch mit und ohne Knopf, damit der Wechsel der Variante nicht springt */
  padding: var(--exp-space-sm) var(--exp-space-md);
  border: 1px solid var(--exp-card-edge);
  border-radius: var(--exp-radius);
  background: var(--exp-surface-raised);
  color: var(--exp-text);
  box-shadow: var(--exp-shadow-pop);
  font-size: var(--exp-text-md);
  animation: exp-send-toast-in var(--exp-dur-2) var(--exp-ease) both;
}
.exp-send-toast[hidden], .exp-send-toast > [hidden] { display: none; }
.exp-send-toast > .lucide { flex: none; color: var(--exp-text-2); }
.exp-send-toast[data-state='sent'] > .lucide { color: var(--exp-success-fg); }
.exp-send-toast[data-state='failed'] > .lucide { color: var(--exp-danger-fg); }
.exp-send-toast[data-state='unclear'] > .lucide { color: var(--exp-warning-fg); }
.exp-send-toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Countdown: eigenes Element, tabellarische Ziffern; die Einheit setzt der Baustein, der Inhalt ist nur die Zahl */
.exp-send-toast-count { flex: none; color: var(--exp-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-send-toast-count::after { content: '\00a0s'; }
.exp-send-toast-undo, .exp-send-toast > .btn-close { flex: none; }
.exp-send-toast-open { flex: 0 0 auto; max-inline-size: 50%; white-space: normal; }
@keyframes exp-send-toast-in {
  from { opacity: 0; transform: translateY(var(--exp-space-sm)); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .exp-send-toast { animation: none; }
}
