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

.activity-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;
}

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

.activity-notifications__btn--active {
  color: #6ee7b7;
}

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

.activity-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;
}

.activity-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);
}

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

.activity-notifications__panel--mobile {
  position: fixed;
  z-index: 202;
  left: 50%;
  right: auto;
  width: min(18rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  max-height: min(20rem, 52vh);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

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

.activity-notifications__backdrop[hidden] {
  display: none;
}

.activity-notifications__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid #27272a;
  flex-shrink: 0;
}

.activity-notifications__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e4e4e7;
}

.activity-notifications__mark-read {
  font-size: 0.6875rem;
  color: #71717a;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.activity-notifications__mark-read:hover {
  color: #d4d4d8;
}

.activity-notifications__list {
  max-height: 18rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.activity-notifications__panel--mobile .activity-notifications__list {
  max-height: min(11rem, 32vh);
  flex: 0 1 auto;
  min-height: 0;
}

.activity-notifications__item {
  display: block;
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 0;
  border-bottom: 1px solid #27272a;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

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

.activity-notifications__item:hover {
  background: rgba(16, 185, 129, 0.08);
}

.activity-notifications__item--unread .activity-notifications__item-title {
  color: #6ee7b7;
}

.activity-notifications__item-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #d4d4d8;
  margin-bottom: 0.2rem;
}

.activity-notifications__item-message {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #a1a1aa;
  word-break: break-word;
}

.activity-notifications__empty {
  margin: 0;
  padding: 1rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #71717a;
  text-align: center;
}

.activity-notifications__list--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.activity-notifications__push {
  padding: 0.625rem 0.875rem 0.75rem;
  border-top: 1px solid #27272a;
  flex-shrink: 0;
}

.activity-notifications__push[hidden] {
  display: none;
  padding: 0;
  border-top: 0;
}

.activity-notifications__push-btn {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  border: 1px solid #3f3f46;
  background: #09090b;
  color: #d4d4d8;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.activity-notifications__push-btn:hover {
  border-color: #10b981;
  color: #6ee7b7;
}

.activity-notifications__push-note {
  margin-top: 0.4rem;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: #52525b;
}

.recent-keys-row--highlight {
  outline: 2px solid rgba(16, 185, 129, 0.75);
  outline-offset: -2px;
  background: rgba(16, 185, 129, 0.08) !important;
  animation: recent-run-highlight 2.4s ease-out;
}

@keyframes recent-run-highlight {
  0%, 40% { background: rgba(16, 185, 129, 0.14) !important; }
  100% { background: rgba(16, 185, 129, 0.08) !important; }
}

@media (max-width: 767px) {
  .activity-notifications__panel:not(.activity-notifications__panel--mobile) {
    right: 0;
    width: min(20rem, calc(100vw - 1rem));
  }
}