.notification-center {
  position: relative;
}

.topbar__account-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar__account-controls #viewAsOpen[hidden] {
  display: none !important;
}

.notification-bell {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--surface2);
  color: var(--txt);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.notification-bell:hover {
  border-color: var(--accent);
  background: rgba(0, 113, 227, .13);
}

.notification-bell:active {
  transform: scale(.96);
}

.notification-bell:focus-visible,
.notification-center-panel button:focus-visible {
  outline: 2px solid #78baff;
  outline-offset: 2px;
}

.notification-bell svg {
  width: 22px;
  height: 22px;
}

.notification-bell__count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #101820;
  border-radius: 999px;
  background: #f04452;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.notification-bell__count[hidden] {
  display: none;
}

.notification-center-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 300;
  display: flex;
  width: min(440px, calc(100vw - 28px));
  max-height: min(680px, calc(100dvh - 100px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border2);
  border-radius: 18px;
  background: #111b29;
  color: var(--txt);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

.notification-center-panel[hidden] {
  display: none;
}

.notification-center-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 14px;
  border-bottom: 1px solid var(--border2);
}

.notification-center-panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 10px;
}

.notification-center-panel__header h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.notification-center-panel__header span {
  color: var(--txt3);
  font-size: 12px;
}

.notification-center-panel__mark-all,
.notification-center-panel__delete-all,
.notification-center-panel__more {
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: #91c6ff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.notification-center-panel__delete-all {
  color: #ff9a9a;
}

.notification-center-panel__mark-all[hidden],
.notification-center-panel__delete-all[hidden],
.notification-center-panel__more[hidden] {
  display: none;
}

.notification-center-panel__list {
  display: grid;
  flex: 1;
  min-height: 100px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-item {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.notification-item-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.notification-item-wrap--unread {
  background: rgba(56, 132, 237, .09);
}

.notification-item-wrap .notification-item {
  flex: 1;
  min-width: 0;
  border-bottom: 0;
  padding-right: 8px;
}

.notification-item:hover {
  background: rgba(255, 255, 255, .045);
}

.notification-item--unread {
  background: rgba(56, 132, 237, .09);
}

.notification-item__delete {
  align-self: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin: 0 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--txt3);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.notification-item__delete:hover {
  border-color: rgba(255, 90, 90, .28);
  background: rgba(255, 69, 58, .12);
  color: #ff7777;
}

.notification-item__icon {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: rgba(100, 160, 240, .13);
  font-size: 17px;
}

.notification-item__content {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 4px;
}

.notification-item__content strong {
  font-size: 13px;
  line-height: 1.4;
}

.notification-item__content > span {
  color: var(--txt2);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.notification-item__content time {
  margin-top: 2px;
  color: var(--txt3);
  font-size: 10px;
}

.notification-item__dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: #63adff;
}

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

.notification-center-empty > span {
  font-size: 26px;
}

.notification-center-empty p {
  max-width: 280px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.notification-center-panel__error {
  margin: 0;
  padding: 12px 16px;
  color: var(--bad);
  font-size: 12px;
}

.notification-center-panel__error[hidden] {
  display: none;
}

.notification-center-panel__more {
  padding: 13px;
  border-top: 1px solid var(--border2);
}

@media (max-width: 760px) {
  .notification-bell {
    width: 38px;
    height: 38px;
    padding: 7px;
  }

  .notification-center-panel {
    position: fixed;
    top: 62px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: min(72dvh, 620px);
    border-radius: 16px;
  }

  .notification-center-panel__header {
    gap: 10px;
    padding: 15px 14px 12px;
  }

  .notification-center-panel__actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 5px;
  }

  .notification-center-panel__mark-all,
  .notification-center-panel__delete-all {
    padding: 5px 2px;
    text-align: right;
  }
}
