.pm-notifications-mount {
  display: inline-flex;
  align-items: center;
}

.pm-notifications {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pm-notifications__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pm-notifications__btn:hover,
.pm-notifications__btn[aria-expanded="true"] {
  color: #fff;
  border-color: #3f3f46;
  background: rgba(39, 39, 42, 0.65);
}

.pm-notifications__btn--active {
  color: #93c5fd;
}

.pm-notifications__btn--open {
  position: relative;
  z-index: 201;
  color: #fff;
  border-color: #3f3f46;
  background: rgba(39, 39, 42, 0.65);
}

.pm-notifications__badge {
  position: absolute;
  top: -2px;
  left: -2px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 9999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px #0a0a0a;
}

.pm-notifications__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  width: min(20rem, calc(100vw - 2rem));
  border: 1px solid #3f3f46;
  background: #18181b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.pm-notifications__panel[hidden] {
  display: none !important;
}

.pm-notifications__panel--mobile {
  position: fixed;
  z-index: 202;
  /* Full-screen messages sheet on mobile */
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100dvh;
  max-height: 100dvh;
  transform: none !important;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pm-notifications__panel--mobile .pm-notifications__list {
  max-height: none;
  flex: 1;
  min-height: 0;
}
.pm-notifications__panel--mobile .pm-notifications__search {
  /* Prevent iOS auto-zoom on focus */
  font-size: 16px;
}

.pm-notifications__backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.pm-notifications__backdrop[hidden] {
  display: none !important;
}

html.pm-notifications-open {
  overflow: hidden;
}

.pm-notifications__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #27272a;
}

/* Same framed style as conversation close (pm-modal__icon-btn) */
.pm-notifications__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: auto;
  padding: 0;
  border: 1px solid #3f3f46;
  border-radius: 0;
  background: rgba(9, 9, 11, 0.9);
  color: #a1a1aa;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}
.pm-notifications__close i {
  font-size: 0.75rem;
  line-height: 1;
}
.pm-notifications__close:hover {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.08);
  color: #6ee7b7;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.18);
}
.pm-notifications__close:focus-visible {
  outline: 2px solid rgba(52, 211, 153, 0.45);
  outline-offset: 2px;
}
@media (max-width: 639px) {
  .pm-notifications__close {
    width: 2rem;
    height: 2rem;
  }
}

.pm-notifications__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pm-notifications__back:hover {
  color: #fff;
  border-color: #3f3f46;
  background: rgba(39, 39, 42, 0.65);
}

.pm-notifications__back[hidden] {
  display: none !important;
}

.pm-notifications__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a1a1aa;
  min-width: 0;
  flex: 1;
}

.pm-notifications__search-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #27272a;
  background: rgba(9, 9, 11, 0.45);
}

.pm-notifications__search-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  flex-shrink: 0;
}

.pm-notifications__search-label i {
  font-size: 0.75rem;
}

.pm-notifications__search {
  flex: 1;
  min-width: 0;
  border: 1px solid #3f3f46;
  background: #09090b;
  color: #e4e4e7;
  font-size: 1rem; /* ≥16px — no mobile zoom; desktop override below */
  line-height: 1.3;
  padding: 0.35rem 0.5rem;
  border-radius: 0;
  outline: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Password-style masking when entering the personal unlock code (not in archive mode) */
.pm-notifications__search[data-pm-pin-mask="1"] {
  -webkit-text-security: disc;
  text-security: disc;
  font-family: text-security-disc, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
}
@media (min-width: 640px) {
  .pm-notifications__search {
    font-size: 0.8125rem;
  }
}

.pm-notifications__search::placeholder {
  color: #71717a;
}

.pm-notifications__search:focus {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.18);
}

.pm-notifications__search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 0.7rem;
  width: 0.7rem;
  background: #71717a;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M3.5 3.5l9 9m0-9l-9 9' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M3.5 3.5l9 9m0-9l-9 9' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
  cursor: pointer;
}

.pm-notifications .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pm-notifications__list {
  max-height: 14rem;
  overflow-y: auto;
}

.pm-notifications__list--empty {
  padding: 0.85rem;
}

.pm-notifications__empty {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #71717a;
}

.pm-notifications__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-bottom: 1px solid #27272a;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pm-notifications__item--unread {
  background: rgba(59, 130, 246, 0.06);
}

.pm-notifications__item-head {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.pm-notifications__item-unread {
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: #60a5fa;
}

.pm-notifications__item:last-child {
  border-bottom: 0;
}

.pm-notifications__item:hover {
  background: rgba(39, 39, 42, 0.65);
}

.pm-notifications__item-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e4e4e7;
}
.pm-notifications__item-title--name {
  color: #e4e4e7;
}

.pm-notifications__item-message {
  font-size: 0.75rem;
  line-height: 1.4;
  color: #a1a1aa;
}