/* ============================================================
   Posteingang (v5.22.21, OPTAVO Pulse)
   ------------------------------------------------------------
   Gebaut nach dem abgenommenen Mockup mockups/posteingang-5.22.18
   (Branch claude/mockup-posteingang). Basis sind die Pulse-Styles
   (tokens.css, style.css); diese Datei ergaenzt nur, was es dort nicht
   gibt: Drei-Spalten-Arbeitsflaeche, Ziehgriffe, dreizeilige Liste,
   Rueckgaengig-Leiste, Tastenhilfe, weisse Leseflaeche.
   Farben ausschliesslich aus vorhandenen Tokens und Werten:
   - Dunkel: var(--color-*) aus tokens.css, Pulse-Schriftskala
   - Weisse Leseflaeche: die Werte von .mail-detail-body (#ffffff, Text
     #1f2937, Links #1d4ed8) plus die Grautoene aus style.css
   - Postfach- und Kollegenfarben: die Hue-Palette der Avatare
   Praefix aller Klassen: pe- (Posteingang). Mailinhalt steht immer auf
   Weiss (Entscheidung Mike, 30.09.2026).
   ============================================================ */

:root {
    --pe-paper: #ffffff;
    --pe-ink: #1f2937;
    --pe-ink-2: #374151;
    --pe-ink-muted: #4b5563;
    --pe-ink-soft: #6b7280;
    --pe-line: #e5e7eb;
    --pe-line-strong: #cbd5e1;
    --pe-wash: #f3f4f6;
    --pe-link: #1d4ed8;
    --pe-slate: #94a3b8;


    --pe-w-folders: 232px;
    --pe-w-list: 448px;
    --pe-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --pe-edge: 24px;           /* linke Kante aller Inhalte auf Weiss */
}

.pe-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* Sichtbarer Fokus im dunklen Bereich (brand-light, 3:1), auf Weiss in Linkblau */
.pe-workspace .pulse-action-button:focus-visible,
.pe-workspace .pulse-filter-pill:focus-visible,
.pe-workspace .pulse-bulk-bar__action:focus-visible,
.pe-workspace .pulse-bulk-bar__select-clear:focus-visible,
.pe-workspace .pe-ki__more:focus-visible {
    outline: 2px solid var(--color-brand-light) !important;
    outline-offset: 2px;
}
.pe-workspace .pe-paper .pulse-action-button:focus-visible { outline-color: var(--pe-link) !important; }

/* Tooltips am rechten Rand rechtsbuendig (Pulse zentriert sonst ueber transform) */
.pulse-tip[data-tip-align="rechts"]::after { left: auto; right: 0; transform: translateY(-4px); }
.pulse-tip[data-tip-align="rechts"]:hover::after,
.pulse-tip[data-tip-align="rechts"]:focus-visible::after { transform: none; }

/* Auswahl-Kaestchen: sichtbarer Rand, Haken und Teilauswahl als Bild (ohne transform,
   damit sie auch bei reduzierter Bewegung stimmen) */
.pe-item__check input[type="checkbox"]:not(.toggle-input),
.pe-bulk__all input[type="checkbox"]:not(.toggle-input) {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.55) !important;
    cursor: pointer;
}
.pe-item__check input[type="checkbox"]:not(.toggle-input):checked,
.pe-bulk__all input[type="checkbox"]:not(.toggle-input):checked {
    background: var(--color-brand-mid) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px 12px no-repeat !important;
    border-color: var(--color-brand-mid) !important;
}
.pe-item__check input[type="checkbox"]:not(.toggle-input):indeterminate,
.pe-bulk__all input[type="checkbox"]:not(.toggle-input):indeterminate {
    background: var(--color-brand-mid) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round'%3E%3Cline x1='6' y1='12' x2='18' y2='12'/%3E%3C/svg%3E") center / 12px 12px no-repeat !important;
    border-color: var(--color-brand-mid) !important;
}
.pe-item__check input[type="checkbox"]:not(.toggle-input)::after,
.pe-bulk__all input[type="checkbox"]:not(.toggle-input)::after { content: none !important; }
.pe-item__check input[type="checkbox"]:not(.toggle-input):focus-visible,
.pe-bulk__all input[type="checkbox"]:not(.toggle-input):focus-visible {
    outline: 2px solid var(--color-brand-light);
    outline-offset: 2px;
    box-shadow: none !important;
}

/* ---------- Seitenrahmen: die Arbeitsflaeche fuellt die Hoehe, die Seite scrollt nie ---------- */
body.is-posteingang { overflow: hidden !important; }
body.is-posteingang .main { min-height: 0 !important; }
/* v5.22.29 (Topbar-Fix): nichts rutscht hinter die Kopfleiste.
   Ursache: body traegt aus style.css eine Mindesthoehe (100vh), .main dazu
   84 px Abstand nach oben. Die Arbeitsflaeche fuellt das Fenster schon
   genau; mit der Mindesthoehe war das Dokument 84 px hoeher als das
   Fenster. body sperrt zwar das eigene Scrollen, das Dokument (html)
   scrollte aber weiter: ein Tastendruck, ein Fokus oder der nach dem
   Neuladen wiederhergestellte Scrollstand schoben den Inhalt unter die
   fest stehende Kopfleiste. Jetzt: keine Mindesthoehe am body, html scrollt
   im Posteingang nicht, und der Einstieg beginnt oben (posteingang-page.js
   nachOben). */
body.is-posteingang { min-height: 0 !important; }
html:has(body.is-posteingang) { overflow: hidden; }
/* v5.22.22 (B2): derselbe Abstand unter der Kopfleiste wie auf den anderen
   Pulse-Seiten (dort beginnt der Inhalt 36 px tiefer: 24 px Modul-Innenabstand
   plus 12 px Kopfbereich). Gemessen im Chromium bei 420 bis 1920 px. Links,
   rechts und unten bleibt die Arbeitsflaeche buendig. */
#m-mails.module { padding: 36px 0 0 !important; }

.pe-workspace {
    container: pe / inline-size;
    height: calc(100vh - 152px);
    height: calc(100dvh - 152px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* Kompakter Kopf statt grosser Seitenueberschrift */
.pe-head {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 36px;
    flex: 0 0 auto;
}
.pe-head__title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}
.pe-head__title h1 {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
}
.pe-head__context {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.pe-head__context strong { color: var(--color-text-primary); font-weight: 600; }
.pe-head__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pe-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    white-space: nowrap;
}
.pe-live__dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}
/* v5.22.21 P3: ohne Live-Verbindung fragt Pulse minuetlich nach */
.pe-live.is-aus .pe-live__dot { background: var(--pe-slate); box-shadow: none; }

/* ---------- Rahmen mit drei Spalten ---------- */
.pe-frame {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--pe-w-folders) 7px var(--pe-w-list) 7px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    position: relative;
    padding: 0 !important;
}
/* Feste Spalten: eine ausgeblendete Spalte verschiebt die anderen nie */
.pe-frame > .pe-folders { grid-column: 1; grid-row: 1; }
.pe-frame > .pe-resizer--folders { grid-column: 2; grid-row: 1; }
.pe-frame > .pe-list { grid-column: 3; grid-row: 1; }
.pe-frame > .pe-resizer--list { grid-column: 4; grid-row: 1; }
.pe-frame > .pe-read { grid-column: 5; grid-row: 1; }
.pe-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pe-scrim { display: none; }

/* Ziehgriffe (neu, in Pulse gibt es kein Split-Pane) */
.pe-resizer {
    position: relative;
    cursor: col-resize;
    touch-action: none;
    z-index: 2;
}
.pe-resizer::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 3px;
    width: 1px;
    background: var(--color-border-strong);
    transition: background var(--duration-fast) ease;
}
/* Trefferflaeche breiter als die sichtbare Linie */
.pe-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: -5px; right: -5px; }
.pe-resizer:hover::before,
.pe-resizer.is-dragging::before,
.pe-resizer:focus-visible::before {
    background: var(--color-brand-mid);
    left: 2px;
    width: 3px;
}
.pe-resizer:focus-visible { outline: none; }
.pe-resizer[aria-disabled="true"] { cursor: default; pointer-events: none; }
.pe-frame.is-resizing { user-select: none; cursor: col-resize; }

/* ---------- Spalte a: Postfaecher und Ordner ---------- */
.pe-folders {
    background: rgba(255, 255, 255, 0.02);
    overflow-y: auto;
    padding: 12px 10px 16px;
    gap: 2px;
}
.pe-folders__label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 10px 10px 4px;
}
.pe-folders__label:first-of-type { padding-top: 2px; }
.pe-folders__sep { height: 1px; background: var(--color-border-strong); margin: 8px 8px; flex: 0 0 auto; }
.pe-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-secondary);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    flex: 0 0 auto;
    position: relative;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.pe-nav:hover { background: rgba(255, 255, 255, 0.05); color: var(--color-text-primary); }
.pe-nav:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: -2px; }
.pe-nav.is-active {
    background: rgba(79, 126, 219, 0.16);
    border-color: rgba(79, 126, 219, 0.45);
    color: var(--color-text-primary);
}
.pe-nav__icon { display: inline-flex; align-items: center; justify-content: center; color: var(--color-text-tertiary); flex: 0 0 auto; }
.pe-nav.is-active .pe-nav__icon { color: var(--color-brand-light); }
.pe-nav__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-nav__label small { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 400; }
.pe-nav__count {
    flex: 0 0 auto;
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    color: var(--color-text-tertiary);
}
.pe-nav__count.is-unread { color: var(--color-text-primary); font-weight: 700; }
.pe-nav__count.is-warn { color: var(--color-warning); font-weight: 700; }
.pe-nav__count.is-danger { color: #fca5a5; font-weight: 700; }
.pe-nav--add { color: var(--color-text-tertiary); }
.pe-collapse-toggle { display: none; }

/* Postfach-Kuerzel statt Farbpunkt: ein Buchstabe ist auch ohne Farbe lesbar */
.pe-mb-mono {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    border-radius: 6px;
    font-size: var(--text-2xs);
    font-weight: 700;
    color: var(--pe-mb);
    background: color-mix(in srgb, var(--pe-mb) 16%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pe-mb) 34%, transparent);
    flex: 0 0 auto;
}
.pe-mb-mono--all { --pe-mb: var(--color-text-secondary); background: rgba(255, 255, 255, 0.08); }
.pe-mb-mono--paper { color: var(--pe-ink); background: color-mix(in srgb, var(--pe-mb) 40%, #ffffff); box-shadow: none; }
/* Farbe je Postfach aus seiner Reihenfolge (Palette der Avatare). */
[data-farbe="0"] { --pe-mb: #7AB8F0; }
[data-farbe="1"] { --pe-mb: #F0A07A; }
[data-farbe="2"] { --pe-mb: #7AF0A8; }
[data-farbe="3"] { --pe-mb: #F07AC9; }
[data-farbe="4"] { --pe-mb: #C97AF0; }
[data-farbe="5"] { --pe-mb: #F0E07A; }

/* ---------- Spalte b: Liste ---------- */
.pe-list { position: relative; container: plist / inline-size; }
.pe-list__head {
    flex: 0 0 auto;
    padding: 12px 12px 10px;
    border-bottom: 1px solid var(--color-border-strong);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pe-list__searchrow { display: flex; align-items: center; gap: 8px; }
.pe-list__searchrow .pulse-list-toolbar__search { flex: 1 1 auto; min-width: 0; position: relative; }
.pe-list__searchrow .pe-search-kbd { position: absolute; right: 10px; top: calc(50% - 9px); margin: 0; pointer-events: none; }
.pe-list__folders-btn { display: none !important; }
.pe-list__select-btn { flex: 0 0 auto; }
.pe-list__select-btn[aria-pressed="true"] { border-color: rgba(79, 126, 219, 0.55); color: var(--color-text-primary); }
.pe-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
.pe-chips .pulse-filter-pill { font-size: var(--text-xs); padding: 4px 10px; gap: 6px; }
.pe-chips .pulse-filter-pill__count { color: var(--color-brand-light); }
.pe-chips .pulse-filter-pill.is-active .pulse-filter-pill__count { color: var(--color-text-primary); }

.pe-list__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 6px 16px;
    position: relative;
}

/* Sammelleiste: echte .pulse-bulk-bar, hier im Listenkopf statt schwebend */
.pe-list .pulse-bulk-bar.pulse-bulk-bar--inline {
    position: static !important;
    transform: none !important;
    left: auto !important;
    bottom: auto !important;
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    animation: none;
    z-index: auto;
}
.pe-bulk__top { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.pe-bulk__all {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: var(--text-xs); color: var(--color-text-primary); cursor: pointer; white-space: nowrap;
}
.pe-bulk__all { min-height: 28px; }
.pe-bulk__count { font-size: var(--text-xs); color: var(--color-text-secondary); white-space: nowrap; }
.pe-bulk__count strong { color: var(--color-text-primary); }
.pe-bulk__spacer { flex: 1 1 auto; }
.pe-bulk .pulse-bulk-bar__select-clear, .pe-bulk__top .pulse-bulk-bar__select-clear { font-size: var(--text-xs); white-space: nowrap; }
.pe-bulk__actions { display: flex; gap: 4px; flex-wrap: nowrap; }
/* v5.22.22 (B2): "Alle" steht immer im Listenkopf, darunter der Hinweis auf
   die noch nicht geladenen Mails des Ordners. */
.pe-allrow { padding: 2px 0 0; }
.pe-allrow .pe-bulk__all { font-weight: 600; }
.pe-allhint {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 8px;
    background: rgba(79, 126, 219, 0.12);
    font-size: var(--text-xs); color: var(--color-text-secondary);
}
.pe-list .pulse-bulk-bar--inline .pe-bulk__actions { flex-wrap: wrap; }
.pe-list .pulse-bulk-bar__action {
    flex-direction: row !important;
    gap: 6px !important;
    min-width: 0 !important;
    height: 30px;
    padding: 0 9px !important;
    font-size: var(--text-xs) !important;
    border-radius: 8px !important;
}
.pe-list .pulse-bulk-bar__action span { display: inline !important; white-space: nowrap; }
.pe-list .pulse-bulk-bar__action svg { width: 15px !important; height: 15px !important; }
/* Schmalere Liste: Papierkorb und Mehr nur als Symbol (Titel und Kuerzel bleiben),
   ganz schmal auch Zurueckstellen. Die Leiste bleibt so bei zwei Zeilen. */
@container plist (max-width: 469px) {
    .pe-list .pulse-bulk-bar__action[data-act="bulk-trash"] span,
    .pe-list .pulse-bulk-bar__action[data-act="bulk-more"] span { display: none !important; }
    .pe-list .pulse-bulk-bar__action[data-act="bulk-trash"],
    .pe-list .pulse-bulk-bar__action[data-act="bulk-more"] { width: 32px; padding: 0 !important; justify-content: center; }
}
@container plist (max-width: 419px) {
    .pe-list .pulse-bulk-bar__action[data-act="bulk-snooze"] span { display: none !important; }
    .pe-list .pulse-bulk-bar__action[data-act="bulk-snooze"] { width: 32px; padding: 0 !important; justify-content: center; }
}

/* Hinweis "3 neue" */
.pe-newpill {
    position: sticky;
    top: 4px;
    z-index: 5;
    display: flex;
    justify-content: center;
    height: 0;
    overflow: visible;
}
.pe-newpill button {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(79, 126, 219, 0.55);
    background: var(--color-brand-primary);
    color: #ffffff;
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    animation: pe-drop-in 220ms var(--pe-ease);
}
.pe-newpill button:hover { background: var(--color-brand-mid); }
.pe-newpill button:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: 2px; }
@keyframes pe-drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pe-newsep {
    display: flex; align-items: center; gap: 8px;
    margin: 4px 8px 2px;
    font-size: var(--text-xs); font-weight: 600;
    color: var(--color-brand-light);
    white-space: nowrap;
}
.pe-newsep__line { flex: 1 1 auto; height: 1px; background: rgba(79, 126, 219, 0.45); }

/* Eintrag: drei Zeilen */
.pe-item {
    position: relative;
    display: grid;
    grid-template-columns: 10px 32px minmax(0, 1fr);
    column-gap: 10px;
    padding: 10px 12px 10px 4px;
    margin: 2px 0;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}
.pe-item:hover { background: rgba(255, 255, 255, 0.05); }
.pe-item.is-checked { background: rgba(79, 126, 219, 0.10); }
.pe-item.is-open {
    background: rgba(79, 126, 219, 0.18);
    border-color: var(--color-brand-mid);
}
.pe-item:focus { outline: none; }
.pe-item:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: 1px; }
.pe-item.is-new { animation: pe-new 1600ms var(--pe-ease); }
@keyframes pe-new { 0% { background: rgba(122, 184, 240, 0.22); } 100% { background: transparent; } }
.pe-item.is-leaving { opacity: 0; transition: opacity 170ms ease; }

.pe-item__dot {
    align-self: start;
    justify-self: center;
    margin-top: 12px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--color-brand-light);
}
.pe-item__dot.is-read { visibility: hidden; }
.pe-item__lead { position: relative; width: 32px; height: 32px; margin-top: 1px; }
.pe-item__lead .pe-avatar { transition: opacity var(--duration-fast) ease; }
.pe-item__check {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity var(--duration-fast) ease;
    cursor: pointer;
}
.pe-item:hover .pe-item__check,
.pe-item.is-checked .pe-item__check,
.pe-list.is-selecting .pe-item__check { opacity: 1; }
.pe-item:hover .pe-avatar,
.pe-item.is-checked .pe-avatar,
.pe-list.is-selecting .pe-item .pe-avatar { opacity: 0; }

.pe-item__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pe-item__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pe-item__name {
    flex: 1 1 auto; min-width: 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pe-item.is-unread .pe-item__name { color: var(--color-text-primary); font-weight: 700; }
.pe-item__time {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    color: var(--color-text-tertiary);
    white-space: nowrap;
}
.pe-item.is-unread .pe-item__time > span:last-child { color: var(--color-brand-light); font-weight: 600; }
.pe-item__mb { display: none; color: var(--color-text-muted); }
.pe-list.is-all-mailboxes .pe-item__mb { display: inline; }
.pe-item__flag { color: var(--color-accent-gold); display: inline-flex; }

.pe-item__row--co { gap: 8px; }
/* v5.22.29: Team-Kuerzel am Ende der zweiten Zeile (reine Anzeige). Die
   vorhandenen Avatar-Klassen (pe-avatar--team, --xs, data-hue). */
.pe-item__team {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 18px;
    cursor: default;
}
/* Beim Ueberfahren und Auswaehlen blendet die Liste JEDEN .pe-avatar der
   Zeile aus (dort steht dann das Auswahl-Kaestchen ueber dem Absender).
   Die Team-Kuerzel bleiben stehen. */
.pe-list .pe-item .pe-item__row--co .pe-item__team .pe-avatar { opacity: 1; transition: none; }

.pe-item__row--subject { font-size: var(--text-sm); gap: 8px; }
.pe-item__subject {
    flex: 0 1 auto; max-width: 62%; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--color-text-secondary);
}
.pe-item.is-unread .pe-item__subject { color: var(--color-text-primary); font-weight: 600; }
.pe-item__snip {
    flex: 1 1 0; min-width: 24px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--color-text-muted);
}
.pe-item__icons { flex: 0 0 auto; display: inline-flex; gap: 6px; color: var(--color-text-tertiary); }
.pe-item__icons:empty { display: none; }
/* Gelesene automatische Antworten treten zurueck; ungelesen stehen sie fett wie jede andere */
.pe-item.is-auto:not(.is-unread) .pe-item__name,
.pe-item.is-auto:not(.is-unread) .pe-item__subject { color: var(--color-text-tertiary); font-weight: 500; }
/* Neutrale Pille auf der blauen Auswahlflaeche heller, sonst unter 4,5:1 */
.pe-item.is-open .pe-chip.status-pill-neu { color: var(--color-text-secondary); }
/* Schmalere Liste: Schnellfilter kompakter und in einer Zeile, Betreff laesst der
   Vorschau Platz; ganz schmal laufen die Filter seitlich weiter (mit Auslauf) */
@container plist (max-width: 479px) {
    .pe-chips { gap: 4px; }
    .pe-chips .pulse-filter-pill { padding: 3px 7px; gap: 4px; }
    .pe-chips .pulse-filter-pill__count { margin-left: 0; }
}
@container plist (max-width: 439px) {
    .pe-item__subject { max-width: 55%; }
    .pe-chips__opt { display: none; }
}
@container plist (max-width: 379px) {
    .pe-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin-right: -12px !important;
        padding-right: 28px;
        -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
    }
    .pe-chips::-webkit-scrollbar { display: none; }
    .pe-chips .pulse-filter-pill { flex: 0 0 auto; }
}
/* Sehr schmale Liste: das Kuerzel im Suchfeld wuerde den Platzhalter verdecken */
@container plist (max-width: 339px) {
    .pe-list__searchrow .pe-search-kbd { display: none; }
}

/* Firmen-Chip: echte .status-pill, Lead und Kunde unterscheidbar (Farbe UND Wort) */
.pe-chip.status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    max-width: 64%;
    min-width: 0;
    margin: 0;
    padding: 0 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 20px;
    overflow: hidden;
}
.pe-chip__kind { font-weight: 700; flex: 0 0 auto; }
.pe-chip__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-chip--lead { background: rgba(79, 126, 219, 0.14); color: var(--color-brand-light); border-color: rgba(79, 126, 219, 0.32); }
.pe-chip--none { background: transparent; color: var(--color-text-tertiary); border: 1px dashed rgba(255, 255, 255, 0.30); }
.pe-chip--meta { flex: 0 0 auto; max-width: none; }
.pe-chip.pe-chip--free { max-width: 100%; align-self: flex-start; }

.pe-stage {
    display: inline-flex; align-items: center; gap: 6px;
    min-width: 0;
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    white-space: nowrap;
}
.pe-stage__txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pe-stage__dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--pe-slate); }
.pe-stage--won .pe-stage__dot { background: var(--color-success); }
.pe-stage--hold .pe-stage__dot { background: var(--color-warning); }

/* Avatar mit Initialen: extern neutral, Kollegen in ihrer Hue-Farbe
   (Schrift in der Farbe auf getoentem Grund: weisse Initialen auf
   Pastell erreichen kein AA) */
.pe-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--pe-av, 32px); height: var(--pe-av, 32px);
    border-radius: 50%;
    font-size: var(--pe-avf, 12px);
    font-weight: 700;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.16);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}
.pe-avatar--team {
    color: var(--pe-hue);
    background: color-mix(in srgb, var(--pe-hue) 16%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pe-hue) 32%, transparent);
}
.pe-avatar[data-hue="0"] { --pe-hue: #7AB8F0; }
.pe-avatar[data-hue="1"] { --pe-hue: #F0A07A; }
.pe-avatar[data-hue="2"] { --pe-hue: #7AF0A8; }
.pe-avatar--xs { --pe-av: 18px; --pe-avf: 10px; letter-spacing: 0; }
.pe-avatar--sm { --pe-av: 22px; --pe-avf: 10px; letter-spacing: 0; }
.pe-avatar--md { --pe-av: 28px; --pe-avf: 11px; }
.pe-avatar--lg { --pe-av: 40px; --pe-avf: 14px; }
/* Auf der weissen Flaeche: dunkle Schrift */
.pe-paper .pe-avatar { color: var(--pe-ink-2); background: var(--pe-line); box-shadow: none; }
.pe-paper .pe-avatar--team { color: var(--pe-ink); background: color-mix(in srgb, var(--pe-hue) 40%, #ffffff); }

/* ---------- Spalte c: Lesebereich ---------- */
.pe-read { container: read / inline-size; position: relative; }
.pe-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border-strong);
    min-height: 54px;
    position: relative;
    z-index: 3;
}
.pe-actions__group { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.pe-actions__sep { width: 1px; height: 22px; background: var(--color-border-strong); margin: 0 4px; flex: 0 0 auto; }
.pe-actions__sep.is-hidden { display: none; }
.pe-actions__spacer { flex: 1 1 auto; min-width: 0; }
.pe-actions__back { display: none !important; }
.pe-actions .pulse-action-button { padding: 8px 11px; gap: 6px; }
.pe-actions .pulse-action-button--icon-only { padding: 0; width: 36px; }
.pe-actions .pulse-action-button--ghost { color: var(--color-text-secondary); border-color: transparent; }
.pe-actions .pulse-action-button--ghost:hover { color: var(--color-text-primary); background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
.pe-actions .pulse-action-button:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: 1px; }
.pe-actions .pulse-action-button[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08); color: var(--color-text-primary); }
/* Aktiver Schreibmodus (Antworten, Allen antworten, Weiterleiten) */
.pe-actions .pulse-action-button[aria-pressed="true"] {
    background: rgba(79, 126, 219, 0.16);
    border-color: rgba(79, 126, 219, 0.45);
    color: var(--color-text-primary);
}
.pe-actions .is-nolabel .pulse-action-button__label { display: none; }
.pe-actions .is-nolabel { padding-left: 9px; padding-right: 9px; }
.pe-actions .pe-overflowed { display: none !important; }
.pe-lbl-short { display: none; }
.pe-actions.is-short .pe-lbl-long { display: none; }
.pe-actions.is-short .pe-lbl-short { display: inline; }
.pe-chev { display: inline-flex; margin-left: -2px; color: var(--color-text-muted); }
.pe-ok .pulse-action-button__icon { color: var(--color-success); }
.pe-danger-soft .pulse-action-button__icon { color: #fca5a5; }
.pe-ai .pulse-action-button__icon { color: var(--color-brand-light); }

.pe-kbd {
    display: inline-block;
    min-width: 18px;
    font-family: var(--font-sans);
    font-size: var(--text-2xs);
    font-weight: 600;
    text-align: center;
    color: var(--color-text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 5px;
    padding: 0 5px;
    line-height: 16px;
    margin: 0 1px;
}

.pe-read__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 20px 28px;
    position: relative;
}
.pe-read__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.pe-read__main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pe-context--aside { display: none; }
/* Breiter Lesebereich: Firmenkarte als Seitenspalte, schmal als Zeile */
@container read (min-width: 840px) {
    .pe-read__grid.has-aside { grid-template-columns: minmax(0, 1fr) 260px; }
    .pe-read__grid.has-aside .pe-context--aside { display: flex; position: sticky; top: 0; }
    .pe-read__grid.has-aside .pe-ctxband { display: none !important; }
}

/* Kopf: nur Betreff und Hinweise */
.pe-mailhead { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.pe-mailhead__subject {
    margin: 0;
    font-size: var(--text-lg);
    line-height: 1.35;
    font-weight: 600;
    color: var(--color-text-primary);
    min-width: 0;
    overflow-wrap: anywhere;
}
.pe-mailhead__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pe-tag.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 0;
    padding: 1px 10px 1px 4px;
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 20px;
}
.pe-tag:not([class*="status-pill-"]) { background: rgba(79, 126, 219, 0.12); color: var(--color-brand-light); border-color: rgba(79, 126, 219, 0.28); }
.pe-tag[class*="status-pill-"] { padding-left: 8px; }

/* KI-Zusammenfassung: kompakt, ein Absatz */
.pe-ki {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(79, 126, 219, 0.08);
    border: 1px solid rgba(79, 126, 219, 0.22);
}
.pe-ki__icon { color: var(--color-brand-light); padding-top: 2px; flex: 0 0 auto; }
.pe-ki__body { min-width: 0; }
.pe-ki__label { font-weight: 700; color: var(--color-brand-light); margin-right: 4px; }
.pe-ki__text { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--color-text-secondary); max-width: 80ch; }
.pe-ki__text:focus { outline: none; }
.pe-ki__suggest { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.pe-ki__more {
    display: none;
    margin-top: 2px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--color-brand-light);
    font: inherit; font-size: var(--text-xs); font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
}
.pe-ki__more:hover { color: var(--color-text-primary); text-decoration: underline; }
/* P10: Knopf statt Text, solange noch keine Zusammenfassung gespeichert ist */
.pe-ki--knopf .pe-ki__body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pe-ki__preis { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--color-text-tertiary); }
.pe-linkbtn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 26px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid rgba(79, 126, 219, 0.36);
    background: transparent;
    color: var(--color-brand-light);
    font: inherit; font-size: var(--text-xs); font-weight: 500;
    cursor: pointer;
}
.pe-linkbtn:hover { background: rgba(79, 126, 219, 0.16); color: var(--color-text-primary); }
.pe-linkbtn:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: 2px; }

/* Firmenkarte (Seitenspalte) */
.pe-context {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border-strong);
    padding: 14px;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.pe-context__person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.pe-context__name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-primary); }
.pe-context__role { font-size: var(--text-xs); color: var(--color-text-tertiary); overflow-wrap: anywhere; }
.pe-context__firm { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--color-border-strong); }
.pe-context__firmname { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-primary); display: flex; align-items: center; gap: 8px; }
.pe-context__firmicon { display: inline-flex; color: var(--color-text-tertiary); }
.pe-context__place { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: var(--text-xs); color: var(--color-text-tertiary); }
.pe-context dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: baseline; }
.pe-context dt { font-size: var(--text-xs); color: var(--color-text-muted); }
.pe-context dd { margin: 0; font-size: var(--text-xs); color: var(--color-text-secondary); min-width: 0; }
.pe-context__owner { display: inline-flex; align-items: center; gap: 6px; }
.pe-context__proj { color: var(--color-text-tertiary); margin-top: 2px; }
.pe-context__open {
    display: inline-flex; align-items: center; gap: 4px;
    align-self: flex-start;
    color: var(--color-brand-light);
    font-size: var(--text-xs); font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
}
.pe-context__open:hover { color: var(--color-text-primary); }
.pe-context__open:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: 2px; }
.pe-context__sub { border-top: 1px solid var(--color-border-strong); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: var(--text-xs); color: var(--color-text-secondary); }
.pe-context__sub h4 { margin: 0 0 2px; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); }
.pe-mini { display: flex; align-items: center; gap: 8px; }
.pe-mini span:last-child { color: var(--color-text-muted); margin-left: auto; white-space: nowrap; }
.pe-context__note { margin: 0; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-tertiary); }
.pe-context__btns { display: flex; flex-direction: column; gap: 8px; }
.pe-context__btns .pulse-action-button { justify-content: flex-start; }

/* Firmenzeile (schmaler Lesebereich) */
.pe-ctxband {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border-strong);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    min-width: 0;
}
.pe-ctxband .pe-chip.status-pill { max-width: 100%; }
.pe-ctxband__item { white-space: nowrap; }
.pe-ctxband__item b { color: var(--color-text-secondary); font-weight: 600; }
.pe-ctxband__end { margin-left: auto; }
@container read (max-width: 699px) { .pe-ctxband__next { display: none; } }
@container read (max-width: 639px) { .pe-tb--att .pe-tb__label { display: none; } }
/* Schmaler Lesebereich oder wenig Hoehe: KI-Zusammenfassung auf zwei Zeilen,
   "Ganz lesen" klappt sie auf und bringt die Vorschlaege zurueck */
@container read (max-width: 559px) {
    .pe-ki:not(.is-open) .pe-ki__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .pe-ki:not(.is-open) .pe-ki__suggest { display: none; }
    .pe-ki:not(.is-open) .pe-ki__more { display: inline-flex; }
    .pe-msg .pe-msg__addr, .pe-msg .pe-msg__to { display: block; margin-left: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
    .pe-suggestbox .pe-suggestbox__note { display: none; }
}
@media (max-height: 720px) {
    .pe-ki:not(.is-open) .pe-ki__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .pe-ki:not(.is-open) .pe-ki__suggest { display: none; }
    .pe-ki:not(.is-open) .pe-ki__more { display: inline-flex; }
}

/* Automatische Antwort: eine Karte mit Erledigt und Kontakt-Vorschlag */
.pe-auto {
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.28);
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 12px;
}
.pe-auto__head { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.pe-auto__icon { display: inline-flex; color: var(--pe-slate); }
.pe-auto__text { flex: 1 1 220px; min-width: 0; font-size: var(--text-sm); color: var(--color-text-secondary); }
.pe-auto__text strong { color: var(--color-text-primary); }
.pe-auto__text small { display: block; margin-top: 2px; font-size: var(--text-xs); color: var(--color-text-tertiary); }
.pe-auto__btns { display: flex; flex-wrap: wrap; gap: 8px; }
/* P7: Beantwortete ablegen, unter den Schnellfiltern */
.pe-ablegen { display: flex; justify-content: flex-end; padding: 2px 0 0; }
.pe-auto__contacts { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--color-border-strong); }
.pe-auto__sub { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-secondary); }
.pe-auto__sub svg { color: var(--color-brand-light); }
.pe-person {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border-strong);
}
.pe-person__name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-primary); }
.pe-person__name span { font-weight: 400; color: var(--color-text-tertiary); font-size: var(--text-xs); }
.pe-person__detail { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: var(--text-xs); color: var(--color-text-tertiary); overflow-wrap: anywhere; }
.pe-person.is-done { border-color: rgba(34, 197, 94, 0.35); background: var(--color-success-soft); }
.pe-done { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--status-success-icon); font-weight: 600; }
@container read (max-width: 559px) {
    .pe-person { grid-template-columns: 32px minmax(0, 1fr); }
    .pe-person > .pulse-action-button, .pe-person > .pe-done { grid-column: 2; justify-self: start; }
}

/* ---------- Die weisse Leseflaeche ---------- */
.pe-paper {
    background: var(--pe-paper);
    color: var(--pe-ink);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.28);
}
.pe-msgc {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px var(--pe-edge);
    border: 0;
    border-bottom: 1px solid var(--pe-line);
    background: var(--pe-paper);
    color: var(--pe-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.pe-msgc:hover { background: var(--pe-wash); }
.pe-msgc:focus-visible { outline: 2px solid var(--pe-link); outline-offset: -2px; }
.pe-msgc__line { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--text-sm); }
.pe-msgc__name { font-weight: 600; white-space: nowrap; color: var(--pe-ink); flex: 0 0 auto; }
.pe-msgc__snip { color: var(--pe-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 0; }
.pe-msgc__date { font-size: var(--text-xs); color: var(--pe-ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pe-msgc.is-open { background: var(--pe-wash); }
.pe-own {
    display: inline-flex; align-items: center; gap: 4px;
    flex: 0 1 auto; min-width: 0;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--pe-wash);
    border: 1px solid var(--pe-line-strong);
    color: var(--pe-ink-2);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 18px;
}
.pe-own span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-own svg { flex: 0 0 auto; }
.pe-msgx { padding: 4px var(--pe-edge) 16px calc(var(--pe-edge) + 38px); border-bottom: 1px solid var(--pe-line); }
.pe-msgx .pe-msg__body { margin-top: 8px; font-size: var(--text-sm); }
.pe-msgx__note { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--pe-ink-muted); }
.pe-older {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 0 var(--pe-edge);
    height: 34px;
    border: 0; border-bottom: 1px solid var(--pe-line);
    background: var(--pe-paper);
    color: var(--pe-ink-muted);
    font: inherit; font-size: var(--text-xs); font-weight: 600;
    cursor: pointer;
}
.pe-older:hover { background: var(--pe-wash); color: var(--pe-ink); }
.pe-older:focus-visible { outline: 2px solid var(--pe-link); outline-offset: -2px; }
.pe-older__line { flex: 1 1 auto; height: 1px; background: var(--pe-line); }
/* P11: Formular fuer Textbausteine (im Bestaetigungsdialog) */
.pe-baustein-form { display: flex; flex-direction: column; gap: 12px; }
.pe-baustein-form__feld { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); color: var(--color-text-secondary); }
.pe-baustein-form textarea { resize: vertical; min-height: 120px; font: inherit; }
/* P9: Hinweis, dass der Verlauf gekappt ist */
.pe-verlauf__mehr { padding: 6px var(--pe-edge); font-size: var(--text-xs); color: var(--pe-ink-muted); border-bottom: 1px solid var(--pe-line); }

.pe-msg { padding: 18px var(--pe-edge) 22px; }
.pe-msg__head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.pe-msg__who { min-width: 0; }
.pe-msg__from { font-size: var(--text-base); font-weight: 600; color: var(--pe-ink); overflow-wrap: anywhere; }
.pe-msg__addr { font-size: var(--text-xs); font-weight: 400; color: var(--pe-ink-muted); margin-left: 8px; }
.pe-msg__to { font-size: var(--text-xs); color: var(--pe-ink-muted); margin-top: 2px; overflow-wrap: anywhere; }
.pe-msg__date { font-size: var(--text-xs); color: var(--pe-ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; align-self: start; padding-top: 3px; }
.pe-msg__body {
    margin-top: 16px;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--pe-ink);
    max-width: 70ch;
}
.pe-msg__body p { margin: 0 0 12px; }
.pe-msg__body p:last-child { margin-bottom: 0; }
.pe-msg__body a { color: var(--pe-link); }
.pe-sigtoggle {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 14px;
    min-height: 26px;
    padding: 2px 10px 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--pe-line-strong);
    background: var(--pe-paper);
    color: var(--pe-ink-muted);
    font: inherit; font-size: var(--text-xs); font-weight: 500;
    cursor: pointer;
}
.pe-sigtoggle:hover { background: var(--pe-wash); color: var(--pe-ink); }
.pe-sigtoggle:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 2px; }
.pe-sig { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--pe-line-strong); font-size: var(--text-xs); line-height: 1.6; color: var(--pe-ink-muted); max-width: 70ch; }
.pe-sig small { display: block; margin-top: 8px; font-size: var(--text-xs); color: var(--pe-ink-muted); }

/* Anhaenge mit Vorschau */
.pe-atts { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.pe-att {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 232px;
    max-width: 100%;
    padding: 8px 10px 8px 8px;
    border-radius: 10px;
    border: 1px solid var(--pe-line-strong);
    background: var(--pe-paper);
    color: var(--pe-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.pe-att:hover { background: var(--pe-wash); }
.pe-att:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 2px; }
.pe-att--static { cursor: default; }
.pe-att__txt { min-width: 0; display: flex; flex-direction: column; }
.pe-att__thumb {
    width: 40px; height: 48px;
    border-radius: 6px;
    background: var(--pe-wash);
    border: 1px solid var(--pe-line);
    display: flex; align-items: flex-end; justify-content: flex-start;
    padding: 3px 4px;
    font-size: 10px; font-weight: 700;
    color: var(--pe-ink-2);
    position: relative;
    overflow: hidden;
}
.pe-att__thumb::before {
    content: "";
    position: absolute; left: 6px; right: 6px; top: 7px; height: 20px;
    background: repeating-linear-gradient(180deg, #cbd5e1 0 2px, transparent 2px 5px);
}
.pe-att__thumb--img::before {
    left: 3px; right: 3px; top: 3px; bottom: 17px; height: auto;
    border-radius: 3px;
    background: linear-gradient(160deg, #7AB8F0 0%, #2a34b0 100%);
}
.pe-att__name { font-size: var(--text-xs); font-weight: 600; color: var(--pe-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-att__size { font-size: var(--text-xs); color: var(--pe-ink-muted); }

/* Schnellantwort unter dem Verlauf */
.pe-quick {
    display: flex; align-items: center; gap: 10px;
    padding: 14px var(--pe-edge);
    border-top: 1px solid var(--pe-line);
    background: var(--pe-paper);
}
.pe-quick__field {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: center; gap: 8px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--pe-line-strong);
    background: var(--pe-paper);
    color: var(--pe-ink-muted);
    font: inherit; font-size: var(--text-sm);
    text-align: left;
    cursor: text;
}
.pe-quick__field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-quick__field:hover { background: var(--pe-wash); color: var(--pe-ink-2); }
.pe-quick__field:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 2px; }
.pe-paper .pulse-action-button--ghost { color: var(--pe-ink-2); border-color: var(--pe-line-strong); background: var(--pe-paper); }
.pe-paper .pulse-action-button--ghost:hover { background: var(--pe-wash); color: var(--pe-ink); border-color: var(--pe-line-strong); }
.pe-paper .pulse-action-button:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 2px; }

/* Editor inline (Antworten, Weiterleiten), weiss */
.pe-editor { border-top: 1px solid var(--pe-line); background: var(--pe-paper); }
.pe-editor__mode {
    display: flex; align-items: center; gap: 8px;
    padding: 14px var(--pe-edge) 6px;
    font-size: var(--text-sm); font-weight: 600;
    color: var(--pe-ink);
}
.pe-editor__mode span { display: inline-flex; color: var(--pe-link); }
.pe-field {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 3px var(--pe-edge);
    border-bottom: 1px solid var(--pe-line);
    font-size: var(--text-sm);
    color: var(--pe-ink);
}
.pe-field:focus-within { box-shadow: inset 0 -2px 0 var(--pe-link); }
.pe-field__label { color: var(--pe-ink-muted); font-size: var(--text-sm); }
.pe-field__value { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; min-width: 0; }
.pe-field__hint { font-size: var(--text-xs); color: var(--pe-ink-muted); }
.pe-field__aside { color: var(--pe-ink-muted); font-size: var(--text-xs); display: flex; gap: 12px; }
.pe-field__aside button { border: 0; background: none; padding: 2px; color: var(--pe-ink-muted); font: inherit; cursor: pointer; border-radius: 4px; }
.pe-field__aside button:hover { color: var(--pe-link); text-decoration: underline; }
.pe-field__aside button:focus-visible { outline: 2px solid var(--pe-link); }
.pe-from {
    display: inline-flex; align-items: center; gap: 8px;
    height: 30px;
    padding: 0 10px 0 4px;
    border-radius: 8px;
    border: 1px solid var(--pe-line-strong);
    background: var(--pe-paper);
    color: var(--pe-ink);
    font: inherit; font-size: var(--text-sm); font-weight: 500;
    cursor: pointer;
}
.pe-from:hover { background: var(--pe-wash); }
.pe-from:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 2px; }
.pe-token {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px;
    padding: 0 4px 0 10px;
    border-radius: 999px;
    background: var(--pe-wash);
    border: 1px solid var(--pe-line-strong);
    color: var(--pe-ink);
    font-size: var(--text-sm);
}
.pe-token button { border: 0; background: none; color: var(--pe-ink-muted); cursor: pointer; display: inline-flex; padding: 3px; border-radius: 50%; }
.pe-token button:hover { color: var(--pe-ink); background: var(--pe-line); }
.pe-token button:focus-visible { outline: 2px solid var(--pe-link); }
/* Felder auf Weiss: Pulse faerbt Eingaben dunkel und Platzhalter hell, hier umgekehrt */
.pe-paper .pe-field__input,
.pe-paper .pe-field__input:hover,
.pe-paper .pe-field__input:focus {
    flex: 1 1 140px;
    min-width: 120px;
    height: 30px;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    color: var(--pe-ink) !important;
    font: inherit !important;
    font-size: var(--text-sm) !important;
    padding: 0 !important;
    box-shadow: none !important;
}
/* Weisse Flaeche: Platzhalter ueber die Variable der Hausregel (P8) */
.pe-paper { --color-placeholder: var(--pe-ink-soft); }
.pe-paper .pe-field__input::placeholder { opacity: 1; }
.pe-suggestbox {
    margin: 0 var(--pe-edge) 8px calc(var(--pe-edge) + 72px);
    border: 1px solid var(--pe-line-strong);
    border-radius: 10px;
    overflow: hidden;
    background: var(--pe-paper);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.pe-suggestbox button {
    display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: var(--pe-paper);
    color: var(--pe-ink);
    font: inherit; font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
}
.pe-suggestbox button:hover, .pe-suggestbox button.is-active { background: var(--pe-wash); }
.pe-suggestbox button:focus-visible { outline: 2px solid var(--pe-link); outline-offset: -2px; }
.pe-suggestbox small { color: var(--pe-ink-muted); font-size: var(--text-xs); }
.pe-suggestbox__who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-suggestbox__note { white-space: nowrap; }
.pe-suggestbox__none { padding: 10px 12px; font-size: var(--text-xs); color: var(--pe-ink-muted); }
.pe-toolbar {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
    padding: 6px calc(var(--pe-edge) - 8px);
    border-bottom: 1px solid var(--pe-line);
}
.pe-tb {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--pe-ink-2);
    font: inherit; font-size: var(--text-sm); font-weight: 500;
    cursor: pointer;
}
.pe-tb:hover, .pe-tb[aria-expanded="true"] { background: var(--pe-wash); color: var(--pe-ink); }
.pe-tb:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 1px; }
.pe-tb--ai { color: var(--color-brand-primary); }
.pe-tb__sep { width: 1px; height: 20px; background: var(--pe-line-strong); margin: 0 6px; }
.pe-editor__body {
    min-height: 150px;
    padding: 16px var(--pe-edge);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--pe-ink);
    outline: none;
    max-width: 76ch;
    caret-color: var(--pe-ink);
}
.pe-editor__body:focus-visible { box-shadow: inset 3px 0 0 var(--pe-link); }
.pe-editor__body:empty::before { content: attr(data-placeholder); color: var(--pe-ink-soft); }
.pe-editor__body p { margin: 0 0 10px; }
.pe-editor__body .pe-inserted { background: rgba(122, 184, 240, 0.30); border-radius: 3px; transition: background 1.4s ease; }
.pe-editor__body .pe-inserted.is-settled { background: transparent; }
.pe-quote {
    margin: 0 var(--pe-edge) 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 26px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--pe-line-strong);
    background: var(--pe-paper);
    color: var(--pe-ink-muted);
    font: inherit; font-size: var(--text-xs);
    cursor: pointer;
}
.pe-quote:hover { background: var(--pe-wash); color: var(--pe-ink); }
.pe-quote:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 2px; }
.pe-editor__atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 var(--pe-edge) 14px; }
/* P6: Anhang-Chip im Editor (entfernen, abgeschaltet, laedt) */
.pe-editor__atts .pe-att { position: relative; }
.pe-editor__atts .pe-att.is-aus .pe-att__name { text-decoration: line-through; color: var(--pe-ink-muted); }
.pe-editor__atts .pe-att.is-laedt { opacity: .7; }
.pe-att__weg {
    border: 0; background: none; color: var(--pe-ink-muted); cursor: pointer;
    display: inline-flex; padding: 4px; border-radius: 50%; margin-left: auto; flex: 0 0 auto;
}
.pe-att__weg:hover { color: var(--pe-ink); background: var(--pe-line); }
.pe-att__weg:focus-visible { outline: 2px solid var(--pe-link); }
/* P6: Verlauf bzw. weitergeleitete Mail zum Nachlesen */
.pe-editor__zitat {
    margin: 0 var(--pe-edge) 14px; padding: 10px 14px;
    border-left: 3px solid var(--pe-line-strong); color: var(--pe-ink-2);
    font-size: var(--text-sm); line-height: 1.5; max-height: 320px; overflow: auto;
    overflow-wrap: anywhere;
}
/* P6: Auswahl der Pulse-KI-Vorschlaege */
.pe-editor__ki {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 6px var(--pe-edge); font-size: var(--text-xs); color: var(--pe-ink-muted);
    border-bottom: 1px solid var(--pe-line);
}
.pe-editor__ki svg { color: var(--color-brand-primary); }
.pe-ki-wahl {
    min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px;
    border: 1px solid var(--pe-line-strong); background: var(--pe-paper);
    color: var(--pe-ink-2); font: inherit; font-size: var(--text-xs); cursor: pointer;
}
.pe-ki-wahl.is-active { border-color: var(--pe-link); color: var(--pe-link); font-weight: 600; }
.pe-ki-wahl:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 1px; }
.pe-field__input {
    flex: 1 1 140px; min-width: 120px; border: 0; background: transparent; outline: none;
    font: inherit; font-size: var(--text-sm); color: var(--pe-ink); padding: 4px 0;
}
.pe-editor__atts .pe-att { width: 214px; }
.pe-editor__foot {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px var(--pe-edge) 16px;
    border-top: 1px solid var(--pe-line);
    background: var(--pe-wash);
}
.pe-send.pulse-glass-btn { height: 36px; padding: 0 18px; border-radius: 8px; }
.pe-send.pulse-glass-btn:focus-visible { outline: 2px solid var(--pe-link); outline-offset: 2px; }
.pe-editor__hint { margin-left: auto; font-size: var(--text-xs); color: var(--pe-ink-muted); }
.pe-editor__hint kbd { font: inherit; font-size: var(--text-2xs); font-weight: 600; border: 1px solid var(--pe-line-strong); border-radius: 5px; padding: 0 5px; color: var(--pe-ink-2); background: var(--pe-paper); }

/* ---------- Menues (echte .kebab-menu, fest positioniert, deckend) ---------- */
.pe-menu.kebab-menu {
    position: fixed !important;
    top: 0; left: 0; right: auto;
    z-index: 9000;
    display: block;
    min-width: 240px;
    max-width: 340px;
    overflow-y: auto;
    background: rgba(20, 20, 28, 0.97);
}
.pe-menu__head { padding: 6px 10px 4px; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); }
.pe-menu .kebab-menu-item { width: 100%; }
.pe-menu .kebab-menu-item:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: -2px; }
.pe-menu .kebab-menu-item small { margin-left: auto; padding-left: 12px; color: var(--color-text-tertiary); font-size: var(--text-xs); white-space: nowrap; }
.pe-menu .kebab-menu-item.is-current { background: rgba(79, 126, 219, 0.16); color: var(--color-text-primary); }
.pe-menu .kebab-menu-item.is-current svg:last-child { margin-left: auto; color: var(--color-brand-light); }
.pe-menu__search.pulse-glass-input {
    display: block;
    width: calc(100% - 8px) !important;
    margin: 4px 4px 6px !important;
    height: 34px !important;
    padding: 0 10px !important;
    font-size: var(--text-sm) !important;
    border-radius: 8px !important;
}
.pe-menu__tpl { display: flex; flex-direction: column; align-items: flex-start !important; gap: 2px !important; }
.pe-menu__tpl span { color: var(--color-text-primary); }
.pe-menu__tpl em { font-style: normal; font-size: var(--text-xs); color: var(--color-text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
/* P5: Hinweis im Menue (etwa: Zurueckstellen beendet Sequenzen) */
.pe-menu__hint {
    display: flex; gap: 6px; align-items: flex-start;
    padding: 6px 10px; max-width: 300px;
    font-size: var(--text-xs); line-height: 1.4; color: var(--color-text-secondary);
}
.pe-menu__hint svg { flex: 0 0 auto; margin-top: 2px; color: var(--color-text-tertiary); }
.pe-zuordnen__hint { margin-bottom: 8px; font-size: var(--text-sm); color: var(--color-text-secondary); }
/* v5.22.22 (B2): die Trefferliste steht im Fluss des Dialogs statt als
   schwebendes Menue darueber. So schneidet der Dialog sie nicht ab, und
   mindestens sechs Treffer sind ohne inneres Scrollen sichtbar. */
.pe-zuordnen { min-height: 44px; }
.pe-zuordnen .pulse-record-search-inline__menu {
    position: static !important;
    margin-top: 6px;
    max-height: min(408px, 52vh);
    overflow-y: auto;
    box-shadow: none;
}
.pe-zuordnen .pulse-record-search-inline__option:focus-visible {
    outline: 2px solid var(--color-brand-light); outline-offset: -2px;
}
.pe-snooze-form { display: flex; gap: 10px; flex-wrap: wrap; }
.pe-snooze-form > div { flex: 1 1 160px; min-width: 0; }

.pe-menu__card {
    display: flex; flex-direction: column; gap: 6px;
    margin: 2px 4px 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border-strong);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    line-height: 1.45;
}
.pe-menu__card b { font-size: var(--text-sm); color: var(--color-text-primary); font-weight: 600; }
.pe-menu__card span { display: flex; align-items: center; gap: 6px; }
.pe-menu__card svg { color: var(--color-text-tertiary); flex: 0 0 auto; }

/* ---------- Rueckgaengig-Leiste (neu) ----------
   Sitzt im Rahmen, unten mittig ueber dem Lesebereich (gleiche Rasterzelle),
   nie ueber der Fuge zwischen Liste und Mail. */
.pe-frame > .pe-toasts {
    grid-column: 5;
    grid-row: 1;
    align-self: end;
    justify-self: stretch;
    position: relative;
    z-index: 40;
    min-width: 0;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
    padding: 0 16px 16px;
}
.pe-toast {
    pointer-events: auto;
    position: relative;
    display: flex; align-items: center; gap: 12px;
    min-width: min(340px, 100%);
    max-width: 560px;
    padding: 10px 10px 10px 14px;
    border-radius: 12px;
    background: rgba(20, 20, 28, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-lg);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    overflow: hidden;
    animation: pe-toast-in 220ms var(--pe-ease);
}
@keyframes pe-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pe-toast__icon { color: var(--color-success); display: inline-flex; }
.pe-toast--info .pe-toast__icon { color: var(--color-brand-light); }
.pe-toast__text { flex: 1 1 auto; min-width: 0; }
.pe-toast__text small { color: var(--color-text-tertiary); margin-left: 8px; font-size: var(--text-xs); }
.pe-toast__undo {
    display: inline-flex; align-items: center; gap: 8px;
    height: 32px; padding: 0 10px;
    border-radius: 8px;
    border: 0;
    background: rgba(79, 126, 219, 0.18);
    color: var(--color-brand-light);
    font: inherit; font-size: var(--text-sm); font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.pe-toast__undo:hover { background: rgba(79, 126, 219, 0.30); color: var(--color-text-primary); }
.pe-toast__undo:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: 2px; }
.pe-toast__undo .pe-kbd { color: inherit; }
.pe-toast__bar {
    position: absolute; left: 0; bottom: 0;
    height: 2px; width: 100%;
    background: var(--color-brand-mid);
    transform-origin: left center;
    animation: pe-countdown var(--pe-toast-ms, 5000ms) linear forwards;
}
.pe-toast.is-paused .pe-toast__bar { animation-play-state: paused; }
@keyframes pe-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Leerer Posteingang ---------- */
.pe-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 48px 24px;
}
.pe-empty--top { justify-content: flex-start; padding-top: 24px; }
.pe-empty__mark {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-success-soft);
    color: var(--color-success);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.06);
    margin-bottom: 6px;
}
.pe-empty__mark--neutral { background: rgba(148, 163, 184, 0.12); color: var(--pe-slate); box-shadow: none; width: 52px; height: 52px; }
.pe-empty h2 { margin: 0; font-size: var(--text-lg); font-weight: 600; color: var(--color-text-primary); }
.pe-empty p { margin: 0; font-size: var(--text-sm); color: var(--color-text-tertiary); max-width: 36ch; line-height: 1.5; }
.pe-empty__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.pe-rest {
    display: flex; flex-direction: column; gap: 14px;
    padding: 76px 8px 28px;   /* Oberkante wie "Alles erledigt" in der Liste */
    max-width: 600px;
}
.pe-rest__none { margin: 0; font-size: var(--text-sm); color: var(--color-text-tertiary); }
.pe-rest h3 { margin: 6px 0 0; font-size: var(--text-sm); font-weight: 600; color: var(--color-text-secondary); }
.pe-rest__list { display: flex; flex-direction: column; gap: 6px; }
.pe-rest__row {
    display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--color-border-strong);
    background: rgba(255, 255, 255, 0.03);
    font: inherit;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-align: left;
    cursor: pointer;
}
.pe-rest__row:hover { background: rgba(255, 255, 255, 0.06); }
.pe-rest__row .pe-chip.status-pill { max-width: 200px; }
.pe-rest__row:focus-visible { outline: 2px solid var(--color-brand-light); outline-offset: 2px; }
.pe-rest__what { display: flex; flex-direction: column; min-width: 0; }
.pe-rest__what b { color: var(--color-text-primary); font-weight: 600; }
.pe-rest__what span { font-size: var(--text-xs); color: var(--color-text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-rest__when { color: var(--color-brand-light); font-weight: 600; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.pe-keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; font-size: var(--text-sm); color: var(--color-text-secondary); }
.pe-keys div { display: flex; align-items: center; gap: 6px; }

.pe-placeholder {
    flex: 1 1 auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
}
.pe-placeholder__keys { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- Tastenhilfe und Vorschau ---------- */
.pe-help, .pe-preview {
    margin: auto;
    border: 0;
    padding: 0;
    color: var(--color-text-primary);
    background: transparent;
}
.pe-help { width: min(580px, calc(100vw - 32px)); }
.pe-help::backdrop, .pe-preview::backdrop { background: rgba(0, 0, 0, 0.55); }
.pe-help__card { padding: 20px 22px 18px; background: rgba(20, 20, 28, 0.97) !important; }
.pe-help__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pe-help__head h2 { margin: 0; font-size: var(--text-lg); font-weight: 600; }
.pe-help__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; }
.pe-help__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--color-border); font-size: var(--text-sm); color: var(--color-text-secondary); }
.pe-help__row span:last-child { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.pe-help__switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: var(--text-sm); color: var(--color-text-secondary); cursor: pointer; }
.pe-help__switch input { accent-color: var(--color-brand-mid); width: 16px; height: 16px; margin: 0; }
.pe-help__foot { margin: 10px 0 0; font-size: var(--text-xs); color: var(--color-text-tertiary); }

.pe-preview { width: min(620px, calc(100vw - 32px)); }
.pe-preview__card { padding: 14px; display: flex; flex-direction: column; gap: 12px; background: rgba(20, 20, 28, 0.97) !important; }
.pe-preview__head { display: flex; align-items: center; gap: 10px; color: var(--color-text-primary); font-size: var(--text-sm); font-weight: 600; }
.pe-preview__head span:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-preview__page {
    background: var(--pe-paper);
    border-radius: 8px;
    height: min(420px, 60vh);
    padding: 36px 44px;
    display: flex; flex-direction: column; gap: 10px;
}
.pe-preview__page i { display: block; height: 9px; border-radius: 3px; background: #e5e7eb; }
.pe-preview__page i.h { height: 16px; width: 55%; background: #cbd5e1; margin-bottom: 10px; }
.pe-preview__page i.box { height: 150px; border-radius: 6px; background: #f3f4f6; border: 1px solid #e5e7eb; margin: 8px 0; }

/* ============================================================
   Breiten
   ------------------------------------------------------------
   Gesteuert ueber die Breite der Arbeitsflaeche (Container), nicht
   ueber das Fenster: die Pulse-Navigation links nimmt rund 344 px,
   unter 900 px Fenster blendet Pulse sie aus.
   ab 1360 px Flaeche (Fenster ab ca. 1704): drei volle Spalten
   936 bis 1359 (Fenster 1280 bis 1703): Ordner als Symbolspalte,
     per Knopf oder Ziehgriff beschriftet anheftbar
   600 bis 935 (Fenster 944 bis 1279 und 624 bis 900): Liste und
     Mail, Ordner als Schublade
   unter 600: eine Spalte, Liste und Mail nacheinander
   ============================================================ */
@container pe (max-width: 1359px) {
    .pe-frame { --pe-w-list: 384px; }
    .pe-collapse-toggle { display: flex; }
}
@container pe (min-width: 936px) and (max-width: 1359px) {
    .pe-frame:not(.is-folders-pinned) { --pe-w-folders: 60px !important; }
    .pe-frame.is-folders-pinned { --pe-w-folders: 188px; --pe-w-list: 340px; }
    .pe-frame:not(.is-folders-pinned) .pe-folders { padding: 10px 8px; align-items: center; }
    .pe-frame:not(.is-folders-pinned) .pe-folders__label,
    .pe-frame:not(.is-folders-pinned) .pe-nav__label,
    .pe-frame:not(.is-folders-pinned) .pe-nav--own { display: none; }
    .pe-frame:not(.is-folders-pinned) .pe-nav {
        width: 42px; min-height: 38px; padding: 0; justify-content: center;
    }
    .pe-frame:not(.is-folders-pinned) .pe-nav__count {
        position: absolute; top: 1px; right: 0;
        min-width: 18px; height: 16px; padding: 0 4px;
        border-radius: 999px;
        font-size: var(--text-2xs); line-height: 16px; text-align: center;
        background: var(--color-bg-hover-solid);
        box-shadow: 0 0 0 1px var(--color-border-strong);
    }
    .pe-frame:not(.is-folders-pinned) .pe-nav__count:not(.is-unread):not(.is-warn):not(.is-danger) { display: none; }
    .pe-frame:not(.is-folders-pinned) .pe-folders__sep { width: 30px; margin: 8px auto; }
}
@container pe (max-width: 999px) {
    .pe-frame { --pe-w-list: 340px; }
}
@container pe (max-width: 935px) {
    .pe-frame { grid-template-columns: 0 0 var(--pe-w-list, 340px) 7px minmax(0, 1fr); }
    .pe-frame:not(.is-folders-open) .pe-folders { display: none; }
    .pe-resizer--folders { display: none; }
    .pe-list__folders-btn { display: inline-flex !important; }
    .pe-frame.is-folders-open .pe-folders {
        position: absolute; z-index: 30; top: 0; bottom: 0; left: 0; width: 256px;
        background: rgba(15, 15, 20, 0.98);
        border-right: 1px solid var(--color-border-strong);
        box-shadow: var(--shadow-xl);
    }
    .pe-frame.is-folders-open .pe-scrim {
        display: block;
        position: absolute; inset: 0; z-index: 29;
        background: rgba(0, 0, 0, 0.55);
    }
}
@container pe (max-width: 759px) {
    .pe-frame { --pe-w-list: 300px; }
}
@container pe (max-width: 679px) {
    .pe-frame { --pe-w-list: 280px; }
}
@container pe (max-width: 599px) {
    .pe-frame { grid-template-columns: minmax(0, 1fr) !important; }
    .pe-frame > * { grid-column: 1 !important; grid-row: 1 !important; }
    .pe-resizer { display: none; }
    .pe-frame .pe-read { display: none; }
    .pe-frame.is-detail .pe-list { display: none; }
    .pe-frame.is-detail .pe-read { display: flex; }
    /* In der geoeffneten Mail zaehlt jede Zeile: der Seitenkopf weicht */
    .pe-head:has(~ .pe-frame.is-detail) { display: none; }
    .pe-actions__back { display: inline-flex !important; }
    .pe-actions { padding: 8px 8px; gap: 2px; }
    .pe-read__scroll { padding: 12px 10px 24px; }
    .pe-paper { --pe-edge: 16px; }
    .pe-msgc__snip { display: none; }
    .pe-msgc__line { flex-wrap: nowrap; }
    .pe-att { width: 100%; }
    .pe-head { gap: 10px; }
    .pe-head__title { gap: 8px; }
    .pe-live, .pe-head__help, .pe-search-kbd { display: none !important; }
    .pe-head__new .pulse-action-button__label { display: none; }
    .pe-head__new { width: 36px; padding: 0; }
    .pe-field { grid-template-columns: 52px minmax(0, 1fr); }
    .pe-field__aside { display: none; }
    .pe-field__hint { display: none; }
    .pe-suggestbox { margin-left: var(--pe-edge); }
    .pe-tb__label { display: none; }
    .pe-editor__hint { display: none; }
    .pe-rest__row { grid-template-columns: minmax(0, 1fr); }
    .pe-keys { grid-template-columns: minmax(0, 1fr); }
    /* Touch-Ziele */
    .pe-chips .pulse-filter-pill { min-height: 36px; }
    .pe-list__select-btn { min-height: 36px; }
    .pe-list .pulse-bulk-bar__select-clear { min-height: 36px; padding: 0 6px; }
    .pe-bulk__all { min-height: 36px; }
    .pe-list .pulse-bulk-bar__action { height: 36px; }
    .pe-context__open { min-height: 32px; }
}

/* Fenster unter 900 px: der Rand von .main ist dort global korrigiert
   (style.css, P8); hier nur die Hoehe der Arbeitsflaeche. */
/* v5.22.29: 144 statt 136. Unter 900 px stehen 84 (Abstand .main) + 12 +
   12 (Innenabstand .main) + 36 (Modul) = 144 px neben der Arbeitsflaeche;
   mit 136 war das Dokument 8 px hoeher als das Fenster. */
@media (max-width: 900px) {
    .pe-workspace { height: calc(100vh - 144px); height: calc(100dvh - 144px); }
}
/* Touch ohne Maus: keine Hover-Tooltips und keine Tastatur-Hinweise */
@media (hover: none) {
    .pe-workspace .pulse-tip::after { content: none !important; }
    .pe-toast__undo .pe-kbd, .pe-search-kbd, .pe-placeholder__keys, .pe-editor__hint { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .pe-item.is-new, .pe-newpill button, .pe-toast { animation: none; }
    .pe-item, .pe-nav, .pe-item__check, .pe-item__lead .pe-avatar { transition: none; }
}

/* =================================================================
   v5.22.29: die schmale Pulse-Navigation ist global (style.css,
   .sidebar.is-eingeklappt, components/sidebar-einklappen.js). Die Regeln
   body.is-posteingang.pe-nav-schmal und der Knopf .pe-head__nav sind
   entfallen. Hier bleibt nur die Unterpunkt-Liste einer Gruppe.
   ================================================================= */
.pe-nav-flyout { min-width: 220px; z-index: 1200; }
.pe-nav-flyout .kebab-menu-item svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- Ergaenzungen zum Mockup ---------- */
/* Hinweis am Postfach: Gesendet-Ordner nicht erkannt (ehrlich statt still) */
.pe-nav__warn {
    display: inline-flex;
    margin-left: 6px;
    color: var(--color-warning);
    vertical-align: -2px;
}
.pe-folders__empty {
    margin: 4px 12px 8px;
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}
.pe-more {
    display: flex;
    justify-content: center;
    padding: 12px 0 16px;
}

/* ---------- v5.22.21 P2: echtes Mail-HTML auf Weiss ----------
   Fremdes Mail-HTML bringt Tabellen, feste Breiten und Bilder mit. Der
   Text bleibt lesbar (Farben streicht der Sanitizer), breite Tabellen
   scrollen in der Flaeche statt den Lesebereich zu sprengen. */
.pe-msg__body--html { max-width: none; overflow-x: auto; overflow-wrap: anywhere; }
.pe-msg__body--html img { max-width: 100%; height: auto; }
.pe-msg__body--html table { max-width: 100%; border-collapse: collapse; }
.pe-msg__body--html td, .pe-msg__body--html th { color: var(--pe-ink); }
.pe-msg__body--html blockquote {
    margin: 8px 0;
    padding-left: 12px;
    border-left: 3px solid var(--pe-line-strong);
    color: var(--pe-ink-muted);
}
.pe-msg__body--text { white-space: normal; }
.pe-verlauf {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--pe-line-strong);
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--pe-ink-muted);
}
.pe-sig.pe-msg__body--html { overflow-x: auto; }
/* Hinweis: externe Bilder blockiert */
.pe-bilder {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-top: 14px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--pe-wash);
    border: 1px solid var(--pe-line);
    color: var(--pe-ink-2);
    font-size: var(--text-xs);
}
.pe-bilder > span { flex: 1 1 240px; min-width: 0; }
.pe-bilder svg { flex: 0 0 auto; color: var(--pe-ink-muted); }
/* Anhang ohne Datei: sichtbar, aber ohne Aktion */
.pe-att--ohne { opacity: 0.8; }
.pe-att--ohne .pe-att__size { white-space: normal; }
/* Waehrend die Mail laedt: Vorschau aus der Liste */
.pe-paper--laedt .pe-msg__body { color: var(--pe-ink-muted); }
/* Vorschau eines Bild-Anhangs */
.pe-preview__bild {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: min(70vh, 720px);
    overflow: auto;
    background: var(--pe-paper);
    border-radius: 8px;
    padding: 8px;
}
.pe-preview__bild img { max-width: 100%; max-height: min(68vh, 700px); object-fit: contain; }
