.user-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.notification-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-menu-button {
  position: relative;
  width: 40px;
  height: 40px;
}

.notification-menu-button .material-symbols-outlined {
  color: currentColor;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 var(--space-1);
  border-radius: 999px;
  border: 1px solid var(--surface-3);
  background: var(--primary-dark);
  color: var(--surface-0);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

.notification-panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 1200;
  width: min(360px, calc(100vw - 2rem));
  max-height: 440px;
  overflow: hidden;
  border: var(--border-dark);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: var(--border-dark);
  color: var(--grey-50);
}

.notification-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.notification-mark-read {
  font-size: 0.8rem;
}

.notification-clear-read {
  font-size: 0.8rem;
}

.notification-list {
  max-height: 360px;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: var(--border-dark);
}

.notification-item-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
  color: var(--grey-300);
  text-decoration: none;
}

.notification-item:hover {
  background: var(--surface-3);
}

.notification-item-link:focus-visible,
.notification-item-read:focus-visible {
  outline: none;
}

.notification-item-read {
  width: 28px;
  height: 28px;
}

.notification-item-read-spacer {
  width: 28px;
  height: 28px;
}

.notification-item[data-read="false"] strong {
  color: var(--grey-50);
}

.notification-item .material-symbols-outlined {
  color: var(--primary-100);
}

.notification-item-read .material-symbols-outlined {
  color: var(--success);
  font-size: 1rem;
}

.notification-item strong,
.notification-item small {
  display: block;
}

.notification-item small,
.notification-empty {
  color: var(--grey-600);
  font-size: 0.82rem;
}

.notification-empty {
  margin: 0;
  padding: var(--space-4);
}

.notification-toast-container {
  position: fixed;
  top: var(--space-10);
  right: var(--space-4);
  z-index: 2147483000;
  display: grid;
  gap: var(--space-2);
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.notification-toast {
  --notification-toast-accent: var(--action-blue);
  --notification-toast-bg: color-mix(in srgb, var(--surface-5) 86%, var(--action-blue));

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--notification-toast-accent) 42%, var(--surface-7));
  border-left: 4px solid var(--notification-toast-accent);
  border-radius: var(--radius-md);
  background: var(--notification-toast-bg);
  box-shadow: var(--shadow-lg);
  color: var(--grey-50);
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(calc(100% + var(--space-4)));
  animation: notification-toast-slide-in 220ms ease-out forwards;
}

.notification-toast.is-leaving {
  animation: notification-toast-slide-out 200ms ease-in forwards;
}

.notification-toast>.material-symbols-outlined {
  color: var(--notification-toast-accent);
}

.notification-toast-copy {
  min-width: 0;
}

.notification-toast-copy strong,
.notification-toast-copy p {
  margin: 0;
}

.notification-toast-copy strong {
  display: block;
  color: var(--grey-50);
  font-size: 0.9rem;
}

.notification-toast-copy p {
  margin-top: var(--space-1);
  color: var(--grey-50);
  font-size: 0.85rem;
  line-height: 1.35;
}

.notification-toast-task-assigned {
  --notification-toast-accent: var(--action-blue);
  --notification-toast-bg: color-mix(in srgb, var(--surface-5) 82%, var(--action-blue));
}

.notification-toast-task-updated,
.notification-toast-task-due {
  --notification-toast-accent: var(--primary-dark);
  --notification-toast-bg: color-mix(in srgb, var(--surface-5) 82%, var(--grey-50));
}

.notification-toast-task-upcoming {
  --notification-toast-accent: var(--pending);
  --notification-toast-bg: color-mix(in srgb, var(--surface-5) 82%, var(--pending));
}

.notification-toast-task-completed {
  --notification-toast-accent: var(--success);
  --notification-toast-bg: color-mix(in srgb, var(--surface-5) 82%, var(--success));
}

.notification-toast-task-deleted,
.notification-toast-task-overdue {
  --notification-toast-accent: var(--danger);
  --notification-toast-bg: color-mix(in srgb, var(--surface-5) 82%, var(--danger));
}

.notification-toast-close {
  width: 28px;
  height: 28px;
}

.notification-toast-close .material-symbols-outlined {
  font-size: 1rem;
}

@keyframes notification-toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(calc(100% + var(--space-4)));
  }

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

@keyframes notification-toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(calc(100% + var(--space-4)));
  }
}
