/* <sistenta-postfach-2> -- Konten | Liste | Lesen/Entwurf (02.10.2026).
   Farben nur ueber die vorhandenen Variablen (--text, --muted, --line,
   --panel, --panel2, --accent, --accent-soft, --on-accent, --warn, --lav),
   damit Hell und Dunkel stimmen. Einzige eigene Farbe: Rot fuer Fehler. */
sistenta-postfach-2 {
  display: block; color: var(--text); margin: 0 0 24px;
  --p2-rot: #ff8a80;
  --p2-flaeche: var(--panel, #0d2631);
  --p2-flaeche2: var(--panel2, #11313c);
  --p2-kante: var(--line, #24404b);
  --p2-radius: 14px;
}
:root[data-theme=light] sistenta-postfach-2 { --p2-rot: #c2362b; }
sistenta-postfach-2 [hidden] { display: none !important; }
sistenta-postfach-2 button, sistenta-postfach-2 input, sistenta-postfach-2 select, sistenta-postfach-2 textarea { font: inherit; color: inherit; }
sistenta-postfach-2 :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.p2-unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.p2-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Raster ---------- */
.p2__raster {
  display: grid; grid-template-columns: 232px minmax(280px, 380px) minmax(0, 1fr);
  min-height: 640px; height: min(82vh, 920px);
  border: 1px solid var(--p2-kante); border-radius: var(--p2-radius); background: var(--p2-flaeche); overflow: hidden;
}
.p2__links { padding: 14px 10px; border-right: 1px solid var(--p2-kante); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.p2__mitte { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--p2-kante); }
.p2__rechts { overflow-y: auto; padding: 22px 26px; min-width: 0; }
.p2__titel { margin: 16px 8px 6px; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.p2__konten, .p2__ordner, .p2__liste, .p2-kontoliste { list-style: none; margin: 0; padding: 0; }

/* ---------- Zeilen links ---------- */
.p2-zeile {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 9px;
  background: none; cursor: pointer; text-align: left; font-size: 13.5px; color: var(--text);
}
.p2-zeile:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.p2-zeile.ist-an { background: var(--accent-soft, color-mix(in srgb, var(--accent) 12%, transparent)); color: var(--text); font-weight: 600; }
.p2-zeile.ist-an .p2-i { color: var(--accent); }
.p2-zeile__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2-zahl { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p2-trenner { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--p2-kante); }
.p2-punkt { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.p2-punkt--gmail { background: var(--accent); }
.p2-punkt--outlook { background: var(--lav); }
.p2-punkt--imap { background: var(--warn); }
.p2-punkt--fehler { background: var(--p2-rot); }
.p2-warn { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--p2-rot); border: 1px solid currentColor; }

/* ---------- Knoepfe ---------- */
.p2-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
sistenta-postfach-2 .p2-knopf { color: var(--on-accent); }
.p2-knopf:disabled { opacity: .45; cursor: not-allowed; }
.p2-knopf--haupt { width: 100%; margin-bottom: 4px; }
sistenta-postfach-2 .p2-knopf--zweit { background: transparent; color: var(--text); border-color: var(--p2-kante); }
.p2-knopf--zweit:hover { border-color: var(--accent); }
.p2-leise { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.p2-leise:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
/* 28.10.2026, Selbsttest: "Konto hinzufuegen" wurde uebersehen. Als Knopf erkennbar. */
.p2-konto-neu { margin-top: 6px; width: 100%; border: 1px dashed color-mix(in srgb, var(--text) 30%, transparent); color: var(--text); font-weight: 600; }
sistenta-postfach-2 .p2-rot, .p2-rot { color: var(--p2-rot); }
.p2-symbol { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--p2-kante); border-radius: 10px; background: none; cursor: pointer; }
.p2-symbol:hover { border-color: var(--accent); }
.p2-dreht .p2-i { animation: p2-drehen 1s linear infinite; }
@keyframes p2-drehen { to { transform: rotate(360deg); } }

/* ---------- Mitte ---------- */
.p2__suche { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--p2-kante); align-items: center; }
.p2__suche select { height: 36px; border: 1px solid var(--p2-kante); border-radius: 10px; background: var(--p2-flaeche2); padding: 0 8px; max-width: 146px; font-size: 13px; }
.p2-suchfeld { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--p2-kante); border-radius: 10px; background: var(--p2-flaeche2); color: var(--muted); }
.p2-suchfeld input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; color: var(--text); font-size: 13.5px; }
.p2-suchfeld:focus-within { border-color: var(--accent); }
.p2__kopf { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px 8px; flex-wrap: wrap; }
.p2__kopf h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.p2__kopf span { font-size: 12.5px; color: var(--muted); }
.p2__liste { flex: 1; overflow-y: auto; }
.p2__liste[aria-busy=true] { opacity: .6; }
.p2__mehr { margin: 8px auto 12px; }
.p2-mail {
  width: 100%; display: grid; gap: 2px; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--p2-kante);
  background: none; text-align: left; cursor: pointer; color: var(--text);
}
.p2-mail:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.p2-mail.ist-an { background: var(--accent-soft, color-mix(in srgb, var(--accent) 10%, transparent)); box-shadow: inset 3px 0 0 var(--accent); }
.p2-mail__oben { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p2-mail__von { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2-mail__zeit { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p2-mail__klammer { color: var(--muted); display: inline-flex; }
.p2-mail__betreff { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p2-mail__auszug { font-size: 12.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.p2-chip { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 99px; font-size: 11px; line-height: 18px; border: 1px solid var(--p2-kante); color: var(--text); }
.p2-chip--rechnungen { border-color: var(--warn); color: var(--warn); }
.p2-chip--kooperationen { border-color: var(--accent); color: var(--accent); }
.p2-chip--wichtig { border-color: var(--lav); color: var(--lav); }
.p2-leer { padding: 28px 18px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* ---------- Rechts ---------- */
.p2-ruhe { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); text-align: center; }
.p2-ruhe .p2-i { width: 34px; height: 34px; stroke-width: 1.3; }
.p2-lesen h3, .p2-entwurf h3, .p2-konto h3 { margin: 0 0 12px; font-size: 20px; font-weight: 650; letter-spacing: -.4px; line-height: 1.25; overflow-wrap: anywhere; }
.p2-konto h4, .p2-entwurf h4 { margin: 22px 0 10px; font-size: 14px; }
.p2-lesen__kopf { display: flex; gap: 12px; align-items: center; font-size: 13.5px; margin-bottom: 14px; overflow-wrap: anywhere; }
.p2-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--p2-flaeche2); border: 1px solid var(--p2-kante); font-weight: 650; }
.p2-leiser { color: var(--muted); }
.p2-klein { font-size: 12px; }
.p2-leiste { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 12px 0; }
.p2-verschieben { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.p2-verschieben select { height: 34px; border: 1px solid var(--p2-kante); border-radius: 9px; background: var(--p2-flaeche2); padding: 0 8px; color: var(--text); }
.p2-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.p2-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; padding: 16px 0; border-top: 1px solid var(--p2-kante); }
.p2-anhaenge { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.p2-anhang { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--p2-kante); border-radius: 9px; color: var(--text); text-decoration: none; font-size: 13px; }
.p2-anhang:hover { border-color: var(--accent); }
.p2-hinweis { margin: 8px 0; padding: 8px 12px; border-radius: 9px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--text); font-size: 13px; display: block; }
.p2-hinweis--rot { background: color-mix(in srgb, var(--p2-rot) 14%, transparent); }

/* ---------- Formulare ---------- */
.p2-entwurf { display: grid; gap: 8px; }
.p2-entwurf__titel { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.p2-entwurf__titel span { font-size: 12px; }
.p2-feld { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.p2-feld input, .p2-feld select, .p2-feld textarea {
  width: 100%; min-width: 0; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--p2-kante); border-radius: 9px;
  background: var(--p2-flaeche2); color: var(--text); font-size: 14px;
}
.p2-feld input:focus, .p2-feld select:focus, .p2-feld textarea:focus { border-color: var(--accent); outline: 0; }
.p2-feld--text { grid-template-columns: minmax(0, 1fr); }
.p2-feld--text textarea { resize: vertical; min-height: 260px; line-height: 1.55; }
.p2-mehr summary { cursor: pointer; font-size: 13px; color: var(--muted); margin: 6px 0; }
.p2-mehr .p2-feld { margin-top: 8px; }
.p2-bestaetigen { margin-top: 6px; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft, transparent); }
.p2-bestaetigen__titel { margin: 0 0 8px; font-weight: 650; }
.p2-bestaetigen dl { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 13.5px; }
.p2-bestaetigen dt { color: var(--muted); }
.p2-bestaetigen dd { margin: 0; overflow-wrap: anywhere; }
.p2-kontoliste li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--p2-kante); }
.p2-kontoliste li > div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; }

/* ---------- Toast ---------- */
.p2__toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: min(560px, 92vw); padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--panel, #fff); font-size: 13.5px; box-shadow: var(--shadow, 0 10px 30px #0003); }
.p2__toast--schlecht { background: var(--p2-rot); color: #fff; }

.p2-nur-schmal { display: none; }

/* ---------- Schmal: eine Spalte ---------- */
@media (max-width: 1180px) {
  .p2__raster { grid-template-columns: 200px minmax(240px, 320px) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .p2__raster { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .p2__links { border-right: 0; border-bottom: 1px solid var(--p2-kante); flex-direction: row; flex-wrap: wrap; align-items: center; }
  .p2__links .p2__titel { width: 100%; margin: 6px 4px 2px; }
  .p2__konten, .p2__ordner { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
  .p2__ordner .p2-trenner { margin: 0; padding: 0; border: 0; }
  .p2-zeile { width: auto; }
  .p2__mitte { border-right: 0; max-height: 70vh; }
  .p2__rechts { display: none; padding: 16px; }
  .p2--offen .p2__mitte, .p2--offen .p2__links { display: none; }
  .p2--offen .p2__rechts { display: block; }
  .p2-nur-schmal { display: inline-flex; margin-bottom: 8px; }
  .p2-feld { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .p2-dreht .p2-i { animation: none; } }
[data-motion=off] .p2-dreht .p2-i { animation: none; }

/* Testphase-Ausbau B6 (09.10.2026): Buendel ueber der Liste, Pruefkaesten. */
.p2__buendel { padding: 0 12px 8px; display: grid; gap: 8px; }
.p2-buendel { border: 1px solid var(--p2-kante); border-radius: 10px; padding: 8px 10px; background: var(--p2-flaeche2); }
.p2-buendel h3 { margin: 0 0 4px; font-size: 13.5px; font-weight: 650; display: flex; gap: 6px; align-items: baseline; }
.p2-buendel ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.p2-buendel li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.p2-buendel li > span { flex: 1; min-width: 0; }
.p2-buendel .p2-leise { text-align: left; color: var(--text); padding: 4px 6px; }
.p2-hinweis ul { margin: 4px 0; padding-left: 18px; }
.p2-pruefung { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--p2-kante); border-radius: 9px; font-size: 13px; }
.p2-pruefung ul { margin: 4px 0; padding-left: 18px; }
.p2-pruefung .p2-plus { color: var(--text); }
.p2-pruefung .p2-minus { color: var(--p2-rot); }
