.app-shell__content--notifications {
  max-width: 375px;
  padding-top: 0;
  padding-left: max(var(--page-inline), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-inline), env(safe-area-inset-right, 0px));
  padding-bottom: calc(var(--tabbar-height) + 24px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
}

@media (max-width: 1279px) {
  .app-shell--notifications .app-shell__topbar {
    display: none;
  }

  .app-shell--notifications .app-shell__body {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

/* Figma TopNavigation: back + title, ~86px with status area */
.notifications__header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 72px;
  align-items: center;
  min-height: 60px;
  margin-inline: calc(-1 * var(--page-inline));
  padding: 0 8px;
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(12px);
  border-bottom: 0;
}

.notifications__back,
.notifications__mark-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: #737478;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.notifications__back {
  justify-self: start;
  border-radius: 12px;
}

.notifications__back:hover,
.notifications__back:focus-visible {
  color: #2c3038;
  background: #f5f6fa;
  outline: none;
}

.notifications__back:active {
  transform: scale(0.96);
}

.notifications__back-icon {
  display: block;
  width: 18px;
  height: 24px;
}

.notifications__title {
  margin: 0;
  color: #2c3038;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.notifications__mark-all {
  justify-self: end;
  width: auto;
  max-width: 72px;
  border-radius: 10px;
  color: #108b88;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.notifications__mark-all:hover:not(:disabled),
.notifications__mark-all:focus-visible:not(:disabled) {
  background: #deffef;
  outline: none;
}

.notifications__mark-all:disabled {
  opacity: 0.55;
  cursor: wait;
}

.notifications__mark-all[hidden] {
  display: none;
}

.notifications__tabs[hidden] {
  display: none;
}

.notifications__tabs {
  display: flex;
  gap: 4px;
  margin: 12px 16px 16px;
  padding: 3px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--color-section-bg);
  scrollbar-width: none;
  animation: notifications-fade-up 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notifications__tabs::-webkit-scrollbar {
  display: none;
}

.notifications__tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #737478;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 160ms ease;
}

.notifications__tab:hover:not(.is-active) {
  color: #2c3038;
  background: rgb(255 255 255 / 55%);
}

.notifications__tab:active {
  transform: scale(0.97);
}

.notifications__tab.is-active {
  background: #ffffff;
  color: var(--color-text);
  box-shadow: 0 1px 4px rgb(43 44 52 / 10%);
}

.notifications__list {
  padding: 8px 16px 20px;
  animation: notifications-fade-up 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notifications__list[hidden] {
  display: none;
}

.notifications__load-more {
  display: grid;
  place-items: center;
  padding: 12px 16px 8px;
  color: #737478;
  font-size: 13px;
  line-height: 1.3;
}

.notifications__load-more[hidden] {
  display: none;
}

.notifications__sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
}

.notifications__group + .notifications__group {
  margin-top: 24px;
}

.notifications__group-title {
  margin: 0 0 16px;
  color: #2c3038;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  animation: notifications-fade-up 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notifications__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Flat rows — no card borders/dividers between notifications (Figma). */
.notifications__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 0;
  margin: 0;
  border-radius: 0;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  box-shadow: none;
  opacity: 0;
  transform: translateY(10px);
  animation: notifications-item-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--notifications-item-delay, 0ms);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.notifications__item:hover {
  background: transparent;
}

.notifications__item:active {
  transform: scale(0.992);
  background: transparent;
}

.notifications__item:focus-visible {
  outline: 2px solid #108b88;
  outline-offset: 2px;
}

.notifications__item.is-new {
  animation: notifications-item-new 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notifications__item.is-read .notifications__name,
.notifications__item.is-read .notifications__message {
  color: #8a8d93;
}

.notifications__visual {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.notifications__type-icon {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 50%;
  background: #2dbe7b;
  box-shadow: 1px 1px 12px rgb(9 88 146 / 16%);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.notifications__item:hover .notifications__type-icon {
  transform: scale(1.06);
}

.notifications__type-icon img {
  display: block;
  width: 16px;
  height: 16px;
}

.notifications__item--changes .notifications__type-icon {
  background: linear-gradient(145deg, #3e8cf9 6%, #41eb9d 94%);
}

.notifications__item--comments .notifications__type-icon {
  background: radial-gradient(circle at 75% 25%, #8ee468 0%, #1fb5a8 100%);
}

.notifications__item--cancel .notifications__type-icon {
  background: #ec5b5b;
}

.notifications__item--registration .notifications__type-icon {
  background: #2dbe7b;
}

/* Small organizer avatar overlaps type icon (Figma) */
.notifications__avatar {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  overflow: hidden;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #dfe3ea;
  color: #2c3038;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}

.notifications__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notifications__avatar--photo {
  background: #ffffff;
  padding: 0;
  font-size: 0;
}

.notifications__copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.notifications__name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.notifications__unread {
  position: relative;
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 75% 25%, #8ee468 0%, #1fb5a8 100%);
}

.notifications__unread::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgb(16 139 136 / 28%);
  animation: notifications-pulse 1.8s ease-out infinite;
}

.notifications__item.is-read .notifications__unread {
  display: none;
}

.notifications__name {
  overflow: hidden;
  color: #108b88;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 180ms ease;
}

.notifications__message,
.notifications__time {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications__message {
  color: #737478;
  font-size: 14px;
  line-height: 1.3;
  transition: color 180ms ease;
}

.notifications__time {
  color: #737478;
  font-size: 13px;
  line-height: 1.3;
}

.notifications__media {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 8px;
  background: #e8eaef;
  transition: transform 200ms ease;
}

.notifications__item:hover .notifications__media {
  transform: scale(1.04);
}

.notifications__media[hidden] {
  display: none;
}

.notifications__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notifications__state {
  display: grid;
  min-height: 320px;
  padding: 64px 24px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #737478;
  text-align: center;
  animation: notifications-fade-up 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notifications__state[hidden] {
  display: none;
}

.notifications__state p {
  margin: 0;
  max-width: 260px;
  font-size: 14px;
  line-height: 1.45;
}

.notifications__state-icon {
  display: grid;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  place-items: center;
  background: linear-gradient(145deg, #deffef 0%, #e8f7ff 100%);
  color: #108b88;
  font-size: 24px;
  box-shadow: 0 8px 24px rgb(16 139 136 / 12%);
  animation: notifications-pop 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.notifications__state--error .notifications__state-icon {
  background: linear-gradient(145deg, #ffe8e8 0%, #fff4ef 100%);
  color: #e24c4c;
  box-shadow: 0 8px 24px rgb(226 76 76 / 10%);
}

.notifications__retry {
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #108b88;
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.notifications__retry:hover,
.notifications__retry:focus-visible {
  background: #0d7572;
  box-shadow: 0 6px 16px rgb(16 139 136 / 24%);
  outline: none;
}

.notifications__retry:active {
  transform: scale(0.97);
}

.notifications__skeleton {
  display: flex;
  padding: 8px 16px 20px;
  flex-direction: column;
  gap: 20px;
  animation: notifications-fade-up 240ms ease both;
}

.notifications__skeleton[hidden] {
  display: none;
}

.notifications__skeleton-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 0;
  padding: 3px;
  border-radius: 10px;
  background: var(--color-section-bg, #f5f6fa);
}

.notifications__skeleton-tab {
  flex: 0 0 auto;
  width: 58px;
  height: 30px;
  border-radius: 8px;
}

.notifications__skeleton-tab:first-child {
  width: 42px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgb(43 44 52 / 8%);
}

.notifications__skeleton-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notifications__skeleton-heading,
.notifications__skeleton-icon,
.notifications__skeleton-copy span,
.notifications__skeleton-media,
.notifications__skeleton-tab {
  border-radius: 7px;
  background: linear-gradient(90deg, #eceef2 18%, #f7f8fa 42%, #eceef2 68%);
  background-size: 220% 100%;
  animation: notifications-shimmer 1.35s ease-in-out infinite;
}

.notifications__skeleton-heading {
  width: 76px;
  height: 22px;
  margin-bottom: 8px;
}

.notifications__skeleton-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 58px;
  padding: 4px 0;
  opacity: 0;
  animation: notifications-fade-up 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--notifications-skel-delay, 0ms);
}

.notifications__skeleton-item:nth-child(2) {
  --notifications-skel-delay: 40ms;
}

.notifications__skeleton-item:nth-child(3) {
  --notifications-skel-delay: 80ms;
}

.notifications__skeleton-item:nth-child(4) {
  --notifications-skel-delay: 120ms;
}

.notifications__skeleton-item:nth-child(5) {
  --notifications-skel-delay: 160ms;
}

.notifications__skeleton-item:nth-child(6) {
  --notifications-skel-delay: 200ms;
}

.notifications__skeleton-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.notifications__skeleton-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}

.notifications__skeleton-copy span {
  width: 70%;
  height: 13px;
}

.notifications__skeleton-copy span:nth-child(2) {
  width: 92%;
}

.notifications__skeleton-copy span:nth-child(3) {
  width: 42%;
}

.notifications__skeleton-media {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.notifications__skeleton-item:nth-child(even) .notifications__skeleton-media {
  opacity: 0.35;
}

@keyframes notifications-shimmer {
  to {
    background-position: -220% 0;
  }
}

@keyframes notifications-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes notifications-item-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes notifications-item-new {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    background: #deffef;
  }

  55% {
    background: #f3fff8;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    background: transparent;
  }
}

@keyframes notifications-pop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes notifications-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }

  70% {
    transform: scale(1.7);
    opacity: 0;
  }

  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

@media (min-width: 768px) {
  .app-shell__content--notifications {
    max-width: 768px;
    min-height: 100vh;
    margin: 0;
  }

  .notifications__header {
    grid-template-columns: 130px minmax(0, 1fr) 130px;
    min-height: 64px;
    padding-top: 12px;
  }

  .notifications__list,
  .notifications__skeleton,
  .notifications__state,
  .notifications__tabs,
  .notifications__load-more,
  .notifications__sentinel {
    width: 375px;
    margin-right: auto;
    margin-left: auto;
  }

  .notifications__tabs {
    margin-top: 12px;
    margin-bottom: 16px;
  }
}

@media (min-width: 1280px) {
  .app-shell__content--notifications {
    max-width: 502px;
    min-height: calc(100vh - 84px);
    margin: 0 auto;
    padding: 0 0 40px;
    border-radius: 20px 20px 0 0;
    background: #ffffff;
  }

  .notifications__header {
    position: static;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    min-height: 60px;
    padding: 0 8px;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    backdrop-filter: none;
    background: #ffffff;
  }

  .notifications__list,
  .notifications__skeleton,
  .notifications__state,
  .notifications__tabs,
  .notifications__load-more,
  .notifications__sentinel {
    width: 400px;
    margin-right: auto;
    margin-left: auto;
  }

  .notifications__list,
  .notifications__skeleton {
    box-sizing: border-box;
    padding-right: 0;
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notifications__skeleton-heading,
  .notifications__skeleton-icon,
  .notifications__skeleton-copy span,
  .notifications__skeleton-media,
  .notifications__skeleton-tab,
  .notifications__unread::after,
  .notifications__item,
  .notifications__item.is-new,
  .notifications__list,
  .notifications__tabs,
  .notifications__state,
  .notifications__state-icon,
  .notifications__group-title,
  .notifications__skeleton,
  .notifications__skeleton-item {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .notifications__back,
  .notifications__mark-all,
  .notifications__tab,
  .notifications__item,
  .notifications__type-icon,
  .notifications__media,
  .notifications__retry {
    transition: none;
  }
}
