/* coreX Messages Nav-Umschlag — self-contained, theme-unabhaengig */
.cx-msgnav { position: relative; display: inline-flex; }

.cx-msgnav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 8px;
  color: inherit;               /* Icon erbt die Menueleisten-Farbe */
  text-decoration: none;
  transition: background-color .15s ease;
}
.cx-msgnav-btn:hover,
.cx-msgnav-btn:focus-visible { background-color: rgba(127,127,127,.14); }
.cx-msgnav-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.cx-msgnav-icon { font-size: 18px; line-height: 1; }

.cx-msgnav-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: #e5484d; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255,255,255,.85);   /* Abgrenzung gegen Icon */
  pointer-events: none;
}
.cx-msgnav-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.cx-msgnav-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; max-width: 90vw;
  background: #fff; color: #1f2328;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  z-index: 1080;
  overflow: hidden;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}
.cx-msgnav-panel.is-open { opacity: 1; transform: translateY(0); }
.cx-msgnav-panel[hidden] { display: none; }

.cx-msgnav-panel-head {
  padding: 10px 14px; font-weight: 600; font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.cx-msgnav-panel-body { max-height: 360px; overflow-y: auto; }
.cx-msgnav-loading { padding: 16px 14px; font-size: 13px; color: #6b7280; }

.cx-msgnav-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,.05);
  text-decoration: none; color: inherit;
}
.cx-msgnav-item:hover,
.cx-msgnav-item:focus-visible { background: rgba(0,0,0,.04); }
.cx-msgnav-item.is-unread { background: rgba(37,99,235,.06); }
.cx-msgnav-item.is-unread .cx-msgnav-item-sender { font-weight: 700; }
.cx-msgnav-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cx-msgnav-item-sender { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-msgnav-item-date { font-size: 11px; color: #6b7280; flex: 0 0 auto; }
.cx-msgnav-item-title { font-size: 12.5px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cx-msgnav-empty { padding: 22px 14px; text-align: center; font-size: 13px; color: #6b7280; }
.cx-msgnav-panel-foot {
  display: block; padding: 10px 14px; text-align: center;
  font-size: 13px; font-weight: 600; color: #2563eb; text-decoration: none;
  border-top: 1px solid rgba(0,0,0,.08);
}
.cx-msgnav-panel-foot:hover { background: rgba(37,99,235,.06); }

@media (prefers-color-scheme: dark) {
  .cx-msgnav-panel { background: #1f232b; color: #e6e6e6; border-color: rgba(255,255,255,.12); }
  .cx-msgnav-panel-head { border-bottom-color: rgba(255,255,255,.08); }
  .cx-msgnav-item { border-bottom-color: rgba(255,255,255,.06); }
  .cx-msgnav-item:hover { background: rgba(255,255,255,.06); }
  .cx-msgnav-item-title { color: #c4c9d0; }
  .cx-msgnav-item-date, .cx-msgnav-empty, .cx-msgnav-loading { color: #9aa2ac; }
  .cx-msgnav-panel-foot { border-top-color: rgba(255,255,255,.08); }
  .cx-msgnav-badge { box-shadow: 0 0 0 2px rgba(31,35,43,.9); }
}
@media (prefers-reduced-motion: reduce) {
  .cx-msgnav-btn, .cx-msgnav-panel { transition: none; }
}
