.family-moments-hero {
  overflow: hidden;
  margin: 0 0 14px;
  padding: 18px;
  color: #fff;
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 92% 8%,
      rgba(255, 255, 255, 0.2),
      transparent 34%
    ),
    linear-gradient(135deg, #7c3aed 0%, #db2777 58%, #f59e0b 130%);
  box-shadow: 0 18px 36px rgba(124, 58, 237, 0.18);
}

.family-moments-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.family-moments-heading > .material-symbols-outlined {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 25px;
}

.family-moments-overline {
  display: block;
  margin-bottom: 2px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.82;
}

.family-moments-heading h3,
.family-moments-heading p {
  margin: 0;
}

.family-moments-heading h3 {
  font-size: 1.22rem;
  line-height: 1.25;
}

.family-moments-heading p {
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.4;
  opacity: 0.88;
}

.family-moment-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.family-moment-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 6px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.13);
}

.family-moment-stat .material-symbols-outlined {
  grid-row: 1 / 3;
  align-self: center;
  font-size: 18px;
}

.family-moment-stat strong {
  font-size: 1rem;
  line-height: 1;
}

.family-moment-stat span:last-child {
  overflow: hidden;
  font-size: 0.66rem;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.family-moments-events h4 {
  margin: 16px 4px 8px;
  color: #334155;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-moment-event {
  display: grid;
  width: 100%;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 10px 4px;
  color: #1e293b;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.family-moment-event:hover {
  background: #f8fafc;
}

.family-moment-event.is-today {
  margin: 4px 0;
  padding: 11px 9px;
  border: 1px solid #f9a8d4;
  border-radius: 13px;
  background: linear-gradient(90deg, #fdf2f8, #fff7ed);
}

.family-moment-event-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: #9d174d;
  background: #fce7f3;
}

.family-moment-event.is-anniversary .family-moment-event-icon {
  color: #be123c;
  background: #ffe4e6;
}

.family-moment-event.is-remembrance .family-moment-event-icon {
  color: #475569;
  background: #e2e8f0;
}

.family-moment-event-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.family-moment-event-copy strong {
  overflow: hidden;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-moment-event-copy > span {
  color: #64748b;
  font-size: 0.73rem;
}

.family-moment-event-arrow {
  color: #94a3b8;
  font-size: 19px;
}

.family-moments-no-events,
.family-moments-empty {
  color: #64748b;
  text-align: center;
}

.family-moments-no-events {
  padding: 26px 12px;
}

.family-moments-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 38px 20px;
}

.family-moments-empty .material-symbols-outlined {
  font-size: 36px;
}

.family-moments-empty p {
  max-width: 32ch;
  margin: 0;
}

.tree-person-card.family-birthday-today {
  filter: drop-shadow(0 0 9px rgba(250, 204, 21, 0.92))
    drop-shadow(0 0 18px rgba(253, 224, 71, 0.5));
}

.tree-person-card.family-birthday-upcoming {
  filter: drop-shadow(0 0 7px rgba(234, 179, 8, 0.62));
}

.tree-family-birthday-badge {
  pointer-events: none;
}

.tree-family-birthday-badge rect {
  fill: #eab308;
  stroke: #fff;
  stroke-width: 2px;
  filter: drop-shadow(0 5px 8px rgba(234, 179, 8, 0.32));
}

.family-birthday-upcoming .tree-family-birthday-badge rect {
  fill: #ca8a04;
}

.tree-family-birthday-icon {
  font-size: 14px;
}

.tree-family-birthday-label {
  fill: #fff;
  font-family: Inter, sans-serif;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.family-birthday-chip {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 5;
  display: inline-flex;
  min-width: 31px;
  height: 31px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 7px;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #eab308, #facc15);
  box-shadow: 0 8px 18px rgba(234, 179, 8, 0.32);
}

.family-birthday-chip .material-symbols-outlined {
  font-size: 17px;
}

.family-birthday-chip-label {
  font-size: 0.64rem;
  font-weight: 800;
}

.family-member-item.family-birthday-today,
.family-member-item.family-birthday-upcoming {
  position: relative;
  padding-right: 46px;
  border: 1px solid rgba(234, 179, 8, 0.32);
  background: linear-gradient(90deg, rgba(254, 249, 195, 0.9), #fff);
  box-shadow: 0 8px 20px rgba(234, 179, 8, 0.09);
}

.family-member-item.family-birthday-upcoming {
  border-color: rgba(202, 138, 4, 0.26);
  background: linear-gradient(90deg, rgba(254, 252, 232, 0.9), #fff);
}

.family-member-item > .family-birthday-chip {
  top: 8px;
  right: 8px;
}

.family-moments-popover .popover-arrow {
  top: auto;
  right: auto;
  bottom: -8px;
  left: var(--family-moments-arrow-left, 24px);
  border-top: 8px solid #fff;
  border-bottom: 0;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.05));
}

.family-moments-popover .family-moments-list {
  padding-top: 4px;
}

@media (max-width: 600px) {
  .family-moments-hero {
    padding: 15px;
    border-radius: 15px;
  }

  .family-moment-stats {
    gap: 5px;
  }

  .family-moment-stat {
    column-gap: 4px;
    padding: 8px 6px;
  }

  .family-moment-stat .material-symbols-outlined {
    font-size: 16px;
  }

  .family-moment-stat span:last-child {
    font-size: 0.6rem;
  }

  .family-moment-event-copy strong {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .family-birthday-today .tree-family-birthday-badge rect,
  .profile-avatar-container.family-birthday-today .family-birthday-chip {
    animation: family-birthday-pulse 2.2s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
  }
}

@keyframes family-birthday-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}
