/* E-Mail-Postfach (app/postfach.js): Panel (/demo/postfach) und Kundenportal (/demo/postfach) */
.pf-kopf { margin-bottom: 14px; }
.pf-kopf .sub { font-size: 16px; }
/* Filterleiste wie im Bewerbungs-Board: Chips „Kunde: Alle ▾“ / „Kampagne: Alle ▾“ (app/filter.js), runde Suche und Umschalter,
   alle 38 px hoch; „Einstellungen“ rechts */
.pf-leiste { --pf-h: 38px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 14px; }
.pf-leiste input[type="search"], .pf-leiste .btn-small { box-sizing: border-box; height: var(--pf-h); margin: 0; font-size: 14px; }
.pf-leiste input[type="search"] { flex: 1 1 200px; min-width: 160px; max-width: 320px; padding: 0 16px; border-radius: 999px; font-size: 14.5px; }
.pf-leiste .btn-small { padding: 0 16px; font-weight: 700; border-radius: 12px; }
/* Filter als ein zusammenhängender Umschalter in derselben Höhe */
.pf-filter { box-sizing: border-box; display: inline-flex; flex-wrap: nowrap; gap: 2px; height: var(--pf-h); padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pf-chip { all: unset; box-sizing: border-box; cursor: pointer; height: 100%; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.pf-chip:hover { color: var(--text); background: var(--bg); }
.pf-chip[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.pf-chip:focus-visible, .pf-zeile:focus-visible, .pf-link-knopf:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.pf-chip .pf-zahl { background: var(--gruen); color: var(--text); }
.pf-einst-knopf { margin-left: auto; }

.pf { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; height: calc(100vh - 270px); height: calc(100dvh - 270px); min-height: 500px;
  background: var(--surface); border-radius: 24px; box-shadow: var(--schatten); overflow: hidden; }
.pf.pf-einzeln { display: block; height: auto; min-height: 0; background: none; box-shadow: none; overflow: visible; }
.pf-seite { border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.pf-leer { padding: 16px 18px; color: var(--muted); font-size: 14px; }
.pf-zeile { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 12px; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pf-zeile:hover { background: var(--bg); }
.pf-zeile.aktiv { background: var(--gruen-soft); }
.pf-zeile.neu .pf-name, .pf-zeile.neu .pf-betreff { font-weight: 800; }
.pf-av { grid-row: span 3; width: 40px; height: 40px; border-radius: 50%; background: var(--grau); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.pf-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pf-zeit { font-size: 12px; color: var(--muted); justify-self: end; white-space: nowrap; }
.pf-zeile.neu .pf-zeit { color: var(--gruen-dunkel); font-weight: 700; }
.pf-betreff, .pf-vorschau, .pf-wo { grid-column: 2 / 4; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pf-vorschau, .pf-wo { color: var(--muted); }
.pf-wo { font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.pf-zahl { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pf-marke { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #fff4d6; color: #8a5a00; white-space: nowrap; }
.pf-marke.rot { background: #fde7e5; color: var(--error); }
.pf-marke.gruen { background: var(--gruen-soft); color: var(--gruen-dunkel); }
.pf-clip { width: 14px; height: 14px; flex: none; }
.pf-clip svg, .pf-icon svg, .pf-zurueck svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pf-haupt { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.pf-kopfzeile { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pf-titel { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pf-titel b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-titel span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-zurueck { all: unset; cursor: pointer; display: none; width: 34px; height: 34px; flex: none; border-radius: 50%; }
.pf-hinweis { padding: 10px 18px; font-size: 13.5px; background: #fff4d6; color: #6d4800; }
.pf-hinweis .text-btn { color: inherit; text-decoration: underline; font-size: 13.5px; }
.pf-hinweis.sim { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.pf-zuordnen { padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; }
.pf-zuordnen .pf-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-treffer { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.pf-treffer button { all: unset; box-sizing: border-box; cursor: pointer; padding: 8px 10px; border-radius: 10px; background: var(--bg); font-size: 14px; }
.pf-treffer button:hover, .pf-treffer button:focus-visible { background: var(--gruen-soft); }
.pf-treffer small { color: var(--muted); }
.pf-verlauf { flex: 1; overflow-y: auto; padding: 16px clamp(12px, 3vw, 32px); display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.pf-mail { background: var(--surface); border-radius: 16px; padding: 14px 16px; box-shadow: var(--schatten); border: 1px solid var(--line); max-width: 860px; width: 100%; }
.pf-mail.aus { align-self: flex-end; background: #f4fbee; border-color: #d9f0c6; }
.pf-mail.aus.kunde { background: #eef4ff; border-color: #d6e4fb; }
.pf-mail.spam { opacity: .85; border-color: #f2c3be; }
.pf-mail-kopf { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13.5px; }
.pf-mail-kopf b { font-size: 14.5px; }
.pf-mail-kopf .pf-datum { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.pf-mail-betreff { font-size: 14px; font-weight: 700; margin: 6px 0 4px; }
.pf-text { font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.pf-zitat summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 8px; }
.pf-zitat .pf-text { color: var(--muted); font-size: 14px; border-left: 3px solid var(--line); padding-left: 10px; }
.pf-ki { margin: 8px 0 2px; padding: 8px 12px; border-radius: 10px; background: var(--bg); font-size: 13.5px; }
.pf-ki b { font-weight: 700; }
.pf-echt { font-size: 12px; color: var(--muted); }
.pf-echt.ok { color: var(--gruen-dunkel); }
.pf-spam { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: #fde7e5; color: #8f251d; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.pf-anh { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: flex-start; align-content: flex-start; }
.pf-datei { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 13.5px; max-width: 100%; color: var(--text); text-decoration: none; }
.pf-datei .pf-icon { width: 18px; height: 18px; flex: none; }
.pf-datei span { display: flex; flex-direction: column; min-width: 0; }
.pf-datei b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-datei small { color: var(--muted); font-size: 12px; }
.pf-datei.pf-abgelehnt { opacity: .75; border-style: dashed; }
a.pf-datei:hover { border-color: var(--line-strong); }
.pf-links { margin-top: 10px; font-size: 13px; }
.pf-links summary { cursor: pointer; color: var(--muted); }
.pf-links ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.pf-links li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pf-link-knopf { all: unset; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.pf-link-frage { flex-basis: 100%; padding: 8px 10px; border-radius: 10px; background: #fff4d6; color: #6d4800; }
.pf-link-frage a { font-weight: 700; color: inherit; }
.pf-fehler { font-size: 12.5px; color: var(--error); margin-top: 6px; }
.pf-aktionen { display: flex; gap: 12px; margin-top: 8px; }
.pf-aktionen .text-btn { font-size: 12.5px; color: var(--muted); }
.pf-eingabe { padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); display: grid; gap: 8px; }
.pf-eingabe textarea { width: 100%; min-height: 72px; max-height: 40vh; resize: vertical; border-radius: 12px; font-size: 15px; line-height: 1.45; }
.pf-eingabe .zeile { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pf-eingabe .sub { font-size: 12.5px; margin: 0; }
.pf-willkommen { margin: auto; padding: 32px; text-align: center; max-width: 520px; }
.pf-willkommen h2 { font-size: 20px; margin: 10px 0 6px; }
.pf-adresse { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.pf-adresse code { background: var(--bg); padding: 4px 8px; border-radius: 8px; font-size: 13px; word-break: break-all; }

/* Einstellungen */
.pf-einst { display: grid; gap: 16px; padding: 18px; overflow-y: auto; }
.pf-einst .panel-card { padding: 20px 22px; }
.pf-einst h2 { font-size: 18px; margin: 0 0 6px; }
.pf-kunden { display: grid; gap: 0; }
.pf-kunde { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.pf-kunde:first-child { border-top: 0; }
.pf-kunde .rechts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pf-kunde select { height: 38px; border-radius: 10px; font-size: 14px; }
.pf-schalter-zeile { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; }
.pf-dns { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.pf-dns th, .pf-dns td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pf-dns td code { overflow-wrap: anywhere; font-size: 12.5px; }
.pf-domain-form { display: grid; grid-template-columns: 1fr auto 1.4fr auto; gap: 8px; align-items: center; margin-top: 10px; }
.pf-domain-form span { color: var(--muted); }

/* Beim Bewerber (Panel und Portal) */
.bw-mail { display: grid; gap: 8px; }
.bw-mail .pf-anh { margin-top: 0; }

.pf-bw-kurz { display: none; }
@media (max-width: 720px) {
  .pf { grid-template-columns: 1fr; height: auto; min-height: 0; border-radius: 20px; }
  .pf.offen .pf-seite { display: none; }
  .pf:not(.offen) .pf-haupt { display: none; }
  .pf-seite { border-right: 0; overflow: visible; }
  .pf-zurueck { display: inline-flex; }
  .pf.offen .pf-haupt { position: fixed; inset: 0 0 calc(68px + env(safe-area-inset-bottom)) 0; z-index: 30; }
  body.pf-portal .pf.offen .pf-haupt { bottom: 0; }
  .pf-kopfzeile { padding: 10px 12px; gap: 8px; }
  .pf-kopfzeile .btn-small { height: 34px; padding: 0 10px; font-size: 13px; }
  .pf-bw-lang { display: none; }
  .pf-bw-kurz { display: inline; }
  .pf-mail { padding: 12px; }
  /* Handy: Suche + „Einstellungen“, darunter Kunde/Kampagne (je halbe Breite), darunter der Filter über die ganze Breite */
  .pf-leiste input[type="search"] { flex: 1 1 160px; min-width: 0; max-width: none; order: 0; }
  .pf-einst-knopf { margin-left: 0; order: 1; }
  .pf-leiste .fchip { flex: 1 1 calc(50% - 5px); min-width: 0; order: 2; }
  .pf-leiste .fchip-knopf { width: 100%; }
  .pf-leiste .fchip-wert { max-width: none; flex: 1; }
  .pf-filter { flex: 1 1 100%; min-width: 0; order: 3; overflow-x: auto; scrollbar-width: none; }
  .pf-filter::-webkit-scrollbar { display: none; }
  .pf-chip { flex: 1 0 auto; justify-content: center; padding: 0 8px; font-size: 13px; }
  .pf-kunde { grid-template-columns: 1fr; }
  .pf-kunde .rechts { justify-content: flex-start; }
  .pf-domain-form { grid-template-columns: 1fr; }
  .pf-dns thead { display: none; }
  .pf-dns tr { display: grid; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .pf-dns td { border: 0; padding: 2px 0; }
}
