/* Postfach wie die Mail-App auf dem iPhone: Liste mit Punkt fuer ungelesen,
   Wischen nach rechts (Archiv / Löschen), Mail mit Anhang-Kacheln und HTML-Ansicht. */
.pf { display: grid; gap: 10px; max-width: 920px; }
.pf-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pf-suche {
  flex: 1 1 220px; max-width: 360px; min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--paper); font: inherit; font-size: 15px;
}
.pf-suche:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.pf-tipp { margin: 0; color: var(--faint); font-size: 12px; }

.pf-liste { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.pf-wisch { position: relative; overflow: hidden; border-top: 1px solid var(--line); transition: max-height .22s ease, opacity .22s ease; max-height: 200px; }
.pf-wisch:first-child { border-top: 0; }
.pf-wisch.is-weg { max-height: 0; opacity: 0; }
.pf-wisch__hinten { position: absolute; inset: 0 auto 0 0; display: flex; }
.pf-wisch__knopf { width: 84px; border: 0; color: #fff; font: 600 13px/1.2 inherit; font-family: inherit; cursor: pointer; }
.pf-wisch__knopf--archiv { background: #5856d6; }
.pf-wisch__knopf--zurueck { background: #0a84ff; }
.pf-wisch__knopf--loeschen { background: #ff3b30; }
.pf-wisch.is-durch .pf-wisch__knopf--archiv, .pf-wisch.is-durch .pf-wisch__knopf--zurueck { width: 100vw; }

.pf-zeile {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: 100%;
  padding: 11px 14px 12px 28px; border: 0; background: var(--panel); color: var(--paper);
  font: inherit; text-align: left; cursor: pointer; touch-action: pan-y; will-change: transform;
}
.pf-zeile:hover { background: var(--panel2); }
.pf-zeile__punkt { position: absolute; left: 10px; top: 17px; width: 9px; height: 9px; border-radius: 50%; background: transparent; }
.pf-zeile.is-neu .pf-zeile__punkt { background: #0a84ff; }
.pf-zeile__von { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-zeile__rechts { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 13px; white-space: nowrap; }
.pf-zeile__klammer { font-size: 13px; filter: grayscale(1); opacity: .8; }
.pf-zeile__pfeil { font-size: 18px; line-height: 1; color: var(--faint); }
.pf-zeile__betreff { grid-column: 1 / -1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--paper); }
.pf-zeile.is-neu .pf-zeile__betreff { font-weight: 600; }
.pf-zeile__vorschau {
  grid-column: 1 / -1; font-size: 13.5px; line-height: 1.35; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pf-chip { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: #ffcc00; color: #d40511; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.pf-zeile__maus { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 2; display: none; gap: 6px; }
.pf-zeile__maus button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line2); background: var(--panel3); color: var(--paper); cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .pf-wisch:hover .pf-zeile__maus { display: flex; }
  .pf-wisch:hover .pf-zeile__rechts { visibility: hidden; }
}

.pf-leer, .pf-fehler { display: grid; gap: 8px; padding: 28px 20px; border: 1px dashed var(--line2); border-radius: 14px; color: var(--muted); font-size: 14px; justify-items: start; }
.pf-leer strong, .pf-fehler strong { color: var(--paper); font-size: 16px; }
.pf-skelett { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.pf-skelett__zeile { display: grid; gap: 7px; padding: 14px 16px 14px 28px; border-top: 1px solid var(--line); }
.pf-skelett__zeile:first-child { border-top: 0; }
.pf-skelett__zeile i { display: block; height: 11px; border-radius: 6px; background: var(--panel3); animation: pfPuls 1.1s ease-in-out infinite; }
.pf-skelett__zeile i:nth-child(1) { width: 34%; } .pf-skelett__zeile i:nth-child(2) { width: 62%; } .pf-skelett__zeile i:nth-child(3) { width: 88%; }
@keyframes pfPuls { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .pf-skelett__zeile i { animation: none; } .pf-wisch, .pf-zeile { transition: none !important; } }

/* Einzelne Mail */
.pf--mail { padding-bottom: 84px; }
.pf-zurueck { justify-self: start; min-height: 40px; border: 0; background: none; color: #0a84ff; font: inherit; font-size: 16px; cursor: pointer; padding: 0 4px; }
.pf-mail { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px; }
.pf-mail__kopf { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pf-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(#8e8e93, #636366); color: #fff; font-weight: 700; font-size: 17px; }
.pf-mail__wer { display: grid; gap: 2px; min-width: 0; }
.pf-mail__wer strong { font-size: 16px; }
.pf-mail__wer span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.pf-mail__kopf time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.pf-mail__betreff { margin: 0; font-size: 21px; line-height: 1.25; }
.pf-hinweis { margin: 0; color: var(--warn); font-size: 13px; }

.pf-marke { display: grid; gap: 10px; justify-items: center; padding: 16px; border-radius: 14px; background: #ffcc00; color: #111; text-align: center; }
.pf-marke__kopf { display: grid; gap: 2px; }
.pf-marke__kopf strong { color: #d40511; font-size: 17px; letter-spacing: .02em; }
.pf-marke__kopf span { font-size: 13px; }
.pf-marke__qr { width: min(280px, 80vw); height: auto; background: #fff; padding: 12px; border-radius: 10px; image-rendering: pixelated; }
.pf-marke p { margin: 0; font-size: 14px; }
.pf-marke__knoepfe { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pf-marke .btn { background: #fff; color: #111; border-color: rgba(0, 0, 0, .25); border-radius: 10px; min-height: 42px; display: inline-flex; align-items: center; text-decoration: none; padding: 0 14px; }
.pf-marke .btn--solid { background: #d40511; color: #fff; border-color: #d40511; }

.pf-anhaenge { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.pf-kachel {
  flex: 0 0 132px; display: grid; gap: 4px; padding: 8px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--panel2); color: var(--paper); font: inherit; text-align: left; cursor: pointer;
}
.pf-kachel:hover { border-color: var(--accent); }
.pf-kachel.is-fehlt { opacity: .55; cursor: default; }
.pf-kachel__bild { height: 92px; border-radius: 8px; background: var(--panel3); display: grid; place-items: center; overflow: hidden; }
.pf-kachel__bild img { width: 100%; height: 100%; object-fit: cover; }
.pf-kachel__bild b { font-size: 15px; letter-spacing: .06em; color: #ff453a; }
.pf-kachel__name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-kachel__groesse { font-size: 11.5px; color: var(--faint); }

.pf-html { width: 100%; min-height: 60px; border-radius: 10px; background: #fff; display: block; overflow: hidden; }
.pf-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; color: var(--paper); }

.pf-leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(13, 13, 13, .94);
  border-top: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.pf-leiste button, .pf-leiste a {
  display: grid; justify-items: center; gap: 2px; min-width: 50px; border: 0; background: none; color: #0a84ff;
  font: inherit; font-size: 11px; text-decoration: none; cursor: pointer;
}
.pf-leiste span { font-size: 20px; line-height: 1.1; }
.pf-leiste [data-aktion="loeschen"] { color: #ff453a; }
@media (min-width: 900px) { .pf-leiste { left: var(--sidebar); } }

.pf-toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: flex; gap: 14px; align-items: center; padding: 10px 12px 10px 16px; border-radius: 12px;
  background: var(--paper); color: #111; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); max-width: calc(100vw - 32px);
}
.pf-toast button { border: 0; background: none; color: #0a62d0; font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 760px) {
  /* Ueber der Tab-Leiste (63 px + Sicherheitsabstand unten). */
  .pf-leiste { bottom: calc(63px + env(safe-area-inset-bottom)); padding-bottom: 8px; }
  .pf--mail { padding-bottom: 150px; }
  .pf-toast { bottom: calc(140px + env(safe-area-inset-bottom)); }
  .pf-mail { padding: 12px; border-radius: 12px; }
  .pf-mail__kopf { grid-template-columns: auto minmax(0, 1fr); }
  .pf-mail__kopf time { grid-column: 2; }
  .pf-suche { max-width: none; }
}

/* Gesendet und selbst schreiben */
.pf-neu { min-height: 38px; border-radius: 10px; padding: 0 14px; }
.pf-chip--art { background: var(--panel3); color: var(--muted); font-weight: 600; border: 1px solid var(--line2); }
.pf-zeile.is-fehler .pf-zeile__punkt { background: #ff453a; }
.pf-avatar--shop { background: #f2efe7; color: #111; }
.pf-fehlertext { color: #ff453a; }
.pf-hinweis--leise { color: var(--muted); }
.pf-verfassen { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px; }
.pf-feld { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.pf-feld span { color: var(--faint); font-size: 14px; }
.pf-feld input { min-height: 38px; border: 0; background: transparent; color: var(--paper); font: inherit; font-size: 16px; outline: none; }
.pf-feld input:disabled { color: var(--faint); font-size: 13px; }
.pf-textfeld { min-height: 240px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--paper); font: inherit; font-size: 16px; line-height: 1.5; padding: 12px; }
.pf-textfeld:focus, .pf-feld input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.pf-verfassen__knoepfe { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pf-verfassen__knoepfe .btn { min-height: 44px; border-radius: 10px; padding: 0 18px; }
@media (max-width: 760px) { .pf-neu { flex: 1 1 100%; } .pf-verfassen { padding: 12px; } }
