.user-notification-wrap {
  position: relative;
}

.user-notification-wrap.hidden,
.user-notification-panel.hidden {
  display: none;
}

.user-notification-wrap:not(.hidden) {
  display: inline-flex;
}

.user-notification-button {
  position: relative;
}

.user-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--app-panel-solid);
  border-radius: 999px;
  padding: 0 4px;
  color: #fff;
  background: #ef4444;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(239, 68, 68, .28);
}

.user-notification-badge.hidden {
  display: none;
}

.user-notification-panel {
  position: absolute;
  z-index: 8200;
  top: calc(100% + 10px);
  right: 0;
  width: min(390px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  color: var(--app-text);
  background: var(--app-panel-solid);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.user-notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--app-border);
  padding: 15px 16px 13px;
  background: linear-gradient(135deg, rgba(49, 89, 217, .08), rgba(19, 155, 140, .06));
}

.user-notification-head div {
  min-width: 0;
}

.user-notification-head b,
.user-notification-head small {
  display: block;
}

.user-notification-head b {
  font-size: 14px;
}

.user-notification-head small {
  margin-top: 2px;
  color: var(--app-muted);
  font-size: 10px;
}

.user-notification-read-all {
  flex: 0 0 auto;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 10px;
  font-weight: 850;
}

.user-notification-list {
  max-height: min(420px, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.user-notification-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  border: 0;
  border-bottom: 1px solid var(--app-border);
  padding: 13px 16px;
  color: var(--app-text);
  background: transparent;
  text-align: left;
}

.user-notification-item:hover {
  background: var(--app-panel-soft);
}

.user-notification-item-unread {
  background: rgba(var(--primary-rgb), .055);
}

.user-notification-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #d97706;
  background: #fff4d6;
}

.user-notification-copy {
  min-width: 0;
}

.user-notification-copy b,
.user-notification-copy p,
.user-notification-copy time {
  display: block;
}

.user-notification-copy b {
  padding-right: 12px;
  font-size: 12px;
  line-height: 1.4;
}

.user-notification-copy p {
  margin: 4px 0 0;
  color: var(--app-muted);
  font-size: 11px;
  line-height: 1.55;
}

.user-notification-copy time {
  margin-top: 6px;
  color: var(--app-muted-2);
  font-size: 9px;
  font-weight: 700;
}

.user-notification-unread-dot {
  position: absolute;
  top: 17px;
  right: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .1);
}

.user-notification-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 36px 20px;
  color: var(--app-muted);
  text-align: center;
}

.user-notification-empty svg {
  width: 28px;
  height: 28px;
  color: var(--app-muted-2);
}

.user-notification-empty b {
  color: var(--app-text);
  font-size: 12px;
}

.user-notification-empty span {
  font-size: 10px;
}

html.dark .user-notification-icon {
  color: #fbbf24;
  background: rgba(146, 64, 14, .3);
}

@media (max-width: 620px) {
  .user-notification-panel {
    position: fixed;
    top: 76px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 88px);
  }

  .user-notification-list {
    max-height: calc(100dvh - 170px);
  }
}
