.notif-panel {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(484px, calc(100vw - 32px));
  max-height: calc(100vh - var(--header-h) - 32px);
  pointer-events: auto;
}

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

.notif-panel__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-bottom: 8px;
}

.notif-group {
  position: relative;
  margin-bottom: 10px;
}

.notif-group::before,
.notif-group::after {
  content: "";
  position: absolute;
  height: 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(12, 17, 20, 0.06);
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.28s ease;
}

.notif-group::before {
  left: 8px;
  right: 8px;
  bottom: -6px;
  z-index: 0;
}

.notif-group::after {
  left: 16px;
  right: 16px;
  bottom: -11px;
  z-index: -1;
}

.notif-group.is-open {
  margin-bottom: 0;
}

.notif-group.is-open::before {
  transform: translateY(22px);
  opacity: 0;
}

.notif-group.is-open::after {
  transform: translateY(34px);
  opacity: 0;
}

.notif-group__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.notif-group.is-open .notif-group__body {
  grid-template-rows: 1fr;
}

.notif-group__body-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-group__body .notif-card {
  margin-top: 0;
  opacity: 0;
  transform: translateY(-36px) scale(0.98);
  transition:
    transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.3s ease;
}

.notif-group__body .notif-card:first-child {
  margin-top: 8px;
}

.notif-group.is-open .notif-group__body .notif-card {
  opacity: 1;
  transform: none;
}

.notif-group.is-open .notif-group__body .notif-card:nth-child(2) {
  transition-delay: 50ms;
}

.notif-group.is-open .notif-group__body .notif-card:nth-child(3) {
  transition-delay: 100ms;
}

.notif-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(12, 17, 20, 0.06);
}

.notif-card--group {
  min-height: 98px;
}

.notif-icon {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-100);
}

.notif-icon img {
  width: 20px;
  height: 20px;
}

.notif-card__copy {
  flex: 1;
  min-width: 0;
}

.notif-card__title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.notif-card__lead {
  color: var(--brand);
}

.notif-card--group .notif-card__title {
  color: var(--ink);
  font-weight: 400;
}

.notif-card__time {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.notif-card__close {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.notif-card__close img {
  width: 24px;
  height: 24px;
}

.notif-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  align-self: center;
}

.notif-more img {
  width: 16px;
  height: 16px;
  transition: transform 0.32s ease;
}

.notif-group.is-open .notif-more img {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .notif-group::before,
  .notif-group::after,
  .notif-group__body,
  .notif-group__body .notif-card,
  .notif-more img {
    transition: none;
  }
}

.notif-panel__foot {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.notif-see-all {
  height: 48px;
  padding: 0 24px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--white);
  color: var(--brand);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.notif-see-all:hover {
  background: var(--brand-100);
}

.page.is-notifications .page__top {
  display: none;
}

.page.is-notifications .page-body {
  margin-top: 0;
}

.nc {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.nc__title {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.nc__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.nc__label {
  margin: 0;
  padding: 6px 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.nc__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.nc .notif-card,
.nc .notif-group {
  width: 100%;
}

.nc .notif-card {
  box-shadow:
    0 0 4.5px rgba(82, 94, 109, 0.2),
    0 0 1px rgba(82, 94, 109, 0.25);
}

.nc .notif-card__lead,
.nc .notif-card--group .notif-card__title {
  font-weight: 500;
}

.notif-icon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.notif-unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.notif-card__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  align-self: stretch;
  gap: 8px;
  flex: 0 0 auto;
}

.notif-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.notif-menu img {
  display: block;
  width: 24px;
  height: 24px;
}

.notif-menu:hover {
  background: var(--grey-200);
}
