/* Postfach – mobile-first, passend zum bestehenden Dark/Glass Look */
:root{
  --pf-glass: rgba(255,255,255,0.06);
  --pf-glass2: rgba(255,255,255,0.09);
  --pf-border: rgba(255,255,255,0.10);
  --pf-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.container{ max-width: 820px; margin: 0 auto; }

.pf-tabs{
  display:flex;
  gap:10px;
  padding: 10px 12px;
  margin: 10px 10px 12px;
  border-radius: 14px;
  background: var(--pf-glass);
  border: 1px solid var(--pf-border);
}

.pf-tab{
  flex:1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-weight: 700;
  display:flex;
  justify-content:center;
  gap:8px;
  align-items:center;
}

.pf-tab.is-active{
  background: var(--pf-glass2);
  border-color: var(--pf-border);
}

.pf-pill{
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pf-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding: 0 10px 14px;
}

.pf-card{
  background: var(--pf-glass);
  border: 1px solid var(--pf-border);
  border-radius: 16px;
  box-shadow: var(--pf-shadow);
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.pf-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.pf-from{
  font-weight: 900;
  line-height: 1.1;
}
.pf-sub{
  opacity: .85;
  font-size: 13px;
}
.pf-snippet{
  opacity: .92;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.pf-badges{
  display:flex;
  gap:8px;
  align-items:center;
}
.pf-badge{
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.25);
}
.pf-badge.unread{
  background: rgba(255,255,255,0.14);
}

.pf-empty{
  margin: 18px 10px;
  padding: 18px;
  border-radius: 18px;
  background: var(--pf-glass);
  border: 1px solid var(--pf-border);
  text-align:center;
}
.pf-empty-icon{ font-size: 32px; margin-bottom: 6px; }
.pf-empty-title{ font-weight: 900; font-size: 18px; }
.pf-empty-sub{ opacity: .85; margin: 6px 0 12px; }

/* dialogs */
.pf-dialog{
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 0;
  max-width: 560px;
  width: calc(100vw - 28px);
  background: rgba(18, 18, 22, 0.92);
  color: inherit;
  box-shadow: var(--pf-shadow);
}
.pf-dialog::backdrop{
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.pf-dialog-inner{ padding: 14px; display:flex; flex-direction:column; gap:12px; }
.pf-dialog-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pf-dialog-title{ font-weight: 950; font-size: 16px; }

.pf-field{ display:flex; flex-direction:column; gap:6px; }
.pf-label{ font-size: 12px; opacity: .85; font-weight: 800; }
.pf-input{
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: inherit;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
.pf-textarea{ resize: vertical; min-height: 120px; }

.pf-dialog-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  align-items:center;
}

.pf-msg-meta{
  opacity: .85;
  font-size: 13px;
  line-height: 1.3;
}
.pf-msg-body{
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 12px;
}

/* toast */
.pf-toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.78);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 10px 12px;
  border-radius: 999px;
  max-width: calc(100vw - 24px);
  box-shadow: var(--pf-shadow);
  z-index: 1000;
  font-weight: 800;
  font-size: 13px;
}

@media (min-width: 840px){
  .pf-tabs{ margin-left: 0; margin-right: 0; }
  .pf-list{ padding-left: 0; padding-right: 0; }
}

@media print{
  header, .pf-tabs, #pf-compose, #pf-empty-compose, .pf-toast { display:none !important; }
  .pf-card{ box-shadow:none; border:1px solid #ddd; background:#fff; color:#000; }
  .pf-dialog{ display:none !important; }
}


/* Search */
.pf-search{ margin-top: 10px; }
#pf-search{
  width: 100%;
  background: var(--pf-glass);
  border: 1px solid var(--pf-border);
  border-radius: 14px;
  padding: 10px 12px;
}

/* Thread / conversation */
.pf-thread-list{
  margin-top: 10px;
  max-height: min(56vh, 520px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.pf-bubble{
  align-self: flex-start;
  max-width: 92%;
  background: var(--pf-glass2);
  border: 1px solid var(--pf-border);
  border-radius: 16px;
  padding: 10px 12px;
}
.pf-bubble.me{
  align-self: flex-end;
  background: rgba(120,255,180,0.10);
  border-color: rgba(120,255,180,0.18);
}
.pf-bubble-top{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.pf-bubble-meta{
  font-size: 12px;
  opacity: 0.75;
}
.pf-bubble-del{
  border: 0;
  background: transparent;
  padding: 4px 6px;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.75;
}
.pf-bubble-del:active{ transform: translateY(1px); }


/* --- Readability tweaks (sent messages & list) --- */
.pf-card{
  color: #fff;
}
.pf-from{
  color: #fff;
}
.pf-sub{
  color: rgba(255,255,255,0.78);
}
.pf-snippet{
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 2px rgba(0,0,0,0.55);
}

/* Sent bubble (me) – higher contrast */
.pf-bubble.me{
  background: linear-gradient(135deg, rgba(255,180,90,0.22), rgba(255,140,60,0.18));
  border-color: rgba(255,180,90,0.35);
  color: #fff;
}
.pf-bubble.me > div:last-child{
  color: #fff;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  background: rgba(0,0,0,0.35);
  padding: 6px 10px;
  border-radius: 12px;
  display: inline-block;
}

/* Print: keep contrast */
@media print{
  .pf-bubble.me{
    background: #000 !important;
    border-color: #000 !important;
  }
  .pf-bubble.me > div:last-child{
    background: #000 !important;
    color: #fff !important;
    text-shadow: none !important;
  }
}
