/* =========================================================
   SHB Private Nachrichten
   ========================================================= */

.shb-pn-postfach,
.shb-pn-gespraech,
.shb-pn-direct,
.shb-pn-start-box {
  margin: 20px 0;
}

.shb-pn-postfach h3,
.shb-pn-gespraech h3 {
  margin: 0 0 18px 0;
  font-size: 2rem;
  line-height: 1.2;
  color: #fff;
}

/* =========================================================
   Hinweise / Fehler
   ========================================================= */

.shb-pn-hinweis,
.shb-pn-fehler {
  margin: 0 0 18px 0;
  padding: 12px 14px;
  border-radius: 10px;
  line-height: 1.5;
}

.shb-pn-hinweis {
  background: rgba(102,255,255,0.05);
  border: 1px solid rgba(102,255,255,0.12);
  color: #fff;
}

.shb-pn-fehler {
  background: rgba(255,80,80,0.12);
  border: 1px solid rgba(255,80,80,0.24);
  color: #fff;
}

/* =========================================================
   Postfach
   ========================================================= */

.shb-pn-postfach {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.shb-pn-postfach-eintrag {
  background: #454545;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.shb-pn-postfach-eintrag:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}

.shb-pn-postfach-eintrag.has-unread {
  border-left: 4px solid #66ffff;
  box-shadow: 0 0 0 1px rgba(102,255,255,0.18), 0 8px 20px rgba(0,0,0,0.18);
}

.shb-pn-postfach-kopf {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.shb-pn-postfach-kopf-links {
  flex: 1 1 auto;
  min-width: 0;
}

.shb-pn-postfach-kopf-rechts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.shb-pn-postfach-partner {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.shb-pn-postfach-bezug {
  margin-top: 6px;
  color: rgba(255,255,255,0.78);
  font-size: 0.96rem;
  line-height: 1.4;
}

.shb-pn-postfach-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.shb-pn-postfach-ungelesen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(102,255,255,0.16);
  color: #66ffff;
  font-weight: 700;
  font-size: 0.9rem;
}

.shb-pn-postfach-snippet {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.55;
  color: #fff;
  opacity: 0.95;
}

.shb-pn-postfach-snippet-leer {
  color: rgba(255,255,255,0.65);
  font-style: italic;
}

.shb-pn-postfach-fuss {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.shb-pn-postfach-fuss-links {
  color: rgba(255,255,255,0.72);
  font-size: 0.92rem;
}

.shb-pn-postfach-fuss-rechts {
  display: flex;
  align-items: center;
}

.shb-pn-postfach-fuss-rechts .button {
  min-width: 110px;
  text-align: center;
}

/* =========================================================
   Gesprächskopf
   ========================================================= */

.shb-pn-chat-titel {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.shb-pn-kopf {
  background: #454545;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.shb-pn-kopf-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.shb-pn-kopf-rechts {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.shb-pn-kopf-links {
  flex: 1 1 auto;
  min-width: 0;
}

.shb-pn-chat-titel {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 10px 0;
  word-break: break-word;
}

.shb-pn-chat-partner {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.92);
}

.shb-pn-kopf-rechts form,
.shb-pn-kopf-rechts div,
.shb-pn-kopf-rechts details {
  margin: 0;
}

.shb-pn-icon-button {
  min-width: 46px !important;
  width: 46px;
  height: 46px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 10px !important;
}

.shb-pn-ended-button {
  min-width: 130px !important;
  height: 46px;
  padding: 0 14px !important;
  border-radius: 10px !important;
  opacity: 0.75;
  cursor: default !important;
}

/* =========================================================
   Kleines Melden-Icon
   ========================================================= */

.shb-pn-report-box {
  position: relative;
}

.shb-pn-report-trigger {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.shb-pn-report-trigger::-webkit-details-marker {
  display: none;
}

.shb-pn-report-trigger::marker {
  display: none;
}

.shb-pn-report-trigger:hover {
  color: #66ffff !important;
}

.shb-pn-report-panel {
  position: absolute;
  top: 56px;
  right: 0;
  width: 320px;
  max-width: 90vw;
  padding: 14px;
  border-radius: 14px;
  background: #4b4b4b;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 10px 30px rgba(0,0,0,0.28);
  z-index: 20;
}

.shb-pn-report-panel form {
  margin: 0;
}

.shb-pn-report-panel p {
  margin: 0 0 10px 0;
}

.shb-pn-report-panel label {
  color: #fff;
}

.shb-pn-report-panel textarea,
.shb-pn-report-panel select {
  border-radius: 10px;
}

/* =========================================================
   Nachrichtenverlauf
   ========================================================= */

.shb-pn-nachrichten {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.shb-pn-nachricht {
  position: relative;
  max-width: min(78%, 760px);
  padding: 14px 16px 15px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 18px rgba(0,0,0,0.14);
}

.shb-pn-nachricht::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: rgba(255,255,255,0.06);
  border-left: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transform: rotate(-45deg);
  border-bottom-left-radius: 3px;
}

.shb-pn-nachricht.is-own {
  margin-left: auto;
  background: rgba(102,255,255,0.10);
  border-color: rgba(102,255,255,0.25);
  box-shadow: 0 8px 20px rgba(0,0,0,0.16);
}

.shb-pn-nachricht.is-own::after {
  left: auto;
  right: 14px;
  background: rgba(102,255,255,0.10);
  border-left: none;
  border-bottom: 1px solid rgba(102,255,255,0.25);
  border-right: 1px solid rgba(102,255,255,0.25);
  transform: rotate(45deg);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 3px;
}

.shb-pn-meta {
  margin-bottom: 10px;
  font-size: 0.86rem;
  line-height: 1.35;
  color: rgba(255,255,255,0.78);
}

.shb-pn-meta strong {
  color: #ffffff;
  font-weight: 700;
}

.shb-pn-text {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #fff;
  word-break: break-word;
}

.shb-pn-nachricht.is-own .shb-pn-text {
  color: #f8ffff;
}

.shb-pn-nachricht.is-own .shb-pn-meta {
  color: rgba(230,255,255,0.82);
}

/* =========================================================
   Formulare im PN-System
   ========================================================= */

.shb-pn-reply-form,
.shb-pn-start-form,
.shb-pn-direct form {
  margin-top: 20px;
}

.shb-pn-reply-form textarea,
.shb-pn-start-form textarea,
.shb-pn-direct textarea {
  border-radius: 10px;
}

.shb-pn-postfach-link .button,
.shb-pn-close-form .button,
.shb-pn-hide-form .button,
.shb-pn-reply-form .button,
.shb-pn-start-form .button,
.shb-pn-direct .button,
.shb-pn-report-panel .button {
  min-width: 170px;
  text-align: center;
}

/* Direktnachricht */
.shb-pn-direct details {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.shb-pn-direct summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  color: #fff;
}

.shb-pn-direct summary::-webkit-details-marker {
  display: none;
}

.shb-pn-direct summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  font-size: 0.85em;
  transform: translateY(-1px);
}

.shb-pn-direct details[open] summary::before {
  content: "▼";
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767px) {
  .shb-pn-postfach-eintrag,
  .shb-pn-kopf,
  .shb-pn-nachricht {
    padding: 14px;
    border-radius: 12px;
    max-width: 100%;
  }

  .shb-pn-postfach h4,
  .shb-pn-gespraech h4 {
    font-size: 1.7rem;
  }

  .shb-pn-postfach-kopf,
  .shb-pn-postfach-fuss {
    flex-direction: column;
    align-items: flex-start;
  }

  .shb-pn-postfach-kopf-rechts {
    width: 100%;
    justify-content: flex-start;
  }
  
  .shb-pn-postfach-fuss-rechts {
    width: 100%;
  }

  .shb-pn-postfach-fuss-rechts .button {
    width: 100%;
    min-width: 0;
  }  

  .shb-pn-kopf-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .shb-pn-chat-titel {
    font-size: 1.7rem;
    margin-bottom: 8px;
  }

  .shb-pn-kopf-rechts {
    margin-top: 6px;
    width: 100%;
    flex-wrap: wrap;
  }

  .shb-pn-report-panel {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
  }

  .shb-pn-icon-button,
  .shb-pn-ended-button,
  .shb-pn-postfach-link .button,
  .shb-pn-close-form .button,
  .shb-pn-hide-form .button,
  .shb-pn-reply-form .button,
  .shb-pn-start-form .button,
  .shb-pn-direct .button,
  .shb-pn-report-panel .button {
    width: 100%;
    min-width: 0 !important;
  }

  .shb-pn-nachricht {
    max-width: 100%;
  }
  
  .shb-pn-nachricht::after,
  .shb-pn-nachricht.is-own::after {
    display: none;
}
